Parcourir la source

todo
优化细节页面

wzh il y a 2 ans
Parent
commit
141b9b32bc
2 fichiers modifiés avec 35 ajouts et 3 suppressions
  1. 1 1
      pages/bluetooth/index/index.vue
  2. 34 2
      pages/device/detail.vue

+ 1 - 1
pages/bluetooth/index/index.vue

@@ -463,7 +463,7 @@ import i18 from '@/utils/i18.js'
             .replace(/\n/g, '')
             .replace(/\r/g, '')
         console.log("写入数据:"+data);
-        ecBLE.writeBLECharacteristicValue(data, false)
+        ecBLE.writeBLECharacteristicValue(data, true)
       },
 			listViewTap(id){
         let self = this;

+ 34 - 2
pages/device/detail.vue

@@ -341,7 +341,7 @@
       </view>
     </u-popup>
 
-    <u-popup :show="true"  mode="center"  >
+    <u-popup :show="deviceInfo.status != 3"  mode="center"  >
         <view style="
         margin:2%;padding:10%; /* 背景色 */color: #000; padding: 10px; /* 内边距 */border-radius: 5px; /* 圆角 */font-size: 16px; /* 文字大小 */text-align: center; /* 文字居中 */  ">
          <view style="width: 100px;margin-top:40rpx;">设备未在线</view>
@@ -580,6 +580,16 @@
               <uni-icons type="forward" size="16"></uni-icons>
             </view>
           </view>
+<!--          <view class="prop-item">-->
+<!--            <view class="prop-item-image">-->
+<!--              <image :src="imgUrl+'/setting/runinfo.png'" style="width: 100%;height:100%;"/>-->
+<!--            </view>-->
+<!--            <view class="prop-item-left">修改名称</view>-->
+<!--            <view class="prop-item-right" @click="modifyName">-->
+<!--              <uni-icons type="forward" size="16"></uni-icons>-->
+<!--            </view>-->
+<!--          </view>-->
+
 
 
         </view>
@@ -619,7 +629,7 @@
 </template>
 
 <script>
-import { getDetail,getDeviceStatus,cacheJsonThingsModel,reportError ,getDeviceRunTime,getLatestFirmware} from '@/api/device/device.js'
+import { getDetail,getDeviceStatus,cacheJsonThingsModel,reportError ,getDeviceRunTime,getLatestFirmware,bingDeviceDept} from '@/api/device/device.js'
 import config from '@/config'
 export default {
   data(){
@@ -746,6 +756,28 @@ export default {
     clearTimeout(this.checkTimer);
   },
   methods:{
+    modifyName(){
+      uni.showModal({
+        title: "修改设备名称",
+        editable: true,
+        placeholderText: "请输入设备名称",
+        content: this.deviceInfo.deviceName,
+        showCancel: true,
+        success: function (res) {
+          console.log(res);
+          if(res.confirm){
+            let content = res.content;
+            let obj = {id:this.id,deviceName:content};
+            bingDeviceDept(obj).then(res=>{
+              // debugger;
+            });
+          }
+        },
+        fail: function (res) {
+          console.log(res);
+        }
+      })
+    },
     showWorkPicker(){
       let self = this;