From a1307fa148329ba0128db5d9d4f3f9df58f69551 Mon Sep 17 00:00:00 2001 From: jacobxu666 Date: Fri, 26 Jun 2026 10:16:24 +0800 Subject: [PATCH] feat(mock): extract all hardcoded data into mock/ modules - scenic.ts: 42 items from scenic-list.vue + filter options - scenic-detail.ts: 8 items from scenic-detail.vue - order.ts: 6 items from order-list.vue (replaces placeholder) - reserve.ts: 6 items from reserve-list.vue (replaces placeholder) - notice.ts: 5 items from notice-list.vue - store.ts: updated to use new local types All image URLs replaced with constants from images.ts --- src/mock/notice.ts | 19 +++++ src/mock/order.ts | 29 +++++++- src/mock/reserve.ts | 32 +++++++- src/mock/scenic-detail.ts | 149 ++++++++++++++++++++++++++++++++++++++ src/mock/scenic.ts | 124 +++++++++++++++++++++++++++++++ src/mock/store.ts | 13 ++-- 6 files changed, 354 insertions(+), 12 deletions(-) create mode 100644 src/mock/notice.ts create mode 100644 src/mock/scenic-detail.ts create mode 100644 src/mock/scenic.ts diff --git a/src/mock/notice.ts b/src/mock/notice.ts new file mode 100644 index 0000000..f53ae27 --- /dev/null +++ b/src/mock/notice.ts @@ -0,0 +1,19 @@ +/** + * 公告列表 mock 数据 — 从 notice-list.vue 提取 + */ + +export interface NoticeItem { + id: number + title: string + date: string + content: string + body: string +} + +export const mockNotices: NoticeItem[] = [ + { id: 1, title: '赣湘全域旅游年卡限时优惠', date: '2026-06-20', content: '赣湘全域旅游年卡限时优惠,工会会员专享¥300/套卡!', body: '赣湘全域旅游年卡限时优惠活动现已开启,工会会员凭有效证件可享专享价¥300/套卡(原价¥580)。套卡包含武功山金顶景区、杨岐山孽龙洞景区、仙凤三宝景区等42家合作景区全年免首道门票权益,覆盖萍乡、长沙、株洲、湘潭等地区。活动期间购买还可额外获赠君澜温泉单次体验券一张。活动截止至2026年7月31日,数量有限,售完即止。' }, + { id: 2, title: '武功山金顶景区开放通知', date: '2026-06-18', content: '武功山金顶景区已开放,持卡可免费入园1次。', body: '武功山金顶景区即日起正常开放,营业时间08:00-18:00。赣湘全域旅游年卡持卡用户可免费入园1次(含首道门票,价值¥70)。温馨提示:山顶温差较大,建议携带防风保暖衣物;雷雨天气请勿登顶;需提前1天通过小程序预约,每日限流5000人。' }, + { id: 3, title: '超级玩家卡全新上线', date: '2026-06-15', content: '超级玩家卡全新上线,40家景区免门票,仅¥198!', body: '超级玩家卡全新上线!仅需¥198即可享受40家合作景区免首道门票权益,单次最高可省¥228。覆盖景区包括武功山金顶(¥70)、君澜温泉(¥228)、杨岐山孽龙洞(¥68)、仙凤三宝(¥50)等热门景区。卡片有效期为购买之日起一年,法定节假日通用,不限购买次数。适合经常出游的家庭和户外爱好者。' }, + { id: 4, title: '端午节假期景区预约提醒', date: '2026-06-10', content: '端午假期热门景区需提前预约,请合理安排出行。', body: '端午节假期(6月14日至16日)期间,武功山金顶景区、君澜温泉等热门景区将实行限流措施,每日限流5000人。请持卡用户提前通过小程序预约,未预约将无法入园。建议错峰出行,关注景区实时客流信息。' }, + { id: 5, title: '新增合作景区:莲花荷博园', date: '2026-06-05', content: '莲花荷博园正式加入合作景区,持卡免门票6次。', body: '莲花荷博园于2026年6月起正式加入赣湘全域旅游年卡合作景区。持卡用户全年可免首道门票入园6次(门票原价¥35)。莲花荷博园位于萍乡市莲花县,夏季荷花盛开时景色最佳,是休闲观光的好去处。' }, +] diff --git a/src/mock/order.ts b/src/mock/order.ts index adc65df..cf6917f 100644 --- a/src/mock/order.ts +++ b/src/mock/order.ts @@ -1,4 +1,27 @@ -import type { OrderInfo } from '@/api/types' +/** + * 订单列表 mock 数据 — 从 order-list.vue 提取 + */ -// 占位 — Task 5 将填充实际模拟数据 -export const mockOrders: OrderInfo[] = [] +type OrderStatus = 'pending' | 'activated' | 'refunded' | 'expired' + +export interface OrderItem { + id: string + status: OrderStatus + createTime: string + payAmount: number + originalPrice: number + cardType: string + redeemCode: string + payChannel: string + activatedTime?: string + refundedTime?: string +} + +export const mockOrders: OrderItem[] = [ + { id: 'ORD20260625001', status: 'pending', createTime: '2026-06-25 10:32', payAmount: 198, originalPrice: 3800, cardType: '超级玩家卡', redeemCode: 'CJ0000012398', payChannel: '微信支付' }, + { id: 'ORD20260624002', status: 'activated', createTime: '2026-06-24 14:18', payAmount: 198, originalPrice: 3800, cardType: '超级玩家卡', redeemCode: 'CJ0000012399', payChannel: '微信支付', activatedTime: '2026-06-24 15:00' }, + { id: 'ORD20260623003', status: 'pending', createTime: '2026-06-23 09:45', payAmount: 198, originalPrice: 3800, cardType: '超级玩家卡', redeemCode: 'CJ0000012400', payChannel: '微信支付' }, + { id: 'ORD20260620004', status: 'refunded', createTime: '2026-06-20 16:22', payAmount: 198, originalPrice: 3800, cardType: '超级玩家卡', redeemCode: 'CJ0000012401', payChannel: '微信支付', refundedTime: '2026-06-21 10:15' }, + { id: 'ORD20260618005', status: 'activated', createTime: '2026-06-18 11:08', payAmount: 198, originalPrice: 3800, cardType: '超级玩家卡', redeemCode: 'CJ0000012402', payChannel: '微信支付', activatedTime: '2026-06-18 12:30' }, + { id: 'ORD20260510007', status: 'activated', createTime: '2026-05-10 13:40', payAmount: 198, originalPrice: 3800, cardType: '超级玩家卡', redeemCode: 'CJ0000012403', payChannel: '微信支付', activatedTime: '2026-05-10 14:20' }, +] diff --git a/src/mock/reserve.ts b/src/mock/reserve.ts index 099bb25..d6e3cea 100644 --- a/src/mock/reserve.ts +++ b/src/mock/reserve.ts @@ -1,4 +1,30 @@ -import type { ReserveRecord } from '@/api/types' +/** + * 预约记录 mock 数据 — 从 reserve-list.vue 提取 + */ +import { IMG_AVATAR_DEFAULT, IMG_AVATAR_MALE, IMG_AVATAR_FEMALE } from './images' -// 占位 — Task 5 将填充实际模拟数据 -export const mockReserves: ReserveRecord[] = [] +type RecordStatus = 'pending' | 'used' | 'cancelled' | 'auto_used' + +export interface ReserveRecordItem { + id: string + scenicName: string + date: string + status: RecordStatus + userName: string + maskedId: string + cardType: string + cardNo: string + applyTime: string + cancelTime?: string + verifyTime?: string + verifyPhoto?: string +} + +export const mockReserves: ReserveRecordItem[] = [ + { id: 'YP26062601', scenicName: '武功山金顶景区', date: '2026-06-27', status: 'pending', userName: '张三', maskedId: '360302****1234', cardType: '超级玩家卡', cardNo: 'CJ0000012398', applyTime: '2026-06-25 14:30' }, + { id: 'YP26062502', scenicName: '杨岐山孽龙洞景区', date: '2026-06-26', status: 'pending', userName: '张三', maskedId: '360302****1234', cardType: '赣湘全域旅游年卡', cardNo: 'CJ0000012399', applyTime: '2026-06-24 10:15' }, + { id: 'YP26062003', scenicName: '仙凤三宝景区', date: '2026-06-20', status: 'used', userName: '张三', maskedId: '360302****1234', cardType: '超级玩家卡', cardNo: 'CJ0000012400', applyTime: '2026-06-18 09:20', verifyTime: '2026-06-20 09:45', verifyPhoto: IMG_AVATAR_DEFAULT }, + { id: 'YP26061804', scenicName: '武功山君澜温泉', date: '2026-06-18', status: 'cancelled', userName: '张三', maskedId: '360302****1234', cardType: '赣湘全域旅游年卡', cardNo: 'CJ0000012401', applyTime: '2026-06-16 16:40', cancelTime: '2026-06-17 20:30' }, + { id: 'YP26061505', scenicName: '凯光新天地生态旅游区', date: '2026-06-15', status: 'auto_used', userName: '张三', maskedId: '360302****1234', cardType: '超级玩家卡', cardNo: 'CJ0000012402', applyTime: '2026-06-13 11:05', verifyTime: '2026-06-16 00:00', verifyPhoto: IMG_AVATAR_MALE }, + { id: 'YP26061006', scenicName: '和平农场·哎马乐园', date: '2026-06-10', status: 'used', userName: '张三', maskedId: '360302****1234', cardType: '赣湘全域旅游年卡', cardNo: 'CJ0000012403', applyTime: '2026-06-08 08:50', verifyTime: '2026-06-10 10:22', verifyPhoto: IMG_AVATAR_FEMALE }, +] diff --git a/src/mock/scenic-detail.ts b/src/mock/scenic-detail.ts new file mode 100644 index 0000000..b97f157 --- /dev/null +++ b/src/mock/scenic-detail.ts @@ -0,0 +1,149 @@ +/** + * 景区详情 mock 数据 — 从 scenic-detail.vue 提取 + */ +import { + IMG_WUGONG_MOUNTAIN_500, + IMG_SNOW_MOUNTAIN_500, + IMG_MOUNTAIN_CLOUD_500, + IMG_PASTORAL_500, + IMG_WATERFALL_500, + IMG_FOREST_500, + IMG_RED_EDUCATION_500, + IMG_CAMPING_500, + IMG_STARRY_SKY, + IMG_JAPANESE_500, +} from './images' + +interface NoticeItem { title: string; content: string } +interface CardBenefit { type: 'super' | 'annual'; remaining: number } + +export interface ScenicDetail { + id: number + name: string + price: number + freeCount: number + level: string + hours: string + needReservation: boolean + bookingDeadline: string + phone: string + address: string + tags: string[] + images: string[] + introduction: string + bookingNotice: NoticeItem[] + cards: CardBenefit[] +} + +/** 双卡种数据:超级玩家卡 remaining 与 freeCount 一致,年卡 remaining 稍多 */ +function buildCards(freeCount: number): CardBenefit[] { + if (freeCount <= 0) return [] + return [ + { type: 'super', remaining: freeCount }, + { type: 'annual', remaining: freeCount + 2 }, + ] +} + +export const mockScenicDetails: ScenicDetail[] = [ + { + id: 1, name: '武功山金顶景区', price: 70, freeCount: 1, level: '5A', + hours: '08:00-18:00', needReservation: true, bookingDeadline: '游玩当日16:00前预约', + phone: '0799-7636666', address: '江西省萍乡市芦溪县东南边境', + tags: ['5A景区', '高山草甸', '日出云海', '徒步圣地'], + images: [IMG_WUGONG_MOUNTAIN_500, IMG_SNOW_MOUNTAIN_500, IMG_MOUNTAIN_CLOUD_500], + introduction: '武功山位于江西省萍乡市东南边缘,主峰白鹤峰海拔1918.3米,为江西省第一高峰。武功山以壮观的高山草甸、日出云海和千年古祭坛群著称,被誉为"云中草原、户外天堂"。景区内有金顶、羊狮幕、发云界等核心景观,四季景色各异,春赏杜鹃、夏避酷暑、秋观红叶、冬看雾凇,是徒步露营和摄影爱好者的理想目的地。', + bookingNotice: [ + { title: '预约方式', content: '需提前通过小程序在线预约,预约成功后凭二维码入园。每日限流5000人,建议提前1-3天预约。' }, + { title: '入园须知', content: '请携带身份证原件,配合工作人员核验健康码。山顶温差较大,建议携带防风保暖衣物。雷雨天气请勿登顶。' }, + { title: '退改规则', content: '预约成功后如需取消,请至少提前24小时操作。逾期未使用视为自动放弃,不予退款。' }, + ], + cards: buildCards(1), + }, + { + id: 2, name: '杨岐山孽龙洞景区', price: 68, freeCount: 6, level: '4A', + hours: '08:30-17:30', needReservation: false, bookingDeadline: '', + phone: '0799-3862888', address: '江西省萍乡市上栗县杨岐山', + tags: ['4A景区', '溶洞奇观', '地质公园', '天然氧吧'], + images: [IMG_MOUNTAIN_CLOUD_500, IMG_STARRY_SKY], + introduction: '孽龙洞位于杨岐山风景名胜区内,是一个形成于1.8亿年前的天然溶洞。洞内全长4公里,已开发游览线路2.8公里,洞内常年恒温18℃,钟乳石形态各异,有"地下艺术长廊"之美誉。', + bookingNotice: [ + { title: '入园方式', content: '持惠民卡直接到景区售票处验证入园,无需预约。' }, + { title: '游览提示', content: '洞内温度恒定18℃,建议携带薄外套。洞内道路湿滑,请穿防滑鞋,老人和儿童需有成人陪同。' }, + ], + cards: buildCards(6), + }, + { + id: 3, name: '仙凤三宝景区', price: 50, freeCount: 6, level: '4A', + hours: '09:00-17:00', needReservation: false, bookingDeadline: '', + phone: '0799-7558888', address: '江西省萍乡市芦溪县宣风镇', + tags: ['4A景区', '亲子乐园', '萌宠互动', '田园体验'], + images: [IMG_PASTORAL_500], + introduction: '仙凤三宝景区是一个集生态农业、亲子游乐、休闲度假于一体的综合性旅游景区。园内有萌宠乐园、花海观赏、果蔬采摘等特色项目,适合全家出行。', + bookingNotice: [ + { title: '入园方式', content: '持惠民卡直接到景区售票处验证入园,无需预约。' }, + { title: '游玩提示', content: '适合亲子游玩,园内有小动物喂养体验,请勿投喂自带食物。' }, + ], + cards: buildCards(6), + }, + { + id: 4, name: '武功山君澜温泉', price: 228, freeCount: 6, level: '4A', + hours: '10:00-22:00', needReservation: true, bookingDeadline: '游玩当日12:00前预约', + phone: '0799-7639999', address: '江西省萍乡市芦溪县武功山景区内', + tags: ['4A景区', '温泉养生', '度假休闲', '山间秘境'], + images: [IMG_WATERFALL_500, IMG_JAPANESE_500], + introduction: '武功山君澜温泉坐落于武功山脚下,依山傍水,环境优美。温泉水取自地下1500米深层矿泉,富含多种对人体有益的微量元素。', + bookingNotice: [ + { title: '预约方式', content: '需提前通过小程序预约,建议提前1天。请自备泳衣泳帽。' }, + { title: '退改规则', content: '提前24小时可免费取消。' }, + ], + cards: buildCards(6), + }, + { + id: 5, name: '凯光新天地生态旅游区', price: 90, freeCount: 6, level: '4A', + hours: '08:00-18:00', needReservation: false, bookingDeadline: '', + phone: '0799-6881888', address: '江西省萍乡市安源区高坑镇', + tags: ['4A景区', '生态观光', '户外拓展', '花卉园林'], + images: [IMG_FOREST_500], + introduction: '凯光新天地生态旅游区是集生态观光、休闲娱乐、户外运动于一体的大型生态旅游综合体。', + bookingNotice: [ + { title: '入园方式', content: '持惠民卡直接到景区售票处验证入园,无需预约。' }, + ], + cards: buildCards(6), + }, + { + id: 14, name: '安源路矿工人运动纪念馆', price: 0, freeCount: 0, level: '4A', + hours: '09:00-16:30', needReservation: false, bookingDeadline: '', + phone: '0799-6832001', address: '江西省萍乡市安源区安源镇', + tags: ['4A景区', '红色教育', '免费参观', '爱国主义基地'], + images: [IMG_RED_EDUCATION_500], + introduction: '安源路矿工人运动纪念馆是全国重点文物保护单位,全面展示了安源路矿工人大罢工的光辉历史。', + bookingNotice: [ + { title: '参观须知', content: '免费参观,周一闭馆。请携带身份证原件入馆。' }, + ], + cards: buildCards(0), + }, + { + id: 30, name: '坊楼红色文化园', price: 0, freeCount: 0, level: '3A', + hours: '09:00-17:00', needReservation: false, bookingDeadline: '', + phone: '0799-7220000', address: '江西省萍乡市莲花县坊楼镇', + tags: ['3A景区', '红色教育', '免费参观', '革命历史'], + images: [IMG_RED_EDUCATION_500], + introduction: '坊楼红色文化园展示了莲花县丰富的革命历史,是重要的红色教育基地。', + bookingNotice: [ + { title: '参观须知', content: '免费参观,请保持安静。' }, + ], + cards: buildCards(0), + }, + { + id: 38, name: '荷尧古渡口', price: 0, freeCount: 0, level: '2A', + hours: '全天开放', needReservation: false, bookingDeadline: '', + phone: '0799-3377200', address: '江西省萍乡市湘东区荷尧镇', + tags: ['2A景区', '古渡口遗址', '免费开放', '历史文化'], + images: [IMG_CAMPING_500], + introduction: '荷尧古渡口是一处保存完好的古渡口遗址,见证了千年的交通商贸历史。', + bookingNotice: [ + { title: '游览提示', content: '免费开放,全天可参观。临水区域请注意安全。' }, + ], + cards: buildCards(0), + }, +] diff --git a/src/mock/scenic.ts b/src/mock/scenic.ts new file mode 100644 index 0000000..f9c952c --- /dev/null +++ b/src/mock/scenic.ts @@ -0,0 +1,124 @@ +/** + * 景区列表 mock 数据 — 从 scenic-list.vue 提取 + */ +import { + IMG_WUGONG_MOUNTAIN, + IMG_MOUNTAIN_CLOUD, + IMG_PASTORAL, + IMG_WATERFALL, + IMG_FOREST, + IMG_GRASSLAND, + IMG_MOUNTAIN_RANGE, + IMG_FARMLAND, + IMG_FOREST_PATH, + IMG_BEACH, + IMG_FIREWORKS, + IMG_TEMPLE, + IMG_CAMPING, + IMG_RED_EDUCATION, + IMG_FLOWERS, + IMG_LAKE, + IMG_SNOW_MOUNTAIN, + IMG_JAPANESE, + IMG_RESORT, + IMG_HOTEL, + IMG_HILLTOP, + IMG_ANCIENT_VILLAGE, +} from './images' + +/** 景区列表项(匹配 scenic-list.vue 内部 ScenicItem) */ +export interface ScenicItem { + id: number + name: string + price: number + freeCount: number + level: string + status: '正常营业' | '暂停营业' + hours: string + needReservation: boolean + tips: string + type: string + region: string + image: string + cardTypes?: string[] +} + +export const mockScenicList: ScenicItem[] = [ + { id: 1, name: '武功山金顶景区', price: 70, freeCount: 1, level: '5A', status: '正常营业', hours: '08:00-18:00', needReservation: true, tips: '建议提前1天预约,山顶温差大请备好外套', type: '自然风光', region: '芦溪县', image: IMG_WUGONG_MOUNTAIN }, + { id: 2, name: '杨岐山孽龙洞景区', price: 68, freeCount: 6, level: '4A', status: '正常营业', hours: '08:30-17:30', needReservation: false, tips: '洞内温度恒定18℃,建议携带薄外套', type: '自然风光', region: '上栗县', image: IMG_MOUNTAIN_CLOUD }, + { id: 3, name: '仙凤三宝景区', price: 50, freeCount: 6, level: '4A', status: '正常营业', hours: '09:00-17:00', needReservation: false, tips: '适合亲子游玩,园内有小动物喂养体验', type: '乡村田园', region: '芦溪县', image: IMG_PASTORAL }, + { id: 4, name: '武功山君澜温泉', price: 228, freeCount: 6, level: '4A', status: '正常营业', hours: '10:00-22:00', needReservation: true, tips: '需提前预约,请自备泳衣泳帽', type: '休闲娱乐', region: '芦溪县', image: IMG_WATERFALL }, + { id: 5, name: '凯光新天地生态旅游区', price: 90, freeCount: 6, level: '4A', status: '正常营业', hours: '08:00-18:00', needReservation: false, tips: '园区较大,建议穿舒适运动鞋', type: '休闲娱乐', region: '安源区', image: IMG_FOREST }, + { id: 6, name: '和平农场·哎马乐园', price: 79, freeCount: 6, level: '3A', status: '正常营业', hours: '09:00-17:30', needReservation: false, tips: '亲子乐园,周末人流较多建议错峰', type: '乡村田园', region: '湘东区', image: IMG_GRASSLAND }, + { id: 7, name: '武功山滑草场', price: 60, freeCount: 6, level: '3A', status: '正常营业', hours: '09:00-17:00', needReservation: false, tips: '雨天暂停开放,请关注天气', type: '休闲娱乐', region: '芦溪县', image: IMG_MOUNTAIN_RANGE }, + { id: 8, name: '芦溪仙凤三宝农业休闲观光园', price: 50, freeCount: 6, level: '3A', status: '正常营业', hours: '08:30-17:30', needReservation: false, tips: '可体验采摘,季节性水果品种丰富', type: '乡村田园', region: '芦溪县', image: IMG_FARMLAND }, + { id: 9, name: '麻山幸福村', price: 40, freeCount: 6, level: '3A', status: '正常营业', hours: '08:00-18:00', needReservation: false, tips: '乡村旅游景区,可体验农家生活', type: '乡村田园', region: '湘东区', image: IMG_FOREST_PATH }, + { id: 10, name: '东桥双月湾', price: 38, freeCount: 6, level: '3A', status: '正常营业', hours: '08:00-18:00', needReservation: false, tips: '临水景区,请注意安全', type: '自然风光', region: '湘东区', image: IMG_BEACH }, + { id: 11, name: '上栗花炮文化博览园', price: 45, freeCount: 6, level: '3A', status: '正常营业', hours: '09:00-17:00', needReservation: false, tips: '了解花炮历史文化,适合研学', type: '文化古迹', region: '上栗县', image: IMG_FIREWORKS }, + { id: 12, name: '杨岐普通寺', price: 30, freeCount: 6, level: '3A', status: '正常营业', hours: '08:00-17:00', needReservation: false, tips: '佛教圣地,请保持安静', type: '文化古迹', region: '上栗县', image: IMG_TEMPLE }, + { id: 13, name: '孽龙洞漂流', price: 88, freeCount: 6, level: '3A', status: '暂停营业', hours: '暂停开放', needReservation: false, tips: '季节性项目,预计6月开放', type: '休闲娱乐', region: '上栗县', image: IMG_CAMPING }, + { id: 14, name: '安源路矿工人运动纪念馆', price: 0, freeCount: 0, level: '4A', status: '正常营业', hours: '09:00-16:30', needReservation: false, tips: '红色教育基地,周一闭馆', type: '红色教育', region: '安源区', image: IMG_RED_EDUCATION }, + { id: 15, name: '莲花荷博园', price: 35, freeCount: 6, level: '3A', status: '正常营业', hours: '08:00-18:00', needReservation: false, tips: '夏季荷花盛开时最佳观赏期', type: '自然风光', region: '莲花县', image: IMG_FLOWERS }, + { id: 16, name: '山口岩水利风景区', price: 25, freeCount: 6, level: '3A', status: '正常营业', hours: '08:00-18:00', needReservation: false, tips: '水利工程景观,可了解水利知识', type: '自然风光', region: '芦溪县', image: IMG_LAKE }, + { id: 17, name: '宣风三宝水上乐园', price: 65, freeCount: 6, level: '3A', status: '暂停营业', hours: '暂停开放', needReservation: false, tips: '夏季开放,请关注开园公告', type: '休闲娱乐', region: '芦溪县', image: IMG_SNOW_MOUNTAIN }, + { id: 18, name: '万龙山温泉', price: 168, freeCount: 6, level: '4A', status: '正常营业', hours: '10:00-22:00', needReservation: true, tips: '需提前预约,温泉养生好去处', type: '休闲娱乐', region: '芦溪县', image: IMG_JAPANESE }, + { id: 19, name: '杨岐山野生动物科普园', price: 42, freeCount: 6, level: '3A', status: '正常营业', hours: '09:00-17:00', needReservation: false, tips: '适合亲子科普教育', type: '乡村田园', region: '上栗县', image: IMG_TEMPLE }, + { id: 20, name: '鸡冠山森林步道', price: 0, freeCount: 0, level: '3A', status: '正常营业', hours: '全天开放', needReservation: false, tips: '森林氧吧,适合徒步健身', type: '自然风光', region: '上栗县', image: IMG_MOUNTAIN_RANGE }, + { id: 21, name: '赤山杨岐山民宿集群配套景区', price: 28, freeCount: 6, level: '2A', status: '正常营业', hours: '08:00-20:00', needReservation: false, tips: '可体验民宿住宿,感受乡村风情', type: '乡村田园', region: '上栗县', image: IMG_RESORT }, + { id: 22, name: '湘东傩文化园', price: 32, freeCount: 6, level: '3A', status: '正常营业', hours: '09:00-17:00', needReservation: false, tips: '了解傩文化,感受非遗魅力', type: '文化古迹', region: '湘东区', image: IMG_FIREWORKS }, + { id: 23, name: '广寒寨四季花海', price: 36, freeCount: 6, level: '3A', status: '正常营业', hours: '08:00-18:00', needReservation: false, tips: '四季花卉轮番绽放,拍照打卡好去处', type: '自然风光', region: '湘东区', image: IMG_FLOWERS }, + { id: 24, name: '上栗泉水湾度假村', price: 58, freeCount: 6, level: '3A', status: '正常营业', hours: '09:00-18:00', needReservation: false, tips: '休闲度假好去处,可垂钓烧烤', type: '休闲娱乐', region: '上栗县', image: IMG_HOTEL }, + { id: 25, name: '莲花棋盘山', price: 22, freeCount: 6, level: '2A', status: '正常营业', hours: '08:00-18:00', needReservation: false, tips: '登山步道完善,适合休闲健身', type: '自然风光', region: '莲花县', image: IMG_HILLTOP }, + { id: 26, name: '芦溪东阳古村', price: 26, freeCount: 6, level: '3A', status: '正常营业', hours: '08:30-17:30', needReservation: false, tips: '古建筑群保存完好,可感受传统村落文化', type: '文化古迹', region: '芦溪县', image: IMG_ANCIENT_VILLAGE }, + { id: 27, name: '安源欢乐谷', price: 72, freeCount: 6, level: '3A', status: '正常营业', hours: '09:00-18:00', needReservation: false, tips: '游乐设施丰富,适合亲子游玩', type: '休闲娱乐', region: '安源区', image: IMG_SNOW_MOUNTAIN }, + { id: 28, name: '湘东太阳广场游乐区', price: 48, freeCount: 6, level: '2A', status: '正常营业', hours: '09:00-21:00', needReservation: false, tips: '夜间灯光秀值得一看', type: '休闲娱乐', region: '湘东区', image: IMG_MOUNTAIN_CLOUD }, + { id: 29, name: '长平养生谷', price: 52, freeCount: 6, level: '3A', status: '正常营业', hours: '08:00-18:00', needReservation: false, tips: '养生休闲好去处,空气清新', type: '自然风光', region: '上栗县', image: IMG_TEMPLE }, + { id: 30, name: '坊楼红色文化园', price: 0, freeCount: 0, level: '3A', status: '正常营业', hours: '09:00-17:00', needReservation: false, tips: '红色教育基地,免费参观', type: '红色教育', region: '莲花县', image: IMG_RED_EDUCATION }, + { id: 31, name: '高坑生态采摘园', price: 33, freeCount: 6, level: '2A', status: '正常营业', hours: '08:00-18:00', needReservation: false, tips: '季节性水果采摘,体验田园乐趣', type: '乡村田园', region: '安源区', image: IMG_FARMLAND }, + { id: 32, name: '源南田园综合体', price: 39, freeCount: 6, level: '3A', status: '正常营业', hours: '08:30-17:30', needReservation: false, tips: '田园风光优美,可体验农耕文化', type: '乡村田园', region: '芦溪县', image: IMG_PASTORAL }, + { id: 33, name: '下埠陶瓷文化小镇', price: 29, freeCount: 6, level: '3A', status: '正常营业', hours: '09:00-17:00', needReservation: false, tips: '可体验陶瓷制作,了解陶瓷文化', type: '文化古迹', region: '湘东区', image: IMG_ANCIENT_VILLAGE }, + { id: 34, name: '桐木水上乐园', price: 66, freeCount: 6, level: '3A', status: '暂停营业', hours: '暂停开放', needReservation: false, tips: '夏季开放,请关注开园时间', type: '休闲娱乐', region: '上栗县', image: IMG_SNOW_MOUNTAIN }, + { id: 35, name: '东源温泉度假村', price: 138, freeCount: 6, level: '4A', status: '正常营业', hours: '10:00-22:00', needReservation: true, tips: '需提前预约,温泉品质优良', type: '休闲娱乐', region: '上栗县', image: IMG_JAPANESE }, + { id: 36, name: '长丰山水景区', price: 24, freeCount: 6, level: '2A', status: '正常营业', hours: '08:00-18:00', needReservation: false, tips: '山水相依,适合休闲散步', type: '自然风光', region: '莲花县', image: IMG_LAKE }, + { id: 37, name: '白竺青草湖', price: 27, freeCount: 6, level: '3A', status: '正常营业', hours: '08:00-18:00', needReservation: false, tips: '湖光山色,可垂钓泛舟', type: '自然风光', region: '湘东区', image: IMG_BEACH }, + { id: 38, name: '荷尧古渡口', price: 0, freeCount: 0, level: '2A', status: '正常营业', hours: '全天开放', needReservation: false, tips: '古渡口遗址,感受历史文化', type: '文化古迹', region: '湘东区', image: IMG_CAMPING }, + { id: 39, name: '新泉红色研学基地', price: 31, freeCount: 6, level: '3A', status: '正常营业', hours: '09:00-17:00', needReservation: true, tips: '研学活动需提前预约', type: '红色教育', region: '芦溪县', image: IMG_RED_EDUCATION }, + { id: 40, name: '张佳坊山地乐园', price: 55, freeCount: 6, level: '3A', status: '正常营业', hours: '09:00-17:30', needReservation: false, tips: '山地运动项目丰富,注意安全', type: '休闲娱乐', region: '芦溪县', image: IMG_MOUNTAIN_RANGE }, + { id: 41, name: '南坑户外拓展基地', price: 44, freeCount: 6, level: '3A', status: '正常营业', hours: '08:30-18:00', needReservation: true, tips: '团队拓展需提前预约', type: '休闲娱乐', region: '莲花县', image: IMG_GRASSLAND }, + { id: 42, name: '老关荷花景区', price: 34, freeCount: 6, level: '2A', status: '正常营业', hours: '08:00-18:00', needReservation: false, tips: '夏季荷花盛开,景色宜人', type: '自然风光', region: '湘东区', image: IMG_FLOWERS, cardTypes: ['年卡', '超级卡'] }, +] + +// 卡种分配:部分景区仅支持年卡,部分仅支持超级卡,其余两者均可 +;(function assignCardTypes() { + const annualOnly = new Set([4, 14, 18, 30, 35]) + const superOnly = new Set([1, 13, 17, 34, 38]) + mockScenicList.forEach(s => { + if (annualOnly.has(s.id)) s.cardTypes = ['年卡'] + else if (superOnly.has(s.id)) s.cardTypes = ['超级卡'] + else if (!s.cardTypes) s.cardTypes = ['年卡', '超级卡'] + }) +})() + +// ========== 筛选选项 ========== +export const regionOptions = [ + { label: '全部地区', value: '' }, + { label: '安源区', value: '安源区' }, + { label: '湘东区', value: '湘东区' }, + { label: '芦溪县', value: '芦溪县' }, + { label: '上栗县', value: '上栗县' }, + { label: '莲花县', value: '莲花县' }, +] + +export const levelOptions = [ + { label: '全部等级', value: '' }, + { label: '5A', value: '5A' }, + { label: '4A', value: '4A' }, + { label: '3A', value: '3A' }, + { label: '2A', value: '2A' }, +] + +export const cardTypeOptions = [ + { label: '全部卡种', value: '' }, + { label: '赣湘全域旅游年卡', value: '年卡' }, + { label: '超级玩家卡', value: '超级卡' }, +] diff --git a/src/mock/store.ts b/src/mock/store.ts index 8f0830f..117a588 100644 --- a/src/mock/store.ts +++ b/src/mock/store.ts @@ -1,17 +1,18 @@ import { ref } from 'vue' -import type { OrderInfo, ReserveRecord } from '@/api/types' +import type { OrderItem } from './order' +import type { ReserveRecordItem } from './reserve' import { mockOrders } from './order' import { mockReserves } from './reserve' -export const orderStore = ref([...mockOrders]) -export const reserveStore = ref([...mockReserves]) +export const orderStore = ref([...mockOrders]) +export const reserveStore = ref([...mockReserves]) -export function updateOrderStatus(orderId: string, status: OrderInfo['status']) { +export function updateOrderStatus(orderId: string, status: OrderItem['status']) { const order = orderStore.value.find(o => o.id === orderId) if (order) order.status = status } -export function addReserve(record: Omit) { - const id = Math.max(...reserveStore.value.map(r => r.id), 0) + 1 +export function addReserve(record: Omit) { + const id = `YP${Date.now().toString(36).toUpperCase()}` reserveStore.value.push({ ...record, id }) }