2024-01-22 18:48:00 +08:00

48 lines
1.3 KiB
JavaScript

var t;
(t = getApp()),
Page({
data: {
winHeight: 0,
tHeight: 0,
bHeight: 0,
startPageY: 0,
scrollTop: 0,
two_none: "none",
hasback: "none",
prov_list: [],
city_list: [],
},
onLoad: function () {
var a = this;
wx.showLoading({ title: "请求中" }),
t.getdata("", "carcitynew").then((t) => {
var e = t.data;
console.log("回调数据汽车:", e), a.setData({ prov_list: e });
});
var e = wx.getSystemInfoSync().windowHeight;
a.setData({ winHeight: e });
},
btn_pinpai: function (t) {
var a = t.currentTarget.dataset.name;
wx.setStorageSync("carprov", a),
this.setData({
two_none: "block",
hasback: "block",
city_list: t.currentTarget.dataset.item,
});
},
btn_sel_name: function (t) {
var a = t.currentTarget.dataset.item;
console.log(a),
wx.setStorageSync("carcity", a),
wx.navigateBack({ delta: 1 });
},
goback: function () {
"block" == this.data.three_none
? this.setData({ three_none: "none" })
: "block" == this.data.two_none
? this.setData({ two_none: "none", hasback: "none" })
: this.setData({ hasback: "none" });
},
});