wangtao 3 ماه پیش
والد
کامیت
e180d43220

+ 1 - 0
src/components/oa-scroll/index.vue

@@ -194,6 +194,7 @@ function onRefresh() {
  * @scrollView触底事件
  */
 function scrolltolower(e) {
+  console.log("触底事件", e);
   if (!refresherLoad.value || pageSize.value >= total.value) {
     return;
   } else {

+ 2 - 2
src/manifest.json

@@ -2,8 +2,8 @@
     "name" : "智能巡更",
     "appid" : "__UNI__BF1A1F0",
     "description" : "智能巡更app,是一款用于监督和记录巡逻人员按照预定路线和时间进行巡逻的系统。",
-    "versionName" : "2.3.0",
-    "versionCode" : 30,
+    "versionName" : "2.3.1",
+    "versionCode" : 31,
     "transformPx" : false,
     "app-plus" : {
         "compatible" : {

+ 68 - 9
src/pages/business/common/projectMange/record/details.vue

@@ -1,5 +1,5 @@
 <template>
-  <u-navbar :titleStyle="{ color: '#000' }" :autoBack="true" :title="dataList[0]?.createBy + '的日报'" :placeholder="true" :safeAreaInsetTop="true" bgColor="#fff">
+  <u-navbar v-if="dataList[0]?.createBy" :titleStyle="{ color: '#000' }" :autoBack="true" :title="dataList[0]?.createBy + '的日报'" :placeholder="true" :safeAreaInsetTop="true" bgColor="#fff">
     <template #left>
       <view class="u-navbar__content__left__item">
         <u-icon name="arrow-left" size="20" color="#000"></u-icon>
@@ -8,22 +8,30 @@
   </u-navbar>
 
   <oa-scroll
-    customClass="record-details-container scroll-height"
-    :style="{
+    customClass="record-container scroll-height"
+    :pageSize="pageSize"
+    :total="total"
+    :isSticky="true"
+    :customStyle="{
       //#ifdef APP-PLUS || MP-WEIXIN
-      height: `calc(100vh - (44px + ${proxy.$settingStore.StatusBarHeight}))`,
+      height: `calc(100vh - (138px + ${proxy.$settingStore.StatusBarHeight}))`,
+      //#endif
+      //#ifdef H5
+      height: `calc(100vh - (138px))`,
       //#endif
     }"
-    :refresherLoad="false"
-    :refresherEnabled="false"
-    :refresherEnabledTitle="false"
+    :refresherLoad="true"
+    :refresherEnabled="true"
     :refresherDefaultStyle="'none'"
     :refresherThreshold="44"
+    :lowerThreshold="44"
     :refresherBackground="'#f5f6f7'"
+    @load="load"
+    @refresh="refresh"
     :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
   >
     <template #default>
-      <view class="content-area radius bg-white" v-for="(item, index) in dataList" :key="index">
+      <view class="content-area radius bg-white" v-for="(item, index) in dataList" :key="index" style="margin-top: 6px">
         <view class="content-area-header flex mb10">
           <img :src="item.avatar" class="content-area-header-avatarImg mr10" v-if="item.avatar" />
           <u-avatar
@@ -139,9 +147,12 @@ const state = reactive({
     { name: "未读", value: 1 },
   ],
   tabsCurrent: 0,
+  pageSize:1,
+  total:10,
+  submitDate:undefined,
 });
 
-const { dataList, userData, tabsList, tabsCurrent } = toRefs(state);
+const { dataList, userData, tabsList, tabsCurrent, pageSize, total } = toRefs(state);
 
 /**
  * @tabs点击事件
@@ -174,6 +185,7 @@ function init() {
       })
       .then((requset) => {
         dataList.value = requset.data.records;
+        state.submitDate = requset.data.records[0].submitDate;
         state.loading = false;
         pmReportReaders.value = requset.data.records[0].pmReportReaders;
         state.tabsList[0].name = state.tabsList[0].name + "(" + pmReportReaders.value.read + ")";
@@ -187,6 +199,7 @@ function init() {
         files.forEach(function (item) {
           state.files.push(item.url);
         });
+        load()
       })
       .catch((err) => {
         state.loading = false;
@@ -200,6 +213,47 @@ function init() {
 function toProjectMange(id) {
   proxy.$tab.navigateTo(`/pages/business/common/projectMange/overview/index?id=${id}`);
 }
+/**
+ * @scrollView加载数据
+ */
+ function load() {
+  projectApi().ReportRecord(
+    {
+      upOrDown:0,
+      slideSum:1,
+      submitDate:state.submitDate,
+      projectAscription:2
+    }
+  ).then((requset) => {
+    dataList.value.push(requset.data.records[0]);
+    if(dataList.value.length>2){
+      delete dataList.value[0]
+    }
+  })
+}
+/**
+ * @scrollView刷新数据
+ */
+ function refresh() {
+  projectApi().ReportRecord(
+    {
+      upOrDown:1,
+      slideSum:1,
+      submitDate:state.submitDate,
+      projectAscription:2
+    }
+  ).then((requset) => {
+    dataList.value.unshift(requset.data.records[0]);
+    state.submitDate = requset.data.records[0].submitDate;
+    if(dataList.value.length>2){
+      delete dataList.value[2]
+    }
+  })
+  // console.log(dataList.value)
+  
+  // state.pageSize = 20;
+  // init();
+}
 onReady(() => {});
 
 onShow(() => {
@@ -255,4 +309,9 @@ onUnload(() => {
     }
   }
 }
+.uni-scroll-view-content .content-area:nth-child(3){
+  height:96px;
+  overflow: hidden;
+  background-image: linear-gradient(to top, #f3f2f2 30%, #fff 100%);
+}
 </style>

+ 2 - 1
src/pages/login.vue

@@ -183,7 +183,8 @@ function init() {
     linkUrl.value = window.location.host;
     // linkUrl.value = "192.168.10.165:13200";
     // linkUrl.value = "localhost:81";
-    linkUrl.value = "xf.usky.cn:13212";
+    // linkUrl.value = "xf.usky.cn:13212";
+    linkUrl.value = "manager.usky.cn";
     useStore.GetMobileTenantConfig({ url: linkUrl.value });
   }
   //#endif

+ 29 - 11
src/store/modules/setting.js

@@ -361,6 +361,7 @@ const settingStores = defineStore("storage-setting", {
          */
         handleLogout() {
             const useStore = useStores();
+            //#ifdef APP-PLUS
             if(config.appInfo.appid == '__UNI__BF1A1F0'){
                 modal.confirmInput("确定注销并退出系统吗?","请输入密码").then((res) => {
                     if(res.confirm){
@@ -377,20 +378,37 @@ const settingStores = defineStore("storage-setting", {
                     }
                 });
             }else{
-                modal.confirm("确定注销并退出系统吗?").then(() => {
-                    useStore.LogOut().then(() => {
-                        if (localStorage.getItem("type")) {
-                            console.log('内嵌h5')
-                            wx.miniProgram.navigateTo({
-                                appId: 'wxf5ad8734295d43f8',
-                                url: '/pages/login?type=logout'
-                            })
-                        } else {
-                            tab.reLaunch("/pages/index");
+                modal.confirmInput("确定注销并退出系统吗?","请输入密码").then((res) => {
+                    if(res.confirm){
+                        if(!res.content){
+                            modal.msg("请输入密码")
+                        }else if(res.content == "sh628628"){
+                            useStore.LogOut().then(() => {
+                                modal.msgSuccess("退出成功")
+                                tab.reLaunch("/pages/index");
+                            });
+                        }else{
+                            modal.msg("密码错误")
                         }
-                    });
+                    }
                 });
             }
+            //#endif
+            //#ifndef APP-PLUS
+            modal.confirm("确定注销并退出系统吗?").then(() => {
+                useStore.LogOut().then(() => {
+                    if (localStorage.getItem("type")) {
+                        console.log('内嵌h5')
+                        wx.miniProgram.navigateTo({
+                            appId: 'wxf5ad8734295d43f8',
+                            url: '/pages/login?type=logout'
+                        })
+                    } else {
+                        tab.reLaunch("/pages/index");
+                    }
+                });
+            });
+            //#endif
             
         },
         /**