Feat:订单退款,礼品下单

This commit is contained in:
linxi
2025-10-21 17:51:40 +08:00
parent 64db7b8cd4
commit bf4861f088
7 changed files with 328 additions and 131 deletions
+71 -50
View File
@@ -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;
}