|
@@ -5,14 +5,14 @@
|
|
|
<view class="txt-right">{{form.storeName}}</view>
|
|
|
</u-form-item>
|
|
|
<u-form-item label="支付用户">
|
|
|
- <view class="txt-right">{{form.phone}}</view>
|
|
|
+ <view class="txt-right">{{form.customerMobile}}</view>
|
|
|
</u-form-item>
|
|
|
- <u-form-item label="备注" prop="remark">
|
|
|
- <u-input placeholder="请输入备注" :maxlength="500" :custom-style="{textAlign:'right'}" trim v-model="form.remark" />
|
|
|
+ <u-form-item label="备注" prop="remarks">
|
|
|
+ <u-input placeholder="请输入备注" :maxlength="500" :custom-style="{textAlign:'right'}" trim v-model="form.remarks" />
|
|
|
</u-form-item>
|
|
|
- <u-form-item label="核销数量" label-position="top" prop="ledou" required>
|
|
|
+ <u-form-item label="核销数量" label-position="top" prop="changeNum" required>
|
|
|
<view class="ledu-input">
|
|
|
- <view><u-input placeholder="请输入核销数量" :custom-style="{borderBottom:'1px solid #999',textAlign:'center',width:'100%'}" trim type="number" v-model="form.ledou" /></view>
|
|
|
+ <view><u-input placeholder="请输入核销数量" :custom-style="{borderBottom:'1px solid #999',textAlign:'center',width:'100%'}" trim type="number" v-model="form.changeNum" /></view>
|
|
|
<text>个乐豆</text>
|
|
|
</view>
|
|
|
</u-form-item>
|
|
@@ -28,37 +28,37 @@
|
|
|
<view class="text-cont">
|
|
|
<view>
|
|
|
<text>用户手机:</text>
|
|
|
- <text>{{form.phone||'--'}}</text>
|
|
|
+ <text>{{form.customerMobile||'--'}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="text-cont">
|
|
|
<view>
|
|
|
<text>验证码:</text>
|
|
|
- <u-input type="number" placeholder="请输入验证码"></u-input>
|
|
|
+ <u-input type="number" v-model="code" :maxlength="6" placeholder="请输入验证码"></u-input>
|
|
|
<u-button size="mini" :disabled="isDisable" @click="getCodeValidate">{{nowVal}}</u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="fot-btn">
|
|
|
- <u-button @click="confirm" size="medium" type="primary" >确定</u-button>
|
|
|
+ <u-button @click="confirm" :loading="loading" size="medium" type="primary" >确定</u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
|
|
|
<!-- 图文验证码 -->
|
|
|
- <uni-popup ref="imageTxtPopup" type="center">
|
|
|
+ <!-- <uni-popup ref="imageTxtPopup" type="center">
|
|
|
<popup-con type="forgetImageTxt" title="图文验证码" :popBtn="popBtn" :changeImg="changeImg" @captchaImg="captchaImg"></popup-con>
|
|
|
- </uni-popup>
|
|
|
+ </uni-popup> -->
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
|
|
- import popupCon from '@/components/uni-popup/popup-con.vue'
|
|
|
- import { memberVerifyCode, memberGetByMobile } from '@/api/user.js'
|
|
|
+ // import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
|
|
+ // import popupCon from '@/components/uni-popup/popup-con.vue'
|
|
|
+ import { offPartnerHx, sendVerifyCode, checkVerificationCode } from '@/api/officialPartnerGoldLog.js'
|
|
|
export default {
|
|
|
components: {
|
|
|
- uniPopup,
|
|
|
- popupCon
|
|
|
+ // uniPopup,
|
|
|
+ // popupCon
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -67,25 +67,26 @@
|
|
|
count: '', // 当前秒数
|
|
|
timer: null, // 倒计时
|
|
|
isDisable: false, // 是否禁止获取验证码
|
|
|
- changeImg: false, // 是否重新更换图形验证码
|
|
|
- randomCode: '', // 图片验证码随机码
|
|
|
+ code: '',
|
|
|
+ loading: false,
|
|
|
form:{
|
|
|
- storeName: '收取门店',
|
|
|
- phone: '13709146191',
|
|
|
- remark: '',
|
|
|
- ledou: ''
|
|
|
+ storeName: '',
|
|
|
+ customerMobile: '',
|
|
|
+ remarks: '',
|
|
|
+ changeNum: ''
|
|
|
},
|
|
|
rules: {
|
|
|
- ledou: [
|
|
|
+ changeNum: [
|
|
|
{
|
|
|
required: true,
|
|
|
type: 'number',
|
|
|
message: '请输入乐豆',
|
|
|
+ min: 1,
|
|
|
// 可以单个或者同时写两个触发验证方式
|
|
|
trigger: ['change','blur'],
|
|
|
}
|
|
|
],
|
|
|
- remark: [
|
|
|
+ remarks: [
|
|
|
{
|
|
|
message: '请输入备注',
|
|
|
trigger: 'change'
|
|
@@ -94,6 +95,12 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ onLoad(opts) {
|
|
|
+ let data = JSON.parse(decodeURIComponent(opts.item))
|
|
|
+ let user = this.$store.state.vuex_userData
|
|
|
+ this.form.customerMobile = data.mobile
|
|
|
+ this.form.storeName = user.org.name
|
|
|
+ },
|
|
|
// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
|
|
|
onReady() {
|
|
|
this.$refs.uForm.setRules(this.rules);
|
|
@@ -104,7 +111,12 @@
|
|
|
console.log(valid)
|
|
|
if (valid) {
|
|
|
console.log('验证通过');
|
|
|
- this.showModal = true
|
|
|
+ if(this.form.changeNum>0){
|
|
|
+ this.showModal = true
|
|
|
+ }else{
|
|
|
+ uni.showToast({icon: 'none',title: '请输入乐豆'})
|
|
|
+ }
|
|
|
+
|
|
|
} else {
|
|
|
console.log('验证失败');
|
|
|
}
|
|
@@ -112,27 +124,55 @@
|
|
|
},
|
|
|
closeModal(){
|
|
|
this.showModal = false
|
|
|
+ this.code = ''
|
|
|
+ },
|
|
|
+ // 提交核销
|
|
|
+ saveHx(){
|
|
|
+ offPartnerHx({
|
|
|
+ "customerMobile": this.form.customerMobile,
|
|
|
+ "changeNum": this.form.changeNum,
|
|
|
+ "remarks": this.form.remarks
|
|
|
+ }).then(res => {
|
|
|
+ if(res.status == 200){
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/ledouHexiao/hexiaoSuccess?changeNum="+this.form.changeNum
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.code = ''
|
|
|
+ uni.showToast({icon: 'none',title: res.message})
|
|
|
+ }
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
},
|
|
|
// 确定验证码
|
|
|
confirm(){
|
|
|
-
|
|
|
- },
|
|
|
- // 获取验证码
|
|
|
- getCodeValidate(){
|
|
|
- if(this.form.phone){
|
|
|
- // 校验手机号是否注册过
|
|
|
- memberGetByMobile({phone: this.form.phone}).then(res => {
|
|
|
+ if(this.code != ''&&this.code.length == 6){
|
|
|
+ this.loading = true
|
|
|
+ checkVerificationCode({mobile:this.form.customerMobile,code:this.code}).then(res => {
|
|
|
if(res.status == 200){
|
|
|
- // 图文验证码
|
|
|
- this.$refs.imageTxtPopup.open()
|
|
|
+ this.saveHx()
|
|
|
}else{
|
|
|
uni.showToast({icon: 'none',title: res.message})
|
|
|
+ this.loading = false
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
- uni.showToast({icon: 'none',title: '请先输入手机号'})
|
|
|
+ uni.showToast({icon: 'none',title: '请输入验证码'})
|
|
|
}
|
|
|
},
|
|
|
+ // 获取验证码
|
|
|
+ getCodeValidate(){
|
|
|
+ sendVerifyCode({mobile: this.form.customerMobile}).then(res => {
|
|
|
+ if(res.status == 200){
|
|
|
+ // 开启倒计时
|
|
|
+ this.getCodeFun()
|
|
|
+ uni.showToast({icon: 'none',title: '验证码发送成功'})
|
|
|
+ }else{
|
|
|
+ this.code = ''
|
|
|
+ uni.showToast({icon: 'none',title: res.message})
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 开始倒计时
|
|
|
getCodeFun(){
|
|
|
const TIME_COUNT = 60
|
|
@@ -152,38 +192,6 @@
|
|
|
}, 1000)
|
|
|
}
|
|
|
},
|
|
|
- // 图文验证码
|
|
|
- captchaImg(code, nowRandomCode){
|
|
|
- this.captchaVerify(code, nowRandomCode)
|
|
|
- },
|
|
|
- // 验证图片验证码
|
|
|
- captchaVerify(code, nowRandomCode){
|
|
|
- const _this = this
|
|
|
- let obj = {}
|
|
|
- obj.phone = this.form.phone
|
|
|
- obj.random = nowRandomCode
|
|
|
- obj.captcha = code
|
|
|
- // 短信验证码
|
|
|
- memberVerifyCode(obj).then(res => {
|
|
|
- console.log(JSON.stringify(res))
|
|
|
- if(res.status == 200){ // 验证码输入正确
|
|
|
- _this.randomCode = nowRandomCode // 图片验证码随机码
|
|
|
- // 关闭 图形验证码 弹框
|
|
|
- _this.$refs.imageTxtPopup.close()
|
|
|
- // 开启倒计时
|
|
|
- this.getCodeFun()
|
|
|
- uni.showToast({icon: 'none',title: '验证码发送成功'})
|
|
|
- }else { // 验证码输入错误
|
|
|
- _this.randomCode = ''
|
|
|
- // 切换验证码重新校验
|
|
|
- _this.changeImg = false
|
|
|
- _this.$nextTick(function(){
|
|
|
- _this.changeImg = true
|
|
|
- })
|
|
|
- uni.showToast({icon: 'none',title: res.message})
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
}
|
|
|
}
|
|
|
</script>
|