Ver Fonte

长按扫码,拨号功能

喻文俊 há 3 anos atrás
pai
commit
2ac41b4c45
1 ficheiros alterados com 14 adições e 4 exclusões
  1. 14 4
      components/cm-module/activityContact/index.vue

+ 14 - 4
components/cm-module/activityContact/index.vue

@@ -11,9 +11,9 @@
             <view class="cm-icon cm-bround cm-mobile" @click="handelShowMobile">
                 <view class="cm-dialog" v-show="mobileVisiable">
                     <view class="cm-dialog-content content1">
-                        <view class="cm-item"> <text>展会咨询电话:15338897365</text> </view>
+                        <view class="cm-item" @click="phoneCall('15338897365')"> <text>展会咨询电话:15338897365</text> </view>
                         <view class="cm-line line1"></view>
-                        <view class="cm-item"> <text>客服咨询电话:15338851365</text> </view>
+                        <view class="cm-item" @click="phoneCall('15338851365')"> <text>客服咨询电话:15338851365</text> </view>
                     </view>
                 </view>
             </view>
@@ -22,6 +22,7 @@
                     <view class="cm-dialog-content content2">
                         <view class="cm-item">
                             <image
+                                show-menu-by-longpress
                                 src="https://static.caimei365.com/app/img/icon2/cm_wechat_02.png"
                                 mode="widthFix"
                             ></image>
@@ -30,6 +31,7 @@
                         <view class="cm-line line2"></view>
                         <view class="cm-item">
                             <image
+                                show-menu-by-longpress
                                 src="https://static.caimei365.com/app/img/icon2/cm_wechat_01.png"
                                 mode="widthFix"
                             ></image>
@@ -89,8 +91,15 @@ export default {
             this.pageInfo.redPacketEndTime
         )
         console.log(this.pageInfo)
-    },
+    }, 
     methods: {
+        // 拨打电话
+        phoneCall(number){
+            console.log(number)
+            uni.makePhoneCall({
+                phoneNumber: number //仅为示例
+            })
+        },
         // 是否展开
         handleToggleAcitve(active) {
             this.isActive = active
@@ -217,6 +226,7 @@ export default {
     padding: 20rpx;
     background: rgb(255, 92, 0);
     border-radius: 16rpx;
+    z-index: 99999;
     &::after {
         position: absolute;
         top: 20rpx;
@@ -279,7 +289,7 @@ export default {
     justify-content: center;
     align-items: center;
     position: fixed;
-    z-index: 999;
+    // z-index: 999;
     top: 0;
     left: 0;
     width: 100vw;