diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json new file mode 100644 index 00000000..8ae452a8 --- /dev/null +++ b/.hbuilderx/launch.json @@ -0,0 +1,9 @@ +{ + "version" : "1.0", + "configurations" : [ + { + "playground" : "standard", + "type" : "uni-app:app-android" + } + ] +} diff --git a/components/supadb/aksupa.uts b/components/supadb/aksupa.uts index 13c16bcc..c47057f4 100644 --- a/components/supadb/aksupa.uts +++ b/components/supadb/aksupa.uts @@ -1042,4 +1042,13 @@ function buildSupabaseFilterQuery(filter : UTSJSONObject | null) : string { return params.join('&'); } +/** + * 创建 Supabase 客户端实例 + * @param url 项目 URL + * @param key 项目匿名密钥 (Anon Key) + */ +export function createClient(url : string, key : string) : AkSupa { + return new AkSupa(url, key); +} + export default AkSupa; \ No newline at end of file diff --git a/components/supadb/aksupainstance - 副本.uts b/components/supadb/aksupainstance - 副本.uts new file mode 100644 index 00000000..a47b3f3e --- /dev/null +++ b/components/supadb/aksupainstance - 副本.uts @@ -0,0 +1,18 @@ +//import AkSupa from './aksupa.uts' +//import { SUPA_URL, SUPA_KEY } from '@/ak/config.uts' + +//const supa = new AkSupa(SUPA_URL, SUPA_KEY) + +//const supaReady: Promise = (async () => { +/// try { + // await supa.signIn('akoo@163.com', 'Hf2152111') +// await supa.signIn('am@163.com', 'kookoo') +// return true +// } catch (err) { +// console.error('Supabase auto sign-in failed', err) +// return false +// } +//})() + +//export { supaReady } +//export default supa \ No newline at end of file diff --git a/components/supadb/aksupainstance.uts b/components/supadb/aksupainstance.uts index e0a9a11e..1e8d8d40 100644 --- a/components/supadb/aksupainstance.uts +++ b/components/supadb/aksupainstance.uts @@ -1,3 +1,34 @@ +// /components/supadb/aksupainstance.uts +import { createClient } from './aksupa.uts' + +// 创建并导出 Supabase 客户端实例 +const supabaseUrl = 'https://your-project.supabase.co' // 替换为你的 Supabase URL +const supabaseAnonKey = 'your-anon-key' // 替换为你的匿名密钥 + +export const supabase = createClient(supabaseUrl, supabaseAnonKey) + +// 导出 Supabase 实例就绪状态 +export const isSupabaseReady = true + +// 如果有其他需要导出的函数,可以这样导出: +export function initializeSupabase(url: string, key: string) { + return createClient(url, key) +} + +// 检查连接状态的函数 +export function checkConnection() { + return new Promise((resolve) => { + // 模拟连接检查 + setTimeout(() => { + resolve(true) + }, 500) + }) +} + +// 不再使用 supaready 变量,而是提供函数 +export async function ensureSupabaseReady() { + return await checkConnection() +} import AkSupa from './aksupa.uts' import { SUPA_URL, SUPA_KEY } from '@/ak/config.uts' diff --git a/main - 副本.uts b/main - 副本.uts new file mode 100644 index 00000000..234c8c9b --- /dev/null +++ b/main - 副本.uts @@ -0,0 +1,14 @@ +import { createSSRApp } from 'vue' +import App from './App.uvue' +import i18n from '@/uni_modules/i18n/index.uts' + +export function createApp() { + const app = createSSRApp(App) + + // 注册 i18n 全局属性,使组件可以使用 $t 方法 + app.config.globalProperties.$t = (key: string, values?: any, locale?: string): string => { + return i18n.global.t(key, values, locale) + } + + return { app } +} diff --git a/main.uts b/main.uts index 0ab5b030..da42848e 100644 --- a/main.uts +++ b/main.uts @@ -4,11 +4,15 @@ import App from './App.uvue' export function createApp() { const app = createSSRApp(App) - - // 简化的$t方法 - app.config.globalProperties.$t = (key: string): string => { - return key // 直接返回key,不进行翻译 - } - + + // 注册 i18n 全局属性,使组件可以使用 $t 方法 + app.config.globalProperties.$t = (key: string, values?: any, locale?: string): string => { + if (!i18n.global) { + console.error('i18n is not initialized') + return key + } + return i18n.global.t(key, values, locale) || key + } + return { app } } diff --git a/package.json b/package.json index 34faeaf5..5c2a48a3 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,10 @@ { + "name": "mall", + "private": true, "dependencies": { "echarts": "^6.0.0" }, "devDependencies": { "@dcloudio/types": "^3.4.29" } -} +} \ No newline at end of file diff --git a/pages - 副本 (2).json b/pages - 副本 (2).json new file mode 100644 index 00000000..765ececb --- /dev/null +++ b/pages - 副本 (2).json @@ -0,0 +1,118 @@ +{ + "pages": [ + // 消费者端页面 + { + "path": "pages/mall/consumer/index", + "style": { + "navigationBarTitleText": "商城首页", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/mall/consumer/category", + "style": { + "navigationBarTitleText": "商品分类" + } + }, + { + "path": "pages/mall/consumer/search", + "style": { + "navigationBarTitleText": "搜索商品", + "navigationStyle": "custom" + } + }, + { + "path": "pages/mall/consumer/product-detail", + "style": { + "navigationBarTitleText": "商品详情" + } + }, + { + "path": "pages/mall/consumer/cart", + "style": { + "navigationBarTitleText": "购物车" + } + }, + { + "path": "pages/mall/consumer/orders", + "style": { + "navigationBarTitleText": "我的订单", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/mall/consumer/order-detail", + "style": { + "navigationBarTitleText": "订单详情" + } + }, + { + "path": "pages/mall/consumer/address", + "style": { + "navigationBarTitleText": "收货地址" + } + }, + { + "path": "pages/mall/consumer/address-edit", + "style": { + "navigationBarTitleText": "编辑地址" + } + }, + { + "path": "pages/mall/consumer/coupons", + "style": { + "navigationBarTitleText": "我的优惠券" + } + }, + { + "path": "pages/mall/consumer/favorites", + "style": { + "navigationBarTitleText": "我的收藏" + } + }, + { + "path": "pages/mall/consumer/profile", + "style": { + "navigationBarTitleText": "个人中心" + } + } + ], + "tabBar": { + "color": "#999999", + "selectedColor": "#007aff", + "backgroundColor": "#ffffff", + "borderStyle": "black", + "list": [ + { + "pagePath": "pages/mall/consumer/index", + "text": "首页", + "iconPath": "static/tab-home.png", + "selectedIconPath": "static/tab-home-active.png" + }, + { + "pagePath": "pages/mall/consumer/category", + "text": "分类", + "iconPath": "static/tab-category.png", + "selectedIconPath": "static/tab-category-active.png" + }, + { + "pagePath": "pages/mall/consumer/cart", + "text": "购物车", + "iconPath": "static/tab-cart.png", + "selectedIconPath": "static/tab-cart-active.png" + }, + { + "pagePath": "pages/mall/consumer/orders", + "text": "订单", + "iconPath": "static/tab-order.png", + "selectedIconPath": "static/tab-order-active.png" + }, + { + "pagePath": "pages/mall/consumer/profile", + "text": "我的", + "iconPath": "static/tab-profile.png", + "selectedIconPath": "static/tab-profile-active.png" + } + ] + } +} \ No newline at end of file diff --git a/pages - 副本.json b/pages - 副本.json new file mode 100644 index 00000000..fed5ab00 --- /dev/null +++ b/pages - 副本.json @@ -0,0 +1,213 @@ +{ + "pages": [ + { + "path": "pages/mall/consumer/index", + "style": { + "navigationBarTitleText": "商城首页", + "navigationStyle": "custom" + } + }, + { + "path": "pages/user/boot", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "pages/user/login", + "style": { + "navigationBarTitleText": "登录" + } + }, + { + "path": "pages/user/register", + "style": { + "navigationBarTitleText": "注册" + } + }, + { + "path": "pages/user/forgot-password", + "style": { + "navigationBarTitleText": "忘记密码" + } + }, + { + "path": "pages/user/center", + "style": { + "navigationBarTitleText": "用户中心" + } + }, + { + "path": "pages/user/profile", + "style": { + "navigationBarTitleText": "个人资料" + } + }, + { + "path": "pages/user/terms", + "style": { + "navigationBarTitleText": "用户协议与隐私政策" + } + }, + { + "path": "pages/mall/merchant/index", + "style": { + "navigationBarTitleText": "商家中心", + "navigationStyle": "custom" + } + }, + { + "path": "pages/mall/delivery/index", + "style": { + "navigationBarTitleText": "配送中心", + "navigationStyle": "custom" + } + }, + { + "path": "pages/mall/admin/index", + "style": { + "navigationBarTitleText": "管理后台", + "navigationStyle": "custom" + } + }, + { + "path": "pages/mall/service/index", + "style": { + "navigationBarTitleText": "客服工作台", + "navigationStyle": "custom" + } + }, + { + "path": "pages/mall/analytics/index", + "style": { + "navigationBarTitleText": "数据分析", + "navigationStyle": "custom" + } + } + ], + "subPackages": [ + { + "root": "pages/mall", + "pages": [ + { + "path": "consumer/product-detail", + "style": { + "navigationBarTitleText": "商品详情" + } + }, + { + "path": "consumer/order-detail", + "style": { + "navigationBarTitleText": "订单详情" + } + }, + { + "path": "consumer/profile", + "style": { + "navigationBarTitleText": "个人中心" + } + }, + { + "path": "consumer/subscription/plan-list", + "style": { + "navigationBarTitleText": "软件订阅" + } + }, + { + "path": "consumer/subscription/plan-detail", + "style": { + "navigationBarTitleText": "订阅详情" + } + }, + { + "path": "consumer/subscription/subscribe-checkout", + "style": { + "navigationBarTitleText": "确认订阅" + } + }, + { + "path": "consumer/subscription/my-subscriptions", + "style": { + "navigationBarTitleText": "我的订阅" + } + }, + { + "path": "admin/subscription/plan-management", + "style": { + "navigationBarTitleText": "订阅方案管理" + } + }, + { + "path": "admin/subscription/user-subscriptions", + "style": { + "navigationBarTitleText": "用户订阅管理" + } + }, + { + "path": "nfc/security/index", + "style": { + "navigationBarTitleText": "安保工作台", + "enablePullDownRefresh": true, + "backgroundColor": "#f8f9fa" + } + } + ] + } + ], + "tabBar": { + "custom": true, + "color": "#7A7E83", + "selectedColor": "#3cc51f", + "borderStyle": "black", + "backgroundColor": "#ffffff", + "list": [ + { + "pagePath": "pages/mall/consumer/index", + "iconPath": "static/tab-home.png", + "selectedIconPath": "static/tab-home-current.png", + "text": "首页" + }, + { + "pagePath": "pages/mall/consumer/category", + "iconPath": "static/tab-category.png", + "selectedIconPath": "static/tab-category-current.png", + "text": "分类" + }, + { + "pagePath": "pages/mall/consumer/cart", + "iconPath": "static/tab-cart.png", + "selectedIconPath": "static/tab-cart-current.png", + "text": "购物车" + }, + { + "pagePath": "pages/mall/consumer/profile", + "iconPath": "static/tab-profile.png", + "selectedIconPath": "static/tab-profile-current.png", + "text": "我的" + } + ] + }, + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "mall", + "navigationBarBackgroundColor": "#FFFFFF", + "backgroundColor": "#F8F8F8" + }, + "condition": { + "current": 0, + "list": [ + { + "name": "消费者端首页", + "path": "pages/mall/consumer/index" + }, + { + "name": "启动页(登录态判断)", + "path": "pages/user/boot" + }, + { + "name": "登录页", + "path": "pages/user/login" + } + ] + } +} \ No newline at end of file diff --git a/pages.json b/pages.json index 6abc7efb..09aa09e6 100644 --- a/pages.json +++ b/pages.json @@ -1,66 +1,130 @@ { "pages": [ { - "path": "pages/mall/consumer/index", + "path": "pages/mall/consumer/index", "style": { - "navigationBarTitleText": "商城首页", + "navigationBarTitleText": "首页", + "navigationStyle": "custom", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/mall/consumer/settings", + "style": { + "navigationBarTitleText": "设置" + } + }, + { + "path": "pages/mall/consumer/wallet", + "style": { + "navigationBarTitleText": "我的钱包" + } + }, + { + "path": "pages/user/login", + "style": { + "navigationBarTitleText": "用户登录", + "navigationStyle": "custom" + } + }, + { + "path": "pages/mall/consumer/category", + "style": { + "navigationBarTitleText": "分类" + } + }, + { + "path": "pages/mall/consumer/messages", + "style": { + "navigationBarTitleText": "消息", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/mall/consumer/cart", + "style": { + "navigationBarTitleText": "购物车" + } + }, + { + "path": "pages/mall/consumer/profile", + "style": { + "navigationBarTitleText": "我的" + } + }, + { + "path": "pages/mall/consumer/search", + "style": { + "navigationBarTitleText": "搜索", "navigationStyle": "custom" } }, { - "path": "pages/user/boot", + "path": "pages/mall/consumer/product-detail", "style": { - "navigationBarTitleText": "" + "navigationBarTitleText": "商品详情" } }, { - "path": "pages/user/login", + "path": "pages/mall/consumer/shop-detail", "style": { - "navigationBarTitleText": "登录" + "navigationBarTitleText": "店铺详情" } }, { - "path": "pages/user/register", + "path": "pages/mall/consumer/coupons", "style": { - "navigationBarTitleText": "注册" + "navigationBarTitleText": "我的优惠券" } }, { - "path": "pages/user/forgot-password", + "path": "pages/mall/consumer/favorites", "style": { - "navigationBarTitleText": "忘记密码" + "navigationBarTitleText": "我的收藏" } }, { - "path": "pages/user/center", + "path": "pages/mall/consumer/footprint", "style": { - "navigationBarTitleText": "用户中心" + "navigationBarTitleText": "我的足迹" } }, { - "path": "pages/user/profile", + "path": "pages/mall/consumer/address-list", "style": { - "navigationBarTitleText": "个人资料" + "navigationBarTitleText": "收货地址" } }, { - "path": "pages/user/terms", + "path": "pages/mall/consumer/address-edit", "style": { - "navigationBarTitleText": "用户协议与隐私政策" + "navigationBarTitleText": "编辑地址" } }, { - "path": "pages/mall/merchant/index", + "path": "pages/mall/consumer/checkout", "style": { - "navigationBarTitleText": "商家中心", + "navigationBarTitleText": "确认订单" + } + }, + { + "path": "pages/mall/consumer/payment", + "style": { + "navigationBarTitleText": "收银台" + } + }, + { + "path": "pages/mall/consumer/payment-success", + "style": { + "navigationBarTitleText": "支付成功", "navigationStyle": "custom" } }, { - "path": "pages/mall/delivery/index", + "path": "pages/mall/consumer/orders", "style": { - "navigationBarTitleText": "配送中心", - "navigationStyle": "custom" + "navigationBarTitleText": "我的订单", + "enablePullDownRefresh": true } }, { @@ -162,150 +226,85 @@ } }, { - "path": "pages/mall/admin/index", + "path": "pages/mall/consumer/order-detail", "style": { - "navigationBarTitleText": "管理后台", - "navigationStyle": "custom" + "navigationBarTitleText": "订单详情" } }, { - "path": "pages/mall/service/index", + "path": "pages/mall/consumer/logistics", "style": { - "navigationBarTitleText": "客服工作台", - "navigationStyle": "custom" + "navigationBarTitleText": "物流详情" } }, { - "path": "pages/mall/analytics/index", + "path": "pages/mall/consumer/review", "style": { - "navigationBarTitleText": "数据分析", + "navigationBarTitleText": "评价晒单" + } + }, + { + "path": "pages/mall/consumer/refund", + "style": { + "navigationBarTitleText": "退款/售后" + } + }, + { + "path": "pages/mall/consumer/apply-refund", + "style": { + "navigationBarTitleText": "申请售后" + } + }, + { + "path": "pages/mall/consumer/refund-review", + "style": { + "navigationBarTitleText": "服务评价" + } + }, + { + "path": "pages/mall/consumer/chat", + "style": { + "navigationBarTitleText": "客服聊天", "navigationStyle": "custom" } } ], - "subPackages": [ - { - "root": "pages/mall", - "pages": [ - { - "path": "consumer/product-detail", - "style": { - "navigationBarTitleText": "商品详情" - } - }, - { - "path": "consumer/order-detail", - "style": { - "navigationBarTitleText": "订单详情" - } - }, - { - "path": "consumer/profile", - "style": { - "navigationBarTitleText": "个人中心" - } - }, - { - "path": "consumer/subscription/plan-list", - "style": { - "navigationBarTitleText": "软件订阅" - } - }, - { - "path": "consumer/subscription/plan-detail", - "style": { - "navigationBarTitleText": "订阅详情" - } - }, - { - "path": "consumer/subscription/subscribe-checkout", - "style": { - "navigationBarTitleText": "确认订阅" - } - }, - { - "path": "consumer/subscription/my-subscriptions", - "style": { - "navigationBarTitleText": "我的订阅" - } - }, - { - "path": "admin/subscription/plan-management", - "style": { - "navigationBarTitleText": "订阅方案管理" - } - }, - { - "path": "admin/subscription/user-subscriptions", - "style": { - "navigationBarTitleText": "用户订阅管理" - } - }, - { - "path": "nfc/security/index", - "style": { - "navigationBarTitleText": "安保工作台", - "enablePullDownRefresh": true, - "backgroundColor": "#f8f9fa" - } - } - ] - } - ], "tabBar": { - "custom": true, - "color": "#7A7E83", - "selectedColor": "#3cc51f", - "borderStyle": "black", + "color": "#999999", + "selectedColor": "#ff5000", "backgroundColor": "#ffffff", + "borderStyle": "black", "list": [ { "pagePath": "pages/mall/consumer/index", - "iconPath": "static/tab-home.png", - "selectedIconPath": "static/tab-home-current.png", - "text": "首页" + "text": "首页", + "iconPath": "static/tabbar/home.png", + "selectedIconPath": "static/tabbar/home-active.png" }, { "pagePath": "pages/mall/consumer/category", - "iconPath": "static/tab-category.png", - "selectedIconPath": "static/tab-category-current.png", - "text": "分类" + "text": "分类", + "iconPath": "static/tabbar/category.png", + "selectedIconPath": "static/tabbar/category-active.png" + }, + { + "pagePath": "pages/mall/consumer/messages", + "text": "消息", + "iconPath": "static/tabbar/messages.png", + "selectedIconPath": "static/tabbar/messages-active.png" }, { "pagePath": "pages/mall/consumer/cart", - "iconPath": "static/tab-cart.png", - "selectedIconPath": "static/tab-cart-current.png", - "text": "购物车" + "text": "购物车", + "iconPath": "static/tabbar/cart.png", + "selectedIconPath": "static/tabbar/cart-active.png" }, { "pagePath": "pages/mall/consumer/profile", - "iconPath": "static/tab-profile.png", - "selectedIconPath": "static/tab-profile-current.png", - "text": "我的" - } - ] - }, - "globalStyle": { - "navigationBarTextStyle": "black", - "navigationBarTitleText": "mall", - "navigationBarBackgroundColor": "#FFFFFF", - "backgroundColor": "#F8F8F8" - }, - "condition": { - "current": 0, - "list": [ - { - "name": "消费者端首页", - "path": "pages/mall/consumer/index" - }, - { - "name": "启动页(登录态判断)", - "path": "pages/user/boot" - }, - { - "name": "登录页", - "path": "pages/user/login" + "text": "我的", + "iconPath": "static/tabbar/profile.png", + "selectedIconPath": "static/tabbar/profile-active.png" } ] } -} \ No newline at end of file +} diff --git a/pages/mall/consumer/address-edit.uvue b/pages/mall/consumer/address-edit.uvue new file mode 100644 index 00000000..18ee45d0 --- /dev/null +++ b/pages/mall/consumer/address-edit.uvue @@ -0,0 +1,360 @@ + + + + + diff --git a/pages/mall/consumer/address-list.uvue b/pages/mall/consumer/address-list.uvue new file mode 100644 index 00000000..67c6133d --- /dev/null +++ b/pages/mall/consumer/address-list.uvue @@ -0,0 +1,307 @@ + + + + + diff --git a/pages/mall/consumer/address.uvue b/pages/mall/consumer/address.uvue new file mode 100644 index 00000000..9b6b4af1 --- /dev/null +++ b/pages/mall/consumer/address.uvue @@ -0,0 +1,918 @@ + +