Browse Source

add more tels

zjxpcyc 6 years ago
parent
commit
efb956d55e

BIN
assets/images/call.png View File


BIN
assets/images/map.png View File


+ 6
- 4
pages/components/SubIndex/index.js View File

25
       icon: '/assets/images/icon7.png',
25
       icon: '/assets/images/icon7.png',
26
       remark: '客服热线:025-86505555'
26
       remark: '客服热线:025-86505555'
27
     }],
27
     }],
28
-    EstateList: []
28
+    EstateList: [],
29
   },
29
   },
30
   lifetimes: {},
30
   lifetimes: {},
31
   ready: function() {
31
   ready: function() {
147
       })
147
       })
148
     },
148
     },
149
     toTel() {
149
     toTel() {
150
-      wx.makePhoneCall({
151
-        phoneNumber: '025-86505555'
152
-      })
150
+      // wx.makePhoneCall({
151
+      //   phoneNumber: '025-86505555'
152
+      // })
153
+      
154
+      this.triggerEvent('showTelDialog')
153
     }
155
     }
154
   }
156
   }
155
 })
157
 })

+ 1
- 1
pages/components/SubIndex/index.wxml View File

101
         </swiper>
101
         </swiper>
102
       </view>
102
       </view>
103
       <view bindtap="toMap">
103
       <view bindtap="toMap">
104
-        <image mode="widthFix" src="/assets/images/icon7.png"></image>
104
+        <image mode="widthFix" src="/assets/images/map.png"></image>
105
         <text>地图看新房</text>
105
         <text>地图看新房</text>
106
       </view>
106
       </view>
107
     </view>
107
     </view>

+ 32
- 1
pages/index/index.js View File

43
     }],
43
     }],
44
     conPageIndex: 0,
44
     conPageIndex: 0,
45
     ScreenBottomHeight: app.globalData.ScreenBottomHeight,
45
     ScreenBottomHeight: app.globalData.ScreenBottomHeight,
46
-    NavActiveIndex: 0 // nav焦点索引值
46
+    NavActiveIndex: 0, // nav焦点索引值
47
+    telList: [
48
+      {
49
+        title: '悦见山',
50
+        tel: '025-86505555',
51
+      },
52
+      {
53
+        title: '依澜郡',
54
+        tel: '025-58651665',
55
+      },
56
+    ],
57
+    telListVisible: false,
58
+  },
59
+  callTel (e) {
60
+    const phoneNumber = e.target.dataset.tel
61
+    
62
+    if (phoneNumber) {
63
+      wx.makePhoneCall({ phoneNumber })
64
+      this.setData({
65
+        telListVisible: false,
66
+      })
67
+    }
68
+  },
69
+  showTelDialog () {
70
+    this.setData({
71
+      telListVisible: true,
72
+    })
73
+  },
74
+  closeTelLayer () {
75
+    this.setData({
76
+      telListVisible: false,
77
+    })
47
   },
78
   },
48
   TriggerCutNav(e) {
79
   TriggerCutNav(e) {
49
     this.DealNavCut(e.detail.index)
80
     this.DealNavCut(e.detail.index)

+ 13
- 1
pages/index/index.wxml View File

6
 
6
 
7
     <!-- 首页 -->
7
     <!-- 首页 -->
8
     <view hidden="{{NavActiveIndex !== 0}}">
8
     <view hidden="{{NavActiveIndex !== 0}}">
9
-      <subindex bindmyevent="TriggerCutNav"></subindex>
9
+      <subindex bindmyevent="TriggerCutNav" bindshowTelDialog="showTelDialog"></subindex>
10
     </view>
10
     </view>
11
 
11
 
12
     <!-- 楼盘 -->
12
     <!-- 楼盘 -->
60
       </view>
60
       </view>
61
     </view>
61
     </view>
62
   </view>
62
   </view>
63
+  
64
+  <view class="layer" hidden="{{!telListVisible}}" bindtap="closeTelLayer">
65
+    <view class="centerLabel" style="padding: 30rpx;">
66
+      <view style="text-align: center; font-size: 30rpx; margin-bottom: 30rpx;">拨打电话</view>
67
+      <view wx:for="{{telList}}" class="tel-list" wx:for-item="tel" wx:key="{{tel.tel}}" data-tel="{{tel.tel}}" bindtap="callTel" >
68
+        <view data-tel="{{tel.tel}}">{{tel.title}}: {{tel.tel}}</view>
69
+        <view data-tel="{{tel.tel}}">
70
+          <image mode="widthFix" src="/assets/images/call.png"></image>
71
+        </view>
72
+      </view>
73
+    </view>
74
+  </view>
63
 
75
 
64
 </view>
76
 </view>

+ 17
- 0
pages/index/index.wxss View File

153
   color: #fff;
153
   color: #fff;
154
   background-color: #BB9C79;
154
   background-color: #BB9C79;
155
 }
155
 }
156
+
157
+.tel-list {
158
+  padding: 10rpx;
159
+  display: flex;
160
+  font-size: 28rpx;
161
+  color: #666;
162
+  justify-content: space-between;
163
+}
164
+
165
+.tel-list image {
166
+  width: 32rpx;
167
+  height: 32rpx;
168
+}
169
+
170
+.tel-list + .tel-list {
171
+  border-top: 1rpx solid #ddd;
172
+}