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.2 KiB

//获取应用实例
const app = getApp()
Page({
data:{
cityName:'',
districtName: '',
},
onLoad: function (options) {
var that = this
// 商家编号
wx.getStorage({
key: 'cityName',
success: function (res) {
that.setData({
cityName: res.data
})
}
});
// 商家编号
wx.getStorage({
key: 'districtName',
success: function (res) {
that.setData({
districtName: res.data
})
}
});
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) {
var citys = res.data;
console.log(citys)
that.setData({
citys: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,
})
},
})