jwyu 2 years ago
parent
commit
7910193404
4 changed files with 108 additions and 10 deletions
  1. 30 0
      api/user.js
  2. 53 0
      pages-user/myCollect.vue
  3. 14 7
      pages.json
  4. 11 3
      pages/user/user.vue

+ 30 - 0
api/user.js

@@ -69,4 +69,34 @@ export const apiLastApplyRecord=(params)=>{
  */
 export const apiSetMyinfo = params => {
 	return httpPost('/user/set',params)
+}
+
+/**
+ * 收藏
+ * @param collection_type 收藏类型:1-研报; 2-视频社区; 3-微路演视频
+ * @param primary_id //收藏类型主ID(如报告id,视频id)
+ * @param extend_id //扩展ID-如研报章节ID
+ * @param source_agent //操作来源:1-小程序 2-小程序 PC 3-弘则研究公众号 4-Web PC
+ */
+export const apiSetCollect=params=>{
+	return httpPost('/collection/collect',params)
+}
+
+/**
+ * 取消收藏
+ * @param collection_id 收藏ID
+ */
+export const apiCancelCollect=params=>{
+	return httpPost('/collection/cancel',params)
+}
+
+/**
+ * 我的收藏列表
+ * @param curr_page
+ * @param page_size
+ * @param keywords
+ * @param from_type 来源类型:0-全部; 1-研报; 2-线上路演; 3-视频社区
+ */
+export const apiMyCollectList=params=>{
+	return httpGet('/collection/list',params)
 }

+ 53 - 0
pages-user/myCollect.vue

@@ -0,0 +1,53 @@
+<template>
+    <view class="my-collect-page">
+        <view class="top-wrap">
+            <searchBox placeholder="搜索" />
+            <van-tabs :active="active" @change="onChange">
+                <van-tab title="标签 1">内容 1</van-tab>
+            </van-tabs>
+        </view>
+    </view>
+</template>
+
+<script>
+import searchBox from "@/components/searchBox/searchBox.vue";
+export default {
+    components: {
+        searchBox
+    },
+    data() {
+        return {
+            opts:[
+                {
+                    name:'全部',
+                    val:0,
+                },
+                {
+                    name:'研报',
+                    val:1,
+                },
+                {
+                    name:'线上路演',
+                    val:2,
+                },
+                {
+                    name:'视频社区',
+                    val:3,
+                },
+            ]
+        }
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.top-wrap{
+    position: sticky;
+    top: 0;
+    left: 0;
+    right: 0;
+    z-index: 50;
+    background-color: #fff;
+    padding-top: 20rpx;
+}
+</style>

+ 14 - 7
pages.json

@@ -154,13 +154,20 @@
 						"enablePullDownRefresh": true
 					}
 				},
-			   {
-			   	"path": "mysetting",
-			   	"style":{
-			   		"navigationBarTitleText": "我的设置"
-			   	}
-			   }
-      ]
+			   	{
+					"path": "mysetting",
+					"style":{
+						"navigationBarTitleText": "我的设置"
+					}
+				},
+				{
+					"path": "myCollect",
+					"style":{
+						"navigationBarTitleText": "我的收藏",
+						"enablePullDownRefresh": true
+					}
+				}
+      		]
 		},
 		// 图库模块
 		{

+ 11 - 3
pages/user/user.vue

@@ -47,7 +47,7 @@
 				</block>
 				
 				<view v-else class="right-text look" @click="handleToUserPermission">
-					<text>查看</text>
+					<!-- <text>查看</text> -->
 					<van-icon name="arrow"></van-icon>
 				</view>
 			</view>
@@ -57,7 +57,6 @@
 					<text class="unread-ico" v-if="userInfo.un_read">{{userInfo.un_read}}</text> 
 				</view>
 				<view class="right-text look" @click="toMessageHadle">
-					<text>查看</text>
 					<van-icon name="arrow"></van-icon>
 				</view>
 			</view>
@@ -77,7 +76,16 @@
 					<image src="../../static/voice/mine-voice-icon.png" mode="widthFix" />
 					<text class="label">我的语音</text>
 					<view class="right-text look">
-						<text>查看</text>
+						<van-icon name="arrow"></van-icon>
+					</view>
+				</view>
+				<view></view>
+			</navigator>
+			<navigator url="/pages-user/myCollect">
+				<view class="flex item-card">
+					<image src="../../static/voice/mine-voice-icon.png" mode="widthFix" />
+					<text class="label">我的收藏</text>
+					<view class="right-text look">
 						<van-icon name="arrow"></van-icon>
 					</view>
 				</view>