From b613bb368d4e678b42d25e94397d0aab3e213438 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期三, 25 二月 2026 09:41:01 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 mini-program/pages/my-collection/my-collection.vue |  120 +++++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 87 insertions(+), 33 deletions(-)

diff --git a/mini-program/pages/my-collection/my-collection.vue b/mini-program/pages/my-collection/my-collection.vue
index c8898ec..5a0c510 100644
--- a/mini-program/pages/my-collection/my-collection.vue
+++ b/mini-program/pages/my-collection/my-collection.vue
@@ -1,65 +1,68 @@
 <template>
 	<view class="box">
 		<view class="cate">
-			<view v-for="(item, index) in cate" :key="index" @click="i = index" :class="i === index ? 'cate-item active' : 'cate-item'">
-				<text>{{item}}</text>
-				<view class="cate-item-x" v-if="i === index"></view>
+			<view v-for="(item, index) in cate" :key="index" @click="changeRow(item.id)" :class="type === item.id ? 'cate-item active' : 'cate-item'">
+				<text>{{item.name}}</text>
+				<view class="cate-item-x" v-if="type === item.id"></view>
 			</view>
-			<view class="cate-item" style="flex: 0.7; justify-content: flex-end; padding-right: 30rpx; box-sizing: border-box;">
-				<image src="/static/icon/ic_guanli@2x.png" mode="widthFix"></image>
-				<text class="wz">绠$悊</text>
+			<view class="cate-item" style="flex: 0.7; justify-content: flex-end; padding-right: 30rpx; box-sizing: border-box;" @click="edit = !edit">
+				<image src="/static/icon/ic_guanli@2x.png" mode="widthFix" v-show="!edit"></image>
+				<image src="/static/icon/ic_guanli_sel@2x.png" mode="widthFix" v-show="edit"></image>
+				<text class="wz" :style="{ color: edit ? '#004096' : '' }">绠$悊</text>
 			</view>
 		</view>
-		<!-- <view class="list1">
-			<view class="list-item">
-				<view class="left">
+		<view class="list1" v-if="type === '1'">
+			<view class="list-item" v-for="(item, index) in list" :key="index">
+				<view class="left" v-if="edit">
 					<image src="/static/icon/ic_agree@2x.png" mode="widthFix"></image>
 				</view>
 				<view class="right">
 					<view class="list-item-image">
-						<image src="/static/logo.png" mode="widthFix"></image>
+						<image :src="item.imgurl" mode="widthFix"></image>
 					</view>
 					<view class="list-item-info">
-						<view class="list-item-info-top">鏇茶酱鍑忛渿鍣ㄧ毊甯﹁疆A12</view>
+						<view class="list-item-info-top">{{item.name}}</view>
 						<view class="list-item-info-bottom">
-							<text>楼398.00</text>
-							<text>楼498.00</text>
+							<text>楼{{item.price}}</text>
+							<text>楼{{item.linePrice}}</text>
 						</view>
 					</view>
 				</view>
 			</view>
-		</view> -->
-		<view class="list">
-			<view class="list-item" v-for="(item, index) in 5" :key="index">
+		</view>
+		<view class="list" v-else>
+			<view class="list-item" v-for="(item, index) in list" :key="index">
 				<view class="info">
-					<view class="check">
+					<view class="check" v-if="edit">
 						<image src="/static/icon/ic_agree@2x.png" mode="widthFix"></image>
 					</view>
 					<view class="info-right">
-						<view class="info-title">鎸栨帢鏈哄湪鍐璧峰姩涓轰粈涔堝洶闅撅紵</view>
-						<view class="info-desc">鎸栨帢鏈哄湪鍐璧峰姩涓轰粈涔堝洶闅撅紵涓嶄粎鍐冲畾浜庢湰韬殑鎶�鏈姸鍐碉紝杩樺彈澶栫晫姘旀俯鐨勫奖鍝�</view>
+						<view class="info-title">{{item.name}}</view>
+						<view class="info-desc">{{item.remark}}</view>
 						<view class="info-data">
-							<view class="tips">缁翠慨</view>
-							<text>100 闃呰锝�2025-10-10 21:00</text>
+							<view class="tips">{{item.labelName}}</view>
+							<text>{{item.readNum}} 闃呰锝渰{item.createDate}}</text>
 						</view>
 					</view>
 				</view>
 				<view class="image">
-					<image src="/static/logo.png" mode="widthFix"></image>
+					<image :src="item.imgurl" mode="widthFix"></image>
 				</view>
 			</view>
 		</view>
-		<view style="width: 100%; height: calc(100rpx + env(safe-area-inset-bottom));"></view>
-		<view class="footer">
-			<view class="caozuo">
-				<view class="caozuo-left">
-					<image src="/static/icon/ic_agree@2x.png" mode="widthFix"></image>
-					<text>鍏ㄩ��</text>
+		<template v-if="edit">
+			<view style="width: 100%; height: calc(100rpx + env(safe-area-inset-bottom));"></view>
+			<view class="footer">
+				<view class="caozuo">
+					<view class="caozuo-left">
+						<image src="/static/icon/ic_agree@2x.png" mode="widthFix"></image>
+						<text>鍏ㄩ��</text>
+					</view>
+					<view class="caozuo-btn">鍒犻櫎(0)</view>
 				</view>
-				<view class="caozuo-btn">鍒犻櫎(0)</view>
+				<view style="width: 100%; height: env(safe-area-inset-bottom);"></view>
 			</view>
-			<view style="width: 100%; height: env(safe-area-inset-bottom);"></view>
-		</view>
+		</template>
 	</view>
 </template>
 
@@ -67,9 +70,60 @@
 	export default {
 		data() {
 			return {
-				i: 0,
-				cate: ['鍟嗗搧(12)', '鏂囩珷(5)']
+				edit: false,
+				type: '1',
+				page: 1,
+				list: [],
+				next: true,
+				cate: [
+					{ name: '鍟嗗搧锛�0锛�', id: '1' },
+					{ name: '鏂囩珷锛�0锛�', id: '0' }
+				]
 			};
+		},
+		onLoad() {
+			this.getList()
+			this.getNum()
+		},
+		onReachBottom() {
+			this.getList()
+		},
+		methods: {
+			changeRow(id) {
+				this.type = id
+				this.page = 1
+				this.list = []
+				this.next = true
+				this.getList()
+			},
+			getNum() {
+				this.$u.api.getCollectNum({})
+					.then(res => {
+						if (res.code === 200) {
+							this.cate[0].name = `鍟嗗搧锛�${res.data.goodsNum}锛塦
+							this.cate[1].name = `鏂囩珷锛�${res.data.activityNum}锛塦
+						}
+					})
+			},
+			getList() {
+				if (!this.next) return
+				this.$u.api.myCollectPage({
+					capacity: 10,
+					page: 1,
+					model: {
+						objType: this.type
+					}
+				}).then(res => {
+					if (res.code === 200) {
+						console.log(res)
+						this.page++
+						this.list.push(...res.data.records)
+						if (res.data.total === this.list.length) {
+							this.next = false
+						}
+					}
+				})
+			}
 		}
 	}
 </script>

--
Gitblit v1.9.3