1、食堂招租的收藏和取消收藏

This commit is contained in:
wangzimeng 2025-08-01 15:32:08 +08:00
parent 211d8853f6
commit beae656b46
2 changed files with 41 additions and 9 deletions

View File

@ -229,17 +229,42 @@
console.log('收藏',detailRent.value.is_collect);
if(detailRent.value.is_collect == 1) {
detailRent.value.is_collect = 0
const data = {
id: detailRent.value.id,
is_collect: detailRent.value.is_collect
}
sheep.$api.rent.rentCollect(data).then((res) => {
if(res.code == 1) {
uni.showToast({
title:'已取消收藏',
icon:'none'
icon:'none',
duration: 2000
})
getDetail()
}
})
}else {
detailRent.value.is_collect = 1
const data1 = {
id: detailRent.value.id,
is_collect: detailRent.value.is_collect
}
sheep.$api.rent.rentCollect(data1).then((res) => {
if(res.code == 1) {
uni.showToast({
title:'已收藏',
icon:'none'
icon:'none',
duration: 2000
})
getDetail()
}
})
}
}
//
@ -501,8 +526,8 @@
.footer-box {
width: 100%;
height: 98rpx;
padding-bottom: 30rpx;
height: 120rpx;
padding-bottom: 0rpx;
box-sizing: border-box;
position: fixed;
bottom: 5rpx;

View File

@ -83,5 +83,12 @@ export default {
request({
url: 'meal.auth/info',
method: 'GET',
})
}),
//收藏
rentCollect: (data) =>
request({
url: 'meal.information/collect',
method: 'POST',
data,
}),
};