From beae656b469ae67cf00134e43b25673a4bacae29 Mon Sep 17 00:00:00 2001 From: wangzimeng <3297159934@qq.com> Date: Fri, 1 Aug 2025 15:32:08 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E9=A3=9F=E5=A0=82=E6=8B=9B=E7=A7=9F?= =?UTF-8?q?=E7=9A=84=E6=94=B6=E8=97=8F=E5=92=8C=E5=8F=96=E6=B6=88=E6=94=B6?= =?UTF-8?q?=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/canteenRent/rentDetail.vue | 41 +++++++++++++++++++++++++------- sheep/api/rent.js | 9 ++++++- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/pages/canteenRent/rentDetail.vue b/pages/canteenRent/rentDetail.vue index b61efdc..9318f58 100644 --- a/pages/canteenRent/rentDetail.vue +++ b/pages/canteenRent/rentDetail.vue @@ -229,17 +229,42 @@ console.log('收藏',detailRent.value.is_collect); if(detailRent.value.is_collect == 1) { detailRent.value.is_collect = 0 - uni.showToast({ - title:'已取消收藏', - icon:'none' + 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', + duration: 2000 + }) + getDetail() + } }) + + }else { detailRent.value.is_collect = 1 - uni.showToast({ - title:'已收藏', - icon:'none' + 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', + 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; diff --git a/sheep/api/rent.js b/sheep/api/rent.js index b7d9142..4b58be8 100644 --- a/sheep/api/rent.js +++ b/sheep/api/rent.js @@ -83,5 +83,12 @@ export default { request({ url: 'meal.auth/info', method: 'GET', - }) + }), + //收藏 + rentCollect: (data) => + request({ + url: 'meal.information/collect', + method: 'POST', + data, + }), }; \ No newline at end of file