瀏覽代碼

feat: policy data format

jiangzixin 1 年之前
父節點
當前提交
b30a7a2fe8
共有 2 個文件被更改,包括 9 次插入11 次删除
  1. 1 1
      uniapp/pages/policy/index.vue
  2. 8 10
      uniapp/pages/policy/list.vue

+ 1 - 1
uniapp/pages/policy/index.vue

@@ -510,7 +510,7 @@
                     } = await submitSurvey(this.survey);
                     if (status == 1) {
                         uni.setStorageSync('policyList', data);
-                        uni.setStorageSync('policyCengci', cengci);
+                        // uni.setStorageSync('policyCengci', cengci);
                         uni.navigateTo({
                             url: '/pages/policy/list',
                         })

+ 8 - 10
uniapp/pages/policy/list.vue

@@ -7,7 +7,7 @@
         </view>
         <!-- 搜索 -->
         <view class="content">
-            <block v-if="policyCengci.length > 0">
+            <block v-if="policyList.length > 0">
                 <view class="flex row-center white lg bold">
                     <u-icon name="checkmark-circle-fill" size="48"></u-icon>
                     <view class="m-l-12">匹配成功</view>
@@ -18,29 +18,29 @@
                     <view class="list">
                         <view class="bg-white p-t-18 p-l-24 p-r-24 p-b-34">
                             <!-- 人才层次标签 -->
-                            <u-tabs :list="policyCengci" name="level" :is-scroll="true" :current="currentTab"
+                            <u-tabs :list="policyList" name="level" :is-scroll="true" :current="currentTab"
                                 :bold="true" active-color="#DD4250" height="80" bar-width="80" font-size="32"
                                 @change="changeTab" />
                             <view class="p-15 m-t-20" style="border: 1px solid #DD4250;box-shadow: 0px 3px 6px 1px rgba(243,113,113,0.39);border-radius: 9px;">
                                 <view class="bold">您可能符合的认定条款:</view>
                                 <view class="m-t-10 primary bold">
-                                    <rich-text :nodes="policyCengci[currentTab].title"></rich-text>
+                                    <rich-text :nodes="policyList[currentTab].title"></rich-text>
                                 </view>
-								<view class="m-t-10 tips" v-if="policyCengci[currentTab].content.length > 0">
-									<rich-text :nodes="policyCengci[currentTab].content"></rich-text>
+								<view class="m-t-10 tips" v-if="policyList[currentTab].content">
+									<rich-text :nodes="policyList[currentTab].content"></rich-text>
 								</view>
                             </view>
                             <!-- 政策列表 -->
                             <view class="flex flex-wrap m-t-30">
                                 <view class="tag-item" :class="{ 'tat-active': activeIndex == index }"
-                                    v-for="(item, index) in  policyList" :key="index" @tap="changeTag(index)">
+                                    v-for="(item, index) in  policyList[currentTab].policy" :key="index" @tap="changeTag(index)">
                                     {{ item.title }}
                                 </view>
                             </view>
-                            <view v-for="(item, index) in policyList" :key="index" v-if="activeIndex == index">
+                            <view v-for="(item, index) in policyList[currentTab].policy" :key="index" v-if="activeIndex == index">
 
                                 <!-- <view class="detail">{{ item.content }}</view> -->
-                                <rich-text :nodes="item.content"></rich-text>
+                                <rich-text :nodes="item.summary"></rich-text>
                                 <view class="flex row-center">
                                     <view class="user-logout flex col-center row-center white" @tap="goDetail(item)">
                                         <view class="m-r-12">查看“{{ item.title }}”详情</view>
@@ -79,13 +79,11 @@
             return {
                 activeIndex: 0,
                 policyList: [],
-                policyCengci: [],
                 currentTab: 0,
             }
         },
         onLoad(option) {
             this.policyList = uni.getStorageSync('policyList');
-            this.policyCengci = uni.getStorageSync('policyCengci');
         },
         onShow() {
             // this.getHomeFun();