【订单详情】

1. 配送信息
pull/1/MERGE
YunaiV 2023-07-02 12:54:57 +08:00
parent 00ed94c762
commit be43aaafd8
3 changed files with 100 additions and 99 deletions

View File

@ -9,3 +9,10 @@ export function getDeliveryConfig() {
export function getDeliveryPickUpStoreList(data) { export function getDeliveryPickUpStoreList(data) {
return request.get("app-api/trade/delivery/pick-up-store/list", data); return request.get("app-api/trade/delivery/pick-up-store/list", data);
} }
// 获得自提门店
export function getDeliveryPickUpStore(id) {
return request.get("app-api/trade/delivery/pick-up-store/get", {
id
});
}

View File

@ -32,6 +32,10 @@ export function getOrderPage(data) {
return request.get("app-api/trade/order/page", data); return request.get("app-api/trade/order/page", data);
} }
export function takeOrder(id) {
return request.put("app-api/trade/order/take?id=" + id, {});
}
export function cancelOrder(id) { export function cancelOrder(id) {
return request.delete("app-api/trade/order/cancel?id=" + id, {}); return request.delete("app-api/trade/order/cancel?id=" + id, {});
} }

View File

@ -67,7 +67,7 @@
</view> </view>
<!-- TODO 芋艿核销的情况 --> <!-- TODO 芋艿核销的情况 -->
<view v-if="orderInfo.shippingType == 2 && orderInfo.paid" class="writeOff borRadius14"> <view v-if="orderInfo.deliveryType === 2 && orderInfo.payStatus" class="writeOff borRadius14">
<view class="title">核销信息</view> <view class="title">核销信息</view>
<view class="grayBg"> <view class="grayBg">
<view class="pictrue"> <view class="pictrue">
@ -79,11 +79,11 @@
<view class="gear"> <view class="gear">
<image src="../../static/images/writeOff.jpg"></image> <image src="../../static/images/writeOff.jpg"></image>
</view> </view>
<view class="num">{{orderInfo.verifyCode}}</view> <view class="num">{{ orderInfo.verifyCode }}</view>
<view class="rules" v-if='orderInfo.systemStore'> <view class="rules" v-if='system_store.id'>
<view class="item"> <view class="item">
<view class="rulesTitle acea-row row-middle"> <view class="rulesTitle acea-row row-middle">
<text class="iconfont icon-shijian"></text>核销时间 <text class="iconfont icon-shijian" />核销时间
</view> </view>
<view class="info"> <view class="info">
每日<text class="time">{{orderInfo.systemStore.dayTime.replace(',','-')}}</text> 每日<text class="time">{{orderInfo.systemStore.dayTime.replace(',','-')}}</text>
@ -97,27 +97,27 @@
</view> </view>
</view> </view>
</view> </view>
<view v-if="orderInfo.shippingType == 2" class="map acea-row row-between-wrapper borRadius14"> <view v-if="orderInfo.deliveryType === 2" class="map acea-row row-between-wrapper borRadius14">
<view>自提地址信息</view> <view>自提地址信息</view>
<view class="place cart-color acea-row row-center-wrapper" @tap="showMaoLocation"> <view class="place cart-color acea-row row-center-wrapper" @tap="showMaoLocation">
<text class="iconfont icon-weizhi"></text>查看位置 <text class="iconfont icon-weizhi" />查看位置
</view> </view>
</view> </view>
<!-- 收货人信息 --> <!-- 收货人信息 -->
<view v-if="orderInfo.deliveryType === 1" class='address borRadius14'> <view v-if="orderInfo.pickUpStoreId > 0" class='address' style="margin-top:15rpx;">
<view class='name' @tap="makePhone">{{ system_store.name }}
<text class='phone'>{{ system_store.phone }}</text>
<text class="iconfont icon-tonghua font-color" />
</view>
<view>{{ system_store.areaName }} {{ system_store.detailAddress }}</view>
</view>
<view v-else class='address borRadius14'>
<view class='name'>{{ orderInfo.receiverName }} <view class='name'>{{ orderInfo.receiverName }}
<text class='phone'>{{ orderInfo.receiverMobile }}</text> <text class='phone'>{{ orderInfo.receiverMobile }}</text>
</view> </view>
<view>{{ orderInfo.receiverAreaName }} {{ orderInfo.receiverDetailAddress}}</view> <view>{{ orderInfo.receiverAreaName }} {{ orderInfo.receiverDetailAddress}}</view>
</view> </view>
<!-- TODO 芋艿核销的情况 -->
<view v-else class='address' style="margin-top:15rpx;">
<view class='name' @tap="makePhone">{{orderInfo.systemStore?orderInfo.systemStore.name:''}}<text
class='phone'>{{orderInfo.systemStore?orderInfo.systemStore.phone:''}}</text><text
class="iconfont icon-tonghua font-color"></text></view>
<view>{{orderInfo.systemStore?orderInfo.systemStore.detailedAddress:''}}</view>
</view>
<!-- 商品列表 --> <!-- 商品列表 -->
<orderGoods <orderGoods
@ -201,38 +201,30 @@
</view> </view>
</view> </view>
<!-- TODO 芋艿快递相关 --> <!-- 配送信息 -->
<view v-if="orderInfo.status !== 0"> <view v-if="orderInfo.status !== 0">
<view class='wrapper borRadius14' v-if='orderInfo.deliveryType === 1'> <view class='wrapper borRadius14' v-if='orderInfo.deliveryType === 1'>
<view class='item acea-row row-between'> <view class='item acea-row row-between'>
<view>配送方式</view> <view>配送方式</view>
<view class='conter'>发货</view> <view class='conter'>发货</view>
</view> </view>
<!-- TODO 芋艿这里的字段对应 -->
<view class='item acea-row row-between'> <view class='item acea-row row-between'>
<view>快递公司</view> <view>快递公司</view>
<view class='conter'>{{orderInfo.deliveryName || ''}}</view> <view class='conter'>{{ orderInfo.deliveryName || ''}}</view>
</view> </view>
<view class='item acea-row row-between'> <view class='item acea-row row-between'>
<view>快递号</view> <view>快递号</view>
<view class='conter'>{{orderInfo.deliveryId || ''}}</view> <view class='conter'>{{ orderInfo.deliveryId || ''}}</view>
</view> </view>
</view> </view>
<view class='wrapper borRadius14' v-else-if='orderInfo.deliveryType=="send"'> <view class='wrapper borRadius14' v-else-if='orderInfo.deliveryType === 2'>
<view class='item acea-row row-between'> <view class='item acea-row row-between'>
<view>配送方式</view> <view>配送方式</view>
<view class='conter'>送货</view> <view class='conter'>门店自提</view>
</view>
<view class='item acea-row row-between'>
<view>配送人姓名</view>
<view class='conter'>{{orderInfo.deliveryName || ''}}</view>
</view>
<view class='item acea-row row-between'>
<view>联系电话</view>
<view class='conter acea-row row-middle row-right'>{{orderInfo.deliveryId || ''}}<text
class='copy' @tap='goTel'>拨打</text></view>
</view> </view>
</view> </view>
<view class='wrapper borRadius14' v-else-if='orderInfo.deliveryType=="fictitious"'> <view class='wrapper borRadius14' v-else-if='orderInfo.deliveryType === 0'>
<view class='item acea-row row-between'> <view class='item acea-row row-between'>
<view>虚拟发货</view> <view>虚拟发货</view>
<view class='conter'>已发货请注意查收</view> <view class='conter'>已发货请注意查收</view>
@ -309,13 +301,9 @@
</view> </view>
</template> </template>
<script> <script>
import { import { qrcodeApi } from '@/api/order.js';
orderTake,
orderDel,
orderCancel,
qrcodeApi
} from '@/api/order.js';
import * as OrderApi from '@/api/trade/order.js'; import * as OrderApi from '@/api/trade/order.js';
import * as DeliveryApi from '@/api/trade/delivery.js';
import { import {
openOrderRefundSubscribe openOrderRefundSubscribe
} from '@/utils/SubscribeMessage.js'; } from '@/utils/SubscribeMessage.js';
@ -327,7 +315,6 @@
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import dayjs from '@/plugin/dayjs/dayjs.min.js'; import dayjs from '@/plugin/dayjs/dayjs.min.js';
import * as Util from '@/utils/util.js'; import * as Util from '@/utils/util.js';
import {cancelOrder, deleteOrder} from "../../api/trade/order";
export default { export default {
components: { components: {
payment, payment,
@ -342,12 +329,15 @@
systemStore: {}, systemStore: {},
}, },
cartInfo: [], // cartInfo: [], //
evaluate: 0, //
// ========== ==========
system_store: {}, //
// TODO
codeImg: '', codeImg: '',
qrcodeSize: 100, qrcodeSize: 100,
evaluate: 0,
system_store: {},
isGoodsReturn: false, //退 isGoodsReturn: false, //退
}; };
}, },
@ -405,18 +395,22 @@
// evaluate 2 // evaluate 2
this.$set(this, 'evaluate', res.data.status === 30 && !res.data.commentStatus ? 2 : 0); this.$set(this, 'evaluate', res.data.status === 30 && !res.data.commentStatus ? 2 : 0);
// TODO
this.$set(this, 'system_store', res.data.systemStore); //
if (res.data.pickUpStoreId) {
DeliveryApi.getDeliveryPickUpStore(res.data.pickUpStoreId).then(res => {
this.system_store = res.data || {};
});
}
if (this.orderInfo.deliveryType === 2 && this.orderInfo.payStatus) {
this.markCode(res.data.verifyCode);
}
// TODO // TODO
if (res.data.refundStatus !== 0) { if (res.data.refundStatus !== 0) {
this.isGoodsReturn = true; this.isGoodsReturn = true;
} }
this.isGoodsReturn = false; // TODO this.isGoodsReturn = false; // TODO
// TODO
if (this.orderInfo.shippingType === 2 && this.orderInfo.payStatus) {
this.markCode(res.data.verifyCode);
}
if (this.isGoodsReturn) { if (this.isGoodsReturn) {
uni.setNavigationBarColor({ uni.setNavigationBarColor({
frontColor: '#ffffff', frontColor: '#ffffff',
@ -438,6 +432,31 @@
url: `/pages/goods/cashier/index?order_id=${this.orderInfo.payOrderId}&from_type=order` url: `/pages/goods/cashier/index?order_id=${this.orderInfo.payOrderId}&from_type=order`
}) })
}, },
/**
* 确认收货
*/
confirmOrder: function() {
uni.showModal({
title: '确认收货',
content: '为保障权益,请收到货确认无误后,再确认收货',
success: (res) => {
if (res.confirm) {
OrderApi.takeOrder(this.orderInfo.id).then(res => {
return this.$util.Tips({
title: '收货成功',
icon: 'success'
}, () => {
this.getOrderInfo();
});
}).catch(err => {
return this.$util.Tips({
title: err
});
})
}
}
})
},
/** /**
* 取消订单 * 取消订单
*/ */
@ -491,29 +510,6 @@
// TODO // TODO
/**
* 拨打电话
*/
makePhone: function() {
uni.makePhoneCall({
phoneNumber: this.system_store.phone
})
},
/**
* 打开地图
*/
showMaoLocation: function() {
if (!this.system_store.latitude || !this.system_store.longitude) return this.$util.Tips({
title: '缺少经纬度信息无法查看地图!'
});
uni.openLocation({
latitude: parseFloat(this.system_store.latitude),
longitude: parseFloat(this.system_store.longitude),
scale: 8,
name: this.system_store.name,
address: this.system_store.address + this.system_store.detailedAddress,
});
},
/** /**
* 生成二维码 * 生成二维码
*/ */
@ -526,14 +522,6 @@
this.codeImg = res.data.code this.codeImg = res.data.code
}); });
}, },
/**
* 打电话
*/
goTel: function() {
uni.makePhoneCall({
phoneNumber: this.orderInfo.deliveryId
})
},
/** /**
* 去拼团详情 * 去拼团详情
*/ */
@ -550,29 +538,6 @@
orderNo: this.order_id orderNo: this.order_id
}]); }]);
}, },
confirmOrder: function() {
let that = this;
uni.showModal({
title: '确认收货',
content: '为保障权益,请收到货确认无误后,再确认收货',
success: function(res) {
if (res.confirm) {
orderTake(that.id).then(res => {
return that.$util.Tips({
title: '操作成功',
icon: 'success'
}, function() {
that.getOrderInfo();
});
}).catch(err => {
return that.$util.Tips({
title: err
});
})
}
}
})
},
// ========== ========== // ========== ==========
/** /**
@ -608,6 +573,31 @@
}); });
}, },
// #endif // #endif
/**
* 拨打电话
*/
makePhone: function() {
uni.makePhoneCall({
phoneNumber: this.system_store.phone
})
},
/**
* 打开地图
*/
showMaoLocation: function() {
if (!this.system_store.latitude || !this.system_store.longitude) {
return this.$util.Tips({
title: '缺少经纬度信息无法查看地图!'
});
}
uni.openLocation({
latitude: this.system_store.latitude,
longitude: this.system_store.longitude,
scale: 8,
name: this.system_store.name,
address: this.system_store.areaName + this.system_store.detailAddress,
});
},
fen2yuan(price) { fen2yuan(price) {
return Util.fen2yuan(price) return Util.fen2yuan(price)