diff --git a/pages/brandCrisis/chooseModel/index.js b/pages/brandCrisis/chooseModel/index.js index ed7a1f4..4331ce0 100644 --- a/pages/brandCrisis/chooseModel/index.js +++ b/pages/brandCrisis/chooseModel/index.js @@ -53,7 +53,7 @@ Page({ save() { wx.setStorageSync("sSeriesArr", this.data.result.toString()); wx.redirectTo({ - url: '/pages/brandCrisis/crisiSet/index' + url: '/pages/brandCrisis/crisiSet/index?brand=' + this.data.brand }) } }) \ No newline at end of file diff --git a/pages/brandCrisis/crisiSet/index.js b/pages/brandCrisis/crisiSet/index.js index c89e513..f90a545 100644 --- a/pages/brandCrisis/crisiSet/index.js +++ b/pages/brandCrisis/crisiSet/index.js @@ -19,10 +19,6 @@ Page({ }) }, onShow() { - let sSeriesName = wx.getStorageSync("sSeriesArr") || ''; - this.setData({ - sSeriesName: sSeriesName, - }) this.getSwsQyQuartz() }, getSwsQyQuartz() { @@ -31,19 +27,24 @@ Page({ pid: 'brand', 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 => { let data = res[0]; let Es = data.Es || {}; let Id = data.Id || ""; let crisis = Es.Crisis ? Es.Crisis.split(",") : []; - let seriesNames = Es.SeriesNames || '' + let seriesNames = wx.getStorageSync("sSeriesArr") || ''; let checked = data.Statu == 1 ? false : true this.setData({ Id: Id, - result: crisis, - sSeriesName: this.data.sSeriesName || seriesNames, - checked: checked + result: this.data.brand == Es.Brands ? crisis : [], + sSeriesName: seriesNames, + checked: this.data.brand == Es.Brands ? checked : false }) + wx.setStorageSync("setBrand", this.data.brand); }) }, onChange(event) { @@ -80,17 +81,19 @@ Page({ }, 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=' + token: wx.getStorageSync('token') || 't%2BrswgjvzGM=', + data: { + Id: this.data.Id, + Es: { + Brands: this.data.brand, + Crisis: this.data.result.toString(), + SeriesNames: this.data.sSeriesName + } + } + } + app.globalData.request(data).then(() => { + wx.setStorageSync("setBrand", this.data.brand); }) }, }) \ No newline at end of file diff --git a/pages/brandCrisis/index.js b/pages/brandCrisis/index.js index df93f7a..aeebf8c 100644 --- a/pages/brandCrisis/index.js +++ b/pages/brandCrisis/index.js @@ -63,9 +63,6 @@ Page({ openid: wx.getStorageSync('openid'), token: wx.getStorageSync('token') || 't%2BrswgjvzGM=' }).then(res => { - this.setData({ - sBrand: res.brandname - }) resolve(res.brandname) }).catch(() => { reject(false) @@ -81,7 +78,7 @@ Page({ action: "getHealthIndex", sType: "BrandOverview", sTimeType: sTimeType, - sBrand: this.data.sBrand, + sBrand: this.data.headlBrand, sStartTime: sStartTime, sEndTime: sEndTime, // sSeriesName: sSeriesName, @@ -145,7 +142,7 @@ Page({ iPageSize: 5, sType: "BrandData", sCrisis: sCrisis, - sBrand: this.data.sBrand, + sBrand: this.data.headlBrand, // sSeriesName: sSeriesName, token: wx.getStorageSync('token') || 't%2BrswgjvzGM=' } @@ -170,7 +167,7 @@ Page({ iPageIndex: 1, iPageSize: 5, sTimeType: sTimeType, - sBrand: this.data.sBrand, + sBrand: this.data.headlBrand, sStartTime: sStartTime, sEndTime: sEndTime, // sSeriesName: sSeriesName, @@ -197,7 +194,7 @@ Page({ sTimeType: sTimeType, sStartTime: sStartTime, sEndTime: sEndTime, - sBrand: this.data.sBrand, + sBrand: this.data.headlBrand, // sSeriesName: sSeriesName, token: wx.getStorageSync('token') || 't%2BrswgjvzGM=' } @@ -231,12 +228,12 @@ Page({ }, handlerSet() { wx.navigateTo({ - url: '/pages/brandCrisis/crisiSet/index?brand=' + this.data.sBrand + url: '/pages/brandCrisis/crisiSet/index?brand=' + this.data.headlBrand }) }, handlerGoList() { wx.navigateTo({ - url: '/pages/brandCrisis/crisisList/index?brand=' + this.data.sBrand + url: '/pages/brandCrisis/crisisList/index?brand=' + this.data.headlBrand }) } }) \ No newline at end of file