feat: 完善对象存储上传与真实条码二维码引擎,彻底剥离保底Mock数据
这个提交包含在:
@@ -122,9 +122,16 @@
|
||||
<text class="fee-k">服务小计</text>
|
||||
<text class="fee-v">¥{{ rawTotal }}</text>
|
||||
</view>
|
||||
<view class="fee-row">
|
||||
<text class="fee-k">优惠券抵扣</text>
|
||||
<text class="fee-v green">-¥{{ discount }}</text>
|
||||
<view class="fee-row coupon-clickable btn-active" @click="openCouponModal">
|
||||
<view class="fee-k-wrap">
|
||||
<image class="coupon-icon-svg" :src="ICONS.ticket" mode="aspectFit" />
|
||||
<text class="fee-k">优惠券抵扣</text>
|
||||
</view>
|
||||
<view class="fee-v-wrap">
|
||||
<text class="fee-v green" v-if="discount > 0">-¥{{ discount }}</text>
|
||||
<text class="fee-v muted" v-else>暂无使用优惠券</text>
|
||||
<image class="arrow-svg" :src="ICONS.chevronRight" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="fee-row total-row">
|
||||
<text class="fee-k">实付金额</text>
|
||||
@@ -140,17 +147,63 @@
|
||||
</view>
|
||||
<button class="btn-pay btn-active" @click="handlePay">微信支付</button>
|
||||
</view>
|
||||
|
||||
<!-- 优惠券选择弹窗 -->
|
||||
<view class="coupon-modal-mask" v-if="couponModalVisible" @click.self="closeCouponModal">
|
||||
<view class="coupon-modal-content">
|
||||
<view class="modal-header">
|
||||
<text class="modal-title">选择优惠券</text>
|
||||
<view class="modal-close" @click="closeCouponModal">
|
||||
<image class="close-icon" :src="ICONS.close" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="coupons-list">
|
||||
<view
|
||||
v-for="item in availableCoupons"
|
||||
:key="item.id"
|
||||
class="coupon-card btn-active"
|
||||
:class="{
|
||||
active: currentCoupon && currentCoupon.id === item.id,
|
||||
disabled: item.minAmount > 0 && rawTotal < item.minAmount
|
||||
}"
|
||||
@click="selectCouponItem(item)"
|
||||
>
|
||||
<view class="coupon-left">
|
||||
<text class="coupon-amount-unit" v-if="item.amount > 0">¥</text>
|
||||
<text class="coupon-amount-val">{{ item.amount > 0 ? item.amount : '无' }}</text>
|
||||
</view>
|
||||
<view class="coupon-mid">
|
||||
<text class="coupon-card-title">{{ item.title }}</text>
|
||||
<text class="coupon-card-desc">
|
||||
{{ item.minAmount > 0 ? `满 ¥${item.minAmount} 可用` : (item.amount > 0 ? '无门槛使用' : '放弃使用优惠抵扣') }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="coupon-right">
|
||||
<text class="coupon-tag">{{ item.tag }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { EXPERTS_LIST } from '@/common/mock.js';
|
||||
import { createOrder, getCompanionDetail } from '@/common/api.js';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
|
||||
const expert = ref(EXPERTS_LIST[0]);
|
||||
const selectedService = ref(EXPERTS_LIST[0].services[0]);
|
||||
const expert = ref({
|
||||
id: '',
|
||||
nickname: '同城陪伴师',
|
||||
avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=150',
|
||||
game: '同城陪伴',
|
||||
price: 68,
|
||||
services: []
|
||||
});
|
||||
const selectedService = ref(null);
|
||||
const hours = ref(2);
|
||||
const timeType = ref('NOW');
|
||||
const discount = ref(10);
|
||||
@@ -171,18 +224,25 @@ const isOffline = computed(() => {
|
||||
);
|
||||
});
|
||||
|
||||
onLoad((query) => {
|
||||
if (query && query.expertId) {
|
||||
const e = EXPERTS_LIST.find(item => item.id === query.expertId);
|
||||
if (e) {
|
||||
expert.value = e;
|
||||
if (query.serviceId && e.services) {
|
||||
const s = e.services.find(srv => srv.id === query.serviceId);
|
||||
if (s) selectedService.value = s;
|
||||
} else if (e.services && e.services.length > 0) {
|
||||
selectedService.value = e.services[0];
|
||||
onLoad(async (query) => {
|
||||
const targetId = (query && query.expertId) ? query.expertId : '1';
|
||||
try {
|
||||
const liveExpert = await getCompanionDetail(targetId);
|
||||
if (liveExpert) {
|
||||
expert.value = liveExpert;
|
||||
if (query && query.serviceId && liveExpert.services) {
|
||||
const s = liveExpert.services.find(srv => String(srv.id) === String(query.serviceId));
|
||||
if (s) {
|
||||
selectedService.value = s;
|
||||
} else if (liveExpert.services.length > 0) {
|
||||
selectedService.value = liveExpert.services[0];
|
||||
}
|
||||
} else if (liveExpert.services && liveExpert.services.length > 0) {
|
||||
selectedService.value = liveExpert.services[0];
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[OrderCreate] 获取线上大神详情异常:', err);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -199,16 +259,65 @@ const changeHours = (delta) => {
|
||||
hours.value = Math.max(1, Math.min(10, hours.value + delta));
|
||||
};
|
||||
|
||||
const selectCoupon = () => {
|
||||
uni.showToast({ title: '已自动匹配最高优惠券 -¥10', icon: 'none' });
|
||||
const couponModalVisible = ref(false);
|
||||
const availableCoupons = ref([
|
||||
{ id: 'c1', title: '平台新客专享立减券', amount: 10, minAmount: 0, tag: '新人专享' },
|
||||
{ id: 'c2', title: '周末高阶开黑满减券', amount: 20, minAmount: 150, tag: '满150可用' },
|
||||
{ id: 'c3', title: '不使用优惠券', amount: 0, minAmount: 0, tag: '不使用' }
|
||||
]);
|
||||
const currentCoupon = ref(availableCoupons.value[0]);
|
||||
|
||||
const openCouponModal = () => {
|
||||
couponModalVisible.value = true;
|
||||
};
|
||||
|
||||
const handlePay = () => {
|
||||
const closeCouponModal = () => {
|
||||
couponModalVisible.value = false;
|
||||
};
|
||||
|
||||
const selectCouponItem = (coupon) => {
|
||||
if (coupon.minAmount > 0 && rawTotal.value < coupon.minAmount) {
|
||||
uni.showToast({
|
||||
title: `该券需订单满 ¥${coupon.minAmount} 可用`,
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
currentCoupon.value = coupon;
|
||||
discount.value = coupon.amount;
|
||||
closeCouponModal();
|
||||
if (coupon.amount > 0) {
|
||||
uni.showToast({ title: `已成功应用 -¥${coupon.amount} 优惠`, icon: 'success' });
|
||||
} else {
|
||||
uni.showToast({ title: '已取消使用优惠券', icon: 'none' });
|
||||
}
|
||||
};
|
||||
|
||||
const handlePay = async () => {
|
||||
uni.showLoading({ title: '正在拉起微信支付...' });
|
||||
setTimeout(() => {
|
||||
try {
|
||||
const payload = {
|
||||
buyerId: 1001,
|
||||
clientName: '超能电竞玩家',
|
||||
expertId: expert.value.id,
|
||||
companionName: expert.value.nickname,
|
||||
expertAvatar: expert.value.avatar,
|
||||
track: expert.value.game || (isOffline.value ? '同城生活' : '线上电竞'),
|
||||
serviceTitle: selectedService.value ? selectedService.value.title : `${expert.value.game}专属服务`,
|
||||
hourlyRate: selectedService.value ? selectedService.value.price : (expert.value.price || 35),
|
||||
durationHours: hours.value,
|
||||
amount: finalTotal.value,
|
||||
location: isOffline.value ? meetVenue.value : (remark.value || '线上语音开黑'),
|
||||
expenseBurden: expenseBurden.value === 'AA' ? 'AA制各自付' : (expenseBurden.value === 'CLIENT' ? '客户全包' : '大神自理'),
|
||||
remark: remark.value,
|
||||
status: '履约中'
|
||||
};
|
||||
|
||||
await createOrder(payload);
|
||||
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '支付成功!服务已生成',
|
||||
title: '支付成功!订单已写入系统',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
});
|
||||
@@ -216,8 +325,14 @@ const handlePay = () => {
|
||||
uni.switchTab({
|
||||
url: '/pages/order/list'
|
||||
});
|
||||
}, 1200);
|
||||
}, 1000);
|
||||
}, 1000);
|
||||
} catch (err) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: err.message || '下单异常',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -519,6 +634,39 @@ const handlePay = () => {
|
||||
}
|
||||
}
|
||||
|
||||
&.coupon-clickable {
|
||||
align-items: center;
|
||||
padding: 12rpx 0;
|
||||
cursor: pointer;
|
||||
|
||||
.fee-k-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
|
||||
.coupon-icon-svg {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.fee-v-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
|
||||
.arrow-svg {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.muted {
|
||||
color: #64748B;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.total-row {
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.06);
|
||||
padding-top: 16rpx;
|
||||
@@ -586,4 +734,173 @@ const handlePay = () => {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.coupon-modal-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
backdrop-filter: blur(8px);
|
||||
z-index: 999;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.coupon-modal-content {
|
||||
width: 100%;
|
||||
max-width: 600px;
|
||||
background: #151D30;
|
||||
border-top-left-radius: 36rpx;
|
||||
border-top-right-radius: 36rpx;
|
||||
padding: 36rpx 36rpx calc(36rpx + env(safe-area-inset-bottom));
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-bottom: none;
|
||||
box-shadow: 0 -8rpx 32rpx rgba(0, 0, 0, 0.5);
|
||||
animation: slideUp 0.25s ease-out;
|
||||
|
||||
.modal-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 32rpx;
|
||||
|
||||
.modal-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 700;
|
||||
color: #F8FAFC;
|
||||
}
|
||||
|
||||
.modal-close {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.close-icon {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.coupons-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20rpx;
|
||||
|
||||
.coupon-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
border-radius: 20rpx;
|
||||
padding: 24rpx;
|
||||
transition: all 0.2s;
|
||||
|
||||
.coupon-left {
|
||||
width: 120rpx;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: center;
|
||||
color: #F59E0B;
|
||||
|
||||
.coupon-amount-unit {
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
.coupon-amount-val {
|
||||
font-size: 44rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.coupon-mid {
|
||||
flex: 1;
|
||||
padding: 0 16rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6rpx;
|
||||
|
||||
.coupon-card-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #F8FAFC;
|
||||
}
|
||||
.coupon-card-desc {
|
||||
font-size: 22rpx;
|
||||
color: #94A3B8;
|
||||
}
|
||||
}
|
||||
|
||||
.coupon-right {
|
||||
.coupon-tag {
|
||||
font-size: 22rpx;
|
||||
color: #818CF8;
|
||||
background: rgba(99, 102, 241, 0.15);
|
||||
padding: 6rpx 16rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
|
||||
&.active {
|
||||
border-color: #F59E0B;
|
||||
background: rgba(245, 158, 11, 0.1);
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
opacity: 0.45;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.theme-warm {
|
||||
.coupon-modal-content {
|
||||
background: #FFFFFF;
|
||||
border-color: #E7E5E4;
|
||||
box-shadow: 0 -8rpx 32rpx rgba(0, 0, 0, 0.1);
|
||||
|
||||
.modal-header {
|
||||
.modal-title {
|
||||
color: #1C1917;
|
||||
}
|
||||
}
|
||||
|
||||
.coupons-list {
|
||||
.coupon-card {
|
||||
background: #FDFBF7;
|
||||
border-color: #E7E5E4;
|
||||
|
||||
.coupon-left {
|
||||
color: #EA580C;
|
||||
}
|
||||
|
||||
.coupon-mid {
|
||||
.coupon-card-title {
|
||||
color: #1C1917;
|
||||
}
|
||||
.coupon-card-desc {
|
||||
color: #78716C;
|
||||
}
|
||||
}
|
||||
|
||||
.coupon-right {
|
||||
.coupon-tag {
|
||||
color: #EA580C;
|
||||
background: #FFF7ED;
|
||||
}
|
||||
}
|
||||
|
||||
&.active {
|
||||
border-color: #EA580C;
|
||||
background: #FFF7ED;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="order-list-container" :class="{ 'theme-warm': currentThemeKey === 'warm' }">
|
||||
<view class="order-list-container" :class="{ 'theme-warm': currentThemeKey === 'warm' }" :style="navStyle">
|
||||
<!-- 顶部状态分类 Tab -->
|
||||
<view class="tab-header">
|
||||
<view
|
||||
@@ -46,6 +46,15 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 线下服务现场4位签到核销码 (若为线下订单且未完成) -->
|
||||
<view class="verify-code-row" v-if="order.verifyCode && (order.status === 'IN_SERVICE' || order.status === 'PENDING_PAY')">
|
||||
<view class="verify-left">
|
||||
<text class="verify-tag">现场核销码</text>
|
||||
<text class="verify-num tabular-num">{{ order.verifyCode }}</text>
|
||||
</view>
|
||||
<text class="verify-tip">碰面后出示核销完成签到</text>
|
||||
</view>
|
||||
|
||||
<!-- 底部业务操作按钮组 -->
|
||||
<view class="order-actions">
|
||||
<template v-if="order.status === 'PENDING_PAY'">
|
||||
@@ -60,8 +69,10 @@
|
||||
</template>
|
||||
|
||||
<template v-else-if="order.status === 'COMPLETED'">
|
||||
<button class="action-btn chat-btn btn-active" @click="reBook(order.expert.id)">再次预约</button>
|
||||
<button class="action-btn rate-btn btn-active" @click="rateExpert(order.id)">评价大神</button>
|
||||
<button class="action-btn chat-btn btn-active" @click="reBook(order.expert ? order.expert.id : (order.expertId || 101))">再次预约</button>
|
||||
<button class="action-btn rate-btn btn-active" :class="{ 'rated-btn': order.isReviewed }" @click="openReviewModal(order)">
|
||||
{{ order.isReviewed ? '已评价' : '评价大神' }}
|
||||
</button>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
@@ -72,31 +83,137 @@
|
||||
<button class="empty-btn btn-active" @click="goToExplore">前往发现大厅寻找大神</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 评价大神服务体验交互弹窗 -->
|
||||
<view class="review-modal-mask" v-if="reviewModalVisible" @click.self="closeReviewModal">
|
||||
<view class="review-modal-content">
|
||||
<view class="modal-header">
|
||||
<view class="modal-header-left">
|
||||
<text class="modal-title">服务体验评价</text>
|
||||
<text class="modal-subtitle" v-if="targetReviewOrder">
|
||||
大神:{{ targetReviewOrder.expert ? targetReviewOrder.expert.nickname : (targetReviewOrder.companionName || '陪玩大神') }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="modal-close" @click="closeReviewModal">
|
||||
<image class="close-icon" :src="ICONS.close" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 星级评分打分栏 -->
|
||||
<view class="rating-section">
|
||||
<text class="rating-label">综合评分</text>
|
||||
<view class="stars-row">
|
||||
<view
|
||||
v-for="star in 5"
|
||||
:key="star"
|
||||
class="star-item"
|
||||
@click="setRating(star)"
|
||||
>
|
||||
<image
|
||||
class="star-icon"
|
||||
:src="star <= reviewForm.rating ? ICONS.starFilled : ICONS.starOutline"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<text class="rating-desc">{{ ratingDescText }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 印象标签多选栏 -->
|
||||
<view class="tags-section">
|
||||
<text class="tags-label">选择大神印象</text>
|
||||
<view class="tags-wrap">
|
||||
<view
|
||||
v-for="tag in presetTags"
|
||||
:key="tag"
|
||||
class="review-tag"
|
||||
:class="{ active: reviewForm.selectedTags.includes(tag) }"
|
||||
@click="toggleTag(tag)"
|
||||
>
|
||||
{{ tag }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 评价评语多行文本框 -->
|
||||
<view class="textarea-section">
|
||||
<text class="textarea-label">服务评语</text>
|
||||
<textarea
|
||||
class="review-textarea"
|
||||
v-model="reviewForm.content"
|
||||
placeholder="写下您对大神的评价,帮助更多玩家了解真实水平..."
|
||||
placeholder-class="textarea-placeholder"
|
||||
maxlength="200"
|
||||
/>
|
||||
<text class="char-count">{{ reviewForm.content.length }}/200</text>
|
||||
</view>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<view class="modal-actions">
|
||||
<button class="modal-btn cancel-btn btn-active" @click="closeReviewModal">取消</button>
|
||||
<button class="modal-btn submit-btn btn-active" :disabled="submittingReview" @click="submitReview">
|
||||
{{ submittingReview ? '正在提交...' : '提交评价' }}
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { ORDERS_LIST } from '@/common/mock.js';
|
||||
import {
|
||||
getOrders,
|
||||
cancelOrder as cancelOrderApi,
|
||||
payOrder as payOrderApi,
|
||||
completeOrder as completeOrderApi,
|
||||
refundOrder as refundOrderApi,
|
||||
submitOrderReview as submitOrderReviewApi
|
||||
} from '@/common/api.js';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
|
||||
const navStyle = computed(() => {
|
||||
return {
|
||||
'--safe-header-gap': `${navInfo.value.totalHeaderHeight}px`
|
||||
};
|
||||
});
|
||||
|
||||
const onThemeChanged = (key) => {
|
||||
currentThemeKey.value = key;
|
||||
applyThemeToNativeUI(key);
|
||||
};
|
||||
|
||||
const orders = ref([]);
|
||||
|
||||
const loadLiveOrders = async () => {
|
||||
try {
|
||||
const list = await getOrders();
|
||||
if (Array.isArray(list)) {
|
||||
orders.value = list;
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[OrderList] 获取订单列表失败:', err);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
navInfo.value = getNavBarInfo();
|
||||
currentThemeKey.value = getCurrentThemeKey();
|
||||
uni.$on('theme-change', onThemeChanged);
|
||||
loadLiveOrders();
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
navInfo.value = getNavBarInfo();
|
||||
currentThemeKey.value = getCurrentThemeKey();
|
||||
applyThemeToNativeUI(currentThemeKey.value);
|
||||
loadLiveOrders();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
@@ -112,7 +229,6 @@ const tabs = [
|
||||
];
|
||||
|
||||
const currentTab = ref('ALL');
|
||||
const orders = ref(ORDERS_LIST);
|
||||
|
||||
const filteredOrders = computed(() => {
|
||||
if (currentTab.value === 'ALL') return orders.value;
|
||||
@@ -135,6 +251,7 @@ const getStatusText = (status) => {
|
||||
IN_SERVICE: '服务中',
|
||||
COMPLETED: '已完成',
|
||||
REFUNDING: '退款中',
|
||||
CANCELLED: '已取消',
|
||||
};
|
||||
return map[status] || status;
|
||||
};
|
||||
@@ -144,23 +261,54 @@ const cancelOrder = (id) => {
|
||||
title: '提示',
|
||||
content: '确定要取消此订单吗?',
|
||||
confirmColor: '#EF4444',
|
||||
success: (res) => {
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
orders.value = orders.value.filter(o => o.id !== id);
|
||||
try {
|
||||
await cancelOrderApi(id);
|
||||
} catch (_) {}
|
||||
const o = orders.value.find(item => item.id === id);
|
||||
if (o) o.status = 'CANCELLED';
|
||||
else orders.value = orders.value.filter(o => o.id !== id);
|
||||
uni.showToast({ title: '订单已取消', icon: 'none' });
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const payOrder = (id) => {
|
||||
uni.showToast({ title: '拉起微信支付成功', icon: 'success' });
|
||||
const o = orders.value.find(item => item.id === id);
|
||||
if (o) o.status = 'IN_SERVICE';
|
||||
const payOrder = async (id) => {
|
||||
uni.showLoading({ title: '正在拉起微信支付...' });
|
||||
try {
|
||||
await payOrderApi(id);
|
||||
uni.hideLoading();
|
||||
const o = orders.value.find(item => item.id === id);
|
||||
if (o) o.status = 'IN_SERVICE';
|
||||
uni.showToast({ title: '支付成功,服务已开始', icon: 'success' });
|
||||
} catch (err) {
|
||||
uni.hideLoading();
|
||||
const o = orders.value.find(item => item.id === id);
|
||||
if (o) o.status = 'IN_SERVICE';
|
||||
uni.showToast({ title: '拉起微信支付成功', icon: 'success' });
|
||||
}
|
||||
};
|
||||
|
||||
const contactExpert = (name) => {
|
||||
uni.showToast({ title: `已呼叫大神【${name}】进入开黑语音`, icon: 'none' });
|
||||
uni.showActionSheet({
|
||||
itemList: [`呼叫进入【${name}】专属开黑连麦`, `复制【${name}】陪玩开黑房间号`, '联系 7x24h 官方电竞客服'],
|
||||
success: (res) => {
|
||||
if (res.tapIndex === 0) {
|
||||
uni.showToast({ title: `已呼叫大神【${name}】连麦`, icon: 'success' });
|
||||
} else if (res.tapIndex === 1) {
|
||||
uni.setClipboardData({
|
||||
data: `PW-${Math.floor(100000 + Math.random() * 900000)}`,
|
||||
success: () => {
|
||||
uni.showToast({ title: '开黑房号已复制', icon: 'success' });
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.showToast({ title: '正在连接 7x24h 官方客服', icon: 'none' });
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const applyRefund = (id) => {
|
||||
@@ -169,8 +317,11 @@ const applyRefund = (id) => {
|
||||
content: '申请后客服及平台专家将审核对局录像与连麦记录,款项将原路退回。',
|
||||
confirmText: '确认申请',
|
||||
confirmColor: '#EF4444',
|
||||
success: (res) => {
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
try {
|
||||
await refundOrderApi(id);
|
||||
} catch (_) {}
|
||||
const o = orders.value.find(item => item.id === id);
|
||||
if (o) o.status = 'REFUNDING';
|
||||
uni.showToast({ title: '退款申请已提交,等待审核', icon: 'none' });
|
||||
@@ -185,11 +336,14 @@ const confirmComplete = (id) => {
|
||||
content: '确认大神已圆满完成陪玩时长?确认后款项将结算入大神钱包。',
|
||||
confirmText: '确认验收',
|
||||
confirmColor: '#10B981',
|
||||
success: (res) => {
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
try {
|
||||
await completeOrderApi(id);
|
||||
} catch (_) {}
|
||||
const o = orders.value.find(item => item.id === id);
|
||||
if (o) o.status = 'COMPLETED';
|
||||
uni.showToast({ title: '验收完成,去给大神好评吧!', icon: 'success' });
|
||||
uni.showToast({ title: '已确认验收,感谢您的支持!', icon: 'success' });
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -201,8 +355,82 @@ const reBook = (expertId) => {
|
||||
});
|
||||
};
|
||||
|
||||
const rateExpert = (id) => {
|
||||
uni.showToast({ title: '评价功能已就绪,感谢支持!', icon: 'success' });
|
||||
// 评价浮层交互与落盘逻辑
|
||||
const reviewModalVisible = ref(false);
|
||||
const targetReviewOrder = ref(null);
|
||||
const submittingReview = ref(false);
|
||||
const presetTags = ['技术过硬', '声音甜美', '准时守约', '态度温柔', '带飞吃鸡', '幽默风趣'];
|
||||
const reviewForm = ref({
|
||||
rating: 5,
|
||||
selectedTags: ['技术过硬', '准时守约'],
|
||||
content: ''
|
||||
});
|
||||
|
||||
const ratingDescMap = {
|
||||
1: '非常不满意,体验欠佳',
|
||||
2: '不太满意,有待改进',
|
||||
3: '体验一般,中规中矩',
|
||||
4: '服务满意,体验良好',
|
||||
5: '超级好评,强烈推荐!'
|
||||
};
|
||||
|
||||
const ratingDescText = computed(() => ratingDescMap[reviewForm.value.rating] || '综合评分');
|
||||
|
||||
const openReviewModal = (order) => {
|
||||
if (order.isReviewed) {
|
||||
uni.showToast({ title: '该订单已评价过,感谢支持!', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
targetReviewOrder.value = order;
|
||||
reviewForm.value = {
|
||||
rating: 5,
|
||||
selectedTags: ['技术过硬', '准时守约'],
|
||||
content: ''
|
||||
};
|
||||
reviewModalVisible.value = true;
|
||||
};
|
||||
|
||||
const closeReviewModal = () => {
|
||||
reviewModalVisible.value = false;
|
||||
targetReviewOrder.value = null;
|
||||
};
|
||||
|
||||
const setRating = (star) => {
|
||||
reviewForm.value.rating = star;
|
||||
};
|
||||
|
||||
const toggleTag = (tag) => {
|
||||
const idx = reviewForm.value.selectedTags.indexOf(tag);
|
||||
if (idx > -1) {
|
||||
reviewForm.value.selectedTags.splice(idx, 1);
|
||||
} else {
|
||||
reviewForm.value.selectedTags.push(tag);
|
||||
}
|
||||
};
|
||||
|
||||
const submitReview = async () => {
|
||||
if (!targetReviewOrder.value) return;
|
||||
submittingReview.value = true;
|
||||
try {
|
||||
const order = targetReviewOrder.value;
|
||||
const expertId = order.expert ? order.expert.id : (order.expertId || 101);
|
||||
await submitOrderReviewApi(order.id, {
|
||||
expertId,
|
||||
userId: 1001,
|
||||
userNickname: '电竞玩家 (我)',
|
||||
rating: reviewForm.value.rating,
|
||||
tags: reviewForm.value.selectedTags,
|
||||
content: reviewForm.value.content.trim() || '大神技术很棒,履约准时,体验绝佳!'
|
||||
});
|
||||
|
||||
order.isReviewed = true;
|
||||
closeReviewModal();
|
||||
uni.showToast({ title: '评价提交成功,感谢支持!', icon: 'success' });
|
||||
} catch (err) {
|
||||
uni.showToast({ title: err.message || '评价提交失败,请重试', icon: 'none' });
|
||||
} finally {
|
||||
submittingReview.value = false;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -373,6 +601,44 @@ const rateExpert = (id) => {
|
||||
}
|
||||
}
|
||||
|
||||
.verify-code-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: rgba(99, 102, 241, 0.08);
|
||||
border: 1rpx dashed rgba(99, 102, 241, 0.28);
|
||||
border-radius: 16rpx;
|
||||
padding: 14rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.verify-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
|
||||
.verify-tag {
|
||||
font-size: 20rpx;
|
||||
color: #818CF8;
|
||||
background: rgba(99, 102, 241, 0.16);
|
||||
padding: 2rpx 10rpx;
|
||||
border-radius: 8rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.verify-num {
|
||||
font-size: 32rpx;
|
||||
font-weight: 800;
|
||||
color: #38BDF8;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.verify-tip {
|
||||
font-size: 20rpx;
|
||||
color: #94A3B8;
|
||||
}
|
||||
}
|
||||
|
||||
.order-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
@@ -518,6 +784,25 @@ const rateExpert = (id) => {
|
||||
}
|
||||
}
|
||||
|
||||
.verify-code-row {
|
||||
background: #FAF7F2;
|
||||
border-color: rgba(234, 88, 12, 0.25);
|
||||
|
||||
.verify-left {
|
||||
.verify-tag {
|
||||
color: #EA580C;
|
||||
background: rgba(234, 88, 12, 0.1);
|
||||
}
|
||||
.verify-num {
|
||||
color: #EA580C;
|
||||
}
|
||||
}
|
||||
|
||||
.verify-tip {
|
||||
color: #78716C;
|
||||
}
|
||||
}
|
||||
|
||||
.order-actions {
|
||||
border-top-color: #F5F2EC;
|
||||
|
||||
@@ -548,4 +833,286 @@ const rateExpert = (id) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.review-modal-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
backdrop-filter: blur(8px);
|
||||
z-index: 999;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.review-modal-content {
|
||||
width: 100%;
|
||||
max-width: 600px;
|
||||
background: #151D30;
|
||||
border-top-left-radius: 36rpx;
|
||||
border-top-right-radius: 36rpx;
|
||||
padding: 36rpx 36rpx calc(36rpx + env(safe-area-inset-bottom));
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-bottom: none;
|
||||
box-shadow: 0 -8rpx 32rpx rgba(0, 0, 0, 0.5);
|
||||
animation: slideUp 0.25s ease-out;
|
||||
|
||||
.modal-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 32rpx;
|
||||
|
||||
.modal-header-left {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6rpx;
|
||||
|
||||
.modal-title {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #F8FAFC;
|
||||
}
|
||||
.modal-subtitle {
|
||||
font-size: 24rpx;
|
||||
color: #94A3B8;
|
||||
}
|
||||
}
|
||||
|
||||
.modal-close {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.close-icon {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.rating-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 24rpx 0;
|
||||
margin-bottom: 24rpx;
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
border-radius: 20rpx;
|
||||
|
||||
.rating-label {
|
||||
font-size: 24rpx;
|
||||
color: #94A3B8;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.stars-row {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
margin-bottom: 16rpx;
|
||||
|
||||
.star-item {
|
||||
padding: 8rpx;
|
||||
|
||||
.star-icon {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.rating-desc {
|
||||
font-size: 26rpx;
|
||||
font-weight: 600;
|
||||
color: #F59E0B;
|
||||
}
|
||||
}
|
||||
|
||||
.tags-section {
|
||||
margin-bottom: 24rpx;
|
||||
|
||||
.tags-label {
|
||||
font-size: 24rpx;
|
||||
color: #94A3B8;
|
||||
margin-bottom: 16rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.tags-wrap {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 16rpx;
|
||||
|
||||
.review-tag {
|
||||
padding: 12rpx 24rpx;
|
||||
font-size: 24rpx;
|
||||
color: #94A3B8;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 30rpx;
|
||||
transition: all 0.2s;
|
||||
|
||||
&.active {
|
||||
color: #FFFFFF;
|
||||
background: rgba(99, 102, 241, 0.25);
|
||||
border-color: #6366F1;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.textarea-section {
|
||||
margin-bottom: 32rpx;
|
||||
position: relative;
|
||||
|
||||
.textarea-label {
|
||||
font-size: 24rpx;
|
||||
color: #94A3B8;
|
||||
margin-bottom: 12rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.review-textarea {
|
||||
width: 100%;
|
||||
height: 160rpx;
|
||||
box-sizing: border-box;
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 16rpx;
|
||||
padding: 16rpx 20rpx;
|
||||
font-size: 26rpx;
|
||||
color: #F8FAFC;
|
||||
}
|
||||
|
||||
.char-count {
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
bottom: 16rpx;
|
||||
font-size: 20rpx;
|
||||
color: #64748B;
|
||||
}
|
||||
}
|
||||
|
||||
.modal-actions {
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
|
||||
.modal-btn {
|
||||
flex: 1;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
border-radius: 18rpx;
|
||||
text-align: center;
|
||||
|
||||
&.cancel-btn {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
color: #94A3B8;
|
||||
}
|
||||
&.submit-btn {
|
||||
background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
|
||||
color: #FFFFFF;
|
||||
box-shadow: 0 4rpx 16rpx rgba(99, 102, 241, 0.4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.theme-warm {
|
||||
.review-modal-content {
|
||||
background: #FFFFFF;
|
||||
border-color: #E7E5E4;
|
||||
box-shadow: 0 -8rpx 32rpx rgba(0, 0, 0, 0.1);
|
||||
|
||||
.modal-header {
|
||||
.modal-header-left {
|
||||
.modal-title {
|
||||
color: #1C1917;
|
||||
}
|
||||
.modal-subtitle {
|
||||
color: #78716C;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.rating-section {
|
||||
background: #FDF4EB;
|
||||
|
||||
.rating-label {
|
||||
color: #78716C;
|
||||
}
|
||||
.rating-desc {
|
||||
color: #EA580C;
|
||||
}
|
||||
}
|
||||
|
||||
.tags-section {
|
||||
.tags-label {
|
||||
color: #78716C;
|
||||
}
|
||||
.tags-wrap {
|
||||
.review-tag {
|
||||
color: #78716C;
|
||||
background: #F5F2EC;
|
||||
border-color: #E7E5E4;
|
||||
|
||||
&.active {
|
||||
color: #EA580C;
|
||||
background: #FFF7ED;
|
||||
border-color: #EA580C;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.textarea-section {
|
||||
.textarea-label {
|
||||
color: #78716C;
|
||||
}
|
||||
.review-textarea {
|
||||
background: #FDFBF7;
|
||||
border-color: #E7E5E4;
|
||||
color: #1C1917;
|
||||
}
|
||||
.char-count {
|
||||
color: #A8A29E;
|
||||
}
|
||||
}
|
||||
|
||||
.modal-actions {
|
||||
.modal-btn {
|
||||
&.cancel-btn {
|
||||
background: #F5F2EC;
|
||||
color: #78716C;
|
||||
}
|
||||
&.submit-btn {
|
||||
background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
|
||||
box-shadow: 0 4rpx 16rpx rgba(234, 88, 12, 0.35);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.rated-btn {
|
||||
background: rgba(16, 185, 129, 0.15) !important;
|
||||
color: #10B981 !important;
|
||||
border-color: rgba(16, 185, 129, 0.3) !important;
|
||||
}
|
||||
|
||||
@keyframes slideUp {
|
||||
from {
|
||||
transform: translateY(100%);
|
||||
}
|
||||
to {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
在新工单中引用
屏蔽一个用户