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.
60 lines
1.5 KiB
60 lines
1.5 KiB
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: app.globalData.getStorage('token'),
|
|
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.navigateBack({
|
|
delta: 1
|
|
// url: '/pages/brandCrisis/crisiSet/index?brand=' + this.data.brand
|
|
})
|
|
}
|
|
}) |