diff --git a/pages/home/employee-info/index.js b/pages/home/employee-info/index.js index e474903..fd922cb 100644 --- a/pages/home/employee-info/index.js +++ b/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 => { diff --git a/pages/message/card-list/index.js b/pages/message/card-list/index.js index b5b35a8..53a3353 100644 --- a/pages/message/card-list/index.js +++ b/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) } }) \ No newline at end of file