uniapp-ZHSQ/pages/user/profile-menu.js

138 lines
8.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 个人中心菜单数据 + 黑红双色矢量图标(移植自原型 profile-icons.js 风格)
* 图标:深灰 #333 主线条 + 红 #FF2B21 点缀viewBox 28输出为 data URI 供 <image> 使用
*/
// 主线条:黑灰描边,圆角端点
const S = 'fill="none" stroke="#333" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"'
// 点缀线条:红色描边
const R = 'fill="none" stroke="#FF2B21" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"'
/** 包裹为完整 svg 并转 data URI小程序 image 可直接渲染) */
const icon = (inner) =>
'data:image/svg+xml;charset=utf-8,' +
encodeURIComponent(`<svg viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">${inner}</svg>`)
// ===== 图标表 =====
export const ICONS = {
// 待付款:钱包 + 红¥
pay: icon(`<rect x="4" y="7" width="20" height="14" rx="2.5" ${S}/><path d="M4 11h20" ${S}/><text x="14" y="18.5" font-size="8" font-weight="700" fill="#FF2B21" text-anchor="middle">¥</text>`),
// 待发货:箱子 + 红盖
ship: icon(`<path d="M5 11l9-4 9 4v9l-9 4-9-4z" ${S}/><path d="M5 11l9 4 9-4" ${R}/><path d="M14 15v9" ${S}/>`),
// 已取消:圆 + 红叉
cancel: icon(`<circle cx="14" cy="14" r="10" ${S}/><path d="M10.5 10.5l7 7M17.5 10.5l-7 7" ${R}/>`),
// 待评价:气泡 + 红三点
comment: icon(`<path d="M5 7h18a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-9l-5 4v-4H5a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1z" ${S}/><circle cx="10" cy="13" r="1" fill="#FF2B21"/><circle cx="14" cy="13" r="1" fill="#FF2B21"/><circle cx="18" cy="13" r="1" fill="#FF2B21"/>`),
// 售后:圆 + 红回退箭头
refund: icon(`<circle cx="14" cy="14" r="10" ${S}/><path d="M14 9l-3 3 3 3" ${R}/><path d="M11 12h6a3 3 0 0 1 0 6h-2" ${R}/>`),
// 我的订单:清单 + 红勾选行
orders: icon(`<rect x="6" y="4" width="16" height="20" rx="2" ${S}/><path d="M10 9h8" ${S}/><path d="M10 14h8" ${S}/><path d="M10 19h5" ${R}/>`),
// 团购订单:拼单双人(一黑一红)+ 底框
groupOrder: icon(`<rect x="4" y="15" width="20" height="8" rx="2" ${S}/><circle cx="10.5" cy="8.5" r="3" ${S}/><circle cx="18" cy="9.5" r="2.4" ${R}/>`),
// 收货地址:定位 + 红中心点
address: icon(`<path d="M14 4c4.4 0 7 3 7 7 0 5-7 13-7 13S7 16 7 11c0-4 2.6-7 7-7z" ${S}/><circle cx="14" cy="11" r="2.6" ${R}/>`),
// 购物车:红车轮
cart: icon(`<path d="M4 5h3l2.5 12h11l2-9H8" ${S}/><circle cx="11" cy="22" r="1.6" ${R}/><circle cx="20" cy="22" r="1.6" ${R}/>`),
// 服务订单:清单 + 红钟表
serviceOrder: icon(`<rect x="5" y="4" width="14" height="20" rx="2" ${S}/><path d="M9 9h6" ${S}/><path d="M9 13h4" ${S}/><circle cx="19" cy="19" r="4.5" ${R}/><path d="M19 17v2l1.3 1" ${R}/>`),
// 月账单:日历 + 红¥
monthlyBill: icon(`<rect x="5" y="6" width="18" height="17" rx="2" ${S}/><path d="M5 11h18" ${S}/><path d="M10 4v4M18 4v4" ${S}/><text x="14" y="19.5" font-size="7" font-weight="700" fill="#FF2B21" text-anchor="middle">¥</text>`),
// 家政合同:折角文件 + 红签名行
contract: icon(`<path d="M7 4h10l4 4v16H7z" ${S}/><path d="M17 4v4h4" ${S}/><path d="M11 14h6" ${S}/><path d="M11 18h4" ${R}/>`),
// 附近门店:店铺 + 红门
shop: icon(`<path d="M5 11l1.5-5h15L23 11" ${S}/><path d="M6 11v11h16V11" ${S}/><path d="M11 22v-6h6v6" ${R}/>`),
// 支付记录:单据 + 红¥
records: icon(`<path d="M7 4h11l3 3v17l-2.5-1.5L16 24l-2.5-1.5L11 24l-2.5-1.5L7 24z" ${S}/><path d="M11 10h6" ${S}/><text x="14" y="18" font-size="7" font-weight="700" fill="#FF2B21" text-anchor="middle">¥</text>`),
// 临停缴费P 牌 + 红¥
parkFee: icon(`<rect x="4" y="4" width="20" height="20" rx="4" ${S}/><text x="11" y="19" font-size="11" font-weight="700" fill="#333" text-anchor="middle">P</text><text x="19" y="19" font-size="8" font-weight="700" fill="#FF2B21" text-anchor="middle">¥</text>`),
// 停车订单:单据 + 红 P
parkOrder: icon(`<rect x="6" y="4" width="16" height="20" rx="2" ${S}/><path d="M10 9h8" ${S}/><path d="M10 13h5" ${S}/><text x="14" y="21.5" font-size="9" font-weight="700" fill="#FF2B21" text-anchor="middle">P</text>`),
// 车辆管理:汽车 + 红车轮
carManage: icon(`<path d="M5 17l1.8-5.2c.3-.9 1-1.5 2-1.5h10.4c1 0 1.7.6 2 1.5L23 17v4h-2.5" ${S}/><path d="M5 17h18" ${S}/><path d="M5 17v4h2.5" ${S}/><circle cx="9.5" cy="19.5" r="1.8" ${R}/><circle cx="18.5" cy="19.5" r="1.8" ${R}/>`),
// 商家入驻:店铺 + 红加号
merchant: icon(`<path d="M5 11l1.5-5h15L23 11" ${S}/><path d="M6 11v11h16V11" ${S}/><path d="M14 14v5M11.5 16.5h5" ${R}/>`),
// 商家端:店铺 + 红店员
merchantSide: icon(`<path d="M5 11l1.5-5h15L23 11" ${S}/><path d="M6 11v11h16V11" ${S}/><circle cx="14" cy="15.5" r="2" ${R}/><path d="M10.5 22c.5-2.4 1.8-3.5 3.5-3.5s3 1.1 3.5 3.5" ${R}/>`),
// 物业端:高楼 + 红窗
propertySide: icon(`<rect x="8" y="4" width="12" height="18" rx="1.5" ${S}/><path d="M5 22h18" ${S}/><path d="M12 9h1.5M12 13h1.5M12 17h1.5" ${S}/><path d="M16 9h1.5M16 13h1.5M16 17h1.5" ${R}/>`),
// 师傅端:人 + 红扳手
workerSide: icon(`<circle cx="11" cy="9" r="3.2" ${S}/><path d="M5 22c.7-4.1 3-6.2 6-6.2 1.2 0 2.3.3 3.2 1" ${S}/><path d="M22.5 13.5a3.2 3.2 0 0 1-4.3 4.3L15 21l-2-2 3.2-3.2a3.2 3.2 0 0 1 4.3-4.3l-1.8 1.8 1.5 1.5z" ${R}/>`),
// 目录行:好物袋 / 到家房 / 功能四宫格
bag: icon(`<path d="M9 10V8a5 5 0 0 1 10 0v2" ${S}/><path d="M6 10h16l-1.2 12H7.2z" ${S}/><circle cx="14" cy="16" r="1.2" fill="#FF2B21"/>`),
home: icon(`<path d="M5 13l9-7 9 7" ${S}/><path d="M7 12v10h14V12" ${S}/><path d="M12 22v-5h4v5" ${R}/>`),
grid: icon(`<rect x="5" y="5" width="7.5" height="7.5" rx="1.5" ${S}/><rect x="15.5" y="5" width="7.5" height="7.5" rx="1.5" ${S}/><rect x="5" y="15.5" width="7.5" height="7.5" rx="1.5" ${S}/><rect x="15.5" y="15.5" width="7.5" height="7.5" rx="1.5" ${R}/>`)
}
// ===== 我的订单五状态格tab 对应订单页 categoryList 索引0全部/1待付款/2待发货/3已取消/4待评价/6售后 =====
export const ORDER_TABS = [
{ label: '待付款', icon: ICONS.pay, tab: 1 },
{ label: '待发货', icon: ICONS.ship, tab: 2 },
{ label: '已取消', icon: ICONS.cancel, tab: 3 },
{ label: '待评价', icon: ICONS.comment, tab: 4 },
{ label: '售后', icon: ICONS.refund, tab: 6 }
]
// ===== 服务目录分组点击目录行弹抽屉并定位到分组items 沿用原各区块跳转) =====
export const MENU_GROUPS = [
{
key: 'goods',
title: '我的好物',
icon: ICONS.bag,
items: [
{ name: '我的订单', icon: ICONS.orders, url: '/packages/myOrders/index/index' },
{ name: '团购订单', icon: ICONS.groupOrder, url: '/packages/myOrders/groupOrders/index' },
{ name: '收货地址', icon: ICONS.address, url: '/packages/shop/address/index' },
{ name: '购物车', icon: ICONS.cart, url: '/packages/shopCar/index/index' }
]
},
{
key: 'daojia',
title: '我的到家',
icon: ICONS.home,
items: [
{ name: '服务订单', icon: ICONS.serviceOrder, url: '/packages/homeService/myOrders/index' },
{ name: '月账单', icon: ICONS.monthlyBill, url: '/packages/homeService/myMonthlyBills/index' },
{ name: '家政合同', icon: ICONS.contract, url: '/packages/homeService/myContracts/index' }
]
},
{
key: 'store',
title: '门店服务',
icon: ICONS.shop,
items: [
{ name: '附近门店', icon: ICONS.shop, url: '/packages/localLife/index/index' },
{ name: '支付记录', icon: ICONS.records, url: '/packages/localLife/payInfo/index' }
]
},
{
key: 'park',
title: '智慧停车',
icon: ICONS.carManage,
items: [
{ name: '临停缴费', icon: ICONS.parkFee, url: '/packages/park/temporaryOrder/index' },
{ name: '停车订单', icon: ICONS.parkOrder, url: '/packages/park/parkOrder/index' },
{ name: '车辆管理', icon: ICONS.carManage, url: '/packages/park/index/index' }
]
},
{
key: 'enter',
title: '好店入驻',
icon: ICONS.merchant,
items: [
{ name: '商家入驻', icon: ICONS.merchant, url: '/packages/shopEnter/choose/index' }
]
}
]
// ===== 功能服务放最后isShow 由登录态动态刷新,图标按端映射) =====
export const FUNC_GROUP_META = { key: 'func', title: '功能服务', icon: ICONS.grid }
export const FUNC_ICONS = {
商家端: ICONS.merchantSide,
物业端: ICONS.propertySide,
师傅端: ICONS.workerSide
}