|
|
|
@ -1,7 +1,6 @@ |
|
|
|
// 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') |
|
|
|
@ -30,11 +29,11 @@ Scene({ |
|
|
|
if(this.data.type == 0){ |
|
|
|
this.fetchCustomerInfo() |
|
|
|
} else if(this.data.type == 1){ |
|
|
|
this.showQrCode(`?mark=ztb_saas&type=${this.data.type}&userId=${this.data.id}` ) |
|
|
|
let channel = this.getOpenerEventChannel() |
|
|
|
let that = this |
|
|
|
channel.once('onParam', function (data) { |
|
|
|
that.setData({ form: data, type: that.data.type }) |
|
|
|
that.showQrCode(`?mark=ztb_saas&QrCodeRecordId=${that.data.id}` ) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
@ -46,7 +45,9 @@ Scene({ |
|
|
|
} else if (message.what == 102) { |
|
|
|
if(this.data.type == 0){ |
|
|
|
this.fetchCustomerInfo() |
|
|
|
} |
|
|
|
} else if(this.data.type == 1){ |
|
|
|
wx.navigateBack() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
fetchCustomerInfo: function(){ |
|
|
|
@ -54,18 +55,7 @@ Scene({ |
|
|
|
getCustomerInfo(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() |
|
|
|
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}` ) |
|
|
|
this.showQrCode(`?mark=ztb_saas&type=${this.data.type}&userId=${this.data.id}` ) |
|
|
|
}).catch(err => { |
|
|
|
wx.hideLoading() |
|
|
|
util.showToast(err) |
|
|
|
|