| | |
| | | let $api = require('../../utils/ajaxFn.js') |
| | | let md5 = require('../../utils/md5.js') |
| | | let validator = require('../../utils/validator.js') |
| | | const app = getApp() |
| | | Page({ |
| | | data: { |
| | |
| | | info:{ |
| | | newPwd: "", |
| | | oldPwd: "" |
| | | } |
| | | }, |
| | | userInfo:{} |
| | | }, |
| | | onLoad() { |
| | | this.setData({ |
| | | userStyle:app.userStyle |
| | | userStyle:app.userStyle, |
| | | userInfo:app.userInfo |
| | | }) |
| | | }, |
| | | getOld(e){ |
| | | this.setData({ |
| | | 'info.oldPwd':md5.hex_md5(e.detail.value) |
| | | 'info.oldPwd':e.detail.value |
| | | }) |
| | | }, |
| | | getNem(e){ |
| | | this.setData({ |
| | | 'info.newPwd':md5.hex_md5(e.detail.value) |
| | | 'info.newPwd':e.detail.value |
| | | }) |
| | | }, |
| | | getNemTwo(e){ |
| | | console.log(3) |
| | | this.setData({ |
| | | newTwo: md5.hex_md5(e.detail.value) |
| | | newTwo: e.detail.value |
| | | }) |
| | | }, |
| | | save(){ |
| | | console.log(this.data.newTwo,this.data.info) |
| | | console.log(this.data.userInfo.mblNo,this.data.newTwo,this.data.info) |
| | | if(validator.checkValEmpty(this.data.info.oldPwd)){ |
| | | my.showToast({ |
| | | content: '请输入原密码', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | if(validator.checkValEmpty(this.data.info.newPwd)){ |
| | | my.showToast({ |
| | | content: '请输入新密码', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | if(this.data.newTwo != this.data.info.newPwd){ |
| | | my.showToast({ |
| | | content: '两次新密码不一致,请确认', |
| | |
| | | }, |
| | | true, |
| | | { |
| | | ...this.data.info |
| | | newPwd: md5.hex_md5(this.data.userInfo.mblNo+this.data.info.newPwd), |
| | | oldPwd: md5.hex_md5(this.data.userInfo.mblNo+this.data.info.oldPwd) |
| | | } |
| | | ) |
| | | } |
| | |
| | | }) |
| | | }else if(code == 2){ |
| | | this.setData({ |
| | | 'info.newPwd':md5.hex_md5(e.detail.value) |
| | | 'info.newPwd':e.detail.value |
| | | }) |
| | | }else{ |
| | | this.setData({ |
| | | newPwdTwo: md5.hex_md5(e.detail.value) |
| | | newPwdTwo:e.detail.value |
| | | }) |
| | | } |
| | | }, |
| | |
| | | err=>{}, |
| | | false, |
| | | { |
| | | ...this.data.info |
| | | mblNo:this.data.info.mblNo, |
| | | verCode:this.data.info.verCode, |
| | | newPwd: md5.hex_md5(this.data.info.mblNo+this.data.info.newPwd) |
| | | } |
| | | ) |
| | | } |
| | |
| | | |
| | | const app = getApp() |
| | | let $api = require('../../../utils/ajaxFn.js') |
| | | let validator = require('../../../utils/validator.js') |
| | | Page({ |
| | | data: { |
| | | isBoss: true, |
| | |
| | | this.setData({ |
| | | info: { ...this.data.info, ...obj } |
| | | }) |
| | | console.log(this.data.info) |
| | | if (code == 1) { |
| | | if (!this.data.info.amt || !this.data.info.prodId || !this.data.info.term || !this.data.info.zfbVersion) { |
| | | this.setData({ |
| | |
| | | ] |
| | | }) |
| | | this.getList({ prodId: this.data.info.prodId }) |
| | | console.log(this.data.info.amt, this.data.info.prodId, this.data.info.term, this.data.info.zfbVersion) |
| | | if (!this.data.info.amt || !this.data.info.prodId || !this.data.info.term || !this.data.info.zfbVersion) { |
| | | this.setData({ |
| | | isBoss: false |
| | |
| | | termName: this.data.termsList[e.detail.value].name, |
| | | 'info.term': this.data.termsList[e.detail.value].code |
| | | }) |
| | | console.log(this.data.info.amt, this.data.info.prodId, this.data.info.term, this.data.info.zfbVersion) |
| | | if (!this.data.info.amt || !this.data.info.prodId || !this.data.info.term || !this.data.info.zfbVersion) { |
| | | this.setData({ |
| | | isBoss: false |
| | |
| | | { name: '支付利率', rate: 0 } |
| | | ] |
| | | }) |
| | | console.log(this.data.info.amt, this.data.info.prodId, this.data.info.term, this.data.info.zfbVersion) |
| | | this.getList({ prodId: this.data.info.prodId, zfbVersion: this.data.info.zfbVersion }) |
| | | if (!this.data.info.amt || !this.data.info.prodId || !this.data.info.term || !this.data.info.zfbVersion) { |
| | | this.setData({ |
| | |
| | | this.setData({ |
| | | 'info.payType': 2 |
| | | }) |
| | | for (let key in this.data.info) { |
| | | if (!this.data.info[key]) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请完整输入信息', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | let info = this.data.info |
| | | if (!validator.checkbdMoney(info.amt)||info.amt==0) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请输入0.01-100000之间分期本金', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | if (validator.checkValEmpty(info.goodsName)) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请输入商品名称', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | if (validator.checkValEmpty(info.prodId)) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请选择付息方式', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | if (validator.checkValEmpty(info.zfbVersion)) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请选择办单通道', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | if (validator.checkValEmpty(info.term)) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请选择分期期数', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | if (validator.checkValEmpty(info.userName)) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请输入客户姓名', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | if (validator.checkValEmpty(info.userMblNo)) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请输入客户手机号', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | my.scan({ |
| | | scanType: ['qrCode', 'barCode'], |
| | |
| | | this.setData({ |
| | | 'info.payType': 1 |
| | | }) |
| | | for (let key in this.data.info) { |
| | | if (!this.data.info[key]) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请完整输入信息', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | // for (let key in this.data.info) { |
| | | // if (!this.data.info[key]) { |
| | | // my.showToast({ |
| | | // type: 'none', |
| | | // content: '请完整输入信息', |
| | | // duration: 2000, |
| | | // }); |
| | | // return |
| | | // } |
| | | // } |
| | | let info = this.data.info |
| | | if (!validator.checkbdMoney(info.amt)||info.amt==0) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请输入0.01-100000之间分期本金', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | if (validator.checkValEmpty(info.goodsName)) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请输入商品名称', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | if (validator.checkValEmpty(info.prodId)) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请选择付息方式', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | if (validator.checkValEmpty(info.zfbVersion)) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请选择办单通道', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | if (validator.checkValEmpty(info.term)) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请选择分期期数', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | if (validator.checkValEmpty(info.userName)) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请输入客户姓名', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | if (validator.checkValEmpty(info.userMblNo)) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请输入客户手机号', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | let str = JSON.stringify(this.data.info) |
| | | my.navigateTo({ |
| | |
| | | font-family: PingFang SC; |
| | | font-weight: 500; |
| | | color: #666666; |
| | | position: fixed; |
| | | bottom: 28px; |
| | | left: 35%; |
| | | padding-top: 30vh; |
| | | } |
| | |
| | | '/sib/xcx/login/mgrLogin', |
| | | 'POST', |
| | | (res)=>{ |
| | | this.userInfo = res.data.body |
| | | app.userInfo = res.data.body |
| | | my.reLaunch({ |
| | | url: '/pages/home/home' |
| | | }); |
| | |
| | | let $api = require('../../../utils/ajaxFn.js') |
| | | let validator = require('../../../utils/validator.js') |
| | | Page({ |
| | | data: { |
| | | userStyle: {}, |
| | |
| | | this.setData({ |
| | | 'info.payType': 2 |
| | | }) |
| | | for (let key in this.data.info) { |
| | | if (!this.data.info[key]) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请完整输入信息', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | // for (let key in this.data.info) { |
| | | // if (!this.data.info[key]) { |
| | | // my.showToast({ |
| | | // type: 'none', |
| | | // content: '请输入商品金额', |
| | | // duration: 2000, |
| | | // }); |
| | | // return |
| | | // } |
| | | // } |
| | | let info = this.data.info |
| | | if (!validator.checkbdMoney(info.payAmt)||info.payAmt==0) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请输入0.01-100000之间商品金额', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | my.scan({ |
| | | scanType: ['qrCode', 'barCode'], |
| | |
| | | this.setData({ |
| | | 'info.payType': 1 |
| | | }) |
| | | for (let key in this.data.info) { |
| | | if (!this.data.info[key]) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请完整输入信息', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | // for (let key in this.data.info) { |
| | | // if (!this.data.info[key]) { |
| | | // my.showToast({ |
| | | // type: 'none', |
| | | // content: '请完整输入信息', |
| | | // duration: 2000, |
| | | // }); |
| | | // return |
| | | // } |
| | | // } |
| | | let info = this.data.info |
| | | if (!validator.checkbdMoney(info.payAmt)||info.payAmt==0) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请输入0.01-100000之间商品金额', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | |
| | | let str = JSON.stringify(this.data.info) |
| | | console.log(this.data.info) |
| | | my.navigateTo({ |
| | |
| | | var params = {...data} |
| | | // console.log(needLogin) |
| | | if(needLogin){ |
| | | console.log('验签字符串',str+my.getStorageSync ({ key: 'sessionId' }).data.sessionId) |
| | | console.log('加密',md5.hex_md5('30000003100阿萨德13阿三1588888888810759c883-e0b6-45ea-85db-07d67bb4f509')) |
| | | // console.log('验签字符串',str+my.getStorageSync ({ key: 'sessionId' }).data.sessionId) |
| | | // console.log('加密',md5.hex_md5('30000003100阿萨德13阿三1588888888810759c883-e0b6-45ea-85db-07d67bb4f509')) |
| | | let sessionId = my.getStorageSync ({ key: 'sessionId' }).data.sessionId |
| | | // params.sessionId = sessionId |
| | | params.jttechSign = md5.hex_md5(str+sessionId) |
| | |
| | | }) |
| | | }, |
| | | }); |
| | | my.removeStorageSync({ |
| | | key: 'sessionId', |
| | | }); |
| | | }else{ |
| | | my.hideLoading(); |
| | | my.showToast({ |
| | |
| | | // 如果通过的话,那么判断小数点的前几位数字 |
| | | return reg.test(commission); |
| | | }, |
| | | |
| | | // 验证输入金额 |
| | | checkbdMoney(commission) { |
| | | //一亿以内,保留四位小数 |
| | | let reg = /^([1-7]\d{0,7}|0)(\.\d{1,2})?$/ |
| | | // 如果通过的话,那么判断小数点的前几位数字 |
| | | return reg.test(commission); |
| | | }, |
| | | // 验证渠道编号是否符合规则--4-8位以内数字+字母,区分大小写 |
| | | checkChannelNo(channelNo) { |
| | | let reg = /^[\w\d]{4,8}$/; |