Browse Source

地址编辑BUG修复

master
杜叶春 2 years ago
parent
commit
0dd1beeec2
  1. 10
      pages/address/index.js
  2. 2
      pages/address/index.wxml
  3. 1
      pages/address/upaddress.js

10
pages/address/index.js

@ -271,9 +271,11 @@ Page({
}, },
// 返回结算页面 // 返回结算页面
chooseBack: function (e) { chooseBack: function (e) {
wx.navigateBack() if (this.data.productStr) {
var addressId = e.currentTarget.dataset.id wx.navigateBack()
wx.setStorageSync('addressId', addressId); var addressId = e.currentTarget.dataset.id
wx.setStorageSync('addressId', addressId);
}
}, },
// 数据加载 // 数据加载
DataonLoad: function () { DataonLoad: function () {
@ -287,7 +289,7 @@ Page({
if (res.code == 200) { if (res.code == 200) {
var data = res.data; var data = res.data;
var address = data.adds; var address = data.adds;
that.numbers = data.adds; // that.numbers = data.adds;
if (address == '') { if (address == '') {
var address = [] var address = []
} }

2
pages/address/index.wxml

@ -30,7 +30,7 @@
</view> </view>
<text class='address_text' wx:if="{{item.is_default==1}}">默认地址</text> <text class='address_text' wx:if="{{item.is_default==1}}">默认地址</text>
</view> </view>
<navigator style='display:inline-block;' url="../address/upaddress?addr_id={{item.id}}&name={{item.name}}&tel={{item.tel}}&sheng={{item.sheng}}&city={{item.city}}&quyu={{item.quyu}}&address={{item.address}}&is_default={{item.is_default}}"> <navigator style='display:inline-block;' url="/pages/address/upaddress?addr_id={{item.id}}&name={{item.name}}&tel={{item.tel}}&sheng={{item.sheng}}&city={{item.city}}&quyu={{item.quyu}}&address={{item.address}}&is_default={{item.is_default}}">
<text style='margin:10px'>编辑</text> <text style='margin:10px'>编辑</text>
</navigator> </navigator>
<text data-id="{{item.id}}" bindtap="delAddress">删除</text> <text data-id="{{item.id}}" bindtap="delAddress">删除</text>

1
pages/address/upaddress.js

@ -38,6 +38,7 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options)
var region = [] var region = []
region.push(options.sheng) region.push(options.sheng)
region.push(options.city) region.push(options.city)

Loading…
Cancel
Save