From e5dacadd66481c8bdbbbe5d14e4190418a0a7920 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Fri, 6 Aug 2021 11:51:42 +0800 Subject: [PATCH] no message --- api/user.js | 4 +++- app.json | 4 ++-- pages/home/customer-list/index.js | 2 +- .../home/{qrcode => factory-qrcode}/index.js | 0 .../{qrcode => factory-qrcode}/index.json | 0 .../{qrcode => factory-qrcode}/index.wxml | 0 .../{qrcode => factory-qrcode}/index.wxss | 0 .../{customer-code => qrcode-info}/index.js | 24 +++++++++++++++++-- .../{customer-code => qrcode-info}/index.json | 0 .../{customer-code => qrcode-info}/index.wxml | 0 .../{customer-code => qrcode-info}/index.wxss | 0 pages/index/index.js | 5 +++- pages/index/scene.js | 6 +++++ 13 files changed, 38 insertions(+), 7 deletions(-) rename pages/home/{qrcode => factory-qrcode}/index.js (100%) rename pages/home/{qrcode => factory-qrcode}/index.json (100%) rename pages/home/{qrcode => factory-qrcode}/index.wxml (100%) rename pages/home/{qrcode => factory-qrcode}/index.wxss (100%) rename pages/home/{customer-code => qrcode-info}/index.js (71%) rename pages/home/{customer-code => qrcode-info}/index.json (100%) rename pages/home/{customer-code => qrcode-info}/index.wxml (100%) rename pages/home/{customer-code => qrcode-info}/index.wxss (100%) diff --git a/api/user.js b/api/user.js index c5f265e..9ffd836 100644 --- a/api/user.js +++ b/api/user.js @@ -28,6 +28,7 @@ const generateCode = (params) => mPost('/uec/generate/qrcode', params, config) const createQrcode = (params) => mPost('/uec/create/qrcode-record', params, config) const verifyCode = (code, params) => mGet(`/uec/verify/qrcode${code}`, params, config) const bindAccount = (params) => mPost(`/uec/bind/primary-account`, params, config) +const getEmplyeeInfo = (id) => mGet(`/uec/get/employees/details/by/${id}`, null, config) const applyEmplyee = (params) => mPost(`/uec/save/join/of/enterprise-department`, params, config) const getCheckList = (params) => mGet(`/uec/get/employee-joining-department-application-list`, params, config) const auditEmploye = (params) => mPost(`/uec/modify/join/of/enterprise-department`, params, config) @@ -248,5 +249,6 @@ export { applyEmplyee, getCheckList, auditEmploye, - editEmploye + editEmploye, + getEmplyeeInfo } \ No newline at end of file diff --git a/app.json b/app.json index dab3f45..dbe8ce7 100644 --- a/app.json +++ b/app.json @@ -8,8 +8,8 @@ "pages/home/customer-list/index", "pages/home/factory-list/index", "pages/home/customer-info/index", - "pages/home/customer-code/index", - "pages/home/qrcode/index", + "pages/home/qrcode-info/index", + "pages/home/factory-qrcode/index", "pages/home/registe/index", "pages/ztbvip/member/index", "pages/ztbvip/payment/index", diff --git a/pages/home/customer-list/index.js b/pages/home/customer-list/index.js index 8038037..7992d4d 100644 --- a/pages/home/customer-list/index.js +++ b/pages/home/customer-list/index.js @@ -217,7 +217,7 @@ Scene({ this.data.index = e.currentTarget.dataset.index item = this.data.searchList[e.currentTarget.dataset.index] } - wx.navigateTo({ url: `/pages/home/customer-code/index?id=${item.id}&userId=${item.userId}` }) + wx.navigateTo({ url: `/pages/home/qrcode-info/index?id=${item.id}&userId=${item.userId}` }) }, addCustomer: function(){ wx.navigateTo({ url: `/pages/home/customer-info/index?` }) diff --git a/pages/home/qrcode/index.js b/pages/home/factory-qrcode/index.js similarity index 100% rename from pages/home/qrcode/index.js rename to pages/home/factory-qrcode/index.js diff --git a/pages/home/qrcode/index.json b/pages/home/factory-qrcode/index.json similarity index 100% rename from pages/home/qrcode/index.json rename to pages/home/factory-qrcode/index.json diff --git a/pages/home/qrcode/index.wxml b/pages/home/factory-qrcode/index.wxml similarity index 100% rename from pages/home/qrcode/index.wxml rename to pages/home/factory-qrcode/index.wxml diff --git a/pages/home/qrcode/index.wxss b/pages/home/factory-qrcode/index.wxss similarity index 100% rename from pages/home/qrcode/index.wxss rename to pages/home/factory-qrcode/index.wxss diff --git a/pages/home/customer-code/index.js b/pages/home/qrcode-info/index.js similarity index 71% rename from pages/home/customer-code/index.js rename to pages/home/qrcode-info/index.js index fde8830..288b426 100644 --- a/pages/home/customer-code/index.js +++ b/pages/home/qrcode-info/index.js @@ -1,6 +1,7 @@ // pages/home/customer-info/index.js import Scene from '../../index/scene' import { getCustomerInfo } from "../../../api/saas" +import { getEmplyeeInfo } from "../../../api/user" const util = require('../../../utils/util') const event = require('../../../utils/event') const qrCode = require('../../../utils/weapp-qrcode') @@ -11,6 +12,7 @@ Scene({ * 页面的初始数据 */ data: { + type: 0, id: null, userId: null, form: null, @@ -22,7 +24,14 @@ Scene({ if(!util.isEmpty(options.id)){ this.data.id = options.id this.data.userId = options.userId - this.fetchCustomerInfo() + if(!util.isEmpty(options.type)){ + this.data.type = Number(options.type) + } + if(this.data.type == 0){ + this.fetchCustomerInfo() + } else if(this.data.type == 1){ + this.fetchEmplyeeInfo() + } } event.on('EventMessage', this, this.onEvent) }, @@ -37,7 +46,18 @@ Scene({ wx.showLoading({ title: '正在获取', mask: true }) getCustomerInfo(this.data.id).then(result => { wx.hideLoading() - this.setData({ form: result.data }) + this.setData({ form: result.data, type: this.data.type }) + this.showQrCode(`?mark=ztb_saas&QrCodeRecordId=${this.data.id}` ) + }).catch(err => { + wx.hideLoading() + util.showToast(err) + }) + }, + fetchEmplyeeInfo: function(){ + wx.showLoading({ title: '正在获取', mask: true }) + getEmplyeeInfo(this.data.id).then(result => { + wx.hideLoading() + this.setData({ form: result.data, type: this.data.type }) this.showQrCode(`?mark=ztb_saas&QrCodeRecordId=${this.data.id}` ) }).catch(err => { wx.hideLoading() diff --git a/pages/home/customer-code/index.json b/pages/home/qrcode-info/index.json similarity index 100% rename from pages/home/customer-code/index.json rename to pages/home/qrcode-info/index.json diff --git a/pages/home/customer-code/index.wxml b/pages/home/qrcode-info/index.wxml similarity index 100% rename from pages/home/customer-code/index.wxml rename to pages/home/qrcode-info/index.wxml diff --git a/pages/home/customer-code/index.wxss b/pages/home/qrcode-info/index.wxss similarity index 100% rename from pages/home/customer-code/index.wxss rename to pages/home/qrcode-info/index.wxss diff --git a/pages/index/index.js b/pages/index/index.js index aa3c880..9e64387 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -170,11 +170,14 @@ Scene({ if (pageView && this.data.tabIndex != 3) { pageView.fetchStatisticsInfo(true) } + this.setData({ visible: false, factoryId: detail.id, factoryName: detail.text }) this.checkLincense() event.emit('EventMessage', { what: 999, desc: 'changeFactory' }) - this.setData({ visible: false, factoryId: detail.id, factoryName: detail.text }) }, checkLincense: function(){ + if(this.closeAttention){ + this.closeAttention() + } getFactoryLicence().then(result => { if(!result.data.expirationTime){ return diff --git a/pages/index/scene.js b/pages/index/scene.js index c0389a3..637fa88 100644 --- a/pages/index/scene.js +++ b/pages/index/scene.js @@ -17,6 +17,12 @@ export default function Scene(config) { this.vipDialog.attention(message) } } + this.closeAttention = function() { + this.vipDialog = this.vipDialog || this.selectComponent('#vip-dialog') + if(this.vipDialog){ + this.vipDialog.onClose() + } + } } // config.onUnload = function(options) { // if (onUnload) {