From 350dcbfde3cb92c5d0e09e50ecd93c0fa912b742 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Tue, 23 Feb 2021 20:26:33 +0800 Subject: [PATCH] no message --- pages/client/bank-add/index.js | 79 ++++++++++------------------- pages/client/bank-add/index.json | 3 +- pages/client/bank-add/index.wxml | 20 ++++++-- pages/home/customer-info/index.js | 66 ++++++------------------ pages/home/customer-info/index.json | 4 ++ pages/home/customer-info/index.wxml | 14 ++++- pages/home/customer-list/index.js | 19 ++++++- pages/home/customer-list/index.json | 2 + pages/home/customer-list/index.wxml | 14 ++++- pages/home/employee/index.json | 1 + pages/home/employee/index.wxml | 4 +- pages/home/employee/index.wxss | 8 +++ 12 files changed, 123 insertions(+), 111 deletions(-) diff --git a/pages/client/bank-add/index.js b/pages/client/bank-add/index.js index 721f3cc..3c832cd 100644 --- a/pages/client/bank-add/index.js +++ b/pages/client/bank-add/index.js @@ -1,66 +1,43 @@ // pages/client/bank-add/index.js +import { postCaptcha, verifyCode } from "../../../api/user" Page({ - /** * 页面的初始数据 */ data: { - + second: '获取验证码', }, - /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - + fetchCaptcha: function(){ + if (!(/^1\d{10}$/.test(this.data.form.account)) || this.data.form.account.length < 11) { + util.showToast('请输入11位手机号码') + return + } + wx.showLoading({ title: '正在获取', mask: true }) + postCaptcha({ verifiableAccount: this.data.form.account, verifiableAccountType: 1, purpose: 1 }).then(result => { + wx.hideLoading() + this.setData({ codeEnable: false }) + util.showToast('验证码已经发送') + this.countDown = this.countDown || this.selectComponent('.count-down') + this.countDown.reset() + this.countDown.start() + }).catch(err => { + wx.hideLoading() + util.showToast(err) + }) + }, + onCountChange: function(e) { + if(e.detail.minutes != 0){ + return + } + this.setData({ second: e.detail.seconds + ' 秒 ' }) + }, + onFinished: function(){ + this.setData({ second: '重新获取验证码', codeEnable: true }) }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - } }) \ No newline at end of file diff --git a/pages/client/bank-add/index.json b/pages/client/bank-add/index.json index 896f4a4..346e5d4 100644 --- a/pages/client/bank-add/index.json +++ b/pages/client/bank-add/index.json @@ -1,5 +1,6 @@ { "usingComponents": { - "van-button": "/components/button/index" + "van-button": "/components/button/index", + "van-count-down": "/components/count-down/index" } } \ No newline at end of file diff --git a/pages/client/bank-add/index.wxml b/pages/client/bank-add/index.wxml index 38a10d4..e44a7df 100644 --- a/pages/client/bank-add/index.wxml +++ b/pages/client/bank-add/index.wxml @@ -4,19 +4,22 @@ - 安全绑卡,快捷支付 + 安全绑卡,快捷支付 持卡人姓名: - + 银行卡卡号: - + - + {{bankName}} {{cardType}} @@ -28,8 +31,15 @@ 验证码: + + + {{second}} + + - {{form.type == 4 ? '提交' : '下一步'}} + {{form.type == 4 ? '提交' : '下一步'}} \ No newline at end of file diff --git a/pages/home/customer-info/index.js b/pages/home/customer-info/index.js index 0a2e069..b04e577 100644 --- a/pages/home/customer-info/index.js +++ b/pages/home/customer-info/index.js @@ -5,62 +5,28 @@ Page({ * 页面的初始数据 */ data: { - + base64: null, + showEmbedded: false }, - /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - + onClickHideEmbedded: function(){ + this.setData({ showEmbedded: false }) + }, + addEmployee: function(event){ + wx.showLoading({ title: '加载中', mask: true }) + const form = { id: 5 } + form.metaData = { factoryId: app.userInfo.factoryId, factoryName: app.userInfo.factoryName } + generateCode(form).then(result => { + this.setData({ showEmbedded: true, base64: result.data }) + wx.hideLoading() + }).catch(err => { + wx.hideLoading() + util.showToast(err) + }) } }) \ No newline at end of file diff --git a/pages/home/customer-info/index.json b/pages/home/customer-info/index.json index d8da97c..73af34b 100644 --- a/pages/home/customer-info/index.json +++ b/pages/home/customer-info/index.json @@ -2,6 +2,10 @@ "usingComponents": { "van-button": "/components/button/index", "van-cell": "/components/cell/index", + "van-loading": "/components/loading/index", + "van-image": "/components/image/index", + "van-icon": "/components/icon/index", + "van-overlay": "/components/overlay/index", "van-notice-bar": "/components/notice-bar/index" } } \ No newline at end of file diff --git a/pages/home/customer-info/index.wxml b/pages/home/customer-info/index.wxml index 9dc2314..5ddd8d0 100644 --- a/pages/home/customer-info/index.wxml +++ b/pages/home/customer-info/index.wxml @@ -44,4 +44,16 @@ 保存 - \ No newline at end of file + + + + + + + + + + 为保证企业账户安全,二维码仅在3小时内有效,失效后,可重新生成。 + + + \ No newline at end of file diff --git a/pages/home/customer-list/index.js b/pages/home/customer-list/index.js index e502e85..f44d6d6 100644 --- a/pages/home/customer-list/index.js +++ b/pages/home/customer-list/index.js @@ -18,7 +18,9 @@ Page({ name: '', pageNum: 1, pageSize: 10 - } + }, + base64: null, + showEmbedded: false }, /** * 生命周期函数--监听页面加载 @@ -86,5 +88,20 @@ Page({ }, customerInfo: function(e){ wx.navigateTo({ url: '/pages/process/customer-info/index?id=' + e.currentTarget.dataset.id }) + }, + onClickHideEmbedded: function(){ + this.setData({ showEmbedded: false }) + }, + addEmployee: function(event){ + wx.showLoading({ title: '加载中', mask: true }) + const form = { id: 5 } + form.metaData = { factoryId: app.userInfo.factoryId, factoryName: app.userInfo.factoryName } + generateCode(form).then(result => { + this.setData({ showEmbedded: true, base64: result.data }) + wx.hideLoading() + }).catch(err => { + wx.hideLoading() + util.showToast(err) + }) } }) \ No newline at end of file diff --git a/pages/home/customer-list/index.json b/pages/home/customer-list/index.json index 233680a..60e7c90 100644 --- a/pages/home/customer-list/index.json +++ b/pages/home/customer-list/index.json @@ -5,6 +5,8 @@ "van-image": "/components/image/index", "van-divider": "/components/divider/index", "van-loading": "/components/loading/index", + "van-icon": "/components/icon/index", + "van-overlay": "/components/overlay/index", "van-cell": "/components/cell/index" } } \ No newline at end of file diff --git a/pages/home/customer-list/index.wxml b/pages/home/customer-list/index.wxml index 6e3512d..c9e3607 100644 --- a/pages/home/customer-list/index.wxml +++ b/pages/home/customer-list/index.wxml @@ -31,4 +31,16 @@ {{finished?'到底啦~':'加载中...'}} - \ No newline at end of file + + + + + + + + + + 为保证企业账户安全,二维码仅在3小时内有效,失效后,可重新生成。 + + + \ No newline at end of file diff --git a/pages/home/employee/index.json b/pages/home/employee/index.json index 56c48a4..ace011a 100644 --- a/pages/home/employee/index.json +++ b/pages/home/employee/index.json @@ -2,6 +2,7 @@ "usingComponents": { "van-cell": "/components/cell/index", "van-button": "/components/button/index", + "van-loading": "/components/loading/index", "van-image": "/components/image/index", "van-index-bar": "/components/index-bar/index", "van-index-anchor": "/components/index-anchor/index", diff --git a/pages/home/employee/index.wxml b/pages/home/employee/index.wxml index fca75c5..e9773ae 100644 --- a/pages/home/employee/index.wxml +++ b/pages/home/employee/index.wxml @@ -65,7 +65,9 @@ - + + + 保存二维码 diff --git a/pages/home/employee/index.wxss b/pages/home/employee/index.wxss index f7d282c..46691ca 100644 --- a/pages/home/employee/index.wxss +++ b/pages/home/employee/index.wxss @@ -35,4 +35,12 @@ justify-content: center; height: 100%; padding: 0px 15%; +} + +.image-load { + width: 525rpx; + height: 525rpx; + display: flex; + align-items: center; + justify-content: center; } \ No newline at end of file