feat(pwuniapp): 在HBuilderX原生工程中实现电竞暗夜流光全套静态UI页面及4位门票核销

这个提交包含在:
wikiboss
2026-09-16 16:47:30 +08:00
父节点 1fafbf977a
当前提交 935d6fa840
共有 34 个文件被更改,包括 3919 次插入 和 11244 次删除

查看文件

@@ -0,0 +1,448 @@
<template>
<view class="create-order-container">
<!-- 服务大神与项目信息 -->
<view class="order-card">
<view class="expert-profile">
<image class="expert-avatar" :src="expert.avatar" mode="aspectFill" />
<view class="expert-meta">
<view class="name-row">
<text class="expert-name">{{ expert.nickname }}</text>
<text class="game-tag">{{ expert.game }}</text>
</view>
<text class="service-title">{{ selectedService.title }}</text>
</view>
<view class="price-single">
<text class="price-unit">¥{{ selectedService.price }}/{{ selectedService.unit }}</text>
</view>
</view>
</view>
<!-- 数量/时长步进器 -->
<view class="order-card">
<view class="stepper-row">
<view class="stepper-label">
<text class="label-main">购买时长</text>
<text class="label-sub">以{{ selectedService.unit }}为计费单位</text>
</view>
<view class="stepper-box">
<button class="step-btn btn-active" :disabled="hours <= 1" @click="changeHours(-1)">-</button>
<text class="step-val">{{ hours }} {{ selectedService.unit }}</text>
<button class="step-btn btn-active" :disabled="hours >= 10" @click="changeHours(1)">+</button>
</view>
</view>
</view>
<!-- 开黑时段选择 -->
<view class="order-card">
<view class="section-title">服务时间</view>
<view class="time-tabs">
<view
class="time-tab btn-active"
:class="{ active: timeType === 'NOW' }"
@click="timeType = 'NOW'"
>
<text class="tab-t">⚡ 即刻出发</text>
<text class="tab-d">付款后立即连麦开黑</text>
</view>
<view
class="time-tab btn-active"
:class="{ active: timeType === 'APPOINT' }"
@click="timeType = 'APPOINT'"
>
<text class="tab-t">📅 预约时间</text>
<text class="tab-d">今晚 20:30 开打</text>
</view>
</view>
</view>
<!-- 优惠抵扣与备注 -->
<view class="order-card">
<view class="coupon-row btn-active" @click="selectCoupon">
<text class="cell-label">优惠券</text>
<view class="cell-right">
<text class="coupon-val">-¥{{ discount }} (新人首单立减)</text>
<text class="arrow">></text>
</view>
</view>
<view class="remark-row">
<text class="cell-label">开黑要求/游戏ID</text>
<input class="remark-input" v-model="remark" placeholder="如:QQ区/王者段位/包赢" placeholder-class="ph" />
</view>
</view>
<!-- 费用明细清单 -->
<view class="order-card">
<view class="fee-row">
<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>
<view class="fee-row total-row">
<text class="fee-k">实付金额</text>
<text class="fee-v pay-val">¥{{ finalTotal }}</text>
</view>
</view>
<!-- 底部固定结算条 -->
<view class="bottom-bar">
<view class="amount-wrap">
<text class="amount-label">实付:</text>
<text class="amount-num">¥{{ finalTotal }}</text>
</view>
<button class="btn-pay btn-active" @click="handlePay">微信支付</button>
</view>
</view>
</template>
<script setup>
import { ref, computed } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { EXPERTS_LIST } from '@/common/mock.js';
const expert = ref(EXPERTS_LIST[0]);
const selectedService = ref(EXPERTS_LIST[0].services[0]);
const hours = ref(2);
const timeType = ref('NOW');
const discount = ref(10);
const remark = ref('');
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];
}
}
}
});
const rawTotal = computed(() => {
return (selectedService.value ? selectedService.value.price : 35) * hours.value;
});
const finalTotal = computed(() => {
const total = rawTotal.value - discount.value;
return total > 0 ? total : 0;
});
const changeHours = (delta) => {
hours.value = Math.max(1, Math.min(10, hours.value + delta));
};
const selectCoupon = () => {
uni.showToast({ title: '已自动匹配最高优惠券 -¥10', icon: 'none' });
};
const handlePay = () => {
uni.showLoading({ title: '正在拉起微信支付...' });
setTimeout(() => {
uni.hideLoading();
uni.showToast({
title: '支付成功!服务已生成',
icon: 'success',
duration: 1500
});
setTimeout(() => {
uni.switchTab({
url: '/pages/order/list'
});
}, 1200);
}, 1000);
};
</script>
<style lang="scss" scoped>
.create-order-container {
min-height: 100vh;
background-color: #0A0F1D;
padding: 24rpx 32rpx 160rpx;
}
.order-card {
background-color: #151D30;
border-radius: 24rpx;
padding: 28rpx;
margin-bottom: 24rpx;
border: 1px solid rgba(255, 255, 255, 0.06);
.expert-profile {
display: flex;
align-items: center;
.expert-avatar {
width: 96rpx;
height: 96rpx;
border-radius: 48rpx;
margin-right: 20rpx;
}
.expert-meta {
flex: 1;
.name-row {
display: flex;
align-items: center;
gap: 12rpx;
margin-bottom: 8rpx;
.expert-name {
font-size: 28rpx;
font-weight: 700;
color: #F8FAFC;
}
.game-tag {
font-size: 20rpx;
background: rgba(99, 102, 241, 0.2);
color: #818CF8;
padding: 2rpx 10rpx;
border-radius: 6rpx;
}
}
.service-title {
font-size: 24rpx;
color: #94A3B8;
}
}
.price-single {
.price-unit {
font-size: 26rpx;
font-weight: 600;
color: #10B981;
}
}
}
.stepper-row {
display: flex;
justify-content: space-between;
align-items: center;
.stepper-label {
display: flex;
flex-direction: column;
.label-main {
font-size: 28rpx;
color: #F8FAFC;
font-weight: 600;
}
.label-sub {
font-size: 20rpx;
color: #64748B;
margin-top: 4rpx;
}
}
.stepper-box {
display: flex;
align-items: center;
background: rgba(255, 255, 255, 0.04);
border-radius: 16rpx;
padding: 6rpx;
.step-btn {
width: 60rpx;
height: 60rpx;
line-height: 56rpx;
padding: 0;
background: #1E2942;
color: #FFF;
font-size: 32rpx;
border-radius: 12rpx;
border: none;
margin: 0;
}
.step-val {
font-size: 28rpx;
color: #F8FAFC;
font-weight: 600;
margin: 0 24rpx;
}
}
}
.section-title {
font-size: 26rpx;
font-weight: 600;
color: #F8FAFC;
margin-bottom: 18rpx;
}
.time-tabs {
display: flex;
gap: 16rpx;
.time-tab {
flex: 1;
background: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 16rpx;
padding: 20rpx;
text-align: center;
&.active {
background: rgba(99, 102, 241, 0.15);
border-color: #6366F1;
.tab-t {
color: #818CF8;
font-weight: 700;
}
}
.tab-t {
font-size: 26rpx;
color: #CBD5E1;
display: block;
margin-bottom: 6rpx;
}
.tab-d {
font-size: 20rpx;
color: #64748B;
}
}
}
.coupon-row {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 20rpx;
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
.cell-label {
font-size: 26rpx;
color: #CBD5E1;
}
.cell-right {
display: flex;
align-items: center;
gap: 8rpx;
.coupon-val {
font-size: 24rpx;
color: #10B981;
font-weight: 600;
}
.arrow {
font-size: 24rpx;
color: #64748B;
}
}
}
.remark-row {
display: flex;
align-items: center;
padding-top: 20rpx;
.cell-label {
font-size: 24rpx;
color: #64748B;
width: 220rpx;
}
.remark-input {
flex: 1;
font-size: 24rpx;
color: #F8FAFC;
}
.ph {
color: #475569;
}
}
.fee-row {
display: flex;
justify-content: space-between;
font-size: 24rpx;
margin-bottom: 12rpx;
.fee-k {
color: #94A3B8;
}
.fee-v {
color: #E2E8F0;
font-weight: 500;
&.green {
color: #10B981;
}
}
&.total-row {
border-top: 1px solid rgba(255, 255, 255, 0.06);
padding-top: 16rpx;
margin-top: 16rpx;
margin-bottom: 0;
.fee-k {
font-size: 26rpx;
color: #F8FAFC;
font-weight: 600;
}
.pay-val {
font-size: 34rpx;
color: #10B981;
font-weight: 700;
}
}
}
}
.bottom-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 120rpx;
background-color: rgba(21, 29, 48, 0.95);
backdrop-filter: blur(12px);
border-top: 1px solid rgba(255, 255, 255, 0.08);
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 32rpx;
z-index: 100;
.amount-wrap {
display: flex;
align-items: baseline;
.amount-label {
font-size: 24rpx;
color: #94A3B8;
}
.amount-num {
font-size: 40rpx;
font-weight: 700;
color: #10B981;
}
}
.btn-pay {
background: linear-gradient(135deg, #10B981 0%, #059669 100%);
color: #FFF;
font-size: 28rpx;
font-weight: 700;
border-radius: 44rpx;
height: 80rpx;
line-height: 80rpx;
padding: 0 60rpx;
box-shadow: 0 4rpx 20rpx rgba(16, 185, 129, 0.35);
margin: 0;
}
}
</style>

