Procházet zdrojové kódy

增加拨打线下运维电话

XWookey před 10 měsíci
rodič
revize
8afc8e0aa4

binární
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)