Browse Source

地址管理编辑点击优化

master
杜叶春 2 years ago
parent
commit
346d7b1bf8
  1. 8
      pages/address/index.js
  2. 8
      pages/address/index.wxml
  3. 1
      pages/address/upaddress.js

8
pages/address/index.js

@ -72,7 +72,7 @@ Page({
onLoad: function (options) {
console.log(options)
// console.log(options)
var that = this;
that.setData({
productStr: options.product,
@ -277,6 +277,12 @@ Page({
wx.setStorageSync('addressId', addressId);
}
},
navToUpaddress: function (e) {
var item = e.currentTarget.dataset
wx.navigateTo({
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,
})
},
// 数据加载
DataonLoad: function () {
var that = this;

8
pages/address/index.wxml

@ -12,9 +12,9 @@
<text class="address-phone">{{item.tel}}</text>
</view>
<view class="address-info">{{item.address_xq}}</view>
<navigator class='address_img_div' 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}}">
<view class='address_img_div' catchtap="navToUpaddress" data-addrId="{{item.id}}" data-name="{{item.name}}" data-tel="{{item.tel}}" data-sheng="{{item.sheng}}" data-city="{{item.city}}" data-quyu="{{item.quyu}}" data-address="{{item.address}}" data-is_default="{{item.is_default}}">
<image src='/images/x_right.png' class='address_img'></image>
</navigator>
</view>
</view>
<view class="address-edit">
@ -30,9 +30,9 @@
</view>
<text class='address_text' wx:if="{{item.is_default==1}}">默认地址</text>
</view>
<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}}">
<view style='display:inline-block;' catchtap="navToUpaddress" data-addrId="{{item.id}}" data-name="{{item.name}}" data-tel="{{item.tel}}" data-sheng="{{item.sheng}}" data-city="{{item.city}}" data-quyu="{{item.quyu}}" data-address="{{item.address}}" data-is_default="{{item.is_default}}">
<text style='margin:10px'>编辑</text>
</navigator>
</view>
<text data-id="{{item.id}}" bindtap="delAddress">删除</text>
</view>
</view>

1
pages/address/upaddress.js

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

Loading…
Cancel
Save