From 01776e495bbd3f693ab2677f793a54e62f91a57b Mon Sep 17 00:00:00 2001 From: wangzimeng <3297159934@qq.com> Date: Sat, 26 Jul 2025 11:59:37 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=8B=9B=E7=A7=9F=E8=AF=A6=E6=83=85?= =?UTF-8?q?=EF=BC=9A=E8=BF=94=E5=9B=9E=E9=A6=96=E9=A1=B5=E3=80=81=E6=94=B6?= =?UTF-8?q?=E8=97=8F=E7=9A=84=E5=8A=9F=E8=83=BD=E5=AE=9E=E7=8E=B0=EF=BC=8C?= =?UTF-8?q?=E5=92=8C=E7=AB=8B=E5=8D=B3=E8=81=94=E7=B3=BB=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/canteenRent/rentDetail.vue | 169 ++++++++++++++++++++++++++++--- sheep/api/rent.js | 22 ++-- 2 files changed, 170 insertions(+), 21 deletions(-) diff --git a/pages/canteenRent/rentDetail.vue b/pages/canteenRent/rentDetail.vue index 408b895..82b7518 100644 --- a/pages/canteenRent/rentDetail.vue +++ b/pages/canteenRent/rentDetail.vue @@ -92,21 +92,21 @@ - + 首页 - + 分享 - + 收藏 - + 客服 @@ -120,17 +120,28 @@ - - 确认拨号 - 剩余联系次数:detailRent.all_mobile_num + + 确认拨号 + 剩余联系次数:{{detailRent.all_mobile_num}} + + + 取消 + 确定 - - + + + 非常抱歉 + 你的联系次数不足请前往积分商城兑换 + + + 取消 + 去兑换 + @@ -158,6 +169,7 @@ } from '@/sheep/validate/form'; import rent from '../../sheep/api/rent'; import sheep from '@/sheep'; + import { showShareModal } from '@/sheep/hooks/useModal'; const rentId = ref(''); const detailRent = ref('') @@ -172,6 +184,12 @@ getDetail(); } }) + + onShow(() => { + if (rentId.value) { + getDetail(); + } + }) async function getDetail() { const res = await sheep.$api.rent.rentInfo(rentId.value) @@ -192,6 +210,44 @@ } } + //返回首页 + function backHome() { + uni.switchTab({ + url: '/pages/index/index' + }) + } + + //页面跳转 + const toPage = (e) => { + uni.navigateTo({ + url: e + }) + } + + //收藏 + function handleColect() { + console.log('收藏',detailRent.value.is_collect); + if(detailRent.value.is_collect == 1) { + detailRent.value.is_collect = 0 + uni.showToast({ + title:'已取消收藏', + icon:'none' + }) + }else { + detailRent.value.is_collect = 1 + uni.showToast({ + title:'已收藏', + icon:'none' + }) + // setTimeout(() => { + // uni.showToast({ + // title:'已收藏', + // icon:'none' + // }) + // }, 1000) + } + } + //是否拨打电话的次数 function handleJuage() { console.log('拨打电话次数:',detailRent.value.all_mobile_num); @@ -201,6 +257,36 @@ showContactNo.value = true } } + const phoneTell = ref() + //确定拨打电话 + async function handleTell() { + const res = await sheep.$api.rent.getPhoneNum({ + id:rentId.value + }) + console.log('获取电话',res); + if(res.code == 1) { + phoneTell.value = res.data.contact_number + showContacted.value = false + wx.makePhoneCall({ + phoneNumber: phoneTell.value, + success: function() { + console.log("拨打电话成功") + + }, + fail: function(err) { + console.log("拨打电话失败", err) + } + }) + } + } + //去兑换拨号次数 + function gotoExchange() { + showContactNo.value = false + uni.navigateTo({ + url: '/pages/app/score-shop' + }) + } +