Browse Source

no message

feature/v1.1
xpz2018 5 years ago
parent
commit
5ee2eb9727
8 changed files with 110 additions and 79 deletions
  1. 2
      api/saas.js
  2. 37
      pages/client/registe/index.js
  3. 4
      pages/client/registe/index.json
  4. 74
      pages/client/registe/index.wxml
  5. 34
      pages/home/customer-list/index.js
  6. 2
      pages/home/customer-list/index.wxml
  7. 17
      pages/process/payment/index.js
  8. 19
      pages/process/payment/index.wxml

2
api/saas.js

@ -36,6 +36,7 @@ const editCustomer = (params) => mPost(`/ztb-factory/factory/edit/customer`, par
const deleteCustomer = (id) => mPost(`/ztb-factory/factory/delete/customer/${id}`, null, sconfig)
const getCustomerInfo = (id) => mGet(`/ztb-factory/factory/wechat-applet/get/customer-detail/${id}`, null, sconfig)
const bindCustomer = (params) => mPost(`/ztb-factory/user/binding/factory-customer`, params, sconfig)
const registeCustomer = (params) => mPost(`/ztb-factory/register-and-binding/factory-customer`, params, sconfig)
const getCustomerOrderList = (params) => mGet(`ztb-factory/factory-customer/get/order-list`, params, sconfig)
export {
@ -64,6 +65,7 @@ export {
deleteCustomer,
getCustomerInfo,
bindCustomer,
registeCustomer,
getPaperList,
repeatOrder,
getStatisticsInfo,

37
pages/client/registe/index.js

@ -1,7 +1,6 @@
// pages/home/password/index.js
// 页面已经废弃,因为UEC的修改,暂时不会提供修改密码的功能
import { postCaptcha } from "../../../api/user"
import { getCustomerInfo, bindCustomer } from "../../../api/saas"
import { generateCode, postCaptcha } from "../../../api/user"
import { getCustomerInfo, registeCustomer } from "../../../api/saas"
const util = require('../../../utils/util')
const app = getApp()
@ -12,11 +11,10 @@ Page({
data: {
second: '获取验证码',
codeEnable: false,
pwdType: 'password',
pwd_icon: 'attention',
form: {
mobile: null,
captcha: null
captcha: null,
accountType: 2
},
loging: false,
customerInfo: null
@ -28,8 +26,21 @@ Page({
if(options.id){
wx.showLoading({ title: '正在获取', mask: true })
getCustomerInfo(options.id).then(result => {
wx.hideLoading()
this.setData({ customerInfo: result.data })
const params = { id: 6 }
params.metaData = {
factoryId: app.userInfo.factoryId,
factoryName: app.userInfo.factoryName,
factoryCustomerId: result.data.id,
factoryCustomerName: result.data.name,
factoryCustomerMobile: result.data.mobile
}
generateCode(params).then(result => {
this.setData({ base64: result.data })
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
})
}).catch(err => {
wx.hideLoading()
util.showToast(err)
@ -39,13 +50,6 @@ Page({
bindForm: function (e) {
this.data.form[e.target.id] = e.detail.value
},
changePwd: function (e) {
if (this.data.pwdType === 'password') {
this.setData({ pwdType: 'text', pwd_icon: 'attentionforbid' })
} else {
this.setData({ pwdType: 'password', pwd_icon: 'attention' })
}
},
fetchCode: function () {
if (util.isEmpty(this.data.form.mobile)) {
util.showToast('请输入手机号码')
@ -85,9 +89,10 @@ Page({
}
wx.showLoading({ title: '处理中', mask: true })
this.setData({ loging: true })
this.data.form.factorycustomerId = this.customerInfo.id
this.data.form.account = this.data.form.mobile
this.data.form.factorycustomerId = this.data.customerInfo.id
this.data.form.factoryId = app.userInfo.factoryId
bindCustomer(this.data.form).then(result => {
registeCustomer(this.data.form).then(result => {
util.showBackToast('客户注册成功')
}).catch(error => {
wx.hideLoading()

4
pages/client/registe/index.json

@ -1,6 +1,10 @@
{
"usingComponents": {
"van-button": "/components/button/index",
"van-image": "/components/image/index",
"van-tab": "/components/tab/index",
"van-tabs": "/components/tabs/index",
"van-cell": "/components/cell/index",
"van-count-down": "/components/count-down/index"
}
}

74
pages/client/registe/index.wxml

@ -3,31 +3,59 @@
<view slot="content" style="color:black;font-size:18px">用户注册</view>
</cu-custom>
<view class="flex flex-center flex-column" style="width:100%;height:320rpx;margin-top:80rpx">
<image style="width:192rpx;height:192rpx" src="/assets/image/ygImg.png"></image>
<view class="text-xl" wx:if="{{customerInfo}}">{{customerInfo.name}}</view>
<view style="padding: 8px 16px;color: #ed6a0c;background-color: #fffbe8">
<text slot user-select="true">通过以下两种方式让您的客户注册成纸通宝用户。\n 1:让客户使用微信扫下面的二维码注册。\n2:使用客户的手机号码,获取千鸟互联的验证码进行注册。</text>
</view>
<view class="cu-list menu no-card sm-border margin-top">
<view class="cu-item">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:170rpx">手机号:</view>
<input id="mobile" maxlength="11" disabled="true" type="number" value="{{form.mobile}}" placeholder="请输入客户手机号码" bindinput="bindForm"></input>
<!-- <van-cell>
<view slot="title" class="flex flex-justify" data-id="{{item.id}}" bindtap="customerInfo">
<van-image round width="80rpx" height="80rpx" src="{{ '/assets/image/ygImg.png' }}" />
<view style="margin-left:18rpx;width:100%;flex:1">
<view class="text-sg text-bold">{{customerInfo.name || ''}}</view>
<view class="text-sm text-gray" style="line-height:32rpx">{{customerInfo.mobile}}</view>
</view>
</view>
<view class="cu-item">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:170rpx">验证码:</view>
<input id="captcha" maxlength="6" type="number" placeholder="请输入验证码" bindinput="bindForm"></input>
</view>
<van-button size="small" plain type="info" custom-style="width:220rpx" disabled="{{codeEnable}}" bind:click="fetchCode">
<van-count-down id="count-down" time="{{ 60000 }}" use-slot auto-start="{{false}}" bind:change="onChange" bind:finish="onFinished">
<text class="text-sm">{{second}}</text>
</van-count-down>
</van-button>
</view>
</view>
</van-cell> -->
<view class="flex flex-direction" style="padding:80rpx 32rpx">
<van-button block type="info" loading="{{loging}}" loading-text="提交..." bind:click="submitForm">提交</van-button>
</view>
<!-- <view class="flex flex-center flex-column" style="width:100%;height:240rpx;margin-top:32rpx">
<image style="width:128rpx;height:128rpx" src="/assets/image/ygImg.png"></image>
<view class="text-xl" wx:if="{{customerInfo}}" style="margin-top:24rpx">{{customerInfo.name}}</view>
</view> -->
<van-tabs active="{{ 0 }}" color="#008AFF" line-height="2rpx">
<van-tab title="手机验证码">
<view class="cu-list menu no-card" style="margin-top:32rpx;padding: 0rpx 48rpx">
<view class="cu-item" style="padding: 16rpx 24rpx;">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:120rpx">手机号:</view>
<input id="mobile" maxlength="11" type="number" value="{{form.mobile}}" placeholder="请输入客户手机号码" bindinput="bindForm"></input>
</view>
</view>
<view class="cu-item" style="padding: 16rpx 24rpx;border-bottom:2rpx solid #f3f3f3">
<view class="flex content cu-item" style="font-size:28rpx">
<view style="min-width:120rpx">验证码:</view>
<input id="captcha" maxlength="6" type="number" placeholder="请输入验证码" bindinput="bindForm"></input>
</view>
<van-button size="small" plain type="info" custom-style="width:220rpx" disabled="{{codeEnable}}"
bind:click="fetchCode">
<van-count-down id="count-down" time="{{ 60000 }}" use-slot auto-start="{{false}}" bind:change="onChange"
bind:finish="onFinished">
<text class="text-sm">{{second}}</text>
</van-count-down>
</van-button>
</view>
</view>
<view class="flex flex-direction" style="padding:80rpx 96rpx;margin-top:48rpx">
<van-button block type="info" loading="{{loging}}" loading-text="提交..." bind:click="submitForm">提交</van-button>
</view>
</van-tab>
<van-tab title="二维码">
<view class="flex flex-center" style="padding-top:48rpx">
<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>
</van-tab>
</van-tabs>

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

@ -94,21 +94,23 @@ Page({
},
bindCustomer: function(e){
var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index]
wx.showLoading({ title: '加载中', mask: true })
const form = { id: 6 }
form.metaData = {
factoryId: app.userInfo.factoryId,
factoryName: app.userInfo.factoryName,
factoryCustomerId: item.id,
factoryCustomerName: item.name,
factoryCustomerMobile: item.mobile
}
generateCode(form).then(result => {
this.setData({ showEmbedded: true, base64: result.data, customerName: item.name })
wx.hideLoading()
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
wx.navigateTo({ url: `/pages/client/registe/index?id=${item.id}` })
// wx.showLoading({ title: '加载中', mask: true })
// const form = { id: 6 }
// form.metaData = {
// factoryId: app.userInfo.factoryId,
// factoryName: app.userInfo.factoryName,
// factoryCustomerId: item.id,
// factoryCustomerName: item.name,
// factoryCustomerMobile: item.mobile
// }
// generateCode(form).then(result => {
// this.setData({ showEmbedded: true, base64: result.data, customerName: item.name })
// wx.hideLoading()
// }).catch(err => {
// wx.hideLoading()
// util.showToast(err)
// })
}
})

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

@ -24,7 +24,7 @@
<view class="text-sm text-gray" style="line-height:32rpx">{{item.mobile || ('卡号:' + item.cardNo)}}</view>
</view>
<view class="text-blue" style="padding:6rpx 0rpx" data-page="{{pageIndex}}" data-index="{{index}}"
catchtap="bindCustomer" wx:if="{{!item.userId}}">邀请注册纸通宝</view>
catchtap="bindCustomer" wx:if="{{!item.userId}}">注册纸通宝</view>
</view>
</van-cell>
</view>

17
pages/process/payment/index.js

@ -118,7 +118,7 @@ Page({
this.data.params[e.target.id] = e.detail.value
},
agentPayment: function(settleType){
if(Number(settleType) == 1 || Number(settleType) == 2){
if(Number(settleType) != 1 || Number(settleType) != 2){
settleType = 3
}
wx.showLoading({ title: '正在处理', mask: true })
@ -138,6 +138,12 @@ Page({
wx.hideLoading()
this.data.requesting = false
util.showToast(err)
Dialog.confirm({ title: '温馨提示', message: '该客户注册成为纸通宝用户,才可以使用千鸟代付,现在去注册?' }).then(() => {
var cid = this.data.orderList[0].factoryCustomerId
wx.navigateTo({ url: '/pages/client/registe/index?id=' + cid })
}).catch(err => {
})
})
},
paymentOrder: function(){
@ -148,8 +154,9 @@ Page({
util.showToast('请选择要付款的订单')
return
}
Dialog.confirm({ title: '温馨提示', message: '订单已经付款,在此进行确认?' }).then(() => {
this.agentPayment(this.data.params.settleType)
Dialog.confirm({ title: '温馨提示', message: '该客户注册成为纸通宝用户,才可以使用千鸟代付,现在去注册?' }).then(() => {
var cid = this.data.orderList[0].factoryCustomerId
wx.navigateTo({ url: '/pages/client/registe/index?id=' + cid })
}).catch(err => {
})
},
@ -168,9 +175,5 @@ Page({
}
}
wx.previewImage({ urls: imgList, current: e.currentTarget.dataset.url })
},
registerCustomer: function(){
var cid = this.data.orderList[0].factoryCustomerId
wx.navigateTo({ url: '/pages/client/registe/index?id=' + cid })
}
})

19
pages/process/payment/index.wxml

@ -27,9 +27,9 @@
</text>
<van-radio slot="right-icon" name="2" disabled="{{!params.bankCardNo}}" />
</van-cell>
<van-cell title="使用千鸟代付" clickable data-name="3" bind:click="onTypeClick" wx:if="{{orderStatus == 4}}">
<!-- <van-cell title="使用千鸟代付" clickable data-name="3" bind:click="onTypeClick" wx:if="{{orderStatus == 4}}">
<van-radio slot="right-icon" name="3" />
</van-cell>
</van-cell> -->
</van-cell-group>
</van-radio-group>
</view>
@ -227,17 +227,4 @@
</van-popup> -->
<van-dialog id="van-dialog" />
<van-dialog use-slot title="温馨提示" show="{{ show }}" custom-style="top: 52% !important;" show-cancel-button confirm-button-text="验证码注册" bind:confirm="registerCustomer">
<view class="van-dialog__message" style="text-align: start;padding: 24px 24px 0px 24px">
<text class="van-dialog__message-text" user-select="true">该客户注册成为纸通宝用户,才可以使用千鸟代付,通过以下两种方式让您的客户注册成纸通宝用户。
1:让客户使用微信扫下面的二维码注册。
</text>
</view>
<view class="flex flex-center" style="padding: 12rpx 0rpx">
<image src="https://img.yzcdn.cn/1.jpg" style="height: 320rpx;width:320rpx"/>
</view>
<view class="van-dialog__message" style="text-align: start;padding: 0px 24px 24px 24px">
<text user-select="true">2:使用客户的手机号码,获取千鸟互联的验证码进行注册。</text>
</view>
</van-dialog>
Loading…
Cancel
Save