|
@@ -27,25 +27,28 @@
|
|
|
</view>
|
|
|
|
|
|
<!-- 优惠券 -->
|
|
|
- <view class="discounts" v-if="false">
|
|
|
+ <view class="discounts" v-if="list.length" >
|
|
|
<view class="title">
|
|
|
- <view class="title-1">
|
|
|
+ <span class="title-1">
|
|
|
优惠券
|
|
|
- </view>
|
|
|
- <view class="title-2">
|
|
|
+ </span>
|
|
|
+ <span class="title-2">
|
|
|
每次只能使用1张
|
|
|
- </view>
|
|
|
- <view class="title-3">
|
|
|
+ </span>
|
|
|
+ <span class="title-3">
|
|
|
-¥6.00
|
|
|
- </view>
|
|
|
+ </span>
|
|
|
</view>
|
|
|
<view class="select">
|
|
|
- <u-radio-group v-model="value" @change="radioGroupChange" wrap="true">
|
|
|
+ <u-radio-group v-model="value" @change="radioGroupChange" :wrap="true">
|
|
|
+
|
|
|
<u-radio @change="radioChange" v-for="(item, index) in list" :key="index" :name="item.name"
|
|
|
+ :style="item.disabled?' background-color: #e3e3e3 !important;':''"
|
|
|
:disabled="item.disabled">
|
|
|
{{item.name}}
|
|
|
|
|
|
- </u-radio>
|
|
|
+ </u-radio>
|
|
|
+
|
|
|
<view class="explain">使用说明</view>
|
|
|
</u-radio-group>
|
|
|
|
|
@@ -113,7 +116,8 @@
|
|
|
name: '100'
|
|
|
},
|
|
|
|
|
|
- ],
|
|
|
+ ],
|
|
|
+ value:"",
|
|
|
// 优惠券
|
|
|
list: [{
|
|
|
name: '满50元减6元',
|
|
@@ -124,8 +128,8 @@
|
|
|
disabled: false
|
|
|
},
|
|
|
{
|
|
|
- name: '满100减15元 未满足使用条件',
|
|
|
- disabled: false
|
|
|
+ name: '满100减15元',
|
|
|
+ disabled: true
|
|
|
}
|
|
|
],
|
|
|
|
|
@@ -141,7 +145,7 @@
|
|
|
if(op.isback){
|
|
|
this.isback=false;
|
|
|
}
|
|
|
-
|
|
|
+ this.useCoupon()
|
|
|
},
|
|
|
onShow() {
|
|
|
this.getHomePage()
|
|
@@ -173,7 +177,8 @@
|
|
|
|
|
|
},
|
|
|
moneyClick(index) {
|
|
|
- this.moneyActiveClass = index;
|
|
|
+ this.moneyActiveClass = index;
|
|
|
+ this.useCoupon()
|
|
|
|
|
|
},
|
|
|
confirm() {
|
|
@@ -225,27 +230,47 @@
|
|
|
this.user = res.data
|
|
|
this.isReady = true;
|
|
|
uni.hideLoading()
|
|
|
-
|
|
|
+ //this.useCoupon()
|
|
|
}).catch(error => {
|
|
|
uni.showToast({
|
|
|
title: error
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+ useCoupon(){
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+ this.submitInit()
|
|
|
+ API.useCoupon({
|
|
|
+ amount:this.submitForm.amount
|
|
|
+ }).then((res) => {
|
|
|
+ this.list=res.userCouponList
|
|
|
+ uni.hideLoading()
|
|
|
+
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ submitInit(){
|
|
|
+ if (this.moneyActiveClass == -1 && !this.otherNum) {
|
|
|
+ this.submitForm.chargeStrategy = 0;
|
|
|
+ this.submitForm.amount = 0
|
|
|
+ } else {
|
|
|
+ this.submitForm.chargeStrategy = 2;
|
|
|
+ if (this.otherNum) {
|
|
|
+ this.submitForm.amount = this.otherNum
|
|
|
+ } else {
|
|
|
+ this.submitForm.amount = this.moneyActiveClass
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
submit() {
|
|
|
-
|
|
|
- if (this.moneyActiveClass == -1 && !this.otherNum) {
|
|
|
- this.submitForm.chargeStrategy = 0;
|
|
|
- this.submitForm.amount = 0
|
|
|
- } else {
|
|
|
- this.submitForm.chargeStrategy = 2;
|
|
|
- if (this.otherNum) {
|
|
|
- this.submitForm.amount = this.otherNum
|
|
|
- } else {
|
|
|
- this.submitForm.amount = this.moneyActiveClass
|
|
|
- }
|
|
|
- }
|
|
|
+ this.submitInit()
|
|
|
+
|
|
|
|
|
|
if (!this.submitForm.channelNo) {
|
|
|
uni.showToast({
|
|
@@ -405,10 +430,10 @@
|
|
|
|
|
|
.title {
|
|
|
width: 100%;
|
|
|
- display: flex;
|
|
|
+
|
|
|
|
|
|
.title-1 {
|
|
|
- width: 48px;
|
|
|
+
|
|
|
height: 22px;
|
|
|
color: rgba(16, 16, 16, 100);
|
|
|
font-size: 16px;
|
|
@@ -421,7 +446,7 @@
|
|
|
}
|
|
|
|
|
|
.title-3 {
|
|
|
- margin-left: 126px;
|
|
|
+ float: right;
|
|
|
height: 19px;
|
|
|
font-size: 16px;
|
|
|
}
|
|
@@ -442,10 +467,10 @@
|
|
|
position: relative;
|
|
|
}
|
|
|
|
|
|
- /deep/.u-radio:nth-child(3) {
|
|
|
- background-color: #e3e3e3 !important;
|
|
|
+ // /deep/.u-radio:nth-child(3) {
|
|
|
+ //
|
|
|
|
|
|
- }
|
|
|
+ // }
|
|
|
|
|
|
/deep/.u-radio__icon-wrap {
|
|
|
left: 16px;
|