Browse Source

no message

feature/v2.1
xpz2018 4 years ago
parent
commit
114b684a77
2 changed files with 12 additions and 0 deletions
  1. 2
      pages/home/employee-info/index.js
  2. 10
      pages/message/card-list/index.js

2
pages/home/employee-info/index.js

@ -4,6 +4,7 @@ import Dialog from '../../../components/dialog/dialog'
import { getRoleList} from "../../../api/saas"
import { editEmploye, deleteEmploye, auditEmploye } from "../../../api/user"
const util = require('../../../utils/util')
const event = require('../../../utils/event')
Scene({
/**
@ -84,6 +85,7 @@ Scene({
editEmploye(this.data.form).then(result => {
wx.hideLoading()
util.showBackToast('修改成功')
event.emit('EventMessage', { what: 120, detail: '' })
const channel = this.getOpenerEventChannel()
channel.emit('onCallback', { what: 120 })
}).catch(err => {

10
pages/message/card-list/index.js

@ -2,6 +2,7 @@
import Scene from '../../index/scene'
import { getCardList, removeCardNop } from "../../../api/saas"
const util = require('../../../utils/util')
const event = require('../../../utils/event')
const app = getApp()
Scene({
@ -31,8 +32,14 @@ Scene({
this.data.actions = [{ id: 2, name: '绑定员工' }, { id: 1, name: '绑定客户' }]
}
this.setData({ height: app.globalData.fragmentHeight, actions: this.data.actions })
event.on('EventMessage', this, this.onEvent)
this.fetchList()
},
onEvent: function(message){
if (message.what == 102 || message.what == 120) {
this.onRefreshList()
}
},
onRefreshList: function () {
if (this.data.requesting) {
return
@ -95,5 +102,8 @@ Scene({
wx.hideLoading()
util.showToast(err)
})
},
onUnload: function(){
event.remove('EventMessage', this)
}
})
Loading…
Cancel
Save