Browse Source

no message

feature/v1.0
xpz2018 5 years ago
parent
commit
350dcbfde3
12 changed files with 123 additions and 111 deletions
  1. 79
      pages/client/bank-add/index.js
  2. 3
      pages/client/bank-add/index.json
  3. 20
      pages/client/bank-add/index.wxml
  4. 66
      pages/home/customer-info/index.js
  5. 4
      pages/home/customer-info/index.json
  6. 14
      pages/home/customer-info/index.wxml
  7. 19
      pages/home/customer-list/index.js
  8. 2
      pages/home/customer-list/index.json
  9. 14
      pages/home/customer-list/index.wxml
  10. 1
      pages/home/employee/index.json
  11. 4
      pages/home/employee/index.wxml
  12. 8
      pages/home/employee/index.wxss

79
pages/client/bank-add/index.js

@ -1,66 +1,43 @@
// pages/client/bank-add/index.js // pages/client/bank-add/index.js
import { postCaptcha, verifyCode } from "../../../api/user"
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
second: '获取验证码',
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { 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 () {
}
}) })

3
pages/client/bank-add/index.json

@ -1,5 +1,6 @@
{ {
"usingComponents": { "usingComponents": {
"van-button": "/components/button/index"
"van-button": "/components/button/index",
"van-count-down": "/components/count-down/index"
} }
} }

20
pages/client/bank-add/index.wxml

@ -4,19 +4,22 @@
</cu-custom> </cu-custom>
<view class="flex flex-center" style="padding:32rpx"> <view class="flex flex-center" style="padding:32rpx">
<text class="text-xxl">安全绑卡,快捷支付</text>
<text class="text-xxl">安全绑卡,快捷支付</text>
</view> </view>
<view class="cu-form-group margin-top"> <view class="cu-form-group margin-top">
<view class="title">持卡人姓名:</view> <view class="title">持卡人姓名:</view>
<input id="name" maxlength="16" style="width:65%" disabled="{{true}}" value="{{form.name}}" placeholder="请输入持卡人姓名" bindinput="bindForm"></input>
<input id="name" maxlength="16" style="width:65%" disabled="{{true}}" value="{{form.name}}" placeholder="请输入持卡人姓名"
bindinput="bindForm"></input>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title">银行卡卡号:</view> <view class="title">银行卡卡号:</view>
<input id="cardNo" maxlength="24" style="width:65%" type="number" value="{{form.cardNo}}" bindinput="bindForm" placeholder="请输入银行卡卡号" bindinput="bindForm"></input>
<input id="cardNo" maxlength="24" style="width:65%" type="number" value="{{form.cardNo}}" bindinput="bindForm"
placeholder="请输入银行卡卡号" bindinput="bindForm"></input>
</view> </view>
<view class="cu-form-group" wx:if="{{form.cardName}}"> <view class="cu-form-group" wx:if="{{form.cardName}}">
<image class="cu-avatar sm round" src="{{'https://medou.oss-cn-shenzhen.aliyuncs.com/bank/' + form.cardName + '.png'}}"></image>
<image class="cu-avatar sm round"
src="{{'https://medou.oss-cn-shenzhen.aliyuncs.com/bank/' + form.cardName + '.png'}}"></image>
<view style="margin-left:24rpx">{{bankName}}</view> <view style="margin-left:24rpx">{{bankName}}</view>
<view class="text-gray" style="margin-left:24rpx">{{cardType}}</view> <view class="text-gray" style="margin-left:24rpx">{{cardType}}</view>
</view> </view>
@ -28,8 +31,15 @@
<view class="cu-form-group" wx:if="{{form.type == 4}}"> <view class="cu-form-group" wx:if="{{form.type == 4}}">
<view class="title">验证码:</view> <view class="title">验证码:</view>
<input id="verificationCode" maxlength="6" type="number" placeholder="请输入验证码" bindinput="bindForm"></input> <input id="verificationCode" maxlength="6" type="number" placeholder="请输入验证码" bindinput="bindForm"></input>
<van-button size="small" plain type="info" custom-style="width:220rpx" disabled="{{!mobileEnable || !codeEnable}}"
bind:click="fetchCaptcha">
<van-count-down class="count-down" time="{{ 60000 }}" use-slot auto-start="{{false}}" bind:change="onCountChange"
bind:finish="onFinished">
<text class="text-sm">{{second}}</text>
</van-count-down>
</van-button>
</view> </view>
<view style="margin-top:20rpx;padding:80rpx 32rpx"> <view style="margin-top:20rpx;padding:80rpx 32rpx">
<van-button block type="info" bind:click="submitForm">{{form.type == 4 ? '提交' : '下一步'}}</van-button>
<van-button block type="info" bind:click="submitForm">{{form.type == 4 ? '提交' : '下一步'}}</van-button>
</view> </view>

66
pages/home/customer-info/index.js

@ -5,62 +5,28 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
base64: null,
showEmbedded: false
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { 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)
})
} }
}) })

4
pages/home/customer-info/index.json

@ -2,6 +2,10 @@
"usingComponents": { "usingComponents": {
"van-button": "/components/button/index", "van-button": "/components/button/index",
"van-cell": "/components/cell/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" "van-notice-bar": "/components/notice-bar/index"
} }
} }

