Merge pull request '修改配送方式' (#348) from zhy into master

Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/348
This commit is contained in:
hansu 2020-09-07 11:42:43 +08:00
commit f65e2e9830
6 changed files with 42 additions and 24 deletions

View File

@ -139,17 +139,9 @@ export default {
});
},
// 订单步骤2发起订单返回订单信息
sendOrder({ ifcart, cart_id, address_id, buy_city_id, pintuan_id, pintuangroup_id, voucher_id, is_selfraising, invoice_id }) {
sendOrder({ ifcart, cart_id, address_id, buy_city_id, pintuan_id, pintuangroup_id, voucher_id, member_deliver_type, invoice_id }) {
return vm.$u.post('buy/buy_step2', {
ifcart: ifcart,
cart_id: cart_id,
address_id: address_id,
buy_city_id: buy_city_id,
pintuan_id: pintuan_id,
pintuangroup_id: pintuangroup_id,
voucher_id: voucher_id, // 优惠券信息
is_selfraising: is_selfraising, // 是否自提
invoice_id: invoice_id,
ifcart, cart_id, address_id, buy_city_id, pintuan_id, pintuangroup_id, voucher_id, member_deliver_type, invoice_id,
});
},
// 订单步骤3发起支付第三方统一下单

View File

@ -25,7 +25,7 @@
<view class="order-btn" v-if="[1, 2, 3, 4, 8, 11].indexOf(order.view_type) >= 0">
<!-- || order.view_type == 2 -->
<view class="cancel" v-if="(order.view_type == 3 || order.view_type == 2) && order.is_refund == 1" @click="toOtherPage('RefundOrder')">申请退款</view>
<view class="cancel" v-if="order.view_type == 3 && order.shipping_code && order.is_selfraising != 1" @click="toOtherPage('Logistics')">查看物流</view>
<view class="cancel" v-if="order.view_type == 3 && order.shipping_code && (order.store_deliver_type ? order.store_deliver_type != 3 : order.member_deliver_type != 3)" @click="toOtherPage('Logistics')">查看物流</view>
<view class="logistics" v-if="order.view_type == 3" @click="confirmReceive">确认收货</view>
<view class="comment" v-if="order.view_type == 4" @click="toOtherPage('Comment')">立即评价</view>
<view class="cancel" v-if="order.view_type == 1" @click="cancelOrder">取消支付</view>

View File

@ -48,7 +48,7 @@
</view>
</view>
</view>
<view class="pick-up" v-if="is_selfraising == 1">
<view class="pick-up" v-if="delivery.type == 3">
<view class="title">自提地址</view>
<view class="content">{{ orderInfo.store_list[index].store_address }}</view>
</view>
@ -120,18 +120,22 @@ export default {
text: '快递',
value: 'express',
disabled: false,
type: 1,
}, {
text: '骑手',
value: 'takeawayer',
disabled: false,
type: 2,
}, {
text: '自提',
value: 'selfraising',
disabled: false,
type: 3,
}],
delivery: {
text: '快递',
value: 'express',
type: 1,
}, //
couponList: [],
couponStatus: false,
@ -141,7 +145,6 @@ export default {
goodsClass: [],
orderType: '', // 1 2 3 4 5
debounce: true,
is_selfraising: 0, // 0=1=
hasInvoice: 0,
}
},
@ -276,7 +279,7 @@ export default {
cart_id: id,
address_id: this.addressInfo.address_id,
buy_city_id: this.addressInfo.city_id,
is_selfraising: this.is_selfraising,
member_deliver_type: this.delivery.type,
invoice_id: this.$store.getters.getInvoiceId, // ID0
}
if(coupon.length) Object.assign(params, { voucher_id: coupon });
@ -413,7 +416,6 @@ export default {
this.getFreight();
}
if(index == 2) {
this.is_selfraising = 1;
for (const key in this.freight) {
if (this.freight.hasOwnProperty(key)) {
this.freight[key] = '0.00';
@ -421,8 +423,6 @@ export default {
}
this.setTotalPrice(); //
this.delivery = this.deliveryList[index];
} else {
this.is_selfraising = 0;
}
if(index == 0) {
this.delivery = this.deliveryList[index];

View File

@ -1,6 +1,6 @@
<template>
<view>
<image :src="list.picture" class="picture" mode=""></image>
<image :src="list.picture" class="picture" mode="aspectFit"></image>
<view class="box">
<view class="info">
<text class="title u-line-2">{{ list.title }}</text>

View File

@ -59,9 +59,9 @@
<view class="title">支付方式</view>
<view class="price">{{ orderInfo.payment_name }}</view>
</view>
<view v-if="orderInfo.is_selfraising == 1">
<view>
<view class="title">配送方式</view>
<view class="price">自提</view>
<view class="price">{{ orderInfo.member_deliver_type | getDeliverType(orderInfo.store_deliver_type) }}</view>
</view>
</view>
</view>
@ -69,7 +69,7 @@
<view>订单编号{{ orderInfo.order_sn }}</view>
<view>支付单号{{ orderInfo.pay_sn }}</view>
<view>创建时间{{ orderInfo.add_time | date}}</view>
<view v-if="orderInfo.is_selfraising == 1" class="address">自提地址{{ orderInfo.extend_store.store_address }}</view>
<view v-if="orderInfo.member_deliver_type == 3" class="address">自提地址{{ orderInfo.extend_store.store_address }}</view>
</view>
</view>
<!-- '4', '8' -->
@ -77,7 +77,7 @@
<!-- orderstate == '4' || -->
<view class="cancel" v-if="(orderstate == '1') && orderInfo.is_refund == 1" @click="toOtherPage('RefundOrder')">申请退款</view>
<!-- <view class="cancel" v-if="orderstate == '8'" @click="cancelOrder">取消订单</view> -->
<view class="cancel" v-if="orderstate == '1' && orderInfo.shipping_code && orderInfo.is_selfraising != 1" @click="toOtherPage('Logistics')">查看物流</view>
<view class="cancel" v-if="orderstate == '1' && orderInfo.shipping_code && orderInfo.member_deliver_type != 3" @click="toOtherPage('Logistics')">查看物流</view>
<view class="logistics" v-if="orderstate == '1'" @click="confirmReceive">确认收货</view>
<view class="comment" v-if="orderstate == '2'" @click="toOtherPage('Comment')">立即评价</view>
<view class="cancel" v-if="orderstate == '6'" @click="cancelOrder">取消支付</view>
@ -157,6 +157,32 @@ export default {
beforeDestroy() {
clearInterval(this.timer);
},
filters: {
getDeliverType(user, store) {
let deliverType = '';
function setType(type) {
switch (type) {
case 1:
deliverType = '快递'
break;
case 2:
deliverType = '骑手'
break;
case 3:
deliverType = '自提'
break;
default:
deliverType = '-'
break;
}
}
setType(user);
if(store) {
setType(store);
}
return deliverType;
}
},
methods: {
viewStoreDetails(id) {
this.$u.route('pageC/merchant/index', {

View File

@ -132,7 +132,7 @@ export default {
console.log(load)
res.data.forEach(element => {
element.extend_order_goods.forEach(i=>{
console.log(i)
// console.log(i)
})
});
this.timer = true;
@ -148,7 +148,7 @@ export default {
}
this.orderList[this.current].forEach(element => {
element.extend_order_goods.forEach(i=>{
console.log(i)
// console.log(i)
})
});
this.$forceUpdate();