فهرست منبع

todo设备解绑功能

wzh 2 سال پیش
والد
کامیت
f7bac908ef
3فایلهای تغییر یافته به همراه21 افزوده شده و 6 حذف شده
  1. 2 1
      locale/en.json
  2. 2 2
      manifest.json
  3. 17 3
      pages/weitiandi/deviceList.vue

+ 2 - 1
locale/en.json

@@ -152,7 +152,8 @@
     "WIFI配网" : "WIFI Config",
     "正在连接蓝牙": "",
     "配网成功,请扫码绑定设备" : "Successfully,Please scan to bind device.",
-    "正在配置网络信息": "Configuring network information."
+    "正在配置网络信息": "Configuring network information.",
+    "解绑设备":"Unbind"
 
   },
   "locale.auto": "System",

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "WeGoodCharger",
     "appid" : "__UNI__60E8019",
     "description" : "",
-    "versionName" : "1.1.0",
-    "versionCode" : 110,
+    "versionName" : "1.1.1",
+    "versionCode" : 111,
     "transformPx" : false,
     "app-plus" : {
         "usingComponents" : true,

+ 17 - 3
pages/weitiandi/deviceList.vue

@@ -4,14 +4,21 @@
       <view class="item" v-for="item in chargeList" :key="item.id">
         <view class="item-header">
           <view class="item-title">
-            {{i18('设备编号')}}:{{ item.imei }}
+            {{i18('设备编号')}}:{{ item.qrcode }}
           </view>
           <view class="item-status">
             <uni-tag type="success" :text="i18('在线中')" v-if="item.status === 1"></uni-tag>
-            <uni-tag type="default" :text="i18('已离线')" v-if="item.status === 2"></uni-tag>
+            <uni-tag type="default" :text="i18('已离线')" v-if="item.status === 0"></uni-tag>
           </view>
         </view>
         <view class="item-body">
+          <view style="font-size: 12px; margin: 5px 0;position: relative">
+            <view class="item-detail-btn" @click="unbind(item)">
+              {{i18('解绑设备')}}
+            </view>
+          </view>
+        </view>
+        <view class="item-body" style ="height: 10vh;line-height: 10vh">
           <view style="font-size: 12px; margin: 5px 0;position: relative">
             {{i18('创建时间')}}:{{ item.createTime }}
             <view class="item-detail-btn" @click="detail(item)">
@@ -50,6 +57,9 @@ export default {
     })
   },
   methods: {
+    unbind(item){
+
+    },
     i18(text){
       return i18(text)
     },
@@ -61,12 +71,16 @@ export default {
       deviceList().then(res=>{
           this.startText = "more"
           this.chargeList =  res.data;
-          if(this.chargeList.length == 1){
+          if(this.chargeList.length == 1 && this.chargeList[0] == 1){
             this.detail(this.chargeList[0])
           }
       })
     },
     detail(item){
+      if(item.status == 0){
+        this.$modal.showToast("Device is offline.");
+        return;
+      }
       let qrcode = item.qrcode;
       let imei = item.imei;
       let ccid = item.ccid;