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.
59 lines
1.4 KiB
59 lines
1.4 KiB
3 years ago
|
const app = getApp();
|
||
|
Page({
|
||
|
data: {
|
||
|
list: [],
|
||
|
brand: "",
|
||
|
result: []
|
||
|
},
|
||
|
onLoad() {
|
||
|
wx.setNavigationBarTitle({
|
||
|
title: "选择车型"
|
||
|
})
|
||
|
let pages = getCurrentPages();
|
||
|
let currentPage = pages[pages.length - 1]
|
||
|
let options = currentPage.options
|
||
|
this.setData({
|
||
|
brand: options.brand
|
||
|
})
|
||
|
},
|
||
|
onShow() {
|
||
|
this.getData();
|
||
|
if(wx.getStorageSync("sSeriesArr")) {
|
||
|
let arr = wx.getStorageSync("sSeriesArr").split(",");
|
||
|
this.setData({
|
||
|
result: arr
|
||
|
})
|
||
|
}
|
||
|
},
|
||
|
getData() {
|
||
|
let obj = {
|
||
|
action: 'getUserSeriesName',
|
||
|
token: wx.getStorageSync('token') || 't%2BrswgjvzGM=',
|
||
|
sBrandName: this.data.brand
|
||
|
}
|
||
|
app.globalData.request(obj).then(res => {
|
||
|
this.setData({
|
||
|
list: res
|
||
|
})
|
||
|
})
|
||
|
},
|
||
|
onChange(event) {
|
||
|
this.setData({
|
||
|
result: event.detail,
|
||
|
});
|
||
|
},
|
||
|
toggle(event) {
|
||
|
const {
|
||
|
index
|
||
|
} = event.currentTarget.dataset;
|
||
|
const checkbox = this.selectComponent(`.checkboxes-${index}`);
|
||
|
checkbox.toggle();
|
||
|
},
|
||
|
noop() {},
|
||
|
save() {
|
||
|
wx.setStorageSync("sSeriesArr", this.data.result.toString());
|
||
|
wx.redirectTo({
|
||
|
url: '/pages/brandCrisis/crisiSet/index'
|
||
|
})
|
||
|
}
|
||
|
})
|