shangjia1.1/pages/store/withdraw/alipay.js

109 lines
2.5 KiB
JavaScript
Raw Normal View History

2024-11-08 14:33:35 +08:00
let that = {}
export default {
data() {
return {
showInfo: false,
form: {
payType: '提现到银行',
payTypeValue: 2,
},
bankImgUp: 'http://yuledui.oss-cn-qingdao.aliyuncs.com/merch_manage/img/bank_card_setting/take_photo.png',// 银行卡照片OCR
openAutoPay: true,
border: false,
showPayType: false,
labelPosition: 'left',
errorType: ['message'],
rules: {
bank_name: [
{
required: true,
message: '请输入姓名',
trigger: 'blur',
},
{
min: 3,
max: 5,
message: '姓名长度在3到5个字符',
trigger: ['change', 'blur'],
},
{
// 此为同步验证可以直接返回true或者false如果是异步验证稍微不同见下方说明
validator: (rule, value, callback) => {
return this.$u.test.chinese(value);
},
message: '姓名必须为中文',
trigger: ['change', 'blur'],
},
]
}
};
},
onLoad: function () {
that = this
that.init();
},
methods: {
init() {
getApp().globalData.util.request({
s: 'Merch.Mershop_Alipay.get'
}).then(res => {
that.form = res.data.data
that.form.alipay_account2 = res.data.data.alipay_account
})
},
submit() {
if (that.form.alipay_account2 !== that.form.alipay_account) {
uni.showModal({
title: '提示',
content: '两次输入的手机号不一致'
});
return
}
getApp().globalData.util.request({
s: 'Merch.Mershop_Alipay.update',
alipay_account: that.form.alipay_account,
alipay_realname: that.form.alipay_realname
}).then(res => {
uni.showModal({
title: '提示',
content: res.data.data.res_msg,
showCancel:false,
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
}
}
})
})
},
selectColor(items) {
if (items[0].value == 'no') {
that.openAutoPay = false
} else {
that.openAutoPay = true
}
},
// 银行卡识别OCR
getBankOCR: function (fileUrl) {
uni.showLoading({
title: '识别中'
})
uni.request({
url: 'https://yld.angyakeji.com/www/src/tools/aliyun/ocr.php',
data: {
fileUrl: fileUrl,
type: 'bankcard'
},
complete: (res) => {
uni.hideLoading()
if (res.data && res.data.Data) {
let fres = res.data.Data
that.$set(that.form, 'bank_com', fres.BankName)
that.$set(that.form, 'bank_no', fres.CardNumber)
that.$set(that.form, 'bank_no2', fres.CardNumber)
}
},
})
},
}
}