14
pages/home/customer-info/index.wxml

@ -44,4 +44,16 @@
<van-button block type="info" bind:click="submitForm">保存</van-button> <van-button block type="info" bind:click="submitForm">保存</van-button>
</view> </view>
</view>
</view>
<van-overlay show="{{ showEmbedded }}" duration="{{0}}" bind:click="onClickHideEmbedded">
<view class="wrapper flex-column" catch:tap="noop">
<view style="position: relative;background-color:white;margin-top:48px">
<van-image use-loading-slot width="525rpx" height="525rpx" src="data:image/png;base64,{{base64}}">
<view class="image-load" slot="loading"><van-loading type="spinner" size="32" /></view>
</van-image>
</view>
<text class="text-df text-white" style="margin-top:36rpx;text-align:center">为保证企业账户安全,二维码仅在3小时内有效,失效后,可重新生成。</text>
<van-icon name="close" color="white" size="36px" custom-style="margin-top:48px" catch:tap="onClickHideEmbedded" />
</view>
</van-overlay>

19
pages/home/customer-list/index.js

@ -18,7 +18,9 @@ Page({
name: '', name: '',
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}
},
base64: null,
showEmbedded: false
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
@ -86,5 +88,20 @@ Page({
}, },
customerInfo: function(e){ customerInfo: function(e){
wx.navigateTo({ url: '/pages/process/customer-info/index?id=' + e.currentTarget.dataset.id }) 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)
})
} }
}) })

2
pages/home/customer-list/index.json

@ -5,6 +5,8 @@
"van-image": "/components/image/index", "van-image": "/components/image/index",
"van-divider": "/components/divider/index", "van-divider": "/components/divider/index",
"van-loading": "/components/loading/index", "van-loading": "/components/loading/index",
"van-icon": "/components/icon/index",
"van-overlay": "/components/overlay/index",
"van-cell": "/components/cell/index" "van-cell": "/components/cell/index"
} }
} }

14
pages/home/customer-list/index.wxml

@ -31,4 +31,16 @@
<van-loading type="spinner" size="16" wx:if="{{!finished}}" /> <van-loading type="spinner" size="16" wx:if="{{!finished}}" />
<text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text> <text class="text-sm" style="margin-left:8rpx">{{finished?'到底啦~':'加载中...'}}</text>
</van-divider> </van-divider>
</refresh-view>
</refresh-view>
<van-overlay show="{{ showEmbedded }}" duration="{{0}}" bind:click="onClickHideEmbedded">
<view class="wrapper flex-column" catch:tap="noop">
<view style="position: relative;background-color:white;margin-top:48px">
<van-image use-loading-slot width="525rpx" height="525rpx" src="data:image/png;base64,{{base64}}">
<view class="image-load" slot="loading"><van-loading type="spinner" size="32" /></view>
</van-image>
</view>
<text class="text-df text-white" style="margin-top:36rpx;text-align:center">为保证企业账户安全,二维码仅在3小时内有效,失效后,可重新生成。</text>
<van-icon name="close" color="white" size="36px" custom-style="margin-top:48px" catch:tap="onClickHideEmbedded" />
</view>
</van-overlay>

1
pages/home/employee/index.json

@ -2,6 +2,7 @@
"usingComponents": { "usingComponents": {
"van-cell": "/components/cell/index", "van-cell": "/components/cell/index",
"van-button": "/components/button/index", "van-button": "/components/button/index",
"van-loading": "/components/loading/index",
"van-image": "/components/image/index", "van-image": "/components/image/index",
"van-index-bar": "/components/index-bar/index", "van-index-bar": "/components/index-bar/index",
"van-index-anchor": "/components/index-anchor/index", "van-index-anchor": "/components/index-anchor/index",

4
pages/home/employee/index.wxml

@ -65,7 +65,9 @@
<van-overlay show="{{ showEmbedded }}" duration="{{0}}" bind:click="onClickHideEmbedded"> <van-overlay show="{{ showEmbedded }}" duration="{{0}}" bind:click="onClickHideEmbedded">
<view class="wrapper flex-column" catch:tap="noop"> <view class="wrapper flex-column" catch:tap="noop">
<view style="position: relative;background-color:white;margin-top:48px"> <view style="position: relative;background-color:white;margin-top:48px">
<van-image width="525rpx" height="525rpx" src="data:image/png;base64,{{base64}}" />
<van-image use-loading-slot width="525rpx" height="525rpx" src="data:image/png;base64,{{base64}}">
<view class="image-load" slot="loading"><van-loading type="spinner" size="32" /></view>
</van-image>
</view> </view>
<van-button block type="info" custom-style="margin-top:36rpx;width:525rpx" bind:click="saveQrcode">保存二维码 <van-button block type="info" custom-style="margin-top:36rpx;width:525rpx" bind:click="saveQrcode">保存二维码
</van-button> </van-button>

8
pages/home/employee/index.wxss

@ -35,4 +35,12 @@
justify-content: center; justify-content: center;
height: 100%; height: 100%;
padding: 0px 15%; padding: 0px 15%;
}
.image-load {
width: 525rpx;
height: 525rpx;
display: flex;
align-items: center;
justify-content: center;
} }
Loading…
Cancel
Save