diff --git a/api/gift.js b/api/gift.js index 4098fb4..3bfe0c0 100644 --- a/api/gift.js +++ b/api/gift.js @@ -63,4 +63,19 @@ export function getGiftCardResend(data) { */ export function getGiftCardSendBackground(data) { return request.get("giftCard/giftCardBackgroundImage", data); -} \ No newline at end of file +} + +/** + * 创建团购礼品 + * @param {*} data + */ +export function createGroupBuyGift(data) { + return request.post("/travel/giftCardOrder/confirm", data); +} +/** + * 旅居团购礼品卡订单创建 + * @param {*} data + */ +export function createSojoumGroupBuyGift(key, data) { + return request.post("/travel/giftCardOrder/create/" + key, data); +} diff --git a/api/sojoumOrder.js b/api/sojoumOrder.js index 05e3e86..d65213c 100644 --- a/api/sojoumOrder.js +++ b/api/sojoumOrder.js @@ -27,7 +27,7 @@ export function sojoumOrderRefund(params) { * @returns */ export function sojoumOrderCheckInTime(params) { - return request.put("/travel/travelGroupOrder/changeDate", params, { + return request.post("/travel/travelGroupGiftCard/changeDate", params, { login: true }) } @@ -43,4 +43,15 @@ export function sojoumOrderCalendar(params) { return request.get("/travel/product/calendar", params, { login: true }) -} \ No newline at end of file +} + +/** + * 旅居团购订单退款信息 + * @param {*} params + * @returns + */ +export function sojoumOrderRefundInfo(params) { + return request.post("/travel/travelGroupOrder/refundInfo", params, { + login: true + }) +} diff --git a/pkg_product/components/Calendar.vue b/pkg_product/components/Calendar.vue index a929e26..783e17a 100644 --- a/pkg_product/components/Calendar.vue +++ b/pkg_product/components/Calendar.vue @@ -7,7 +7,6 @@ :maxRange="999" :defaultDate="defaultDate" :minDate="minDate" - :disabledDate="disabledDates" color="#C52733" @confirm="handleDateChange" @close="hideCalendar" @@ -111,10 +110,9 @@ export default { startDate: e[0], endDate: e[e.length - 1] } - // 如果选择的天数小于minDay,提示用户选择至少minDay天 - if (e.length < this.minDay) { + if (e.length !== this.minDay) { uni.showToast({ - title: `请选择至少${this.minDay}天`, + title: `团购天数必须为${this.minDay}天`, icon: 'none' }) this.resetSelection() diff --git a/pkg_product/views/groupBuyDetails.vue b/pkg_product/views/groupBuyDetails.vue index aaad125..f9fa9da 100644 --- a/pkg_product/views/groupBuyDetails.vue +++ b/pkg_product/views/groupBuyDetails.vue @@ -155,50 +155,7 @@ export default { giftBg: '', id: '', activePeriod: 0, - detail: { - title: '【正牌爆售】30天29晚臻享特色小院/庵食套餐', - price: 3888, - images: [ - 'https://cdn.jsdelivr.net/gh/trae-ai/assets-placeholder/hotel-1.jpg', - 'https://cdn.jsdelivr.net/gh/trae-ai/assets-placeholder/hotel-2.jpg', - 'https://cdn.jsdelivr.net/gh/trae-ai/assets-placeholder/hotel-3.jpg' - ], - periods: [ - { batch: 1, range: '6/13-6/15' }, - { batch: 2, range: '6/16-6/18' }, - { batch: 3, range: '6/19-6/21' }, - { batch: 4, range: '6/22-6/24' } - ], - combos: [ - { img: 'https://cdn.jsdelivr.net/gh/trae-ai/assets-placeholder/room-1.jpg', text: '温泉泡汤·双人早餐' }, - { img: 'https://cdn.jsdelivr.net/gh/trae-ai/assets-placeholder/room-2.jpg', text: '茶室体验·手作禅食' }, - { img: 'https://cdn.jsdelivr.net/gh/trae-ai/assets-placeholder/room-3.jpg', text: '山景露台·下午茶' }, - { img: 'https://cdn.jsdelivr.net/gh/trae-ai/assets-placeholder/room-4.jpg', text: '夜间电影·星空灯' }, - { img: 'https://cdn.jsdelivr.net/gh/trae-ai/assets-placeholder/room-5.jpg', text: '精品床品·加湿香氛' }, - { img: 'https://cdn.jsdelivr.net/gh/trae-ai/assets-placeholder/room-6.jpg', text: '小院烧烤·庭院篝火' } - ], - highlights: [ - '小院临海风光,步行可达观景台', - '馆内私厨,提供本地特色庵食', - '房间带露台,景观视野绝佳', - '每期限定名额,错峰享受更安静' - ], - rules: [ - '需至少提前3日预订,节假日价格略有浮动', - '不可与其他优惠同享;支持改期一次', - '如遇不可抗因素,支持无损退款', - '入住需持有效身份证件,遵守园区规定' - ], - fees: [ - { name: '下单即赠惊喜', value: '免费' }, - { name: '入住加床', value: 'x' }, - { name: '儿童入园', value: 'x' } - ], - gallery: [ - 'https://cdn.jsdelivr.net/gh/trae-ai/assets-placeholder/courtyard-1.jpg', - 'https://cdn.jsdelivr.net/gh/trae-ai/assets-placeholder/courtyard-2.jpg' - ] - }, + detail: {}, calendar: [], currentWeek: [], rules: "", @@ -223,6 +180,12 @@ export default { }) }, methods: { + toGift(){ + uni.navigateTo({ + // + '&couponId=' + coupId + url: '/pkg_user/views/gift/gift?cartId=' + this.id + '&isGroupBuy=1' + }) + }, handleDateSelected(dateRange) { console.log(dateRange, 'dateRange'); @@ -300,7 +263,25 @@ export default { }, contactService() { - uni.showToast({ title: '已为您接入管家', icon: 'none' }) + uni.showModal({ + title: '商家电话', + content: this.detail.phone || '暂无电话', + confirmText: '立即拨打', + cancelText: '取消', + success: (res) => { + if (res.confirm && this.detail.phone) { + uni.makePhoneCall({ + phoneNumber: this.detail.phone, + fail: () => { + uni.showToast({ + title: '拨打电话失败', + icon: 'none' + }) + } + }) + } + } + }) }, bookNow() { uni.navigateTo({ url: '/pkg_product/views/submitOrder?id=' + this.id + '&orderStartDate=' + this.rangeDate.startDate + '&orderEndDate=' + this.rangeDate.endDate }) diff --git a/pkg_product/views/sojoumOrderDetails.vue b/pkg_product/views/sojoumOrderDetails.vue index b523bbc..81c69a3 100644 --- a/pkg_product/views/sojoumOrderDetails.vue +++ b/pkg_product/views/sojoumOrderDetails.vue @@ -2,7 +2,7 @@ - {{orderInfo._status._title}} + {{orderInfo._status._title}} 您已下单成功,请联系商家确认具体的入住时间 @@ -27,8 +27,8 @@ {{orderInfo.travelGroupOrderInfo.travelGroupProduct.name}} 实付: - - ¥ + + ¥ {{orderInfo.payPrice}} @@ -40,11 +40,34 @@ 核销码:{{orderInfo.verifyCode}} - - + + + + + + {{ title }} + {{ popContent || '暂无'}} + + + 立即拨打 | 取消 + + + + 立即复制 | 取消 + + + + 立即拨打 | 取消 + + + + 联系人信息 @@ -90,13 +113,20 @@ - - + + + + + - + + @@ -110,10 +140,14 @@ export default { data() { return { key: '', + popContent: '', + title: '', orderInfo: { travelGroupOrderInfo: {}, - _status: {} - } + _status: {}, + merchantPhone: '' // 添加商家电话字段 + }, + showPhonePopup: false // 控制电话弹窗显示 } }, onLoad(otps) { @@ -121,11 +155,17 @@ export default { this.getSojoumOrderDetail(); }, methods: { + getDaysCount() { + // 根据开始日期和结束日期计算天数 + const startDate = new Date(this.orderInfo.travelGroupOrderInfo.orderStartDate); + const endDate = new Date(this.orderInfo.travelGroupOrderInfo.orderEndDate); + const timeDiff = endDate - startDate; + const daysCount = Math.ceil(timeDiff / (1000 * 60 * 60 * 24)); + return daysCount + 1; + }, handleDateSelected(dateRange) { - console.log('selectedRange', dateRange); - const params = { - orderId: this.orderInfo.travelGroupOrderInfo.travelGroupProduct.id, + orderId: this.key, orderStartDate: dateRange.startDate, orderEndDate: dateRange.endDate } @@ -139,6 +179,7 @@ export default { title: '入住时间修改成功', icon: 'success' }) + this.getSojoumOrderDetail(); } }).finally(() => { uni.hideLoading(); @@ -169,6 +210,7 @@ export default { const res = await fetchSojoumOrderDetail(params); if (res.status === 200) { this.orderInfo = res.data; + this.orderInfo.minBookingDays = this.getDaysCount(); uni.hideLoading(); } }, @@ -202,6 +244,8 @@ export default { uni.makePhoneCall({ phoneNumber: this.orderInfo.merPhone, success: () => { + console.log('///'); + uni.showToast({ title: '正在拨打电话', icon: 'none' @@ -218,6 +262,7 @@ export default { uni.setClipboardData({ data: this.orderInfo.merWechat, success: () => { + console.log('//微信号已复制/'); uni.showToast({ title: '微信号已复制', icon: 'success' @@ -228,10 +273,21 @@ export default { }, contactCustomerService() { // 这里可以添加跳转到客服页面或打开客服会话的逻辑 - uni.showToast({ - title: '正在连接客服...', - icon: 'none' - }) + uni.makePhoneCall({ + phoneNumber: this.orderInfo.merPhone, + success: () => { + uni.showToast({ + title: '正在拨打电话', + icon: 'none' + }) + }, + fail: () => { + uni.showToast({ + title: '拨打失败', + icon: 'none' + }) + } + }) }, modifyStayTime() { // 这里可以添加修改入住时间的逻辑,比如打开日期选择器 @@ -242,7 +298,42 @@ export default { uni.navigateTo({ url: '/pkg_product/views/sojoumOrderRefund?id=' + this.key }) - } + }, + // 显示电话弹窗 + showPhoneDialog(type) { + if (!this.orderInfo.merPhone) { + uni.showToast({ + title: '暂无商家电话', + icon: 'none' + }); + return; + } + if (type === 'phone') { + this.title = '商家电话'; + this.popContent = this.orderInfo.merPhone; + } else if (type === 'wechat') { + this.title = '商家微信'; + this.popContent = this.orderInfo.merWechat; + } + this.showPhonePopup = true; + }, + + // 拨打电话 + makePhoneCall() { + if (!this.orderInfo.merchantPhone) return; + uni.makePhoneCall({ + phoneNumber: this.orderInfo.merchantPhone, + success: () => { + this.showPhonePopup = false; + }, + fail: () => { + uni.showToast({ + title: '拨号失败', + icon: 'none' + }); + } + }); + }, } } @@ -325,6 +416,8 @@ export default { padding: 0 40rpx; border-radius: 40rpx; font-size: 28rpx; + height: 60rpx; + line-height: 60rpx; &.merchant-phone { background-color: #fff; border: 2rpx solid #333; @@ -405,4 +498,50 @@ export default { } } } +.phone-popup { + width: 400rpx; + background-color: #fff; + border-radius: 20rpx; + padding: 40rpx; + + .phone-title { + font-size: 32rpx; + color: #333; + text-align: center; + margin-bottom: 30rpx; + font-weight: bold; + } + + .phone-number { + font-size: 32rpx; + color: #333; + text-align: center; + margin-bottom: 40rpx; + } + + .phone-actions { + display: flex; + justify-content: space-around; + gap: 20rpx; + + .action-btn { + flex: 1; + height: 80rpx; + line-height: 80rpx; + text-align: center; + border-radius: 40rpx; + font-size: 28rpx; + + &.cancel { + background-color: #f5f5f5; + color: #666; + } + + &.call { + background-color: var(--v12-color-primary); + color: #fff; + } + } + } +} \ No newline at end of file diff --git a/pkg_product/views/sojoumOrderRefund.vue b/pkg_product/views/sojoumOrderRefund.vue index 645d4a6..e89b203 100644 --- a/pkg_product/views/sojoumOrderRefund.vue +++ b/pkg_product/views/sojoumOrderRefund.vue @@ -55,12 +55,13 @@