From 0e8fc589f7896b836dc4dab59424debe58848218 Mon Sep 17 00:00:00 2001
From: wangzimeng <3297159934@qq.com>
Date: Fri, 1 Aug 2025 17:30:25 +0800
Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=B9=B3=E5=8F=B0=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E7=9A=84=E6=94=B6=E8=97=8F=E5=8A=9F=E8=83=BD=202=E3=80=81?=
=?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=E7=9A=84=E6=94=B6=E8=97=8F?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4+?=
=?UTF-8?q?=E6=94=B6=E8=97=8F=E6=8C=89=E9=92=AE=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/canteenRent/rentDetail.vue | 10 +-
pages/user/goods-collect.vue | 216 ++++++++++++++++++++++++-------
2 files changed, 178 insertions(+), 48 deletions(-)
diff --git a/pages/canteenRent/rentDetail.vue b/pages/canteenRent/rentDetail.vue
index 9318f58..33ba1ba 100644
--- a/pages/canteenRent/rentDetail.vue
+++ b/pages/canteenRent/rentDetail.vue
@@ -240,7 +240,10 @@
icon:'none',
duration: 2000
})
- getDetail()
+ setTimeout(() =>{
+ getDetail()
+ },1000)
+ // getDetail()
}
})
@@ -258,7 +261,10 @@
icon:'none',
duration: 2000
})
- getDetail()
+ setTimeout(() =>{
+ getDetail()
+ },1000)
+ // getDetail()
}
})
diff --git a/pages/user/goods-collect.vue b/pages/user/goods-collect.vue
index 53dbd89..61bf9b4 100644
--- a/pages/user/goods-collect.vue
+++ b/pages/user/goods-collect.vue
@@ -25,35 +25,34 @@
{{item.platform_title}}
-
+
- {{e}}
+ {{e}}
-
-
-
+
-
-
- {{item.address_city_text}}
-
+
+ {{item.address_city_text}}
-
-
-
- 取消收藏
-
+
+
+
+
+
+ 取消收藏
+ 收藏
+
@@ -62,29 +61,22 @@
-
-
-
+
+
+
{{item.title}}
-
+
取消收藏
+
+ 收藏
+
-
@@ -166,8 +158,10 @@
currentTab.value = e.index
console.log('切换tabs', currentTab.value);
if (currentTab.value == 0) {
+ collectRentList.value = [];
getRentList();
} else {
+ collectSchoolList.value = [];
getSchoolList();
}
}
@@ -180,7 +174,6 @@
limit: listQuery.value.limit,
order: 'normal',
status: 1,
- recommend: 1,
collect: 1,
});
@@ -206,7 +199,6 @@
page: listQuery.value.schoolPage,
limit: listQuery.value.limit,
order: 'normal',
- recommend: 1,
collect: 1,
});
@@ -272,6 +264,78 @@
}
}
+ //招租收藏
+ function rentColect(item, index) {
+ console.log('收藏', item.is_collect);
+ if (item.is_collect == 1) {
+ collectRentList.value[index].is_collect = 0
+ const data = {
+ id: item.id,
+ is_collect: item.is_collect
+ }
+ sheep.$api.rent.rentCollect(data).then((res) => {
+ if (res.code == 1) {
+ uni.showToast({
+ title: '已取消收藏',
+ icon: 'none',
+ duration: 2000
+ })
+ }
+ })
+ } else {
+ collectRentList.value[index].is_collect = 1
+ const data1 = {
+ id: item.id,
+ is_collect: item.is_collect
+ }
+ sheep.$api.rent.rentCollect(data1).then((res) => {
+ if (res.code == 1) {
+ uni.showToast({
+ title: '已收藏',
+ icon: 'none',
+ duration: 2000
+ })
+ }
+ })
+ }
+ }
+
+ //课程收藏
+ function classCollect(item,index) {
+ console.log('收藏', item.is_collect);
+ if (item.is_collect == 1) {
+ collectSchoolList.value[index].is_collect = 0
+ const data = {
+ id: item.id,
+ is_collect: item.is_collect
+ }
+ sheep.$api.school.classesCollect(data).then((res) => {
+ if(res.code == 1) {
+ uni.showToast({
+ title:'已取消收藏',
+ icon:'none',
+ duration: 2000,
+ })
+ }
+ })
+ } else {
+ collectSchoolList.value[index].is_collect = 1
+ const data1 = {
+ id: item.id,
+ is_collect: item.is_collect
+ }
+ sheep.$api.school.classesCollect(data1).then((res) => {
+ if(res.code == 1) {
+ uni.showToast({
+ title:'已收藏',
+ icon:'none',
+ duration: 2000,
+ })
+ }
+ })
+ }
+ }
+
onReachBottom(() => {});
onLoad(() => {
getRentList();
@@ -319,17 +383,15 @@
// background-color: #ffffff;
.recommend-box {
- margin-top: 30rpx;
- padding: 20rpx 30rpx;
+ padding: 0rpx 30rpx;
.rrecommList {
margin-top: 30rpx;
- // padding: 30rpx;
.reListItem {
background-color: #ffffff;
width: 640rpx;
- height: 190rpx;
+ // height: 190rpx auto;
padding: 30rpx;
display: flex;
justify-content: flex-start;
@@ -352,15 +414,24 @@
}
.listItem-contents {
+ width: 300rpx;
+ height: auto;
margin-left: 20rpx;
.score-box {
+ // width: 300rpx;
display: flex;
.cate {
+ width: 300rpx;
+ height: 190rpx auto;
display: flex;
justify-content: flex-start;
align-items: center;
+ white-space: nowrap;
+ /* 禁止换行 */
+ overflow: hidden;
+ /* 超出部分隐藏 */
.cate-e {
@@ -371,15 +442,41 @@
font-weight: 400;
line-height: 22rpx;
background-color: rgba(247, 97, 0, 0.2);
-
- // opacity: 0.2;
+ width: 107rpx;
+ height: 36rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
color: #F76100;
- //flex-shrink: 0
}
}
}
+ .cate-e {
+ width: 300rpx;
+ height: 190rpx auto;
+ display: flex;
+ justify-content: flex-start;
+ align-items: center;
+ overflow-wrap: break-word;
+ word-break: break-word;
+ white-space: normal;
+ .status-tag {
+ // padding: 5rpx 15rpx;
+ border-radius: 5rpx;
+ font-size: 22rpx;
+ font-weight: 400;
+ line-height: 22rpx;
+ background-color: rgba(247, 97, 0, 0.2);
+ width: 107rpx;
+ height: 36rpx;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ color: #F76100;
+ }
+ }
}
@@ -387,7 +484,7 @@
.cons-third {
margin-top: 20rpx;
display: flex;
- justify-content: space-around;
+ justify-content: flex-start;
align-items: center;
}
}
@@ -399,24 +496,34 @@
.exChangeBox {
- background-color: #ffffff;
+ // background-color: #ffffff;
width: 690rpx;
+ margin: 0 auto;
.couponsList {
width: 100%;
- padding: 0 30rpx;
+ // padding: 0 30rpx;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 20rpx;
box-sizing: border-box;
+ margin-top: 30rpx;
+
.list-item {
width: 330rpx;
border-radius: 18rpx;
box-shadow: 4rpx 4rpx 4rpx 4rpx rgba(153, 153, 153, 0.1);
+ background-color: #ffffff;
.item-text {
padding: 30rpx;
+ display: flex;
+ flex-direction: column;
+ height: 212rpx;
+ /* 确保 item-text 填满父容器的高度 */
+ justify-content: space-between;
+ /* 将内容分散对齐,顶部和底部 */
.exchangeBtn {
margin-top: 30rpx;
@@ -433,6 +540,23 @@
line-height: 30rpx;
font-weight: 400;
}
+
+ .exchangeBtn1 {
+ margin-top: 30rpx;
+ background-color: #fcc74e;
+ // border: 2rpx solid #999999;
+ height: 70rpx;
+ width: 270rpx;
+ border-radius: 223rpx;
+ align-items: center;
+ justify-content: center;
+ display: flex;
+ color: #333333;
+ font-size: 28rpx;
+ line-height: 30rpx;
+ font-weight: 400;
+ }
+
}
}