查看文件

@@ -0,0 +1,412 @@
<template>
<view class="order-list-container">
<!-- 顶部状态分类 Tab -->
<view class="tab-header">
<view
v-for="tab in tabs"
:key="tab.key"
class="tab-item btn-active"
:class="{ active: currentTab === tab.key }"
@click="switchTab(tab.key)"
>
<text class="tab-text">{{ tab.name }}</text>
<view class="tab-indicator" v-if="currentTab === tab.key"></view>
</view>
</view>
<!-- 订单列表 -->
<view class="orders-wrap">
<view
v-for="order in filteredOrders"
:key="order.id"
class="order-card"
>
<!-- 订单卡片顶部 -->
<view class="order-head">
<text class="order-sn">单号:{{ order.orderSn }}</text>
<view class="status-pill" :class="order.status">
{{ getStatusText(order.status) }}
</view>
</view>
<!-- 陪玩与服务信息 -->
<view class="expert-block">
<image class="expert-avatar" :src="order.expert.avatar" mode="aspectFill" />
<view class="expert-meta">
<view class="name-row">
<text class="expert-name">{{ order.expert.nickname }}</text>
<text class="game-tag">{{ order.expert.game }}</text>
</view>
<text class="service-name">{{ order.serviceTitle }}</text>
<text class="order-time">下单时间:{{ order.createdAt }}</text>
</view>
<view class="amount-box">
<text class="amount-val">¥{{ order.totalAmount }}</text>
<text class="quantity-text">共 {{ order.quantity }} 小时</text>
</view>
</view>
<!-- 底部业务操作按钮组 -->
<view class="order-actions">
<template v-if="order.status === 'PENDING_PAY'">
<button class="action-btn cancel-btn btn-active" @click="cancelOrder(order.id)">取消</button>
<button class="action-btn primary-btn btn-active" @click="payOrder(order.id)">立即付款</button>
</template>
<template v-else-if="order.status === 'IN_SERVICE'">
<button class="action-btn chat-btn btn-active" @click="contactExpert(order.expert.nickname)">联系大神</button>
<button class="action-btn refund-btn btn-active" @click="applyRefund(order.id)">申请退款</button>
<button class="action-btn success-btn btn-active" @click="confirmComplete(order.id)">确认验收</button>
</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>
</template>
</view>
</view>
<view v-if="filteredOrders.length === 0" class="empty-state">
<text class="empty-icon">📦</text>
<text class="empty-text">暂无此类订单</text>
</view>
</view>
</view>
</template>
<script setup>
import { ref, computed } from 'vue';
import { ORDERS_LIST } from '@/common/mock.js';
const tabs = [
{ key: 'ALL', name: '全部' },
{ key: 'IN_SERVICE', name: '进行中' },
{ key: 'PENDING_PAY', name: '待付款' },
{ key: 'COMPLETED', name: '已完成' },
];
const currentTab = ref('ALL');
const orders = ref(ORDERS_LIST);
const filteredOrders = computed(() => {
if (currentTab.value === 'ALL') return orders.value;
return orders.value.filter(o => o.status === currentTab.value);
});
const switchTab = (tabKey) => {
currentTab.value = tabKey;
};
const getStatusText = (status) => {
const map = {
PENDING_PAY: '待付款',
IN_SERVICE: '服务中',
COMPLETED: '已完成',
REFUNDING: '退款中',
};
return map[status] || status;
};
const cancelOrder = (id) => {
uni.showModal({
title: '提示',
content: '确定要取消此订单吗?',
confirmColor: '#EF4444',
success: (res) => {
if (res.confirm) {
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 contactExpert = (name) => {
uni.showToast({ title: `已呼叫大神【${name}】进入开黑语音`, icon: 'none' });
};
const applyRefund = (id) => {
uni.showModal({
title: '申请退款/售后仲裁',
content: '申请后客服及平台专家将审核对局录像与连麦记录,款项将原路退回。',
confirmText: '确认申请',
confirmColor: '#EF4444',
success: (res) => {
if (res.confirm) {
const o = orders.value.find(item => item.id === id);
if (o) o.status = 'REFUNDING';
uni.showToast({ title: '退款申请已提交,等待审核', icon: 'none' });
}
}
});
};
const confirmComplete = (id) => {
uni.showModal({
title: '确认验收',
content: '确认大神已圆满完成陪玩时长?确认后款项将结算入大神钱包。',
confirmText: '确认验收',
confirmColor: '#10B981',
success: (res) => {
if (res.confirm) {
const o = orders.value.find(item => item.id === id);
if (o) o.status = 'COMPLETED';
uni.showToast({ title: '验收完成,去给大神好评吧!', icon: 'success' });
}
}
});
};
const reBook = (expertId) => {
uni.navigateTo({
url: `/pages/expert/detail?id=${expertId}`
});
};
const rateExpert = (id) => {
uni.showToast({ title: '评价功能已就绪,感谢支持!', icon: 'success' });
};
</script>
<style lang="scss" scoped>
.order-list-container {
min-height: 100vh;
background-color: #0A0F1D;
padding: 20rpx 32rpx 140rpx;
}
.tab-header {
display: flex;
background-color: #151D30;
border-radius: 20rpx;
padding: 8rpx;
margin-bottom: 24rpx;
border: 1px solid rgba(255, 255, 255, 0.06);
.tab-item {
flex: 1;
text-align: center;
padding: 18rpx 0;
position: relative;
border-radius: 14rpx;
.tab-text {
font-size: 26rpx;
color: #94A3B8;
font-weight: 500;
}
&.active {
background: rgba(99, 102, 241, 0.18);
.tab-text {
color: #FFFFFF;
font-weight: 700;
}
.tab-indicator {
position: absolute;
bottom: 4rpx;
left: 50%;
transform: translateX(-50%);
width: 32rpx;
height: 6rpx;
background: #6366F1;
border-radius: 3rpx;
box-shadow: 0 0 10rpx #6366F1;
}
}
}
}
.orders-wrap {
display: flex;
flex-direction: column;
gap: 24rpx;
.order-card {
background-color: #151D30;
border-radius: 24rpx;
padding: 28rpx;
border: 1px solid rgba(255, 255, 255, 0.06);
box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.3);
.order-head {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
padding-bottom: 16rpx;
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
.order-sn {
font-size: 22rpx;
color: #64748B;
font-family: monospace;
}
.status-pill {
font-size: 20rpx;
padding: 4rpx 14rpx;
border-radius: 12rpx;
font-weight: 600;
&.PENDING_PAY {
background: rgba(245, 158, 11, 0.15);
color: #F59E0B;
}
&.IN_SERVICE {
background: rgba(16, 185, 129, 0.15);
color: #10B981;
}
&.COMPLETED {
background: rgba(148, 163, 184, 0.15);
color: #94A3B8;
}
&.REFUNDING {
background: rgba(239, 68, 68, 0.15);
color: #EF4444;
}
}
}
.expert-block {
display: flex;
align-items: center;
margin-bottom: 20rpx;
.expert-avatar {
width: 88rpx;
height: 88rpx;
border-radius: 44rpx;
margin-right: 18rpx;
}
.expert-meta {
flex: 1;
.name-row {
display: flex;
align-items: center;
gap: 10rpx;
margin-bottom: 6rpx;
.expert-name {
font-size: 28rpx;
font-weight: 700;
color: #F8FAFC;
}
.game-tag {
font-size: 20rpx;
color: #818CF8;
background: rgba(99, 102, 241, 0.15);
padding: 2rpx 8rpx;
border-radius: 6rpx;
}
}
.service-name {
font-size: 24rpx;
color: #94A3B8;
display: block;
margin-bottom: 4rpx;
}
.order-time {
font-size: 20rpx;
color: #64748B;
}
}
.amount-box {
text-align: right;
.amount-val {
font-size: 34rpx;
font-weight: 700;
color: #10B981;
display: block;
}
.quantity-text {
font-size: 20rpx;
color: #64748B;
}
}
}
.order-actions {
display: flex;
justify-content: flex-end;
gap: 16rpx;
padding-top: 16rpx;
border-top: 1px solid rgba(255, 255, 255, 0.05);
.action-btn {
height: 60rpx;
line-height: 58rpx;
padding: 0 26rpx;
font-size: 22rpx;
border-radius: 30rpx;
margin: 0;
&.cancel-btn {
background: transparent;
color: #94A3B8;
border: 1px solid rgba(255, 255, 255, 0.12);
}
&.primary-btn {
background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
color: #FFF;
border: none;
}
&.chat-btn {
background: rgba(99, 102, 241, 0.12);
color: #818CF8;
border: 1px solid rgba(99, 102, 241, 0.25);
}
&.refund-btn {
background: rgba(239, 68, 68, 0.1);
color: #EF4444;
border: 1px solid rgba(239, 68, 68, 0.25);
}
&.success-btn {
background: linear-gradient(135deg, #10B981 0%, #059669 100%);
color: #FFF;
border: none;
}
&.rate-btn {
background: rgba(245, 158, 11, 0.15);
color: #F59E0B;
border: 1px solid rgba(245, 158, 11, 0.3);
}
}
}
}
.empty-state {
text-align: center;
padding: 100rpx 0;
.empty-icon {
font-size: 64rpx;
display: block;
margin-bottom: 16rpx;
}
.empty-text {
color: #64748B;
font-size: 26rpx;
}
}
}
</style>