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.

50 lines
1.1 KiB

8 years ago
const address = require('../../utils/address.js')
8 years ago
const district = require('../../utils/address_data.json')
8 years ago
Page({
8 years ago
data: {
8 years ago
arraySheng: ['a', 'b'],
8 years ago
indexSheng: 0,
},
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
indexSheng: e.detail.value
})
},
8 years ago
formSubmit: function(e) {
address.postAddress(e.detail.value)
8 years ago
console.log('form 发生了 submit 事件,携带数据为:', e.detail.value)
8 years ago
},
formReset: function(e) {
8 years ago
console.log('form 发生了 reset 事件')
},
onLoad (params) {
//this.data.sku = params.sku
8 years ago
this.setData({'arraySheng': district.keys()})
},
getAddressMenu: function() {
var that = this
wx.request({
method: 'POST',
url: `cities?province=${that.data.arraySheng[indexSheng]}`,
data: Object.assign({}, data),
header: { 'Content-Type': 'application/json' },
success (res) {
console.log('success')
wx.setStorageSync('addrss', res.data)
wx.navigateBack()
},
fail (e) {
console.log('error')
console.error(e)
}
})
8 years ago
}
})