diff --git a/app.js b/app.js index 910696a..19c1bb9 100644 --- a/app.js +++ b/app.js @@ -55,30 +55,7 @@ App({ } }) }) - }, - requestMessage: function (params) { - return new Promise((resolve, reject) => { - wx.request({ - url: 'http://cloud.sws010.com/api/v7.ashx', - data: { - version: "1", - ...params - }, - method: 'get', - success: function (res) { - //接口实际返回的内容在res.data中 - if (res.data.Code == 1) { - resolve(res.data.Msg); - } else { - reject(res.data) - } - }, - fail: function (err) { - reject(err); - } - }) - }) - }, + } }, }) \ No newline at end of file diff --git a/pages/insight/pages/brandInsight/TailInsight/index.js b/pages/insight/pages/brandInsight/TailInsight/index.js index 6941f14..296df8a 100644 --- a/pages/insight/pages/brandInsight/TailInsight/index.js +++ b/pages/insight/pages/brandInsight/TailInsight/index.js @@ -18,7 +18,7 @@ Component({ }, methods: { getData() { - app.globalData.requestMessage({ + app.globalData.request({ action: 'getWeiYiInsightAnalysis', //尾翼洞察详情 token: 't%2BrswgjvzGM=', sType: 'BrandWeiYi', @@ -26,9 +26,7 @@ Component({ sStartTime: wx.getStorageSync('sStartTime') || '', sEndTime: wx.getStorageSync('sEndTime') || '', sBrand: wx.getStorageSync('sBrand') || '' - }).then(res => { - this.setData({detailData: res}); - }); + }, (res) => {this.setData({detailData: res.Msg})}).then(() => {}); app.globalData.request({ action: 'getWeiYiVolumeTime', //尾翼洞察详情 token: 't%2BrswgjvzGM=', diff --git a/pages/insight/pages/brandInsight/TutorInsight/index.js b/pages/insight/pages/brandInsight/TutorInsight/index.js index 224114b..eb4d0f4 100644 --- a/pages/insight/pages/brandInsight/TutorInsight/index.js +++ b/pages/insight/pages/brandInsight/TutorInsight/index.js @@ -16,7 +16,7 @@ Component({ }, methods: { getData() { - app.globalData.requestMessage({ + app.globalData.request({ action: 'getBbsInsightAnalysis', //论坛洞察详情 token: 't%2BrswgjvzGM=', sType: 'BbsBrand', @@ -25,9 +25,7 @@ Component({ sEndTime: wx.getStorageSync('sEndTime') || '', sBrand: wx.getStorageSync('sBrand') || '', iBBsType: 1, - }).then(res => { - this.setData({detailData: res}) - }); + }, (res) => {this.setData({detailData: res.Msg})}).then(() => {}); app.globalData.request({ action: 'getBbsCountTime', //论坛传播态势 token: 't%2BrswgjvzGM=', diff --git a/pages/insight/pages/modalInsight/TailInsight/index.js b/pages/insight/pages/modalInsight/TailInsight/index.js index 0615cdf..97de4b4 100644 --- a/pages/insight/pages/modalInsight/TailInsight/index.js +++ b/pages/insight/pages/modalInsight/TailInsight/index.js @@ -18,7 +18,7 @@ Component({ }, methods: { getData() { - app.globalData.requestMessage({ + app.globalData.request({ action: 'getWeiYiInsightAnalysis', //尾翼洞察详情 token: 't%2BrswgjvzGM=', sType: 'BrandWeiYi', @@ -27,9 +27,7 @@ Component({ sEndTime: wx.getStorageSync('sEndTime') || '', sBrand: wx.getStorageSync('sBrand') || '', sSeriesName: wx.getStorageSync('sSeriesName') || '', - }).then(res => { - this.setData({detailData: res}); - }); + }, (res) => {this.setData({detailData: res.Msg})}).then(() => {}); app.globalData.request({ action: 'getWeiYiVolumeTime', //尾翼传播态势 token: 't%2BrswgjvzGM=',