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