From 3d02a07026e799a2a058e8b6de4dd41f4403ef14 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Tue, 30 Mar 2021 17:06:16 +0800 Subject: [PATCH] no message --- app.json | 1 + components/dialog/index.wxml | 64 +++++-------------- pages/client/registe/index.js | 99 +++++++++++++++++++++++++++++ pages/client/registe/index.json | 6 ++ pages/client/registe/index.wxml | 33 ++++++++++ pages/client/registe/index.wxss | 4 ++ pages/home/index/index.js | 2 +- pages/process/agent-list/index.js | 48 ++------------ pages/process/agent-list/index.wxml | 22 ++----- pages/process/order-info/index.wxml | 17 +++-- pages/process/order-list/index.js | 13 ++-- pages/process/order-list/index.wxml | 6 ++ pages/process/payment/index.js | 60 +++++++++++------ pages/process/payment/index.wxml | 47 +++++++++++++- pages/process/payment/index.wxss | 48 ++++++++++++-- project.config.json | 2 +- 16 files changed, 328 insertions(+), 144 deletions(-) create mode 100644 pages/client/registe/index.js create mode 100644 pages/client/registe/index.json create mode 100644 pages/client/registe/index.wxml create mode 100644 pages/client/registe/index.wxss diff --git a/app.json b/app.json index 30cc1c1..3e4055e 100644 --- a/app.json +++ b/app.json @@ -21,6 +21,7 @@ "pages/message/detail/index", "pages/storage/index/index", "pages/client/index/index", + "pages/client/registe/index", "pages/client/home/index", "pages/client/order-list/index", "pages/client/factory-list/index", diff --git a/components/dialog/index.wxml b/components/dialog/index.wxml index d814a3c..57d8d11 100644 --- a/components/dialog/index.wxml +++ b/components/dialog/index.wxml @@ -1,64 +1,34 @@ - - + + {{ title }} - {{ message }} - + {{ cancelButtonText }} - + {{ confirmButtonText }} diff --git a/pages/client/registe/index.js b/pages/client/registe/index.js new file mode 100644 index 0000000..853f350 --- /dev/null +++ b/pages/client/registe/index.js @@ -0,0 +1,99 @@ +// pages/home/password/index.js +// 页面已经废弃,因为UEC的修改,暂时不会提供修改密码的功能 +import { postCaptcha } from "../../../api/user" +import { getCustomerInfo, bindCustomer } from "../../../api/saas" +const util = require('../../../utils/util') +const app = getApp() + +Page({ + /** + * 页面的初始数据 + */ + data: { + second: '获取验证码', + codeEnable: false, + pwdType: 'password', + pwd_icon: 'attention', + form: { + mobile: null, + captcha: null + }, + loging: false, + customerInfo: null + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + if(options.id){ + wx.showLoading({ title: '正在获取', mask: true }) + getCustomerInfo(options.id).then(result => { + wx.hideLoading() + this.setData({ customerInfo: result.data }) + }).catch(err => { + wx.hideLoading() + util.showToast(err) + }) + } + }, + 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('请输入手机号码') + return + } + if (this.second && this.second.interval) return !1 + wx.showLoading({ title: '正在获取', mask: true }) + postCaptcha({ verifiableAccount: this.data.form.mobile, verifiableAccountType: 1, purpose: 1 }).then(result => { + wx.hideLoading() + this.setData({ codeEnable: true }) + util.showToast('验证码已经发送') + this.countDown = this.countDown || this.selectComponent('.count-down') + this.countDown.reset() + this.countDown.start() + }).catch(error => { + wx.hideLoading() + util.showToast(error) + }) + }, + onChange: function(e) { + this.setData({ second: e.detail.seconds + ' 秒 ' }) + }, + onFinished: function(){ + this.setData({ second: '重新获取验证码', codeEnable: false }) + }, + submitForm: function () { + if (this.data.loging || !this.data.customerInfo) { + return + } + if (util.isEmpty(this.data.form.mobile)) { + util.showToast('请输入客户手机号码') + return + } + if (util.isEmpty(this.data.form.captcha)) { + util.showToast('请输入验证码') + return + } + wx.showLoading({ title: '处理中', mask: true }) + this.setData({ loging: true }) + this.data.form.factorycustomerId = this.customerInfo.id + this.data.form.factoryId = app.userInfo.factoryId + bindCustomer(this.data.form).then(result => { + util.showBackToast('客户注册成功') + }).catch(error => { + wx.hideLoading() + util.showToast(error) + this.setData({ loging: false }) + }) + } + +}) \ No newline at end of file diff --git a/pages/client/registe/index.json b/pages/client/registe/index.json new file mode 100644 index 0000000..346e5d4 --- /dev/null +++ b/pages/client/registe/index.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "van-button": "/components/button/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 new file mode 100644 index 0000000..041ff81 --- /dev/null +++ b/pages/client/registe/index.wxml @@ -0,0 +1,33 @@ + + + 用户注册 + + + + + {{customerInfo.name}} + + + + + + 手机号: + + + + + + 验证码: + + + + + {{second}} + + + + + + + 提交 + diff --git a/pages/client/registe/index.wxss b/pages/client/registe/index.wxss new file mode 100644 index 0000000..7abbfbe --- /dev/null +++ b/pages/client/registe/index.wxss @@ -0,0 +1,4 @@ +/* pages/home/password/index.wxss */ +page { + background-color: #fff; +} diff --git a/pages/home/index/index.js b/pages/home/index/index.js index 4d4ebf4..b4716b8 100644 --- a/pages/home/index/index.js +++ b/pages/home/index/index.js @@ -74,7 +74,7 @@ Component({ } }, orderList: function(){ - wx.navigateTo({ url: '/pages/process/order-list/index' }) + wx.navigateTo({ url: '/pages/process/agent-list/index' }) }, tipApply: function(){ wx.navigateTo({ url: '/pages/htmls/auths/index' }) diff --git a/pages/process/agent-list/index.js b/pages/process/agent-list/index.js index 5f80ce8..158a0f5 100644 --- a/pages/process/agent-list/index.js +++ b/pages/process/agent-list/index.js @@ -1,6 +1,5 @@ // pages/process/order-list/index.js -import Dialog from '../../../components/dialog/dialog' -import { getFactoryOrderList, cancelOrder } from "../../../api/saas" +import { getFactoryOrderList } from "../../../api/saas" const event = require('../../../utils/event') const util = require('../../../utils/util') const app = getApp() @@ -12,10 +11,8 @@ Page({ tabIndex: 0, tabList: [ {id: 0, name: '全部', badge: 0, status: '' }, - {id: 1, name: '审核中', badge: 0, status: 1 }, - {id: 2, name: '审核未通过', badge: 0, status: 2 }, - {id: 4, name: '待付款', badge: 0, status: 4 }, - {id: 5, name: '已结算', badge: 0, status: 5 }, + {id: 1, name: '审核中', badge: 0, status: 41 }, + {id: 4, name: '已付款', badge: 0, status: 42 } // {id: 6, name: '已取消', badge: 0, status: 6 } ], loading: true, @@ -33,22 +30,6 @@ Page({ }, // * 生命周期函数--监听页面加载 onLoad: function (options) { - if(options.status){ - this.data.form.funcType = Number(options.status) - if(this.data.form.funcType == 1){ - this.data.title = '待定价订单' - } else if(this.data.form.funcType == 2){ - this.data.title = '过磅审核订单' - } else if(this.data.form.funcType == 3){ - this.data.title = '待付款订单' - } else if(this.data.form.funcType == 4){ - this.data.title = '已完成订单' - this.data.form.funcType = 6 - this.data.form.status = 5 - } else if(this.data.form.funcType == 5){ - this.data.title = '已关闭订单' - } - } event.on('OrderMessage', this, this.onEvent) this.setData({ height: app.globalData.fragmentHeight - 90, title: this.data.title }) this.fetchOrderList() @@ -138,30 +119,9 @@ Page({ this.setData({ finished: true, requesting: false, loading: false }) } }, - cancelOrder: function(e){ - Dialog.confirm({ title: '温馨提示', message: '确定取消该订单?' }).then(() => { - wx.showLoading({ title: '正在获取', mask: true }) - cancelOrder(e.currentTarget.dataset.id).then(result => { - wx.hideLoading() - util.showToast('订单已经删除') - this.onRefreshList() - }).catch(err => { - wx.hideLoading() - util.showToast(err) - }) - }) - }, lookItem: function (e) { var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index] - if(item.status == 2 || item.status == 3 || item.status == 4 || item.status == 5){ - wx.navigateTo({ url: `/pages/process/order-info/index?id=${item.id}` }) - } - }, - priceOrder: function(e){ - wx.navigateTo({ url: '/pages/process/order-price/index?id=' + e.currentTarget.dataset.id }) - }, - checkOrder: function(e){ - wx.navigateTo({ url: '/pages/process/order-info/index?id=' + e.currentTarget.dataset.id }) + wx.navigateTo({ url: `/pages/process/order-info/index?id=${item.id}` }) }, onUnload: function(){ event.remove('OrderMessage', this) diff --git a/pages/process/agent-list/index.wxml b/pages/process/agent-list/index.wxml index 1a4e6eb..e0eb448 100644 --- a/pages/process/agent-list/index.wxml +++ b/pages/process/agent-list/index.wxml @@ -1,9 +1,9 @@ - {{title}} + 代付订单 - + @@ -28,21 +28,11 @@ 毛重:{{item.totalWeight}}公斤 - - 取消 - 定价 + + 代付中 - - 审核 - - - 待过皮重 - - - 待付款 + + 待结算 已完成 diff --git a/pages/process/order-info/index.wxml b/pages/process/order-info/index.wxml index ce3bbf7..74873f7 100644 --- a/pages/process/order-info/index.wxml +++ b/pages/process/order-info/index.wxml @@ -13,11 +13,19 @@ 待过磅审核 - + 待付款(请前往后台支付) - + + + 代付审核中 + + + + 待结算(请前往后台支付) + + 已完成 @@ -146,12 +154,13 @@ - + + wx:if="{{form && (form.status == 3 || form.status == 4 || form.status == 42)}}"> 重新过皮重 通过审核 进行支付 + 客户结算 diff --git a/pages/process/order-list/index.js b/pages/process/order-list/index.js index 67d0ab8..809fd18 100644 --- a/pages/process/order-list/index.js +++ b/pages/process/order-list/index.js @@ -5,6 +5,7 @@ const event = require('../../../utils/event') const util = require('../../../utils/util') const app = getApp() +//1-定价 2-待过皮重 3-待过榜审核 4-待付款 41-代付中 42-待结算 5-已完成 6-已关闭 Page({ // * 页面的初始数据 data: { @@ -14,10 +15,12 @@ Page({ {id: 0, name: '全部', badge: 0, status: '' }, {id: 1, name: '待定价', badge: 0, status: 1 }, {id: 2, name: '待过皮重', badge: 0, status: 2 }, - {id: 3, name: '过磅审核', badge: 0, status: 3 }, + {id: 3, name: '待过榜审核', badge: 0, status: 3 }, {id: 4, name: '待付款', badge: 0, status: 4 }, - {id: 5, name: '已完成', badge: 0, status: 5 }, - // {id: 6, name: '已取消', badge: 0, status: 6 } + {id: 5, name: '代付中', badge: 0, status: 41 }, + {id: 6, name: '待结算', badge: 0, status: 42 }, + {id: 7, name: '已完成', badge: 0, status: 5 }, + // {id: 8, name: '已取消', badge: 0, status: 6 } ], loading: true, requesting: false, @@ -154,7 +157,9 @@ Page({ }, lookItem: function (e) { var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index] - if(item.status == 2 || item.status == 3 || item.status == 4 || item.status == 5){ + if(item.status == 1){ + wx.navigateTo({ url: `/pages/process/order-price/index?id=${item.id}` }) + } else { wx.navigateTo({ url: `/pages/process/order-info/index?id=${item.id}` }) } }, diff --git a/pages/process/order-list/index.wxml b/pages/process/order-list/index.wxml index 1a4e6eb..e49d679 100644 --- a/pages/process/order-list/index.wxml +++ b/pages/process/order-list/index.wxml @@ -44,6 +44,12 @@ 待付款 + + 代付中 + + + 待结算 + 已完成 diff --git a/pages/process/payment/index.js b/pages/process/payment/index.js index f59c276..e4c8b79 100644 --- a/pages/process/payment/index.js +++ b/pages/process/payment/index.js @@ -20,6 +20,7 @@ Page({ }, amount: 0, orderList: null, + orderStatus: null, params: { settleType: '1', ids: [], @@ -27,6 +28,7 @@ Page({ }, requesting: false, popup: false, + show: false, detail: null }, /** @@ -65,7 +67,15 @@ Page({ this.data.params.bankCardNo = element.bankCardNo } } - this.setData({ height: app.globalData.fragmentHeight, safeBottom: app.globalData.safeBottom, orderList, amount, params: this.data.params }) + this.data.orderStatus = orderList[0].status + this.setData({ + height: app.globalData.fragmentHeight, + safeBottom: app.globalData.safeBottom, + orderList, + amount, + params: this.data.params, + orderStatus: this.data.orderStatus + }) } else { this.setData({ height: app.globalData.fragmentHeight, safeBottom: app.globalData.safeBottom }) } @@ -107,6 +117,29 @@ Page({ bindInput: function (e) { this.data.params[e.target.id] = e.detail.value }, + agentPayment: function(settleType){ + if(Number(settleType) == 1 || Number(settleType) == 2){ + settleType = 3 + } + wx.showLoading({ title: '正在处理', mask: true }) + this.data.requesting = true + this.data.params.settleType = settleType + paymentOrder(this.data.params).then(result => { + wx.hideLoading() + if(!util.isEmpty(result.message)){ + util.showBackToast(result.message) + } else { + util.showBackToast('订单已支付') + } + const channel = this.getOpenerEventChannel() + channel.emit('onOrderChange', { what: 12, desc: 'PaymentOrder' }) + event.emit('OrderMessage', { what: 12, desc: 'PaymentOrder' }) + }).catch(err => { + wx.hideLoading() + this.data.requesting = false + util.showToast(err) + }) + }, paymentOrder: function(){ if(this.data.requesting){ return @@ -116,29 +149,12 @@ Page({ return } Dialog.confirm({ title: '温馨提示', message: '订单已经付款,在此进行确认?' }).then(() => { - wx.showLoading({ title: '正在获取', mask: true }) - this.data.requesting = true - this.data.params.settleType = Number(this.data.params.settleType) - paymentOrder(this.data.params).then(result => { - wx.hideLoading() - if(!util.isEmpty(result.message)){ - util.showBackToast(result.message) - } else { - util.showBackToast('订单已支付') - } - const channel = this.getOpenerEventChannel() - channel.emit('onOrderChange', { what: 12, desc: 'PaymentOrder' }) - event.emit('OrderMessage', { what: 12, desc: 'PaymentOrder' }) - }).catch(err => { - wx.hideLoading() - this.data.requesting = false - util.showToast(err) - }) + this.agentPayment(this.data.params.settleType) }).catch(err => { }) }, onPopupClose: function(){ - this.setData({ popup: false }) + this.setData({ popup: false, show: false}) }, viewImage: function (e) { var imgList = [] @@ -152,5 +168,9 @@ 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 6c6973b..66a97a6 100644 --- a/pages/process/payment/index.wxml +++ b/pages/process/payment/index.wxml @@ -27,7 +27,7 @@ - + @@ -70,7 +70,9 @@ - 付款 + 使用千鸟代付 + 直接付款 + 付款 @@ -199,4 +201,43 @@ - \ No newline at end of file + + + + + + + 该客户注册成为纸通宝用户,才可以使用千鸟代付,通过以下两种方式让您的客户注册成纸通宝用户。 + 1:让客户使用微信扫下面的二维码注册。 + + + + + + + 2:使用客户的手机号码,获取千鸟互联的验证码进行注册。 + + \ No newline at end of file diff --git a/pages/process/payment/index.wxss b/pages/process/payment/index.wxss index d304903..2028e22 100644 --- a/pages/process/payment/index.wxss +++ b/pages/process/payment/index.wxss @@ -1,5 +1,7 @@ /* pages/process/payment/index.wxss */ -.checkbox{ +@import '../../../components/common/index.wxss'; + +.checkbox { padding-top: 6rpx; } @@ -7,8 +9,46 @@ margin-right: 24rpx; } -.lable{ +.lable { padding: 32rpx 32rpx 24rpx 32rpx; - margin-top:18rpx; - border-bottom:1rpx solid #eee + margin-top: 18rpx; + border-bottom: 1rpx solid #eee +} + +.van-dialog { + top: 50% !important; + overflow: hidden; + width: 320px; + width: var(--dialog-width, 320px); + font-size: 16px; + font-size: var(--dialog-font-size, 16px); + border-radius: 16rpx; + border-radius: var(--dialog-border-radius, 16rpx); + background-color: #fff; + background-color: var(--dialog-background-color, #fff) +} + +.van-dialog__message { + overflow-y: auto; + text-align: center; + -webkit-overflow-scrolling: touch; + font-size: 14px; + font-size: var(--dialog-message-font-size, 14px); + line-height: 20px; + line-height: var(--dialog-message-line-height, 20px); + max-height: 60vh; + max-height: var(--dialog-message-max-height, 60vh); + padding: 24px; + padding: var(--dialog-message-padding, 24px) +} + +van-dialog__button { + -webkit-flex: 1; + flex: 1 +} + +.van-dialog__cancel, +.van-dialog__confirm { + border: 0 !important; + border-radius: 0px; } \ No newline at end of file diff --git a/project.config.json b/project.config.json index a3b16fb..8ac0a38 100644 --- a/project.config.json +++ b/project.config.json @@ -14,7 +14,7 @@ "coverView": true, "nodeModules": true, "autoAudits": false, - "showShadowRootInWxmlPanel": true, + "showShadowRootInWxmlPanel": false, "scopeDataCheck": false, "uglifyFileName": true, "checkInvalidKey": true,