From 5ee2eb972761cc68932cdafeb4ca94ce69b43170 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Tue, 30 Mar 2021 19:26:22 +0800 Subject: [PATCH] no message --- api/saas.js | 2 + pages/client/registe/index.js | 37 ++++++++------- pages/client/registe/index.json | 4 ++ pages/client/registe/index.wxml | 74 ++++++++++++++++++++--------- pages/home/customer-list/index.js | 34 ++++++------- pages/home/customer-list/index.wxml | 2 +- pages/process/payment/index.js | 17 ++++--- pages/process/payment/index.wxml | 19 ++------ 8 files changed, 110 insertions(+), 79 deletions(-) diff --git a/api/saas.js b/api/saas.js index 2066489..1de1415 100644 --- a/api/saas.js +++ b/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, diff --git a/pages/client/registe/index.js b/pages/client/registe/index.js index 853f350..83a2fa2 100644 --- a/pages/client/registe/index.js +++ b/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() diff --git a/pages/client/registe/index.json b/pages/client/registe/index.json index 346e5d4..5b4b1a9 100644 --- a/pages/client/registe/index.json +++ b/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" } } \ No newline at end of file diff --git a/pages/client/registe/index.wxml b/pages/client/registe/index.wxml index 041ff81..15939bd 100644 --- a/pages/client/registe/index.wxml +++ b/pages/client/registe/index.wxml @@ -3,31 +3,59 @@ 用户注册 - - - {{customerInfo.name}} + + 通过以下两种方式让您的客户注册成纸通宝用户。\n 1:让客户使用微信扫下面的二维码注册。\n2:使用客户的手机号码,获取千鸟互联的验证码进行注册。 - - - - 手机号: - + - - 提交 - + + + + + + + + 手机号: + + + + + + 验证码: + + + + + {{second}} + + + + + + 提交 + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/home/customer-list/index.js b/pages/home/customer-list/index.js index 54bb002..f53092c 100644 --- a/pages/home/customer-list/index.js +++ b/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) + // }) } }) \ No newline at end of file diff --git a/pages/home/customer-list/index.wxml b/pages/home/customer-list/index.wxml index d54b31d..43150a2 100644 --- a/pages/home/customer-list/index.wxml +++ b/pages/home/customer-list/index.wxml @@ -24,7 +24,7 @@ {{item.mobile || ('卡号:' + item.cardNo)}} 邀请注册纸通宝 + catchtap="bindCustomer" wx:if="{{!item.userId}}">注册纸通宝 diff --git a/pages/process/payment/index.js b/pages/process/payment/index.js index e4c8b79..39a33a4 100644 --- a/pages/process/payment/index.js +++ b/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 }) } }) \ No newline at end of file diff --git a/pages/process/payment/index.wxml b/pages/process/payment/index.wxml index 66a97a6..12592a4 100644 --- a/pages/process/payment/index.wxml +++ b/pages/process/payment/index.wxml @@ -27,9 +27,9 @@ - + @@ -227,17 +227,4 @@ --> - - - - 该客户注册成为纸通宝用户,才可以使用千鸟代付,通过以下两种方式让您的客户注册成纸通宝用户。 - 1:让客户使用微信扫下面的二维码注册。 - - - - - - - 2:使用客户的手机号码,获取千鸟互联的验证码进行注册。 - - \ No newline at end of file + \ No newline at end of file