8 Commits 666f4a416a ... 9bd02d07c8

Author SHA1 Message Date
  Satsiki 9bd02d07c8 Merge branch 'master' of 139.224.213.4:wenshuai/winhc-demension-vue3 2 years ago
  Satsiki bcd9e0747c feat: 字段列表完善,跳转逻辑完善 2 years ago
  wenshuai 3ab1b177e1 列表tab开发 2 years ago
  wenshuai 9a0788cc3e 列表tab开发 2 years ago
  Satsiki 081a7c3edb feat: tab开发 2 years ago
  wenshuai 3161fd6c92 feat: 完善列表,添加tab 2 years ago
  wenshuai 8bb33c7a6a feat: 项目结构搭建 2 years ago
  wenshuai ecd6b572fc init 2 years ago

+ 3 - 2
src/api/reqHeaders.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: 文帅
  * @Date: 2022-03-08 17:08:19
- * @LastEditTime: 2022-03-11 15:13:31
+ * @LastEditTime: 2022-03-14 16:50:30
  * @LastEditors: 文帅
  * @Description:
  */
@@ -14,5 +14,6 @@ export const headerData = {
   'brand': '',
   'osVersion': '',
   'appVersion': '',
-  'sessionId': localStorage.getItem('sessionId') ? localStorage.getItem('sessionId') : '2203011444526GU9ABP6HOKMLA4M0375'
+  // 'sessionId': localStorage.getItem('sessionId') ? localStorage.getItem('sessionId') : '220311101808VDFV8U11CE3FTX2H0208'
+  'sessionId': '220314101949DP49DY28X3K04N340296'
 }

+ 78 - 16
src/components/CommonList.vue

@@ -1,12 +1,39 @@
 <template>
-  <div>
+  <div class="common-list">
+    <div class="fixed-num">共
+      <span>{{store.totalNum}}</span>
+      条开庭公告</div>
     <van-list v-model:loading="loading" :finished="finished" :immediate-check="false" finished-text="没有更多了" @load="onLoad">
-      <div v-for="(item,index) in store.dataList" :key="index" class="card">
-        <div v-for="obj in store.selectDemension.viewList" :key="obj.value" class="item">
-          <p v-if="obj.name">{{obj.name}}:</p>
-          <p v-if="obj.valueType === 'date'">{{dayjs(item[obj.value]).format('YYYY-MM-DD')}}</p>
-          <p v-else :class="obj.valueType === 'title' ? 'title' : ''">{{item[obj.value]}}</p>
+      <div v-for="(item,index) in store.dataList" :key="index" class="card" @click="goDetail(item)">
+        <div class="list-container">
+          <div v-for="obj in store.selectDemension.viewList" :key="obj.value" class="item">
+
+            <!-- 标题 -->
+            <p v-if="obj.name" class="name">{{obj.name}}:</p>
+
+
+            <div>
+              <!-- 时间数据-->
+              <p v-if="obj.valueType === 'date'">{{dayjs(item[obj.value]).format('YYYY-MM-DD')}}</p>
+
+              <!-- 多个数据 -->
+              <div v-else-if="obj.listVal">
+                <a v-for="(listItem,listIndex) in item[obj.listVal]"
+                   :key="listIndex" href="javascript:"
+                   class="block"
+                   @click.stop="$goCompany(listItem[obj.companyName as string],listItem[obj.companyId as string])">
+                  {{listItem[obj.value]}}
+                </a>
+              </div>
+
+              <p v-else :class="obj.valueType === 'title' ? 'title' : ''">{{item[obj.value]}}</p>
+            </div>
+
+
+
+          </div>
         </div>
+        <van-icon v-if="store.selectDemension.hasDetail" name="arrow" color="#969696" class="arrow" />
       </div>
     </van-list>
   </div>
@@ -14,6 +41,7 @@
 
 <script lang="ts" setup>
   import { useDemensionStore } from '@/store/demension'
+  import { $goCompany } from '@/utils/utils'
   import dayjs from 'dayjs'
   import { ref, watch } from 'vue'
   const store = useDemensionStore()
@@ -35,10 +63,13 @@
     }
   }
 
+  const goDetail = (item:{id:string}) => {
+    console.log(`跳转详情:${item.id}`)
+
+  }
+
   watch(() => store.dataList.length,(newVal) => {
     if(!newVal) {
-      console.log(877)
-
       finished.value = false
     }
   })
@@ -50,14 +81,45 @@
   width: 100%;
   background: #fff;
   padding: 15px;
