|
|
|
@ -5,9 +5,9 @@ Page({
|
|
|
|
|
value: "",
|
|
|
|
|
tabActive: 0,
|
|
|
|
|
active: 1,
|
|
|
|
|
height:app.globalData.navBarHeight + app.globalData.statusBarHeight,
|
|
|
|
|
statusBarHeight:app.globalData.statusBarHeight,
|
|
|
|
|
navBarHeight:app.globalData.navBarHeight,
|
|
|
|
|
height: app.globalData.navBarHeight + app.globalData.statusBarHeight,
|
|
|
|
|
statusBarHeight: app.globalData.statusBarHeight,
|
|
|
|
|
navBarHeight: app.globalData.navBarHeight,
|
|
|
|
|
navData: [],
|
|
|
|
|
sourceData: [],
|
|
|
|
|
mockData: [],
|
|
|
|
@ -18,35 +18,37 @@ Page({
|
|
|
|
|
sBrand: '',
|
|
|
|
|
daActive: -1,
|
|
|
|
|
dbActive: '',
|
|
|
|
|
dcActive: ''
|
|
|
|
|
dcActive: '',
|
|
|
|
|
model: ''
|
|
|
|
|
},
|
|
|
|
|
onLaunch() {
|
|
|
|
|
wx.getSystemInfo({
|
|
|
|
|
success: (res) => {
|
|
|
|
|
const ratio = 750 / res.windowWidth
|
|
|
|
|
const menuInfo = wx.getMenuButtonBoundingClientRect();
|
|
|
|
|
this.setData({
|
|
|
|
|
top: menuInfo.top * ratio ,
|
|
|
|
|
left: menuInfo.left * ratio ,
|
|
|
|
|
height: menuInfo.height * ratio ,
|
|
|
|
|
const ratio = 750 / res.windowWidth
|
|
|
|
|
const menuInfo = wx.getMenuButtonBoundingClientRect();
|
|
|
|
|
this.setData({
|
|
|
|
|
top: menuInfo.top * ratio,
|
|
|
|
|
left: menuInfo.left * ratio,
|
|
|
|
|
height: menuInfo.height * ratio,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
onLoad() {
|
|
|
|
|
let pages = getCurrentPages();
|
|
|
|
|
let currentPage = pages[pages.length-1]
|
|
|
|
|
let options = currentPage.options
|
|
|
|
|
let currentPage = pages[pages.length - 1]
|
|
|
|
|
let options = currentPage.options
|
|
|
|
|
this.setData({
|
|
|
|
|
type: options.type || 2,
|
|
|
|
|
sBrand: options.sBrand || ''
|
|
|
|
|
type: options.type || 2
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
onShow() {
|
|
|
|
|
this.getData();
|
|
|
|
|
this.createSelectorQuery().select(".nav-top").boundingClientRect(res => {
|
|
|
|
|
if (res) {
|
|
|
|
|
const { height } = res;
|
|
|
|
|
const {
|
|
|
|
|
height
|
|
|
|
|
} = res;
|
|
|
|
|
this.setData({
|
|
|
|
|
heightTop: height
|
|
|
|
|
})
|
|
|
|
@ -65,8 +67,8 @@ Page({
|
|
|
|
|
handlerChoose(e) {
|
|
|
|
|
const row = e.currentTarget.dataset.row;
|
|
|
|
|
let n = this.data.navData.findIndex(ele => row.brandid === ele.brandid);
|
|
|
|
|
wx.setStorageSync('sBrand', row.brandname);
|
|
|
|
|
if(this.data.type === 1) {
|
|
|
|
|
wx.setStorageSync('sBrand', row.brandname);
|
|
|
|
|
if (this.data.type === 1) {
|
|
|
|
|
// wx.switchTab({
|
|
|
|
|
// url: "/pages/brandCrisis/index"
|
|
|
|
|
// })
|
|
|
|
@ -75,16 +77,16 @@ Page({
|
|
|
|
|
this.setData({
|
|
|
|
|
showPop: true,
|
|
|
|
|
daActive: n
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.getSeries(row.brandname);
|
|
|
|
|
},
|
|
|
|
|
handlerChoose1(e) {
|
|
|
|
|
if(this.data.sBrand) {
|
|
|
|
|
if (this.data.sBrand) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const row = e.currentTarget.dataset.row;
|
|
|
|
|
wx.setStorageSync('sBrand', row.brandname);
|
|
|
|
|
if(this.data.type === 1) {
|
|
|
|
|
wx.setStorageSync('sBrand', row.brandname);
|
|
|
|
|
if (this.data.type === 1) {
|
|
|
|
|
// wx.switchTab({
|
|
|
|
|
// url: "/pages/brandCrisis/index"
|
|
|
|
|
// })
|
|
|
|
@ -93,13 +95,13 @@ Page({
|
|
|
|
|
this.setData({
|
|
|
|
|
showPop: true,
|
|
|
|
|
dbActive: row.brandid
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.getSeries(row.brandname);
|
|
|
|
|
},
|
|
|
|
|
handlerCloseDialog() {
|
|
|
|
|
this.setData({
|
|
|
|
|
showPop: false
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handlerChooseS(e) {
|
|
|
|
|
const row = e.currentTarget.dataset.row;
|
|
|
|
@ -107,9 +109,6 @@ Page({
|
|
|
|
|
this.setData({
|
|
|
|
|
dcActive: row.name
|
|
|
|
|
})
|
|
|
|
|
// wx.switchTab({
|
|
|
|
|
// url: "/pages/brandCrisis/index"
|
|
|
|
|
// })
|
|
|
|
|
},
|
|
|
|
|
getSeries(brandname) {
|
|
|
|
|
let obj = {
|
|
|
|
@ -129,7 +128,7 @@ Page({
|
|
|
|
|
title: '加载中',
|
|
|
|
|
icon: 'loading',
|
|
|
|
|
duration: 30000
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
app.globalData.request({
|
|
|
|
|
action: 'getUserBrand',
|
|
|
|
|
token: 't%2BrswgjvzGM=',
|
|
|
|
@ -141,9 +140,9 @@ Page({
|
|
|
|
|
data: []
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
for(let i of res){
|
|
|
|
|
for(let j of arr){
|
|
|
|
|
if(i.firstword == j.name){
|
|
|
|
|
for (let i of res) {
|
|
|
|
|
for (let j of arr) {
|
|
|
|
|
if (i.firstword == j.name) {
|
|
|
|
|
j.data.push(i)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -151,26 +150,39 @@ Page({
|
|
|
|
|
let newArr = [];
|
|
|
|
|
let obj = {};
|
|
|
|
|
for (var i = 0; i < res.length; i++) {
|
|
|
|
|
if (!obj[res[i].brandid]) {
|
|
|
|
|
newArr.push(res[i])
|
|
|
|
|
obj[res[i].brandid] = true
|
|
|
|
|
}
|
|
|
|
|
if (!obj[res[i].brandid]) {
|
|
|
|
|
newArr.push(res[i])
|
|
|
|
|
obj[res[i].brandid] = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
newArr = newArr.filter(ele => ele.brandname === this.data.sBrand)
|
|
|
|
|
this.setData({
|
|
|
|
|
mockData:arr,
|
|
|
|
|
mockData: arr,
|
|
|
|
|
navData: newArr,
|
|
|
|
|
sourceData: newArr
|
|
|
|
|
})
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
wx.hideToast();
|
|
|
|
|
}, 1000)
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handlerBack() {
|
|
|
|
|
wx.navigateBack({
|
|
|
|
|
delta: 1
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
onChange(event) {
|
|
|
|
|
this.setData({
|
|
|
|
|
model: event.detail,
|
|
|
|
|
});
|
|
|
|
|
wx.setStorageSync('sSeries', event.detail);
|
|
|
|
|
},
|
|
|
|
|
onClick(event) {
|
|
|
|
|
const {
|
|
|
|
|
name
|
|
|
|
|
} = event.currentTarget.dataset;
|
|
|
|
|
this.setData({
|
|
|
|
|
model: name
|
|
|
|
|
});
|
|
|
|
|
wx.setStorageSync('sSeries', name);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|