feat(activity): 附近活动页新增「发布陪玩需求(平台派单)」入口

- 组局活动与抢单订单是两套数据:组局进活动大厅,平台派单订单才进入待接单池

- 入口直接跳转 /pages/order/create(不指定大神时自动进入平台派单模式)
这个提交包含在:
xcbyy
2026-10-21 16:35:01 +08:00
父节点 16f6419cba
当前提交 18035fefad
共有 2 个文件被更改,包括 52 次插入 和 12 次删除

查看文件

@@ -22,6 +22,15 @@
</view> </view>
</view> </view>
<!-- 平台派单入口:不指定大神,发布需求后附近大神抢单 -->
<view class="demand-entry btn-active" @click="goPublishDemand">
<view class="demand-entry-left">
<text class="demand-entry-title">发布陪玩需求(平台派单)</text>
<text class="demand-entry-desc">不指定大神 · 5km 内认证大神抢单 · 30 分钟无人接单自动退款</text>
</view>
<text class="demand-entry-arrow">›</text>
</view>
<!-- 顶部模式切换选项卡 (矢量SVG模式图标) --> <!-- 顶部模式切换选项卡 (矢量SVG模式图标) -->
<view class="tab-header"> <view class="tab-header">
<view <view
@@ -180,6 +189,7 @@ import { getActivities, getNavCategories, normalizeUserId } from '@/common/api.j
import { ICONS } from '@/common/icons.js'; import { ICONS } from '@/common/icons.js';
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js'; import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
import { getNavBarInfo } from '@/common/nav.js'; import { getNavBarInfo } from '@/common/nav.js';
import { ensureLoginOrRedirect } from '@/common/role.js';
const CURRENT_USER_ID = normalizeUserId(); const CURRENT_USER_ID = normalizeUserId();
@@ -369,6 +379,11 @@ const switchTab = (tab) => {
currentTab.value = tab; currentTab.value = tab;
}; };
const goPublishDemand = () => {
if (!ensureLoginOrRedirect('/pages/activity/list')) return;
uni.navigateTo({ url: '/pages/order/create' });
};
const switchCategory = (cat) => { const switchCategory = (cat) => {
currentCategory.value = cat; currentCategory.value = cat;
}; };
@@ -393,6 +408,40 @@ const createActivity = () => {
padding: 0 32rpx calc(180rpx + env(safe-area-inset-bottom)); padding: 0 32rpx calc(180rpx + env(safe-area-inset-bottom));
} }
.demand-entry {
margin: 0 32rpx 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16rpx;
padding: 20rpx 24rpx;
border-radius: 20rpx;
border: 1rpx solid rgba(99, 102, 241, 0.35);
background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(139, 92, 246, 0.10));
.demand-entry-left {
display: flex;
flex-direction: column;
gap: 6rpx;
}
.demand-entry-title {
font-size: 26rpx;
font-weight: 600;
color: var(--text-primary, #F8FAFC);
}
.demand-entry-desc {
font-size: 21rpx;
color: var(--text-muted, #94A3B8);
}
.demand-entry-arrow {
font-size: 36rpx;
color: var(--color-brand, #6366F1);
}
}
.header-search { .header-search {
padding-top: var(--safe-header-gap, 36rpx); padding-top: var(--safe-header-gap, 36rpx);
padding-bottom: 24rpx; padding-bottom: 24rpx;

查看文件

@@ -509,9 +509,9 @@ async function resolveTencentMapKey(): Promise<string> {
return key; return key;
} }
function httpsGetJsonOnce(url: string, headers: Record<string, string>, timeoutMs = 4000): Promise<any> { function httpsGetJson(url: string, timeoutMs = 4000): Promise<any> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const req = https.get(url, { headers }, (resp) => { const req = https.get(url, (resp) => {
let data = ''; let data = '';
resp.on('data', (chunk) => { resp.on('data', (chunk) => {
data += chunk; data += chunk;
@@ -529,15 +529,6 @@ function httpsGetJsonOnce(url: string, headers: Record<string, string>, timeoutM
}); });
} }
async function httpsGetJson(url: string, timeoutMs = 4000): Promise<any> {
const referer = String(process.env.TENCENT_MAP_REFERER || 'http://118.184.172.94/').trim();
const data = await httpsGetJsonOnce(url, referer ? { Referer: referer } : {}, timeoutMs);
if (data && (data.status === 110 || data.status === 105) && referer) {
return httpsGetJsonOnce(url, {}, timeoutMs);
}
return data;
}
const geocodeCache = new Map<string, { geo: { lat: number; lng: number } | null; at: number }>(); const geocodeCache = new Map<string, { geo: { lat: number; lng: number } | null; at: number }>();
/** 地址 -> 坐标(腾讯 WebService 地理编码),带进程内缓存 */ /** 地址 -> 坐标(腾讯 WebService 地理编码),带进程内缓存 */
@@ -2970,7 +2961,7 @@ async function loadDemoAccounts(): Promise<Array<{ userId: number; roleTag: stri
roleDesc: String(a.roleDesc || ''), roleDesc: String(a.roleDesc || ''),
desc: String(a.desc || ''), desc: String(a.desc || ''),
})) }))
.filter((a: any) => a.userId > 0) .filter((a) => a.userId > 0)
.slice(0, 10); .slice(0, 10);
} catch (e) { } catch (e) {
logServerError('loadDemoAccounts', e); logServerError('loadDemoAccounts', e);