From 450e9603b55e8d373f09148dec958ea29a1eb359 Mon Sep 17 00:00:00 2001
From: Fox-33 <1466778434@qq.com>
Date: Wed, 27 Aug 2025 17:35:24 +0800
Subject: [PATCH] feat: page-collect;
---
components/product/productCard.vue | 36 +++++++++++++++++++---------
pages_order/auth/wxUserInfo.vue | 2 +-
pages_order/partner/team.vue | 3 ++-
pages_order/partner/withdraw.vue | 2 +-
pages_order/product/collectList.vue | 48 +++++++++++++++++++++++++++++++++++++
uni.scss | 2 +-
6 files changed, 78 insertions(+), 15 deletions(-)
create mode 100644 pages_order/product/collectList.vue
diff --git a/components/product/productCard.vue b/components/product/productCard.vue
index 4248a2e..2891a94 100644
--- a/components/product/productCard.vue
+++ b/components/product/productCard.vue
@@ -35,7 +35,7 @@
@click.stop="onCollect"
@touchstart.stop="() => {}"
>
- 收藏
+ {{ isCollected ? '移除收藏' : '收藏' }}
@@ -48,6 +48,10 @@
default() {
return {}
}
+ },
+ isCollected: {
+ type: Boolean,
+ default: false,
}
},
data() {
@@ -65,13 +69,16 @@
return (this.data.currentPrice % this.priceInt).toFixed(2).slice(1)
},
collectBtnStyle() {
- let display = Math.ceil(this.displayX / 56 * 100)
+ const width = this.isCollected ? 80 : 56
+ const background = this.isCollected ? '#26334E' : '#FF9035'
+
+ let display = Math.ceil(this.displayX / this.collectBtnWidth * 100)
display > 100 && (display = 100)
const translateX = 100 - display
- return `transform: translateX(${translateX}%);`
+ return `width: ${width}px; transform: translateX(${translateX}%); background: ${background};`
}
},
methods: {
@@ -108,13 +115,20 @@
},
onCollect() {
console.log('onCollect')
-
- // todo: fetch collect
- uni.showToast({
- icon: 'success',
- title: '已收藏',
- });
+ if (this.isCollected) {
+ // todo: fetch cancel collect
+ uni.showToast({
+ icon: 'success',
+ title: '已移除收藏',
+ });
+ } else {
+ // todo: fetch collect
+ uni.showToast({
+ icon: 'success',
+ title: '已收藏',
+ });
+ }
this.hiddenCollectBtn()
},
onRegistrate() {
@@ -216,12 +230,12 @@
top: 0;
right: 0;
row-gap: 8rpx;
- width: 112rpx;
+ // width: 112rpx;
height: 100%;
font-size: 24rpx;
line-height: 1;
color: #FFFFFF;
- background: #FF9035;
+ // background: #FF9035;
}
\ No newline at end of file
diff --git a/pages_order/auth/wxUserInfo.vue b/pages_order/auth/wxUserInfo.vue
index fa57642..463a6fe 100644
--- a/pages_order/auth/wxUserInfo.vue
+++ b/pages_order/auth/wxUserInfo.vue
@@ -202,7 +202,7 @@
.page__view {
width: 100vw;
min-height: 100vh;
- background: unset;
+ background: $uni-bg-color;
position: relative;
/deep/ .nav-bar__view {
diff --git a/pages_order/partner/team.vue b/pages_order/partner/team.vue
index a05f0f5..66e6f2c 100644
--- a/pages_order/partner/team.vue
+++ b/pages_order/partner/team.vue
@@ -1,7 +1,7 @@
-
+
@@ -57,6 +57,7 @@
{ name: '直推用户列表' },
{ name: '间推用户列表' },
],
+ // todo
mixinsListApi: '',
current: 0,
}
diff --git a/pages_order/partner/withdraw.vue b/pages_order/partner/withdraw.vue
index 6062fab..27def59 100644
--- a/pages_order/partner/withdraw.vue
+++ b/pages_order/partner/withdraw.vue
@@ -118,7 +118,7 @@
.page__view {
width: 100vw;
min-height: 100vh;
- background: unset;
+ background: $uni-bg-color;
position: relative;
/deep/ .nav-bar__view {
diff --git a/pages_order/product/collectList.vue b/pages_order/product/collectList.vue
new file mode 100644
index 0000000..cfc97cb
--- /dev/null
+++ b/pages_order/product/collectList.vue
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/uni.scss b/uni.scss
index 9431c3f..dd726ea 100644
--- a/uni.scss
+++ b/uni.scss
@@ -30,7 +30,7 @@ $uni-text-color-disable:#c0c0c0;
/* 背景颜色 */
$uni-fg-color:#ffffff;
-$uni-bg-color: #E5F2F9;
+$uni-bg-color: #F2F2F2;
$uni-bg-color-grey:#F4F4F4;
$uni-bg-color-hover:#f1f1f1;//点击状态颜色
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色