From c479292fb4d49fe728cea5672d895f304a52895d Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Fri, 30 Apr 2021 15:11:40 +0800 Subject: [PATCH] no message --- api/saas.js | 6 ++- components/image-cropper/index.js | 4 +- pages/home/customer-list/index.json | 1 - pages/home/employee/index.js | 47 ----------------------- pages/home/employee/index.wxml | 14 ------- pages/home/user-info/index.json | 1 - pages/home/user-info/index.wxml | 58 ++++++++++++++--------------- pages/index/index.js | 9 +++-- pages/index/index.wxml | 16 +++++--- pages/process/index/index.js | 25 +++++++++---- pages/process/index/index.wxml | 6 ++- pages/settlement/bank-list/index.js | 4 +- 12 files changed, 74 insertions(+), 117 deletions(-) diff --git a/api/saas.js b/api/saas.js index c8efeba..22f037f 100644 --- a/api/saas.js +++ b/api/saas.js @@ -63,7 +63,8 @@ const auditOutOrder = (params) => mPost(`/ztb-factory/audit/outbount-delivery-or const receiptOutOrder = (params) => mPost(`/ztb-factory/confirm/outbound-delivery-order-receipt`, params, sconfig) const createOutOrder = (params) => mPost(`/ztb-factory/relevancy/weight-note/and/outbound-delivery-order`, params, sconfig) const bindBankCard = (params) => mPost(`/ztb-factory/factory/binding/bank-card`, params, sconfig) -const postFeedback = (params) => mPost(`/saas-user/account/feedback`, params, sconfig) +const getBankCardList = () => mGet(`/ztb-factory/get/factory-bank-card-list`, null, sconfig) +const deleteBankcard = (params) => mPost(`/ztb-factory/delete/factory-bank-card`, params, sconfig) export { sconfig, @@ -120,5 +121,6 @@ export { receiptOutOrder, createOutOrder, bindBankCard, - postFeedback + getBankCardList, + deleteBankcard } \ No newline at end of file diff --git a/components/image-cropper/index.js b/components/image-cropper/index.js index 89263fd..47dc864 100644 --- a/components/image-cropper/index.js +++ b/components/image-cropper/index.js @@ -294,9 +294,7 @@ Component({ //检查canvas是否在范围内 this._canvasDetectionPosition(); //初始化完成 - this.triggerEvent('load', { - cropper: this - }) + this.triggerEvent('load', { cropper: this }) }, methods: { /** diff --git a/pages/home/customer-list/index.json b/pages/home/customer-list/index.json index 226b343..16e2883 100644 --- a/pages/home/customer-list/index.json +++ b/pages/home/customer-list/index.json @@ -6,7 +6,6 @@ "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", "notification": "/pages/message/notification/index" } diff --git a/pages/home/employee/index.js b/pages/home/employee/index.js index 9084bb2..453d8f5 100644 --- a/pages/home/employee/index.js +++ b/pages/home/employee/index.js @@ -12,15 +12,9 @@ Scene({ data: { type: 0, height: app.globalData.fragmentHeight, - base64: null, loading: true, checkList: [], memberList: [], - showEmbedded: false, - show: false, - actions: [ - { id: 1, name: '删除该员工' } - ], nowIndex: -1, qrcode: null }, @@ -110,50 +104,9 @@ Scene({ wx.hideLoading() }).catch(err => { wx.hideLoading() - console.log(err) util.showToast(err) }) }, - 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) - }) - }, - saveQrcode: function(){ - var fsm = wx.getFileSystemManager() - var ten = parseInt( Math.random() * 10) - var that = this - var number = Math.random().toString().replace('.', '') - fsm.writeFile({ - filePath: wx.env.USER_DATA_PATH + '/qrcode' + (ten + number) + '.png', - data: that.data.base64, - encoding: 'base64', - success: res => { - wx.saveImageToPhotosAlbum({ - filePath: wx.env.USER_DATA_PATH + '/qrcode' + (ten + number) + '.png', - success: function (res) { - that.setData({ showEmbedded: false }) - util.showToast('保存成功') - }, - fail: function (err) { - that.setData({ showEmbedded: false }) - } - }) - }, fail: err => { - that.setData({ showEmbedded: false }) - } - }) - }, onShareAppMessage: function () { return { title: '邀请您加入' + app.userInfo.factoryName, diff --git a/pages/home/employee/index.wxml b/pages/home/employee/index.wxml index 631ca74..30bf039 100644 --- a/pages/home/employee/index.wxml +++ b/pages/home/employee/index.wxml @@ -61,18 +61,4 @@ - - \ No newline at end of file diff --git a/pages/home/user-info/index.json b/pages/home/user-info/index.json index 43f5c09..53e58de 100644 --- a/pages/home/user-info/index.json +++ b/pages/home/user-info/index.json @@ -1,7 +1,6 @@ { "usingComponents": { "van-cell": "/components/cell/index", - "van-cell-group": "/components/cell-group/index", "van-info": "/components/info/index", "van-icon": "/components/icon/index", "van-switch": "/components/switch/index", diff --git a/pages/home/user-info/index.wxml b/pages/home/user-info/index.wxml index a363b15..23c033b 100644 --- a/pages/home/user-info/index.wxml +++ b/pages/home/user-info/index.wxml @@ -3,38 +3,36 @@ 个人资料 - - - - 头像 - - - - - - - - 实名制认证 - - {{userInfo.isAuth == 1 ? '已认证' : '未实名认证'}} - 去认证 - - - - - - 关注纸厂 + + + 头像 + + + + + + + + 实名制认证 + + {{userInfo.isAuth == 1 ? '已认证' : '未实名认证'}} + 去认证 - - - + + --> diff --git a/pages/index/index.js b/pages/index/index.js index 6719425..633cebd 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -18,7 +18,7 @@ Scene({ { index: 3, value: 'home', badge: 0, name: '我的', blue: '/assets/tabbar/home-blue.png', gray: '/assets/tabbar/home-gray.png' } ], tabIndex: 1, - visiable: true, + zIndex: 9, setInter: null }, /************************************** 初始化流程 ********************************************/ @@ -29,7 +29,7 @@ Scene({ // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 updateManager.applyUpdate() }) - event.on('TabMessage', this, this.onEvent) + // event.on('TabMessage', this, this.onEvent) this.setData({fragment: (app.globalData.safeFragmentHeight + app.globalData.statusBarHeight), safeBottom: app.globalData.safeBottom }) this.data.setInter = setInterval(this.fetchMessage, 10000) }, @@ -49,7 +49,6 @@ Scene({ }, onEvent: function (message) { if (message.what == 99) { - this.setData({ visiable: message.visiable }) } }, fetchMessage: function(){ @@ -64,8 +63,10 @@ Scene({ }).catch(err => { }) }, + onPopupChange: function({detail}){ + this.setData({zIndex: detail}) + }, onUnload: function(){ - event.remove('TabMessage', this) if(this.data.setInter) { clearInterval(this.data.setInter) this.data.setInter = null diff --git a/pages/index/index.wxml b/pages/index/index.wxml index d959515..8fbf22b 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,12 +1,18 @@ - + - - - + + + + + + + + + - + diff --git a/pages/process/index/index.js b/pages/process/index/index.js index f549b45..b41bcd8 100644 --- a/pages/process/index/index.js +++ b/pages/process/index/index.js @@ -1,6 +1,7 @@ // pages/index/index.js import Dialog from '../../../components/dialog/dialog' import { getStatisticsInfo } from "../../../api/saas" +import { headerFactoryId } from "../../../api/user" import util from '../../../utils/util' const event = require('../../../utils/event') const app = getApp() @@ -14,6 +15,7 @@ Component({ data: { userInfo: app.userInfo, height: app.globalData.safeFragmentHeight, + CustomBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 60), tabList: [ { status: 1, badge: '', name: '定价', icon: '/assets/image/icon_pricing.png' }, { status: 2, badge: '', name: '过磅审核', icon: '/assets/image/icon_checking.png' }, @@ -34,7 +36,8 @@ Component({ usedCreditLine: 0 }, vdate: [], - vdateString: '' + vdateString: '', + visiable: false }, lifetimes: { attached: function () { @@ -84,6 +87,7 @@ Component({ wx.navigateTo({ url: '/pages/process/order-list/index' }) }, agentList: function (e) { + // this.showFactoryList() wx.navigateTo({ url: '/pages/process/agent-list/index' }) }, checkList: function (e) { @@ -114,7 +118,8 @@ Component({ } }, fetchStatisticsInfo: function(vdate){ - getStatisticsInfo({startTime: util.formatTime(new Date(vdate[0]), 'Y-M-D'), endTime: util.formatTime(new Date(vdate[1]), 'Y-M-D')}).then(result => { + var param = {startTime: util.formatTime(new Date(vdate[0]), 'Y-M-D'), endTime: util.formatTime(new Date(vdate[1]), 'Y-M-D')} + getStatisticsInfo(param).then(result => { if(Number(result.data.priceOrderNum) > 0){ this.data.tabList[0].badge = Number(result.data.priceOrderNum) } else { @@ -166,14 +171,12 @@ Component({ }) }, showSheet: function(){ - // this.setData({ show: true }) - // event.emit('TabMessage', { what: 99, visiable: false }) + this.setData({ show: true }) + this.triggerEvent("zIndex", -1) }, onClose: function() { this.setData({ show: false }) - setTimeout(function(){ - event.emit('TabMessage', { what: 99, visiable: true }) - }, 100) + this.triggerEvent("zIndex", 9) }, onSelect: function({detail}) { const [start, end] = detail @@ -182,6 +185,14 @@ Component({ }, toAuths: function(){ wx.navigateTo({ url: '/pages/htmls/auths/index' }) + }, + showFactoryList: function(){ + this.setData({ visiable: true }) + // this.$emit("zIndex", -1) + }, + onClickHide: function(){ + this.setData({ visiable: false }) + // this.$emit("zIndex", 9) } } }) \ No newline at end of file diff --git a/pages/process/index/index.wxml b/pages/process/index/index.wxml index fefbe12..acab410 100644 --- a/pages/process/index/index.wxml +++ b/pages/process/index/index.wxml @@ -139,4 +139,8 @@ - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/pages/settlement/bank-list/index.js b/pages/settlement/bank-list/index.js index 657f368..c12de2e 100644 --- a/pages/settlement/bank-list/index.js +++ b/pages/settlement/bank-list/index.js @@ -1,7 +1,7 @@ // pages/message/detail/index.js import Scene from '../../index/scene' import Dialog from '../../../components/dialog/dialog' -import { getBankCardList, deleteBankcard } from "../../../api/payment" +import { getBankCardList, deleteBankcard } from "../../../api/saas" const util = require('../../../utils/util') const event = require('../../../utils/event') const app = getApp() @@ -61,7 +61,7 @@ Scene({ Dialog.confirm({ title: '温馨提示', message: '确定删除该银行卡?' }).then(() => { wx.showLoading({ title: '处理中', mask: true }) var item = this.data.bankList[this.data.nowIndex] - deleteBankcard(item.id).then(res => { + deleteBankcard({id: item.id}).then(res => { wx.hideLoading() util.showToast('解除成功') this.data.bankList.splice(this.data.nowIndex, 1);