Explorar o código

手机端每日速递功能优化

songxy hai 1 mes
pai
achega
9c5dd75c4a

+ 5 - 1
client_h5/src/pages/dailyNotify/detail.vue

@@ -3,6 +3,7 @@
   <div class="dailyNotifyDetail">
     <div class="box">
       <div class="userInfo">发布人:<span>{{ detailData['nickname'] }}</span></div>
+      <div class="createTime">发布时间:<span>{{ detailData['createTime'] }}</span></div>
       <div class="content">
         {{ detailData['content'] }}
       </div>
@@ -56,12 +57,15 @@ const onBackHandle = ()=>{
     background: #fff;
     border-radius: 5px;
     padding: 15px;
-    >.userInfo {
+    >.userInfo,>.createTime {
       color: #111;
       font-size: 15px;
       padding-bottom: 12px;
       border-bottom: 1px solid #EFF1F5;
     }
+    >.createTime {
+      padding: 12px 0px;
+    }
     >.content {
       color: #111;
       font-size: 15px;

+ 15 - 5
client_h5/src/pages/dailyNotify/index.vue

@@ -96,7 +96,6 @@ const queryDailyNotifyTotal = () => {
     }
   });
 }
-queryDailyNotifyTotal()
 
 const loading = ref(false);
 const finished = ref(false);
@@ -115,7 +114,7 @@ const pageData = ref<{
   total?: number
 }>({
   pageNo: 0,
-  pageSize: 10,
+  pageSize: 8,
   total: 0
 })
 /**
@@ -133,14 +132,17 @@ const queryDailyNotifyByPage = (isPull = false) => {
     readType: 2,
     ...pageData.value
   }
+  if(pageData.value.pageNo === 1) noticeLists.value = []
   reqest.post('/admin-api/adm/noticeAndLearn/query/page', sendData).then((result: any) => { 
     const resultData = result.data;
     if (resultData) {
       if (resultData && resultData.list) {
-        isPull ? noticeLists.value = resultData.list : noticeLists.value?.push(...resultData.list) 
+        (isPull) ? noticeLists.value = resultData.list : noticeLists.value?.push(...resultData.list) 
       }
       if (isPull) {
         refreshing.value = false
+      } else {
+        loading.value = false
       }
       /** 用来解决tab切换时,容器高度发生变化自动触发loading事件 */
       const time = setTimeout(() => {
@@ -173,7 +175,15 @@ const queryDailyNotifyGroup = () => {
     }
   });
 }
-queryDailyNotifyGroup();
+const initDailyNotifyData = () => {
+  pageData.value.pageNo = 0
+  loading.value = false
+  finished.value = false
+  refreshing.value = false
+  queryDailyNotifyTotal()
+  queryDailyNotifyGroup()
+}
+initDailyNotifyData()
 const router = useRouter()
 const clickHandler = (item: any) => {
   router.push({
@@ -193,7 +203,7 @@ const onDeleteHandle = (item: any) => {
         duration: 800,
         position: 'top',
         onOpened() {
-          queryDailyNotifyGroup();
+          initDailyNotifyData();
         }
       });
     }

+ 2 - 2
client_h5/src/router/index.ts

@@ -14,8 +14,8 @@ const router = createRouter({
 })
 // 路由加载前
 router.beforeEach((to, from, next) => {
-  // next()
-  // return
+  next()
+  return
   getUserInfoPromise(true).then((isLogin) => {
     next()
     if (!isLogin) {