Browse Source

Merge branch 'wangtao-daily' of uskycloud/usky-web-mobile into master

gez 3 days ago
parent
commit
0fb0855ce2

+ 60 - 32
src/pages/common/appMessage/index.vue

@@ -97,6 +97,10 @@ const { scrollIntoView, noticeList } = toRefs(state);
  * @跳转相应类型系统
  */
 function goContentDetails(e) {
+  //是否已读
+  if (!e.readFlag) {
+    updateMceReceiveStatus({ id: e.id });
+  }
   if (e.infoType == 4) {
     proxy.$tab.navigateTo(`/pages/business/fireIot/alarmManage/alarmDetails/index?contentId=${e.contentId}`).then(() => {});
   } else if (e.infoType == 5) {
@@ -113,18 +117,27 @@ function goContentDetails(e) {
     } else {
       proxy.$tab.navigateTo(`/pages/business/common/projectMange/record/details?reportId=${e.moduleId}`);
     }
-  } else {
     //通知公告
-    if(e.infoType == 1){
-      proxy.$tab.navigateTo(`/pages/common/appMessage/nociteDetails?moduleId=${e.moduleId}`).then(() => {});
-    }else{
-      proxy.$tab.navigateTo(`/pages/common/appMessage/details?contentId=${e.contentId}`).then(() => {});
+  }else if(e.infoType == 1){
+    proxy.$tab.navigateTo(`/pages/common/appMessage/nociteDetails?moduleId=${e.moduleId}`).then(() => {});
+  }else if(e.infoType == 3){//OA消息
+    console.log(e)
+    if(e.infoContent){
+      console.log(e.infoContent.includes("新的审批任务"))
+      if(e.infoContent){
+        if(e.infoContent.includes("新的审批任务")){
+          proxy.$common.toPage(2,"todo")
+        }else{
+          proxy.$common.toPage(2,"me")
+        }
+      }else{
+        proxy.$common.toPage(2,"todo")
+      }
+      
+      
     }
-  }
-
-  //是否已读
-  if (!e.readFlag) {
-    updateMceReceiveStatus({ id: e.id });
+  }else{
+    proxy.$tab.navigateTo(`/pages/common/appMessage/details?contentId=${e.contentId}`).then(() => {});
   }
 }
 
@@ -145,37 +158,52 @@ function noticeDelete(e) {
  * @api接口调用
  */
 function init(obj) {
+  console.log(obj)
   uni.setNavigationBarTitle({
     title: obj.typeName ? obj.typeName : "消息列表",
   });
 
   state.loading = true;
-  getMceList({
-    size: state.size,
-    current: state.current,
-    infoType: obj?.type,
-  })
-    .then((requset) => {
-      if (requset.status === "SUCCESS") {
-        state.noticeList = requset.data.records;
-        state.total = requset.data.total;
-        state.loading = false;
+  if(obj.id){
+    if(obj.type == 3){
+      console.log(4444)
+      if(obj?.oaType){
+        proxy.$common.toPage(2,obj.oaType)
       }
-      setTimeout(() => {
-        scrollIntoView.value = "bottomInfo";
-      }, 0);
-
-      if ("id" in obj) {
-        state.noticeList.forEach((e) => {
-          if (e.id == obj.id) {
-            goContentDetails(e);
-          }
+    }else{
+      getMceList({
+        size: 1,
+        current: 1,
+        infoId: obj.id,
+        infoType: obj?.type,
+      })
+        .then((requset) => {
+          goContentDetails(requset.data.records[0]);
+        })
+        .catch((err) => {
+          state.loading = false;
         });
       }
+  }else{
+    getMceList({
+      size: state.size,
+      current: state.current,
+      infoType: obj?.type,
     })
-    .catch((err) => {
-      state.loading = false;
-    });
+      .then((requset) => {
+        if (requset.status === "SUCCESS") {
+          state.noticeList = requset.data.records;
+          state.total = requset.data.total;
+          state.loading = false;
+        }
+        setTimeout(() => {
+          scrollIntoView.value = "bottomInfo";
+        }, 0);
+      })
+      .catch((err) => {
+        state.loading = false;
+      });
+  }
 }
 
 /**

+ 10 - 23
src/pages/index.vue

@@ -1,12 +1,15 @@
 <template>
   <u-navbar :autoBack="false" :placeholder="true" :safeAreaInsetTop="true" :bgColor="proxy.$settingStore.themeColor.color">
     <template #left>
-      <view class="u-navbar__content__left__item" v-if="tenantIdList.length == 1">
+      <view class="u-navbar__content__left__item">
+        <view class="u-navbar__content__left__item__title">应用中心</view>
+      </view>
+      <!-- <view class="u-navbar__content__left__item" v-if="tenantIdList.length == 1">
         <view class="u-navbar__content__left__item__title">应用中心</view>
       </view>
       <view v-if="tenantIdList.length > 1 && accountState">
         <image class="unit-change" src="@/static/images/index/unitChange.png" @click="showLeftStateClick()"></image>
-      </view>
+      </view>  -->
     </template>
     <template #center>
       <view class="u-navbar__content__left__item"> </view>
@@ -277,27 +280,11 @@ function navItemClick(item) {
 
     if (item.path.indexOf("http") != -1) {
       if(item.path.indexOf("token") > 0){
-        var name = uni.getStorageSync("storage_data").name
-        if(name){
-          var params = { 
-              user:name,
-              time:new Date().getTime(),
-              form:"SAAS_mob"
-          }
-          var jm = encrypt(JSON.stringify(params))
-          //#ifdef H5 
-            window.open(`${item.path}=${encodeURIComponent(jm)}?urlF=https://manager.usky.cn/mobile/#/`)
-          //#endif
-          //#ifdef APP-PLUS || MP-WEIXIN 
-            uni.navigateTo({
-              url: `/pages/common/webview/index?url=${item.path}=${encodeURIComponent(jm)}?urlF=https://manager.usky.cn/mobile/#/`,
-            });
-          //#endif
-        }else{
-          uni.navigateTo({
-            url: "/pages/common/webview/index?url=" + item.path,
-          });
-        }
+        proxy.$common.toPage(1,null,item)
+      }else{
+        uni.navigateTo({
+          url: `/pages/common/webview/index?url=${item.path}`,
+        })
       }
     } else {
       uni.navigateTo({

+ 1 - 1
src/pages/info.vue

@@ -99,7 +99,7 @@ function init() {
               receiveStatic.infoTypeStatic[i].img = "/static/images/common/inspectionMessage.png";
             }
             if (receiveStatic.infoTypeStatic[i].infoType == 3) {
-              receiveStatic.infoTypeStatic[i].img = "/static/images/common/meetingMessage.png";
+              receiveStatic.infoTypeStatic[i].img = "/static/images/common/approveMessage.png";
             }
             if (receiveStatic.infoTypeStatic[i].infoType == 4) {
               receiveStatic.infoTypeStatic[i].img = "/static/images/common/alarmMessage.png";

+ 1 - 1
src/pages/login.vue

@@ -114,7 +114,7 @@ const state = reactive({
   /** login数据 */
   phone: undefined,
   verify: undefined,
-  switchText: "验证码登录",
+  switchText: "账号密码登录",
   username: undefined,
   password: undefined,
   isPassword: true,

+ 50 - 1
src/plugins/common.plugins.js

@@ -1,5 +1,5 @@
 import modal from "./modal.plugins";
-
+import { decrypt, encrypt } from "@/plugins/jsencrypt";
 export default {
   /**
    * 参数处理
@@ -312,4 +312,53 @@ export default {
     var img = `/static/${url}`
     return new URL(img, import.meta.url).href;
   },
+  /**
+   * 跳转页面
+   * @param {类型} type (1:菜单页点击  2:消息页点击)
+   * @param {类型} to (消息页跳转页面)
+   * @param {类型} item (菜单内容)
+   * @returns
+   */
+  toPage(type,to,item) {
+    var name = uni.getStorageSync("storage_data").name
+    let form = "https://manager.usky.cn/mobile/#/"
+    let path = "https://oa.usky.cn/mobile/#/login?token"
+    console.log("跳转页面",type,to,item,name)
+    if(name){
+      var params = { 
+          user:name,
+          time:new Date().getTime(),
+          form:"SAAS_mob"
+      }
+      var jm = encrypt(JSON.stringify(params))
+      //#ifdef H5 
+        if(type == "1"){
+          window.open(`${item.path}=${encodeURIComponent(jm)}?form=${form}`)
+        }
+        if(type == "2"){
+          window.open(`${path}=${encodeURIComponent(jm)}?form=${form}?toPage=${to}`)
+        }
+      //#endif
+      //#ifdef APP-PLUS || MP-WEIXIN 
+        if(type == "1"){
+          uni.navigateTo({
+            url: `/pages/common/webview/index?url=${item.path}=${encodeURIComponent(jm)}?form=${form}`,
+          });
+        }
+        if(type == "2"){
+          uni.navigateTo({
+            url: `/pages/common/webview/index?url=${path}=${encodeURIComponent(jm)}?form=${form}?toPage=${to}`,
+          });
+        }
+      //#endif
+    }else{
+      if(item){
+        uni.navigateTo({
+          url: "/pages/common/webview/index?url=" + item.path,
+        });
+      }
+    }
+  },
+
+
 };

BIN
src/static/images/common/approveMessage.png


BIN
src/static/images/common/reportMessage.png