فهرست منبع

优化一系列功能

wzh 2 سال پیش
والد
کامیت
5e441df782
8فایلهای تغییر یافته به همراه270 افزوده شده و 86 حذف شده
  1. 26 1
      api/device/device.js
  2. 2 1
      config.js
  3. 218 63
      pages/device/detail.vue
  4. 1 1
      pages/device/detail1.vue
  5. 6 3
      pages/device/reset/reset.vue
  6. 2 2
      pages/login.vue
  7. 15 15
      pages/work/index.vue
  8. BIN
      static/images/banner/banner01.png

+ 26 - 1
api/device/device.js

@@ -97,7 +97,23 @@ export function getDevcieByQrcode(id){
     })
 }
 
-//根据二维码找到设备详情
+//绑定设备
+export function bindDevice(device){
+    return request({
+        url: '/iot/device/bindDevice',
+        data:device,
+        method: 'post',
+    })
+}
+//注销设备
+export function resetDevice(device){
+    return request({
+        url: '/iot/device/resetDevice',
+        data:device,
+        method: 'post',
+    })
+}
+
 export function bingDeviceDept(device){
     return request({
         url: '/iot/device',
@@ -105,6 +121,15 @@ export function bingDeviceDept(device){
         method: 'put',
     })
 }
+
+//根据二维码找到设备详情
+export function editDeviceName(device){
+    return request({
+        url: '/iot/device/editDevice',
+        data:device,
+        method: 'post',
+    })
+}
 //主动上报错误
 export function reportError(err){
     return request({

+ 2 - 1
config.js

@@ -3,7 +3,8 @@ module.exports = {
   //baseUrl: 'https://vue.ruoyi.vip/prod-api',
    baseUrl: 'https://yun.dnzc.vip',
   //baseUrl: 'http://127.0.0.1:8991',
-  imgUrl:"https://hyscancode.oss-cn-hangzhou.aliyuncs.com/jianyaoji",
+  //imgUrl:"https://hyscancode.oss-cn-hangzhou.aliyuncs.com/jianyaoji",
+  imgUrl:"https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji",
   // 应用信息
   appInfo: {
     // 应用名称

+ 218 - 63
pages/device/detail.vue

@@ -66,7 +66,7 @@
               <view class="control_item_left" @click="subTemperature(1)">-</view>
               <view class="control_item_center">
                 <view style="position: absolute">
-                  <u-input  customStyle="width:150rpx;border:0px;" disabledColor="white"   @change="changeTemperature()" v-model="temperature"></u-input>
+                  <u-input  customStyle="width:150rpx;border:0px;" disabledColor="white" @change="propChange(1)"  @focus="propFocus(1)" @confirm="propBlur(1)" @blur="propBlur(1)" v-model="temperature"></u-input>
                 </view>
               </view>
               <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
@@ -82,8 +82,8 @@
             <view class="control_item_detail">
               <view class="control_item_left" @click="subTemperatureTime(1)">-</view>
               <view class="control_item_center">
-                <view style="position: absolute">
-                  <u-input  customStyle="width:150rpx;border:0px;" disabledColor="white"   v-model="temperatureTime"></u-input>
+                <view style="position: absolute;z-index: 999">
+                  <u-input  customStyle="width:150rpx;border:0px;z-index: 999" disabledColor="white"    v-model="temperatureTime"></u-input>
                 </view>
               </view>
               <view class="control_item_center_unit" :style="unitFixedStyle">分钟</view>
@@ -100,7 +100,7 @@
               <view class="control_item_left" @click="subTemperatureTime(1)">-</view>
               <view class="control_item_center">
                 <view style="position: absolute">
-                  <u-input  customStyle="width:150rpx;border:0px;" disabledColor="white"   v-model="leftJianyaoTime"></u-input>
+                  <u-input  customStyle="width:150rpx;border:0px;" disabledColor="white"  @change="propChange(1)"  @focus="propFocus(2)" @confirm="propBlur(2)" @blur="propBlur(2)"   v-model="leftJianyaoTime"></u-input>
                 </view>
               </view>
               <view class="control_item_center_unit" :style="unitFixedStyle">分钟</view>
@@ -115,7 +115,7 @@
             <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
             <view class="control_item_detail">
               <view class="control_item_center">
-                <u-input  customStyle="width:150rpx;border:0px;" disabledColor="white"  :value="currentTemperature"></u-input>
+                <u-input disabled customStyle="width:150rpx;border:0px;" disabledColor="white"  :value="currentTemperature"></u-input>
               </view>
               <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
             </view>
@@ -128,7 +128,7 @@
             <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
             <view class="control_item_detail">
               <view class="control_item_center">
-                <u-input  customStyle="width:150rpx;border:0px;" disabledColor="white"   :value="hightTemperature"></u-input>
+                <u-input disabled customStyle="width:150rpx;border:0px;" disabledColor="white"   :value="hightTemperature"></u-input>
               </view>
               <view class="control_item_center_unit" :style="unitFixedStyle">分钟</view>
             </view>
@@ -172,7 +172,7 @@
             <view class="control_item_detail">
               <view class="control_item_left" @click="subEdegTemperature(1)">-</view>
               <view class="control_item_center">
-                <u-input  customStyle="width:150rpx;border:0px;background:none;" disabledColor="white"  placeholder="0" disabled v-model="setEdegTemperature"></u-input>
+                <u-input  customStyle="width:150rpx;border:0px;background:none;" disabledColor="white"  placeholder="0"  @confirm="propBlur(3)" v-model="setEdegTemperature"></u-input>
               </view>
               <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
               <view class="control_item_right" @click="addEdegTemperature(1)">+</view>
@@ -187,14 +187,19 @@
             <view class="control_item_detail">
               <view class="control_item_left" @click="subEdegTemperature(1)">-</view>
               <view class="control_item_center">
-                <u-input  customStyle="width:150rpx;border:0px;background:none;" disabledColor="white"  placeholder="0" disabled v-model="edegTemperature"></u-input>
+                <u-input  customStyle="width:150rpx;border:0px;background:none;" disabledColor="white"  placeholder="0" @focus="propFocus(3)" @blur="propBlur(3)"  v-model="edegTemperature"></u-input>
               </view>
               <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
               <view class="control_item_right" @click="addEdegTemperature(1)">+</view>
 
             </view>
             <view class="control_item_title">
-               封边温度
+              <view v-if="!baozhuangFengbianSetting">
+                封边温度
+              </view>
+              <view v-if="baozhuangFengbianSetting">
+                设置温度
+              </view>
             </view>
           </view>
 
@@ -203,7 +208,7 @@
             <view class="control_item_detail">
               <view class="control_item_left" @click="subSealingTemperature(1)">-</view>
               <view class="control_item_center">
-                <u-input  customStyle="width:150rpx;border:0px;background:none;" disabledColor="white" placeholder="0" disabled  v-model="setSealingTemperature"></u-input>
+                <u-input  customStyle="width:150rpx;border:0px;background:none;" disabledColor="white" placeholder="0" @blur="propBlur(4)" @confirm="propBlur(4)"   v-model="setSealingTemperature"></u-input>
               </view>
               <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
               <view class="control_item_right" @click="addSealingTemperature(1)">+</view>
@@ -218,52 +223,57 @@
             <view class="control_item_detail">
               <view class="control_item_left" @click="subSealingTemperature(1)">-</view>
               <view class="control_item_center">
-                <u-input  customStyle="width:150rpx;border:0px;background:none;" disabledColor="white" placeholder="0" disabled  v-model="sealingTemperature"></u-input>
+                <u-input  customStyle="width:150rpx;border:0px;background:none;" disabledColor="white" placeholder="0"  @change="propChange(1)"  @focus="propFocus(4)" @blur="propBlur(4)"    v-model="sealingTemperature"></u-input>
               </view>
               <view class="control_item_center_unit" :style="unitFixedStyle">℃</view>
               <view class="control_item_right" @click="addSealingTemperature(1)">+</view>
 
             </view>
             <view class="control_item_title">
-              封口温度
+              <view v-if="!baozhuangFengkouSetting">
+                封口温度
+              </view>
+              <view v-if="baozhuangFengkouSetting">
+                设置温度
+              </view>
             </view>
           </view>
-
           <view class="control_item">
             <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
             <view class="control_item_detail">
-              <view class="control_item_left" @click="subPackageNumber()">-</view>
+              <view class="control_item_left" @click="subPackageVolume()">-</view>
               <view class="control_item_center">
                 <view style="position: absolute">
-                  <u-input  customStyle="width:150rpx;border:0px;" disabledColor="white"   @change="changePackageNumber" :value="packageNumber"></u-input>
+                  <u-input  customStyle="width:150rpx;border:0px;" disabledColor="white"   @focus="propFocus(5)" @confirm="propBlur(5)" @blur="propBlur(5)" v-model="packageVolume"></u-input>
                 </view>
               </view>
-              <view class="control_item_center_unit" :style="unitFixedStyle"></view>
-              <view class="control_item_right" @click="addPackageNumber()">+</view>
+              <view class="control_item_center_unit" :style="unitFixedStyle">ml</view>
+              <view class="control_item_right" @click="addPackageVolume()">+</view>
             </view>
             <view class="control_item_title">
-              包装
+              包装
             </view>
           </view>
-
           <view class="control_item">
             <image :src="imgUrl+'/detail/bg_mid.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
             <view class="control_item_detail">
-              <view class="control_item_left" @click="subPackageVolume()">-</view>
+              <view class="control_item_left" @click="subPackageNumber()">-</view>
               <view class="control_item_center">
                 <view style="position: absolute">
-                  <u-input  customStyle="width:150rpx;border:0px;" disabledColor="white"   @change="changePackageVolume" :value="packageVolume"></u-input>
+                  <u-input  customStyle="width:150rpx;border:0px;" disabledColor="white"    @focus="propFocus(6)" @confirm="propBlur(6)" @blur="propBlur(6)" v-model="packageNumber"></u-input>
                 </view>
               </view>
-              <view class="control_item_center_unit" :style="unitFixedStyle">ml</view>
-              <view class="control_item_right" @click="addPackageVolume()">+</view>
+              <view class="control_item_center_unit" :style="unitFixedStyle"></view>
+              <view class="control_item_right" @click="addPackageNumber()">+</view>
             </view>
             <view class="control_item_title">
-              包装
+              包装
             </view>
           </view>
 
 
+
+
         </view>
         <view class="bottom">
           <image :src="imgUrl+'/detail/bg_large.png'" style="width: 100%;height:100%;position: absolute;top:0px;"/>
@@ -563,15 +573,15 @@
               <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 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>
 
 
 
@@ -612,7 +622,7 @@
 </template>
 
 <script>
-import { getDetail,getDeviceStatus,cacheJsonThingsModel,reportError ,getDeviceRunTime,getLatestFirmware,bingDeviceDept} from '@/api/device/device.js'
+import { getDetail,getDeviceStatus,cacheJsonThingsModel,reportError ,getDeviceRunTime,getLatestFirmware,bingDeviceDept,editDeviceName} from '@/api/device/device.js'
 import config from '@/config'
 export default {
   data(){
@@ -722,6 +732,14 @@ export default {
       deviceType:1,
       tabActive:[true,false,false],
       resetDuration:4000,
+      jianyaoWenduSetting:false,
+      jianyaoShijianSetting:false,
+      baozhuangFengbianSetting:false,
+      baozhuangFengkouSetting:false,
+      baozhuangRongLiangSetting:false,
+      baozhuangShuLIangSetting:false,
+      tempFengkouWendu:0,
+      tempFengBianWendu:0,
     }
   },
   onLoad: function(opt) {
@@ -739,7 +757,69 @@ export default {
     clearTimeout(this.checkTimer);
   },
   methods:{
+    propChange(type){
+      // if(type == 1){
+
+      // }
+    },
+    propFocus(type){
+      if(type == 1){
+        this.jianyaoWenduSetting = true;
+      }
+
+      if(type == 2){
+        this.jianyaoShijianSetting = true;
+      }
+      if(type == 3){
+        this.baozhuangFengbianSetting = true;
+        this.tempFengBianWendu = this.edegTemperature;
+        this.edegTemperature = this.setEdegTemperature;
+      }
+      if(type == 4){
+        this.baozhuangFengkouSetting = true;
+        this.tempFengkouWendu = this.sealingTemperature;
+        this.sealingTemperature = this.setSealingTemperature;
+      }
+      if(type == 5){
+        this.baozhuangRongLiangSetting = true;
+
+      }
+      if(type == 6){
+        this.baozhuangShuLIangSetting = true;
+      }
+
+
+    },
+    autoBlur(type){
+
+    },
+    propBlur(type){
+      if(type == 1){
+        this.jianyaoWenduSetting = false;
+        this.changeTemperature();
+      }
+      if(type == 2){
+        this.temperatureTime = this.leftJianyaoTime;
+        this.changeTemperatureTime();
+      }
+      if(type == 3){
+        this.setEdegTemperature = this.edegTemperature;
+        this.changeEdegTemperature();
+      }
+      if(type == 4){
+        this.setSealingTemperature = this.sealingTemperature;
+        this.changeSealingTemperature();
+      }
+      if(type == 5){
+        this.changePackageVolume()
+      }
+      if(type == 6){
+        this.changePackageNumber();
+      }
+
+    },
     modifyName(){
+      let self = this;
       uni.showModal({
         title: "修改设备名称",
         editable: true,
@@ -750,9 +830,14 @@ export default {
           console.log(res);
           if(res.confirm){
             let content = res.content;
-            let obj = {id:this.id,deviceName:content};
-            bingDeviceDept(obj).then(res=>{
-              // debugger;
+            let obj = {"deviceId":self.id,deviceName:content};
+            editDeviceName(obj).then(res=>{
+              if(res.code == 200){
+                self.deviceInfo.deviceName = content;
+                self.$modal.showToast('修改成功')
+              }else{
+                self.$modal.showToast('修改失败,请稍后再试')
+              }
             });
           }
         },
@@ -980,25 +1065,40 @@ export default {
       }
       this.resetChoose();
      if(index == 4){
-          this.firstTab = false;
+
+       uni.showLoading({title:"加载中"});
        getDeviceStatus(this.id,0).then(res=>{
          let data =res.data;
          this.deviceInfo = data;
          self.parseStatusData(data)
+         setTimeout(function () {
+           uni.hideLoading();
+           self.firstTab = false;
+         },100);
+
        });
      }else{
-       this.firstTab = true;
+
        let arr = ["a","b","c"]
        if(type == 4 || type == 5){
          this.childId =arr[index-1];
-         this.getDeviceStatus();
+         this.getDeviceStatus(function(){
+           self.tabIndex = index;
+           self.firstTab = true;
+           self.tabActive[index-1] = true;
+           self.$forceUpdate();
+         });
        }else{
-         this.getDeviceStatus()
+         this.getDeviceStatus(function(){
+           self.tabIndex = index;
+           self.firstTab = true;
+           self.tabActive[index-1] = true;
+           self.$forceUpdate();
+         })
        }
-       this.tabIndex = index;
-       this.tabActive[index-1] = true;
+
        console.log(this.tabActive)
-       this.$forceUpdate();
+
 
      }
     },
@@ -1404,20 +1504,31 @@ export default {
           obj.id = key;
           if(key === "PackingVolume"){
             obj.shadow = this.packageVolume;
+            setTimeout(function (){
+              self.baozhuangRongLiangSetting = false;
+            },self.resetDuration);
           }
           if(key === "PackageQuantity"){
             obj.shadow = this.packageNumber;
+            setTimeout(function (){
+              self.baozhuangShuLIangSetting = false;
+            },self.resetDuration);
           }
           if(key === "SetSealTemp"){
             obj.shadow = this.setSealingTemperature;
             setTimeout(function (){
               self.fengkouDlgShow = false;
+              self.baozhuangFengkouSetting = false;
+              self.sealingTemperature = self.tempFengKouWendu;;
             },self.resetDuration);
           }
           if(key === "SetBandingTemp"){
             obj.shadow = this.setEdegTemperature;
             setTimeout(function (){
               self.fengbianDlgShow = false;
+              self.baozhuangFengbianSetting = false;
+              self.edegTemperature = self.tempFengBianWendu;
+
             },self.resetDuration);
           }
           if(targetKey == key){
@@ -1442,12 +1553,18 @@ export default {
           obj.id = key;
           if(key === "TempSetting"){
             obj.shadow = this.temperature;
-            setTimeout(function(){
-              self.wenhuoTimeDlgShow = false;
-            },self.resetDuration)
+            // setTimeout(function(){
+            //   self.wenhuoTimeDlgShow = false;
+            //   self.jianyaoShijianSetting = false;
+            // },self.resetDuration)
           }
           if(key === "TimeSetting"){
             obj.shadow = this.temperatureTime;
+            self.leftJianyaoTime = this.temperatureTime;;
+            setTimeout(function(){
+              self.wenhuoTimeDlgShow = false;
+              self.jianyaoShijianSetting = false;
+            },self.resetDuration)
           }
           if(targetKey == key){
             arr.push(obj);
@@ -1785,16 +1902,24 @@ export default {
         }
       });
     },
-    getDeviceStatus(){
+    getDeviceStatus(func){
       let self = this;
       if(this.summary.length>1){
       }else{
         this.childId = 0;
       }
+      uni.showLoading({title:"加载中"});
       getDeviceStatus(this.id,this.childId).then(res=>{
         let data =res.data;
         this.deviceInfo = data;
         self.parseStatusData(data)
+
+        setTimeout(function () {
+          uni.hideLoading();
+          if(typeof func == "function"){
+            func();
+          }
+        },50);
       });
     },
     getNewDeviceStatus(item){
@@ -1944,23 +2069,32 @@ export default {
         let prop = self.inputProp[i];
         let value = prop.shadow||0;
         let id = prop.id;
-        if(id === "TimeSetting"){//温度设置
+          if(id === "TimeSetting"){//温度设置
             self.temperatureTime = value;
-        }
-        if(id === "TempSetting"){
-          self.temperature = value;
-        }
+          }
 
+        if(!self.jianyaoWenduSetting){
+          if(id === "TempSetting"){
+            self.temperature = value;
+          }
+        }
         this.setPropValue(id,"SlowfireTiem","leftJianyaoTime",value,0)
+
         this.setPropValue(id,"HighTempTime","hightTemperature",value,0)
         this.setPropValue(id,"CurrentTemp","currentTemperature",value,0)
         this.setPropValue(id,"CalibrationTemp","jiaozhunTemp",value,0)
         this.setPropValue(id,"PackingVolume","packageVolume",value,50)
         this.setPropValue(id,"PackageQuantity","packageNumber",value,1)
-        this.setPropValue(id,"SealTemp","sealingTemperature",value)
-        this.setPropValue(id,"BandingTemp","edegTemperature",value)
-        this.setPropValue(id,"SetSealTemp","setSealingTemperature",value,160)
-        this.setPropValue(id,"SetBandingTemp","setEdegTemperature",value,160)
+
+        //封边温度
+        this.setPropValue(id,"BandingTemp","edegTemperature",value);
+        this.setPropValue(id,"BandingTemp","tempFengBianWendu",value)
+
+        //封口温度
+        this.setPropValue(id,"SealTemp","sealingTemperature",value);
+        this.setPropValue(id,"SealTemp","tempFengKouWendu",value)
+
+
         this.setPropValue(id,"LeftAppointmentTime","leftAppointmentTime",value,0)
         self.propMap[id] = prop;
 
@@ -2189,27 +2323,48 @@ export default {
       if(msgId === "HighTempTime"){
         this.hightTemperature = obj.value;
       }
-      if(msgId === "SealTemp"){
+      if(msgId === "SealTemp"){//封口温度
         if(!this.editing){
-          this.sealingTemperature = obj.value;
+
+          if(this.baozhuangFengkouSetting){
+            this.tempFengkouWendu = obj.value;
+          }else{
+            this.sealingTemperature = obj.value;
+          }
         }
 
       }
-      if(msgId === "BandingTemp"){
+      if(msgId === "BandingTemp"){//封边温度
         if(!this.editing){
-          this.edegTemperature = obj.value;
+
+          if(this.baozhuangFengbianSetting){
+            this.tempFengBianWendu = obj.value;
+          }else{
+            this.edegTemperature = obj.value;
+          }
+
         }
 
       }
       if(msgId === "PackingVolume"){
         if(!this.editing){
-          this.packageVolume = obj.value;
+          if(this.baozhuangRongLiangSetting){
+
+          }else{
+            this.packageVolume = obj.value;
+          }
+
+
         }
 
       }
       if(msgId === "PackageQuantity"){
         if(!this.editing){
-          this.packageNumber = obj.value;
+          if(this.baozhuangShuLIangSetting){
+
+          }else{
+            this.packageNumber = obj.value;
+          }
         }
       }
 

+ 1 - 1
pages/device/detail1.vue

@@ -2,7 +2,7 @@
   <view class="content">
     <view class="header" style="margin:0;padding: 0px;">
 
-      <view class="bg" style="position: fixed;top:0px;bottom:0px;left:0px;right:0px;background-image: url('https://hyscancode.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/device/bg.png');background-size: 100% 100%;padding:0 40rpx">
+      <view class="bg" style="position: fixed;top:0px;bottom:0px;left:0px;right:0px;background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/device/bg.png');background-size: 100% 100%;padding:0 40rpx">
         <view style="position: absolute;right:10rpx;top:30rpx">
           <u-button @click="reportError" color="#EC6D2F" text="上报异常" type="error" size="mini"></u-button>
         </view>

+ 6 - 3
pages/device/reset/reset.vue

@@ -3,7 +3,7 @@
     <view style="margin-top: 10px">
       <u-cell @click="resetUser"  title="扫码注销" :isLink="true" arrow-direction="left"></u-cell>
       <u-cell  title="注销记录" :isLink="true" url="/pages/device/reset/resetrecord" arrow-direction="left"></u-cell>
-      <u-cell  title="已注销列表" :isLink="true" url="/pages/device/index?deptId=-1" arrow-direction="left"></u-cell>
+<!--      <u-cell  title="已注销列表" :isLink="true" url="/pages/device/index?deptId=-1" arrow-direction="left"></u-cell>-->
 
     </view>
     <u-modal :show="show" :title="dlgTitle" @cancel="cancel" :showCancelButton="true" @confirm="bingDevice" >
@@ -21,7 +21,7 @@
 </template>
 
 <script>
-import {getDevcieByQrcode,bingDeviceDept} from '@/api/device/device';
+import {getDevcieByQrcode,resetDevice} from '@/api/device/device';
 export default {
   data() {
     return {
@@ -37,7 +37,7 @@ export default {
   methods: {
     bingDevice(){
       this.show = false;
-      bingDeviceDept(this.scanDevice).then(res=>{
+      resetDevice(this.scanDevice).then(res=>{
         if(res.code == 200){
           this.$modal.showToast('操作成功')
         }else{
@@ -70,6 +70,9 @@ export default {
               }
             }
           });
+        },
+        fail(res){
+          console.log(res);
         }
       });
     },

+ 2 - 2
pages/login.vue

@@ -1,9 +1,9 @@
 <template>
-  <view class="normal-login-container" style="background-image: url('https://hyscancode.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/login/bg.png');background-size: 100% 100%;">
+  <view class="normal-login-container" style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/login/bg.png');background-size: 100% 100%;">
     <view class="logo-content align-center justify-center flex">
 <!--      <image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">-->
 <!--      </image>-->
-      <text class="title">天目云平台移动端登录</text>
+      <text class="title">老药师云平台移动端登录</text>
     </view>
     <view class="login-form-content">
       <view class="input-item flex align-center">

+ 15 - 15
pages/work/index.vue

@@ -6,14 +6,14 @@
       <swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper">
         <swiper-item v-for="(item, index) in data" :key="index">
           <view class="swiper-item" @click="clickBannerItem(item)">
-            <image :src="item.image" mode="aspectFill" :draggable="false" style="border-radius: 12rpx" />
+            <image :src="item.image" mode="aspectFill" :draggable="false" style="border-radius: 12rpx;margin:20rpx" />
           </view>
         </swiper-item>
       </swiper>
     </uni-swiper-dot>
   </view>
     <view style="box-sizing: border-box;margin-top:20rpx;padding:0 20rpx">
-      <view class="grid-item-box" @click="watchDevice"  style="background-image: url('https://hyscancode.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
+      <view class="grid-item-box" @click="watchDevice"  style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
         <view class="grid-image">
           <u-image :showLoading="true" src="/static/images/icons/scan.png" width="80rpx" height="80rpx" ></u-image>
         </view>
@@ -23,7 +23,7 @@
         </view>
       </view>
 
-      <view class="grid-item-box" v-if="hasRole(['admin'])" @click="goPage('user')" style="background-image: url('https://hyscancode.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
+      <view class="grid-item-box" v-if="hasRole(['admin'])" @click="goPage('user')" style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
         <view class="grid-image">
           <u-image :showLoading="true" src="/static/images/icons/user.png" width="80rpx" height="80rpx" ></u-image>
         </view>
@@ -33,7 +33,7 @@
         </view>
       </view>
 
-      <view class="grid-item-box" v-if="isCompanyUser()" @click="goPage('deptuser')" style="background-image: url('https://hyscancode.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
+      <view class="grid-item-box" v-if="isCompanyUser()" @click="goPage('deptuser')" style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
           <view class="grid-image">
             <u-image :showLoading="true" src="/static/images/icons/user.png" width="80rpx" height="80rpx" ></u-image>
           </view>
@@ -42,7 +42,7 @@
             <view class="bottom">User Management</view>
           </view>
       </view>
-      <view class="grid-item-box" v-if="isCompanyUser()" @click="goPage('device')"  style="background-image: url('https://hyscancode.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
+      <view class="grid-item-box" v-if="isCompanyUser()" @click="goPage('device')"  style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
         <view class="grid-image">
           <u-image :showLoading="true" src="/static/images/icons/device.png" width="80rpx" height="80rpx" ></u-image>
         </view>
@@ -52,7 +52,7 @@
         </view>
       </view>
 
-      <view class="grid-item-box" @click="goPage('wifi')"  style="background-image: url('https://hyscancode.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
+      <view class="grid-item-box" @click="goPage('wifi')"  style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
         <view class="grid-image">
           <u-image :showLoading="true" src="/static/images/icons/wifi.png" width="80rpx" height="80rpx" ></u-image>
         </view>
@@ -62,7 +62,7 @@
         </view>
       </view>
 
-      <view class="grid-item-box" v-if="isCompanyUser()" @click="scanCode()"  style="background-image: url('https://hyscancode.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
+      <view class="grid-item-box" v-if="isCompanyUser()" @click="scanCode()"  style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
         <view class="grid-image">
           <u-image :showLoading="true" src="/static/images/icons/bind.png" width="80rpx" height="80rpx" ></u-image>
         </view>
@@ -73,7 +73,7 @@
       </view>
 
 
-      <view class="grid-item-box" v-if="hasRole(['admin'])" @click="goPage('scan')"  style="background-image: url('https://hyscancode.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
+      <view class="grid-item-box" v-if="hasRole(['admin'])" @click="goPage('scan')"  style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
         <view class="grid-image">
           <u-image :showLoading="true" src="/static/images/icons/bind.png" width="80rpx" height="80rpx" ></u-image>
         </view>
@@ -87,7 +87,7 @@
 
 
 
-      <view class="grid-item-box" v-if="isCompanyUser()" @click="goPage('alert')"  style="background-image: url('https://hyscancode.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
+      <view class="grid-item-box" v-if="isCompanyUser()" @click="goPage('alert')"  style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
         <view class="grid-image">
           <u-image :showLoading="true" src="/static/images/icons/alert.png" width="80rpx" height="80rpx" ></u-image>
         </view>
@@ -98,7 +98,7 @@
       </view>
 
 
-<!--      <view class="grid-item-box" v-if="isCompanyUser()" @click="goPage('alert')"  style="background-image: url('https://hyscancode.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">-->
+<!--      <view class="grid-item-box" v-if="isCompanyUser()" @click="goPage('alert')"  style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">-->
 <!--        <view class="grid-image">-->
 <!--          <u-image :showLoading="true" src="/static/images/icons/error.png" width="80rpx" height="80rpx" ></u-image>-->
 <!--        </view>-->
@@ -108,7 +108,7 @@
 <!--        </view>-->
 <!--      </view>-->
 
-      <view class="grid-item-box" @click="goPage('reset')" v-if="hasRole(['admin'])"  style="background-image: url('https://hyscancode.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
+      <view class="grid-item-box" @click="goPage('reset')" v-if="hasRole(['admin']) || hasRole(['companymgr'])"  style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
         <view class="grid-image">
           <u-image :showLoading="true" src="/static/images/icons/reset.png" width="80rpx" height="80rpx" ></u-image>
         </view>
@@ -119,7 +119,7 @@
       </view>
 
 
-      <view class="grid-item-box" @click="goPage('time')"  style="background-image: url('https://hyscancode.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
+      <view class="grid-item-box" @click="goPage('time')"  style="background-image: url('https://jianyaoji.oss-cn-hangzhou.aliyuncs.com/jianyaoji/images/icons/bg.png');background-size: 100% 100%">
         <view class="grid-image">
           <u-image :showLoading="true" src="/static/images/icons/rank.png" width="80rpx" height="80rpx" ></u-image>
         </view>
@@ -147,7 +147,7 @@
 
 <script>
 import authObj from '@/plugins/auth.js';
-import {getDevcieByQrcode,bingDeviceDept} from '@/api/device/device';
+import {getDevcieByQrcode,bindDevice} from '@/api/device/device';
 import UImage from "../../uni_modules/uview-ui/components/u--image/u--image";
 export default {
   components: {UImage},
@@ -181,7 +181,7 @@ export default {
     methods: {
       bingDevice(){
           this.show = false;
-        bingDeviceDept(this.scanDevice).then(res=>{
+        bindDevice(this.scanDevice).then(res=>{
           if(res.code == 200){
             this.$modal.showToast('操作成功')
           }else{
@@ -245,7 +245,7 @@ export default {
               if(!device){
                 self.$modal.showToast('设备不存在或该已经绑定用户')
               }else{
-                if(device.deptId != null){
+                if(device.deptId != null && device.deptId>0){
                   self.$modal.showToast('该设备已经绑定了用户')
                 }else{
                   self.dlgTitle = "绑定设备";

BIN
static/images/banner/banner01.png