dev
xiaowen 3 years ago
parent 62c254a675
commit 94332ac906

@ -53,7 +53,7 @@ Page({
save() { save() {
wx.setStorageSync("sSeriesArr", this.data.result.toString()); wx.setStorageSync("sSeriesArr", this.data.result.toString());
wx.redirectTo({ wx.redirectTo({
url: '/pages/brandCrisis/crisiSet/index' url: '/pages/brandCrisis/crisiSet/index?brand=' + this.data.brand
}) })
} }
}) })

@ -19,10 +19,6 @@ Page({
}) })
}, },
onShow() { onShow() {
let sSeriesName = wx.getStorageSync("sSeriesArr") || '';
this.setData({
sSeriesName: sSeriesName,
})
this.getSwsQyQuartz() this.getSwsQyQuartz()
}, },
getSwsQyQuartz() { getSwsQyQuartz() {
@ -31,19 +27,24 @@ Page({
pid: 'brand', pid: 'brand',
token: wx.getStorageSync('token') || 't%2BrswgjvzGM=' token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
} }
let setBrand = wx.getStorageSync("setBrand");
if(this.data.brand != setBrand) {
wx.setStorageSync("sSeriesArr", '');
}
app.globalData.request(obj).then(res => { app.globalData.request(obj).then(res => {
let data = res[0]; let data = res[0];
let Es = data.Es || {}; let Es = data.Es || {};
let Id = data.Id || ""; let Id = data.Id || "";
let crisis = Es.Crisis ? Es.Crisis.split(",") : []; let crisis = Es.Crisis ? Es.Crisis.split(",") : [];
let seriesNames = Es.SeriesNames || '' let seriesNames = wx.getStorageSync("sSeriesArr") || '';
let checked = data.Statu == 1 ? false : true let checked = data.Statu == 1 ? false : true
this.setData({ this.setData({
Id: Id, Id: Id,
result: crisis, result: this.data.brand == Es.Brands ? crisis : [],
sSeriesName: this.data.sSeriesName || seriesNames, sSeriesName: seriesNames,
checked: checked checked: this.data.brand == Es.Brands ? checked : false
}) })
wx.setStorageSync("setBrand", this.data.brand);
}) })
}, },
onChange(event) { onChange(event) {
@ -80,6 +81,9 @@ Page({
}, },
save() { save() {
let data = { let data = {
action: "addOrUpdSwsQyQuartzList",
token: wx.getStorageSync('token') || 't%2BrswgjvzGM=',
data: {
Id: this.data.Id, Id: this.data.Id,
Es: { Es: {
Brands: this.data.brand, Brands: this.data.brand,
@ -87,10 +91,9 @@ Page({
SeriesNames: this.data.sSeriesName SeriesNames: this.data.sSeriesName
} }
} }
app.globalData.request({ }
action: "addOrUpdSwsQyQuartzList", app.globalData.request(data).then(() => {
data: data, wx.setStorageSync("setBrand", this.data.brand);
token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
}) })
}, },
}) })

@ -63,9 +63,6 @@ Page({
openid: wx.getStorageSync('openid'), openid: wx.getStorageSync('openid'),
token: wx.getStorageSync('token') || 't%2BrswgjvzGM=' token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
}).then(res => { }).then(res => {
this.setData({
sBrand: res.brandname
})
resolve(res.brandname) resolve(res.brandname)
}).catch(() => { }).catch(() => {
reject(false) reject(false)
@ -81,7 +78,7 @@ Page({
action: "getHealthIndex", action: "getHealthIndex",
sType: "BrandOverview", sType: "BrandOverview",
sTimeType: sTimeType, sTimeType: sTimeType,
sBrand: this.data.sBrand, sBrand: this.data.headlBrand,
sStartTime: sStartTime, sStartTime: sStartTime,
sEndTime: sEndTime, sEndTime: sEndTime,
// sSeriesName: sSeriesName, // sSeriesName: sSeriesName,
@ -145,7 +142,7 @@ Page({
iPageSize: 5, iPageSize: 5,
sType: "BrandData", sType: "BrandData",
sCrisis: sCrisis, sCrisis: sCrisis,
sBrand: this.data.sBrand, sBrand: this.data.headlBrand,
// sSeriesName: sSeriesName, // sSeriesName: sSeriesName,
token: wx.getStorageSync('token') || 't%2BrswgjvzGM=' token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
} }
@ -170,7 +167,7 @@ Page({
iPageIndex: 1, iPageIndex: 1,
iPageSize: 5, iPageSize: 5,
sTimeType: sTimeType, sTimeType: sTimeType,
sBrand: this.data.sBrand, sBrand: this.data.headlBrand,
sStartTime: sStartTime, sStartTime: sStartTime,
sEndTime: sEndTime, sEndTime: sEndTime,
// sSeriesName: sSeriesName, // sSeriesName: sSeriesName,
@ -197,7 +194,7 @@ Page({
sTimeType: sTimeType, sTimeType: sTimeType,
sStartTime: sStartTime, sStartTime: sStartTime,
sEndTime: sEndTime, sEndTime: sEndTime,
sBrand: this.data.sBrand, sBrand: this.data.headlBrand,
// sSeriesName: sSeriesName, // sSeriesName: sSeriesName,
token: wx.getStorageSync('token') || 't%2BrswgjvzGM=' token: wx.getStorageSync('token') || 't%2BrswgjvzGM='
} }
@ -231,12 +228,12 @@ Page({
}, },
handlerSet() { handlerSet() {
wx.navigateTo({ wx.navigateTo({
url: '/pages/brandCrisis/crisiSet/index?brand=' + this.data.sBrand url: '/pages/brandCrisis/crisiSet/index?brand=' + this.data.headlBrand
}) })
}, },
handlerGoList() { handlerGoList() {
wx.navigateTo({ wx.navigateTo({
url: '/pages/brandCrisis/crisisList/index?brand=' + this.data.sBrand url: '/pages/brandCrisis/crisisList/index?brand=' + this.data.headlBrand
}) })
} }
}) })
Loading…
Cancel
Save