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.
45 lines
1.3 KiB
45 lines
1.3 KiB
// pages/setting/notification.js
|
|
import { readMessage } from "../../../api/saas"
|
|
const util = require('../../../utils/util')
|
|
const app = getApp()
|
|
|
|
Component({
|
|
options: {
|
|
addGlobalClass: true,
|
|
multipleSlots: true
|
|
},
|
|
data: {
|
|
StatusBar: app.globalData.StatusBar,
|
|
CustomBar: app.globalData.CustomBar,
|
|
notice: false,
|
|
message: null
|
|
},
|
|
lifetimes: {
|
|
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
|
attached: function () {
|
|
this.setData({ StatusBar: app.globalData.StatusBar || 40, CustomBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 60), })
|
|
}
|
|
},
|
|
methods: {
|
|
notify: function(message){
|
|
if(this.data.notice){
|
|
return
|
|
}
|
|
this.setData({ notice: true, message })
|
|
},
|
|
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 })
|
|
wx.navigateTo({ url: `/pages/home/customer-info/index?cardNo=${this.data.message.redirectInfo.params.cardNo}` })
|
|
}
|
|
})
|
|
},
|
|
onClose: function(){
|
|
this.setData({ notice: false })
|
|
}
|
|
}
|
|
})
|