feat(mine): 我的页改为四部分:顶部头像 / 我的报名 / 我的接单 / 我的园区
- 我的报名保持原样(BOOK 标题+筛选+签到) - 我的接单(ACCEPT):扫码接单按钮(缩小)+提示任务广场到 Web/桌面端查看 - 我的园区(PARK):未入驻→申请入驻+OPC认证;已入驻→园区信息+OPC认证+转园申请;子按钮统一缩小 - 移除 服务宫格/任务广场/申请与认证 旧入口;build:weapp 通过
This commit is contained in:
@@ -4,6 +4,7 @@ import { useState, useEffect } from 'react';
|
||||
import { useTabIndex } from '@/utils/tab';
|
||||
import { isAuthed, getUser, logout, wxLogin, phoneLogin, bindPhone, sendCode, wxPhoneBind, updateProfile, getMe } from '@/utils/auth';
|
||||
import { getMyBookings, checkIn, parseIso, BK_STATUS_OPTIONS, BK_TOPIC_OPTIONS, BK_SOURCE_OPTIONS } from '@/utils/booking';
|
||||
import { getMyAdmission } from '@/utils/parks';
|
||||
import Skeleton from '@/components/skeleton';
|
||||
import CountdownBox from '@/components/CountdownBox';
|
||||
import './index.scss';
|
||||
@@ -41,20 +42,12 @@ const fmtTime = (iso) => {
|
||||
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())} 周${week}`;
|
||||
};
|
||||
|
||||
/** 我的服务宫格项:label → 子页 */
|
||||
const SVC = [
|
||||
['报名', '/pages/my-bookings/index'],
|
||||
['任务', '/pages/my-tasks/index'],
|
||||
['园区', '/pages/my-park/index'],
|
||||
['认证', '/pages/my-cert/index'],
|
||||
];
|
||||
const maskPhone = (p) => (/^1\d{10}$/.test(p || '') ? p.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2') : (p || ''));
|
||||
|
||||
export default function Mine() {
|
||||
useTabIndex(4);
|
||||
const [user, setUser] = useState(getUser());
|
||||
const [bookings, setBookings] = useState([]);
|
||||
const [phase, setPhase] = useState('all'); // 报名状态筛选
|
||||
const [admission, setAdmission] = useState([]); // 我的园区入驻记录
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [err, setErr] = useState('');
|
||||
@@ -83,6 +76,10 @@ export default function Mine() {
|
||||
const d = await getMyBookings();
|
||||
setBookings((d && d.list) || []);
|
||||
} catch { /* 保留上次列表,避免重进闪空 */ }
|
||||
try {
|
||||
const a = await getMyAdmission();
|
||||
setAdmission(Array.isArray(a) ? a : []);
|
||||
} catch { /* 保留上次 */ }
|
||||
finally { setLoaded(true); }
|
||||
};
|
||||
Taro.useDidShow(() => { refresh(); });
|
||||
@@ -397,44 +394,6 @@ export default function Mine() {
|
||||
</View>
|
||||
)}
|
||||
|
||||
{/* 任务广场入口:浏览待接单任务 */}
|
||||
<View className="card scan-entry-card" onClick={() => Taro.navigateTo({ url: '/pages/tasks/index' })}>
|
||||
<View className="scan-entry-icon">任</View>
|
||||
<View className="scan-entry-body">
|
||||
<Text className="scan-entry-title">任务广场</Text>
|
||||
<Text className="scan-entry-sub">浏览平台待接单任务,点击抢单 / 报名</Text>
|
||||
</View>
|
||||
<Text className="scan-entry-arrow">›</Text>
|
||||
</View>
|
||||
|
||||
{/* 扫码接单入口:扫描大屏任务二维码领取任务 */}
|
||||
<View className="card scan-entry-card" onClick={() => Taro.navigateTo({ url: '/pages/scan/index' })}>
|
||||
<View className="scan-entry-icon">QR</View>
|
||||
<View className="scan-entry-body">
|
||||
<Text className="scan-entry-title">扫码接单</Text>
|
||||
<Text className="scan-entry-sub">扫描大屏任务码领取任务,做任务赚预算</Text>
|
||||
</View>
|
||||
<Text className="scan-entry-arrow">›</Text>
|
||||
</View>
|
||||
|
||||
{/* 申请/认证入口:入驻 / OPC认证 / 转园 */}
|
||||
<View className="mine-section-head">
|
||||
<Text className="mine-no">APPLY</Text>
|
||||
<Text className="mine-section-title">申请与认证</Text>
|
||||
</View>
|
||||
<View className="card scan-entry-card" onClick={() => Taro.navigateTo({ url: '/pages/park-apply/index' })}>
|
||||
<View className="scan-entry-body"><Text className="scan-entry-title">园区入驻申请</Text><Text className="scan-entry-sub">填写入园申请表,入驻创业园</Text></View>
|
||||
<Text className="scan-entry-arrow">›</Text>
|
||||
</View>
|
||||
<View className="card scan-entry-card" onClick={() => Taro.navigateTo({ url: '/pages/cert-apply/index' })}>
|
||||
<View className="scan-entry-body"><Text className="scan-entry-title">OPC 认证</Text><Text className="scan-entry-sub">提交认证资料,认证 OPC 超级个体</Text></View>
|
||||
<Text className="scan-entry-arrow">›</Text>
|
||||
</View>
|
||||
<View className="card scan-entry-card" onClick={() => Taro.navigateTo({ url: '/pages/park-transfer/index' })}>
|
||||
<View className="scan-entry-body"><Text className="scan-entry-title">转园申请</Text><Text className="scan-entry-sub">园区 OPC 申请转入其它园区</Text></View>
|
||||
<Text className="scan-entry-arrow">›</Text>
|
||||
</View>
|
||||
|
||||
{/* 我的报名 */}
|
||||
<View className="mine-section-head">
|
||||
<Text className="mine-no">BOOK</Text>
|
||||
@@ -484,6 +443,50 @@ export default function Mine() {
|
||||
</View>
|
||||
);
|
||||
})()}
|
||||
|
||||
{/* 我的接单:扫码接单;任务广场移到 Web / 桌面端 */}
|
||||
<View className="mine-section-head">
|
||||
<Text className="mine-no">ACCEPT</Text>
|
||||
<Text className="mine-section-title">我的接单</Text>
|
||||
</View>
|
||||
<View className="card mk-act">
|
||||
<Button className="btn-main mk-btn-sm" onClick={() => Taro.navigateTo({ url: '/pages/scan/index' })}>扫码接单</Button>
|
||||
<Text className="mk-hint">任务广场请到 Web 端或桌面端查看</Text>
|
||||
</View>
|
||||
|
||||
{/* 我的园区:未入驻 → 申请入驻 + OPC认证;已入驻 → 园区信息 + OPC认证 + 转园 */}
|
||||
<View className="mine-section-head">
|
||||
<Text className="mine-no">PARK</Text>
|
||||
<Text className="mine-section-title">我的园区</Text>
|
||||
</View>
|
||||
{(() => {
|
||||
const ad = admission[0] || {};
|
||||
const st = String(ad.status || ad.audit_status || '').toLowerCase();
|
||||
const admitted = ['approved', 'verified', 'admitted'].includes(st) || ['已入驻', '通过', 'approved'].includes(ad.status);
|
||||
if (!admitted) {
|
||||
return (
|
||||
<View className="card mk-actions">
|
||||
<Text className="mk-hint">暂未入驻园区,可申请入驻并完成 OPC 认证。</Text>
|
||||
<View className="mk-btnrow">
|
||||
<Button className="btn-main mk-btn-sm" onClick={() => Taro.navigateTo({ url: '/pages/park-apply/index' })}>申请入驻</Button>
|
||||
<Button className="btn-ghost mk-btn-sm" onClick={() => Taro.navigateTo({ url: '/pages/cert-apply/index' })}>OPC 认证</Button>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
const name = ad.tenant_name || ad.park_name || ad.company_name || ad.company || '已入驻园区';
|
||||
return (
|
||||
<View className="card mk-park">
|
||||
<View className="mk-park-name">{name}</View>
|
||||
{ad.region ? <Text className="mk-hint">区域:{ad.region}</Text> : null}
|
||||
<View className="mk-btnrow">
|
||||
<Button className="btn-ghost mk-btn-sm" onClick={() => Taro.navigateTo({ url: '/pages/cert-apply/index' })}>OPC 认证</Button>
|
||||
<Button className="btn-ghost mk-btn-sm" onClick={() => Taro.navigateTo({ url: '/pages/park-transfer/index' })}>转园申请</Button>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
})()}
|
||||
|
||||
{err && <Text className="err-text">{err}</Text>}
|
||||
<View className="mk-foot">
|
||||
<Text className="mk-foot-line">云南省首个由政府主办的免费大学生创业服务平台</Text>
|
||||
|
||||
@@ -393,3 +393,13 @@
|
||||
.bind-key { font-size:26rpx; color:#6a6a73; }
|
||||
.bind-val { font-size:26rpx; color:#98a0ab; }
|
||||
.bind-val.on { color:#00a06e; font-weight:600; }
|
||||
|
||||
/* ---- 四部分:我的接单 / 我的园区 ---- */
|
||||
.mk-act { padding: 24rpx; }
|
||||
.mk-actions { padding: 22rpx 24rpx; }
|
||||
.mk-park { padding: 22rpx 24rpx; }
|
||||
.mk-park-name { font-size: 30rpx; font-weight: 700; color: #0d2f4e; display: block; margin-bottom: 6rpx; }
|
||||
.mk-btn-sm { font-size: 24rpx; padding: 0 26rpx; line-height: 2.2; margin: 0; }
|
||||
.mk-btnrow { display: flex; gap: 16rpx; margin-top: 18rpx; flex-wrap: wrap; }
|
||||
.mk-hint { margin-top: 12rpx; font-size: 24rpx; color: #8a8a93; display: block; line-height: 1.5; }
|
||||
.mk-hint:first-child { margin-top: 0; }
|
||||
|
||||
Reference in New Issue
Block a user