Compare commits

..

No commits in common. '1f90d7b0022f7ba344c2aa7d04b03cd96512fd76' and 'bb372ef132c3f5042f102fae15a8db8862ac5df3' have entirely different histories.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

@ -38,6 +38,7 @@ addresslist:{}
})
},
consigneeRegionInput: function (e) {
this.setData({
consigneeRegion: e.detail.value
})
@ -94,7 +95,6 @@ addresslist:{}
addresslist.name=this.data.consigneeName
addresslist.phone=this.data.phone
addresslist.address=this.data.consigneeRegion
console.log(this.data.consigneeRegion)
addresslist.detailedAddress=this.data.detailedAddress
addresslist.check=check
this.setData({
@ -171,58 +171,43 @@ addresslist:{}
var that = this
var city = that.data.city
var value = that.data.value
that.startAddressAnimation(false)
console.log(value)
this.startAddressAnimation(false)
// 将选择的城市信息显示到输入框
var consigneeRegion = that.data.provinces[value[0]].name + '-' + that.data.citys[value[1]].name + '-' + that.data.areas[value[2]].name
console.log(consigneeRegion)
that.setData({
consigneeRegion: consigneeRegion
consigneeRegion: consigneeRegion,
})
},
// 处理省市县联动逻辑
cityChange: function (e) {
var value = e.detail.value
console.log(value)
var provinces = this.data.provinces
var citys = this.data.citys
var areas = this.data.areas
var provinceNum = value[0]
var cityNum = value[1]
var countyNum = value[2]
console.log(provinceNum)
// 如果省份选择项和之前不一样,表示滑动了省份,此时市默认是省的第一组数据,
if (this.data.value[0] != provinceNum) {
var pid = provinces[provinceNum].id
console.log(pid)
console.log(address._citys[pid][0])
console.log(address._citys[pid][0].id)
var id = provinces[provinceNum].id
this.setData({
value: [provinceNum, 0, 0],
citys: address._citys[pid],
areas: address._areas[address._citys[pid][0].id],
citys: _citys[id],
areas: _areas[_citys[id][0].id],
})
} else if (this.data.value[1] != cityNum) {
// 滑动选择了第二项数据,即市,此时区显示省市对应的第一组数据
var id = citys[cityNum].id
this.setData({
value: [provinceNum, cityNum, 0],
areas: address.areas[citys[cityNum].id],
areas: _areas[citys[cityNum].id],
})
}
console.log(provinceNum)
console.log(cityNum)
console.log(countyNum)
} else {
// 滑动选择了区
this.setData({
value: [provinceNum, cityNum, countyNum]
})
}
},

@ -20,7 +20,7 @@
<view class="address-msg">
<view class="item-msg">所在地区</view>
<view class="section" bindtap='select'>
<input disabled="disabled" placeholder="省市区县、乡镇等" data-value="{{consigneeRegion}}" bindblur="consigneeRegionInput" placeholder-class="phcolor"></input>
<input disabled="disabled" placeholder="省市区县、乡镇等" value="{{consigneeRegion}}" bindblur="consigneeRegionInput" placeholder-class="phcolor"></input>
</view>
<view class="address-rights" bindtap='select'>
@ -30,7 +30,7 @@
<view class="address-msg">
<view class="item-msg">详细地址</view>
<view class="section">
<input type="text" placeholder="街道、楼牌号等" data-value="{{detailedAddress}}" bindblur="detailedAddressInput" placeholder-class="phcolor"></input>
<input type="text" placeholder="街道、楼牌号等" value="{{detailedAddress}}" bindblur="detailedAddressInput" placeholder-class="phcolor"></input>
</view>
</view>
<view class="label">

@ -17,6 +17,8 @@ Page({
},
delAddress:function(event){
var that = this;
const index = event.currentTarget.id;
console.log(index)
let addressList = this.data. addressList;//购物车所有的商品数据
@ -59,13 +61,12 @@ Page({
}) //还需修改
.get({
success: res => {
console.log(res.data[0].address)
console.log(res.data.address)
console.log(res.data)
//这一步很重要给ne赋值没有这一步的话前台就不会显示值
this.setData({
addressList: res.data[0].address
})
console.log(addressList)
}
})

@ -34,9 +34,11 @@ Page({
onLoad: function (options) {
let foodid =options.id
var userid=app.globalData.openid
// console.log('1111w ');
console.log('1111w ');
console.log(userid)
this.setData({
userid:userid

@ -19,7 +19,7 @@ Page({
},
allCheckbox: function(tap) {
var a = 0 //设置初始总价格
var index = tap.currentTarget.dataset.index
console.log(index)//获取索引值
let address = this.data.addresslist //获取地址列表

Loading…
Cancel
Save