|
|
|
@ -25,9 +25,9 @@ |
|
|
|
|
|
|
|
|
|
<view class="width100 backcorfff"> |
|
|
|
|
<view class="username"> |
|
|
|
|
<view class="namecont">优惠金额</view> |
|
|
|
|
<input v-if="type !=3" placeholder="请输入优惠金额" v-model="price" type="text" |
|
|
|
|
placeholder-style="color: #bfbfbf;" /> |
|
|
|
|
<view class="namecont" >优惠金额</view> |
|
|
|
|
<input v-if="type !=3" :placeholder="placeholderTip" v-model="price" type="text" |
|
|
|
|
placeholder-style="color: #bfbfbf;" style="width: 72%;" /> |
|
|
|
|
<view v-if="type ==3">{{price}}</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -126,6 +126,12 @@ |
|
|
|
|
//结束时间转化 |
|
|
|
|
endDate() { |
|
|
|
|
return this.getDate('end'); |
|
|
|
|
}, |
|
|
|
|
placeholderTip(){ |
|
|
|
|
if(this.preferentialType==3){ |
|
|
|
|
return "折扣比例(10~99),例98折:98" |
|
|
|
|
} |
|
|
|
|
return '请输入优惠金额' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
@ -224,7 +230,7 @@ |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (!this.price) { |
|
|
|
|
if (!this.price){ |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请输入优惠金额', |
|
|
|
|
icon: "none", |
|
|
|
@ -232,6 +238,18 @@ |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if(this.preferentialType==3){ |
|
|
|
|
let reg =/^[1-9][0-9]$/; //10-99最低打一折 |
|
|
|
|
if(!reg.test(this.price)){ |
|
|
|
|
this.price=""; |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请输入正确的折扣比例,例如99折输入:99,打七折输入:70', |
|
|
|
|
icon: "none", |
|
|
|
|
duration: 2000 |
|
|
|
|
}); |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!this.end_date) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '请选择结束时间', |
|
|
|
|