order 7.22
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-info">
|
||||
<view @click="showCoupon({type: 2, store_id: item[0].store_id})">
|
||||
<view @click="showCoupon({type: 2, store_id: item[0].store_id})" v-if="orderInfo.ifcart != 0">
|
||||
<view class="title">优惠券折扣</view>
|
||||
<view class="value">
|
||||
<view>¥{{ item.coupon_price ? item.coupon_price : '0.00' }}</view>
|
||||
@@ -50,7 +50,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="common-active">
|
||||
<view @click="showCoupon({type: 1})">
|
||||
<view @click="showCoupon({type: 1})" v-if="orderInfo.ifcart != 0">
|
||||
<view class="title">平台优惠券</view>
|
||||
<view class="value">
|
||||
<view>-¥{{ choiceCoupon.vouchertemplate_id ? choiceCoupon.voucher_price : '0.00' }}</view>
|
||||
@@ -80,7 +80,7 @@
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="num">共件{{ orderInfo.store_cart_list | setTotalNumber }}商品</view>
|
||||
<view class="btn" @click="sendOrder">结算</view>
|
||||
<view class="btn" @click="intermediate">结算</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-action-sheet :list="deliveryList" @click="setDelivery" border-radius="10" v-model="showDelivery"></u-action-sheet>
|
||||
@@ -112,7 +112,7 @@ export default {
|
||||
couponStatus: false,
|
||||
choiceCoupon: {}, // 使用的平台优惠券
|
||||
goodsClass: [],
|
||||
orderType: '', // 订单类型 1 普通订单 2 购物车订单 3 拼团订单 4 秒杀订单
|
||||
orderType: '', // 订单类型 1 普通订单 2 拼团订单 3 秒杀订单 4 优惠券 5 购物车订单
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -138,7 +138,8 @@ export default {
|
||||
onLoad(option) {
|
||||
this.orderType = this.$store.state.orderType;
|
||||
this.orderInfo = this.$store.state.orderInfo;
|
||||
// console.log(this.orderInfo);
|
||||
console.log(this.orderType);
|
||||
console.log(this.orderInfo);
|
||||
},
|
||||
onShow() {
|
||||
// 判断是不是从选择地址页面返回
|
||||
@@ -158,7 +159,32 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
sendOrder() {
|
||||
// 如果有pintuangroup_headid为参团不然为开团
|
||||
async withImmediate(type) {
|
||||
let params = {
|
||||
pintuan_id: this.orderInfo.pintuan_id,
|
||||
}
|
||||
// console.log(this.involvemenGroupInfo);
|
||||
if(this.orderInfo.pintuangroup_id) {
|
||||
Object.assign(params, { pintuangroup_headid: this.$store.state.pintuangroup_headid });
|
||||
Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id });
|
||||
}
|
||||
// console.log(params);
|
||||
this.$u.api.withImmediate(params).then(res => {
|
||||
this.showGroupUser = false;
|
||||
this.showInvolvementUser = false;
|
||||
if(res.errCode == 0) {
|
||||
this.sendOrder(0);
|
||||
} else {
|
||||
this.$u.toast(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
intermediate() {
|
||||
if(this.orderType == 2) this.withImmediate();
|
||||
else this.sendOrder(1);
|
||||
},
|
||||
sendOrder(ifcart) {
|
||||
// 拼接后端需要的数据形式
|
||||
let id = [], temp = '';
|
||||
const object = this.orderInfo.store_cart_list;
|
||||
@@ -173,14 +199,15 @@ export default {
|
||||
}
|
||||
}
|
||||
let params = {
|
||||
ifcart: 1,
|
||||
ifcart: ifcart,
|
||||
cart_id: id,
|
||||
address_id: this.addressInfo.address_id,
|
||||
buy_city_id: this.addressInfo.city_id,
|
||||
}
|
||||
// if(this.orderType == 3) {
|
||||
// Object.assign(params, { pintuan_id: })
|
||||
// }
|
||||
if(this.orderType == 2) {
|
||||
Object.assign(params, { pintuan_id: this.orderInfo.pintuan_id })
|
||||
if(this.orderInfo.pintuangroup_id) Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id })
|
||||
}
|
||||
this.$u.api.sendOrder(params).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.$u.route({
|
||||
@@ -190,6 +217,8 @@ export default {
|
||||
price: res.data.order_total_amount,
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$u.toast(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -38,7 +38,7 @@ export default {
|
||||
disabled: false,
|
||||
}
|
||||
],
|
||||
pay_way: '',
|
||||
pay_way: 'wxpay_app',
|
||||
pay_sn: '',
|
||||
price: '',
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
current(index) {
|
||||
console.log(this.tabList);
|
||||
// console.log(this.tabList);
|
||||
this.getPinTuanList(this.tabList[index].gc_id);
|
||||
}
|
||||
},
|
||||
@@ -69,7 +69,6 @@ export default {
|
||||
// swiper滑动结束,分别设置tabs和swiper的状态
|
||||
animationfinish(e) {
|
||||
let current = e.detail.current;
|
||||
this.$refs.uTabs.setFinishCurrent(current);
|
||||
this.swiperCurrent = current;
|
||||
this.current = current;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user