You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.5 KiB
49 lines
1.5 KiB
// pages/setting/notification.js
|
|
import { readMessage } from "../../../api/saas"
|
|
const app = getApp()
|
|
|
|
Component({
|
|
options: {
|
|
addGlobalClass: true,
|
|
multipleSlots: true
|
|
},
|
|
data: {
|
|
StatusBar: app.globalData.StatusBar,
|
|
CustomBar: app.globalData.CustomBar,
|
|
isAdmin: false,
|
|
notice: false,
|
|
message: null,
|
|
numb: 0
|
|
},
|
|
lifetimes: {
|
|
attached: function () {
|
|
this.setData({ StatusBar: app.globalData.StatusBar, CustomBar: app.globalData.CustomBar })
|
|
}
|
|
},
|
|
methods: {
|
|
notify: function(message){
|
|
if(!app.userInfo.factoryId || this.data.notice){
|
|
return
|
|
}
|
|
this.setData({ notice: true, message, isAdmin: app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0 })
|
|
},
|
|
submit: function(e){
|
|
if(!this.data.message.redirectInfo || !this.data.message.redirectInfo.targetView){
|
|
return
|
|
}
|
|
readMessage({ idList: [this.data.message.id] }).then(result => {
|
|
if(this.data.message.redirectInfo.targetView == 'factoryCustomerDetail'){// 新建客户
|
|
this.setData({ notice: false })
|
|
if(e.currentTarget.id == 'client'){
|
|
wx.navigateTo({ url: `/pages/home/customer-info/index?cardNo=${this.data.message.redirectInfo.params.cardNo}` })
|
|
} else if(e.currentTarget.id == 'employ'){
|
|
wx.navigateTo({ url: `/pages/home/employee-info/index?cardNo=${this.data.message.redirectInfo.params.cardNo}` })
|
|
}
|
|
}
|
|
})
|
|
},
|
|
onClose: function(){
|
|
this.setData({ notice: false })
|
|
}
|
|
}
|
|
})
|