From 9cad6a832c786989be620573b09badccfe7e3b51 Mon Sep 17 00:00:00 2001
From: QYF-GitLab1 <1940665526@qq.com>
Date: 星期一, 25 八月 2025 15:11:37 +0800
Subject: [PATCH] 首页头部,样式调整

---
 src/views/personalCenter/myApply.vue |  202 ++++++++++++++++++++++++++++++--------------------
 1 files changed, 120 insertions(+), 82 deletions(-)

diff --git a/src/views/personalCenter/myApply.vue b/src/views/personalCenter/myApply.vue
index 2812c8e..98f2497 100644
--- a/src/views/personalCenter/myApply.vue
+++ b/src/views/personalCenter/myApply.vue
@@ -5,9 +5,7 @@
     <div class="personalPage-content">
       <div class="tipsText">
         <div>
-          濡傛偍鍦ㄦ暀鏉愯瘯鐢ㄧ敵璇疯繃绋嬩腑閬囧埌闂锛岃浜庡伐浣滄椂闂磋仈绯绘垜浠��<span class="phone">
-            QQ鍙凤細3565269931 / 鍜ㄨ鐢佃瘽010-65778403锛堝伐浣滄椂闂达細9:00锝�17:00锛�
-          </span>
+          {{ description }}
         </div>
       </div>
       <div class="stageBtm" v-for="(item, index) in listData" :key="index">
@@ -22,11 +20,7 @@
                   reviewstatusWait: item.state == 'WaitAudit',
                 }"
                 >{{
-                  item.state == "WaitAudit"
-                    ? "瀹℃牳涓�"
-                    : item.state == "Normal"
-                    ? "閫氳繃"
-                    : "鎷掔粷"
+                  item.state == 'WaitAudit' ? '瀹℃牳涓�' : item.state == 'Normal' ? '閫氳繃' : '鎷掔粷'
                 }}</span
               >
             </div>
@@ -37,23 +31,19 @@
               璇曠敤鏈熼檺锛�<span>{{ item.updateDate }}</span> --
               <span>{{ item.feedBack.endDate }}</span>
             </div>
-            <div style="color: orangered" v-if="item.isExpiry">
+            <div class="no" style="color: orangered" v-if="item.isExpiry">
               闃呰鏈熼檺锛�<span>宸茶繃鏈�</span>
             </div>
             <div class="time">鐢宠鏃堕棿锛歿{ item.updateDate }}</div>
           </div>
-          <div
-            class="reasonForFailure"
-            style="margin: 10px 0"
-            v-if="item.state == 'Reject'"
-          >
+          <div class="reasonForFailure" style="margin: 10px 0" v-if="item.state == 'Reject'">
             <div class="centerVertically">鏈�氳繃鍘熷洜:</div>
             <div
               style="flex: 1"
               class="ellipsis-3"
               :title="item.feedBack.reason ? item.feedBack.reason : ' - '"
             >
-              {{ item.feedBack.reason ? item.feedBack.reason : " - " }}
+              {{ item.feedBack.reason ? item.feedBack.reason : ' - ' }}
             </div>
           </div>
         </div>
@@ -92,7 +82,7 @@
         layout="total, prev, pager, next, slot"
         :total="paginationData.totalCount"
       >
-        <div style="display: inline-block">
+        <div style="display: flex; align-items: center">
           <span class="el-pagination__jump"
             >鍓嶅線
             <div class="el-input el-pagination__editor is-in-pagination">
@@ -115,105 +105,146 @@
   </div>
 </template>
 <script setup lang="ts">
