upload project

This commit is contained in:
unknown 2025-12-27 17:16:03 +08:00
commit 06961cae04
422 changed files with 110626 additions and 0 deletions

516
utils/merchant-data.js Normal file
View file

@ -0,0 +1,516 @@
/**
* 合作商家数据模块
* 包含22家合作商家的模拟数据
*/
// 商家ID起始值避免与其他marker冲突
const MERCHANT_MARKER_BASE_ID = 10000;
/**
* 22家合作商家的模拟数据
* 坐标数据为上海松江万达广场附近的示例坐标松江万达坐标31.0434°N, 121.2222°E
* 商家分布在松江万达广场周边约3公里范围内
*/
const MERCHANT_DATA = [
{
id: 1,
name: 'Elijem爱聚花园咖啡厅',
latitude: 43.7496,
longitude: 87.6398,
address: '新疆维吾尔自治区乌鲁木齐市天山区益都水岸-东南门赛马场',
merchantType: 'restaurant',
description: '新疆知名的西餐厅',
phone: '18599435525',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741587_id-1.jpg', // 菜品宣传图
title: '迷雾交响曲特色水烟2人餐 特色水烟一壶+百香果冷萃茶或薄荷红茶2选1+小吃',
sales: '半年售出2.8万+',
ranking: '门店热销第一名',
rating: 4.7,
shopName: '大湾南路店',
district: '天山区',
groupPrice: 160,
originalPrice: 194,
discount: 34
}
},
{
id: 2,
name: '蜀渊火锅',
latitude: 43.876260,
longitude: 87.615092,
address: '新疆维吾尔自治区乌鲁木齐市米东区红光山路1237号',
merchantType: 'restaurant',
description: '全疆知名的火锅公司',
phone: '17771177888',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741588_id-2.jpg',
title: '情侣套餐(红汤锅/鸳鸯锅、鲜鸭血、鲜切马尾、鸭胗花、鲜切麻辣牛肉、虎皮鸡爪、海带芽、豆芽、2分小料、纸巾、茶水',
sales: '半年售出3.4万+',
ranking: '门店热销第一名',
rating: 4.9,
shopName: '米东区店',
district: '米东区',
groupPrice: 188,
originalPrice: 260,
discount: 72
}
},
{
id: 3,
name: '木垒烧烤',
latitude: 43.832647,
longitude: 87.626975,
address: '新疆维吾尔自治区乌鲁木齐市水磨沟区南湖东路长青五巷112号',
merchantType: 'restaurant',
description: '全球知名烧烤品牌',
phone: '13659990568',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741589_id-3.jpg',
title: '黄面凉皮+烤羊筋1串+烤羊心1串+烤羊肝1串18 架子肉1公斤+菠菜面筋/凉拌韭菜/糖拌西红柿/花生米/水煮花生米/老虎菜/泡菜7选2不可重复+烤千叶豆腐/烤平菇/烤辣子/烤豆角+烤韭菜+烤金针菇6选5可重复',
sales: '半年售出5.2万+',
ranking: '门店热销第二名',
rating: 4.6,
shopName: '水磨沟区店',
district: '水磨沟区',
groupPrice: 140,
originalPrice: 158,
discount: 18
}
},
{
id: 4,
name: '大胆公鸡大盘鸡',
latitude: 43.775576,
longitude: 87.612197,
address: '天山区华侨小区',
merchantType: 'restaurant',
description: '知名大盘鸡店',
phone: '-',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741589_id-4.jpg',
title: '中盘鸡双人餐(含凉菜、皮带面)',
sales: '半年售出1.8万+',
ranking: '门店热销第一名',
rating: 4.9,
shopName: '天山区店',
district: '天山区',
groupPrice: 130,
originalPrice: 157,
discount: 27
}
},
{
id: 5,
name: '黎弯德咖啡',
latitude: 43.776500,
longitude: 87.611000,
address: '天山区新华南路754号',
merchantType: 'cofe',
description: '知名咖啡品牌',
phone: '09918529999',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741590_id-5.jpg',
title: '阳光活力双人早餐哈勒瓦+北非蛋+早餐面包+早餐蔬菜沙拉+早餐水果拼盘+鸡蛋饼+自制小酱+甜橙果酱+蜂蜜奶酪+立顿红茶+红扁豆糊糊+恰玛古浓汤+早餐牛奶+早餐橙汁',
sales: '半年售出2.1万+',
ranking: '门店热销第一名',
rating: 4.5,
shopName: '天山区店',
district: '天山区',
groupPrice: 229,
originalPrice: 267,
discount: 38.0
}
},
{
id: 6,
name: '巴特私房菜·新疆菜',
latitude: 43.798500,
longitude: 87.599000,
address: '沙依巴克区文化宫路51号吉祥苑小区3楼',
merchantType: 'restaurant',
description: '新疆特色菜',
phone: '15199083420',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741591_id-6.jpg',
title: '2-3人餐火焰山果味辣子鸡+菠萝咕噜肉+蒜蓉西兰花+养生豆腐',
sales: '半年售出8.5万+',
ranking: '门店热销第一名',
rating: 4.7,
shopName: '沙区店',
district: '沙区',
groupPrice: 180,
originalPrice: 222,
discount: 42
}
},
{
id: 7,
name: '迈花郎抓饭烤肉美食',
latitude: 43.775000,
longitude: 87.611000,
address: '天山区新华南路760号',
merchantType: 'restaurant',
description: '知名个人抓饭店',
phone: '-',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741592_id-7.jpg',
title: '特色抓饭 【本店热销 】',
sales: '半年售出1.2万+',
ranking: '本店热门菜',
rating: 4.6,
shopName: '天山区店',
district: '天山区',
groupPrice: 30,
originalPrice: 36,
discount: 6
}
},
{
id: 8,
name: 'Badroom',
latitude: 43.830395,
longitude: 87.632740,
address: '新疆维吾尔自治区乌鲁木齐市水磨沟区南湖东路北七巷3号',
merchantType: 'bar',
description: '热门酒吧!',
phone: '18164991818',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741593_id-8.jpg',
title: '特调酒水 回忆/脑浆/SunSet29 摇滚不死(包死、慎点!!!)',
sales: '半年售出6800+',
ranking: '门店热销第一名',
rating: 4.7,
shopName: '水磨沟区店',
district: '水磨沟区',
groupPrice: 88,
originalPrice: 98,
discount: 10
}
},
{
id: 9,
name: '小白房子.White House',
latitude: 43.842000,
longitude: 87.645000,
address: '新疆维吾尔自治区乌鲁木齐市水磨沟区七道湾南路1358号',
merchantType: 'bar',
description: '全新木屋酒吧',
phone: '18690660882',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741593_id-9.jpg',
title: '1664啤酒/白/红12瓶',
sales: '半年售出12.5万+',
ranking: '门店热销第一名',
rating: 4.8,
shopName: '水磨沟区店',
district: '水磨沟区',
groupPrice: 399.99,
originalPrice: 427.96,
discount: 27.97
}
},
{
id: 10,
name: 'Brat',
latitude: 43.863204,
longitude: 87.646801,
address: '新疆乌鲁木齐市水磨沟区七道湾南路1247号南湖南湖创造Life潮生活中心24号建筑物',
merchantType: 'bar',
description: '美式酒吧!',
phone: '19999124449',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741594_id-10.jpg',
title: '一壶特调水烟+双杯美式',
sales: '半年售出3.8万+',
ranking: '门店热销第一名',
rating: 4.5,
shopName: '水磨沟区店',
district: '水磨沟区',
groupPrice: 120,
originalPrice: 170,
discount: 50
}
},
{
id: 11,
name: '迪娜艺咖啡店',
latitude: 43.770000,
longitude: 87.625000,
address: '新疆维吾尔自治区乌鲁木齐市胜利路657号店铺',
merchantType: 'cofe',
description: 'UG咖啡厅',
phone: '15899227419',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741595_id-11.jpg',
title: '香橙美式',
sales: '半年售出6.8万+',
ranking: '门店热销第一名',
rating: 4.7,
shopName: '天山区店',
district: '天山区',
groupPrice: 12,
originalPrice: 15,
discount: 3
}
},
{
id: 12,
name: '羔娃咖啡',
latitude: 43.873399,
longitude: 87.573634,
address: '新疆维吾尔自治区乌鲁木齐市新市区二工街道河南东路389号',
merchantType: 'cofe',
description: '蒙古风格咖啡馆',
phone: '020-12345689',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741596_id-12.jpg',
title: '蒙古包慕斯蛋糕 25',
sales: '半年售出9.2万+',
ranking: '门店热销第一名',
rating: 4.6,
shopName: '新市区店',
district: '新市区',
groupPrice: 25.0,
originalPrice: 29.0,
discount: 5.0
}
},
{
id: 13,
name: '渡鸦 Whisky Bar',
latitude: 43.797000,
longitude: 87.613000,
address: '中山路299负一层',
merchantType: 'bar',
description: '知名酒吧',
phone: '13139622162',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741596_id-13.jpg',
title: 'OHMYCAT无醇香槟1瓶+藜麦莎拉+烟熏马肉披萨+黑松露薯条+炸食拼盘',
sales: '半年售出15.6万+',
ranking: '门店热销第一名',
rating: 4.8,
shopName: '天山区店',
district: '天山区',
groupPrice: 350.0,
originalPrice: 370.0,
discount: 20.0
}
},
{
id: 14,
name: '零点休闲馆',
latitude: 43.775707,
longitude: 87.611107,
address: '天山区新华南路752号',
merchantType: 'play',
description: '玩乐大本营',
phone: '-',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741597_id-14.jpg',
title: '璟点中八或PS5一小时',
sales: '半年售出4.5万+',
ranking: '门店热销第一名',
rating: 4.5,
shopName: '天山区店',
district: '天山区',
groupPrice: 39,
originalPrice: 58,
discount: 19
}
},
{
id: 15,
name: '古丽格拉斯蛋糕咖啡店',
latitude: 43.765925,
longitude: 87.640339,
address: '新疆维吾尔自治区乌鲁木齐市天山区团结路街道富丽湾',
merchantType: 'mall',
description: 'UG蛋糕店',
phone: '-',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741598_id-16.jpg',
title: '巧克力蛋糕 29.9',
sales: '半年售出18.9万+',
ranking: '门店热销第一名',
rating: 4.7,
shopName: '天山区店',
district: '天山区',
groupPrice: 29.9,
originalPrice: 39.0,
discount: 10.0
}
},
{
id: 16,
name: '疯玩岛潮玩街区 团建聚会',
latitude: 43.800255,
longitude: 87.607778,
address: '新华北路139号OL星辰汇4F',
merchantType: 'mall',
description: '畅玩 娱乐',
phone: '19289924725',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741598_id-16.jpg',
title: '双人全天无限畅玩 送抓娃娃币50枚',
sales: '半年售出2.3万+',
ranking: '门店热销第一名',
rating: 4.6,
shopName: '天山区店',
district: '天山区',
groupPrice: 999.0,
originalPrice: 1288.0,
discount: 289.0
}
},
{
id: 17,
name: '岩咖攀岩',
latitude: 43.799385,
longitude: 87.610300,
address: '新华北路街道新华北路222号3楼喀什和田玉门口进',
merchantType: 'play',
description: '玩乐-畅玩',
phone: '18040775611',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741598_id-17.jpg',
title: '双人套餐 330',
sales: '半年售出22.5万+',
ranking: '门店热销第一名',
rating: 4.9,
shopName: '天山区店',
district: '天山区',
groupPrice: 330.0,
originalPrice: 336.0,
discount: 36
}
},
{
id: 18,
name: '初墨手作 陶艺 银饰 拼豆',
latitude: 43.802429,
longitude: 87.608434,
address: '新华北路38号红山新世纪5楼2号门观光直梯上行5楼',
merchantType: 'play',
description: '新式娱乐',
phone: '17726853579',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741599_id-18.jpg',
title: '情侣/闺蜜粘土冰箱贴 110',
sales: '半年售出19.8万+',
ranking: '门店热销第一名',
rating: 4.8,
shopName: '天山区店',
district: '天山区',
groupPrice: 110.0,
originalPrice: 136.0,
discount: 26.0
}
},
{
id: 19,
name: '喵呜豆社猫狗咖 撸猫撸狗 拼豆',
latitude: 43.803000,
longitude: 87.618000,
address: '青年路街道光明路39号CCMALL广场B座17楼C',
merchantType: 'play',
description: '新玩乐项目',
phone: '13629971015',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741600_id-19.jpg',
title: '双人撸猫撸狗套餐不限时(包饮料+宠物投喂+赠品)',
sales: '半年售出32.6万+',
ranking: '门店热销第一名',
rating: 4.7,
shopName: '天山区店',
district: '天山区',
groupPrice: 180.0,
originalPrice: 220.0,
discount: 40.0
}
},
{
id: 20,
name: '开心麻花爆笑原创综艺同款新喜剧',
latitude: 43.800000,
longitude: 87.610000,
address: '建中路2号',
merchantType: 'play',
description: '玩乐',
phone: '0-0',
dishInfo: {
image: 'https://findme-1375214531.cos.ap-guangzhou.myqcloud.com/user/12852468/image/1766741601_id-20.jpg',
title: '游乐 单人玩乐 【特价 150 】',
sales: '半年售出28.4万+',
ranking: '门店热销第一名',
rating: 4.6,
shopName: '天山区店',
district: '天山区',
groupPrice: 150.0,
originalPrice: 160.0,
discount: 10.0
}
}
];
/**
* 将商家数据转换为地图marker格式
* @param {Array} merchants - 商家数据数组
* @returns {Array} marker数组
*/
function convertMerchantsToMarkers(merchants) {
if (!merchants || !Array.isArray(merchants)) {
return [];
}
return merchants.map((merchant, index) => {
const markerId = MERCHANT_MARKER_BASE_ID + merchant.id;
return {
id: markerId,
type: 'merchant',
latitude: merchant.latitude,
longitude: merchant.longitude,
iconPath: '/images/map/marker_blank.png', // 使用透明图标通过自定义callout显示名称
width: 40,
height: 40,
customCallout: {
anchorY: 0,
anchorX: 0,
display: 'ALWAYS' // 始终显示商家名称
},
merchantId: merchant.id,
merchantType: merchant.merchantType || 'default',
merchantName: merchant.name,
name: merchant.name, // 兼容字段WXML中使用
merchantAddress: merchant.address,
joinCluster: false // 商家标记不参与聚合
};
});
}
/**
* 获取所有商家数据
* @returns {Array} 商家数据数组
*/
function getAllMerchants() {
return MERCHANT_DATA;
}
/**
* 根据ID获取商家信息
* @param {Number} id - 商家ID
* @returns {Object|null} 商家信息对象
*/
function getMerchantById(id) {
return MERCHANT_DATA.find(merchant => merchant.id === id) || null;
}
module.exports = {
MERCHANT_DATA,
MERCHANT_MARKER_BASE_ID,
getAllMerchants,
getMerchantById,
convertMerchantsToMarkers
};