Browse Source

no message

feature/v2.2
xpz2018 4 years ago
parent
commit
e5dacadd66
13 changed files with 38 additions and 7 deletions
  1. 4
      api/user.js
  2. 4
      app.json
  3. 2
      pages/home/customer-list/index.js
  4. 0
      pages/home/factory-qrcode/index.js
  5. 0
      pages/home/factory-qrcode/index.json
  6. 0
      pages/home/factory-qrcode/index.wxml
  7. 0
      pages/home/factory-qrcode/index.wxss
  8. 24
      pages/home/qrcode-info/index.js
  9. 0
      pages/home/qrcode-info/index.json
  10. 0
      pages/home/qrcode-info/index.wxml
  11. 0
      pages/home/qrcode-info/index.wxss
  12. 5
      pages/index/index.js
  13. 6
      pages/index/scene.js

4
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
}

4
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",

2
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?` })

pages/home/qrcode/index.js → pages/home/factory-qrcode/index.js

pages/home/qrcode/index.json → pages/home/factory-qrcode/index.json

pages/home/qrcode/index.wxml → pages/home/factory-qrcode/index.wxml

pages/home/qrcode/index.wxss → pages/home/factory-qrcode/index.wxss

pages/home/customer-code/index.js → 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()

pages/home/customer-code/index.json → pages/home/qrcode-info/index.json

pages/home/customer-code/index.wxml → pages/home/qrcode-info/index.wxml

pages/home/customer-code/index.wxss → pages/home/qrcode-info/index.wxss

5
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

6
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) {

Loading…
Cancel
Save