group order

This commit is contained in:
2020-07-20 17:17:41 +08:00
parent 50085a341f
commit a6e1241238
11 changed files with 494 additions and 55 deletions

View File

@@ -33,7 +33,7 @@
</view>
</view>
<view class="order-info">
<view @click="showCoupon({type: 2, store_id: item[index].store_id})">
<view @click="showCoupon({type: 2, store_id: item[0].store_id})">
<view class="title">优惠券折扣</view>
<view class="value">
<view>{{ item.coupon_price ? item.coupon_price : '0.00' }}</view>
@@ -69,7 +69,7 @@
<scroll-view class="coupon-choose" style="height: 800rpx;">
<view class="title">优惠券详情</view>
<view class="text">使用优惠券</view>
<Coupon :couponInfo="coupon" :status='0' :type="1" @use="useCoupon($event)" v-for="(coupon) in couponList" :key="coupon.vouchertemplate_id"></Coupon>
<Coupon :couponInfo="coupon" @use="useCoupon($event)" :goodsClass="goodsClass" v-for="(coupon, index) in couponList" :key="index"></Coupon>
<u-empty text="无可用优惠券" mode="coupon" v-if="!couponList.length"></u-empty>
</scroll-view>
</u-popup>
@@ -87,7 +87,7 @@
</view>
</template>
<script>
import Coupon from "@/components/mine/coupon/index";
import Coupon from "@/components/mine/coupon/mine";
export default {
data() {
return {
@@ -111,6 +111,7 @@ export default {
couponList: [],
couponStatus: false,
choiceCoupon: {}, // 使用的平台优惠券
goodsClass: [],
}
},
components: {
@@ -135,6 +136,7 @@ export default {
},
onLoad(option) {
this.orderInfo = this.$store.state.cartInfo;
console.log(this.orderInfo);
},
onShow() {
// 判断是不是从选择地址页面返回
@@ -193,7 +195,7 @@ export default {
})
return res;
},
showCoupon({ type, store_id }) {
showCoupon({ type, gc_id, store_id }) {
// this.getCoupon({
// type: type, // 优惠券类型: 1平台券, 2店铺券
// store_id: store_id,
@@ -201,11 +203,13 @@ export default {
// }).then(res => {
// this.couponStatus = true;
// })
this.$u.api.getMemberCouponList({
let params = {
type: type, // 优惠券类型: 1平台券, 2店铺券
store_id: store_id,
status: 1, // 代金券状态 1:未用 2:已用 3:过期 4:收回
}).then(res => {
}
if(store_id) Object.assign(params, 'store_id', store_id);
if(gc_id) Object.assign(params, 'gc_id', gc_id);
this.$u.api.getMemberCouponList(params).then(res => {
this.couponList = res.data;
this.couponStatus = true;
})
@@ -256,6 +260,11 @@ export default {
url: '/pageE/order/Details'
});
},
getGoodsClass() {
this.$u.api.getGoodsClass().then(res => {
this.goodsClass = res.data;
})
},
changeAddress() {
uni.navigateTo({
url: '/pageE/more/Address?type=choose'