Jing-Jiu 4 년 전
부모
커밋
60e74a19b5
2개의 변경된 파일60개의 추가작업 그리고 22개의 파일을 삭제
  1. 2 2
      components/foot-tabs/footTabs.vue
  2. 58 20
      pages/selfCenter/collection.vue

+ 2 - 2
components/foot-tabs/footTabs.vue

@@ -57,13 +57,13 @@ export default {
           pagePath: "/pages/index/index",
           iconPath: "/static/tabbar/home-select.png",
           selectedIconPath: "/static/tabbar/home-selected.png",
-          text: "页",
+          text: "锟斤拷页",
         },
         {
           pagePath: "/pages/selfCenter/index",
           iconPath: "/static/tabbar/user-select.png",
           selectedIconPath: "/static/tabbar/user-selected.png",
-          text: "我的",
+          text: "锟揭碉拷",
         },
       ],
     };

+ 58 - 20
pages/selfCenter/collection.vue

@@ -24,17 +24,9 @@
               {{ item.title }}
             </p>
             <view class="policy-content-item-left-time">
-              <p class="moment">{{ item.publish_time | globalTime }}</p>
-              <p class="maxMony">{{ item.project_money }}</p>
-              <p class="leftDay">
-                <!-- {{ item.project_end_date | globalTime || "长期可申报" }} -->
-                {{ "长期可申报" }}
-              </p>
+              <p class="moment">收藏时间: {{ item.time | globalTime }}</p>
             </view>
           </view>
-          <view class="policy-content-item-img">
-            <image :src="item.pic_url" alt="" />
-          </view>
         </view>
       </view>
       <view class="companys" v-if="active == 1">
@@ -77,20 +69,14 @@
 </template>
 
 <script>
+import md5 from "@/common/md5.js";
 export default {
   data() {
     return {
       titleList: ["政策", "企业"],
       active: 0,
       searchVal: "",
-      policyData: new Array(5).fill({
-        title:
-          "工业金额信息化部办公厅 组织开2021念工业互联网平台创新互联网工业文化产业项目征集工作。",
-        moment: "2021-07-12",
-        maxMony: "最高500.00万",
-        leftDay: "剩5天",
-        img: "/static/policy/u388.jpg",
-      }),
+      policyData: [],
       companyList: new Array(5).fill({
         logo: "/static/enterprise/logo.png",
         name: "康拓科技有限责任公司",
@@ -102,7 +88,9 @@ export default {
       }),
     };
   },
-  onLoad() {},
+  onLoad() {
+    this.getCollection();
+  },
   methods: {
     toDetail(index) {
       uni.navigateTo({
@@ -114,6 +102,56 @@ export default {
         url: "/pages/policy/policy_deatil?id=" + id,
       });
     },
+    getCollection() {
+      let md5Sign = md5(
+        "method=" +
+          "user" +
+          "&timestamp=" +
+          getApp().globalData.globalTimestamp +
+          "&secret=" +
+          getApp().globalData.secret
+      );
+      let url =
+        getApp().globalData.shareUrl +
+        "api/api.php" +
+        "?method=user&action=collect_list&timestamp=" +
+        getApp().globalData.globalTimestamp +
+        "&sign=" +
+        md5Sign;
+      let postData = {
+        page: 1,
+        page_size: 5,
+        openId: getApp().globalData.open_id,
+      };
+      uni.request({
+        url: url,
+        method: "POST",
+        header: {
+          "content-type": "application/x-www-form-urlencoded",
+        },
+        data: postData,
+        success: (res) => {
+          console.log(res);
+          if (res.data.code === 200) {
+            let list = res.data.data.list;
+            this.policyData = list.map((item) => {
+              let ob = {
+                title: "",
+                time: "",
+                id: "",
+              };
+              ob.title = item.source_title;
+              ob.time = item.addtime;
+              ob.id = item.id;
+              return ob;
+            });
+          }
+        },
+        fail: () => {
+          console.log("连接失败");
+        },
+      });
+    },
   },
 };
 </script>
@@ -225,7 +263,7 @@ export default {
           line-clamp: 2;
           -webkit-box-orient: vertical;
           font-size: 25rpx;
-          margin-bottom: 10rpx;
+          margin-bottom: 2rpx;
         }
         .policy-content-item-left-time {
           width: 100%;
@@ -311,4 +349,4 @@ export default {
     }
   }
 }
-</style>
+</style>