ZaiZai 1 year ago
parent
commit
288bf2f9a8
3 changed files with 48 additions and 17 deletions
  1. 33 8
      components/hc-update/index.vue
  2. 2 2
      manifest.json
  3. 13 7
      pages/ledger/editTable.vue

+ 33 - 8
components/hc-update/index.vue

@@ -90,24 +90,49 @@ watch(() => [
 //获取新版本信息
 const versionData = ref({})
 const getVersionDataApi = async () => {
+    const {code, data} = await getUpdateDataApi()
+    versionData.value = data
+    appUpdate.value.version = data.versionNumber
+    const toUpdate = appUpdate.value.toUpdate
+    if (code === 200) {
+        appUpdate.value.isUpdate = true
+        isShow.value = toUpdate
+    } else {
+        appUpdate.value.isUpdate = false
+        appUpdate.value.toUpdate = false
+    }
+    store.setAppUpdate(appUpdate.value)
+}
+
+const getUpdateDataApi = async () => {
+    //获取完整包的版本信息
+    const {code: ICode, data: IData} = await getVersionUpdateApi(0)
+    if (ICode === 200) {
+        return {code: 200, data: IData}
+    }
+    //获取热更新包
+    const {code: YCode, data: YData} = await getVersionUpdateApi(1)
+    if (YCode === 200) {
+        return {code: 200, data: YData}
+    }
+    return {code: 300, data: YData}
+}
+
+//获取版本信息
+const getVersionUpdateApi = async (fileType) => {
     const { osName, version } = appInfo.value
     const type = osName === 'ios' ? 2 : 1
     const { data } = await getVersionData({
         softwareType: type,
+        fileType: fileType,
         platform: website.platform
     })
     const res = getObjValue(data)
-    versionData.value = res
-    appUpdate.value.version = res.versionNumber
-    const toUpdate = appUpdate.value.toUpdate
     if (res.versionNumber > version) {
-        appUpdate.value.isUpdate = true
-        isShow.value = toUpdate
+        return {code: 200, data: res}
     } else {
-        appUpdate.value.isUpdate = false
-        appUpdate.value.toUpdate = false
+        return {code: 300, data: res}
     }
-    store.setAppUpdate(appUpdate.value)
 }
 
 //立即强制更新

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "工程云家",
     "appid" : "__UNI__A0B807E",
     "description" : "智慧数字工程",
-    "versionName" : "2.0.9",
-    "versionCode" : 209,
+    "versionName" : "2.1.0",
+    "versionCode" : 210,
     "transformPx" : false,
     "networkTimeout" : {
         "request" : 300000,

+ 13 - 7
pages/ledger/editTable.vue

@@ -259,14 +259,20 @@ const linkTabClick = () => {
         errorToast('表单未渲染完成,请稍后再试');
         return
     }
-    uni.navigateTo({
-        url: '/pages/ledger/linkTab?id=' + itemFormId.value,
-        events: {
-            finish: (data) => {
-                linkTabFinish(data)
+    const { nodeType } = pageNode.value
+    if (nodeType === 7 || nodeType === 11) {
+        uni.navigateTo({
+            url: '/pages/ledger/linkTab?id=' + itemFormId.value,
+            events: {
+                finish: (data) => {
+                    linkTabFinish(data)
+                }
             }
-        }
-    });
+        });
+    } else {
+        errorToast('当前类型不需要关联');
+        return
+    }
 }
 
 //通知更新关联工序数据