-  margin-bottom: 10px;
-  font-size: 14px;
-  .item{
-    display: flex;
-    align-items: center;
-    .title{
-      font-weight: bold;
-      color: #000;
+  margin-bottom: 15px;
+  display: flex;
+  align-items: center;
+  .list-container{
+    width: inherit;
+    .item{
+      display: flex;
+      // align-items: center;
+      .title{
+        font-weight: bold;
+        color: #000;
+        font-size: 15px;
+        padding: 4px 0;
+      }
+      .name{
+        line-height: 24px;
+        color: #969696;
+        font-size: 15px;
+        width: max-content;
+        flex-shrink: 0;
+      }
+      a{
+        color: #088BFE;
+        font-size: 15px;
+      }
+    }
+    .arrow{
+      // align-items: center;
+      // display: flex;
+    }
+  }
+
+}
+.common-list{
+  .fixed-num{
+    padding: 8px 15px;
+    line-height: 20px;
+    span{
+      color: #EB5953 ;
     }
   }
 }

+ 1 - 1
src/components/vant/CommonTab.vue

@@ -2,7 +2,7 @@
 
   <div>
     <van-tabs></van-tabs>
-    <van-tabs v-model:active="state.active" class="fixed w-full top-0"
+    <van-tabs v-model:active="state.active" class="fixed w-full top-0 z-10"
               swipeable animated
               @change="change">
       <van-tab v-for="(item,index) in state.tabList" :key="index" :title="`${item.name}${store.tabInfo.totalNumList[index] || ''}`" :name="item.deleted" title-style="font-weight:bold">

+ 15 - 0
src/js-pages/company-detail/FaLvFengXian/index.ts

@@ -7,6 +7,7 @@ export const FaLvFengXian: DemensionPagesInter = {
       routing: 'KaiTingGongGao',
       title: '开庭公告',
       tabs: 'deleted',
+      hasDetail: true,
       viewList: [
         {
           value: 'caseReason',
@@ -17,6 +18,20 @@ export const FaLvFengXian: DemensionPagesInter = {
           value: 'caseNo'
         },
         {
+          name: '上诉人/原告',
+          listVal: 'plaintiffInfo',
+          value: 'name',
+          companyId: 'litigantId',
+          companyName: 'name'
+        },
+        {
+          name: '被上诉人/被告',
+          listVal: 'defendantInfo',
+          value: 'name',
+          companyId: 'litigantId',
+          companyName: 'name'
+        },
+        {
           name: '开庭时间',
           value: 'startDate',
           valueType: 'date'

+ 8 - 1
src/js-pages/types.ts

@@ -13,6 +13,8 @@ export interface DemensionPagesListInter {
   code: string,
   routing: string,
   title: string,
+  //是否有详情页
+  hasDetail?: boolean
   viewList?: ViewListInter[],
   tabs?: 'deleted' | [],  //是否有tabs,历史列表deleted,普通tab传数组
   customRender?: any
@@ -24,6 +26,11 @@ export interface ViewListInter {
   name?: string,
   value: string,
   //类型 时间、标题
-  valueType?: 'date' | 'title'
+  valueType?: 'date' | 'title',
+  //数组字段名
+  listVal?: string,
+  //需要跳转企业详情的ID和Name
+  companyId?: string,
+  companyName?: string
 }
 

+ 2 - 1
src/plugins/vant.ts

@@ -1,4 +1,4 @@
-import { Button, Row, Tab, Tabs, List } from 'vant'
+import { Button, Row, Tab, Tabs, List, Icon } from 'vant'
 import { App } from 'vue'
 
 export const useVant = (app: App<Element>) => {
@@ -7,5 +7,6 @@ export const useVant = (app: App<Element>) => {
   app.use(Tab)
   app.use(Tabs)
   app.use(List)
+  app.use(Icon)
 
 }

+ 4 - 3
src/store/demension.ts

@@ -46,11 +46,12 @@ export const useDemensionStore = defineStore({
 
     //有历史tab页的请求,自定义请求获取额外数据
     async getDeletedList() {
-      const totalNum1 = await (await this.getList()).totalNum
       this.deleted = 1
-      const totalNum2 = await (await this.getList()).totalNum
+      const totalNum1 = await (await this.getList()).totalNum
+      this.dataList = []
       this.deleted = 0
-      this.tabInfo.totalNumList = [totalNum1, totalNum2]
+      const totalNum2 = await (await this.getList()).totalNum
+      this.tabInfo.totalNumList = [totalNum2, totalNum1]
       // console.log()
     },
     async getList(extraParams?: {}) {

+ 11 - 0
src/utils/utils.ts

@@ -0,0 +1,11 @@
+/*
+ * @Author: 文帅
+ * @Date: 2022-03-14 16:09:28
+ * @LastEditTime: 2022-03-14 16:10:48
+ * @LastEditors: 文帅
+ * @Description:
+ */
+
+export const $goCompany = (companyName: string, companyId: string) => {
+  console.log(companyName, companyId)
+}

+ 0 - 2
src/views/demension/list.vue

@@ -1,7 +1,6 @@
 <template>
   <div class="page">
     <!-- <List /> -->
-    <!-- fdsfsd -->
     <CommonTab></CommonTab>
     <CommonList></CommonList>
   </div>
@@ -10,7 +9,6 @@
 <script lang="ts" setup>
   import CommonList from '@/components/CommonList.vue'
   import CommonTab from '@/components/vant/CommonTab.vue'
-  // import routerMatch from '@/hooks/routerMatch'
   import { useDemensionStore } from '@/store/demension'
   const store = useDemensionStore()
   store.getDemension()