|
|
@ -47,23 +47,34 @@ |
|
|
|
<view class="zfb" v-show="activeIndex==2"> |
|
|
|
<view class="zfb" v-show="activeIndex==2"> |
|
|
|
<u-upload |
|
|
|
<u-upload |
|
|
|
:fileList="zfbPic" |
|
|
|
:fileList="zfbPic" |
|
|
|
:previewFullImage="true" |
|
|
|
:previewFullImage="false" |
|
|
|
@afterRead="" |
|
|
|
@afterRead="afterRead" |
|
|
|
:maxCount="1" width="176" height="176" |
|
|
|
width="176" height="176" |
|
|
|
|
|
|
|
style="display: none;" |
|
|
|
|
|
|
|
ref="uploadzfb" |
|
|
|
name="1" |
|
|
|
name="1" |
|
|
|
multiple |
|
|
|
|
|
|
|
></u-upload> |
|
|
|
></u-upload> |
|
|
|
|
|
|
|
<image :src="zfburl" v-if="zfburl" mode="" @click="uploadZfb"></image> |
|
|
|
|
|
|
|
<image src="/static/image/up_img.png" v-else mode="" @click="uploadZfb"></image> |
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="zfb" v-show="activeIndex==3"> |
|
|
|
<view class="zfb" v-show="activeIndex==3"> |
|
|
|
<u-upload |
|
|
|
<u-upload |
|
|
|
:fileList="zfbPic" |
|
|
|
:fileList="wxPic" |
|
|
|
:previewFullImage="true" |
|
|
|
:previewFullImage="false" |
|
|
|
@afterRead="" |
|
|
|
@afterRead="afterRead" |
|
|
|
:maxCount="1" width="176" height="176" |
|
|
|
width="176" height="176" |
|
|
|
name="1" |
|
|
|
style="display: none;" |
|
|
|
multiple |
|
|
|
ref="uploadwx" |
|
|
|
|
|
|
|
name="2" |
|
|
|
|
|
|
|
|
|
|
|
></u-upload> |
|
|
|
></u-upload> |
|
|
|
|
|
|
|
<image :src="wxurl" mode="" v-if="wxurl" @click="uploadwx"></image> |
|
|
|
|
|
|
|
<image src="/static/image/up_img.png" mode="" v-else @click="uploadwx"></image> |
|
|
|
|
|
|
|
<view class="mesInfo"> |
|
|
|
|
|
|
|
微信收款码,上传后将无法修改,请认真上传。 |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="yhk"> |
|
|
|
<view class="yhk"> |
|
|
|
<view class="list-input"> |
|
|
|
<view class="list-input"> |
|
|
@ -71,7 +82,7 @@ |
|
|
|
<text>手机号</text> |
|
|
|
<text>手机号</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="content"> |
|
|
|
<view class="content"> |
|
|
|
<input type="text" v-model="mobileForm.phone" placeholder="请输入手机号"> |
|
|
|
<input type="text" disabled v-model="mobileForm.simplephone" placeholder="请输入手机号"> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="list-input"> |
|
|
|
<view class="list-input"> |
|
|
@ -81,7 +92,7 @@ |
|
|
|
<view class="content"> |
|
|
|
<view class="content"> |
|
|
|
<input type="text" v-model="mobileForm.code" placeholder="请输入验证码"> |
|
|
|
<input type="text" v-model="mobileForm.code" placeholder="请输入验证码"> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="yzmBtn" v-show="!codeSend"> |
|
|
|
<view class="yzmBtn" v-show="!codeSend" @click="getCode"> |
|
|
|
获取验证码 |
|
|
|
获取验证码 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="yzmBtn" v-show="codeSend"> |
|
|
|
<view class="yzmBtn" v-show="codeSend"> |
|
|
@ -89,7 +100,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="saveBtn"> |
|
|
|
<view class="saveBtn" :style="issave?'opacity:1':'opacity:0.4'" @click="issave?submitSave():''"> |
|
|
|
|
|
|
|
|
|
|
|
{{activeIndex==1?'保存银行卡':activeIndex==2?'保存支付宝二维码':activeIndex==3?'保存微信二维码':''}} |
|
|
|
{{activeIndex==1?'保存银行卡':activeIndex==2?'保存支付宝二维码':activeIndex==3?'保存微信二维码':''}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -100,7 +111,8 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import {updateUserInfo,smsSend} from '@/common/api.js' |
|
|
|
import {getToken} from '@/common/auth.js' |
|
|
|
|
|
|
|
import {updateUserInfo,smsSend,getUserInfo,smsCheck} from '@/common/api.js' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
@ -124,28 +136,53 @@ |
|
|
|
codeSend:false, |
|
|
|
codeSend:false, |
|
|
|
timeNum:59, |
|
|
|
timeNum:59, |
|
|
|
timer:null, |
|
|
|
timer:null, |
|
|
|
|
|
|
|
fileList1:[], |
|
|
|
|
|
|
|
fileList2:[], |
|
|
|
zfbPic:[], |
|
|
|
zfbPic:[], |
|
|
|
|
|
|
|
zfburl:'', |
|
|
|
|
|
|
|
wxPic:[], |
|
|
|
|
|
|
|
wxurl:'', |
|
|
|
mobileForm:{ |
|
|
|
mobileForm:{ |
|
|
|
phone: '', |
|
|
|
phone: '', |
|
|
|
|
|
|
|
simplephone:'', |
|
|
|
code: '', |
|
|
|
code: '', |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
issave:false, |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
onLoad(option) { |
|
|
|
|
|
|
|
this.getUserInfoHandle() |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
methods:{ |
|
|
|
|
|
|
|
//获取用户信息 |
|
|
|
|
|
|
|
getUserInfoHandle(){ |
|
|
|
|
|
|
|
getUserInfo().then(res=>{ |
|
|
|
|
|
|
|
this.mobileForm.phone =res.data.mobile |
|
|
|
|
|
|
|
this.mobileForm.simplephone=this.mobileForm.phone.replace(/^(\d{3})\d{4}(\d{4})/,'$1****$2') |
|
|
|
|
|
|
|
Object.keys(this.yhk).forEach(item=>{ |
|
|
|
|
|
|
|
this.yhk[item] = res.data[item] |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.zfburl = res.data.alipay_image; |
|
|
|
|
|
|
|
this.wxurl = res.data.wechat_image; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
getPay(item){ |
|
|
|
getPay(item){ |
|
|
|
this.activeIndex = item.id |
|
|
|
this.activeIndex = item.id; |
|
|
|
|
|
|
|
clearInterval(this.timer); |
|
|
|
|
|
|
|
this.mobileForm.code=''; |
|
|
|
|
|
|
|
this.timeNum = 59; |
|
|
|
|
|
|
|
this.codeSend = false; |
|
|
|
}, |
|
|
|
}, |
|
|
|
getCode(){ |
|
|
|
getCode(){ |
|
|
|
|
|
|
|
// let event = this.activeIndex==1?'bank':this.activeIndex==2?'alipay':'wechat' |
|
|
|
if(!this.mobileForm.phone){ |
|
|
|
if(!this.mobileForm.phone){ |
|
|
|
this.$refs.uToast.show({ |
|
|
|
this.$refs.uToast.show({ |
|
|
|
message:'请输入手机号码' |
|
|
|
message:'请输入手机号码' |
|
|
|
}) |
|
|
|
}) |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
smsSend({mobile:this.mobileForm.phone}).then(res=>{ |
|
|
|
smsSend({mobile:this.mobileForm.phone,event:'notice'}).then(res=>{ |
|
|
|
if(res.code==1){ |
|
|
|
if(res.code==1){ |
|
|
|
this.codeSend = true; |
|
|
|
this.codeSend = true; |
|
|
|
this.timer = setInterval(()=>{ |
|
|
|
this.timer = setInterval(()=>{ |
|
|
@ -160,11 +197,128 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
submitSave(){ |
|
|
|
|
|
|
|
if(!this.mobileForm.code){ |
|
|
|
|
|
|
|
this.$refs.uToast.show({ |
|
|
|
|
|
|
|
message:'请输入验证码' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
smsCheck({mobile:this.mobileForm.phone,captcha:this.mobileForm.code,event:'notice'}).then(res=>{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(res.code==1){ |
|
|
|
|
|
|
|
if(this.activeIndex==1){ |
|
|
|
|
|
|
|
updateUserInfo(this.yhk).then(res=>{ |
|
|
|
|
|
|
|
console.log(res,"999") |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}else if(this.activeIndex==2){ |
|
|
|
|
|
|
|
updateUserInfo({alipay_image:this.zfburl}).then(res=>{ |
|
|
|
|
|
|
|
console.log(res,"999zfb") |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}else if(this.activeIndex==3){ |
|
|
|
|
|
|
|
updateUserInfo({wechat_image:this.wxurl}).then(res=>{ |
|
|
|
|
|
|
|
console.log(res,"999wx") |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
uploadZfb(){ |
|
|
|
|
|
|
|
this.$refs.uploadzfb.chooseFile() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
uploadwx(){ |
|
|
|
|
|
|
|
this.$refs.uploadwx.chooseFile() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 新增图片 |
|
|
|
|
|
|
|
async afterRead(event) { |
|
|
|
|
|
|
|
console.log(event) |
|
|
|
|
|
|
|
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式 |
|
|
|
|
|
|
|
let lists = [].concat(event.file) |
|
|
|
|
|
|
|
let fileListLen = this[`fileList${event.name}`].length |
|
|
|
|
|
|
|
lists.map((item) => { |
|
|
|
|
|
|
|
this[`fileList${event.name}`].push({ |
|
|
|
|
|
|
|
...item, |
|
|
|
|
|
|
|
status: 'uploading', |
|
|
|
|
|
|
|
message: '上传中' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
for (let i = 0; i < lists.length; i++) { |
|
|
|
|
|
|
|
const result = await this.uploadFilePromise(lists[i].url) |
|
|
|
|
|
|
|
if(event.name==1){ |
|
|
|
|
|
|
|
this.zfburl = JSON.parse(result).data.fullurl; |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.wxurl = JSON.parse(result).data.fullurl; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//上传照片 |
|
|
|
|
|
|
|
uploadFilePromise(url) { |
|
|
|
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
|
|
|
let a = uni.uploadFile({ |
|
|
|
|
|
|
|
url: this.baseUrl+'api/common/upload', |
|
|
|
|
|
|
|
filePath: url, |
|
|
|
|
|
|
|
name: 'file', |
|
|
|
|
|
|
|
header:{ |
|
|
|
|
|
|
|
token:getToken() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
formData: { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
success: (res) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(JSON.parse(res.data).code==1){ |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
// this.finishImageList.push({url:JSON.parse(res.data).data.fullurl,path:JSON.parse(res.data).data.url}) |
|
|
|
|
|
|
|
resolve(res.data) |
|
|
|
|
|
|
|
}, 1000) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
uni.$u.toast(JSON.parse(res.data).msg) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
resolve(res.data) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
fail: (res) => { |
|
|
|
|
|
|
|
console.log(res,"rrr") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
destroyed() { |
|
|
|
destroyed() { |
|
|
|
clearInterval(this.timer) |
|
|
|
clearInterval(this.timer) |
|
|
|
this.timer = null; |
|
|
|
this.timer = null; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
watch:{ |
|
|
|
|
|
|
|
activeIndex:{ |
|
|
|
|
|
|
|
handler(newValue, oldValue) { |
|
|
|
|
|
|
|
if(newValue==1){ |
|
|
|
|
|
|
|
if(this.yhk.bank_realname && this.yhk.bank_mobile && this.yhk.bank_no && this.yhk.bank_address){ |
|
|
|
|
|
|
|
this.issave = true; |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.issave = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}else if(newValue==2){ |
|
|
|
|
|
|
|
this.issave = true; |
|
|
|
|
|
|
|
}else if(newValue==3){ |
|
|
|
|
|
|
|
this.issave = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
yhk:{ |
|
|
|
|
|
|
|
handler(newValue, oldValue) { |
|
|
|
|
|
|
|
if(newValue.bank_realname && newValue.bank_mobile && newValue.bank_no && newValue.bank_address){ |
|
|
|
|
|
|
|
this.issave = true; |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.issave = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
deep: true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|