-import { reactive, ref, onMounted, inject } from "vue";
-import { getPublicImage } from "@/assets/js/middleGround/tool";
-const MG: any = inject("MG");
-const config: any = inject("config");
-const crumbStore = inject("crumbStore");
-const router = inject("router");
-let listData = ref([]);
-let loading = ref(false);
+import { reactive, ref, onMounted, inject } from 'vue'
+import { getPublicImage } from '@/assets/js/middleGround/tool'
+import { useRouter } from 'vue-router'
+import defaultImg from '@/assets/images/default-book-img.png'
+const MG: any = inject('MG')
+const config: any = inject('config')
+const router = useRouter()
+let listData = ref([])
+let loading = ref(false)
 let paginationData = reactive({
   page: 1,
   limit: 10,
   totalCount: 0,
   totalPage: 0,
-});
-let inputPage = ref(1);
+})
+let inputPage = ref(1)
+let description = ref('')
 
 const getTextBookList = () => {
-  loading.value = true;
-  let { page, limit } = paginationData;
+  loading.value = true
+  let { page, limit } = paginationData
   const data = {
     start: limit * page - limit,
     size: limit,
-    topicIdOrRefCode: "applyDigitalBook",
+    topicIdOrRefCode: 'applyDigitalBook',
     appRefCode: config.appRefCode,
     sort: {
-      type: "Desc",
-      field: "CreateDate",
+      type: 'Desc',
+      field: 'CreateDate',
     },
-  };
+  }
   MG.ugc.getTopicMessageList(data).then((res) => {
-    loading.value = false;
+    loading.value = false
     res.datas.forEach((item) => {
-      item.icon = item.icon ? item.icon : getPublicImage(null);
-      item.updateDate = item.updateDate.split("T")[0];
+      item.icon = item.icon ? item.icon : getPublicImage(null)
+      item.updateDate = item.updateDate.split('T')[0]
       if (item.feedBack) {
-        item.feedBack = JSON.parse(item.feedBack);
+        item.feedBack = JSON.parse(item.feedBack)
         if (item.feedBack.endDate) {
-          let times = new Date(item.feedBack.endDate + " 23:59:59").getTime();
+          let times = new Date(item.feedBack.endDate + ' 23:59:59').getTime()
           if (times < sessionStorage.currentDate) {
-            item.isExpiry = true;
+            item.isExpiry = true
           }
         }
       }
       if (item.content) {
-        item.content = JSON.parse(item.content)[0] ?? {};
+        item.content = JSON.parse(item.content)[0] ?? {}
         if (!item.content?.icon) {
-          item.content.icon = require("@/assets/images/default-book-img.png");
+          item.content.icon = defaultImg
         }
       }
-    });
-    paginationData.totalCount = res.totalSize;
-    paginationData.totalPage = Math.ceil(res.totalSize / limit);
-    listData.value = res.datas;
-  });
-};
+    })
+    paginationData.totalCount = res.totalSize
+    paginationData.totalPage = Math.ceil(res.totalSize / limit)
+    listData.value = res.datas
+  })
+}
+
+const getType = () => {
+  const data = {
+    refCodes: ['sampleBook'],
+  }
+  MG.resource
+    .getCmsTypeByRefCode(data)
+    .then((res) => {
+      if (res?.length) {
+        description.value = res[0]?.description
+      }
+    })
+    .catch(() => {
+      description.value = ''
+    })
+}
+
 onMounted(() => {
-  getTextBookList();
-});
+  getType()
+  getTextBookList()
+})
 
 const toDetail = (item: any) => {
-  const thisCrumbs = [{ name: "涔︾睄璇︽儏", pathName: "digitalTextbooks-textbooksDetail" }];
-  MG.store.dispatch("setCrumbs", {
-    type: "textbooks",
-    data: thisCrumbs,
-    callback: (key: string) => {
-      MG.router.push({
-        name: "digitalTextbooks-textbooksDetail",
-        query: {
-          id: item.id,
-          rootCmsItemId: item.rootCmsItemId,
-          crumbsKey: key,
-        },
-      });
+  router.push({
+    path: '/bookdetail',
+    query: {
+      bookId: item.id,
     },
-  });
-};
-const read = (pItem: any) => {
-  let token = MG.tool.getCookie(config.tokenKey);
-  window.open(config.textReaderUrl + "?bookId=" + pItem.refCode + "&token=" + token);
-};
+  })
+}
+
+// 鑾峰彇鏁欐潗璇︽儏
+const getBookDetail = async (id: string) => {
+  const query = {
+    path: '*',
+    queryType: '*',
+    productId: id,
+    coverSize: {
+      height: 300,
+      width: 210,
+    },
+    fields: {
+      author: [],
+      isbn: [],
+    },
+  }
+  const res = await MG.store.getProductDetail(query)
+  return res.datas ?? null
+}
+
+const read = async (pItem: any) => {
+  /** 鏆傛棤鏁欐潗闃呰鍣紝璺宠浆鑷宠鎯� */
+  const detail = await getBookDetail(pItem.id)
+  let token = localStorage.getItem(config.tokenKey)
+  const url =
+    config.textBookResourceUrl + '#/home' + '?bookId=' + detail.refCode + '&token=' + token
+  window.open(url)
+  // router.push({
+  //   path: '/bookdetail',
+  //   query: {
+  //     bookId: pItem.id,
+  //   },
+  // })
+}
 const handleSizeChange = (val: number) => {
-  paginationData.limit = val;
-  getTextBookList();
-};
+  paginationData.limit = val
+  getTextBookList()
+}
 const handleCurrentChange = (val: number) => {
-  paginationData.page = val;
-  getTextBookList();
-};
+  paginationData.page = val
+  getTextBookList()
+}
 const jumpFun = (event: any) => {
-  event.target.blur();
+  event.target.blur()
   if (inputPage.value <= 0) {
-    inputPage.value = 1;
+    inputPage.value = 1
   }
   if (inputPage.value > paginationData.totalPage) {
-    inputPage.value = paginationData.totalPage;
+    inputPage.value = paginationData.totalPage
   }
-  paginationData.page = inputPage.value;
-  getTextBookList();
-};
+  paginationData.page = inputPage.value
+  getTextBookList()
+}
 </script>
 <style scoped lang="less">
 .myCarTopPage {
@@ -237,8 +268,9 @@
 }
 
 .pageBox {
+  display: flex;
+  justify-content: center;
   background-color: #fff;
-  margin-top: 50px;
 }
 .stageBtm {
   border: 1px solid #dcdcdc;
@@ -277,20 +309,26 @@
     padding: 15px;
     box-sizing: border-box;
     .listImg {
-      display: inline-block;
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      justify-content: space-between;
       margin-right: 60px;
       width: 120px;
       img {
         width: 120px;
         cursor: pointer;
+        box-shadow: 0px 0px 20px 1px #ccc;
       }
       .name {
-        line-height: 27px;
+        line-height: 30px;
         font-size: 15px;
         color: #333;
         overflow: hidden;
         text-overflow: ellipsis;
         white-space: nowrap;
+        padding: 5px 0;
+        box-sizing: border-box;
       }
     }
   }

--
Gitblit v1.9.1