Feat:订单退款,礼品下单
This commit is contained in:
+16
-1
@@ -63,4 +63,19 @@ export function getGiftCardResend(data) {
|
||||
*/
|
||||
export function getGiftCardSendBackground(data) {
|
||||
return request.get("giftCard/giftCardBackgroundImage", data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建团购礼品
|
||||
* @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);
|
||||
}
|
||||
|
||||
+13
-2
@@ -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
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 旅居团购订单退款信息
|
||||
* @param {*} params
|
||||
* @returns
|
||||
*/
|
||||
export function sojoumOrderRefundInfo(params) {
|
||||
return request.post("/travel/travelGroupOrder/refundInfo", params, {
|
||||
login: true
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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 })
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<view class="order-details v12-px-3 v12-pt-3">
|
||||
<!-- 订单状态 -->
|
||||
<view class="status-section">
|
||||
<view class="v12-font-32 v12-primary-text">{{orderInfo._status._title}}</view>
|
||||
<view class="v12-font-28 v12-font-bold v12-primary-text">{{orderInfo._status._title}}</view>
|
||||
<view class="v12-font-24 v12-mt-3" style="color: #666;" v-if="orderInfo._status && ['1','2'].includes(orderInfo._status._type)">
|
||||
您已下单成功,请联系商家确认具体的入住时间
|
||||
</view>
|
||||
@@ -27,8 +27,8 @@
|
||||
<view class="v12-font-32 v12-font-bold more_t">{{orderInfo.travelGroupOrderInfo.travelGroupProduct.name}}</view>
|
||||
<view class="product-price">
|
||||
<text style="font-size: 28rpx; color: #A1A1A1;">实付:</text>
|
||||
<text class="v12-primary-text">
|
||||
<text class="v12-font-28 v12-primary-text">¥</text>
|
||||
<text class="v12-primary-text v12-font-bold">
|
||||
<text class="v12-font-26 v12-primary-text">¥</text>
|
||||
<text class="v12-font-36 v12-primary-text">{{orderInfo.payPrice}}</text>
|
||||
</text>
|
||||
</view>
|
||||
@@ -40,11 +40,34 @@
|
||||
<view class="verify-title v12-font-28 v12-primary-text">核销码:{{orderInfo.verifyCode}}</view>
|
||||
<image class="qr-code" :src="orderInfo.verifyQrCode" mode="aspectFit"></image>
|
||||
<view class="contact-buttons">
|
||||
<button class="contact-btn merchant-phone" @click="contactMerchant('phone')">商家电话</button>
|
||||
<button class="contact-btn merchant-wechat" @click="contactMerchant('wechat')">商家微信</button>
|
||||
<button class="contact-btn merchant-phone" @click="showPhoneDialog('phone')">商家电话</button>
|
||||
<button class="contact-btn merchant-wechat" @click="showPhoneDialog('wechat')">商家微信</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商家电话弹窗 -->
|
||||
<u-popup :show="showPhonePopup" mode="center" round="10" :safe-area-inset-bottom="false">
|
||||
<view class="phone-popup">
|
||||
<view class="phone-title">{{ title }}</view>
|
||||
<view class="phone-number">{{ popContent || '暂无'}}</view>
|
||||
<view class="phone-actions v12-align-center" v-if="title === '商家电话'">
|
||||
<!-- <button class="action-btn cancel" @click="showPhonePopup = false">取消</button>
|
||||
<button class="action-btn call" @click="makePhoneCall">立即拨打</button> -->
|
||||
<view class="v12-font-28 v12-primary-text" @click="contactMerchant('phone')">立即拨打</view> | <view class="v12-font-28" @click="showPhonePopup = false">取消</view>
|
||||
</view>
|
||||
<view class="phone-actions v12-align-center" v-if="title === '商家微信'">
|
||||
<!-- <button class="action-btn cancel" @click="showPhonePopup = false">取消</button>
|
||||
<button class="action-btn call" @click="makePhoneCall">立即拨打</button> -->
|
||||
<view class="v12-font-28 v12-primary-text" @click="contactMerchant('wechat')">立即复制</view> | <view class="v12-font-28" @click="showPhonePopup = false">取消</view>
|
||||
</view>
|
||||
<view class="phone-actions v12-align-center" v-if="title === '平台电话'" >
|
||||
<!-- <button class="action-btn cancel" @click="showPhonePopup = false">取消</button>
|
||||
<button class="action-btn call" @click="makePhoneCall">立即拨打</button> -->
|
||||
<view v-if="title === '平台电话'" class="v12-font-28 v12-primary-text" @click="contactMerchant('phone')">立即拨打</view> | <view class="v12-font-28" @click="showPhonePopup = false">取消</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
<!-- 联系人信息 -->
|
||||
<view class="contact-section">
|
||||
<view class="section-title v12-font-28 v12-font-bold">联系人信息</view>
|
||||
@@ -90,13 +113,20 @@
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<view class="bottom-buttons">
|
||||
<button class="btn customer-service" @click="contactCustomerService">平台客服</button>
|
||||
<view class="v12-align-center">
|
||||
<button class="btn customer-service" @click="showPhoneDialog('phone')">平台客服</button>
|
||||
<view class="v12-align-center" v-if="orderInfo._status && ['1','2'].includes(orderInfo._status._type)">
|
||||
<button class="btn v12-primary-border v12-primary-text modify-time" @click="modifyStayTime">修改入住时间</button>
|
||||
<button class="btn v12-primary-border v12-primary-text refund" @click="applyRefund">申请退款</button>
|
||||
</view>
|
||||
<view class="v12-align-center" v-if="orderInfo._status && ['1','2'].includes(orderInfo._status._type)">
|
||||
<button class="btn v12-dark-border v12-dark-text modify-time" @click="showPhoneDialog('phone')">联系商家</button>
|
||||
</view>
|
||||
</view>
|
||||
<Calendar ref="calendar" @dateSelected="handleDateSelected"></Calendar>
|
||||
<Calendar
|
||||
ref="calendar"
|
||||
:minDay="orderInfo.minBookingDays"
|
||||
@dateSelected="handleDateSelected">
|
||||
</Calendar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -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'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -55,12 +55,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { sojoumOrderRefundInfo, sojoumOrderRefund } from '@/api/sojoumOrder.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
refundAmount: 3500.0,
|
||||
orderAmount: 3888,
|
||||
deductionAmount: 388.8,
|
||||
refundAmount: '',
|
||||
orderAmount: '',
|
||||
deductionAmount: '',
|
||||
refundReasons: [
|
||||
'行程变更',
|
||||
'定错时间/地址',
|
||||
@@ -70,24 +71,55 @@ export default {
|
||||
'其他'
|
||||
],
|
||||
selectedReason: '',
|
||||
otherReason: ''
|
||||
otherReason: '',
|
||||
key: ''
|
||||
}
|
||||
},
|
||||
onLoad(opts) {
|
||||
this.key = opts.id
|
||||
this.getRefundInfo(opts.id)
|
||||
},
|
||||
methods: {
|
||||
getRefundInfo(id) {
|
||||
sojoumOrderRefundInfo({
|
||||
orderId: id
|
||||
}).then(res => {
|
||||
if (res.status === 200) {
|
||||
this.refundAmount = res.data.refundPrice
|
||||
this.orderAmount = res.data.payPrice
|
||||
this.deductionAmount = res.data.penalty
|
||||
}
|
||||
})
|
||||
},
|
||||
selectReason(reason) {
|
||||
this.selectedReason = reason
|
||||
},
|
||||
submitRefund() {
|
||||
// TODO: 实现退款提交逻辑
|
||||
// orderId string 订单号
|
||||
// refundReasonWap string 选择的退款原因
|
||||
// refundReasonWapExplain string 退款原因说明(其他个人原因)
|
||||
const refundData = {
|
||||
amount: this.refundAmount,
|
||||
reason: this.selectedReason,
|
||||
otherReason: this.otherReason
|
||||
orderId: this.key,
|
||||
refundReasonWap: this.selectedReason,
|
||||
refundReasonWapExplain: this.otherReason
|
||||
}
|
||||
console.log('提交退款申请:', refundData)
|
||||
uni.showToast({
|
||||
title: '退款申请已提交',
|
||||
icon: 'success'
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true,
|
||||
})
|
||||
sojoumOrderRefund(refundData).then(res => {
|
||||
if (res.status === 200) {
|
||||
uni.showToast({
|
||||
title: '退款申请已提交',
|
||||
icon: 'success'
|
||||
})
|
||||
uni.navigateBack({
|
||||
url: '/pkg_product/views/sojoumOrderDetails?id=' + this.key
|
||||
})
|
||||
}
|
||||
}).finally(() => {
|
||||
uni.hideLoading();
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="gift-page" v-if="goodsInfo.productInfo && goodsInfo.productInfo.storeName">
|
||||
<view class="gift-page" v-if="(goodsInfo.productInfo && goodsInfo.productInfo.storeName) || isGroupBuy">
|
||||
<view class="top-card" v-if="!isPayOk ">
|
||||
<view class="v12-justify-between v12-pa-2">
|
||||
<view>
|
||||
@@ -19,41 +19,25 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="v12-px-2">
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="v12-pa-2 ">
|
||||
<u-textarea
|
||||
v-model="message"
|
||||
placeholderClass="v12-font-28"
|
||||
placeholder="礼笺轻启,礼藏心意"
|
||||
maxlength="30"
|
||||
border="none"
|
||||
count
|
||||
ref="textarea"
|
||||
cols="30"
|
||||
@input="messageChange"
|
||||
rows="10"></u-textarea>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="gift-good-card">
|
||||
<view class="v12-align-center v12-justify-start">
|
||||
<view>
|
||||
<image :src="goodsInfo.productInfo.image" mode="scaleToFill" class="cover-image"></image>
|
||||
<image :src="isGroupBuy ? goodsInfo.mainImage : goodsInfo.productInfo.image" mode="scaleToFill" class="cover-image"></image>
|
||||
</view>
|
||||
<view class="v12-ml-2 info-wrap">
|
||||
<view class="v12-dark-text v12-font-bold v12-font-28 t-more">
|
||||
{{ goodsInfo.productInfo.storeName }}
|
||||
{{ isGroupBuy ? goodsInfo.name : goodsInfo.productInfo.storeName }}
|
||||
</view>
|
||||
<view class="gift-sku">
|
||||
<view class="gift-sku" v-if="!isGroupBuy">
|
||||
{{ goodsInfo.productInfo.attrInfo.sku }}
|
||||
</view>
|
||||
<view class="v12-justify-between">
|
||||
<view>
|
||||
<text class="v12-primary-text v12-font-bold v12-font-22">¥</text>
|
||||
<text class="v12-primary-text v12-font-bold v12-font-30">{{ payPrice }}</text>
|
||||
<text class="v12-primary-text v12-font-bold v12-font-30">{{ isGroupBuy ? goodsInfo.price : payPrice }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<view v-if="!isGroupBuy">
|
||||
<u-number-box
|
||||
v-if="!isPayOk"
|
||||
v-model="goodsInfo.cartNum"
|
||||
@@ -96,7 +80,7 @@
|
||||
<u-switch v-model="canTransfer" activeColor="#c52733"></u-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view class="swich-btn" v-if="!isPayOk">
|
||||
<view class="swich-btn" v-if="!isPayOk && !isGroupBuy">
|
||||
<view class="v12-font-28 v12-dark-text">打开盲盒模式,朋友签收前商品信息保密</view>
|
||||
<view>
|
||||
<u-switch v-model="isBlind" activeColor="#c52733"></u-switch>
|
||||
@@ -109,10 +93,10 @@
|
||||
<view class="v12-font-24 v12-dark-text">商品总价:</view>
|
||||
<view>
|
||||
<text class="v12-dark-text v12-font-22">¥</text>
|
||||
<text class="v12-dark-text v12-font-30">{{ computedResult.totalPrice }}</text>
|
||||
<text class="v12-dark-text v12-font-30">{{ isGroupBuy ? goodsInfo.price : computedResult.totalPrice }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="v12-justify-between v12-align-center v12-font-28 v12-mt-1">
|
||||
<view class="v12-justify-between v12-align-center v12-font-28 v12-mt-1" v-if="!isGroupBuy">
|
||||
<view class="v12-font-24 v12-dark-text">平台折扣:</view>
|
||||
<view>
|
||||
-
|
||||
@@ -120,7 +104,7 @@
|
||||
<text class="v12-dark-text v12-font-30">{{ computedResult.discountPrice }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="v12-justify-between v12-align-center v12-font-28 v12-mt-1">
|
||||
<view class="v12-justify-between v12-align-center v12-font-28 v12-mt-1" v-if="!isGroupBuy">
|
||||
<view class="v12-font-24 v12-dark-text v12-align-center">
|
||||
<view class="">
|
||||
优惠券:
|
||||
@@ -142,7 +126,7 @@
|
||||
<view class="v12-font-bold">合计:</view>
|
||||
<view class="">
|
||||
<text class="v12-primary-text v12-font-bold v12-font-22">¥</text>
|
||||
<text class="v12-primary-text v12-font-bold v12-font-28">{{ computedResult.payPrice }}</text>
|
||||
<text class="v12-primary-text v12-font-bold v12-font-28">{{ isGroupBuy ? goodsInfo.price : computedResult.payPrice }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -177,7 +161,7 @@
|
||||
ref='payPwdPop'
|
||||
showMoney
|
||||
v-if="isShowPayPwdPop"
|
||||
:money="payPrice"
|
||||
:money="isGroupBuy ? goodsInfo.price : payPrice"
|
||||
:show="isShowPayPwdPop"
|
||||
@close="isShowPayPwdPop = false"
|
||||
@finish="pwdPopFinish"
|
||||
@@ -210,7 +194,14 @@
|
||||
|
||||
<script>
|
||||
import passkeyborad from '@/components/yzc-paykeyboard/yzc-paykeyboard'
|
||||
import { getGiftCardSendOrderConfirm, getGiftCardSendOrder, getGiftCardSendOrderAmount, getGiftCardResend } from '@/api/gift'
|
||||
import {
|
||||
getGiftCardSendOrderConfirm,
|
||||
getGiftCardSendOrder,
|
||||
getGiftCardSendOrderAmount,
|
||||
getGiftCardResend,
|
||||
createGroupBuyGift,
|
||||
createSojoumGroupBuyGift
|
||||
} from '@/api/gift'
|
||||
import { weappPay } from "@/libs/wechat";
|
||||
import {mapGetters} from "vuex";
|
||||
import giftTips from './components/giftTips.vue'
|
||||
@@ -263,7 +254,8 @@ export default {
|
||||
},
|
||||
couponTitle: '',
|
||||
showPopup: false,
|
||||
blindImage: ''
|
||||
blindImage: '',
|
||||
isGroupBuy: false,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -275,9 +267,14 @@ export default {
|
||||
},
|
||||
onLoad(opts) {
|
||||
this.cartId = opts.cartId
|
||||
this.isGroupBuy = opts.isGroupBuy === '1'
|
||||
// this.couponId = opts.couponId || 0
|
||||
this.discount = opts.discount
|
||||
this.getGift()
|
||||
if(this.isGroupBuy) {
|
||||
this.getGroupBuyInfo()
|
||||
} else {
|
||||
this.getGift()
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["userInfo"]),
|
||||
@@ -406,6 +403,7 @@ export default {
|
||||
showTips() {
|
||||
this.$refs.giftTips.showTips = true
|
||||
},
|
||||
|
||||
getGift() {
|
||||
const params = {
|
||||
cartId: this.cartId,
|
||||
@@ -455,26 +453,35 @@ export default {
|
||||
uni.showLoading({
|
||||
title: "生成订单中"
|
||||
});
|
||||
const params = {
|
||||
orderKey: this.orderKey,
|
||||
from: 'routine',
|
||||
cartId: this.cartId,
|
||||
couponId: this.couponId,
|
||||
recipientsNum: this.goodsInfo.cartNum,
|
||||
templateId: this.templateId,
|
||||
message : this.message || '礼笺轻启,礼藏心意',
|
||||
cover: this.selectedCover,
|
||||
canTransfer: this.canTransfer ? 1 : 0,
|
||||
isBlind: this.isBlind ? 1 : 0,
|
||||
payType: this.payType,
|
||||
seckillId: this.orderGroupInfo.seckill_id,
|
||||
combinationId: this.orderGroupInfo.combination_id,
|
||||
bargainId: this.orderGroupInfo.bargain_id,
|
||||
}
|
||||
const params = this.isGroupBuy ? {
|
||||
key: this.orderKey,
|
||||
from: 'routine',
|
||||
cartId: this.cartId,
|
||||
templateId: this.templateId,
|
||||
message : this.message || '礼笺轻启,礼藏心意',
|
||||
canTransfer: this.canTransfer ? 1 : 0,
|
||||
payType: this.payType,
|
||||
} : {
|
||||
orderKey: this.orderKey,
|
||||
from: 'routine',
|
||||
cartId: this.cartId,
|
||||
couponId: this.couponId,
|
||||
recipientsNum: this.goodsInfo.cartNum,
|
||||
templateId: this.templateId,
|
||||
message : this.message || '礼笺轻启,礼藏心意',
|
||||
cover: this.selectedCover,
|
||||
canTransfer: this.canTransfer ? 1 : 0,
|
||||
isBlind: this.isBlind ? 1 : 0,
|
||||
payType: this.payType,
|
||||
seckillId: this.orderGroupInfo.seckill_id,
|
||||
combinationId: this.orderGroupInfo.combination_id,
|
||||
bargainId: this.orderGroupInfo.bargain_id,
|
||||
}
|
||||
if (this.payType == 'yue') {
|
||||
params.passwordPay = this.payPassword;
|
||||
}
|
||||
getGiftCardSendOrder(this.orderKey, params).then(res => {
|
||||
const apiFn = this.isGroupBuy ? createSojoumGroupBuyGift : getGiftCardSendOrder
|
||||
apiFn(this.orderKey, params).then(res => {
|
||||
uni.hideLoading();
|
||||
|
||||
const data = res.data;
|
||||
@@ -558,6 +565,22 @@ export default {
|
||||
this.$refs.payPwdPop.clear();//清空支付密码
|
||||
this.$refs.payPwdPop.close();//关闭支付密码弹窗
|
||||
});
|
||||
},
|
||||
getGroupBuyInfo() {
|
||||
const params = {
|
||||
travelGroupProductId: this.cartId
|
||||
}
|
||||
createGroupBuyGift(params).then(res => {
|
||||
if (res.status === 200) {
|
||||
this.coverList = res.data.giftCardGiftNotice || []
|
||||
this.orderKey = res.data.orderKey
|
||||
this.goodsInfo = {
|
||||
...res.data.travelGroupProduct,
|
||||
|
||||
}
|
||||
this.giftNotice = res.data.giftCardGiftNotice
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -693,7 +716,6 @@ export default {
|
||||
}
|
||||
.price-wrap{
|
||||
width: 100%;
|
||||
height: 320rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
margin-top: 30rpx;
|
||||
@@ -702,7 +724,6 @@ export default {
|
||||
}
|
||||
.act-box{
|
||||
width: 710rpx;
|
||||
height: 146rpx;
|
||||
background: #fff;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user