You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
159 lines
4.2 KiB
159 lines
4.2 KiB
3 years ago
|
// pages/varComm/pages/addEvent/index.js
|
||
|
const app = getApp()
|
||
|
Page({
|
||
|
data: {
|
||
|
searchValue:'',
|
||
|
eventList:[],
|
||
|
result:[],
|
||
|
sBrand:'',
|
||
|
option1: [{ text: '品牌选择', value: "" },],
|
||
|
option2: [
|
||
|
{ text: '车型选择', value: '' },
|
||
|
],
|
||
|
option3: [
|
||
|
{ text: '事件类型', value: '' },
|
||
|
{ text: '自燃', value: '自燃' },
|
||
|
{ text: '领导人', value: '领导人' },
|
||
|
{ text: '维权', value: '维权' },
|
||
|
{ text: '车展', value: '车展' },
|
||
|
{ text: '裁员', value: '裁员' },
|
||
|
{ text: '产品代言', value: '产品代言' },
|
||
|
{ text: '新车上市', value: '新车上市' },
|
||
|
],
|
||
|
sSeriesName:'',
|
||
|
sQuDao: '',
|
||
|
},
|
||
|
getData(param={}){
|
||
|
let boxArr = wx.getStorageSync('eventData')
|
||
|
let arr = []
|
||
|
for(let i of boxArr){
|
||
|
if(i) arr.push(JSON.stringify(i))
|
||
|
}
|
||
|
this.setData({
|
||
|
result:arr
|
||
|
})
|
||
|
app.globalData.request({
|
||
|
action: 'getEventList',
|
||
|
token: wx.getStorageSync('token'),
|
||
|
sType: 'HotLibraryC',
|
||
|
...param,
|
||
|
sTimeType: 20
|
||
|
}).then(res => {
|
||
|
this.setData({
|
||
|
eventList: res
|
||
|
})
|
||
|
})
|
||
|
},
|
||
|
checkChange(val){
|
||
|
this.setData({
|
||
|
result:val.detail
|
||
|
})
|
||
|
|
||
|
let arr = this.data.result.map(ele=>{
|
||
|
return JSON.parse(ele)
|
||
|
})
|
||
|
wx.setStorageSync('eventData', arr)
|
||
|
wx.navigateBack({
|
||
|
delta: 1,
|
||
|
})
|
||
|
|
||
|
},
|
||
|
brandChange(e){
|
||
|
let {detail} = e
|
||
|
|
||
|
app.globalData.request({
|
||
|
action: 'getUserSeriesName',
|
||
|
token: wx.getStorageSync('token'),
|
||
|
sBrandName:detail
|
||
|
}).then(res=>{
|
||
|
let arr = [ { text: '车型选择', value: '' }]
|
||
|
for(let i of res){
|
||
|
let obj = {
|
||
|
text:i.name,
|
||
|
value:i.name
|
||
|
}
|
||
|
arr.push(obj)
|
||
|
}
|
||
|
this.setData({
|
||
|
option2:arr,
|
||
|
sSeriesName:''
|
||
|
})
|
||
|
this.getData({
|
||
|
sBrand:detail,
|
||
|
sSeriesName:this.data.sSeriesName,
|
||
|
sQuDao:this.data.sQuDao,
|
||
|
sTitle:this.data.searchValue
|
||
|
})
|
||
|
})
|
||
|
},
|
||
|
sQuDaoChange(e){
|
||
|
let {detail} = e
|
||
|
this.setData({
|
||
|
sQuDao:detail
|
||
|
})
|
||
|
this.getData({
|
||
|
sBrand:this.data.sBrand,
|
||
|
sSeriesName:this.data.sSeriesName,
|
||
|
sQuDao:detail,
|
||
|
sTitle:this.data.searchValue
|
||
|
})
|
||
|
},
|
||
|
seriesNameChange(e){
|
||
|
let {detail} = e
|
||
|
this.setData({
|
||
|
sSeriesName:detail
|
||
|
})
|
||
|
this.getData({
|
||
|
sBrand:this.data.sBrand,
|
||
|
sSeriesName:detail,
|
||
|
sQuDao:this.data.sQuDao,
|
||
|
sTitle:this.data.searchValue
|
||
|
})
|
||
|
},
|
||
|
|
||
|
onChange(e){
|
||
|
let {detail} = e
|
||
|
this.setData({
|
||
|
searchValue:detail
|
||
|
})
|
||
|
},
|
||
|
onSearch(e){
|
||
|
this.getData({
|
||
|
sBrand:this.data.sBrand,
|
||
|
sSeriesName:this.data.sSeriesName,
|
||
|
sQuDao:this.data.sQuDao,
|
||
|
sTitle:e.detail
|
||
|
})
|
||
|
},
|
||
|
onClick(){
|
||
|
this.getData({
|
||
|
sBrand:this.data.sBrand,
|
||
|
sSeriesName:this.data.sSeriesName,
|
||
|
sQuDao:this.data.sQuDao,
|
||
|
sTitle:this.data.searchValue
|
||
|
})
|
||
|
},
|
||
|
/**
|
||
|
* 生命周期函数--监听页面加载
|
||
|
*/
|
||
|
onLoad(options) {
|
||
|
this.getData()
|
||
|
app.globalData.request({
|
||
|
action: 'getUserBrand',
|
||
|
token: wx.getStorageSync('token'),
|
||
|
}).then(res=>{
|
||
|
let arr = [ { text: '品牌选择', value: "" },]
|
||
|
for(let i of res){
|
||
|
if(i.firstword=='热门') continue
|
||
|
let obj = {
|
||
|
text:i.brandname,
|
||
|
value:i.brandname
|
||
|
}
|
||
|
arr.push(obj)
|
||
|
}
|
||
|
this.setData({
|
||
|
option1:arr
|
||
|
})
|
||
|
})
|
||
|
},
|
||
3 years ago
|
})
|