Browse Source

客户地址

zhaoxiaohai 3 years ago
parent
commit
f201c393e3

+ 9 - 2
packageA/setclient/modules/address/index.js

@@ -19,6 +19,11 @@ Component({
         }
     },
     methods: {
+        changeTotal() {
+            this.setData({
+                "content.total": this.data.content.total - 1
+            })
+        },
         /* 获取地址列表 */
         getList(id, init) {
             let content = this.data.content;
@@ -44,8 +49,10 @@ Component({
                     "content.total": res.total,
                     sys_enterpriseid: id
                 })
-                setTimeout(()=>{this.selectComponent("#List").initRadio();},300)
-               
+                setTimeout(() => {
+                    this.selectComponent("#List").initRadio();
+                }, 300)
+
             })
         }
     }

+ 1 - 1
packageA/setclient/modules/address/index.wxml

@@ -10,4 +10,4 @@
     </view>
 </view>
 
-<List id='List' list='{{list}}' />
+<List id='List' list='{{list}}' bindchangeTotal='changeTotal' />

+ 9 - 11
packageA/setclient/modules/address/list/index.js

@@ -4,19 +4,12 @@ Component({
         addGlobalClass: true
     },
     properties: {
-        list: Array
+        list: Array,
+        changeTotal: Function
     },
-
-    /**
-     * 组件的初始数据
-     */
     data: {
         radio: 0, //默认
     },
-
-    /**
-     * 组件的方法列表
-     */
     methods: {
         // 修改默认
         radioChange({
@@ -53,6 +46,11 @@ Component({
                 that = this;
             if (!name) return;
             switch (name) {
+                case 'call':
+                    wx.makePhoneCall({
+                        phoneNumber: item.phonenumber,
+                    })
+                    break;
                 case 'copy':
                     let str = `联系人:${item.name}\n手机号码:${item.phonenumber}\n所在地区:${item.province+item.city+item.county}\n详细地址:${item.province+item.city+item.county+item.address}`
                     wx.setClipboardData({
@@ -87,9 +85,9 @@ Component({
                                         icon: "none"
                                     })
                                     that.setData({
-                                        list: that.data.list.filter(v => v.contactsid != item.contactsid),
-                                        "content.total": that.data.content.total - 1
+                                        list: that.data.list.filter(v => v.contactsid != item.contactsid)
                                     });
+                                    that.triggerEvent("changeTotal")
                                 })
                             }
                         }

+ 2 - 4
packageA/setclient/modules/address/list/index.wxml

@@ -2,18 +2,16 @@
     <view class="add-box" wx:for="{{list}}" wx:key="item.changeuserid">
         <view class="detail">
             <view class="label">
-                {{item.province + item.city + item.county + item.address}}
+                <text class="iconfont icon-a-wodemendianxinxidizhi" style="color: #3874F6;" /> {{item.province + item.city + item.county + item.address}}
             </view>
             <view class="detail-add">
                 {{item.name}}:{{item.phonenumber}}
             </view>
-            <view class="principal">
-
-            </view>
         </view>
         <view class="editor">
             <van-radio icon-size='14' label-class='radio' name="{{item.contactsid}}">默认收货地址</van-radio>
             <view class="icon-but" bindtap="handleItem">
+                <navigator url="#" data-item="{{item}}" data-name="call" class="iconfont icon-a-wodemendianxinxidianhua" />
                 <navigator url="#" data-item="{{item}}" data-name="copy" class="iconfont icon-a-yingxiaowuliaofuzhi" />
                 <navigator url="#" data-item="{{item}}" data-name="edit" class="iconfont icon-bianji" />
                 <navigator url="#" data-item="{{item}}" data-name="delete" class="iconfont icon-shanchu" />