瀏覽代碼

增加拨打线下运维电话

XWookey 8 月之前
父節點
當前提交
8afc8e0aa4
共有 5 個文件被更改,包括 52 次插入2 次删除
  1. 二進制
      images/phone_underline.png
  2. 14 0
      pages/charginfo/charginfo.js
  3. 1 1
      pages/charginfo/charginfo.wxml
  4. 20 0
      pages/charginfo/charginfo.wxss
  5. 17 1
      pages/charging/charging.js

二進制
images/phone_underline.png


+ 14 - 0
pages/charginfo/charginfo.js

@@ -494,6 +494,20 @@ Page({
     });
     return;
   },
+  callphone(){
+    let that = this
+    let phonenum =  that.data.offlineServicecall;
+    wx.makePhoneCall({
+        phoneNumber: that.data.offlineServicecall, //此号码并非真实电话号码,仅用于测试
+        success:function(){
+          console.log("拨打电话成功!" + phonenum)
+        },
+        fail:function(){
+          console.log("拨打电话失败!" + phonenum)
+        }
+      })
+  
+  },
   /**
    * 生命周期函数--监听页面隐藏
    */

+ 1 - 1
pages/charginfo/charginfo.wxml

@@ -13,7 +13,7 @@
             </block>   
           </text>
           <text class="grey address">{{address}}</text>
-          <text class="grey">线下运维电话: {{offlineServicecall}}</text>
+          <view  class="grey_underline" bindtap="callphone"><text class="grey">线下运维电话:</text><image src="/images/phone_underline.png"/><text class="phone"  > {{offlineServicecall}}</text></view>
         </view>
       </view>
 

+ 20 - 0
pages/charginfo/charginfo.wxss

@@ -361,4 +361,24 @@ text.price {
     border-radius: 15rpx;
     height: 30rpx;
     line-height: 30rpx;
+}
+.grey_underline{
+    height: 42rpx;
+    display: flex;
+    flex-direction: row;
+}
+.grey_underline image{
+    height: 18rpx;
+    width: 18rpx;
+    margin:15rpx 3rpx;
+    margin-left: 5rpx;
+}
+
+.grey_underline .phone{
+    font-size: 22rpx;
+    line-height: 42rpx;
+    height: 42rpx;
+    min-height: 42rpx;
+    color: #9d9d9d;
+    margin: 0;
 }

+ 17 - 1
pages/charging/charging.js

@@ -464,8 +464,24 @@ Page({
               });
               console.log(orderid_r);
               that.delOrder(orderid_r);
-            }
+            } else if (chargingOrder.chargPileStatus == 5) { //订单被删除
+                clearInterval(chargingStatus);
+                log.info('[充电中]', '[充电轮训]', '[chargPileStatus状态5订单被删除]', data);
+                wx.showModal({
+                  showCancel: false,
+                  content: '开启充电失败',
+                  confirmColor:'#00AADD',
+                });
+                console.log(orderid_r);
+                that.delOrder(orderid_r);
+              }
           } else if (data && data.code == 500) {
+              if(data.msg == '没有充电桩实时充电状态'){
+                let url = `/pages/index/index`;
+                wx.reLaunch({
+                  url
+                });
+              }
             // console.info("ddddddddddddddddddddddddddd")
             // console.info(that.data.orderid)
             // console.info(userIdCache)