Commit ac921b9e authored by 王炽's avatar 王炽

Merge branch 'feihesanqi_20251014' of...

Merge branch 'feihesanqi_20251014' of http://gitlab2.dui88.com/fh/20250528_FHQ1 into feihesanqi_20251014
parents a5222332 2253c649
......@@ -67,3 +67,10 @@ export const doTerminate = () => api.post('/c/user/terminate');
export const getExchangeList = (params = {}) => api.get('/c/user/exchange/list', { params });
/**
*
* @param {orderNo} data
* @returns
*/
export const getOrderDetail = (data) => api.get('/c/order/detail', data);
\ No newline at end of file
......@@ -16,7 +16,7 @@
<!-- 奖励信息 -->
<view v-if="rewardInfo && isCorrect" class="reward-info">
已获得{{ rewardInfo }}积分
已获得{{ rewardInfo }}
</view>
<!-- 错误状态下也保留相同高度的空间 -->
<view v-else class="empty-reward-space"></view>
......@@ -62,19 +62,19 @@ export default {
},
question: {
type: String,
default: '题目标题占位'
default: ''
},
correctAnswer: {
type: String,
default: '能吃'
default: ''
},
analysis: {
type: String,
default: '题目答案解析文案占位题目答案解析文案占位'
default: ''
},
allResult: {
type: String,
default: '30|23|17|30'
default: '25|25|25|25'
},
optionDistribution: {
type: Array,
......@@ -90,7 +90,7 @@ export default {
// 根据allResult字符串生成显示用的选项分布数据
displayOptionDistribution() {
// 如果有allResult属性且格式正确,使用它来生成分布数据
if (this.allResult && this.allResult.includes('|')) {
if (this.allResult && this.allResult.trim() !== '' && this.allResult.includes('|')) {
const percentages = this.allResult.split('|');
const labels = ['能吃', '少吃', '慎吃', '禁吃'];
......
......@@ -51,16 +51,6 @@
<!-- <text class="back-text">返回app</text> -->
</button>
<!-- 金币动画模块 -->
<view class="gold-coin-animation" v-if="false" @tap="hideGoldCoinAnimation">
<view class="gold-coin-content" @tap.stop>
<view class="gold-coin-title">{{ goldCoinConfig.title }}</view>
<view class="gold-coin-description">{{ goldCoinConfig.description }}</view>
<view class="gold-coin-container">
<image class="gold-coin gold-coin-1" :src="$baseUrl + 'homepage/Q3Res/goldCoin.png'"></image>
</view>
</view>
</view>
<!-- 悬浮授权手机号模块 -->
<view class="auth-phone-module" v-if="!userStore.memberInfo?.mobile">
......@@ -99,15 +89,7 @@ const $baseUrl = proxy.$baseUrl;
const homeRef = ref(null);
const scrollTop = ref(0);
const isBackApp = ref(false);
const showGoldCoinAnimation = ref(false);
const taskId = ref(0);
const goldCoinConfig = ref({
title: '恭喜你回答正确',
description: '获得20积分'
});
const shareOptions = {
0: {
title: "8000万中国妈妈信赖的育儿品牌",
......@@ -155,28 +137,6 @@ const handleAuthPhoneClick = () => {
})
}
// 显示金币动画
const showGoldCoinEffect = (config = {}) => {
// 合并配置
goldCoinConfig.value = {
title: config.title || '恭喜你回答正确',
description: config.description || '获得20积分',
...config
};
// 显示动画
showGoldCoinAnimation.value = true;
// 3秒后自动隐藏
setTimeout(() => {
showGoldCoinAnimation.value = false;
}, 3000);
}
// 隐藏金币动画
const hideGoldCoinAnimation = () => {
showGoldCoinAnimation.value = false;
}
// 检查任务结果并更新全局状态
const checkAndUpdateTaskResult = async () => {
......@@ -277,10 +237,7 @@ onPageScroll((e) => {
// });
// 暴露显示金币动画的方法供其他组件调用
defineExpose({
showGoldCoinEffect
});
// 邀请奖品弹窗相关方法
const handleInviteClick = () => {
......@@ -422,141 +379,6 @@ const handleTaskPersonSubmit = (formData) => {
}
}
/* 金币动画样式 */
.gold-coin-animation {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.6);
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
animation: fadeIn 0.3s ease-out;
}
.gold-coin-content {
text-align: center;
padding: 60rpx 40rpx;
}
.gold-coin-title {
font-size: 44rpx;
font-weight: bold;
color: #ffffff;
margin-bottom: 20rpx;
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3);
animation: slideUp 0.5s ease-out;
}
.gold-coin-description {
font-size: 32rpx;
color: #ffd700;
margin-bottom: 40rpx;
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3);
animation: slideUp 0.7s ease-out;
}
.gold-coin-container {
position: relative;
width: 300rpx;
height: 300rpx;
margin: 0 auto;
display: flex;
align-items: center;
justify-content: center;
}
.gold-coin {
position: absolute;
width: 167rpx;
height: 162rpx;
animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
transform-origin: center;
will-change: transform, opacity;
}
.gold-coin-1 {
animation: goldCoinFly 1.5s ease-out 1;
z-index: 5;
}
/* 缓动动画关键帧 */
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes slideUp {
from {
transform: translateY(50rpx);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
/* 单个金币从中间飞向底部导航"我的"图标的动画 - 自然延续的曲线波动 */
@keyframes goldCoinFly {
0% {
transform: translate(0, 0) scale(1.3) rotate(0deg);
opacity: 1;
left: 50%;
top: 50%;
}
20% {
transform: translate(100rpx, 120rpx) scale(1.25) rotate(10deg);
opacity: 1;
left: 50%;
top: 50%;
}
40% {
transform: translate(160rpx, 280rpx) scale(1.2) rotate(15deg);
opacity: 1;
left: 50%;
top: 50%;
}
60% {
transform: translate(190rpx, 380rpx) scale(1.1) rotate(25deg);
opacity: 0.95;
left: 50%;
top: 50%;
}
70% {
transform: translate(200rpx, 420rpx) scale(0.9) rotate(30deg);
opacity: 0.8;
left: 50%;
top: 50%;
}
80% {
transform: translate(208rpx, 460rpx) scale(0.7) rotate(38deg);
opacity: 0.6;
left: 50%;
top: 50%;
}
90% {
transform: translate(215rpx, 500rpx) scale(0.3) rotate(42deg);
opacity: 0.3;
left: 50%;
top: 50%;
}
100% {
transform: translate(220rpx, 550rpx) scale(0) rotate(45deg);
opacity: 0;
left: 50%;
top: 50%;
}
}
.content {
display: flex;
......
This diff is collapsed.
This diff is collapsed.
......@@ -15,7 +15,8 @@
<!-- 订单头部 -->
<view class="order-header">
<text class="order-number">订单号 {{ order.orderId }}</text>
<text class="order-status" :class="getStatusClass(order.status)">{{ getStatusText(order.status)
<!-- :class="getStatusClass(order.status)" -->
<text class="order-status">{{ getStatusText(order.status)
}}</text>
</view>
......@@ -51,6 +52,16 @@
</view>
</view>
<!-- 待使用状态 -->
<view v-else-if="order.status === 'pending_use'" class="action-btn" @tap="useCoupon(order)">
<text class="btn-text">去使用</text>
</view>
<!-- 待领取状态 -->
<view v-else-if="order.status === 'pending_take'" class="action-btn" @tap="takeReward(order)">
<text class="btn-text">去领取</text>
</view>
<!-- 其他状态的操作按钮 -->
<view v-else class="action-btn" @tap="viewOrderDetail(order)">
<text class="btn-text">查看详情</text>
......@@ -222,11 +233,39 @@ export default {
// 映射订单状态
mapFlowStateToStatus(flowState) {
const statusMap = {
'1': 'pending_payment', // 待付款
'2': 'pending_shipment', // 待发货
'3': 'completed', // 已完成
'4': 'cancelled', // 已取消
'99': 'completed' // 特殊状态,按已完成处理
// 处理中状态
'0': 'processing', // 处理中
'11': 'processing', // 扣积分成功
'12': 'pending_payment', // 扣积分失败 - 待付款
'25': 'processing', // 商品兑换处理中
// 支付相关状态
'20': 'pending_payment', // 待支付
'21': 'processing', // 支付成功
'22': 'payment_failed', // 支付失败
'23': 'audit_waiting', // 待审核
// 物流相关状态
'30': 'pending_shipment', // 待发货
'31': 'shipped', // 已发货
'32': 'completed', // 已确认收货
// 使用相关状态
'40': 'pending_use', // 待使用
'41': 'used', // 已使用
// 活动相关状态
'13': 'pending_take', // 待领取
'14': 'taken', // 已领取
// 售后相关状态
'95': 'refund_processing', // 售后处理中
'96': 'refund_success', // 售后完成
// 订单结束状态
'97': 'failed', // 订单失败
'98': 'cancelled', // 订单已取消
'99': 'completed' // 订单完成
};
return statusMap[flowState.toString()] || 'completed';
},
......@@ -270,9 +309,34 @@ export default {
// 获取状态文本
getStatusText(status) {
const statusMap = {
'pending_shipment': '待发货',
// 处理中状态
'processing': '处理中',
'audit_waiting': '待审核',
// 支付相关状态
'pending_payment': '待付款',
'completed': '已完成'
'payment_failed': '支付失败',
// 物流相关状态
'pending_shipment': '待发货',
'shipped': '已发货',
'completed': '已完成',
// 使用相关状态
'pending_use': '待使用',
'used': '已使用',
// 活动相关状态
'pending_take': '待领取',
'taken': '已领取',
// 售后相关状态
'refund_processing': '售后处理中',
'refund_success': '售后完成',
// 订单结束状态
'failed': '交易失败',
'cancelled': '已取消'
};
return statusMap[status] || '未知状态';
},
......@@ -312,6 +376,22 @@ export default {
uni.navigateTo({
url: `/v3/orderDetail/orderDetail?orderId=${order.orderId}`
});
},
// 使用优惠券
useCoupon(order) {
// 跳转到优惠券使用页面
uni.navigateTo({
url: `/v3/couponUse/couponUse?orderId=${order.orderId}`
});
},
// 领取奖励
takeReward(order) {
// 跳转到奖励领取页面
uni.navigateTo({
url: `/v3/rewardTake/rewardTake?orderId=${order.orderId}`
});
}
}
}
......@@ -392,18 +472,73 @@ export default {
font-weight: 500;
}
.status-pending_shipment {
color: #b9b9b9;
/* 处理中状态 */
.status-processing {
color: #D3A458;
}
.status-audit_waiting {
color: #D3A458;
}
/* 支付相关状态 */
.status-pending_payment {
color: #D3A458;
}
.status-payment_failed {
color: #E34D59;
}
/* 物流相关状态 */
.status-pending_shipment {
color: #b9b9b9;
}
.status-shipped {
color: #b9b9b9;
}
.status-completed {
color: #333333;
}
/* 使用相关状态 */
.status-pending_use {
color: #D3A458;
}
.status-used {
color: #333333;
}
/* 活动相关状态 */
.status-pending_take {
color: #D3A458;
}
.status-taken {
color: #333333;
}
/* 售后相关状态 */
.status-refund_processing {
color: #D3A458;
}
.status-refund_success {
color: #333333;
}
/* 订单结束状态 */
.status-failed {
color: #E34D59;
}
.status-cancelled {
color: #b9b9b9;
}
/* 商品信息 */
.product-info {
display: flex;
......
......@@ -59,7 +59,17 @@ export default {
isSuccess: true, // true: 成功, false: 失败
pointsValue: '',
failureReason: '',
orderId: '' // 订单ID,用于跳转订单详情
orderId: '', // 订单ID,用于跳转订单详情
// 新增字段
goodsName: '',
goodsImage: '',
goodsSpec: '',
quantity: 1,
creditsTypeName: '积分',
priceData: '',
gid: '',
skuld: '',
buy_num: 1
}
}
},
......@@ -100,6 +110,8 @@ export default {
}
},
onLoad(options) {
console.log('支付结果页面接收到的参数:', options);
// 处理页面参数
if (options.isSuccess !== undefined) {
this.resultData.isSuccess = options.isSuccess === 'true';
......@@ -114,7 +126,17 @@ export default {
this.resultData.orderId = options.orderId;
}
console.log('支付结果页面参数:', options);
// 保存其他参数供后续使用
this.resultData.goodsName = options.goodsName || '';
this.resultData.goodsImage = options.goodsImage || '';
this.resultData.goodsSpec = options.goodsSpec || '';
this.resultData.quantity = parseInt(options.quantity) || 1;
this.resultData.creditsTypeName = options.creditsTypeName || '积分';
this.resultData.priceData = options.priceData || '';
this.resultData.gid = options.gid || '';
this.resultData.skuld = options.skuld || '';
this.resultData.buy_num = parseInt(options.buy_num) || 1;
console.log('支付结果数据:', this.resultData);
},
methods: {
......
......@@ -30,14 +30,15 @@
</view>
<view class="product-detail">
<view class="product-image">
<text class="image-placeholder">优惠券</text>
<image v-if="goodsInfo.image" class="product-img" :src="goodsInfo.image" mode="aspectFill"></image>
<text v-else class="image-placeholder">商品图片</text>
</view>
<view class="product-info">
<text class="product-name">优惠券名称占位优惠券名称占位优惠券名称占位</text>
<text class="product-spec">净含量 750g</text>
<text class="product-name">{{ goodsInfo.name }}</text>
<text class="product-spec" v-if="goodsInfo.spec">净含量 {{ goodsInfo.spec }}</text>
<view class="price-quantity-row">
<text class="product-price">12000积分</text>
<text class="product-quantity">x1</text>
<text class="product-price">{{ goodsInfo.points }}{{ goodsInfo.creditsTypeName }}</text>
<text class="product-quantity">x{{ goodsInfo.quantity }}</text>
</view>
</view>
</view>
......@@ -58,8 +59,8 @@
<!-- 订单汇总 -->
<view class="summary-section">
<text class="summary-label">1</text>
<text class="summary-price">小计:12000积分</text>
<text class="summary-label">{{ goodsInfo.quantity }}</text>
<text class="summary-price">小计:{{ goodsInfo.points * goodsInfo.quantity }}{{ goodsInfo.creditsTypeName }}</text>
</view>
</view>
</view>
......@@ -74,7 +75,7 @@
<view class="bottom-bar">
<view class="total-info">
<text class="total-label">商品积分</text>
<text class="total-price">12000积分</text>
<text class="total-price">{{ goodsInfo.points * goodsInfo.quantity }}{{ goodsInfo.creditsTypeName }}</text>
</view>
<button class="submit-btn" @click="submitOrder">提交订单</button>
</view>
......@@ -124,6 +125,9 @@ export default {
methods: {
// 解析页面参数
parsePageParams(options) {
console.log('结算页面接收到的参数:', options);
// 基础订单参数
this.orderParams = {
gid: options.gid || '',
skuld: options.skuld || '',
......@@ -141,6 +145,7 @@ export default {
if (options.priceData) {
try {
this.priceData = JSON.parse(decodeURIComponent(options.priceData));
console.log('解析的价格数据:', this.priceData);
} catch (error) {
console.error('解析价格数据失败:', error);
}
......@@ -149,10 +154,14 @@ export default {
// 设置商品信息
this.goodsInfo = {
name: options.goodsName || '商品名称',
spec: options.spec || '750g',
spec: options.goodsSpec || options.spec || '750g',
points: parseInt(options.points) || 0,
quantity: parseInt(options.buy_num) || 1
quantity: parseInt(options.buy_num) || 1,
image: options.goodsImage || '',
creditsTypeName: options.creditsTypeName || '积分'
};
console.log('解析后的商品信息:', this.goodsInfo);
},
// 检查收货地址
......@@ -318,16 +327,35 @@ export default {
// 跳转到支付结果页面
navigateToPayResult(isSuccess, orderData = null, errorMsg = '') {
const resultParams = {
success: isSuccess,
// 基础结果参数
isSuccess: isSuccess,
orderId: orderData ? orderData.orderId : '',
points: this.goodsInfo.points,
goodsName: this.goodsInfo.name
// 积分信息
pointsValue: `${this.goodsInfo.points * this.goodsInfo.quantity}${this.goodsInfo.creditsTypeName}`,
creditsTypeName: this.goodsInfo.creditsTypeName,
// 商品信息
goodsName: this.goodsInfo.name,
goodsImage: this.goodsInfo.image || '',
goodsSpec: this.goodsInfo.spec || '',
quantity: this.goodsInfo.quantity,
// 价格数据
priceData: JSON.stringify(this.priceData),
// 订单参数
gid: this.orderParams.gid,
skuld: this.orderParams.skuld,
buy_num: this.orderParams.buy_num
};
if (!isSuccess) {
resultParams.failureReason = errorMsg || '兑换失败,请重试';
}
console.log('结算页面跳转支付结果页面参数:', resultParams);
uni.navigateTo({
url: `/v3/payResultPage/payResultPage?${this.buildQueryString(resultParams)}`
});
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment