|
|
|
@ -128,7 +128,7 @@ |
|
|
|
</view> |
|
|
|
<view class="flex-row group_15"> |
|
|
|
<text class="text_11">优惠券:</text> |
|
|
|
<u-input v-model="couponText" placeholder="非必填,请输入优惠券码"></u-input> |
|
|
|
<u-input @change="checkCoupon" v-model="couponText" placeholder="非必填,请输入优惠券码"></u-input> |
|
|
|
</view> |
|
|
|
<view class="flex-col group_21"> |
|
|
|
<view class="flex-col items-center button" @click="next"> |
|
|
|
@ -144,6 +144,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { dispose } from '@/common/directoss.js'; |
|
|
|
import { checkAgentCode } from '@/service/index.js'; |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
@ -163,6 +164,8 @@ |
|
|
|
columns:[], |
|
|
|
columnsData:null, |
|
|
|
columnsIndex:0, |
|
|
|
couponStatus:true, |
|
|
|
couponTimer:null, |
|
|
|
}; |
|
|
|
}, |
|
|
|
// computed:{ |
|
|
|
@ -185,6 +188,22 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
checkCoupon(event){ |
|
|
|
if(this.couponTimer){ |
|
|
|
clearTimeout(this.couponTimer); |
|
|
|
} |
|
|
|
this.couponTimer = setTimeout(async () => { |
|
|
|
let res = await checkAgentCode(event); |
|
|
|
if(res.code > 0){ |
|
|
|
this.couponStatus = false; |
|
|
|
uni.showToast({ |
|
|
|
title:res.msg, |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
this.couponStatus = true; |
|
|
|
} |
|
|
|
},500); |
|
|
|
}, |
|
|
|
async afterRead(event){ |
|
|
|
let imageList = await dispose(event.file); |
|
|
|
this.fileList.push(...imageList); |
|
|
|
@ -209,6 +228,9 @@ |
|
|
|
if(!sonpingInfo.name) return this.$msg('请填写送评人信息'); |
|
|
|
if(!sonpingInfo.phone) return this.$msg('请填写送评人手机号'); |
|
|
|
if(!sonpingInfo.number) return this.$msg('请填写送评数量'); |
|
|
|
if(this.couponStatus == false){ |
|
|
|
this.coupon = ''; |
|
|
|
} |
|
|
|
this.$url('/pages/write/distribution'); |
|
|
|
} |
|
|
|
} |
|
|
|
|