瀏覽代碼

feature:字段全配置模式

liuzhenlin 6 月之前
父節點
當前提交
d12de9a0d3

+ 10 - 0
api/inst/index.js

@@ -10,6 +10,7 @@ import micro_request from "../../utils/micro_request";
 // console.log(process.uniEnv.VITE_INSTR_ADMIN);
 const service_path = uni.getStorageSync("labsop_service_path") || "";
 const instPath = process.uniEnv.VITE_INSTR_ADMIN + service_path;
+const adminPath = process.uniEnv.VUE_APP_AdminPath + service_path;
 export default {
   // 获取照片
   getPhoto(query) {
@@ -83,4 +84,13 @@ export default {
       query
     );
   },
+  // 获取公告信息
+  getEntityByKey(query) {
+    return micro_request.postRequest(
+      adminPath,
+      "Config",
+      "GetEntityByKey",
+      query
+    );
+  },
 };

+ 743 - 763
pages/home/index.vue

@@ -1,11 +1,6 @@
 <template>
   <view @click="resetTimer">
-    <img
-      v-if="screenSaveFlag"
-      class="screen-save-box"
-      src="static/images/screen-saver.png"
-      alt=""
-    />
+    <img v-if="screenSaveFlag" class="screen-save-box" src="static/images/screen-saver.png" alt="" />
     <view v-else>
       <view class="container-lab">
         <!-- 头部 -->
@@ -21,10 +16,7 @@
         <view class="container">
           <!-- 设备头 -->
           <view class="deviceInfo">
-            <view
-              class="deviceInfoTitle"
-              style="justify-content: space-between"
-            >
+            <view class="deviceInfoTitle" style="justify-content: space-between">
               <view class="instr-info">
                 <img src="static/images/icon-instr.png" class="comImg" alt="" />
                 <view class="title">设备信息</view>
@@ -65,13 +57,11 @@
                 <view class="devicelab">使用次数</view>
                 <view class="title-info">{{ instrInfo.useCountWeek }}次</view>
               </li>
-              <li
-                style="
+              <li style="
                   display: flex;
                   justify-content: space-between;
                   justify-content: center;
-                "
-              >
+                ">
                 <view class="devicelab">使用时长</view>
                 <view class="frequency">
                   <!-- <view class="line">
@@ -89,13 +79,11 @@
                 <view class="devicelab">使用次数</view>
                 <view class="title-info">{{ instrInfo.useCountMonth }}次</view>
               </li>
-              <li
-                style="
+              <li style="
                   display: flex;
                   justify-content: space-between;
                   justify-content: center;
-                "
-              >
+                ">
                 <view class="devicelab">使用时长</view>
 
                 <view class="frequency">
@@ -125,20 +113,13 @@
               <!-- 实验人员 -->
               <view class="deviceInfo laboratoryBox" v-if="isOnlineInfo">
                 <view class="deviceInfoTitle">
-                  <img
-                    src="static/images/icon-user.png"
-                    class="comImg"
-                    alt=""
-                  />
+                  <img src="static/images/icon-user.png" class="comImg" alt="" />
                   <view class="title">实验员</view>
                 </view>
                 <!-- 详情 信息 -->
                 <view class="deviceInfoTop">
                   <view class="imgBox">
-                    <img
-                      :src="completionImgPath(isOnlineInfo.avatar)"
-                      alt="加载失败"
-                    />
+                    <img :src="completionImgPath(isOnlineInfo.avatar)" alt="加载失败" />
                   </view>
                   <ul class="laboratoryDetail">
                     <li>
@@ -179,11 +160,7 @@
               <!-- 实验人员 -->
               <view class="deviceInfo laboratoryBox" v-else>
                 <view class="deviceInfoTitle">
-                  <img
-                    src="static/images/icon-user.png"
-                    class="comImg"
-                    alt=""
-                  />
+                  <img src="static/images/icon-user.png" class="comImg" alt="" />
                   <view class="title">实验员尚未登录</view>
                 </view>
                 <!-- 未登录 -->
@@ -197,37 +174,21 @@
               <!-- 下一个预约 -->
               <view class="deviceInfo nextOrder">
                 <view class="deviceInfoTitle">
-                  <img
-                    src="static/images/icon-appoint.png"
-                    class="comImg"
-                    alt=""
-                  />
+                  <img src="static/images/icon-appoint.png" class="comImg" alt="" />
                   <view class="title">下一个预约信息</view>
                 </view>
 
-                <view
-                  id="notNext"
-                  class="nextTop"
-                  v-if="appointList.length == 0"
-                >
+                <view id="notNext" class="nextTop" v-if="appointList.length == 0">
                   <view class="nextNoLoginImgBox">
                     <img src="static/images/data0.png" alt="" />
                   </view>
                   <view>暂无预约</view>
                 </view>
                 <view v-else class="next-order-wrap">
-                  <view
-                    v-for="(v, i) in appointList"
-                    :key="i"
-                    style="margin-bottom: 10px"
-                  >
+                  <view v-for="(v, i) in appointList" :key="i" style="margin-bottom: 10px">
                     <view id="hasNext" class="deviceInfoTop">
                       <view class="imgBox">
-                        <img
-                          id="nextImageUrl"
-                          :src="completionImgPath(v.avatar)"
-                          alt="加载失败"
-                        />
+                        <img id="nextImageUrl" :src="completionImgPath(v.avatar)" alt="加载失败" />
                       </view>
                       <ul class="laboratoryDetail pd10">
                         <li>
@@ -272,11 +233,7 @@
             <view class="deviceData">
               <view class="deviceInfoHeader">
                 <view class="deviceInfoTitle">
-                  <img
-                    src="static/images/icon-notice.png"
-                    class="comImg"
-                    alt=""
-                  />
+                  <img src="static/images/icon-notice.png" class="comImg" alt="" />
                   <view class="title">公告</view>
                 </view>
                 <!--<view class="deviceInfoBtn">-->
@@ -302,14 +259,8 @@
           </view>
         </view>
       </view>
-      <u-popup
-        v-if="noticeShow"
-        :show="noticeShow"
-        @close="noticeShow = false"
-        mode="center"
-        :round="10"
-        :closeable="true"
-      >
+      <u-popup v-if="noticeShow" :show="noticeShow" @close="noticeShow = false" mode="center" :round="10"
+        :closeable="true">
         <view class="notice-wrap">
           <view class="notice-header">{{ noticeInfo.noticeTitle }}</view>
           <view class="notice-content">
@@ -322,772 +273,801 @@
 </template>
 
 <script>
