dev
xiaowen 3 years ago
parent 81d2672f40
commit 3717086a3f

@ -3,19 +3,47 @@ Page({
data: {
result: ['1', '2', '3'],
checked: false,
sSeriesName: ''
sSeriesName: '',
brand: '',
Id: "",
},
onLoad() {
wx.setNavigationBarTitle({
title: '危机事件推送设置'
})
let pages = getCurrentPages();
let currentPage = pages[pages.length - 1]
let options = currentPage.options
this.setData({
brand: options.brand
})
},
onShow() {
let sSeriesName = wx.getStorageSync("sSeriesArr") || '';
let sCrisis = wx.getStorageSync("sCrisis") || '1,2,3';
this.setData({
sSeriesName: sSeriesName,
result: sCrisis.split(",")
})
this.getSwsQyQuartz()
},
getSwsQyQuartz() {
let obj = {
action: "getSwsQyQuartzList",
pid: 'brand',
token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
}
app.globalData.request(obj).then(res => {
let data = res[0];
let Es = data.Es || {};
let Id = data.Id || "";
let crisis = Es.Crisis ? Es.Crisis.split(",") : [];
let seriesNames = Es.SeriesNames || ''
let checked = data.Statu == 1 ? false : true
this.setData({
Id: Id,
result: crisis,
sSeriesName: this.data.sSeriesName || seriesNames,
checked: checked
})
})
},
onChange(event) {
@ -24,8 +52,21 @@ Page({
result: event.detail,
});
},
onChange1({ detail }) {
this.setData({ checked: detail });
onChange1({
detail
}) {
let Statu = detail ? 2 : 1;
this.setData({
checked: detail
});
app.globalData.request({
action: 'addOrUpdSwsQyQuartzList',
data: {
Id: this.data.Id,
Statu: Statu
},
token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
})
},
handlerModel() {
app.globalData.request({
@ -35,9 +76,21 @@ Page({
wx.navigateTo({
url: '/pages/brandCrisis/chooseModel/index?brand=' + res
})
})
})
},
save() {
let data = {
Id: this.data.Id,
Es: {
Brands: this.data.brand,
Crisis: this.data.result.toString(),
SeriesNames: this.data.sSeriesName
}
}
app.globalData.request({
action: "addOrUpdSwsQyQuartzList",
data: data,
token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
})
}
})

@ -217,7 +217,7 @@ Page({
},
handlerSet() {
wx.navigateTo({
url: '/pages/brandCrisis/crisiSet/index'
url: '/pages/brandCrisis/crisiSet/index?brand=' + this.data.sBrand
})
},
handlerGoList() {

Loading…
Cancel
Save