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.
41 lines
908 B
41 lines
908 B
|
|
//获取应用实例
|
|
const app = getApp()
|
|
Page({
|
|
onLoad: function (options) {
|
|
// this.setData({
|
|
// title: options.title
|
|
// });
|
|
var that = this
|
|
wx.request({
|
|
url: app.gw.hostUrl + '/mall/wxa/index/opencitylist',
|
|
data: { cityName: 'cityName' },
|
|
method: 'GET',
|
|
header: {
|
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
},
|
|
success: function (res) {
|
|
console.log(res.data)
|
|
var citys = res.data;
|
|
console.log(citys);
|
|
that.setData({
|
|
citys
|
|
});
|
|
},
|
|
fail: function () {
|
|
// fail
|
|
},
|
|
})
|
|
},
|
|
openGroup: function (e) {
|
|
// console.log(e.currentTarget.dataset.item)
|
|
wx.setStorage({
|
|
key: 'cityId',
|
|
data: e.currentTarget.dataset.item,
|
|
});
|
|
wx.navigateTo({
|
|
url: '../district/district?cityId=' + e.currentTarget.dataset.item,
|
|
})
|
|
|
|
},
|
|
})
|