-  import instApi from "../../api/inst";
-  import to from "await-to-js";
-  export default {
-    data() {
-      return {
-        noticeShow: false, //公共详情
-        noticeInfo: "", //公告详情
-        clickTimer: null, //点击次数
-        clickCount: 0, //点击次数
-        timer: null, //当前时间
-        infoTimer: null, //仪器详情
-        curTime: "", //当前时间
-        curTimetimer: null, //上机时间
-        screenSaveTimer: null, //屏保时间
-        idleTime: 5 * 60 * 1000, // 设置超时时间:5分钟
-        screenSaveFlag: false,
-        instrInfo: {
-          id: 0,
-          instName: "",
-          instCode: "",
-          useCountWeek: 0,
-          useTimeWeek: 0,
-          useCountMonth: 0,
-          useTimeMonth: 0,
-        },
-        appointList: [], //预约列表
-        noticeList: [], //公告
-        terminal: "",
-        isOnlineInfo: null, //在线信息
-        userId: 0,
-        currentTime: new Date(), // 当前时间
-        headerImg: "static/images/header.png", // 头部背景图片
-      };
-    },
-    computed: {
-      formattedTime() {
-        if (!this.isOnlineInfo) {
-          return "-";
-        }
-        const diff =
-          this.currentTime - new Date(this.isOnlineInfo.usedRecord.startTime);
-        const hours = String(Math.floor(diff / (1000 * 60 * 60))).padStart(
-          2,
-          "0"
-        );
-        const minutes = String(
-          Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60))
-        ).padStart(2, "0");
-        const seconds = String(
-          Math.floor((diff % (1000 * 60)) / 1000)
-        ).padStart(2, "0");
-        return `${hours}:${minutes}:${seconds}`;
+import instApi from "../../api/inst";
+import to from "await-to-js";
+export default {
+  data() {
+    return {
+      noticeShow: false, //公共详情
+      noticeInfo: "", //公告详情
+      clickTimer: null, //点击次数
+      clickCount: 0, //点击次数
+      timer: null, //当前时间
+      infoTimer: null, //仪器详情
+      curTime: "", //当前时间
+      curTimetimer: null, //上机时间
+      screenSaveTimer: null, //屏保时间
+      idleTime: 5 * 60 * 1000, // 设置超时时间:5分钟
+      screenSaveFlag: false,
+      instrInfo: {
+        id: 0,
+        instName: "",
+        instCode: "",
+        useCountWeek: 0,
+        useTimeWeek: 0,
+        useCountMonth: 0,
+        useTimeMonth: 0,
       },
+      appointList: [], //预约列表
+      noticeList: [], //公告
+      terminal: "",
+      isOnlineInfo: null, //在线信息
+      userId: 0,
+      currentTime: new Date(), // 当前时间
+      headerImg: "static/images/header.png", // 头部背景图片
+    };
+  },
+  computed: {
+    formattedTime() {
+      if (!this.isOnlineInfo) {
+        return "-";
+      }
+      const diff =
+        this.currentTime - new Date(this.isOnlineInfo.usedRecord.startTime);
+      const hours = String(Math.floor(diff / (1000 * 60 * 60))).padStart(
+        2,
+        "0"
+      );
+      const minutes = String(
+        Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60))
+      ).padStart(2, "0");
+      const seconds = String(
+        Math.floor((diff % (1000 * 60)) / 1000)
+      ).padStart(2, "0");
+      return `${hours}:${minutes}:${seconds}`;
     },
-    onLoad(option) {
-      this.userId = option.id;
-    },
-    async onShow() {
-      this.startIdleTimer();
-      if (!uni.getStorageSync("labsop_no")) {
-        uni.redirectTo({
-          url: "/pages/setting/index",
-        });
-      } else {
-        // 获取仪器信息
+  },
+  onLoad(option) {
+    this.userId = option.id;
+  },
+  async onShow() {
+    this.startIdleTimer();
+    if (!uni.getStorageSync("labsop_no")) {
+      uni.redirectTo({
+        url: "/pages/setting/index",
+      });
+    } else {
+      // 获取仪器信息
+      this.getInstrInfo();
+      this.getAppointList();
+      this.getNotice();
+      await this.getGetOnInfo();
+      // 获取日期
+      this.timer = setInterval(() => {
+        this.getNowTime();
+      }, 1000);
+      // 仪器信息
+      this.infoTimer = setInterval(() => {
         this.getInstrInfo();
         this.getAppointList();
         this.getNotice();
-        await this.getGetOnInfo();
-        // 获取日期
-        this.timer = setInterval(() => {
-          this.getNowTime();
-        }, 1000);
-        // 仪器信息
-        this.infoTimer = setInterval(() => {
-          this.getInstrInfo();
-          this.getAppointList();
-          this.getNotice();
-        }, 60000);
-        // 上机信息
-        if (this.userId && !this.isOnlineInfo) {
-          this.getOn();
-        }
-        this.handleSwitchInstr();
+      }, 60000);
+      // 上机信息
+      if (this.userId && !this.isOnlineInfo) {
+        this.getOn();
       }
+      this.handleSwitchInstr();
+    }
+    this.headerImg = uni.getStorageSync("labsop_headerImg") ? uni.getStorageSync("labsop_filePath") + uni.getStorageSync("labsop_headerImg") : "static/images/header.png";
+    console.log("headerImg----------", this.headerImg);
+
+  },
+  onHide() {
+    //离开页面前清除计时器
+    clearInterval(this.timer);
+    clearInterval(this.clickTimer);
+    clearInterval(this.infoTimer);
+    clearInterval(this.curTimetimer);
+    this.resetTimer();
+    this.timer = null;
+    this.clickTimer = null;
+    this.infoTimer = null;
+    this.curTimetimer = null;
+  },
+  mounted() { },
+  beforeDestroy() {
+    //离开页面前清除计时器
+    clearInterval(this.timer);
+    clearInterval(this.clickTimer);
+    clearInterval(this.infoTimer);
+    clearInterval(this.curTimetimer);
+    this.resetTimer();
+    this.timer = null;
+    this.clickTimer = null;
+    this.infoTimer = null;
+    this.curTimetimer = null;
+  },
+  methods: {
+    //屏保计时
+    startIdleTimer() {
+      this.screenSaveTimer = setTimeout(() => {
+        this.toScreenSaver();
+      }, this.idleTime);
     },
-    onHide() {
-      //离开页面前清除计时器
-      clearInterval(this.timer);
-      clearInterval(this.clickTimer);
-      clearInterval(this.infoTimer);
-      clearInterval(this.curTimetimer);
-      this.resetTimer();
-      this.timer = null;
-      this.clickTimer = null;
-      this.infoTimer = null;
-      this.curTimetimer = null;
+    // 点击操作重置屏保计时
+    resetTimer() {
+      clearTimeout(this.screenSaveTimer);
+      this.screenSaveFlag = false;
+      this.startIdleTimer(); // 重置计时器
     },
-    mounted() {},
-    beforeDestroy() {
-      //离开页面前清除计时器
-      clearInterval(this.timer);
-      clearInterval(this.clickTimer);
-      clearInterval(this.infoTimer);
-      clearInterval(this.curTimetimer);
-      this.resetTimer();
-      this.timer = null;
-      this.clickTimer = null;
-      this.infoTimer = null;
-      this.curTimetimer = null;
+    // 进入屏保
+    toScreenSaver() {
+      this.screenSaveFlag = true;
     },
-    methods: {
-      //屏保计时
-      startIdleTimer() {
-        this.screenSaveTimer = setTimeout(() => {
-          this.toScreenSaver();
-        }, this.idleTime);
-      },
-      // 点击操作重置屏保计时
-      resetTimer() {
-        clearTimeout(this.screenSaveTimer);
-        this.screenSaveFlag = false;
-        this.startIdleTimer(); // 重置计时器
-      },
-      // 进入屏保
-      toScreenSaver() {
-        this.screenSaveFlag = true;
-      },
-      // 打开公告详情
-      async openContent(row) {
-        this.noticeShow = true;
-        this.noticeInfo = row;
-      },
-      // 获取仪器信息
-      async getInstrInfo() {
-        this.terminal = uni.getStorageSync("labsop_no");
-        let [err, res] = await to(
-          instApi.getInstrInfo({ terminal: this.terminal })
-        );
-        if (err) return;
-        this.instrInfo = res.data;
-      },
-      // 获取预约信息
-      async getAppointList() {
-        this.terminal = uni.getStorageSync("labsop_no");
-        let [err, res] = await to(
-          instApi.getAppointInfo({ terminal: this.terminal })
-        );
-        if (err) return;
-        this.appointList = res.data;
-      },
-      // 获取公告信息
-      async getNotice() {
-        this.terminal = uni.getStorageSync("labsop_no");
-        let [err, res] = await to(
-          instApi.getNoticeInfo({ terminal: this.terminal })
-        );
-        if (err) return;
-        this.noticeList = res.data;
-      },
-      // 上机
-      async getOn() {
-        const handleAppoint = uni.getStorageSync("handleAppoint");
-        console.log("handleAppoint----------", handleAppoint);
-        if (handleAppoint !== "appointLine") return;
-        let [err, res] = await to(
-          instApi.getOn({ terminal: this.terminal, UserId: this.userId })
-        );
-        uni.removeStorageSync("handleAppoint");
-        if (err) return;
-        this.getGetOnInfo();
-        this.getAppointList();
-        uni.showToast({
-          title: "上机成功",
-          icon: "success",
-          duration: 1000,
-        });
-      },
-      // 打开设备
-      async handleSwitchInstr() {
-        const handleType = uni.getStorageSync("handleType");
-        console.log("handleType----------", handleType);
-        if (handleType !== "openInstr") return;
-        let [err, res] = await to(
-          instApi.switch({
-            switch: true,
-            terminal: this.terminal,
-            userId: Number(this.userId),
-          })
-        );
-        uni.removeStorageSync("handleType");
-        if (err) return;
-        uni.showToast({
-          title: "设备打开成功",
-          icon: "success",
-          duration: 1000,
-        });
-      },
-      // 关闭设备
-      async closeInstr() {
-        uni.showModal({
-          title: "提示",
-          content: "确认关闭当前仪器?",
-          success: async (modalRes) => {
-            if (modalRes.confirm) {
-              let [err, res] = await to(
-                instApi.switch({
-                  switch: false,
-                  terminal: this.terminal,
-                })
-              );
-              if (err) return;
-              uni.showToast({
-                title: "设备关闭成功",
-                icon: "success",
-                duration: 1000,
+    // 打开公告详情
+    async openContent(row) {
+      this.noticeShow = true;
+      this.noticeInfo = row;
+    },
+    // 获取仪器信息
+    async getInstrInfo() {
+      this.terminal = uni.getStorageSync("labsop_no");
+      let [err, res] = await to(
+        instApi.getInstrInfo({ terminal: this.terminal })
+      );
+      if (err) return;
+      this.instrInfo = res.data;
+    },
+    // 获取预约信息
+    async getAppointList() {
+      this.terminal = uni.getStorageSync("labsop_no");
+      let [err, res] = await to(
+        instApi.getAppointInfo({ terminal: this.terminal })
+      );
+      if (err) return;
+      this.appointList = res.data;
+    },
+    // 获取公告信息
+    async getNotice() {
+      this.terminal = uni.getStorageSync("labsop_no");
+      let [err, res] = await to(
+        instApi.getNoticeInfo({ terminal: this.terminal })
+      );
+      if (err) return;
+      this.noticeList = res.data;
+    },
+    // 上机
+    async getOn() {
+      const handleAppoint = uni.getStorageSync("handleAppoint");
+      console.log("handleAppoint----------", handleAppoint);
+      if (handleAppoint !== "appointLine") return;
+      let [err, res] = await to(
+        instApi.getOn({ terminal: this.terminal, UserId: this.userId })
+      );
+      uni.removeStorageSync("handleAppoint");
+      if (err) return;
+      this.getGetOnInfo();
+      this.getAppointList();
+      uni.showToast({
+        title: "上机成功",
+        icon: "success",
+        duration: 1000,
+      });
+    },
+    // 打开设备
+    async handleSwitchInstr() {
+      const handleType = uni.getStorageSync("handleType");
+      console.log("handleType----------", handleType);
+      if (handleType !== "openInstr") return;
+      let [err, res] = await to(
+        instApi.switch({
+          switch: true,
+          terminal: this.terminal,
+          userId: Number(this.userId),
+        })
+      );
+      uni.removeStorageSync("handleType");
+      if (err) return;
+      uni.showToast({
+        title: "设备打开成功",
+        icon: "success",
+        duration: 1000,
+      });
+    },
+    // 关闭设备
+    async closeInstr() {
+      uni.showModal({
+        title: "提示",
+        content: "确认关闭当前仪器?",
+        success: async (modalRes) => {
+          if (modalRes.confirm) {
+            let [err, res] = await to(
+              instApi.switch({
+                switch: false,
+                terminal: this.terminal,
+              })
+            );
+            if (err) return;
+            uni.showToast({
+              title: "设备关闭成功",
+              icon: "success",
+              duration: 1000,
+            });
+          }
+        },
+      });
+    },
+    // 获取正在上机信息
+    async getGetOnInfo() {
+      let [err, res] = await to(
+        instApi.getOnInfo({ terminal: this.terminal })
+      );
+      if (err) return;
+      this.isOnlineInfo = res.data;
+      this.curTimetimer = setInterval(this.updateTime, 1000);
+    },
+    // 下机
+    handleGetOff() {
+      uni.showModal({
+        title: "提示",
+        content: "退出设备将会断电、终止实验,您确定要注销登录吗?",
+        success: async (res) => {
+          if (res.confirm) {
+            let [err, res] = await to(
+              instApi.geOff({
+                terminal: this.terminal,
+                UserId: this.userId || "" + this.isOnlineInfo.userId,
+              })
+            );
+            if (err) return;
+            if (res.code == 200) {
+              uni.redirectTo({
+                url: "/pages/home/index",
               });
             }
-          },
-        });
-      },
-      // 获取正在上机信息
-      async getGetOnInfo() {
-        let [err, res] = await to(
-          instApi.getOnInfo({ terminal: this.terminal })
-        );
-        if (err) return;
-        this.isOnlineInfo = res.data;
-        this.curTimetimer = setInterval(this.updateTime, 1000);
-      },
-      // 下机
-      handleGetOff() {
-        uni.showModal({
-          title: "提示",
-          content: "退出设备将会断电、终止实验,您确定要注销登录吗?",
-          success: async (res) => {
-            if (res.confirm) {
-              let [err, res] = await to(
-                instApi.geOff({
-                  terminal: this.terminal,
-                  UserId: this.userId || "" + this.isOnlineInfo.userId,
-                })
-              );
-              if (err) return;
-              if (res.code == 200) {
-                uni.redirectTo({
-                  url: "/pages/home/index",
-                });
-              }
-            }
-          },
-        });
-      },
-      // 跳转人脸识别
-      openFaceCheck() {
-        uni.redirectTo({
-          url: "/pages/face/index",
-        });
-      },
-      openInstr() {
+          }
+        },
+      });
+    },
+    // 跳转人脸识别
+    openFaceCheck() {
+      uni.redirectTo({
+        url: "/pages/face/index",
+      });
+    },
+    openInstr() {
+      uni.redirectTo({
+        url: "/pages/face/openInstrFace",
+      });
+    },
+    completionImgPath(path) {
+      const filePath =
+        uni.getStorageSync("labsop_filePath") || process.uniEnv.VITE_FILE;
+      let url = path;
+      if (url.indexOf("http") == -1) {
+        url = filePath + url;
+      }
+      return url;
+    },
+    // 跳转设置页
+    toSettingPage() {
+      this.clickCount++;
+      if (this.clickCount === 6) {
         uni.redirectTo({
-          url: "/pages/face/openInstrFace",
+          url: "/pages/setting/index",
         });
-      },
-      completionImgPath(path) {
-        const filePath =
-          uni.getStorageSync("labsop_filePath") || process.uniEnv.VITE_FILE;
-        let url = path;
-        if (url.indexOf("http") == -1) {
-          url = filePath + url;
-        }
-        return url;
-      },
-      // 跳转设置页
-      toSettingPage() {
-        this.clickCount++;
-        if (this.clickCount === 6) {
-          uni.redirectTo({
-            url: "/pages/setting/index",
-          });
+        this.clickCount = 0;
+        clearTimeout(this.clickTimer);
+      } else {
+        clearTimeout(this.clickTimer);
+        this.clickTimer = setTimeout(() => {
           this.clickCount = 0;
-          clearTimeout(this.clickTimer);
-        } else {
-          clearTimeout(this.clickTimer);
-          this.clickTimer = setTimeout(() => {
-            this.clickCount = 0;
-          }, 2000);
-        }
-      },
-      updateTime() {
-        this.currentTime = new Date();
-      },
-      getNowTime() {
-        var date = new Date();
-        //年 getFullYear():四位数字返回年份
-        var year = date.getFullYear(); //getFullYear()代替getYear()
-        //月 getMonth():0 ~ 11
-        var month = date.getMonth() + 1;
-        //日 getDate():(1 ~ 31)
-        var day = date.getDate();
-        //时 getHours():(0 ~ 23)
-        var hour = date.getHours();
-        //分 getMinutes(): (0 ~ 59)
-        var minute = date.getMinutes();
-        //秒 getSeconds():(0 ~ 59)
-        var second = date.getSeconds();
-        var myArray = new Array(7);
-        myArray[0] = "星期日";
-        myArray[1] = "星期一";
-        myArray[2] = "星期二";
-        myArray[3] = "星期三";
-        myArray[4] = "星期四";
-        myArray[5] = "星期五";
-        myArray[6] = "星期六";
-        var weekday = date.getDay();
-        var time =
-          year +
-          "-" +
-          this.addZero(month) +
-          "-" +
-          this.addZero(day) +
-          " " +
-          myArray[weekday] +
-          " " +
-          this.addZero(hour) +
-          ":" +
-          this.addZero(minute) +
-          ":" +
-          this.addZero(second);
-        this.curTime = time;
-      },
-      //小于10的拼接上0字符串
-      addZero(s) {
-        return s < 10 ? "0" + s : s;
-      },
+        }, 2000);
+      }
+    },
+    updateTime() {
+      this.currentTime = new Date();
+    },
+    getNowTime() {
+      var date = new Date();
+      //年 getFullYear():四位数字返回年份
+      var year = date.getFullYear(); //getFullYear()代替getYear()
+      //月 getMonth():0 ~ 11
+      var month = date.getMonth() + 1;
+      //日 getDate():(1 ~ 31)
+      var day = date.getDate();
+      //时 getHours():(0 ~ 23)
+      var hour = date.getHours();
+      //分 getMinutes(): (0 ~ 59)
+      var minute = date.getMinutes();
+      //秒 getSeconds():(0 ~ 59)
+      var second = date.getSeconds();
+      var myArray = new Array(7);
+      myArray[0] = "星期日";
+      myArray[1] = "星期一";
+      myArray[2] = "星期二";
+      myArray[3] = "星期三";
+      myArray[4] = "星期四";
+      myArray[5] = "星期五";
+      myArray[6] = "星期六";
+      var weekday = date.getDay();
+      var time =
+        year +
+        "-" +
+        this.addZero(month) +
+        "-" +
+        this.addZero(day) +
+        " " +
+        myArray[weekday] +
+        " " +
+        this.addZero(hour) +
+        ":" +
+        this.addZero(minute) +
+        ":" +
+        this.addZero(second);
+      this.curTime = time;
+    },
+    //小于10的拼接上0字符串
+    addZero(s) {
+      return s < 10 ? "0" + s : s;
     },
-  };
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-  .container-lab {
-    width: 100vw;
-    height: 100vh;
-    display: flex;
-    flex-direction: column;
-  }
-  /* 头部 */
-  .header {
+.container-lab {
+  width: 100vw;
+  height: 100vh;
+  display: flex;
+  flex-direction: column;
+}
+
+/* 头部 */
+.header {
+  width: 100%;
+  height: 12.6vh;
+  padding: 0 3.9vw 0 3.125vw;
+  box-sizing: border-box;
+  display: flex;
+  justify-content: space-between;
+  align-items: flex-end;
+
+  .header-img {
+    position: absolute;
+    left: 0;
+    top: 0;
     width: 100%;
     height: 12.6vh;
-    padding: 0 3.9vw 0 3.125vw;
-    box-sizing: border-box;
-    display: flex;
-    justify-content: space-between;
-    align-items: flex-end;
-    .header-img {
-      position: absolute;
-      left: 0;
-      top: 0;
-      width: 100%;
-      height: 12.6vh;
-      z-index: -1;
-    }
+    z-index: -1;
   }
+}
 
-  .hleft {
-    width: 28.4vw;
-    height: 100%;
-    font-size: 1.72vw;
-    /*background-color: #009688;*/
-    /*border-radius: 0 1.56vw 1.56vw 0;*/
-    padding-left: 2vw;
-    box-sizing: border-box;
-    display: flex;
-    align-items: center;
-  }
+.hleft {
+  width: 28.4vw;
+  height: 100%;
+  font-size: 1.72vw;
+  /*background-color: #009688;*/
+  /*border-radius: 0 1.56vw 1.56vw 0;*/
+  padding-left: 2vw;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+}
 
-  .hcenter {
-    flex: 1;
-    // width: 43.36vw;
-    height: 100%;
-    line-height: 12.6vh;
-    text-align: center;
-    font-size: 3.44vw;
-    color: #ffffff;
-  }
+.hcenter {
+  flex: 1;
+  // width: 43.36vw;
+  height: 100%;
+  line-height: 12.6vh;
+  text-align: center;
+  font-size: 3.44vw;
+  color: #ffffff;
+}
+
+.hright {
+  width: 16.4vw;
+  height: 5vh;
+  display: flex;
+  justify-content: flex-end;
+  align-items: center;
+}
+
+.hright img {
+  width: 3.125vw;
+  height: auto;
+  cursor: pointer;
+}
+
+/* 中间内容 */
+.container {
+  width: 95%;
+  flex: 1;
+  margin: 5vh auto;
+  display: flex;
+}
+
+/* 设备信息  */
+.deviceInfo {
+  width: 31.25vw;
+  height: 100%;
+  // height: 77vh;
+  margin-right: 2vw;
+  background-color: #fff;
+  box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.12);
+  opacity: 1;
+  border-radius: 0.4vw;
+}
+
+.deviceInfoTitle {
+  width: 100%;
+  height: 5.5vh;
+  display: flex;
+  align-items: center;
+  padding-left: 0.78vw;
+  border-bottom: 1px solid #f0f2f5;
+  box-sizing: border-box;
+  margin-bottom: 1vh;
 
-  .hright {
-    width: 16.4vw;
-    height: 5vh;
+  .instr-info {
     display: flex;
-    justify-content: flex-end;
     align-items: center;
   }
 
-  .hright img {
-    width: 3.125vw;
-    height: auto;
-    cursor: pointer;
-  }
-  /* 中间内容 */
-  .container {
-    width: 95%;
-    flex: 1;
-    margin: 5vh auto;
+  .handle-instr-wrap {
     display: flex;
   }
 
-  /* 设备信息  */
-  .deviceInfo {
-    width: 31.25vw;
-    height: 100%;
-    // height: 77vh;
-    margin-right: 2vw;
-    background-color: #fff;
-    box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.12);
-    opacity: 1;
-    border-radius: 0.4vw;
+  .handle-instr {
+    padding: 5px 16px;
+    border: 1px solid;
+    border-radius: 10px;
+    margin-right: 10px;
+    color: #fff;
   }
 
-  .deviceInfoTitle {
-    width: 100%;
-    height: 5.5vh;
-    display: flex;
-    align-items: center;
-    padding-left: 0.78vw;
-    border-bottom: 1px solid #f0f2f5;
-    box-sizing: border-box;
-    margin-bottom: 1vh;
-    .instr-info {
-      display: flex;
-      align-items: center;
-    }
-    .handle-instr-wrap {
-      display: flex;
-    }
-    .handle-instr {
-      padding: 5px 16px;
-      border: 1px solid;
-      border-radius: 10px;
-      margin-right: 10px;
-      color: #fff;
-    }
-    .open-btn {
-      background: #409eff;
-    }
-    .close-btn {
-      background: #f56c6c;
-    }
-  }
-  .info-title {
-    flex: 1;
-    padding-right: 10px;
-  }
-  .comImg {
-    width: 2.34vw;
-    height: auto;
-    margin-right: 0.7vw;
+  .open-btn {
+    background: #409eff;
   }
 
-  .title {
-    display: inline-block;
-    color: #303133;
-    font-size: 1.4vw;
+  .close-btn {
+    background: #f56c6c;
   }
+}
 
-  /* 设备信息 */
-  .deviecDetail {
-    padding-left: 0;
-  }
-  .deviecDetail li {
-    list-style: none;
-    width: 100%;
-    // height: 6.25vh;
-    line-height: 6.25vh;
-    padding-left: 30px;
-    box-sizing: border-box;
-    display: flex;
-  }
+.info-title {
+  flex: 1;
+  padding-right: 10px;
+}
 
-  .devicelab {
-    display: inline-block;
-    width: 6.2vw;
-    color: #606266;
-    font-size: 1.2vw;
-    text-align: left;
-    margin-right: 0.5vw;
-  }
+.comImg {
+  width: 2.34vw;
+  height: auto;
+  margin-right: 0.7vw;
+}
 
-  .tongji {
-    width: 8.3vw !important;
-    font-weight: 700;
-  }
+.title {
+  display: inline-block;
+  color: #303133;
+  font-size: 1.4vw;
+}
 
-  .frequency {
-    display: flex;
-    align-items: center;
-    width: 24.8vw;
-    height: 100%;
-  }
+/* 设备信息 */
+.deviecDetail {
+  padding-left: 0;
+}
 
-  .num {
-    display: inline-block;
-    width: 20%;
-    color: #303133;
-    margin-left: 10px;
-    font-size: 1.4vw;
-  }
+.deviecDetail li {
+  list-style: none;
+  width: 100%;
+  // height: 6.25vh;
+  line-height: 6.25vh;
+  padding-left: 30px;
+  box-sizing: border-box;
+  display: flex;
+}
 
-  .line {
-    width: 80%;
-    height: 1.5vh;
-    background-color: #ededed;
-    border-radius: 0.46vw;
-  }
-  .realline {
-    width: 0%;
-    height: 1.5vh;
-    background-color: #1d66dc;
-    border-radius: 0.46vw;
-  }
+.devicelab {
+  display: inline-block;
+  width: 6.2vw;
+  color: #606266;
+  font-size: 1.2vw;
+  text-align: left;
+  margin-right: 0.5vw;
+}
 
-  .footer {
-    margin-top: 6vh;
-    width: 100%;
-    height: 0.8vh;
-    display: flex;
-    justify-content: center;
-    align-items: center;
-  }
+.tongji {
+  width: 8.3vw !important;
+  font-weight: 700;
+}
 
-  .tItem {
-    width: 14vw;
-    margin-right: 2vw;
-    margin-bottom: 1.75vh;
-    text-align: center;
-  }
+.frequency {
+  display: flex;
+  align-items: center;
+  width: 24.8vw;
+  height: 100%;
+}
 
-  .tItem:nth-child(2n) {
-    margin-right: 0;
-  }
+.num {
+  display: inline-block;
+  width: 20%;
+  color: #303133;
+  margin-left: 10px;
+  font-size: 1.4vw;
+}
 
-  .tItemTitle {
-    color: #606266;
-    margin-top: 0.45vh;
-    font-size: 1.2vw;
-    font-weight: 700;
-  }
+.line {
+  width: 80%;
+  height: 1.5vh;
+  background-color: #ededed;
+  border-radius: 0.46vw;
+}
 
-  .tItemNum {
-    font-size: 1.3vw;
-    color: #3399ff;
-    font-weight: 700;
-  }
+.realline {
+  width: 0%;
+  height: 1.5vh;
+  background-color: #1d66dc;
+  border-radius: 0.46vw;
+}
 
-  /* 右侧 */
-  .deviceRight {
-    width: 60vw;
-    flex: 1;
-  }
+.footer {
+  margin-top: 6vh;
+  width: 100%;
+  height: 0.8vh;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
 
-  .deviceTop {
-    width: 100%;
-    display: flex;
-    margin-bottom: 3vh;
-  }
+.tItem {
+  width: 14vw;
+  margin-right: 2vw;
+  margin-bottom: 1.75vh;
+  text-align: center;
+}
 
-  /* 实验员信息 */
-  .deviceInfoTop {
-    width: 100%;
-    height: 12.5vh;
-    padding-left: 2.8vw;
-    box-sizing: border-box;
-    display: flex;
-    margin-bottom: 1.875vh;
-  }
+.tItem:nth-child(2n) {
+  margin-right: 0;
+}
 
-  .imgBox {
-    width: 7.8vw;
-    height: 13vh;
-    border-radius: 50%;
-    margin-right: 1.4vw;
-  }
+.tItemTitle {
+  color: #606266;
+  margin-top: 0.45vh;
+  font-size: 1.2vw;
+  font-weight: 700;
+}
 
-  .imgBox img {
-    width: 7.8vw;
-    height: 100%;
-    border-radius: 50%;
-  }
+.tItemNum {
+  font-size: 1.3vw;
+  color: #3399ff;
+  font-weight: 700;
+}
 
-  /* 实验人员 */
-  .laboratoryBox {
-    width: 31.25vw;
-    height: 37.5vh;
-    display: flex;
-    flex-direction: column;
-    .nologin {
-      flex: 1;
-    }
-  }
-  .nologinImgBox {
-    display: flex;
-    align-items: center;
-    justify-content: center;
-    height: 100%;
-  }
-  .laboratory {
-    width: 100%;
-    display: flex;
-    justify-content: center;
-    flex-wrap: wrap;
-  }
+/* 右侧 */
+.deviceRight {
+  width: 60vw;
+  flex: 1;
+}
 
-  .nextLaboratory {
-    width: 100%;
-    display: flex;
-    justify-content: center;
-  }
+.deviceTop {
+  width: 100%;
+  display: flex;
+  margin-bottom: 3vh;
+}
 
-  .laboratoryDetail li {
-    list-style: none;
-    width: 100%;
-    height: 4.375vh;
-    line-height: 4.375vh;
-    display: flex;
-  }
-  .pd10 {
-    padding-left: 10px;
-  }
-  /*  */
-  .laboratoryLab {
-    display: inline-block;
-    width: 3.9vw;
-    color: #606266;
-    font-size: 1.2vw;
-    text-align: right;
-    margin-right: 0.7vw;
-  }
+/* 实验员信息 */
+.deviceInfoTop {
+  width: 100%;
+  height: 12.5vh;
+  padding-left: 2.8vw;
+  box-sizing: border-box;
+  display: flex;
+  margin-bottom: 1.875vh;
+}
 
-  /* 下一次预约 */
-  .nextOrder {
-    width: 28.5vw;
-    height: 37.5vh;
-    margin-right: 0;
-    display: flex;
-    flex-direction: column;
-  }
-  .next-order-wrap {
+.imgBox {
+  width: 7.8vw;
+  height: 13vh;
+  border-radius: 50%;
+  margin-right: 1.4vw;
+}
+
+.imgBox img {
+  width: 7.8vw;
+  height: 100%;
+  border-radius: 50%;
+}
+
+/* 实验人员 */
+.laboratoryBox {
+  width: 31.25vw;
+  height: 37.5vh;
+  display: flex;
+  flex-direction: column;
+
+  .nologin {
     flex: 1;
-    overflow: auto;
-    padding: 0 0 20px 0;
   }
+}
 
-  /* 照片 */
-  .nextTop {
-    width: 100%;
-    display: flex;
-    flex-direction: column;
-    justify-content: space-around;
-    align-items: center;
-  }
+.nologinImgBox {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  height: 100%;
+}
 
-  .nextImgBox {
-    width: 7.8vw;
-    height: 13vh;
-    border-radius: 50%;
-    margin-right: 1.4vw;
-  }
+.laboratory {
+  width: 100%;
+  display: flex;
+  justify-content: center;
+  flex-wrap: wrap;
+}
 
-  .nextNoLoginImgBox {
-    margin-top: 20px;
-  }
+.nextLaboratory {
+  width: 100%;
+  display: flex;
+  justify-content: center;
+}
 
-  .nextImgBox img {
-    width: 7.8vw;
-    height: 100%;
-    border-radius: 50%;
-  }
+.laboratoryDetail li {
+  list-style: none;
+  width: 100%;
+  height: 4.375vh;
+  line-height: 4.375vh;
+  display: flex;
+}
 
-  .nextBox {
-    width: 4.69vw;
-    height: 7.5vh;
-    border-radius: 50%;
-    background-color: #3399ff;
-    color: #fff;
-    display: flex;
-    justify-content: center;
-    align-items: center;
-  }
+.pd10 {
+  padding-left: 10px;
+}
 
-  /* 设备数据 */
-  .deviceData {
-    width: 100%;
-    height: 36.5vh;
-    background-color: #fff;
-    box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.12);
-    opacity: 1;
-    border-radius: 0.4vw;
-  }
+/*  */
+.laboratoryLab {
+  display: inline-block;
+  width: 3.9vw;
+  color: #606266;
+  font-size: 1.2vw;
+  text-align: right;
+  margin-right: 0.7vw;
+}
 
-  .deviceList {
-    width: 100%;
-    height: 29vh;
-    overflow-y: auto;
-    padding: 0 2.18vw 1.88vh 2.18vw;
-    box-sizing: border-box;
-  }
+/* 下一次预约 */
+.nextOrder {
+  width: 28.5vw;
+  height: 37.5vh;
+  margin-right: 0;
+  display: flex;
+  flex-direction: column;
+}
 
-  .deviceList li {
-    list-style: none;
-    width: 100%;
-    height: 4.75vh;
-    line-height: 4.75vh;
-    font-size: 1.1vw;
-    color: #606266;
-    overflow: hidden;
-    text-overflow: ellipsis;
-    white-space: nowrap;
-    border-bottom: 1px dashed #f0f2f5;
-    display: flex;
-  }
+.next-order-wrap {
+  flex: 1;
+  overflow: auto;
+  padding: 0 0 20px 0;
+}
 
-  .deviceList li view:first-child {
-    margin-right: 10px;
-  }
+/* 照片 */
+.nextTop {
+  width: 100%;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-around;
+  align-items: center;
+}
 
-  .notice-wrap {
-    width: 50vw;
-    height: 60vh;
-    .notice-header {
-      padding: 20px 20px 0;
-      font-size: 20px;
-      font-weight: bold;
-    }
-    .notice-content {
-      padding: 20px;
-    }
-  }
-  .screen-save-box {
-    position: fixed;
-    left: 0;
-    top: 0;
-    width: 100%;
-    height: 100%;
-  }
-  .notice-home-content {
-    flex: 1;
-    overflow: hidden;
-  }
-  .notice-home-p {
-    // 省略号
-    overflow: hidden;
-    white-space: nowrap;
-    text-overflow: ellipsis;
-  }
-  .notice-home-createdName {
-    font-size: 14px;
-    width: 200px;
-    text-align: right;
-  }
-  .notice-home-date {
-    font-size: 14px;
-    width: 80px;
-    text-align: right;
+.nextImgBox {
+  width: 7.8vw;
+  height: 13vh;
+  border-radius: 50%;
+  margin-right: 1.4vw;
+}
+
+.nextNoLoginImgBox {
+  margin-top: 20px;
+}
+
+.nextImgBox img {
+  width: 7.8vw;
+  height: 100%;
+  border-radius: 50%;
+}
+
+.nextBox {
+  width: 4.69vw;
+  height: 7.5vh;
+  border-radius: 50%;
+  background-color: #3399ff;
+  color: #fff;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+/* 设备数据 */
+.deviceData {
+  width: 100%;
+  height: 36.5vh;
+  background-color: #fff;
+  box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.12);
+  opacity: 1;
+  border-radius: 0.4vw;
+}
+
+.deviceList {
+  width: 100%;
+  height: 29vh;
+  overflow-y: auto;
+  padding: 0 2.18vw 1.88vh 2.18vw;
+  box-sizing: border-box;
+}
+
+.deviceList li {
+  list-style: none;
+  width: 100%;
+  height: 4.75vh;
+  line-height: 4.75vh;
+  font-size: 1.1vw;
+  color: #606266;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  border-bottom: 1px dashed #f0f2f5;
+  display: flex;
+}
+
+.deviceList li view:first-child {
+  margin-right: 10px;
+}
+
+.notice-wrap {
+  width: 50vw;
+  height: 60vh;
+
+  .notice-header {
+    padding: 20px 20px 0;
+    font-size: 20px;
+    font-weight: bold;
   }
-  .notice-home-p:hover {
-    color: #3399ff;
+
+  .notice-content {
+    padding: 20px;
   }
+}
+
+.screen-save-box {
+  position: fixed;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+}
+
+.notice-home-content {
+  flex: 1;
+  overflow: hidden;
+}
+
+.notice-home-p {
+  // 省略号
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+
+.notice-home-createdName {
+  font-size: 14px;
+  width: 200px;
+  text-align: right;
+}
+
+.notice-home-date {
+  font-size: 14px;
+  width: 80px;
+  text-align: right;
+}
+
+.notice-home-p:hover {
+  color: #3399ff;
+}
 </style>

+ 261 - 264
pages/setting/index.vue

@@ -8,89 +8,51 @@
       <view class="input-col">
         <view class="title">服务器IP:</view>
         <view class="input-box">
-          <input
-            class="lab-input"
-            v-model="ip"
-            type="text"
-            placeholder="请输入服务器IP"
-          />
+          <input class="lab-input" v-model="ip" type="text" placeholder="请输入服务器IP" />
         </view>
       </view>
       <view class="input-col">
         <view class="title required">终端编号:</view>
         <view class="input-box">
-          <input
-            class="lab-input"
-            v-model="no"
-            type="text"
-            placeholder="请输入终端编号"
-          />
+          <input class="lab-input" v-model="no" type="text" placeholder="请输入终端编号" />
         </view>
       </view>
       <view class="input-col">
         <view class="title">终端租户码:</view>
         <view class="input-box">
-          <input
-            class="lab-input"
-            v-model="tenant"
-            type="text"
-            placeholder="请输入终端租户码"
-          />
+          <input class="lab-input" v-model="tenant" type="text" placeholder="请输入终端租户码" />
         </view>
       </view>
       <view class="input-col">
         <view class="title">秘钥:</view>
         <view class="input-box">
-          <input
-            class="lab-input"
-            v-model="token"
-            type="text"
-            placeholder="请输入秘钥"
-          />
+          <input class="lab-input" v-model="token" type="text" placeholder="请输入秘钥" />
         </view>
       </view>
       <view class="input-col">
         <view class="title">微服务:</view>
         <view class="input-box">
-          <input
-            class="lab-input"
-            v-model="service_path"
-            type="text"
-            placeholder="请输入微服务路径"
-          />
+          <input class="lab-input" v-model="service_path" type="text" placeholder="请输入微服务路径" />
         </view>
       </view>
       <view class="input-col">
         <view class="title">sdk:</view>
-        <view class="input-box">
-          <input
-            class="lab-input"
-            v-model="sdkKey"
-            type="text"
-            placeholder="请输入sdk"
-          />
+        <view class="input-box flex">
+          <input class="lab-input" v-model="sdkKey" type="text" placeholder="请输入sdk"
+            style="flex: 1;padding-right: 20px;" />
+          <u-button type="primary" style="width: 120px;" @click="getSdk">获取SDK</u-button>
         </view>
       </view>
       <view class="input-col">
         <view class="title">logo:</view>
         <view class="input-box">
-          <input
-            class="lab-input"
-            v-model="headerImg"
-            type="text"
-            placeholder="请输入sdk"
-          />
+          <input class="lab-input" v-model="headerImg" type="text" placeholder="请输入sdk" />
         </view>
       </view>
       <view class="input-col">
         <view class="title">文件路径:</view>
         <view class="input-box">
-          <input
-            class="lab-input"
-            v-model="filePath"
-            type="text"
-            placeholder="请输入文件路径"
-          />
+          <input class="lab-input" v-model="filePath" type="text" placeholder="请输入文件路径" />
         </view>
       </view>
     </view>
@@ -98,241 +60,276 @@
 </template>
 
 <script>
-  const module = uni.requireNativePlugin("leven-arcFace-ArcFaceModule");
-  export default {
-    data() {
-      return {
-        ip: "",
-        no: "",
-        tenant: "",
-        token: "",
-        service_path: "",
-        sdkKey: "CUjFXiqfJtDp6gZKUPKTSPLuVsKoyqw7WPgbQA5o7ebp",
-        headerImg: "static/images/header.png",
-        filePath: "",
-      };
-    },
-    onMounted() {
-      this.ip =
-        uni.getStorageSync("labsop_ip") ||
-        process.uniEnv.VUE_APP_MicroSrvProxy_API;
-      this.no = uni.getStorageSync("labsop_no") || "";
-      this.tenant =
-        uni.getStorageSync("labsop_tenant") || process.uniEnv.VUE_APP_TENANT;
-      this.token =
-        uni.getStorageSync("labsop_android_token") ||
-        process.uniEnv.VUE_APP_TOKEN;
-      this.service_path = uni.getStorageSync("labsop_service_path") || "";
-      this.sdkKey =
-        uni.getStorageSync("labsop_sdkKey") ||
-        "CUjFXiqfJtDp6gZKUPKTSPLuVsKoyqw7WPgbQA5o7ebp";
-      this.headerImg =
-        uni.getStorageSync("labsop_headerImg") || "static/images/header.png";
-      this.filePath = uni.getStorageSync("labsop_filePath") || "";
+import instApi from "../../api/inst";
+import to from "await-to-js";
+const module = uni.requireNativePlugin("leven-arcFace-ArcFaceModule");
+export default {
+  data() {
+    return {
+      ip: "",
+      no: "",
+      tenant: "",
+      token: "",
+      service_path: "",
+      sdkKey: "91RPJZf6Xz158bBuHHDmX2BoEHWCKYyL2gnMvbuCADKD",
+      headerImg: "static/images/header.png",
+      filePath: "",
+    };
+  },
+  onMounted() {
+    this.ip =
+      uni.getStorageSync("labsop_ip") ||
+      process.uniEnv.VUE_APP_MicroSrvProxy_API;
+
+    this.no = uni.getStorageSync("labsop_no") || "";
+
+    this.tenant =
+      uni.getStorageSync("labsop_tenant") || process.uniEnv.VUE_APP_TENANT;
+
+    this.token =
+      uni.getStorageSync("labsop_android_token") ||
+      process.uniEnv.VUE_APP_TOKEN;
+
+    this.service_path = uni.getStorageSync("labsop_service_path") || "";
+
+    this.sdkKey =
+      uni.getStorageSync("labsop_sdkKey") ||
+      "91RPJZf6Xz158bBuHHDmX2BoEHWCKYyL2gnMvbuCADKD";
+
+    this.headerImg =
+      uni.getStorageSync("labsop_headerImg") || "static/images/header.png";
+
+    this.filePath = uni.getStorageSync("labsop_filePath") || "";
+  },
+  onShow() {
+    this.ip =
+      uni.getStorageSync("labsop_ip") ||
+      process.uniEnv.VUE_APP_MicroSrvProxy_API;
+
+    this.no = uni.getStorageSync("labsop_no") || "";
+
+    this.tenant =
+      uni.getStorageSync("labsop_tenant") || process.uniEnv.VUE_APP_TENANT;
+
+    this.token =
+      uni.getStorageSync("labsop_android_token") ||
+      process.uniEnv.VUE_APP_TOKEN;
+
+    this.service_path = uni.getStorageSync("labsop_service_path") || "";
+
+    this.sdkKey =
+      uni.getStorageSync("labsop_sdkKey") ||
+      "91RPJZf6Xz158bBuHHDmX2BoEHWCKYyL2gnMvbuCADKD";
+
+    this.headerImg =
+      uni.getStorageSync("labsop_headerImg") || "static/images/header.png";
+
+    this.filePath = uni.getStorageSync("labsop_filePath") || "";
+  },
+  onLoad() { },
+  methods: {
+    // 重新获取系统Sdk 
+    async getSdk() {
+      const [err, res] = await to(instApi.getEntityByKey({ configKey: 'hongruanSdk' }))
+      if (err) {
+        uni.showToast({
+          title: "获取SDK失败",
+          icon: "none",
+          duration: 1000,
+        });
+        return;
+      }
+      this.sdkKey = res.data.configValue|| ''
     },
-    onShow() {
-      this.ip =
-        uni.getStorageSync("labsop_ip") ||
-        process.uniEnv.VUE_APP_MicroSrvProxy_API;
+    testSave() {
+      // 测试用的方法
+      uni.setStorageSync("labsop_ip", this.ip || "");
 
-      this.no = uni.getStorageSync("labsop_no") || "";
+      uni.setStorageSync("labsop_no", "66400376");
 
-      this.tenant =
-        uni.getStorageSync("labsop_tenant") || process.uniEnv.VUE_APP_TENANT;
+      uni.setStorageSync("labsop_tenant", this.tenant || "");
 
-      this.token =
-        uni.getStorageSync("labsop_android_token") ||
-        process.uniEnv.VUE_APP_TOKEN;
+      uni.setStorageSync("labsop_android_token", this.token || "");
 
-      this.service_path = uni.getStorageSync("labsop_service_path") || "";
+      uni.setStorageSync("labsop_service_path", this.service_path || "");
 
-      this.sdkKey =
-        uni.getStorageSync("labsop_sdkKey") ||
-        "CUjFXiqfJtDp6gZKUPKTSPLuVsKoyqw7WPgbQA5o7ebp";
+      uni.setStorageSync(
+        "labsop_sdkKey",
+        this.sdkKey || "91RPJZf6Xz158bBuHHDmX2BoEHWCKYyL2gnMvbuCADKD"
+      );
 
-      this.headerImg =
-        uni.getStorageSync("labsop_headerImg") || "static/images/header.png";
+      uni.setStorageSync(
+        "labsop_headerImg",
+        "weed1/5,124d5a8af276"
+      );
 
-      this.filePath = uni.getStorageSync("labsop_filePath") || "";
+      uni.setStorageSync("labsop_filePath", this.filePath || "");
     },
-    onLoad() {},
-    methods: {
-      testSave() {
-        // 测试用的方法
-        uni.setStorageSync("labsop_ip", this.ip || "");
-
-        uni.setStorageSync("labsop_no", this.no || "");
-
-        uni.setStorageSync("labsop_tenant", this.tenant || "");
-
-        uni.setStorageSync("labsop_android_token", this.token || "");
-
-        uni.setStorageSync("labsop_service_path", this.service_path || "");
-
-        uni.setStorageSync(
-          "labsop_sdkKey",
-          this.sdkKey || "CUjFXiqfJtDp6gZKUPKTSPLuVsKoyqw7WPgbQA5o7ebp"
-        );
-
-        uni.setStorageSync(
-          "labsop_headerImg",
-          this.headerImg || "static/images/header.png"
-        );
-
-        uni.setStorageSync("labsop_filePath", this.filePath || "");
-      },
-      // 激活引擎
-      confirm() {
-        // this.testSave();
-        // return;
-        if (!this.no) {
-          uni.showToast({
-            title: "终端编号不能为空",
-            icon: "none",
-            duration: 1000,
-          });
-          return;
-        }
-        module.activeEngine(
-          {
-            appId: "F4G44DgYsCFdZbfi4va9aE81bhTsRjHQvFUXxr9V5ym9",
-            sdkKey: this.sdkKey,
-          },
-          (res) => {
-            console.log(res);
-            if (res.code == 0 || res.code == 90114) {
-              uni.showModal({
-                title: "提示",
-                content: "确认设置" + this.no + "为当前系统的终端编号?",
-                success: (res) => {
-                  if (res.confirm) {
-                    this.clearFace();
-
-                    uni.setStorageSync("labsop_ip", this.ip || "");
-
-                    uni.setStorageSync("labsop_no", this.no || "");
-
-                    uni.setStorageSync("labsop_tenant", this.tenant || "");
-
-                    uni.setStorageSync(
-                      "labsop_android_token",
-                      this.token || ""
-                    );
-
-                    uni.setStorageSync(
-                      "labsop_service_path",
-                      this.service_path || ""
-                    );
-
-                    uni.setStorageSync(
-                      "labsop_sdkKey",
-                      this.sdkKey ||
-                        "CUjFXiqfJtDp6gZKUPKTSPLuVsKoyqw7WPgbQA5o7ebp"
-                    );
-
-                    uni.setStorageSync(
-                      "labsop_headerImg",
-                      this.headerImg || "static/images/header.png"
-                    );
-
-                    uni.setStorageSync("labsop_filePath", this.filePath || "");
-
-                    uni.showToast({
-                      title: "保存成功",
-                      duration: 1000,
-                    });
-                    setTimeout(() => {
-                      plus.runtime.restart();
-                    }, 1000);
-                  }
-                },
-              });
-            } else {
-              uni.showToast({
-                title: "激活失败,请重新确认激活",
-                icon: "none",
-                duration: 1000,
-              });
-            }
-          }
-        );
-      },
-      // 清空人脸库
-      clearFace() {
-        module.clearFace((res) => {
-          console.log("清空人脸库结果", res);
-        });
-      },
-      backHome() {
-        uni.redirectTo({
-          url: "/pages/home/index",
+    // 激活引擎
+    confirm() {
+      // this.testSave();
+      // return;
+      if (!this.no) {
+        uni.showToast({
+          title: "终端编号不能为空",
+          icon: "none",
+          duration: 1000,
         });
-      },
+        return;
+      }
+      module.activeEngine(
+        {
+          appId: "9hEJzpvjHowhWTwrcAd47fSg42YRjx3RhvmpuHFAVLyy",
+          sdkKey: this.sdkKey,
+        },
+        (res) => {
+          console.log(res);
+          if (res.code == 0 || res.code == 90114) {
+            uni.showModal({
+              title: "提示",
+              content: "确认设置" + this.no + "为当前系统的终端编号?",
+              success: (res) => {
+                if (res.confirm) {
+                  this.clearFace();
+
+                  uni.setStorageSync("labsop_ip", this.ip || "");
+
+                  uni.setStorageSync("labsop_no", this.no || "");
+
+                  uni.setStorageSync("labsop_tenant", this.tenant || "");
+
+                  uni.setStorageSync(
+                    "labsop_android_token",
+                    this.token || ""
+                  );
+
+                  uni.setStorageSync(
+                    "labsop_service_path",
+                    this.service_path || ""
+                  );
+
+                  uni.setStorageSync(
+                    "labsop_sdkKey",
+                    this.sdkKey ||
+                    "91RPJZf6Xz158bBuHHDmX2BoEHWCKYyL2gnMvbuCADKD"
+                  );
+
+                  uni.setStorageSync(
+                    "labsop_headerImg",
+                    this.headerImg || "static/images/header.png"
+                  );
+
+                  uni.setStorageSync("labsop_filePath", this.filePath || "");
+
+                  uni.showToast({
+                    title: "保存成功",
+                    duration: 1000,
+                  });
+                  setTimeout(() => {
+                    plus.runtime.restart();
+                  }, 1000);
+                }
+              },
+            });
+          } else {
+            uni.showToast({
+              title: "激活失败,请重新确认激活",
+              icon: "none",
+              duration: 1000,
+            });
+          }
+        }
+      );
     },
-  };
+    // 清空人脸库
+    clearFace() {
+      module.clearFace((res) => {
+        console.log("清空人脸库结果", res);
+      });
+    },
+    backHome() {
+      uni.redirectTo({
+        url: "/pages/home/index",
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-  .setting-wrap {
+.setting-wrap {
+  width: 100%;
+  height: 100vh;
+  background: #fff;
+
+  .header {
+    background: skyblue;
     width: 100%;
-    height: 100vh;
-    background: #fff;
-    .header {
-      background: skyblue;
-      width: 100%;
-      height: 12.6vh;
-      box-sizing: border-box;
+    height: 12.6vh;
+    box-sizing: border-box;
+    display: flex;
+
+    .name {
+      flex: 1;
       display: flex;
-      .name {
-        flex: 1;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        font-size: 1.6vw;
-        color: #fff;
-      }
-      .activation-btn {
-        font-size: 1.6vw;
-        letter-spacing: 2px;
-        color: #fff;
-        width: 15vw;
-        height: 100%;
-        background: #395294;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-      }
+      align-items: center;
+      justify-content: center;
+      font-size: 1.6vw;
+      color: #fff;
     }
-    .lab-input-wrap {
-      padding: 8vh 6vw 0 6vw;
+
+    .activation-btn {
+      font-size: 1.6vw;
+      letter-spacing: 2px;
+      color: #fff;
+      width: 15vw;
+      height: 100%;
+      background: #395294;
       display: flex;
-      flex-wrap: wrap;
-      .input-col {
-        width: 50%;
-        display: flex;
-        margin-bottom: 40px;
-        padding-right: 40px;
-        .title {
-          width: 9vw;
-          font-size: 1.4vw;
-          margin-right: 20px;
-          text-align: right;
-        }
-        .input-box {
-          flex: 1;
-          border-bottom: 1px solid #ccc;
-          .lab-input {
-            padding-left: 4px;
-            padding-bottom: 10px;
-          }
+      align-items: center;
+      justify-content: center;
+    }
+  }
+
+  .lab-input-wrap {
+    padding: 8vh 6vw 0 6vw;
+    display: flex;
+    flex-wrap: wrap;
+
+    .input-col {
+      width: 50%;
+      display: flex;
+      margin-bottom: 40px;
+      padding-right: 40px;
+
+      .title {
+        width: 9vw;
+        font-size: 1.4vw;
+        margin-right: 20px;
+        text-align: right;
+      }
+
+      .input-box {
+        flex: 1;
+        border-bottom: 1px solid #ccc;
+
+        .lab-input {
+          padding-left: 4px;
+          padding-bottom: 10px;
         }
       }
     }
-    .required::before {
-      margin-right: 4px;
-      color: red;
-      content: "*";
-      font-size: 20px;
-    }
   }
+
+  .flex {
+    display: flex;
+  }
+
+  .required::before {
+    margin-right: 4px;
+    color: red;
+    content: "*";
+    font-size: 20px;
+  }
+}
 </style>

+ 1 - 1
unpackage/cache/apk/apkurl

@@ -1 +1 @@
-https://app.liuyingyong.cn/build/download/ed238900-509f-11f0-b0e0-dfc6cde5db4d
+https://app.liuyingyong.cn/build/download/3f080ce0-516f-11f0-9665-71bc04a1cb8b

File diff suppressed because it is too large
+ 0 - 0
unpackage/cache/apk/cmManifestCache.json


File diff suppressed because it is too large
+ 0 - 0
unpackage/cache/wgt/__UNI__499A04E/app-service.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/cache/wgt/__UNI__499A04E/app-view.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/cache/wgt/__UNI__499A04E/manifest.json


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/app-plus/app-service.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/app-plus/app-view.js


+ 2 - 2
unpackage/dist/dev/app-plus/app-config-service.js

@@ -1,8 +1,8 @@
 
 var isReady=false;var onReadyCallbacks=[];
 var isServiceReady=false;var onServiceReadyCallbacks=[];
-var __uniConfig = {"pages":["pages/home/index","pages/setting/index","pages/face/index"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8","pageOrientation":"landscape","rpxCalcMaxDeviceWidth":1920,"titleNView":false},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"智能实验终端","compilerVersion":"4.45","entryPagePath":"pages/home/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
-var __uniRoutes = [{"path":"/pages/home/index","meta":{"isQuit":true},"window":{"navigationBarTitleText":"仪器首页"}},{"path":"/pages/setting/index","meta":{},"window":{"navigationBarTitleText":"设置"}},{"path":"/pages/face/index","meta":{"isNVue":true},"window":{"navigationBarTitleText":"人脸登录"}}];
+var __uniConfig = {"pages":["pages/home/index","pages/setting/index","pages/face/index","pages/face/openInstrFace"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8","pageOrientation":"landscape","rpxCalcMaxDeviceWidth":1920,"titleNView":false},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"智能实验终端","compilerVersion":"4.57","entryPagePath":"pages/home/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
+var __uniRoutes = [{"path":"/pages/home/index","meta":{"isQuit":true},"window":{"navigationBarTitleText":"仪器首页"}},{"path":"/pages/setting/index","meta":{},"window":{"navigationBarTitleText":"设置"}},{"path":"/pages/face/index","meta":{"isNVue":true},"window":{"navigationBarTitleText":"人脸登录"}},{"path":"/pages/face/openInstrFace","meta":{"isNVue":true},"window":{"navigationBarTitleText":"人脸登录"}}];
 __uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
 __uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
 service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});

File diff suppressed because it is too large
+ 3 - 3
unpackage/dist/dev/app-plus/app-service.js


File diff suppressed because it is too large
+ 233 - 188
unpackage/dist/dev/app-plus/app-view.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/app-plus/manifest.json


File diff suppressed because it is too large
+ 11 - 29
unpackage/dist/dev/app-plus/pages/face/index.js


File diff suppressed because it is too large
+ 96 - 0
unpackage/dist/dev/app-plus/pages/face/openInstrFace.js


二進制
unpackage/dist/dev/app-plus/static/images/header-beisan.png


二進制
unpackage/dist/dev/app-plus/static/images/header.png


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/app-plus/view.umd.min.js


Some files were not shown because too many files changed in this diff