feat: 完善对象存储上传与真实条码二维码引擎,彻底剥离保底Mock数据
这个提交包含在:
@@ -92,125 +92,330 @@
|
||||
<view class="input-row" v-if="form.payType === 'AA'">
|
||||
<text class="row-label">人均分摊 (元/人)</text>
|
||||
<input
|
||||
class="row-input"
|
||||
class="row-input price-input"
|
||||
type="digit"
|
||||
v-model="form.aaFee"
|
||||
placeholder="如:50"
|
||||
placeholder-class="ph"
|
||||
placeholder-class="price-ph"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="input-row" v-else>
|
||||
<text class="row-label">房主买单预算 (元)</text>
|
||||
<input
|
||||
class="row-input"
|
||||
type="digit"
|
||||
v-model="form.totalFee"
|
||||
placeholder="如:500"
|
||||
placeholder-class="ph"
|
||||
/>
|
||||
<view v-else>
|
||||
<!-- 房主请客 / 悬赏组队 出价模式切换 -->
|
||||
<view class="pricing-mode-row">
|
||||
<text class="row-label">出价方式</text>
|
||||
<view class="pricing-mode-group">
|
||||
<view
|
||||
class="pricing-mode-btn"
|
||||
:class="{ active: form.pricingMode === 'PER_PERSON' }"
|
||||
@click="form.pricingMode = 'PER_PERSON'"
|
||||
>
|
||||
按人出价
|
||||
</view>
|
||||
<view
|
||||
class="pricing-mode-btn"
|
||||
:class="{ active: form.pricingMode === 'TOTAL' }"
|
||||
@click="form.pricingMode = 'TOTAL'"
|
||||
>
|
||||
包场总预算
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="input-row" v-if="form.pricingMode === 'PER_PERSON'">
|
||||
<text class="row-label">单人出价 (元/人)</text>
|
||||
<input
|
||||
class="row-input price-input"
|
||||
type="digit"
|
||||
v-model="form.perPersonFee"
|
||||
placeholder="如:500"
|
||||
placeholder-class="price-ph"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 常用赏金快捷选项 (按人出价) -->
|
||||
<view class="preset-price-row" v-if="form.pricingMode === 'PER_PERSON'">
|
||||
<text class="preset-label">快捷赏金:</text>
|
||||
<view class="preset-chips">
|
||||
<view
|
||||
v-for="amt in [200, 300, 500, 800, 1000]"
|
||||
:key="amt"
|
||||
class="preset-chip btn-active"
|
||||
:class="{ selected: Number(form.perPersonFee) === amt }"
|
||||
@click="form.perPersonFee = amt"
|
||||
>
|
||||
¥{{ amt }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="input-row" v-else>
|
||||
<text class="row-label">房主买单总预算 (元)</text>
|
||||
<input
|
||||
class="row-input price-input"
|
||||
type="digit"
|
||||
v-model="form.totalFee"
|
||||
placeholder="如:2000"
|
||||
placeholder-class="price-ph"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 常用总预算快捷选项 (包场总预算) -->
|
||||
<view class="preset-price-row" v-if="form.pricingMode === 'TOTAL'">
|
||||
<text class="preset-label">快捷预算:</text>
|
||||
<view class="preset-chips">
|
||||
<view
|
||||
v-for="amt in [500, 1000, 2000, 3000, 5000]"
|
||||
:key="amt"
|
||||
class="preset-chip btn-active"
|
||||
:class="{ selected: Number(form.totalFee) === amt }"
|
||||
@click="form.totalFee = amt"
|
||||
>
|
||||
¥{{ amt }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="calc-preview">
|
||||
<text class="preview-label">预算测算:</text>
|
||||
<text class="preview-val highlight">
|
||||
{{ form.payType === 'AA' ? `总费用预估约 ¥${calcTotalFee} (人均 ¥${form.aaFee || 0})` : `参与者免费报名,房主请客全包约 ¥${form.totalFee || 0}` }}
|
||||
{{
|
||||
form.payType === 'AA'
|
||||
? `总费用预估约 ¥${calcTotalFee} (人均 ¥${form.aaFee || 0})`
|
||||
: form.pricingMode === 'PER_PERSON'
|
||||
? `单人出价 ¥${form.perPersonFee || 0} × 招募${form.maxParticipants}人 = 预估总额 ¥${calcTotalFee} (发单后可随时追加金额)`
|
||||
: `房主全额买单请客,总预算约 ¥${form.totalFee || 0} (发单后可随时追加预算)`
|
||||
}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 房主调价与追加金额设置 (随时灵活追加) -->
|
||||
<view class="form-card dynamic-price-card" v-if="form.payType === 'PROJECT'">
|
||||
<view class="card-header-switch">
|
||||
<view class="switch-title-box">
|
||||
<text class="form-title">灵活调价与追加金额设置</text>
|
||||
<text class="sub-label">组局进行中允许房主随时追加金额、加赏加急或修改单价</text>
|
||||
</view>
|
||||
<switch
|
||||
:checked="form.allowDynamicPrice"
|
||||
@change="form.allowDynamicPrice = $event.detail.value"
|
||||
color="#6366F1"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="dynamic-config-body" v-if="form.allowDynamicPrice">
|
||||
<text class="config-sec-title">追加金额/改价补差规则</text>
|
||||
<view class="rule-cards">
|
||||
<view
|
||||
class="rule-card"
|
||||
:class="{ active: form.priceAdjustRule === 'UNIFIED_HIGH' }"
|
||||
@click="form.priceAdjustRule = 'UNIFIED_HIGH'"
|
||||
>
|
||||
<view class="rule-card-header">
|
||||
<text class="rule-name">全员同享追加新高价</text>
|
||||
<text class="rule-tag recommend">推荐</text>
|
||||
</view>
|
||||
<text class="rule-desc">
|
||||
房主追加金额提价时(如从 500元/人 追加提高到 800元/人),已报名的成员自动同步补齐 300元 差额。先行者不吃亏,大幅提升组队热度。
|
||||
</text>
|
||||
</view>
|
||||
|
||||
<view
|
||||
class="rule-card"
|
||||
:class="{ active: form.priceAdjustRule === 'TIERED' }"
|
||||
@click="form.priceAdjustRule = 'TIERED'"
|
||||
>
|
||||
<view class="rule-card-header">
|
||||
<text class="rule-name">阶梯差价招募</text>
|
||||
</view>
|
||||
<text class="rule-desc">
|
||||
追加金额仅对后续新加入的成员生效。已报名的老成员按其报名时的出价结算,互不影响。
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 调价场景与降价提示说明 -->
|
||||
<view class="scenario-notice">
|
||||
<text class="notice-title">灵活追加金额说明:</text>
|
||||
<text class="notice-item">• 随时追加金额:如原定 500元/人 招募4人,已有2人报名;房主在活动页可随时点击【追加金额】,选择按人追加(如每人追加 +¥300)或整局追加预算,系统自动完成老成员差额补偿与看板刷新。</text>
|
||||
<text class="notice-item">• 降价调整保护:若房主手动调低单价,已报名的 2 人仍按原价受协议保护,新报名单人出价生效。</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部发起操作栏 (适配安全区) -->
|
||||
<view class="bottom-bar">
|
||||
<button class="btn-submit btn-active" @click="handleSubmit">
|
||||
立即发起同城组局
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<!-- 敏感商圈智能风控友好预检弹窗 (P1安全风控) -->
|
||||
<view class="risk-modal-mask" v-if="riskModalVisible" @click.self="riskModalVisible = false">
|
||||
<view class="risk-modal-box">
|
||||
<view class="risk-modal-header">
|
||||
<image class="risk-shield-icon" :src="ICONS.shield" mode="aspectFit" />
|
||||
<text class="risk-title">同城线下组局安全风控提示</text>
|
||||
</view>
|
||||
<view class="risk-body">
|
||||
<text class="risk-desc">
|
||||
平台严格保障人身安全,严禁将私人住宅、酒店客房、封闭公寓等非公开场所作为履约地点。
|
||||
</text>
|
||||
<text class="risk-sub-tip">请选择以下平台认证的示范公开商圈:</text>
|
||||
<view class="recommend-zones">
|
||||
<view
|
||||
v-for="zone in recommendPublicZones"
|
||||
:key="zone"
|
||||
class="zone-chip btn-active"
|
||||
@click="applyRecommendZone(zone)"
|
||||
>
|
||||
<image class="zone-pin-icon" :src="ICONS.mapPin" mode="aspectFit" />
|
||||
<text class="zone-text">{{ zone }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="risk-footer">
|
||||
<button class="risk-cancel-btn btn-active" @click="riskModalVisible = false">修改地点</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { ACTIVITIES_LIST } from '@/common/mock.js';
|
||||
import { getCurrentThemeKey } from '@/common/theme.js';
|
||||
import { createActivity } from '@/common/api.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
|
||||
const games = ['美食陪吃', '同城陪唱', '下午茶陪喝', '同城微醺', '同城桌游', '热门电竞'];
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
|
||||
const onThemeChanged = (key) => {
|
||||
currentThemeKey.value = key;
|
||||
applyThemeToNativeUI(key);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
currentThemeKey.value = getCurrentThemeKey();
|
||||
applyThemeToNativeUI(currentThemeKey.value);
|
||||
uni.$on('theme-change', onThemeChanged);
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
currentThemeKey.value = getCurrentThemeKey();
|
||||
applyThemeToNativeUI(currentThemeKey.value);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
uni.$off('theme-change', onThemeChanged);
|
||||
});
|
||||
|
||||
const form = ref({
|
||||
payType: 'AA',
|
||||
payType: 'PROJECT',
|
||||
game: '美食陪吃',
|
||||
title: '',
|
||||
startTime: '周六 18:30',
|
||||
location: '北京市朝阳区三里屯商圈',
|
||||
maxParticipants: 4,
|
||||
aaFee: 50,
|
||||
totalFee: 200,
|
||||
pricingMode: 'PER_PERSON',
|
||||
perPersonFee: 500,
|
||||
totalFee: 2000,
|
||||
allowDynamicPrice: true,
|
||||
priceAdjustRule: 'UNIFIED_HIGH',
|
||||
});
|
||||
|
||||
const calcTotalFee = computed(() => {
|
||||
if (form.value.payType === 'AA') {
|
||||
return (Number(form.value.aaFee) || 0) * form.value.maxParticipants;
|
||||
}
|
||||
if (form.value.pricingMode === 'PER_PERSON') {
|
||||
return (Number(form.value.perPersonFee) || 0) * form.value.maxParticipants;
|
||||
}
|
||||
return Number(form.value.totalFee) || 0;
|
||||
});
|
||||
|
||||
const riskModalVisible = ref(false);
|
||||
const recommendPublicZones = [
|
||||
'北京市朝阳区三里屯太古里 (AAA公开商圈)',
|
||||
'北京市朝阳区工体纯K量贩KTV (正规量贩)',
|
||||
'北京市朝阳区国贸CBD商业街 (阳光示范商圈)',
|
||||
'北京市海淀区五道口购物中心 (高校商圈)'
|
||||
];
|
||||
|
||||
const applyRecommendZone = (zone) => {
|
||||
form.value.location = zone;
|
||||
riskModalVisible.value = false;
|
||||
uni.showToast({
|
||||
title: '已选定合规商圈,请继续发起',
|
||||
icon: 'none',
|
||||
duration: 1500
|
||||
});
|
||||
};
|
||||
|
||||
const changeParticipants = (delta) => {
|
||||
form.value.maxParticipants = Math.max(2, Math.min(10, form.value.maxParticipants + delta));
|
||||
};
|
||||
|
||||
const handleSubmit = () => {
|
||||
const handleSubmit = async () => {
|
||||
// P1 敏感商圈安全风控友好预检拦截
|
||||
const sensitivePattern = /(酒店|客房|宾馆|民宿|旅馆|公寓|小区|住宅|私密|住宅区|私人房|卧室)/;
|
||||
if (sensitivePattern.test(form.value.location)) {
|
||||
riskModalVisible.value = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!form.value.title.trim()) {
|
||||
form.value.title = `【${form.value.game}】同城聚会组局`;
|
||||
}
|
||||
|
||||
const newActivity = {
|
||||
id: `act_${Date.now()}`,
|
||||
const isProject = form.value.payType === 'PROJECT';
|
||||
const perPerson = isProject && form.value.pricingMode === 'PER_PERSON' ? (Number(form.value.perPersonFee) || 0) : 0;
|
||||
|
||||
const newActivityPayload = {
|
||||
creatorId: 1001,
|
||||
game: form.value.game,
|
||||
title: form.value.title,
|
||||
payType: form.value.payType,
|
||||
pricingMode: isProject ? form.value.pricingMode : 'AA',
|
||||
perPersonFee: perPerson,
|
||||
allowDynamicPrice: isProject ? form.value.allowDynamicPrice : false,
|
||||
priceAdjustRule: form.value.priceAdjustRule,
|
||||
totalFee: calcTotalFee.value,
|
||||
aaFee: Number(form.value.aaFee) || 0,
|
||||
currentParticipants: 1,
|
||||
maxParticipants: form.value.maxParticipants,
|
||||
startTime: form.value.startTime,
|
||||
location: form.value.location,
|
||||
creatorNickname: '同城局长',
|
||||
creatorAvatar: 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=150&h=150&fit=crop',
|
||||
participants: [
|
||||
{
|
||||
id: 'u_888',
|
||||
nickname: '同城局长',
|
||||
avatar: 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=150&h=150&fit=crop',
|
||||
checkedIn: true
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
ACTIVITIES_LIST.unshift(newActivity);
|
||||
uni.showLoading({ title: '正在发布组局...' });
|
||||
|
||||
uni.showToast({
|
||||
title: '组局发起成功!等待好友加入',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1200);
|
||||
try {
|
||||
await createActivity(newActivityPayload);
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '组局发起成功!等待好友加入',
|
||||
icon: 'success',
|
||||
duration: 1500
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: '/pages/activity/list'
|
||||
});
|
||||
}, 1200);
|
||||
} catch (err) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: err.message || '发布异常,请重试',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -319,17 +524,39 @@ const handleSubmit = () => {
|
||||
width: 220rpx;
|
||||
font-size: 26rpx;
|
||||
color: #CBD5E1;
|
||||
height: 48rpx;
|
||||
line-height: 48rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.row-input {
|
||||
flex: 1;
|
||||
font-size: 26rpx;
|
||||
color: #F8FAFC;
|
||||
height: 48rpx;
|
||||
line-height: 48rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
&.price-input {
|
||||
font-size: 34rpx;
|
||||
font-weight: 700;
|
||||
color: #F8FAFC;
|
||||
letter-spacing: 0.5px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
}
|
||||
|
||||
.ph {
|
||||
color: #475569;
|
||||
}
|
||||
|
||||
.price-ph {
|
||||
font-size: 26rpx;
|
||||
font-weight: normal;
|
||||
color: #475569;
|
||||
}
|
||||
}
|
||||
|
||||
.stepper-row {
|
||||
@@ -404,6 +631,182 @@ const handleSubmit = () => {
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
}
|
||||
|
||||
.pricing-mode-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.04);
|
||||
|
||||
.pricing-mode-group {
|
||||
display: flex;
|
||||
gap: 12rpx;
|
||||
|
||||
.pricing-mode-btn {
|
||||
font-size: 22rpx;
|
||||
padding: 8rpx 22rpx;
|
||||
border-radius: 20rpx;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
color: #94A3B8;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
|
||||
&.active {
|
||||
background: rgba(99, 102, 241, 0.2);
|
||||
color: #818CF8;
|
||||
border-color: #6366F1;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.preset-price-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 14rpx 0;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.04);
|
||||
|
||||
.preset-label {
|
||||
font-size: 20rpx;
|
||||
color: #94A3B8;
|
||||
width: 140rpx;
|
||||
}
|
||||
|
||||
.preset-chips {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12rpx;
|
||||
|
||||
.preset-chip {
|
||||
font-size: 22rpx;
|
||||
padding: 6rpx 18rpx;
|
||||
border-radius: 12rpx;
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
color: #CBD5E1;
|
||||
|
||||
&.selected {
|
||||
background: rgba(99, 102, 241, 0.2);
|
||||
border-color: #6366F1;
|
||||
color: #818CF8;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.dynamic-price-card {
|
||||
.card-header-switch {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.switch-title-box {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.form-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #F8FAFC;
|
||||
}
|
||||
.sub-label {
|
||||
font-size: 20rpx;
|
||||
color: #64748B;
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dynamic-config-body {
|
||||
margin-top: 24rpx;
|
||||
padding-top: 20rpx;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.04);
|
||||
|
||||
.config-sec-title {
|
||||
font-size: 22rpx;
|
||||
font-weight: 600;
|
||||
color: #94A3B8;
|
||||
display: block;
|
||||
margin-bottom: 14rpx;
|
||||
}
|
||||
|
||||
.rule-cards {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14rpx;
|
||||
|
||||
.rule-card {
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
border-radius: 16rpx;
|
||||
padding: 18rpx 20rpx;
|
||||
|
||||
&.active {
|
||||
background: rgba(99, 102, 241, 0.12);
|
||||
border-color: #6366F1;
|
||||
}
|
||||
|
||||
.rule-card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
margin-bottom: 8rpx;
|
||||
|
||||
.rule-name {
|
||||
font-size: 26rpx;
|
||||
font-weight: 700;
|
||||
color: #F8FAFC;
|
||||
}
|
||||
|
||||
.rule-tag {
|
||||
font-size: 18rpx;
|
||||
padding: 2rpx 10rpx;
|
||||
border-radius: 6rpx;
|
||||
|
||||
&.recommend {
|
||||
background: rgba(16, 185, 129, 0.2);
|
||||
color: #10B981;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.rule-desc {
|
||||
font-size: 20rpx;
|
||||
color: #94A3B8;
|
||||
line-height: 1.45;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.scenario-notice {
|
||||
margin-top: 20rpx;
|
||||
padding: 16rpx 20rpx;
|
||||
background: rgba(99, 102, 241, 0.08);
|
||||
border: 1px dashed rgba(99, 102, 241, 0.3);
|
||||
border-radius: 14rpx;
|
||||
|
||||
.notice-title {
|
||||
font-size: 22rpx;
|
||||
font-weight: 700;
|
||||
color: #818CF8;
|
||||
display: block;
|
||||
margin-bottom: 6rpx;
|
||||
}
|
||||
|
||||
.notice-item {
|
||||
font-size: 20rpx;
|
||||
color: #94A3B8;
|
||||
line-height: 1.5;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bottom-bar {
|
||||
@@ -466,6 +869,59 @@ const handleSubmit = () => {
|
||||
border-color: #F0ECE4;
|
||||
box-shadow: 0 4rpx 20rpx rgba(28, 25, 23, 0.05);
|
||||
|
||||
.card-label {
|
||||
color: #1C1917;
|
||||
}
|
||||
|
||||
.game-pills .game-pill {
|
||||
background: #F8F5F0;
|
||||
border-color: #E7E5E4;
|
||||
color: #78716C;
|
||||
|
||||
&.selected {
|
||||
background: rgba(234, 88, 12, 0.1);
|
||||
border-color: #EA580C;
|
||||
color: #EA580C;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.stepper-row {
|
||||
border-bottom-color: #F5F2EC;
|
||||
|
||||
.stepper-info {
|
||||
.row-label {
|
||||
color: #1C1917;
|
||||
}
|
||||
.sub-label {
|
||||
color: #78716C;
|
||||
}
|
||||
}
|
||||
|
||||
.stepper-box {
|
||||
background: #F8F5F0;
|
||||
border: 1px solid #E7E5E4;
|
||||
|
||||
.step-btn {
|
||||
background: #FFFFFF;
|
||||
color: #1C1917;
|
||||
border: 1px solid #E7E5E4;
|
||||
box-shadow: 0 2rpx 6rpx rgba(28, 25, 23, 0.04);
|
||||
|
||||
&:disabled {
|
||||
color: #A8A29E;
|
||||
background: #F5F2EC;
|
||||
border-color: #E7E5E4;
|
||||
}
|
||||
}
|
||||
|
||||
.step-val {
|
||||
color: #1C1917;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.form-title {
|
||||
color: #1C1917;
|
||||
}
|
||||
@@ -476,6 +932,14 @@ const handleSubmit = () => {
|
||||
}
|
||||
.row-input {
|
||||
color: #1C1917;
|
||||
|
||||
&.price-input {
|
||||
color: #000000;
|
||||
font-weight: 800;
|
||||
}
|
||||
}
|
||||
.price-ph {
|
||||
color: #A8A29E;
|
||||
}
|
||||
}
|
||||
.calc-preview {
|
||||
@@ -484,6 +948,78 @@ const handleSubmit = () => {
|
||||
color: #78716C;
|
||||
}
|
||||
}
|
||||
|
||||
.pricing-mode-row {
|
||||
border-bottom-color: #F5F2EC;
|
||||
.pricing-mode-btn {
|
||||
background: #F8F5F0;
|
||||
color: #78716C;
|
||||
border-color: #E7E5E4;
|
||||
&.active {
|
||||
background: rgba(234, 88, 12, 0.1);
|
||||
color: #EA580C;
|
||||
border-color: #EA580C;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.preset-price-row {
|
||||
border-bottom-color: #F5F2EC;
|
||||
.preset-label {
|
||||
color: #78716C;
|
||||
}
|
||||
.preset-chips .preset-chip {
|
||||
background: #F8F5F0;
|
||||
border-color: #E7E5E4;
|
||||
color: #78716C;
|
||||
&.selected {
|
||||
background: rgba(234, 88, 12, 0.1);
|
||||
border-color: #EA580C;
|
||||
color: #EA580C;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&.dynamic-price-card {
|
||||
.card-header-switch .switch-title-box .form-title {
|
||||
color: #1C1917;
|
||||
}
|
||||
.dynamic-config-body {
|
||||
border-top-color: #F5F2EC;
|
||||
.config-sec-title {
|
||||
color: #78716C;
|
||||
}
|
||||
.rule-cards .rule-card {
|
||||
background: #FAFAF9;
|
||||
border-color: #E7E5E4;
|
||||
&.active {
|
||||
background: rgba(234, 88, 12, 0.06);
|
||||
border-color: #EA580C;
|
||||
.rule-card-header .rule-name {
|
||||
color: #EA580C;
|
||||
}
|
||||
}
|
||||
.rule-card-header .rule-name {
|
||||
color: #1C1917;
|
||||
}
|
||||
.rule-desc {
|
||||
color: #78716C;
|
||||
}
|
||||
}
|
||||
.scenario-notice {
|
||||
background: #FFF7ED;
|
||||
border-color: #FDBA74;
|
||||
.notice-title {
|
||||
color: #EA580C;
|
||||
}
|
||||
.notice-item {
|
||||
color: #78716C;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bottom-bar {
|
||||
@@ -495,5 +1031,143 @@ const handleSubmit = () => {
|
||||
box-shadow: 0 4rpx 20rpx rgba(234, 88, 12, 0.35);
|
||||
}
|
||||
}
|
||||
|
||||
.risk-modal-box {
|
||||
background: #FFFFFF;
|
||||
border-color: rgba(239, 68, 68, 0.4);
|
||||
|
||||
.risk-modal-header .risk-title {
|
||||
color: #DC2626;
|
||||
}
|
||||
|
||||
.risk-body {
|
||||
.risk-desc {
|
||||
color: #475569;
|
||||
}
|
||||
.risk-sub-tip {
|
||||
color: #64748B;
|
||||
}
|
||||
.recommend-zones .zone-chip {
|
||||
background: rgba(234, 88, 12, 0.08);
|
||||
border-color: rgba(234, 88, 12, 0.25);
|
||||
.zone-text {
|
||||
color: #EA580C;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.risk-footer .risk-cancel-btn {
|
||||
background: #F1F5F9;
|
||||
color: #334155;
|
||||
border-color: #CBD5E1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.risk-modal-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.75);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 999;
|
||||
padding: 40rpx;
|
||||
backdrop-filter: blur(6px);
|
||||
}
|
||||
|
||||
.risk-modal-box {
|
||||
width: 100%;
|
||||
max-width: 620rpx;
|
||||
background: #151D30;
|
||||
border: 1px solid rgba(239, 68, 68, 0.35);
|
||||
border-radius: 28rpx;
|
||||
padding: 36rpx;
|
||||
box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.6);
|
||||
|
||||
.risk-modal-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.risk-shield-icon {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
}
|
||||
|
||||
.risk-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
color: #F87171;
|
||||
}
|
||||
}
|
||||
|
||||
.risk-body {
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
.risk-desc {
|
||||
display: block;
|
||||
font-size: 24rpx;
|
||||
color: #CBD5E1;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.risk-sub-tip {
|
||||
display: block;
|
||||
font-size: 22rpx;
|
||||
color: #94A3B8;
|
||||
margin-bottom: 16rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.recommend-zones {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12rpx;
|
||||
|
||||
.zone-chip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
background: rgba(99, 102, 241, 0.12);
|
||||
border: 1px solid rgba(99, 102, 241, 0.3);
|
||||
border-radius: 14rpx;
|
||||
padding: 16rpx 20rpx;
|
||||
|
||||
.zone-pin-icon {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.zone-text {
|
||||
font-size: 24rpx;
|
||||
color: #A5B4FC;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.risk-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
.risk-cancel-btn {
|
||||
width: 100%;
|
||||
height: 72rpx;
|
||||
line-height: 72rpx;
|
||||
background: #1E293B;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
color: #E2E8F0;
|
||||
font-size: 26rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
文件差异内容过多而无法显示
加载差异
@@ -1,167 +1,251 @@
|
||||
<template>
|
||||
<view class="activity-container" :class="{ 'theme-warm': currentThemeKey === 'warm' }">
|
||||
<!-- 顶部模式切换选项卡 (矢量SVG模式图标) -->
|
||||
<view class="tab-header">
|
||||
<view
|
||||
class="tab-item btn-active"
|
||||
:class="{ active: currentTab === 'ALL' }"
|
||||
@click="switchTab('ALL')"
|
||||
>
|
||||
<text class="tab-text">全部活动</text>
|
||||
<view class="tab-indicator" v-if="currentTab === 'ALL'"></view>
|
||||
</view>
|
||||
<view
|
||||
class="tab-item btn-active"
|
||||
:class="{ active: currentTab === 'AA' }"
|
||||
@click="switchTab('AA')"
|
||||
>
|
||||
<image class="tab-svg" :src="ICONS.bolt" mode="aspectFit" />
|
||||
<text class="tab-text">AA制拼桌</text>
|
||||
<view class="tab-indicator" v-if="currentTab === 'AA'"></view>
|
||||
</view>
|
||||
<view
|
||||
class="tab-item btn-active"
|
||||
:class="{ active: currentTab === 'PROJECT' }"
|
||||
@click="switchTab('PROJECT')"
|
||||
>
|
||||
<image class="tab-svg" :src="ICONS.gameTrophy" mode="aspectFit" />
|
||||
<text class="tab-text">房主请客</text>
|
||||
<view class="tab-indicator" v-if="currentTab === 'PROJECT'"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="activity-container" :class="{ 'theme-warm': currentThemeKey === 'warm' }" :style="navStyle">
|
||||
<!-- 活动大厅骨架屏 (首屏加载中流光占位,杜绝空白) -->
|
||||
<skeleton-screen v-if="isLoading" type="activity" />
|
||||
|
||||
<!-- 核心品类快捷筛选胶囊栏 (陪吃·陪唱·陪喝) -->
|
||||
<view class="category-capsule-bar">
|
||||
<view
|
||||
class="capsule-item btn-active"
|
||||
:class="{ active: currentCategory === 'ALL' }"
|
||||
@click="switchCategory('ALL')"
|
||||
>
|
||||
<text class="capsule-text">全部品类</text>
|
||||
</view>
|
||||
<view
|
||||
class="capsule-item btn-active"
|
||||
:class="{ active: currentCategory === 'MEAL' }"
|
||||
@click="switchCategory('MEAL')"
|
||||
>
|
||||
<image class="capsule-svg" :src="ICONS.utensils" mode="aspectFit" />
|
||||
<text class="capsule-text">美食陪吃</text>
|
||||
</view>
|
||||
<view
|
||||
class="capsule-item btn-active"
|
||||
:class="{ active: currentCategory === 'SING' }"
|
||||
@click="switchCategory('SING')"
|
||||
>
|
||||
<image class="capsule-svg" :src="ICONS.micVocal" mode="aspectFit" />
|
||||
<text class="capsule-text">同城陪唱</text>
|
||||
</view>
|
||||
<view
|
||||
class="capsule-item btn-active"
|
||||
:class="{ active: currentCategory === 'DRINK' }"
|
||||
@click="switchCategory('DRINK')"
|
||||
>
|
||||
<image class="capsule-svg" :src="ICONS.coffee" mode="aspectFit" />
|
||||
<text class="capsule-text">下午茶陪喝</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 顶部状态小提示 (矢量盾牌图标) -->
|
||||
<view class="tips-bar">
|
||||
<image class="tips-svg" :src="ICONS.shield" mode="aspectFit" />
|
||||
<text class="tips-text">AA制聚会人均费用透明平摊,项目制为房主全额请客或悬赏组局,凭4位门票码现场核销</text>
|
||||
</view>
|
||||
|
||||
<!-- 活动列表 -->
|
||||
<view class="activity-list">
|
||||
<view
|
||||
v-for="act in filteredActivities"
|
||||
:key="act.id"
|
||||
class="activity-card card-active"
|
||||
@click="goToDetail(act.id)"
|
||||
>
|
||||
<!-- 卡片头部 -->
|
||||
<view class="card-header">
|
||||
<view class="game-tag" :class="getCategoryTagClass(act.game)">{{ act.game }}</view>
|
||||
<view class="mode-tag" :class="act.payType === 'AA' ? 'aa-mode' : 'project-mode'">
|
||||
{{ act.payType === 'AA' ? 'AA制平摊' : '房主请客' }}
|
||||
</view>
|
||||
<view class="status-pill" :class="act.status">
|
||||
{{ act.status === 'RECRUITING' ? '招募中' : '进行中' }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 卡片标题 -->
|
||||
<view class="activity-title">{{ act.title }}</view>
|
||||
|
||||
<!-- 详细信息条 (矢量时钟与商圈位置) -->
|
||||
<view class="meta-row">
|
||||
<view class="meta-item">
|
||||
<image class="meta-svg" :src="ICONS.clock" mode="aspectFit" />
|
||||
<text class="meta-val">{{ act.startTime }}</text>
|
||||
</view>
|
||||
<view class="meta-item">
|
||||
<image class="meta-svg" :src="ICONS.mapPin" mode="aspectFit" />
|
||||
<text class="meta-val">{{ act.location }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 进度与头像 -->
|
||||
<view class="progress-section">
|
||||
<view class="progress-info">
|
||||
<text class="progress-label">组局进度</text>
|
||||
<text class="progress-count tabular-num">{{ act.currentParticipants }} / {{ act.maxParticipants }}人</text>
|
||||
</view>
|
||||
<view class="progress-track">
|
||||
<view
|
||||
class="progress-fill"
|
||||
:style="{ width: (act.currentParticipants / act.maxParticipants * 100) + '%' }"
|
||||
></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部房主与价格 -->
|
||||
<view class="card-footer">
|
||||
<view class="creator-info">
|
||||
<image class="creator-avatar" :src="act.creatorAvatar" mode="aspectFill" />
|
||||
<text class="creator-name">局长:{{ act.creatorNickname }}</text>
|
||||
</view>
|
||||
|
||||
<view class="fee-info tabular-num">
|
||||
<template v-if="act.payType === 'AA'">
|
||||
<text class="fee-label">人均预估</text>
|
||||
<text class="fee-amount">¥{{ act.aaFee }}</text>
|
||||
</template>
|
||||
<template v-else>
|
||||
<text class="fee-label">房主请客</text>
|
||||
<text class="fee-amount project-gold">¥{{ act.totalFee }}</text>
|
||||
</template>
|
||||
<!-- 真实内容 (首屏数据加载完成后平滑展示) -->
|
||||
<view v-else class="activity-body-wrapper">
|
||||
<!-- 顶部综合搜索栏 (支持搜组局标题、美食/KTV品类、商圈地点、局长昵称) -->
|
||||
<view class="header-search">
|
||||
<view class="search-box">
|
||||
<image class="search-icon-img" :src="ICONS.search" mode="aspectFit" />
|
||||
<input
|
||||
class="search-input"
|
||||
v-model="searchKeyword"
|
||||
confirm-type="search"
|
||||
placeholder="搜索组局、美食火锅、商圈地点、局长..."
|
||||
placeholder-class="placeholder-text"
|
||||
/>
|
||||
<view class="clear-btn btn-active" v-if="searchKeyword" @click="clearSearch">
|
||||
<text class="clear-text">x</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="filteredActivities.length === 0" class="empty-tip">
|
||||
<text>暂无符合条件的组局活动,快来发起吧!</text>
|
||||
|
||||
<!-- 顶部模式切换选项卡 (矢量SVG模式图标) -->
|
||||
<view class="tab-header">
|
||||
<view
|
||||
class="tab-item btn-active"
|
||||
:class="{ active: currentTab === 'ALL' }"
|
||||
@click="switchTab('ALL')"
|
||||
>
|
||||
<text class="tab-text">全部活动</text>
|
||||
<view class="tab-indicator" v-if="currentTab === 'ALL'"></view>
|
||||
</view>
|
||||
<view
|
||||
class="tab-item btn-active"
|
||||
:class="{ active: currentTab === 'MINE' }"
|
||||
@click="switchTab('MINE')"
|
||||
>
|
||||
<image class="tab-svg" :src="ICONS.gameCrown" mode="aspectFit" />
|
||||
<text class="tab-text">我发起的</text>
|
||||
<view class="tab-indicator" v-if="currentTab === 'MINE'"></view>
|
||||
</view>
|
||||
<view
|
||||
class="tab-item btn-active"
|
||||
:class="{ active: currentTab === 'AA' }"
|
||||
@click="switchTab('AA')"
|
||||
>
|
||||
<image class="tab-svg" :src="ICONS.bolt" mode="aspectFit" />
|
||||
<text class="tab-text">AA制拼桌</text>
|
||||
<view class="tab-indicator" v-if="currentTab === 'AA'"></view>
|
||||
</view>
|
||||
<view
|
||||
class="tab-item btn-active"
|
||||
:class="{ active: currentTab === 'PROJECT' }"
|
||||
@click="switchTab('PROJECT')"
|
||||
>
|
||||
<image class="tab-svg" :src="ICONS.gameTrophy" mode="aspectFit" />
|
||||
<text class="tab-text">房主请客</text>
|
||||
<view class="tab-indicator" v-if="currentTab === 'PROJECT'"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 核心品类快捷筛选胶囊栏 (陪吃·陪唱·陪喝) -->
|
||||
<view class="category-capsule-bar">
|
||||
<view
|
||||
class="capsule-item btn-active"
|
||||
:class="{ active: currentCategory === 'ALL' }"
|
||||
@click="switchCategory('ALL')"
|
||||
>
|
||||
<text class="capsule-text">全部品类</text>
|
||||
</view>
|
||||
<view
|
||||
class="capsule-item btn-active"
|
||||
:class="{ active: currentCategory === 'MEAL' }"
|
||||
@click="switchCategory('MEAL')"
|
||||
>
|
||||
<image class="capsule-svg" :src="ICONS.utensils" mode="aspectFit" />
|
||||
<text class="capsule-text">美食陪吃</text>
|
||||
</view>
|
||||
<view
|
||||
class="capsule-item btn-active"
|
||||
:class="{ active: currentCategory === 'SING' }"
|
||||
@click="switchCategory('SING')"
|
||||
>
|
||||
<image class="capsule-svg" :src="ICONS.micVocal" mode="aspectFit" />
|
||||
<text class="capsule-text">同城陪唱</text>
|
||||
</view>
|
||||
<view
|
||||
class="capsule-item btn-active"
|
||||
:class="{ active: currentCategory === 'DRINK' }"
|
||||
@click="switchCategory('DRINK')"
|
||||
>
|
||||
<image class="capsule-svg" :src="ICONS.coffee" mode="aspectFit" />
|
||||
<text class="capsule-text">下午茶陪喝</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 顶部状态小提示 (矢量盾牌图标) -->
|
||||
<view class="tips-bar">
|
||||
<image class="tips-svg" :src="ICONS.shield" mode="aspectFit" />
|
||||
<text class="tips-text">AA制聚会人均费用透明平摊,项目制为房主全额请客或悬赏组局,凭4位门票码现场核销</text>
|
||||
</view>
|
||||
|
||||
<!-- 活动列表 -->
|
||||
<view class="activity-list">
|
||||
<view
|
||||
v-for="act in filteredActivities"
|
||||
:key="act.id"
|
||||
class="activity-card card-active"
|
||||
:class="{ 'is-cancelled': act.status === 'CANCELLED' }"
|
||||
@click="goToDetail(act.id)"
|
||||
>
|
||||
<!-- 卡片头部 -->
|
||||
<view class="card-header">
|
||||
<view class="game-tag" :class="getCategoryTagClass(act.game)">{{ act.game }}</view>
|
||||
<view class="mode-tag" :class="act.payType === 'AA' ? 'aa-mode' : 'project-mode'">
|
||||
{{ act.payType === 'AA' ? 'AA制平摊' : '房主请客' }}
|
||||
</view>
|
||||
<view class="status-pill" :class="act.status || 'RECRUITING'">
|
||||
{{ getStatusText(act.status) }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 卡片标题 -->
|
||||
<view class="activity-title">{{ act.title }}</view>
|
||||
|
||||
<!-- 详细信息条 (矢量时钟与商圈位置) -->
|
||||
<view class="meta-row">
|
||||
<view class="meta-item">
|
||||
<image class="meta-svg" :src="ICONS.clock" mode="aspectFit" />
|
||||
<text class="meta-val">{{ act.startTime }}</text>
|
||||
</view>
|
||||
<view class="meta-item">
|
||||
<image class="meta-svg" :src="ICONS.mapPin" mode="aspectFit" />
|
||||
<text class="meta-val">{{ act.location }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 进度与头像 -->
|
||||
<view class="progress-section">
|
||||
<view class="progress-info">
|
||||
<text class="progress-label">组局进度</text>
|
||||
<text class="progress-count tabular-num">{{ act.currentParticipants }} / {{ act.maxParticipants }}人</text>
|
||||
</view>
|
||||
<view class="progress-track">
|
||||
<view
|
||||
class="progress-fill"
|
||||
:style="{ width: (act.currentParticipants / act.maxParticipants * 100) + '%' }"
|
||||
></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部房主与价格 -->
|
||||
<view class="card-footer">
|
||||
<view class="creator-info">
|
||||
<image class="creator-avatar" :src="act.creatorAvatar" mode="aspectFill" />
|
||||
<text class="creator-name">局长:{{ act.creatorNickname }}</text>
|
||||
</view>
|
||||
|
||||
<view class="fee-info tabular-num">
|
||||
<template v-if="act.payType === 'AA'">
|
||||
<text class="fee-label">人均预估</text>
|
||||
<text class="fee-amount">¥{{ act.aaFee }}</text>
|
||||
</template>
|
||||
<template v-else>
|
||||
<text class="fee-label">房主请客</text>
|
||||
<text class="fee-amount project-gold">¥{{ act.totalFee }}</text>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="filteredActivities.length === 0" class="empty-tip">
|
||||
<text v-if="searchKeyword">未找到与“{{ searchKeyword }}”匹配的组局</text>
|
||||
<text v-else>暂无符合条件的组局活动,快来发起吧!</text>
|
||||
<button class="empty-reset-btn btn-active" v-if="searchKeyword" @click="clearSearch">
|
||||
清空搜索条件
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 悬浮发起活动按钮 (脉冲微流光) -->
|
||||
<view class="fab-btn btn-active" @click="createActivity">
|
||||
<text class="fab-icon">+</text>
|
||||
<text class="fab-text">发起组局</text>
|
||||
</view>
|
||||
<!-- 底部自定义导航栏 (发单人端:活动中心 / 我要发单 / 友圈 / 个人中心) -->
|
||||
<custom-tab-bar current="activity" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { ACTIVITIES_LIST } from '@/common/mock.js';
|
||||
import { onShow, onLoad } from '@dcloudio/uni-app';
|
||||
import CustomTabBar from '@/components/CustomTabBar.vue';
|
||||
import SkeletonScreen from '@/components/SkeletonScreen.vue';
|
||||
import { getActivities } from '@/common/api.js';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
|
||||
const activities = ref(ACTIVITIES_LIST);
|
||||
const CURRENT_USER_ID = 1001;
|
||||
|
||||
const isLoading = ref(true);
|
||||
const activities = ref([]);
|
||||
const currentTab = ref('ALL');
|
||||
const currentCategory = ref('ALL');
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const searchKeyword = ref('');
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
|
||||
const navStyle = computed(() => {
|
||||
return {
|
||||
'--safe-header-gap': `${navInfo.value.safeHeaderGap}px`,
|
||||
'--capsule-right-space': `${navInfo.value.capsuleRightSpace}px`,
|
||||
'--capsule-height': `${navInfo.value.capsuleHeight}px`
|
||||
};
|
||||
});
|
||||
|
||||
const clearSearch = () => {
|
||||
searchKeyword.value = '';
|
||||
};
|
||||
|
||||
const loadInitialActivities = async () => {
|
||||
try {
|
||||
await fetchLiveActivities();
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
isLoading.value = false;
|
||||
}, 200);
|
||||
}
|
||||
};
|
||||
|
||||
const fetchLiveActivities = async () => {
|
||||
try {
|
||||
const list = await getActivities();
|
||||
if (Array.isArray(list) && list.length > 0) {
|
||||
activities.value = list;
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[ActivityList] 获取线上数据异常,保持缓存:', err);
|
||||
}
|
||||
};
|
||||
|
||||
onLoad((options) => {
|
||||
if (options && options.category) {
|
||||
currentCategory.value = options.category;
|
||||
}
|
||||
if (options && options.tab) {
|
||||
currentTab.value = options.tab;
|
||||
}
|
||||
});
|
||||
|
||||
const onThemeChanged = (key) => {
|
||||
currentThemeKey.value = key;
|
||||
@@ -169,13 +253,24 @@ const onThemeChanged = (key) => {
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
navInfo.value = getNavBarInfo();
|
||||
currentThemeKey.value = getCurrentThemeKey();
|
||||
applyThemeToNativeUI(currentThemeKey.value);
|
||||
uni.$on('theme-change', onThemeChanged);
|
||||
loadInitialActivities();
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
navInfo.value = getNavBarInfo();
|
||||
currentThemeKey.value = getCurrentThemeKey();
|
||||
applyThemeToNativeUI(currentThemeKey.value);
|
||||
uni.hideTabBar({ animation: false, fail: () => {} });
|
||||
const pendingTab = uni.getStorageSync('ACTIVITY_ACTIVE_TAB');
|
||||
if (pendingTab) {
|
||||
currentTab.value = pendingTab;
|
||||
uni.removeStorageSync('ACTIVITY_ACTIVE_TAB');
|
||||
}
|
||||
fetchLiveActivities();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
@@ -189,11 +284,37 @@ const getCategoryTagClass = (game) => {
|
||||
return '';
|
||||
};
|
||||
|
||||
const getStatusText = (status) => {
|
||||
if (status === 'CANCELLED') return '已解散';
|
||||
if (status === 'COMPLETED') return '已完成';
|
||||
if (status === 'FULL') return '已满员';
|
||||
if (status === 'IN_PROGRESS' || status === 'RUNNING') return '进行中';
|
||||
return '招募中';
|
||||
};
|
||||
|
||||
const filteredActivities = computed(() => {
|
||||
const kw = (searchKeyword.value || '').trim().toLowerCase();
|
||||
|
||||
return activities.value.filter(a => {
|
||||
// 支付模式筛选
|
||||
const matchTab = currentTab.value === 'ALL' || a.payType === currentTab.value;
|
||||
// 品类筛选 (美食陪吃 / 同城陪唱 / 下午茶陪喝/微醺)
|
||||
// 1. 关键词搜索筛选 (标题、商圈地点、品类、局长昵称)
|
||||
let matchKeyword = true;
|
||||
if (kw) {
|
||||
const titleMatch = (a.title || '').toLowerCase().includes(kw);
|
||||
const locationMatch = (a.location || '').toLowerCase().includes(kw);
|
||||
const gameMatch = (a.game || '').toLowerCase().includes(kw);
|
||||
const creatorMatch = (a.creatorNickname || '').toLowerCase().includes(kw);
|
||||
matchKeyword = titleMatch || locationMatch || gameMatch || creatorMatch;
|
||||
}
|
||||
|
||||
// 2. 支付模式或发单人筛选
|
||||
let matchTab = true;
|
||||
if (currentTab.value === 'MINE') {
|
||||
matchTab = Number(a.creatorId) === CURRENT_USER_ID || a.creatorNickname === '同城局长';
|
||||
} else if (currentTab.value !== 'ALL') {
|
||||
matchTab = a.payType === currentTab.value;
|
||||
}
|
||||
|
||||
// 3. 品类筛选 (美食陪吃 / 同城陪唱 / 下午茶陪喝/微醺)
|
||||
let matchCat = true;
|
||||
if (currentCategory.value === 'MEAL') {
|
||||
matchCat = a.game === '美食陪吃';
|
||||
@@ -202,7 +323,7 @@ const filteredActivities = computed(() => {
|
||||
} else if (currentCategory.value === 'DRINK') {
|
||||
matchCat = a.game === '下午茶陪喝' || a.game === '同城微醺';
|
||||
}
|
||||
return matchTab && matchCat;
|
||||
return matchKeyword && matchTab && matchCat;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -231,7 +352,74 @@ const createActivity = () => {
|
||||
.activity-container {
|
||||
min-height: 100vh;
|
||||
background-color: #0A0F1D;
|
||||
padding: var(--safe-header-gap, 36rpx) 32rpx calc(180rpx + env(safe-area-inset-bottom));
|
||||
padding: 0 32rpx calc(180rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.header-search {
|
||||
padding-top: var(--safe-header-gap, 36rpx);
|
||||
padding-bottom: 24rpx;
|
||||
background-color: #0A0F1D;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 50;
|
||||
/* #ifdef MP-WEIXIN */
|
||||
padding-right: calc(var(--capsule-right-space, 210rpx));
|
||||
/* #endif */
|
||||
|
||||
.search-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #151D30;
|
||||
height: 80rpx;
|
||||
/* #ifdef MP-WEIXIN */
|
||||
height: var(--capsule-height, 64rpx);
|
||||
/* #endif */
|
||||
border-radius: 40rpx;
|
||||
padding: 0 28rpx;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:focus-within {
|
||||
border-color: #6366F1;
|
||||
box-shadow: 0 0 16rpx rgba(99, 102, 241, 0.35);
|
||||
}
|
||||
|
||||
.search-icon-img {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-right: 16rpx;
|
||||
opacity: 0.8;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
flex: 1;
|
||||
font-size: 26rpx;
|
||||
color: #F8FAFC;
|
||||
}
|
||||
|
||||
.placeholder-text {
|
||||
color: #64748B;
|
||||
}
|
||||
|
||||
.clear-btn {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-left: 12rpx;
|
||||
flex-shrink: 0;
|
||||
|
||||
.clear-text {
|
||||
font-size: 22rpx;
|
||||
color: #94A3B8;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tab-header {
|
||||
@@ -371,6 +559,20 @@ const createActivity = () => {
|
||||
padding: 60rpx 0;
|
||||
font-size: 26rpx;
|
||||
color: #64748B;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
|
||||
.empty-reset-btn {
|
||||
font-size: 24rpx;
|
||||
color: #6366F1;
|
||||
background: rgba(99, 102, 241, 0.12);
|
||||
border: 1px solid rgba(99, 102, 241, 0.3);
|
||||
padding: 8rpx 28rpx;
|
||||
border-radius: 30rpx;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.activity-card {
|
||||
@@ -379,6 +581,12 @@ const createActivity = () => {
|
||||
padding: 28rpx;
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
box-shadow: 0 8rpx 20rpx rgba(0, 0, 0, 0.3);
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&.is-cancelled {
|
||||
opacity: 0.65;
|
||||
filter: grayscale(0.2);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
@@ -438,10 +646,24 @@ const createActivity = () => {
|
||||
background: rgba(99, 102, 241, 0.2);
|
||||
color: #818CF8;
|
||||
}
|
||||
&.FULL {
|
||||
background: rgba(245, 158, 11, 0.2);
|
||||
color: #F59E0B;
|
||||
}
|
||||
&.IN_PROGRESS,
|
||||
&.RUNNING {
|
||||
background: rgba(16, 185, 129, 0.2);
|
||||
color: #10B981;
|
||||
}
|
||||
&.COMPLETED {
|
||||
background: rgba(148, 163, 184, 0.2);
|
||||
color: #94A3B8;
|
||||
}
|
||||
&.CANCELLED {
|
||||
background: rgba(239, 68, 68, 0.15);
|
||||
color: #F87171;
|
||||
border: 1px solid rgba(239, 68, 68, 0.3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -552,48 +774,47 @@ const createActivity = () => {
|
||||
}
|
||||
}
|
||||
|
||||
.fab-btn {
|
||||
position: fixed;
|
||||
right: 36rpx;
|
||||
bottom: calc(140rpx + env(safe-area-inset-bottom));
|
||||
background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
|
||||
border-radius: 44rpx;
|
||||
padding: 18rpx 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-shadow: 0 8rpx 28rpx rgba(99, 102, 241, 0.55);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
z-index: 100;
|
||||
animation: fabPulse 3s infinite ease-in-out;
|
||||
|
||||
.fab-icon {
|
||||
font-size: 32rpx;
|
||||
color: #FFF;
|
||||
font-weight: 700;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
.fab-text {
|
||||
font-size: 26rpx;
|
||||
color: #FFF;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 481px) {
|
||||
.fab-btn {
|
||||
right: calc(50% - 225px + 36rpx);
|
||||
bottom: calc(140rpx + 20px);
|
||||
.activity-container {
|
||||
max-width: 450px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fabPulse {
|
||||
0%, 100% { box-shadow: 0 8rpx 24rpx rgba(99, 102, 241, 0.45); }
|
||||
50% { box-shadow: 0 8rpx 36rpx rgba(99, 102, 241, 0.75); }
|
||||
}
|
||||
|
||||
.activity-container.theme-warm {
|
||||
background-color: #FDFBF7;
|
||||
|
||||
.header-search {
|
||||
background-color: #FDFBF7;
|
||||
|
||||
.search-box {
|
||||
background-color: #FFFFFF;
|
||||
border-color: #F0ECE4;
|
||||
box-shadow: 0 4rpx 16rpx rgba(28, 25, 23, 0.04);
|
||||
|
||||
&:focus-within {
|
||||
border-color: #EA580C;
|
||||
box-shadow: 0 0 16rpx rgba(234, 88, 12, 0.2);
|
||||
}
|
||||
|
||||
.search-input {
|
||||
color: #1C1917;
|
||||
}
|
||||
|
||||
.placeholder-text {
|
||||
color: #78716C;
|
||||
}
|
||||
|
||||
.clear-btn {
|
||||
background: #F8F5F0;
|
||||
|
||||
.clear-text {
|
||||
color: #78716C;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tab-header {
|
||||
background-color: #FFFFFF;
|
||||
border-color: #F0ECE4;
|
||||
@@ -662,9 +883,13 @@ const createActivity = () => {
|
||||
}
|
||||
}
|
||||
|
||||
.fab-btn {
|
||||
background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
|
||||
box-shadow: 0 8rpx 28rpx rgba(234, 88, 12, 0.4);
|
||||
.empty-tip {
|
||||
color: #78716C;
|
||||
.empty-reset-btn {
|
||||
color: #EA580C;
|
||||
background: rgba(234, 88, 12, 0.1);
|
||||
border-color: rgba(234, 88, 12, 0.3);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -43,12 +43,57 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 条形码与二维码模拟区域 -->
|
||||
<view class="qrcode-section">
|
||||
<view class="barcode-graphic">
|
||||
<view class="bar" v-for="i in 36" :key="i" :style="{ width: (i % 3 === 0 ? '6rpx' : '2rpx'), marginRight: (i % 2 === 0 ? '4rpx' : '2rpx') }"></view>
|
||||
<!-- 真实动态条形码与二维码区域 (Code128B 与 QR Code 标准矩阵渲染) -->
|
||||
<view class="ticket-codes-panel">
|
||||
<view class="code-tab-switch">
|
||||
<view
|
||||
class="tab-btn btn-active"
|
||||
:class="{ active: activeCodeType === 'BARCODE' }"
|
||||
@click="activeCodeType = 'BARCODE'"
|
||||
>
|
||||
条形码 (Code128)
|
||||
</view>
|
||||
<view
|
||||
class="tab-btn btn-active"
|
||||
:class="{ active: activeCodeType === 'QRCODE' }"
|
||||
@click="activeCodeType = 'QRCODE'"
|
||||
>
|
||||
二维码 (QR Code)
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 1. 真实动态条形码 (矢量条块高密度渲染) -->
|
||||
<view v-if="activeCodeType === 'BARCODE'" class="barcode-view">
|
||||
<view class="barcode-container-real">
|
||||
<view
|
||||
v-for="(seg, idx) in barcodeSegments"
|
||||
:key="idx"
|
||||
class="real-bar"
|
||||
:class="{ 'bar-black': seg.isBar, 'bar-white': !seg.isBar }"
|
||||
:style="{ flexGrow: seg.width }"
|
||||
></view>
|
||||
</view>
|
||||
<text class="barcode-text-sn">{{ ticketSn }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 2. 真实动态二维码 (25x25 矩阵点阵标准渲染) -->
|
||||
<view v-else class="qrcode-view">
|
||||
<view class="qr-matrix-container">
|
||||
<view
|
||||
v-for="(row, rIdx) in qrcodeMatrix"
|
||||
:key="rIdx"
|
||||
class="qr-row"
|
||||
>
|
||||
<view
|
||||
v-for="(cell, cIdx) in row"
|
||||
:key="cIdx"
|
||||
class="qr-cell"
|
||||
:class="{ 'cell-dark': cell, 'cell-light': !cell }"
|
||||
></view>
|
||||
</view>
|
||||
</view>
|
||||
<text class="qrcode-text-sn">{{ ticketSn }}</text>
|
||||
</view>
|
||||
<text class="barcode-num">TICKET-2026-9025</text>
|
||||
</view>
|
||||
|
||||
<!-- 动态防伪时间与安全保障 -->
|
||||
@@ -64,7 +109,7 @@
|
||||
<!-- 演示操作按钮 -->
|
||||
<view class="action-wrap">
|
||||
<button class="btn-verify-demo btn-active" @click="toggleCheckIn">
|
||||
{{ isCheckedIn ? '重置为待核销状态' : '模拟局长核销此门票' }}
|
||||
{{ isCheckedIn ? '重置为待核销状态' : '局长现场核销此门票' }}
|
||||
</button>
|
||||
<button class="btn-back btn-active" @click="goBack">返回活动详情</button>
|
||||
</view>
|
||||
@@ -73,12 +118,37 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||
import { ACTIVITIES_LIST } from '@/common/mock.js';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { getActivityDetail, verifyActivityCheckin, getMyActivities } from '@/common/api.js';
|
||||
import { encodeCode128B } from '@/common/barcode.js';
|
||||
import { generateQRCodeMatrix } from '@/common/qrcode.js';
|
||||
|
||||
const ticketData = ref(ACTIVITIES_LIST[0]);
|
||||
const activeCodeType = ref('BARCODE');
|
||||
const ticketData = ref({
|
||||
id: '',
|
||||
title: '同城组局现场门票',
|
||||
game: '同城陪伴',
|
||||
startTime: '根据预约到场',
|
||||
location: '同城商业街区',
|
||||
creatorNickname: '组局房主'
|
||||
});
|
||||
const verifyCode = ref('8392');
|
||||
const isCheckedIn = ref(false);
|
||||
const currentTime = ref('');
|
||||
const hasTicket = ref(true);
|
||||
|
||||
const ticketSn = computed(() => {
|
||||
const actId = ticketData.value && ticketData.value.id ? ticketData.value.id : '101';
|
||||
return `TICKET-${actId}-${verifyCode.value}`;
|
||||
});
|
||||
|
||||
const barcodeSegments = computed(() => {
|
||||
return encodeCode128B(ticketSn.value);
|
||||
});
|
||||
|
||||
const qrcodeMatrix = computed(() => {
|
||||
return generateQRCodeMatrix(ticketSn.value, 2);
|
||||
});
|
||||
|
||||
const verifyCodeDigits = computed(() => {
|
||||
return verifyCode.value.split('');
|
||||
@@ -97,6 +167,74 @@ const updateTime = () => {
|
||||
currentTime.value = `${y}-${m}-${d} ${hh}:${mm}:${ss}`;
|
||||
};
|
||||
|
||||
onLoad(async (query) => {
|
||||
if (query && query.code) {
|
||||
verifyCode.value = String(query.code);
|
||||
}
|
||||
|
||||
// 1. 若有指定活动ID,直接拉取该活动详情
|
||||
if (query && query.id) {
|
||||
try {
|
||||
const detail = await getActivityDetail(query.id);
|
||||
if (detail) {
|
||||
ticketData.value = detail;
|
||||
if (detail.participants && detail.participants.length > 0) {
|
||||
const found = detail.participants.find(p => p.verifyCode === verifyCode.value);
|
||||
if (found) {
|
||||
isCheckedIn.value = Boolean(found.checkedIn);
|
||||
} else if (!query.code) {
|
||||
verifyCode.value = detail.participants[0].verifyCode;
|
||||
isCheckedIn.value = Boolean(detail.participants[0].checkedIn);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[MyTicket] 获取指定活动门票失败:', err);
|
||||
}
|
||||
}
|
||||
|
||||
// 2. 若无传参,真实拉取当前用户的已报名组局列表
|
||||
try {
|
||||
const myActs = await getMyActivities(1001);
|
||||
const joinedList = myActs.joined || [];
|
||||
if (joinedList.length > 0) {
|
||||
let targetAct = joinedList.find(act => {
|
||||
const myP = (act.participants || []).find(p => p.userId === 1001 || p.nickname === '同城局长' || p.verifyCode);
|
||||
return myP && !myP.checkedIn;
|
||||
}) || joinedList[0];
|
||||
|
||||
ticketData.value = targetAct;
|
||||
if (targetAct.participants && targetAct.participants.length > 0) {
|
||||
const myP = targetAct.participants.find(p => p.userId === 1001 || p.verifyCode);
|
||||
if (myP && myP.verifyCode) {
|
||||
verifyCode.value = String(myP.verifyCode);
|
||||
isCheckedIn.value = Boolean(myP.checkedIn);
|
||||
} else {
|
||||
verifyCode.value = String(targetAct.participants[0].verifyCode || '8392');
|
||||
isCheckedIn.value = Boolean(targetAct.participants[0].checkedIn);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[MyTicket] 获取用户报名门票异常:', err);
|
||||
}
|
||||
|
||||
// 3. 兜底拉取线上第一个活动
|
||||
try {
|
||||
const defaultDetail = await getActivityDetail('act_101');
|
||||
if (defaultDetail) {
|
||||
ticketData.value = defaultDetail;
|
||||
if (defaultDetail.participants && defaultDetail.participants.length > 0) {
|
||||
verifyCode.value = String(defaultDetail.participants[0].verifyCode || '8392');
|
||||
isCheckedIn.value = Boolean(defaultDetail.participants[0].checkedIn);
|
||||
}
|
||||
}
|
||||
} catch (_) {}
|
||||
});
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
updateTime();
|
||||
timer = setInterval(updateTime, 1000);
|
||||
@@ -106,13 +244,36 @@ onUnmounted(() => {
|
||||
if (timer) clearInterval(timer);
|
||||
});
|
||||
|
||||
const toggleCheckIn = () => {
|
||||
isCheckedIn.value = !isCheckedIn.value;
|
||||
uni.showToast({
|
||||
title: isCheckedIn.value ? '房主已成功核销该4位门票码!' : '状态已重置为待核销',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
const toggleCheckIn = async () => {
|
||||
if (!isCheckedIn.value) {
|
||||
try {
|
||||
uni.showLoading({ title: '正在核销签到...' });
|
||||
await verifyActivityCheckin(ticketData.value.id, verifyCode.value, 1001);
|
||||
uni.hideLoading();
|
||||
isCheckedIn.value = true;
|
||||
uni.showToast({
|
||||
title: '4位核销码核销成功,已完成现场签到!',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
});
|
||||
} catch (err) {
|
||||
uni.hideLoading();
|
||||
// 若线上返回已核销或网络异常,同步状态
|
||||
isCheckedIn.value = true;
|
||||
uni.showToast({
|
||||
title: err.message || '核销完成',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
} else {
|
||||
isCheckedIn.value = false;
|
||||
uni.showToast({
|
||||
title: '状态已重置为待核销',
|
||||
icon: 'none',
|
||||
duration: 1500
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const goBack = () => {
|
||||
@@ -267,29 +428,107 @@ const goBack = () => {
|
||||
}
|
||||
}
|
||||
|
||||
.qrcode-section {
|
||||
.ticket-codes-panel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 16rpx 32rpx 28rpx;
|
||||
|
||||
.barcode-graphic {
|
||||
.code-tab-switch {
|
||||
display: flex;
|
||||
height: 60rpx;
|
||||
align-items: center;
|
||||
opacity: 0.8;
|
||||
background: rgba(15, 23, 42, 0.6);
|
||||
padding: 6rpx;
|
||||
border-radius: 32rpx;
|
||||
margin-bottom: 24rpx;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
|
||||
.bar {
|
||||
height: 100%;
|
||||
background-color: #F8FAFC;
|
||||
.tab-btn {
|
||||
font-size: 22rpx;
|
||||
padding: 8rpx 24rpx;
|
||||
border-radius: 28rpx;
|
||||
color: #94A3B8;
|
||||
font-weight: 500;
|
||||
transition: all 0.25s ease;
|
||||
|
||||
&.active {
|
||||
background: #6366F1;
|
||||
color: #FFFFFF;
|
||||
font-weight: 700;
|
||||
box-shadow: 0 2rpx 12rpx rgba(99, 102, 241, 0.4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.barcode-num {
|
||||
font-size: 20rpx;
|
||||
color: #64748B;
|
||||
letter-spacing: 4rpx;
|
||||
margin-top: 10rpx;
|
||||
.barcode-view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
|
||||
.barcode-container-real {
|
||||
display: flex;
|
||||
width: 90%;
|
||||
height: 90rpx;
|
||||
background: #FFFFFF;
|
||||
padding: 12rpx 16rpx;
|
||||
border-radius: 8rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.real-bar {
|
||||
height: 100%;
|
||||
|
||||
&.bar-black {
|
||||
background-color: #0F172A;
|
||||
}
|
||||
&.bar-white {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.barcode-text-sn {
|
||||
font-size: 22rpx;
|
||||
color: #94A3B8;
|
||||
letter-spacing: 4rpx;
|
||||
margin-top: 14rpx;
|
||||
font-family: 'Courier New', monospace;
|
||||
}
|
||||
}
|
||||
|
||||
.qrcode-view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.qr-matrix-container {
|
||||
padding: 16rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.2);
|
||||
|
||||
.qr-row {
|
||||
display: flex;
|
||||
|
||||
.qr-cell {
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
|
||||
&.cell-dark {
|
||||
background-color: #0F172A;
|
||||
}
|
||||
&.cell-light {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.qrcode-text-sn {
|
||||
font-size: 20rpx;
|
||||
color: #94A3B8;
|
||||
margin-top: 16rpx;
|
||||
font-family: 'Courier New', monospace;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2004
pwuniapp/pages/community/index.vue
普通文件
2004
pwuniapp/pages/community/index.vue
普通文件
文件差异内容过多而无法显示
加载差异
@@ -1,144 +1,150 @@
|
||||
<template>
|
||||
<view class="expert-detail-container">
|
||||
<!-- 顶部封面与基本信息 -->
|
||||
<view class="hero-header">
|
||||
<image class="cover-bg" :src="expert.coverImage || expert.avatar" mode="aspectFill" />
|
||||
<view class="cover-mask"></view>
|
||||
<!-- 大神主页骨架屏 (首屏加载中流光占位,杜绝视觉空白) -->
|
||||
<skeleton-screen v-if="isLoading" type="expert" />
|
||||
|
||||
<view class="profile-card">
|
||||
<view class="avatar-wrap">
|
||||
<image class="avatar-img" :src="expert.avatar" mode="aspectFill" />
|
||||
<view class="status-badge" :class="{ online: expert.isOnline }">
|
||||
<view class="pulse-dot" v-if="expert.isOnline"></view>
|
||||
<text>{{ expert.isOnline ? '在线' : '离线' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 真实内容 (数据加载完成平滑展示) -->
|
||||
<view v-else class="expert-body-wrapper">
|
||||
<!-- 顶部封面与基本信息 -->
|
||||
<view class="hero-header">
|
||||
<image class="cover-bg" :src="expert.coverImage || expert.avatar" mode="aspectFill" />
|
||||
<view class="cover-mask"></view>
|
||||
|
||||
<view class="info-wrap">
|
||||
<view class="name-row">
|
||||
<text class="nickname">{{ expert.nickname }}</text>
|
||||
<text class="level-tag">{{ expert.levelTag }}</text>
|
||||
</view>
|
||||
|
||||
<view class="rank-row">
|
||||
<text class="game-tag">{{ expert.game }}</text>
|
||||
<text class="rank-tag">{{ expert.rankTag }}</text>
|
||||
</view>
|
||||
|
||||
<view class="city-row" v-if="expert.city">
|
||||
<image class="city-pin-svg" :src="ICONS.mapPin" mode="aspectFit" />
|
||||
<text class="city-text">{{ expert.city }}</text>
|
||||
</view>
|
||||
|
||||
<view class="data-row">
|
||||
<view class="rating-box">
|
||||
<image class="star-svg" :src="ICONS.star" mode="aspectFit" />
|
||||
<text class="rating-val">{{ expert.rating }}</text>
|
||||
<view class="profile-card">
|
||||
<view class="avatar-wrap">
|
||||
<image class="avatar-img" :src="expert.avatar" mode="aspectFill" />
|
||||
<view class="status-badge" :class="{ online: expert.isOnline }">
|
||||
<view class="pulse-dot" v-if="expert.isOnline"></view>
|
||||
<text>{{ expert.isOnline ? '在线' : '离线' }}</text>
|
||||
</view>
|
||||
<text class="order-val">已陪玩 {{ expert.orderCount }} 次</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 专属打招呼试听语音 (矢量SVG播放条) -->
|
||||
<view class="voice-card btn-active" @click="toggleVoice">
|
||||
<view class="voice-icon-wrap">
|
||||
<image class="play-svg" :src="isPlayingVoice ? ICONS.pause : ICONS.play" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="voice-info">
|
||||
<text class="voice-title">{{ isPlayingVoice ? '正在连麦试听语音...' : '点击试听打招呼原声' }}</text>
|
||||
<view class="voice-wave" v-if="isPlayingVoice">
|
||||
<view class="bar b1"></view>
|
||||
<view class="bar b2"></view>
|
||||
<view class="bar b3"></view>
|
||||
<view class="bar b4"></view>
|
||||
</view>
|
||||
<text class="voice-dur" v-else>{{ expert.voiceDuration }}s 真实原声</text>
|
||||
</view>
|
||||
<text class="listen-tag">试听</text>
|
||||
</view>
|
||||
|
||||
<!-- 个人简介 -->
|
||||
<view class="section-card">
|
||||
<view class="sec-title">个人介绍</view>
|
||||
<text class="bio-text">{{ expert.bio }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 服务项目选择 -->
|
||||
<view class="section-card">
|
||||
<view class="sec-title">服务项目</view>
|
||||
<view class="service-list">
|
||||
<view
|
||||
v-for="srv in expert.services"
|
||||
:key="srv.id"
|
||||
class="service-item btn-active"
|
||||
:class="{ selected: selectedServiceId === srv.id }"
|
||||
@click="selectService(srv)"
|
||||
>
|
||||
<view class="srv-left">
|
||||
<view class="srv-title">{{ srv.title }}</view>
|
||||
<view class="srv-desc">{{ srv.desc }}</view>
|
||||
</view>
|
||||
<view class="srv-right">
|
||||
<text class="price-sym">¥</text>
|
||||
<text class="price-num">{{ srv.price }}</text>
|
||||
<text class="price-unit">/{{ srv.unit }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 线下安全守则提示卡 -->
|
||||
<view class="offline-safety-card" v-if="expert.city">
|
||||
<image class="safety-icon-svg" :src="ICONS.shield" mode="aspectFit" />
|
||||
<view class="safety-content">
|
||||
<text class="safety-title">绿色合规陪伴服务承诺</text>
|
||||
<text class="safety-desc">该大神已完成公安实名联网比对与健康认证。同城陪玩/陪吃/陪喝仅限在公开正规商业场所履约,到场出示4位核销码现场签到。</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 战绩与生活照片 -->
|
||||
<view class="section-card" v-if="expert.photos && expert.photos.length > 0">
|
||||
<view class="sec-title">战绩相册</view>
|
||||
<scroll-view scroll-x class="gallery-scroll" :show-scrollbar="false">
|
||||
<view class="gallery-list">
|
||||
<image
|
||||
v-for="(photo, index) in expert.photos"
|
||||
:key="index"
|
||||
class="gallery-item"
|
||||
:src="photo"
|
||||
mode="aspectFill"
|
||||
@click="previewImage(index)"
|
||||
/>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 真实买家评价 -->
|
||||
<view class="section-card">
|
||||
<view class="sec-header">
|
||||
<text class="sec-title">服务好评 ({{ expert.reviews ? expert.reviews.length : 0 }})</text>
|
||||
<text class="rate-percent">好评率 99.8%</text>
|
||||
</view>
|
||||
|
||||
<view class="review-list" v-if="expert.reviews && expert.reviews.length > 0">
|
||||
<view v-for="rev in expert.reviews" :key="rev.id" class="review-item">
|
||||
<image class="rev-avatar" :src="rev.userAvatar" mode="aspectFill" />
|
||||
<view class="rev-body">
|
||||
<view class="rev-top">
|
||||
<text class="rev-name">{{ rev.userNickname }}</text>
|
||||
<text class="rev-time">{{ rev.time }}</text>
|
||||
<view class="info-wrap">
|
||||
<view class="name-row">
|
||||
<text class="nickname">{{ expert.nickname }}</text>
|
||||
<text class="level-tag">{{ expert.levelTag }}</text>
|
||||
</view>
|
||||
<view class="tag-row">
|
||||
<text class="rev-tag" v-for="(t, i) in rev.tags" :key="i">{{ t }}</text>
|
||||
|
||||
<view class="rank-row">
|
||||
<text class="game-tag">{{ expert.game }}</text>
|
||||
<text class="rank-tag">{{ expert.rankTag }}</text>
|
||||
</view>
|
||||
|
||||
<view class="city-row" v-if="expert.city">
|
||||
<image class="city-pin-svg" :src="ICONS.mapPin" mode="aspectFit" />
|
||||
<text class="city-text">{{ expert.city }}</text>
|
||||
</view>
|
||||
|
||||
<view class="data-row">
|
||||
<view class="rating-box">
|
||||
<image class="star-svg" :src="ICONS.star" mode="aspectFit" />
|
||||
<text class="rating-val">{{ expert.rating }}</text>
|
||||
</view>
|
||||
<text class="order-val">已陪玩 {{ expert.orderCount }} 次</text>
|
||||
</view>
|
||||
<text class="rev-content">{{ rev.content }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="empty-reviews">
|
||||
<text>近期新增服务,暂无评价记录</text>
|
||||
|
||||
<!-- 专属打招呼试听语音 (矢量SVG播放条) -->
|
||||
<view class="voice-card btn-active" @click="toggleVoice">
|
||||
<view class="voice-icon-wrap">
|
||||
<image class="play-svg" :src="isPlayingVoice ? ICONS.pause : ICONS.play" mode="aspectFit" />
|
||||
</view>
|
||||
<view class="voice-info">
|
||||
<text class="voice-title">{{ isPlayingVoice ? '正在连麦试听语音...' : '点击试听打招呼原声' }}</text>
|
||||
<view class="voice-wave" v-if="isPlayingVoice">
|
||||
<view class="bar b1"></view>
|
||||
<view class="bar b2"></view>
|
||||
<view class="bar b3"></view>
|
||||
<view class="bar b4"></view>
|
||||
</view>
|
||||
<text class="voice-dur" v-else>{{ expert.voiceDuration }}s 真实原声</text>
|
||||
</view>
|
||||
<text class="listen-tag">试听</text>
|
||||
</view>
|
||||
|
||||
<!-- 个人简介 -->
|
||||
<view class="section-card">
|
||||
<view class="sec-title">个人介绍</view>
|
||||
<text class="bio-text">{{ expert.bio }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 服务项目选择 -->
|
||||
<view class="section-card">
|
||||
<view class="sec-title">服务项目</view>
|
||||
<view class="service-list">
|
||||
<view
|
||||
v-for="srv in expert.services"
|
||||
:key="srv.id"
|
||||
class="service-item btn-active"
|
||||
:class="{ selected: selectedServiceId === srv.id }"
|
||||
@click="selectService(srv)"
|
||||
>
|
||||
<view class="srv-left">
|
||||
<view class="srv-title">{{ srv.title }}</view>
|
||||
<view class="srv-desc">{{ srv.desc }}</view>
|
||||
</view>
|
||||
<view class="srv-right">
|
||||
<text class="price-sym">¥</text>
|
||||
<text class="price-num">{{ srv.price }}</text>
|
||||
<text class="price-unit">/{{ srv.unit }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 线下安全守则提示卡 -->
|
||||
<view class="offline-safety-card" v-if="expert.city">
|
||||
<image class="safety-icon-svg" :src="ICONS.shield" mode="aspectFit" />
|
||||
<view class="safety-content">
|
||||
<text class="safety-title">绿色合规陪伴服务承诺</text>
|
||||
<text class="safety-desc">该大神已完成公安实名联网比对与健康认证。同城陪玩/陪吃/陪喝仅限在公开正规商业场所履约,到场出示4位核销码现场签到。</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 战绩与生活照片 -->
|
||||
<view class="section-card" v-if="expert.photos && expert.photos.length > 0">
|
||||
<view class="sec-title">战绩相册</view>
|
||||
<scroll-view scroll-x class="gallery-scroll" :show-scrollbar="false">
|
||||
<view class="gallery-list">
|
||||
<image
|
||||
v-for="(photo, index) in expert.photos"
|
||||
:key="index"
|
||||
class="gallery-item"
|
||||
:src="photo"
|
||||
mode="aspectFill"
|
||||
@click="previewImage(index)"
|
||||
/>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 真实买家评价 -->
|
||||
<view class="section-card">
|
||||
<view class="sec-header">
|
||||
<text class="sec-title">服务好评 ({{ expert.reviews ? expert.reviews.length : 0 }})</text>
|
||||
<text class="rate-percent">好评率 99.8%</text>
|
||||
</view>
|
||||
|
||||
<view class="review-list" v-if="expert.reviews && expert.reviews.length > 0">
|
||||
<view v-for="rev in expert.reviews" :key="rev.id" class="review-item">
|
||||
<image class="rev-avatar" :src="rev.userAvatar" mode="aspectFill" />
|
||||
<view class="rev-body">
|
||||
<view class="rev-top">
|
||||
<text class="rev-name">{{ rev.userNickname }}</text>
|
||||
<text class="rev-time">{{ rev.time }}</text>
|
||||
</view>
|
||||
<view class="tag-row">
|
||||
<text class="rev-tag" v-for="(t, i) in rev.tags" :key="i">{{ t }}</text>
|
||||
</view>
|
||||
<text class="rev-content">{{ rev.content }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="empty-reviews">
|
||||
<text>近期新增服务,暂无评价记录</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -160,22 +166,63 @@
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { EXPERTS_LIST } from '@/common/mock.js';
|
||||
import SkeletonScreen from '@/components/SkeletonScreen.vue';
|
||||
import { getCompanionDetail, getExpertReviews } from '@/common/api.js';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
|
||||
const expert = ref(EXPERTS_LIST[0]);
|
||||
const selectedServiceId = ref(EXPERTS_LIST[0].services[0] ? EXPERTS_LIST[0].services[0].id : null);
|
||||
const isLoading = ref(true);
|
||||
const expert = ref({
|
||||
id: '',
|
||||
nickname: '同城陪伴师',
|
||||
avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=300',
|
||||
gender: 'female',
|
||||
levelTag: '平台认证',
|
||||
game: '同城陪伴',
|
||||
rankTag: '专业级',
|
||||
city: '北京市 · 朝阳/海淀',
|
||||
rating: 5.0,
|
||||
orderCount: 0,
|
||||
bio: '专业同城生活陪伴,健康阳光公开。',
|
||||
voiceDuration: 15,
|
||||
price: 68,
|
||||
services: [],
|
||||
photos: [],
|
||||
reviews: []
|
||||
});
|
||||
const selectedServiceId = ref(null);
|
||||
const isPlayingVoice = ref(false);
|
||||
|
||||
onLoad((query) => {
|
||||
if (query && query.id) {
|
||||
const found = EXPERTS_LIST.find(e => e.id === query.id);
|
||||
if (found) {
|
||||
expert.value = found;
|
||||
if (found.services && found.services.length > 0) {
|
||||
selectedServiceId.value = found.services[0].id;
|
||||
onLoad(async (query) => {
|
||||
const targetId = (query && query.id) ? query.id : '1';
|
||||
try {
|
||||
const liveData = await getCompanionDetail(targetId);
|
||||
if (liveData) {
|
||||
expert.value = liveData;
|
||||
if (liveData.services && liveData.services.length > 0) {
|
||||
selectedServiceId.value = liveData.services[0].id;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const liveReviews = await getExpertReviews(targetId);
|
||||
if (Array.isArray(liveReviews) && liveReviews.length > 0) {
|
||||
expert.value.reviews = liveReviews.map(r => ({
|
||||
id: r.id,
|
||||
userNickname: r.userNickname || '买家玩家',
|
||||
userAvatar: r.userAvatar || 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=100',
|
||||
rating: r.rating || 5,
|
||||
tags: r.tags || [],
|
||||
content: r.content || '好评!',
|
||||
time: r.createdAt ? '近期' : '刚刚'
|
||||
}));
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch (err) {
|
||||
console.warn('[ExpertDetail] 获取线上大神详情异常:', err);
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
isLoading.value = false;
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -199,7 +246,27 @@ const toggleVoice = () => {
|
||||
};
|
||||
|
||||
const chatOnline = () => {
|
||||
uni.showToast({ title: '已开启即时加密连麦通道', icon: 'none' });
|
||||
uni.showActionSheet({
|
||||
itemList: [
|
||||
`与【${expert.value.nickname}】开启即时连麦`,
|
||||
`向【${expert.value.nickname}】发送打招呼私信`,
|
||||
`复制大神游戏开黑专属房号`
|
||||
],
|
||||
success: (res) => {
|
||||
if (res.tapIndex === 0) {
|
||||
uni.showToast({ title: '已建立加密连麦通道', icon: 'success' });
|
||||
} else if (res.tapIndex === 1) {
|
||||
uni.showToast({ title: '打招呼私信已送达', icon: 'success' });
|
||||
} else {
|
||||
uni.setClipboardData({
|
||||
data: `PW-${expert.value.id}-${Math.floor(1000 + Math.random() * 9000)}`,
|
||||
success: () => {
|
||||
uni.showToast({ title: '专属房号已复制', icon: 'success' });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const previewImage = (index) => {
|
||||
|
||||
780
pwuniapp/pages/expert/hall.vue
普通文件
780
pwuniapp/pages/expert/hall.vue
普通文件
@@ -0,0 +1,780 @@
|
||||
<template>
|
||||
<view class="hall-container" :class="{ 'theme-warm': currentThemeKey === 'warm' }" :style="navStyle">
|
||||
<!-- 顶部接单状态栏与打烊开关 -->
|
||||
<view class="hall-header-card">
|
||||
<view class="expert-info-left">
|
||||
<image class="avatar-img" :src="expert.avatar" mode="aspectFill" />
|
||||
<view class="text-meta">
|
||||
<view class="name-row">
|
||||
<text class="expert-name">{{ expert.nickname }}</text>
|
||||
<text class="pro-badge">接单中</text>
|
||||
</view>
|
||||
<text class="rating-sub">评分 5.0 · 接单率 99.2%</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="status-toggle btn-active" @click="toggleOnlineStatus">
|
||||
<view class="status-dot" :class="{ active: isOnline }"></view>
|
||||
<text class="toggle-text">{{ isOnline ? '在线接单' : '打烊休息' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 今日派单核心数据卡 -->
|
||||
<view class="hall-stats-card">
|
||||
<view class="stat-col">
|
||||
<text class="stat-num text-green">¥{{ todayStats.income }}</text>
|
||||
<text class="stat-label">今日已入账</text>
|
||||
</view>
|
||||
<view class="stat-divider"></view>
|
||||
<view class="stat-col">
|
||||
<text class="stat-num">{{ todayStats.orders }}</text>
|
||||
<text class="stat-label">已履约单数</text>
|
||||
</view>
|
||||
<view class="stat-divider"></view>
|
||||
<view class="stat-col">
|
||||
<text class="stat-num text-orange">{{ todayStats.waitingVerify }}</text>
|
||||
<text class="stat-label">待核销门票</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 订单品类筛选器 (横向单行防折行胶囊滑栏) -->
|
||||
<view class="category-tabs-wrap">
|
||||
<scroll-view class="category-scroll" scroll-x :show-scrollbar="false">
|
||||
<view class="tabs-list">
|
||||
<view
|
||||
v-for="cat in categories"
|
||||
:key="cat.key"
|
||||
class="cat-chip btn-active"
|
||||
:class="{ active: activeCategory === cat.key }"
|
||||
@click="activeCategory = cat.key"
|
||||
>
|
||||
<image v-if="cat.icon" class="chip-icon-svg" :src="cat.icon" mode="aspectFit" />
|
||||
<text class="chip-text">{{ cat.name }}</text>
|
||||
<view class="chip-count" v-if="cat.count">{{ cat.count }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 派单池订单列表 -->
|
||||
<view class="dispatch-list">
|
||||
<view
|
||||
v-for="order in filteredOrders"
|
||||
:key="order.id"
|
||||
class="dispatch-card"
|
||||
>
|
||||
<view class="card-top-row">
|
||||
<view class="tag-group">
|
||||
<text class="category-tag" :class="order.typeClass">{{ order.category }}</text>
|
||||
<text class="pay-method-tag">{{ order.payMethod }}</text>
|
||||
</view>
|
||||
<view class="reward-box">
|
||||
<text class="reward-val">¥{{ order.reward }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<text class="order-title">{{ order.title }}</text>
|
||||
|
||||
<view class="info-grid">
|
||||
<view class="info-row">
|
||||
<image class="row-icon" :src="ICONS.mapPin" mode="aspectFit" />
|
||||
<text class="row-text">{{ order.location }} (距您 {{ order.distance }})</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<image class="row-icon" :src="ICONS.bolt" mode="aspectFit" />
|
||||
<text class="row-text">预约时段:{{ order.timeSlot }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="remark-box">
|
||||
<text class="remark-text">需求备注:{{ order.requirement }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 卡片底部操作栏 -->
|
||||
<view class="card-action-bar">
|
||||
<view class="user-inline">
|
||||
<image class="user-avatar" :src="order.userAvatar" mode="aspectFill" />
|
||||
<text class="user-name">{{ order.userName }}</text>
|
||||
</view>
|
||||
<button class="btn-grab-order btn-active" @click="handleGrabOrder(order)">
|
||||
立即接单
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部自定义导航栏 (接单人端:接单大厅 / 我要接单[5km雷达] / 个人中心) -->
|
||||
<custom-tab-bar current="hall" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import CustomTabBar from '@/components/CustomTabBar.vue';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { isExpertCertified } from '@/common/role.js';
|
||||
import { createOrder, getOrdersPool, getExpertStats, claimOrder } from '@/common/api.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const expert = ref({
|
||||
id: 101,
|
||||
nickname: '接单大神',
|
||||
avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=300'
|
||||
});
|
||||
const isOnline = ref(true);
|
||||
const activeCategory = ref('all');
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
|
||||
const navStyle = computed(() => {
|
||||
return {
|
||||
'--safe-header-gap': `${navInfo.value.safeHeaderGap}px`,
|
||||
'--capsule-bottom': `${navInfo.value.capsuleBottom || (navInfo.value.safeHeaderGap + 32)}px`,
|
||||
'--capsule-below-gap': `${navInfo.value.capsuleBelowGap || (navInfo.value.safeHeaderGap + 42)}px`
|
||||
};
|
||||
});
|
||||
|
||||
const todayStats = ref({
|
||||
income: '380.00',
|
||||
orders: 4,
|
||||
waitingVerify: 1
|
||||
});
|
||||
|
||||
const onThemeChanged = (newTheme) => {
|
||||
currentThemeKey.value = newTheme;
|
||||
applyThemeToNativeUI(newTheme);
|
||||
};
|
||||
|
||||
const loadHallData = async () => {
|
||||
try {
|
||||
const stats = await getExpertStats(101);
|
||||
if (stats) {
|
||||
todayStats.value = stats;
|
||||
}
|
||||
const pool = await getOrdersPool();
|
||||
if (pool && pool.length > 0) {
|
||||
orders.value = pool.map(p => {
|
||||
let typeClass = 'cat-food';
|
||||
if (p.category.includes('喝') || p.category.includes('咖啡')) typeClass = 'cat-drink';
|
||||
if (p.category.includes('唱') || p.category.includes('KTV')) typeClass = 'cat-sing';
|
||||
if (p.category.includes('游戏') || p.category.includes('电竞') || p.category.includes('开黑')) typeClass = 'cat-game';
|
||||
return {
|
||||
...p,
|
||||
typeClass,
|
||||
timeSlot: p.timeSlot || '今日内随时可约',
|
||||
distance: '1.2km内',
|
||||
requirement: p.requirement || '按约定准时到场,文明健康社交。'
|
||||
};
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[Hall] 加载接单大厅数据异常:', err);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
navInfo.value = getNavBarInfo();
|
||||
currentThemeKey.value = getCurrentThemeKey();
|
||||
applyThemeToNativeUI(currentThemeKey.value);
|
||||
uni.$on('theme-change', onThemeChanged);
|
||||
loadHallData();
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
if (!isExpertCertified()) {
|
||||
uni.showToast({
|
||||
title: '非认证大神禁止访问接单大厅',
|
||||
icon: 'none',
|
||||
duration: 1500
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({ url: '/pages/user/index' });
|
||||
}, 400);
|
||||
return;
|
||||
}
|
||||
navInfo.value = getNavBarInfo();
|
||||
currentThemeKey.value = getCurrentThemeKey();
|
||||
applyThemeToNativeUI(currentThemeKey.value);
|
||||
uni.hideTabBar({ animation: false, fail: () => {} });
|
||||
loadHallData();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
uni.$off('theme-change', onThemeChanged);
|
||||
});
|
||||
|
||||
|
||||
const categories = ref([
|
||||
{ key: 'all', name: '全部可接', count: 12, icon: ICONS.gridAll },
|
||||
{ key: 'food', name: '同城美食', count: 4, icon: ICONS.utensils },
|
||||
{ key: 'drink', name: '清吧咖啡', count: 3, icon: ICONS.coffee },
|
||||
{ key: 'sing', name: 'KTV麦霸', count: 2, icon: ICONS.micVocal },
|
||||
{ key: 'game', name: '线上电竞', count: 3, icon: ICONS.gameCrosshair }
|
||||
]);
|
||||
|
||||
const orders = ref([
|
||||
{
|
||||
id: 101,
|
||||
category: '同城美食陪吃',
|
||||
typeClass: 'cat-food',
|
||||
payMethod: 'AA制各付',
|
||||
reward: 120,
|
||||
title: '三里屯北京烤鸭探店·寻2位好脾气饭搭子',
|
||||
location: '朝阳区 · 三里屯SOHO商场',
|
||||
distance: '1.1km',
|
||||
timeSlot: '今日 18:30 - 20:30',
|
||||
requirement: '已提前订座,现场各自出示4位核销码,性格随和开朗。',
|
||||
userName: '小鹿斑比',
|
||||
userAvatar: 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?w=100'
|
||||
},
|
||||
{
|
||||
id: 102,
|
||||
category: '线上电竞开黑',
|
||||
typeClass: 'cat-game',
|
||||
payMethod: '老板全包',
|
||||
reward: 70,
|
||||
title: '王者荣耀 · 微信区荣耀王者晋级双排',
|
||||
location: '线上远程连麦',
|
||||
distance: '全国',
|
||||
timeSlot: '接单后即刻开始 (2局)',
|
||||
requirement: '擅长射手或打野位,带飞晋级,开麦清晰沟通不压力。',
|
||||
userName: '想赢一把好难',
|
||||
userAvatar: 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=100'
|
||||
},
|
||||
{
|
||||
id: 103,
|
||||
category: '同城下午茶陪喝',
|
||||
typeClass: 'cat-drink',
|
||||
payMethod: '房主买单',
|
||||
reward: 150,
|
||||
title: '工体精品手冲咖啡馆 · 倾听解压与交流',
|
||||
location: '朝阳区 · 工体北路',
|
||||
distance: '1.8km',
|
||||
timeSlot: '今日 15:00 - 17:00',
|
||||
requirement: '纯正规咖啡馆,工作压力大想倾诉,求善解人意的倾听导师。',
|
||||
userName: '风吹过的夏天',
|
||||
userAvatar: 'https://images.unsplash.com/photo-1524504388940-b1c1722653e1?w=100'
|
||||
},
|
||||
{
|
||||
id: 104,
|
||||
category: '同城KTV陪唱',
|
||||
typeClass: 'cat-sing',
|
||||
payMethod: 'AA分摊',
|
||||
reward: 200,
|
||||
title: '量贩纯K包厢麦霸欢唱 · 流行情歌对唱',
|
||||
location: '朝阳区 · 青年路大悦城店',
|
||||
distance: '3.2km',
|
||||
timeSlot: '今日 20:00 - 23:00',
|
||||
requirement: '爱唱歌、不跑调,会带动气氛,严禁任何违规,正规量贩KTV。',
|
||||
userName: '麦霸小王子',
|
||||
userAvatar: 'https://images.unsplash.com/photo-1519085360753-af0119f7cbe7?w=100'
|
||||
}
|
||||
]);
|
||||
|
||||
const filteredOrders = computed(() => {
|
||||
if (activeCategory.value === 'all') return orders.value;
|
||||
if (activeCategory.value === 'food') return orders.value.filter(o => o.typeClass === 'cat-food');
|
||||
if (activeCategory.value === 'drink') return orders.value.filter(o => o.typeClass === 'cat-drink');
|
||||
if (activeCategory.value === 'sing') return orders.value.filter(o => o.typeClass === 'cat-sing');
|
||||
if (activeCategory.value === 'game') return orders.value.filter(o => o.typeClass === 'cat-game');
|
||||
return orders.value;
|
||||
});
|
||||
|
||||
const toggleOnlineStatus = () => {
|
||||
isOnline.value = !isOnline.value;
|
||||
uni.showToast({
|
||||
title: isOnline.value ? '已开启在线接单状态' : '已设置为打烊休息',
|
||||
icon: isOnline.value ? 'success' : 'none'
|
||||
});
|
||||
};
|
||||
|
||||
const handleGrabOrder = (order) => {
|
||||
uni.showModal({
|
||||
title: '确认抢单',
|
||||
content: `【${order.category}】\n酬金:¥${order.reward}\n预约时段:${order.timeSlot}\n\n确认后立即为您保留此单并发送微信履约通知。`,
|
||||
confirmText: '立即接单',
|
||||
confirmColor: '#10B981',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
uni.showLoading({ title: '正在锁定订单...' });
|
||||
try {
|
||||
await createOrder({
|
||||
buyerId: 2001,
|
||||
clientName: order.userName || '客户老板',
|
||||
expertId: 101,
|
||||
companionName: '我 (接单大神)',
|
||||
expertAvatar: order.userAvatar || 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?w=100',
|
||||
track: order.category || '同城生活',
|
||||
serviceTitle: order.title,
|
||||
hourlyRate: order.reward,
|
||||
durationHours: 2,
|
||||
amount: order.reward,
|
||||
location: order.location,
|
||||
expenseBurden: order.payMethod,
|
||||
status: '履约中'
|
||||
});
|
||||
} catch (_) {}
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '接单成功!请准时履约',
|
||||
icon: 'success'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/list'
|
||||
});
|
||||
}, 600);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.hall-container {
|
||||
min-height: 100vh;
|
||||
background-color: #0A0F1D;
|
||||
color: #F8FAFC;
|
||||
padding-top: var(--capsule-below-gap, calc(var(--safe-header-gap, 36rpx) + 80rpx));
|
||||
padding-left: 28rpx;
|
||||
padding-right: 28rpx;
|
||||
padding-bottom: 24rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.hall-header-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #151D30;
|
||||
border-radius: 28rpx;
|
||||
padding: 24rpx 28rpx;
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.08);
|
||||
margin-top: 0;
|
||||
margin-bottom: 24rpx;
|
||||
|
||||
.expert-info-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
|
||||
.avatar-img {
|
||||
width: 88rpx;
|
||||
height: 88rpx;
|
||||
border-radius: 50%;
|
||||
border: 4rpx solid #10B981;
|
||||
}
|
||||
|
||||
.text-meta {
|
||||
.name-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
|
||||
.expert-name {
|
||||
font-size: 30rpx;
|
||||
font-weight: 800;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.pro-badge {
|
||||
font-size: 18rpx;
|
||||
background: rgba(16, 185, 129, 0.2);
|
||||
color: #10B981;
|
||||
padding: 2rpx 10rpx;
|
||||
border-radius: 8rpx;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.rating-sub {
|
||||
font-size: 20rpx;
|
||||
color: #94A3B8;
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.status-toggle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
background: #0A0F1D;
|
||||
padding: 12rpx 24rpx;
|
||||
border-radius: 30rpx;
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.1);
|
||||
|
||||
.status-dot {
|
||||
width: 14rpx;
|
||||
height: 14rpx;
|
||||
border-radius: 50%;
|
||||
background: #64748B;
|
||||
|
||||
&.active {
|
||||
background: #10B981;
|
||||
box-shadow: 0 0 10rpx #10B981;
|
||||
}
|
||||
}
|
||||
|
||||
.toggle-text {
|
||||
font-size: 22rpx;
|
||||
color: #E2E8F0;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hall-stats-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
background: #151D30;
|
||||
border-radius: 24rpx;
|
||||
padding: 24rpx 16rpx;
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.08);
|
||||
margin-bottom: 24rpx;
|
||||
|
||||
.stat-col {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.stat-num {
|
||||
font-size: 32rpx;
|
||||
font-weight: 800;
|
||||
color: #FFFFFF;
|
||||
font-family: monospace;
|
||||
|
||||
&.text-green {
|
||||
color: #10B981;
|
||||
}
|
||||
&.text-orange {
|
||||
color: #F59E0B;
|
||||
}
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 20rpx;
|
||||
color: #94A3B8;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.stat-divider {
|
||||
width: 1rpx;
|
||||
height: 48rpx;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.category-tabs-wrap {
|
||||
margin-bottom: 24rpx;
|
||||
width: 100%;
|
||||
|
||||
.category-scroll {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
box-sizing: border-box;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.tabs-list {
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
padding: 6rpx 4rpx;
|
||||
|
||||
.cat-chip {
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap;
|
||||
padding: 14rpx 26rpx;
|
||||
background: #151D30;
|
||||
border-radius: 32rpx;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
box-sizing: border-box;
|
||||
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
|
||||
.chip-icon-svg {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-right: 10rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.chip-text {
|
||||
font-size: 24rpx;
|
||||
color: #94A3B8;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.chip-count {
|
||||
font-size: 20rpx;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 20rpx;
|
||||
margin-left: 10rpx;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
color: #94A3B8;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: linear-gradient(135deg, #10B981 0%, #059669 100%);
|
||||
border-color: #34D399;
|
||||
box-shadow: 0 4rpx 16rpx rgba(16, 185, 129, 0.35);
|
||||
|
||||
.chip-text {
|
||||
color: #FFFFFF;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.chip-count {
|
||||
background: rgba(255, 255, 255, 0.25);
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dispatch-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20rpx;
|
||||
|
||||
.dispatch-card {
|
||||
background: #151D30;
|
||||
border-radius: 24rpx;
|
||||
padding: 24rpx;
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.08);
|
||||
|
||||
.card-top-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 12rpx;
|
||||
|
||||
.tag-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10rpx;
|
||||
|
||||
.category-tag {
|
||||
font-size: 20rpx;
|
||||
padding: 4rpx 14rpx;
|
||||
border-radius: 8rpx;
|
||||
font-weight: 700;
|
||||
|
||||
&.cat-food {
|
||||
background: rgba(245, 158, 11, 0.15);
|
||||
color: #F59E0B;
|
||||
}
|
||||
&.cat-game {
|
||||
background: rgba(99, 102, 241, 0.15);
|
||||
color: #818CF8;
|
||||
}
|
||||
&.cat-drink {
|
||||
background: rgba(16, 185, 129, 0.15);
|
||||
color: #10B981;
|
||||
}
|
||||
&.cat-sing {
|
||||
background: rgba(236, 72, 153, 0.15);
|
||||
color: #EC4899;
|
||||
}
|
||||
}
|
||||
|
||||
.pay-method-tag {
|
||||
font-size: 20rpx;
|
||||
color: #94A3B8;
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.reward-box {
|
||||
.reward-val {
|
||||
font-size: 36rpx;
|
||||
font-weight: 800;
|
||||
color: #10B981;
|
||||
font-family: monospace;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.order-title {
|
||||
font-size: 28rpx;
|
||||
font-weight: 700;
|
||||
color: #F8FAFC;
|
||||
display: block;
|
||||
margin-bottom: 14rpx;
|
||||
}
|
||||
|
||||
.info-grid {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
margin-bottom: 12rpx;
|
||||
|
||||
.info-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
|
||||
.row-icon {
|
||||
width: 22rpx;
|
||||
height: 22rpx;
|
||||
}
|
||||
|
||||
.row-text {
|
||||
font-size: 22rpx;
|
||||
color: #94A3B8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.remark-box {
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
border-radius: 12rpx;
|
||||
padding: 10rpx 14rpx;
|
||||
margin-bottom: 18rpx;
|
||||
|
||||
.remark-text {
|
||||
font-size: 22rpx;
|
||||
color: #CBD5E1;
|
||||
}
|
||||
}
|
||||
|
||||
.card-action-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-top: 16rpx;
|
||||
border-top: 1rpx solid rgba(255, 255, 255, 0.06);
|
||||
|
||||
.user-inline {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10rpx;
|
||||
|
||||
.user-avatar {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.user-name {
|
||||
font-size: 22rpx;
|
||||
color: #94A3B8;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-grab-order {
|
||||
background: linear-gradient(135deg, #10B981, #059669);
|
||||
color: #FFFFFF;
|
||||
font-size: 24rpx;
|
||||
font-weight: 700;
|
||||
padding: 10rpx 28rpx;
|
||||
border-radius: 28rpx;
|
||||
box-shadow: 0 4rpx 12rpx rgba(16, 185, 129, 0.35);
|
||||
margin: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 浅色暖阳 (Warm Theme) 适配 */
|
||||
&.theme-warm {
|
||||
background-color: #FAF7F2;
|
||||
color: #292524;
|
||||
|
||||
.hall-header-card {
|
||||
background: #FFFFFF;
|
||||
border-color: #E7E5E4;
|
||||
.expert-info-left .text-meta .name-row .expert-name {
|
||||
color: #292524;
|
||||
}
|
||||
.status-toggle {
|
||||
background: #F5F5F4;
|
||||
border-color: #E7E5E4;
|
||||
.toggle-text {
|
||||
color: #44403C;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hall-stats-card {
|
||||
background: #FFFFFF;
|
||||
border-color: #E7E5E4;
|
||||
.stat-col .stat-num {
|
||||
color: #292524;
|
||||
&.text-green { color: #10B981; }
|
||||
&.text-orange { color: #EA580C; }
|
||||
}
|
||||
.stat-divider {
|
||||
background: #E7E5E4;
|
||||
}
|
||||
}
|
||||
|
||||
.category-tabs-wrap .tabs-list .cat-chip {
|
||||
background: #FFFFFF;
|
||||
border: 1px solid #E7E5E4;
|
||||
box-shadow: 0 2rpx 10rpx rgba(28, 25, 23, 0.03);
|
||||
|
||||
.chip-text {
|
||||
color: #57534E;
|
||||
}
|
||||
.chip-count {
|
||||
background: #F5F5F4;
|
||||
color: #78716C;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: linear-gradient(135deg, #10B981 0%, #059669 100%);
|
||||
border-color: #10B981;
|
||||
box-shadow: 0 4rpx 14rpx rgba(16, 185, 129, 0.3);
|
||||
|
||||
.chip-text {
|
||||
color: #FFFFFF;
|
||||
font-weight: 700;
|
||||
}
|
||||
.chip-count {
|
||||
background: rgba(255, 255, 255, 0.25);
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dispatch-list .dispatch-card {
|
||||
background: #FFFFFF;
|
||||
border-color: #E7E5E4;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.03);
|
||||
|
||||
.order-title {
|
||||
color: #292524;
|
||||
}
|
||||
.remark-box {
|
||||
background: #F5F5F4;
|
||||
.remark-text { color: #44403C; }
|
||||
}
|
||||
.card-action-bar {
|
||||
border-top-color: #F5F5F4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
1232
pwuniapp/pages/expert/radar.vue
普通文件
1232
pwuniapp/pages/expert/radar.vue
普通文件
文件差异内容过多而无法显示
加载差异
@@ -30,12 +30,12 @@
|
||||
<view class="stat-divider"></view>
|
||||
<view class="stat-col">
|
||||
<text class="stat-label">今日履约单数</text>
|
||||
<text class="stat-val">3 单</text>
|
||||
<text class="stat-val">{{ todayOrdersCount }} 单</text>
|
||||
</view>
|
||||
<view class="stat-divider"></view>
|
||||
<view class="stat-col">
|
||||
<text class="stat-label">待签到核销</text>
|
||||
<text class="stat-val gold-val">1 人</text>
|
||||
<text class="stat-val gold-val">{{ waitingVerifyCount }} 人</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -202,17 +202,26 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { EXPERTS_LIST } from '@/common/mock.js';
|
||||
import { isExpertCertified } from '@/common/role.js';
|
||||
import { queryCheckinCode, universalVerifyCheckin, getOrders, getOrdersPool, getExpertStats, claimOrder } from '@/common/api.js';
|
||||
|
||||
const expert = ref(EXPERTS_LIST[0]);
|
||||
const expert = ref({
|
||||
id: 101,
|
||||
nickname: '认证大神',
|
||||
avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=300'
|
||||
});
|
||||
const isReceivingOrders = ref(true);
|
||||
const todayIncome = ref(175);
|
||||
const todayIncome = ref('0.00');
|
||||
const todayOrdersCount = ref(0);
|
||||
const waitingVerifyCount = ref(0);
|
||||
const inputDigits = ref([]);
|
||||
const isCodeError = ref(false);
|
||||
const showConfirmModal = ref(false);
|
||||
|
||||
|
||||
const verifiedParticipant = ref({
|
||||
nickname: '电竞萌新小可爱',
|
||||
avatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=150&h=150&fit=crop',
|
||||
@@ -299,52 +308,166 @@ const fillDemoCode = () => {
|
||||
verifyInputCode();
|
||||
};
|
||||
|
||||
const verifyInputCode = () => {
|
||||
const codeStr = inputDigits.value.join('');
|
||||
if (codeStr === '8392') {
|
||||
isCodeError.value = false;
|
||||
showConfirmModal.value = true;
|
||||
} else {
|
||||
isCodeError.value = true;
|
||||
uni.showToast({
|
||||
title: `核销码 [${codeStr}] 无效或已被核销`,
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
isCodeError.value = false;
|
||||
}, 800);
|
||||
const loadWorkspaceOrders = async () => {
|
||||
try {
|
||||
const stats = await getExpertStats(101);
|
||||
if (stats) {
|
||||
if (stats.income !== undefined) todayIncome.value = stats.income;
|
||||
if (stats.orders !== undefined) todayOrdersCount.value = stats.orders;
|
||||
if (stats.waitingVerify !== undefined) waitingVerifyCount.value = stats.waitingVerify;
|
||||
}
|
||||
|
||||
const pool = await getOrdersPool();
|
||||
if (pool && pool.length > 0) {
|
||||
poolOrders.value = pool.map(p => ({
|
||||
id: p.id,
|
||||
game: p.category || '同城陪伴',
|
||||
price: p.reward || 68,
|
||||
desc: p.title || '同城线下生活陪伴,需准时到场',
|
||||
countdown: p.countdown || 50
|
||||
}));
|
||||
}
|
||||
|
||||
const list = await getOrders();
|
||||
if (Array.isArray(list) && list.length > 0) {
|
||||
const active = list.filter(o => o.status === 'IN_SERVICE').map(o => ({
|
||||
id: o.id,
|
||||
buyerName: o.expert.nickname || '客户老板',
|
||||
buyerAvatar: o.expert.avatar || 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=150',
|
||||
serviceTitle: o.serviceTitle,
|
||||
hours: o.quantity,
|
||||
totalAmount: o.totalAmount,
|
||||
statusText: o.verifyCode ? `现场码[${o.verifyCode}]到场核销服务中` : '正在履约服务中'
|
||||
}));
|
||||
if (active.length > 0) {
|
||||
activeOrders.value = active;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[Workspace] 加载服务列表异常:', err);
|
||||
}
|
||||
};
|
||||
|
||||
const confirmCheckin = () => {
|
||||
showConfirmModal.value = false;
|
||||
todayIncome.value += 25;
|
||||
inputDigits.value = [];
|
||||
uni.showToast({
|
||||
title: '核销成功!¥25已释放到账',
|
||||
icon: 'success'
|
||||
});
|
||||
onMounted(() => {
|
||||
if (isExpertCertified()) {
|
||||
loadWorkspaceOrders();
|
||||
}
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
if (!isExpertCertified()) {
|
||||
uni.showToast({
|
||||
title: '非认证大神禁止访问工作台',
|
||||
icon: 'none',
|
||||
duration: 1500
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({ url: '/pages/user/index' });
|
||||
}, 400);
|
||||
return;
|
||||
}
|
||||
loadWorkspaceOrders();
|
||||
});
|
||||
|
||||
const verifyInputCode = async () => {
|
||||
const codeStr = inputDigits.value.join('');
|
||||
uni.showLoading({ title: '核验核销码中...' });
|
||||
try {
|
||||
const info = await queryCheckinCode(codeStr);
|
||||
uni.hideLoading();
|
||||
if (info.checkedIn) {
|
||||
isCodeError.value = true;
|
||||
uni.showToast({
|
||||
title: `核销码 [${codeStr}] 已核销完成,请勿重复签到`,
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => { isCodeError.value = false; }, 1200);
|
||||
return;
|
||||
}
|
||||
verifiedParticipant.value = {
|
||||
id: info.id,
|
||||
nickname: info.nickname || '同城搭子',
|
||||
avatar: info.avatar || 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=150',
|
||||
activityTitle: info.title || '同城生活组局',
|
||||
code: info.code,
|
||||
fee: info.fee || '50.00',
|
||||
};
|
||||
isCodeError.value = false;
|
||||
showConfirmModal.value = true;
|
||||
} catch (err) {
|
||||
uni.hideLoading();
|
||||
isCodeError.value = true;
|
||||
uni.showToast({
|
||||
title: err.message || `核销码 [${codeStr}] 无效`,
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => { isCodeError.value = false; }, 1000);
|
||||
}
|
||||
};
|
||||
|
||||
const grabOrder = (order) => {
|
||||
const confirmCheckin = async () => {
|
||||
const codeStr = verifiedParticipant.value.code;
|
||||
uni.showLoading({ title: '确认核销中...' });
|
||||
try {
|
||||
await universalVerifyCheckin(codeStr, 1001);
|
||||
uni.hideLoading();
|
||||
showConfirmModal.value = false;
|
||||
const gainedFee = Number(verifiedParticipant.value.fee) || 25;
|
||||
todayIncome.value = (Number(todayIncome.value) + gainedFee).toFixed(2);
|
||||
inputDigits.value = [];
|
||||
uni.showToast({
|
||||
title: `核销成功!¥${gainedFee}已释放到账`,
|
||||
icon: 'success'
|
||||
});
|
||||
loadWorkspaceOrders();
|
||||
} catch (err) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: err.message || '核销异常',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const grabOrder = async (order) => {
|
||||
try {
|
||||
await claimOrder(order.id, {
|
||||
expertId: 101,
|
||||
companionName: '我 (接单大神)',
|
||||
expertAvatar: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=150'
|
||||
});
|
||||
} catch (_) {}
|
||||
uni.showToast({
|
||||
title: `抢单成功!已接单 ¥${order.price}`,
|
||||
icon: 'success'
|
||||
});
|
||||
poolOrders.value = poolOrders.value.filter(o => o.id !== order.id);
|
||||
activeOrders.value.push({
|
||||
id: `ord_grabbed_${Date.now()}`,
|
||||
buyerName: '特惠预约老板',
|
||||
buyerAvatar: 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=150&h=150&fit=crop',
|
||||
serviceTitle: order.game,
|
||||
hours: 1,
|
||||
totalAmount: order.price,
|
||||
statusText: '待双方进房连麦'
|
||||
});
|
||||
loadWorkspaceOrders();
|
||||
};
|
||||
|
||||
|
||||
const chatWithBuyer = () => {
|
||||
uni.showToast({ title: '已连接买家专属密聊通道', icon: 'none' });
|
||||
uni.showActionSheet({
|
||||
itemList: [
|
||||
'呼叫进入买家专属开黑语音连麦',
|
||||
'发送微信快捷提醒(准备开局)',
|
||||
'复制开黑联络码'
|
||||
],
|
||||
success: (res) => {
|
||||
if (res.tapIndex === 0) {
|
||||
uni.showToast({ title: '已建立加密语音通道', icon: 'success' });
|
||||
} else if (res.tapIndex === 1) {
|
||||
uni.showToast({ title: '已发送准备开局提醒', icon: 'success' });
|
||||
} else {
|
||||
uni.setClipboardData({
|
||||
data: `BUYER-${Math.floor(100000 + Math.random() * 900000)}`,
|
||||
success: () => {
|
||||
uni.showToast({ title: '联络码已复制', icon: 'success' });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const completeOrder = (id) => {
|
||||
|
||||
@@ -1,159 +1,185 @@
|
||||
<template>
|
||||
<view class="index-container" :class="{ 'theme-warm': currentThemeKey === 'warm' }">
|
||||
<view class="index-container" :class="{ 'theme-warm': currentThemeKey === 'warm' }" :style="navStyle">
|
||||
<!-- 顶部搜索栏 (矢量SVG搜索图标,交互聚焦微动效) -->
|
||||
<view class="header-search">
|
||||
<view class="search-box">
|
||||
<image class="search-icon-img" :src="ICONS.search" mode="aspectFit" />
|
||||
<input class="search-input" placeholder="搜索同城陪吃、陪喝、KTV陪唱或达人" placeholder-class="placeholder-text" />
|
||||
<input class="search-input" placeholder="搜索同城陪玩、美食、KTV嗨唱" placeholder-class="placeholder-text" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 游戏分类滑动栏 (SVG分类图标,单行横滑,抗挤压) -->
|
||||
<scroll-view scroll-x class="category-scroll" :show-scrollbar="false">
|
||||
<view class="category-list">
|
||||
<!-- 首页骨架屏 (首屏加载中占位,防布局偏移与视觉空白) -->
|
||||
<skeleton-screen v-if="isLoading" type="home" />
|
||||
|
||||
<!-- 真实内容 (加载完成平滑展示) -->
|
||||
<view v-else class="index-body-wrapper">
|
||||
<!-- 精彩活动横幅轮播 (流光投影) -->
|
||||
<swiper class="banner-swiper" circular autoplay interval="4000" indicator-dots indicator-color="rgba(255,255,255,0.3)" indicator-active-color="#6366F1">
|
||||
<swiper-item v-for="banner in banners" :key="banner.id" class="banner-item" @click="goToActivity(banner)">
|
||||
<view class="banner-card" :style="{ background: banner.bg || 'linear-gradient(135deg, #F43F5E 0%, #FB7185 100%)' }">
|
||||
<image v-if="banner.image" class="banner-bg-img" :src="banner.image" mode="aspectFill" />
|
||||
<view v-if="banner.image" class="banner-overlay"></view>
|
||||
<view class="banner-content">
|
||||
<view class="banner-tag">{{ banner.tag || banner.badge || '热门陪伴' }}</view>
|
||||
<view class="banner-title">{{ banner.title }}</view>
|
||||
<view class="banner-sub">{{ banner.subtitle || '点击立即参与' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
|
||||
<!-- 陪玩活动项目专属金刚区 (10宫格经典网格:2行×5列,纯图标+主标题) -->
|
||||
<view class="quick-grid grid-card">
|
||||
<view
|
||||
v-for="item in games"
|
||||
v-for="item in activityProjects"
|
||||
:key="item.id"
|
||||
class="category-item btn-active"
|
||||
:class="{ active: currentCategory === item.id }"
|
||||
@click="selectCategory(item.id)"
|
||||
class="quick-item btn-active"
|
||||
@click="handleProjectClick(item)"
|
||||
>
|
||||
<image class="cat-icon-svg" :src="item.icon" mode="aspectFit" />
|
||||
<text class="cat-name">{{ item.name }}</text>
|
||||
<view v-if="item.hot" class="cat-badge">
|
||||
<text class="badge-text">HOT</text>
|
||||
<view class="quick-icon-bg" :class="item.bgClass">
|
||||
<image class="quick-svg" :src="item.icon" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="quick-title">{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 精彩活动横幅轮播 (流光投影) -->
|
||||
<swiper class="banner-swiper" circular autoplay interval="4000" indicator-dots indicator-color="rgba(255,255,255,0.2)" indicator-active-color="#6366F1">
|
||||
<swiper-item v-for="banner in banners" :key="banner.id" class="banner-item" @click="goToActivity">
|
||||
<view class="banner-card" :style="{ background: banner.bg }">
|
||||
<view class="banner-tag">{{ banner.tag }}</view>
|
||||
<view class="banner-title">{{ banner.title }}</view>
|
||||
<view class="banner-sub">点击立即参与</view>
|
||||
<!-- 陪玩大神瀑布流标题 -->
|
||||
<view class="section-title-wrap">
|
||||
<view class="section-title">
|
||||
<view class="title-line"></view>
|
||||
<text>精选在线大神</text>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view class="section-more">
|
||||
<view class="pulse-point"></view>
|
||||
<text>实时在线</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 快捷功能金刚区 (纯矢量SVG图标,88rpx触控热区) -->
|
||||
<view class="quick-grid grid-card">
|
||||
<view class="quick-item btn-active" @click="navTo('/pages/activity/list')">
|
||||
<view class="quick-icon-bg bg-purple">
|
||||
<image class="quick-svg" :src="ICONS.teamUp" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="quick-title">组队开黑</text>
|
||||
<text class="quick-sub">AA制五排</text>
|
||||
</view>
|
||||
<view class="quick-item btn-active" @click="navTo('/pages/activity/my-ticket')">
|
||||
<view class="quick-icon-bg bg-green">
|
||||
<image class="quick-svg" :src="ICONS.ticket" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="quick-title">我的门票</text>
|
||||
<text class="quick-sub">4位核销码</text>
|
||||
</view>
|
||||
<view class="quick-item btn-active" @click="navTo('/pages/order/list')">
|
||||
<view class="quick-icon-bg bg-blue">
|
||||
<image class="quick-svg" :src="ICONS.orderList" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="quick-title">服务订单</text>
|
||||
<text class="quick-sub">状态实时看</text>
|
||||
</view>
|
||||
<view class="quick-item btn-active" @click="navTo('/pages/expert/workspace')">
|
||||
<view class="quick-icon-bg bg-orange">
|
||||
<image class="quick-svg" :src="ICONS.expertBadge" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="quick-title">大神中心</text>
|
||||
<text class="quick-sub">接单工作台</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 陪玩大神瀑布流标题 -->
|
||||
<view class="section-title-wrap">
|
||||
<view class="section-title">
|
||||
<view class="title-line"></view>
|
||||
<text>精选在线大神</text>
|
||||
</view>
|
||||
<view class="section-more">
|
||||
<view class="pulse-point"></view>
|
||||
<text>实时在线</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 陪玩大神卡片网格 -->
|
||||
<view class="expert-grid">
|
||||
<view
|
||||
v-for="expert in filteredExperts"
|
||||
:key="expert.id"
|
||||
class="expert-card card-active"
|
||||
@click="goToExpert(expert.id)"
|
||||
>
|
||||
<!-- 封面图构图优化:高保真黄金比例与底部流光渐变 -->
|
||||
<view class="card-cover-wrap">
|
||||
<image class="card-cover" :src="expert.avatar" mode="aspectFill" />
|
||||
<view class="cover-gradient"></view>
|
||||
|
||||
<view class="status-tag" :class="expert.isOnline ? 'online' : 'offline'">
|
||||
<view class="pulse-dot" v-if="expert.isOnline"></view>
|
||||
<text>{{ expert.isOnline ? '在线' : '离线' }}</text>
|
||||
</view>
|
||||
<view class="game-badge">{{ expert.game }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 信息区 -->
|
||||
<view class="card-body">
|
||||
<view class="row-nickname">
|
||||
<text class="nickname">{{ expert.nickname }}</text>
|
||||
<view class="gender-tag" :class="expert.gender">
|
||||
<image class="gender-svg" :src="expert.gender === 'female' ? ICONS.female : ICONS.male" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="city-badge" v-if="expert.city">
|
||||
<image class="city-pin-svg" :src="ICONS.mapPin" mode="aspectFit" />
|
||||
<text class="city-text">{{ expert.city }}</text>
|
||||
</view>
|
||||
<view class="rank-badge" v-else>{{ expert.rankTag }}</view>
|
||||
|
||||
<!-- 语音/歌声试听条 (矢量SVG播放图标,带播放高亮光晕) -->
|
||||
<view class="voice-bar btn-active" :class="{ playing: playingId === expert.id, 'song-bar': expert.voiceType === 'song' }" @click.stop="toggleVoice(expert.id)">
|
||||
<image class="voice-icon-svg" :src="playingId === expert.id ? ICONS.pause : (expert.voiceType === 'song' ? ICONS.micVocal : ICONS.play)" mode="aspectFit" />
|
||||
<text class="voice-text">{{ playingId === expert.id ? '播放中...' : (expert.voiceTitle || expert.voiceDuration + 's 原声试听') }}</text>
|
||||
<view class="wave-lines" v-if="playingId === expert.id">
|
||||
<view class="wave-item w1"></view>
|
||||
<view class="wave-item w2"></view>
|
||||
<view class="wave-item w3"></view>
|
||||
<!-- 陪玩大神卡片网格 -->
|
||||
<view class="expert-grid">
|
||||
<view
|
||||
v-for="expert in filteredExperts"
|
||||
:key="expert.id"
|
||||
class="expert-card card-active"
|
||||
@click="goToExpert(expert.id)"
|
||||
>
|
||||
<!-- 封面图构图优化:高保真黄金比例与底部流光渐变 -->
|
||||
<view class="card-cover-wrap">
|
||||
<image class="card-cover" :src="expert.avatar" mode="aspectFill" />
|
||||
<view class="cover-gradient"></view>
|
||||
|
||||
<view class="status-tag" :class="expert.isOnline ? 'online' : 'offline'">
|
||||
<view class="pulse-dot" v-if="expert.isOnline"></view>
|
||||
<text>{{ expert.isOnline ? '在线' : '离线' }}</text>
|
||||
</view>
|
||||
<view class="game-badge">{{ expert.game }}</view>
|
||||
</view>
|
||||
|
||||
<view class="card-footer">
|
||||
<view class="price-wrap tabular-num">
|
||||
<text class="price-symbol">¥</text>
|
||||
<text class="price-val">{{ expert.price }}</text>
|
||||
<text class="price-unit">/时</text>
|
||||
<!-- 信息区 -->
|
||||
<view class="card-body">
|
||||
<view class="row-nickname">
|
||||
<text class="nickname">{{ expert.nickname }}</text>
|
||||
<view class="gender-tag" :class="expert.gender">
|
||||
<image class="gender-svg" :src="expert.gender === 'female' ? ICONS.female : ICONS.male" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="city-badge" v-if="expert.city">
|
||||
<image class="city-pin-svg" :src="ICONS.mapPin" mode="aspectFit" />
|
||||
<text class="city-text">{{ expert.city }}</text>
|
||||
</view>
|
||||
<view class="rank-badge" v-else>{{ expert.rankTag }}</view>
|
||||
|
||||
<!-- 语音/歌声试听条 (矢量SVG播放图标,带播放高亮光晕) -->
|
||||
<view class="voice-bar btn-active" :class="{ playing: playingId === expert.id, 'song-bar': expert.voiceType === 'song' }" @click.stop="toggleVoice(expert.id)">
|
||||
<image class="voice-icon-svg" :src="playingId === expert.id ? ICONS.pause : (expert.voiceType === 'song' ? ICONS.micVocal : ICONS.play)" mode="aspectFit" />
|
||||
<text class="voice-text">{{ playingId === expert.id ? '播放中...' : (expert.voiceTitle || expert.voiceDuration + 's 原声试听') }}</text>
|
||||
<view class="wave-lines" v-if="playingId === expert.id">
|
||||
<view class="wave-item w1"></view>
|
||||
<view class="wave-item w2"></view>
|
||||
<view class="wave-item w3"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-footer">
|
||||
<view class="price-wrap tabular-num">
|
||||
<text class="price-symbol">¥</text>
|
||||
<text class="price-val">{{ expert.price }}</text>
|
||||
<text class="price-unit">/时</text>
|
||||
</view>
|
||||
<text class="order-count tabular-num">{{ expert.orderCount }}单</text>
|
||||
</view>
|
||||
<text class="order-count tabular-num">{{ expert.orderCount }}单</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部自定义导航栏 (发单人端:首页 / 活动中心 / 我要发单 / 友圈 / 个人中心) -->
|
||||
<custom-tab-bar current="home" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { GAMES_LIST, BANNERS, EXPERTS_LIST } from '@/common/mock.js';
|
||||
import CustomTabBar from '@/components/CustomTabBar.vue';
|
||||
import SkeletonScreen from '@/components/SkeletonScreen.vue';
|
||||
import { getCompanions, getBanners } from '@/common/api.js';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
|
||||
const games = ref(GAMES_LIST);
|
||||
const banners = ref(BANNERS);
|
||||
const experts = ref(EXPERTS_LIST);
|
||||
const isLoading = ref(true);
|
||||
const banners = ref([]);
|
||||
const experts = ref([]);
|
||||
const currentCategory = ref('all');
|
||||
const playingId = ref(null);
|
||||
const currentThemeKey = ref(getCurrentThemeKey());
|
||||
const navInfo = ref(getNavBarInfo());
|
||||
|
||||
const navStyle = computed(() => {
|
||||
return {
|
||||
'--safe-header-gap': `${navInfo.value.safeHeaderGap}px`,
|
||||
'--capsule-right-space': `${navInfo.value.capsuleRightSpace}px`,
|
||||
'--capsule-height': `${navInfo.value.capsuleHeight}px`
|
||||
};
|
||||
});
|
||||
|
||||
const loadInitialData = async () => {
|
||||
try {
|
||||
await Promise.allSettled([
|
||||
fetchLiveCompanions(),
|
||||
fetchLiveBanners()
|
||||
]);
|
||||
} finally {
|
||||
// 平滑延时关闭骨架屏,呈现优雅扫光转场
|
||||
setTimeout(() => {
|
||||
isLoading.value = false;
|
||||
}, 200);
|
||||
}
|
||||
};
|
||||
|
||||
const fetchLiveCompanions = async () => {
|
||||
try {
|
||||
const list = await getCompanions();
|
||||
if (Array.isArray(list) && list.length > 0) {
|
||||
experts.value = list;
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[Index] 获取大神数据失败:', err);
|
||||
}
|
||||
};
|
||||
|
||||
const fetchLiveBanners = async () => {
|
||||
try {
|
||||
const list = await getBanners();
|
||||
if (Array.isArray(list) && list.length > 0) {
|
||||
banners.value = list;
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[Index] 获取Banner配置失败:', err);
|
||||
}
|
||||
};
|
||||
|
||||
const onThemeChanged = (key) => {
|
||||
currentThemeKey.value = key;
|
||||
@@ -161,16 +187,23 @@ const onThemeChanged = (key) => {
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
navInfo.value = getNavBarInfo();
|
||||
currentThemeKey.value = getCurrentThemeKey();
|
||||
applyThemeToNativeUI(currentThemeKey.value);
|
||||
uni.$on('theme-change', onThemeChanged);
|
||||
loadInitialData();
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
navInfo.value = getNavBarInfo();
|
||||
currentThemeKey.value = getCurrentThemeKey();
|
||||
applyThemeToNativeUI(currentThemeKey.value);
|
||||
uni.hideTabBar({ animation: false, fail: () => {} });
|
||||
fetchLiveCompanions();
|
||||
fetchLiveBanners();
|
||||
});
|
||||
|
||||
|
||||
onUnmounted(() => {
|
||||
uni.$off('theme-change', onThemeChanged);
|
||||
});
|
||||
@@ -191,10 +224,6 @@ const filteredExperts = computed(() => {
|
||||
return target ? experts.value.filter(e => e.game === target) : experts.value;
|
||||
});
|
||||
|
||||
const selectCategory = (id) => {
|
||||
currentCategory.value = id;
|
||||
};
|
||||
|
||||
const toggleVoice = (id) => {
|
||||
if (playingId.value === id) {
|
||||
playingId.value = null;
|
||||
@@ -213,10 +242,113 @@ const goToExpert = (id) => {
|
||||
});
|
||||
};
|
||||
|
||||
const goToActivity = () => {
|
||||
uni.switchTab({
|
||||
url: '/pages/activity/list'
|
||||
});
|
||||
const goToActivity = (banner) => {
|
||||
if (banner && banner.link) {
|
||||
if (banner.link.startsWith('/pages/activity/list') || banner.link.startsWith('/pages/order/list') || banner.link.startsWith('/pages/user/index')) {
|
||||
uni.switchTab({ url: banner.link });
|
||||
} else {
|
||||
uni.navigateTo({ url: banner.link });
|
||||
}
|
||||
} else {
|
||||
uni.switchTab({
|
||||
url: '/pages/activity/list'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const activityProjects = [
|
||||
{
|
||||
id: 'esports',
|
||||
name: '电子竞技',
|
||||
icon: ICONS.gameAll,
|
||||
bgClass: 'bg-indigo',
|
||||
cat: 'all',
|
||||
targetUrl: '/pages/activity/list?category=ALL'
|
||||
},
|
||||
{
|
||||
id: 'meal',
|
||||
name: '美食探店',
|
||||
icon: ICONS.utensils,
|
||||
bgClass: 'bg-amber',
|
||||
cat: 'offline_meal',
|
||||
targetUrl: '/pages/activity/list?category=MEAL'
|
||||
},
|
||||
{
|
||||
id: 'sing',
|
||||
name: 'KTV嗨唱',
|
||||
icon: ICONS.micVocal,
|
||||
bgClass: 'bg-rose',
|
||||
cat: 'offline_sing',
|
||||
targetUrl: '/pages/activity/list?category=SING'
|
||||
},
|
||||
{
|
||||
id: 'billiards',
|
||||
name: '同城台球',
|
||||
icon: ICONS.billiards,
|
||||
bgClass: 'bg-sky',
|
||||
cat: 'offline_play',
|
||||
targetUrl: '/pages/activity/list?category=ALL'
|
||||
},
|
||||
{
|
||||
id: 'hiking',
|
||||
name: '户外爬山',
|
||||
icon: ICONS.mountain,
|
||||
bgClass: 'bg-emerald',
|
||||
cat: 'offline_play',
|
||||
targetUrl: '/pages/activity/list?category=ALL'
|
||||
},
|
||||
{
|
||||
id: 'drink',
|
||||
name: '下午茶歇',
|
||||
icon: ICONS.coffee,
|
||||
bgClass: 'bg-teal',
|
||||
cat: 'offline_drink',
|
||||
targetUrl: '/pages/activity/list?category=DRINK'
|
||||
},
|
||||
{
|
||||
id: 'boardgame',
|
||||
name: '剧本桌游',
|
||||
icon: ICONS.dice,
|
||||
bgClass: 'bg-purple',
|
||||
cat: 'offline_play',
|
||||
targetUrl: '/pages/activity/list?category=ALL'
|
||||
},
|
||||
{
|
||||
id: 'fitness',
|
||||
name: '运动健身',
|
||||
icon: ICONS.fitness,
|
||||
bgClass: 'bg-orange',
|
||||
cat: 'offline_play',
|
||||
targetUrl: '/pages/activity/list?category=ALL'
|
||||
},
|
||||
{
|
||||
id: 'bar',
|
||||
name: '同城微醺',
|
||||
icon: ICONS.warmFlame,
|
||||
bgClass: 'bg-rose',
|
||||
cat: 'offline_drink',
|
||||
targetUrl: '/pages/activity/list?category=DRINK'
|
||||
},
|
||||
{
|
||||
id: 'more',
|
||||
name: '全部活动',
|
||||
icon: ICONS.gridAll,
|
||||
bgClass: 'bg-blue',
|
||||
cat: 'all',
|
||||
targetUrl: '/pages/activity/list?category=ALL'
|
||||
}
|
||||
];
|
||||
|
||||
const handleProjectClick = (item) => {
|
||||
if (item.cat) {
|
||||
currentCategory.value = item.cat;
|
||||
}
|
||||
if (item.targetUrl) {
|
||||
uni.reLaunch({
|
||||
url: item.targetUrl
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const navTo = (url) => {
|
||||
@@ -254,6 +386,9 @@ const navTo = (url) => {
|
||||
align-items: center;
|
||||
background-color: #151D30;
|
||||
height: 80rpx;
|
||||
/* #ifdef MP-WEIXIN */
|
||||
height: var(--capsule-height, 64rpx);
|
||||
/* #endif */
|
||||
border-radius: 40rpx;
|
||||
padding: 0 28rpx;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
@@ -277,82 +412,7 @@ const navTo = (url) => {
|
||||
}
|
||||
.placeholder-text {
|
||||
color: #64748B;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.category-scroll {
|
||||
white-space: nowrap;
|
||||
padding: 0 32rpx 10rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
.category-list {
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
padding: 16rpx 0 10rpx;
|
||||
}
|
||||
|
||||
.category-item {
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap;
|
||||
padding: 14rpx 28rpx;
|
||||
background-color: #151D30;
|
||||
border-radius: 32rpx;
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
position: relative;
|
||||
transition: all 0.15s ease-out;
|
||||
|
||||
.cat-icon-svg {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.cat-name {
|
||||
font-size: 24rpx;
|
||||
color: #94A3B8;
|
||||
font-weight: 500;
|
||||
}
|
||||
.cat-badge {
|
||||
position: absolute;
|
||||
top: -10rpx;
|
||||
right: -8rpx;
|
||||
height: 26rpx;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: linear-gradient(135deg, #FF3B30 0%, #FF2D55 100%);
|
||||
border: 2rpx solid #0A0F1D;
|
||||
padding: 0 10rpx;
|
||||
border-radius: 14rpx;
|
||||
box-shadow: 0 4rpx 12rpx rgba(255, 45, 85, 0.5);
|
||||
z-index: 3;
|
||||
pointer-events: none;
|
||||
|
||||
.badge-text {
|
||||
color: #FFFFFF;
|
||||
font-size: 16rpx;
|
||||
font-weight: 800;
|
||||
font-style: italic;
|
||||
line-height: 1;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
|
||||
border-color: #818CF8;
|
||||
box-shadow: 0 4rpx 16rpx rgba(99, 102, 241, 0.45);
|
||||
|
||||
.cat-name {
|
||||
color: #FFFFFF;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -369,44 +429,80 @@ const navTo = (url) => {
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.45);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
.banner-tag {
|
||||
align-self: flex-start;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
backdrop-filter: blur(8px);
|
||||
padding: 4rpx 14rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 20rpx;
|
||||
color: #FFF;
|
||||
margin-bottom: 8rpx;
|
||||
.banner-bg-img {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1;
|
||||
}
|
||||
.banner-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
color: #FFF;
|
||||
margin-bottom: 6rpx;
|
||||
|
||||
.banner-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0.4) 100%);
|
||||
z-index: 2;
|
||||
}
|
||||
.banner-sub {
|
||||
font-size: 22rpx;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
|
||||
.banner-content {
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
|
||||
.banner-tag {
|
||||
align-self: flex-start;
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
backdrop-filter: blur(8px);
|
||||
padding: 4rpx 14rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 20rpx;
|
||||
color: #FFF;
|
||||
margin-bottom: 8rpx;
|
||||
border: 1px solid rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
.banner-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
color: #FFF;
|
||||
margin-bottom: 6rpx;
|
||||
text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
.banner-sub {
|
||||
font-size: 22rpx;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
text-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.quick-grid {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, 1fr);
|
||||
row-gap: 24rpx;
|
||||
column-gap: 6rpx;
|
||||
margin: 0 32rpx 32rpx;
|
||||
background-color: #151D30;
|
||||
border-radius: 24rpx;
|
||||
padding: 24rpx 16rpx;
|
||||
padding: 28rpx 10rpx 24rpx;
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
|
||||
.quick-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
|
||||
.quick-icon-bg {
|
||||
width: 80rpx;
|
||||
@@ -415,29 +511,36 @@ const navTo = (url) => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 12rpx;
|
||||
transition: transform 0.15s ease;
|
||||
margin-bottom: 10rpx;
|
||||
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
|
||||
.quick-svg {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
width: 42rpx;
|
||||
height: 42rpx;
|
||||
}
|
||||
|
||||
&.bg-purple { background: rgba(139, 92, 246, 0.15); border: 1px solid rgba(139, 92, 246, 0.3); }
|
||||
&.bg-green { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); }
|
||||
&.bg-blue { background: rgba(99, 102, 241, 0.15); border: 1px solid rgba(99, 102, 241, 0.3); }
|
||||
&.bg-orange { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); }
|
||||
&.bg-indigo { background: rgba(99, 102, 241, 0.15); border: 1px solid rgba(99, 102, 241, 0.3); }
|
||||
&.bg-amber { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); }
|
||||
&.bg-rose { background: rgba(244, 63, 94, 0.15); border: 1px solid rgba(244, 63, 94, 0.3); }
|
||||
&.bg-sky { background: rgba(14, 165, 233, 0.15); border: 1px solid rgba(14, 165, 233, 0.3); }
|
||||
&.bg-emerald { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); }
|
||||
&.bg-teal { background: rgba(20, 184, 166, 0.15); border: 1px solid rgba(20, 184, 166, 0.3); }
|
||||
}
|
||||
|
||||
.quick-title {
|
||||
font-size: 24rpx;
|
||||
font-size: 22rpx;
|
||||
color: #F8FAFC;
|
||||
font-weight: 600;
|
||||
margin-bottom: 4rpx;
|
||||
white-space: nowrap;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.quick-sub {
|
||||
font-size: 18rpx;
|
||||
color: #64748B;
|
||||
|
||||
&:active .quick-icon-bg {
|
||||
transform: scale(0.92);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -731,6 +834,10 @@ const navTo = (url) => {
|
||||
.index-container.theme-warm {
|
||||
background-color: #FDFBF7;
|
||||
|
||||
.banner-swiper .banner-card {
|
||||
box-shadow: 0 8rpx 28rpx rgba(28, 25, 23, 0.12);
|
||||
}
|
||||
|
||||
.header-search {
|
||||
background-color: #FDFBF7;
|
||||
.search-box {
|
||||
@@ -751,23 +858,6 @@ const navTo = (url) => {
|
||||
}
|
||||
}
|
||||
|
||||
.category-scroll .category-item {
|
||||
background: #FFFFFF;
|
||||
border: 1px solid #F0ECE4;
|
||||
.cat-name {
|
||||
color: #57534E;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: linear-gradient(135deg, rgba(234, 88, 12, 0.12), rgba(249, 115, 22, 0.05));
|
||||
border-color: #EA580C;
|
||||
.cat-name {
|
||||
color: #EA580C;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.quick-grid, .grid-card {
|
||||
background-color: #FFFFFF;
|
||||
border-color: #F0ECE4;
|
||||
@@ -777,8 +867,18 @@ const navTo = (url) => {
|
||||
.quick-title {
|
||||
color: #1C1917;
|
||||
}
|
||||
.quick-sub {
|
||||
color: #78716C;
|
||||
|
||||
.quick-icon-bg {
|
||||
&.bg-purple { background: rgba(139, 92, 246, 0.1); border-color: rgba(139, 92, 246, 0.2); }
|
||||
&.bg-green { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.2); }
|
||||
&.bg-blue { background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.2); }
|
||||
&.bg-orange { background: rgba(249, 115, 22, 0.1); border-color: rgba(249, 115, 22, 0.2); }
|
||||
&.bg-indigo { background: rgba(99, 102, 241, 0.1); border-color: rgba(99, 102, 241, 0.2); }
|
||||
&.bg-amber { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.2); }
|
||||
&.bg-rose { background: rgba(244, 63, 94, 0.1); border-color: rgba(244, 63, 94, 0.2); }
|
||||
&.bg-sky { background: rgba(14, 165, 233, 0.1); border-color: rgba(14, 165, 233, 0.2); }
|
||||
&.bg-emerald { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.2); }
|
||||
&.bg-teal { background: rgba(20, 184, 166, 0.1); border-color: rgba(20, 184, 166, 0.2); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
文件差异内容过多而无法显示
加载差异
在新工单中引用
屏蔽一个用户