Browse Source

feature:试验智能终端平板配置项增加

liuzhenlin 5 months ago
parent
commit
8118776e52

+ 2 - 1
api/inst/index.js

@@ -8,7 +8,8 @@
  */
 import micro_request from "../../utils/micro_request";
 // console.log(process.uniEnv.VITE_INSTR_ADMIN);
-const instPath = process.uniEnv.VITE_INSTR_ADMIN;
+const service_path = uni.getStorageSync("labsop_service_path") || "";
+const instPath = process.uniEnv.VITE_INSTR_ADMIN + service_path;
 export default {
   // 获取照片
   getPhoto(query) {

+ 2 - 1
pages/home/index.vue

@@ -10,7 +10,7 @@
       <view class="container-lab">
         <!-- 头部 -->
         <view class="header">
-          <img src="static/images/header.png" class="header-img" alt="" />
+          <img :src="headerImg" class="header-img" alt="" />
           <view class="hleft" @click="toSettingPage"></view>
           <view class="hcenter"></view>
           <view class="hright" v-if="isOnlineInfo" @click="handleGetOff">
@@ -353,6 +353,7 @@
         isOnlineInfo: null, //在线信息
         userId: 0,
         currentTime: new Date(), // 当前时间
+        headerImg: "static/images/header.png", // 头部背景图片
       };
     },
     computed: {

+ 79 - 1
pages/setting/index.vue

@@ -49,6 +49,39 @@
           />
         </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="请输入微服务路径"
+          />
+        </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>
+      </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"
+          />
+        </view>
+      </view>
     </view>
   </view>
 </template>
@@ -62,6 +95,9 @@
         no: "",
         tenant: "",
         token: "",
+        service_path: "",
+        sdkKey: "CUjFXiqfJtDp6gZKUPKTSPLuVsKoyqw7WPgbQA5o7ebp",
+        headerImg: "static/images/header.png",
       };
     },
     onMounted() {
@@ -74,6 +110,12 @@
       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";
     },
     onShow() {
       this.ip =
@@ -85,11 +127,35 @@
       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";
     },
     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"
+        );
+        this.headerImg =
+          uni.getStorageSync("labsop_headerImg") || "static/images/header.png";
+        uni.redirectTo({
+          url: "/",
+        });
+      },
       // 激活引擎
       confirm() {
+        // this.testSave();
+        // return;
         if (!this.no) {
           uni.showToast({
             title: "终端编号不能为空",
@@ -101,7 +167,7 @@
         module.activeEngine(
           {
             appId: "F4G44DgYsCFdZbfi4va9aE81bhTsRjHQvFUXxr9V5ym9",
-            sdkKey: "CUjFXiqfJtDp6gZKUPKTSPLuVsKoyqw7WPgbQA5o7ebp",
+            sdkKey: this.sdkKey,
           },
           (res) => {
             console.log(res);
@@ -119,6 +185,18 @@
                       "labsop_android_token",
                       this.token || ""
                     );
+                    uni.setStorageSync(
+                      "labsop_service_path",
+                      this.service_path || ""
+                    );
+                    uni.setStorageSync(
+                      "labsop_sdkKey",
+                      this.sdkKey ||
+                        "CUjFXiqfJtDp6gZKUPKTSPLuVsKoyqw7WPgbQA5o7ebp"
+                    );
+                    this.headerImg =
+                      uni.getStorageSync("labsop_headerImg") ||
+                      "static/images/header.png";
                     uni.showToast({
                       title: "保存成功",
                       duration: 1000,

+ 1 - 1
unpackage/cache/apk/apkurl

@@ -1 +1 @@
-https://app.liuyingyong.cn/build/download/50dc1e70-190a-11f0-9fdb-955621470e7c
+https://app.liuyingyong.cn/build/download/502d5f20-5019-11f0-b6c7-e5f523f2f2db

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/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


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