分销认证新增 银行开户行 银行开户名 银行账号
parent
efb2a7963e
commit
9f48cc7110
|
@ -4,10 +4,10 @@
|
|||
*/
|
||||
// 开发环境
|
||||
const dev = {
|
||||
common: "https://common-api.pickmall.cn",
|
||||
buyer: "https://buyer-api.pickmall.cn",
|
||||
// common: "http://192.168.0.109:8890",
|
||||
// buyer: "http://192.168.0.109:8888",
|
||||
// common: "https://common-api.pickmall.cn",
|
||||
// buyer: "https://buyer-api.pickmall.cn",
|
||||
common: "http://192.168.0.109:8890",
|
||||
buyer: "http://192.168.0.109:8888",
|
||||
};
|
||||
// 生产环境
|
||||
const prod = {
|
||||
|
|
|
@ -8,10 +8,16 @@
|
|||
<u-input v-model="ruleForm.name" placeholder="请输入您的真实姓名" />
|
||||
</u-form-item>
|
||||
<u-form-item label="身份证" prop="idNumber">
|
||||
<u-input
|
||||
v-model="ruleForm.idNumber"
|
||||
placeholder="请输入身份证号码"
|
||||
/>
|
||||
<u-input v-model="ruleForm.idNumber" placeholder="请输入身份证号码" />
|
||||
</u-form-item>
|
||||
<u-form-item label="银行开户行" prop="settlementBankBranchName">
|
||||
<u-input v-model="ruleForm.settlementBankBranchName" type="text" placeholder="请输入银行开户行" />
|
||||
</u-form-item>
|
||||
<u-form-item label="银行开户名" prop="settlementBankAccountName">
|
||||
<u-input v-model="ruleForm.settlementBankAccountName" type="text" placeholder="请输入银行开户名" />
|
||||
</u-form-item>
|
||||
<u-form-item label="银行账号" prop="settlementBankAccountNum">
|
||||
<u-input v-model="ruleForm.settlementBankAccountNum" type="text" placeholder="请输入银行账号" />
|
||||
</u-form-item>
|
||||
<!-- <u-form-item label="身份证正面照" prop="name">
|
||||
<u-upload></u-upload>
|
||||
|
@ -23,7 +29,7 @@
|
|||
<u-upload></u-upload>
|
||||
</u-form-item> -->
|
||||
</u-form>
|
||||
<u-button :customStyle="{'background':$lightColor,'color':'#fff' }" @click="submit">提交</u-button>
|
||||
<u-button :customStyle="{'background':$lightColor,'color':'#fff' }" @click="submit">提交</u-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
@ -35,12 +41,16 @@
|
|||
</template>
|
||||
<script>
|
||||
import { applyDistribution } from "@/api/goods";
|
||||
import { checkBankno } from "@/utils/Foundation";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
ruleForm: {
|
||||
name: "",
|
||||
idNumber: "",
|
||||
settlementBankBranchName: "", // 银行开户行
|
||||
settlementBankAccountName: "", //银行开户名
|
||||
settlementBankAccountNum: "", //银行账号
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
|
@ -62,6 +72,50 @@ export default {
|
|||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
// 银行开户行
|
||||
settlementBankBranchName: [
|
||||
{
|
||||
required: true,
|
||||
message: "银行开户行",
|
||||
// 可以单个或者同时写两个触发验证方式
|
||||
trigger: "blur",
|
||||
},
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
// 上面有说,返回true表示校验通过,返回false表示不通过
|
||||
// this.$u.test.mobile()就是返回true或者false的
|
||||
return this.$u.test.chinese(value);
|
||||
},
|
||||
message: "银行开户行不正确",
|
||||
// 触发器可以同时用blur和change
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
], //银行开户名
|
||||
settlementBankAccountName: [
|
||||
{
|
||||
required: true,
|
||||
message: "银行开户名",
|
||||
// 可以单个或者同时写两个触发验证方式
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
//银行账号
|
||||
settlementBankAccountNum: [
|
||||
{
|
||||
required: true,
|
||||
message: "银行账号不正确",
|
||||
// 可以单个或者同时写两个触发验证方式
|
||||
trigger: "blur",
|
||||
},
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
// 上面有说,返回true表示校验通过,返回false表示不通过
|
||||
// this.$u.test.mobile()就是返回true或者false的
|
||||
return checkBankno(value);
|
||||
},
|
||||
message: "银行账号不正确",
|
||||
},
|
||||
],
|
||||
idNumber: [
|
||||
{
|
||||
required: true,
|
||||
|
@ -96,16 +150,14 @@ export default {
|
|||
icon: "none",
|
||||
});
|
||||
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack();
|
||||
},500)
|
||||
|
||||
}
|
||||
else{
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 500);
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
duration: 2000,
|
||||
icon:"none"
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -57,10 +57,7 @@
|
|||
applyInfo.refundWay == 'ORIGINAL' ? '原路退回' : '账号退款'
|
||||
" type="text" input-align="right" :disabled="true" />
|
||||
</u-form-item>
|
||||
<view v-if="
|
||||
applyInfo.accountType === 'BANK_TRANSFER' &&
|
||||
applyInfo.applyRefundPrice != 0
|
||||
">
|
||||
<view >
|
||||
<u-form-item label="银行开户行" :label-width="150">
|
||||
<u-input v-model="form.bankDepositName" type="text" input-align="right" placeholder="请输入银行开户行" />
|
||||
</u-form-item>
|
||||
|
@ -100,7 +97,7 @@ import {
|
|||
|
||||
import city from "@/components/m-city/m-city";
|
||||
import { upload } from "@/api/common.js";
|
||||
|
||||
import {checkBankno} from '@/utils/Foundation'
|
||||
import storage from "@/utils/storage.js";
|
||||
export default {
|
||||
component: {
|
||||
|
@ -278,6 +275,7 @@ export default {
|
|||
if (!this.handleCheckParams()) {
|
||||
return;
|
||||
}
|
||||
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
|
@ -297,71 +295,6 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 验证银行卡号
|
||||
*/
|
||||
checkBankno(bankno) {
|
||||
var lastNum = bankno.substr(bankno.length - 1, 1); //取出最后一位(与luhm进行比较)
|
||||
var first15Num = bankno.substr(0, bankno.length - 1); //前15或18位
|
||||
var newArr = [];
|
||||
|
||||
for (var i = first15Num.length - 1; i > -1; i--) {
|
||||
//前15或18位倒序存进数组
|
||||
newArr.push(first15Num.substr(i, 1));
|
||||
}
|
||||
|
||||
var arrJiShu = []; //奇数位*2的积 <9
|
||||
var arrJiShu2 = []; //奇数位*2的积 >9
|
||||
var arrOuShu = []; //偶数位数组
|
||||
for (var j = 0; j < newArr.length; j++) {
|
||||
if ((j + 1) % 2 == 1) {
|
||||
//奇数位
|
||||
if (parseInt(newArr[j]) * 2 < 9)
|
||||
arrJiShu.push(parseInt(newArr[j]) * 2);
|
||||
else arrJiShu2.push(parseInt(newArr[j]) * 2);
|
||||
} //偶数位
|
||||
else arrOuShu.push(newArr[j]);
|
||||
}
|
||||
|
||||
var jishu_child1 = []; //奇数位*2 >9 的分割之后的数组个位数
|
||||
var jishu_child2 = []; //奇数位*2 >9 的分割之后的数组十位数
|
||||
for (var h = 0; h < arrJiShu2.length; h++) {
|
||||
jishu_child1.push(parseInt(arrJiShu2[h]) % 10);
|
||||
jishu_child2.push(parseInt(arrJiShu2[h]) / 10);
|
||||
}
|
||||
|
||||
var sumJiShu = 0; //奇数位*2 < 9 的数组之和
|
||||
var sumOuShu = 0; //偶数位数组之和
|
||||
var sumJiShuChild1 = 0; //奇数位*2 >9 的分割之后的数组个位数之和
|
||||
var sumJiShuChild2 = 0; //奇数位*2 >9 的分割之后的数组十位数之和
|
||||
var sumTotal = 0;
|
||||
for (var m = 0; m < arrJiShu.length; m++) {
|
||||
sumJiShu = sumJiShu + parseInt(arrJiShu[m]);
|
||||
}
|
||||
for (var n = 0; n < arrOuShu.length; n++) {
|
||||
sumOuShu = sumOuShu + parseInt(arrOuShu[n]);
|
||||
}
|
||||
for (var p = 0; p < jishu_child1.length; p++) {
|
||||
sumJiShuChild1 = sumJiShuChild1 + parseInt(jishu_child1[p]);
|
||||
sumJiShuChild2 = sumJiShuChild2 + parseInt(jishu_child2[p]);
|
||||
}
|
||||
//计算总和
|
||||
sumTotal =
|
||||
parseInt(sumJiShu) +
|
||||
parseInt(sumOuShu) +
|
||||
parseInt(sumJiShuChild1) +
|
||||
parseInt(sumJiShuChild2);
|
||||
//计算Luhm值
|
||||
var k = parseInt(sumTotal) % 10 == 0 ? 10 : parseInt(sumTotal) % 10;
|
||||
var luhm = 10 - k;
|
||||
if (lastNum == luhm) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
//检测提交参数
|
||||
handleCheckParams() {
|
||||
|
||||
|
@ -398,7 +331,7 @@ export default {
|
|||
type: "error",
|
||||
});
|
||||
return false;
|
||||
} else if (this.checkBankno(this.form.bankAccountNumber) === false) {
|
||||
} else if (checkBankno(this.form.bankAccountNumber) === false) {
|
||||
this.$refs.uToast.show({
|
||||
title: "银行卡卡号不正确",
|
||||
type: "error",
|
||||
|
|
|
@ -73,7 +73,10 @@ export default {
|
|||
distribution().then((res) => {
|
||||
if (res.data.result) {
|
||||
let type = res.data.result.distributionStatus;
|
||||
|
||||
uni.navigateTo({
|
||||
url: "/pages/mine/distribution/auth",
|
||||
});
|
||||
return
|
||||
if (type == "PASS") {
|
||||
uni.navigateTo({
|
||||
url: "/pages/mine/distribution/home",
|
||||
|
@ -91,7 +94,7 @@ export default {
|
|||
}
|
||||
} else if (!res.data.success && res.data.code == 22000) {
|
||||
uni.showToast({
|
||||
title: '分销功能暂未开启',
|
||||
title: "分销功能暂未开启",
|
||||
duration: 2000,
|
||||
icon: "none",
|
||||
});
|
||||
|
|
|
@ -9,6 +9,69 @@
|
|||
* randomString 随机生成指定长度的字符串
|
||||
*/
|
||||
|
||||
/**
|
||||
* 验证银行卡号
|
||||
*/
|
||||
export function checkBankno(bankno) {
|
||||
var lastNum = bankno.substr(bankno.length - 1, 1); //取出最后一位(与luhm进行比较)
|
||||
var first15Num = bankno.substr(0, bankno.length - 1); //前15或18位
|
||||
var newArr = [];
|
||||
|
||||
for (var i = first15Num.length - 1; i > -1; i--) {
|
||||
//前15或18位倒序存进数组
|
||||
newArr.push(first15Num.substr(i, 1));
|
||||
}
|
||||
|
||||
var arrJiShu = []; //奇数位*2的积 <9
|
||||
var arrJiShu2 = []; //奇数位*2的积 >9
|
||||
var arrOuShu = []; //偶数位数组
|
||||
for (var j = 0; j < newArr.length; j++) {
|
||||
if ((j + 1) % 2 == 1) {
|
||||
//奇数位
|
||||
if (parseInt(newArr[j]) * 2 < 9) arrJiShu.push(parseInt(newArr[j]) * 2);
|
||||
else arrJiShu2.push(parseInt(newArr[j]) * 2);
|
||||
} //偶数位
|
||||
else arrOuShu.push(newArr[j]);
|
||||
}
|
||||
|
||||
var jishu_child1 = []; //奇数位*2 >9 的分割之后的数组个位数
|
||||
var jishu_child2 = []; //奇数位*2 >9 的分割之后的数组十位数
|
||||
for (var h = 0; h < arrJiShu2.length; h++) {
|
||||
jishu_child1.push(parseInt(arrJiShu2[h]) % 10);
|
||||
jishu_child2.push(parseInt(arrJiShu2[h]) / 10);
|
||||
}
|
||||
|
||||
var sumJiShu = 0; //奇数位*2 < 9 的数组之和
|
||||
var sumOuShu = 0; //偶数位数组之和
|
||||
var sumJiShuChild1 = 0; //奇数位*2 >9 的分割之后的数组个位数之和
|
||||
var sumJiShuChild2 = 0; //奇数位*2 >9 的分割之后的数组十位数之和
|
||||
var sumTotal = 0;
|
||||
for (var m = 0; m < arrJiShu.length; m++) {
|
||||
sumJiShu = sumJiShu + parseInt(arrJiShu[m]);
|
||||
}
|
||||
for (var n = 0; n < arrOuShu.length; n++) {
|
||||
sumOuShu = sumOuShu + parseInt(arrOuShu[n]);
|
||||
}
|
||||
for (var p = 0; p < jishu_child1.length; p++) {
|
||||
sumJiShuChild1 = sumJiShuChild1 + parseInt(jishu_child1[p]);
|
||||
sumJiShuChild2 = sumJiShuChild2 + parseInt(jishu_child2[p]);
|
||||
}
|
||||
//计算总和
|
||||
sumTotal =
|
||||
parseInt(sumJiShu) +
|
||||
parseInt(sumOuShu) +
|
||||
parseInt(sumJiShuChild1) +
|
||||
parseInt(sumJiShuChild2);
|
||||
//计算Luhm值
|
||||
var k = parseInt(sumTotal) % 10 == 0 ? 10 : parseInt(sumTotal) % 10;
|
||||
var luhm = 10 - k;
|
||||
if (lastNum == luhm) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录后跳转判断
|
||||
* 计算出当前router路径
|
||||
|
@ -154,12 +217,11 @@ export function countTimeDown(seconds) {
|
|||
};
|
||||
}
|
||||
|
||||
|
||||
function navigationToBack(type) {
|
||||
if (type == "wx") {
|
||||
// console.log(getCurrentPages().length - 3)
|
||||
uni.navigateBack({
|
||||
delta: getCurrentPages().length ,
|
||||
delta: getCurrentPages().length,
|
||||
});
|
||||
} else {
|
||||
uni.switchTab({
|
||||
|
@ -194,4 +256,5 @@ module.exports = {
|
|||
countTimeDown,
|
||||
theNextDayTime,
|
||||
whetherNavigate,
|
||||
checkBankno,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue