完善问题

This commit is contained in:
2020-07-18 17:43:37 +08:00
parent 5c419e6710
commit 5c9bdcd0f3
10 changed files with 271 additions and 144 deletions

View File

@@ -26,7 +26,6 @@
<view class="name u-line-2">{{ goods.goods_name }}</view>
<view class="cart-info">
<view class="price">{{ goods.goods_price }}</view>
<!-- <u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" color="#FF780F" :index="g_index" v-model="goods.goods_num" :disabled="true"></u-number-box> -->
<view>×{{ goods.goods_num }}</view>
</view>
</view>
@@ -34,10 +33,10 @@
</view>
</view>
<view class="order-info">
<view>
<view @click="showCoupon({type: 2, store_id: item[index].store_id})">
<view class="title">优惠券折扣</view>
<view class="value">
<view>{{ index }}</view>
<view>{{ item.coupon_price ? item.coupon_price : '0.00' }}</view>
<image src="../static/image/1.png"></image>
</view>
</view>
@@ -45,17 +44,16 @@
<view class="title">运费</view>
<view class="value">
<view v-if="freight">{{ freight | setFreight(index) }}</view>
<!-- <image src="../static/image/1.png"></image> -->
</view>
</view>
</view>
</view>
</view>
<view class="common-active">
<view>
<view @click="showCoupon({type: 1})">
<view class="title">平台优惠券</view>
<view class="value">
<view>-0.00</view>
<view>-{{ choiceCoupon.vouchertemplate_id ? choiceCoupon.voucher_price : '0.00' }}</view>
<image src="../static/image/1.png"></image>
</view>
</view>
@@ -67,6 +65,14 @@
</view>
</view>
</view>
<u-popup v-model="couponStatus" mode="bottom">
<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>
<u-empty text="无可用优惠券" mode="coupon" v-if="!couponList.length"></u-empty>
</scroll-view>
</u-popup>
<view class="bottom">
<view class="left">
<view class="title">合计</view>
@@ -81,6 +87,7 @@
</view>
</template>
<script>
import Coupon from "@/components/mine/coupon/index";
export default {
data() {
return {
@@ -101,8 +108,14 @@ export default {
text: '快递',
value: 'express',
}, // 配送方式
couponList: [],
couponStatus: false,
choiceCoupon: {}, // 使用的平台优惠券
}
},
components: {
Coupon
},
filters: {
setTotalNumber(data) {
let num = 0;
@@ -172,6 +185,35 @@ export default {
}
})
},
async getCoupon({ type, store_id, status }) {
const res = await this.$u.api.getMemberCouponList({
type: type,
store_id: store_id,
status: status,
})
return res;
},
showCoupon({ type, store_id }) {
// this.getCoupon({
// type: type, // 优惠券类型: 1平台券, 2店铺券
// store_id: store_id,
// status: 1, // 代金券状态 1:未用 2:已用 3:过期 4:收回
// }).then(res => {
// this.couponStatus = true;
// })
this.$u.api.getMemberCouponList({
type: type, // 优惠券类型: 1平台券, 2店铺券
store_id: store_id,
status: 1, // 代金券状态 1:未用 2:已用 3:过期 4:收回
}).then(res => {
this.couponList = res.data;
this.couponStatus = true;
})
},
useCoupon(coupon) {
this.choiceCoupon = coupon;
this.couponStatus = false;
},
getFreight() {
this.$u.api.getFreight({
freight_hash: this.orderInfo.freight_hash,
@@ -403,6 +445,23 @@ export default {
}
}
}
.coupon-choose {
box-sizing: border-box;
padding: 30rpx;
.title {
padding-bottom: 30rpx;
font-size: 32rpx;
font-weight: 500;
color: rgba(51,51,51,1);
text-align: center;
}
.text {
padding-bottom: 30rpx;
font-size: 28rpx;
font-weight: 500;
color: rgba(102,102,102,1);
}
}
.bottom {
padding: 35rpx 30rpx;
position: fixed;