From 73498128dde533e8984c8bc2ebcca43253e46fb6 Mon Sep 17 00:00:00 2001 From: cyh666666 <2398882793@qq.com> Date: Thu, 22 Jan 2026 17:07:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9D=E6=AC=A1=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=88=91=E7=9A=84=E9=A1=B9=E7=9B=AE=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hbuilderx/launch.json | 9 + ak/config.uts | 4 +- components/supadb/aksupainstance - 副本.uts | 18 + components/supadb/aksupainstance.uts | 43 +- main - 副本.uts | 14 + main.uts | 10 +- pages - 副本 (2).json | 118 + pages - 副本.json | 213 ++ pages.json | 204 +- pages/mall/consumer/address-edit.uvue | 793 +++++++ pages/mall/consumer/address.uvue | 474 ++++ pages/mall/consumer/cart - 副本.uvue | 810 +++++++ pages/mall/consumer/cart.uvue | 529 +++++ pages/mall/consumer/category - 副本.uvue | 526 +++++ pages/mall/consumer/category.uvue | 361 +++ pages/mall/consumer/chat.uvue | 593 +++++ pages/mall/consumer/checkout.uvue | 739 ++++++ pages/mall/consumer/coupons.uvue | 590 +++++ pages/mall/consumer/favorites.uvue | 694 ++++++ pages/mall/consumer/footprint.uvue | 674 ++++++ pages/mall/consumer/index - 副本 (2).uvue | 1455 ++++++++++++ pages/mall/consumer/index - 副本 (3).uvue | 1550 +++++++++++++ pages/mall/consumer/index - 副本.uvue | 1239 ++++++++++ pages/mall/consumer/index.uvue | 2029 +++++++++++------ pages/mall/consumer/indexback.uvue | 1550 +++++++++++++ pages/mall/consumer/messages.uvue | 634 +++++ pages/mall/consumer/orders - 副本.uvue | 1011 ++++++++ pages/mall/consumer/orders.uvue | 908 ++++++++ pages/mall/consumer/payment.uvue | 755 ++++++ pages/mall/consumer/refund.uvue | 858 +++++++ pages/mall/consumer/review.uvue | 772 +++++++ pages/mall/consumer/search.uvue | 13 + pages/mall/consumer/settings.uvue | 698 ++++++ pages/mall/consumer/wallet.uvue | 950 ++++++++ static/images/default-banner.png | 0 static/images/default-product.png | 0 types/mall-types - 副本.uts | 365 +++ types/mall-types.uts | 70 + .../.app-android/tsc/app-android/.tsbuildInfo | 1 + 39 files changed, 21439 insertions(+), 835 deletions(-) create mode 100644 .hbuilderx/launch.json create mode 100644 components/supadb/aksupainstance - 副本.uts create mode 100644 main - 副本.uts create mode 100644 pages - 副本 (2).json create mode 100644 pages - 副本.json create mode 100644 pages/mall/consumer/address-edit.uvue create mode 100644 pages/mall/consumer/address.uvue create mode 100644 pages/mall/consumer/cart - 副本.uvue create mode 100644 pages/mall/consumer/cart.uvue create mode 100644 pages/mall/consumer/category - 副本.uvue create mode 100644 pages/mall/consumer/category.uvue create mode 100644 pages/mall/consumer/chat.uvue create mode 100644 pages/mall/consumer/checkout.uvue create mode 100644 pages/mall/consumer/coupons.uvue create mode 100644 pages/mall/consumer/favorites.uvue create mode 100644 pages/mall/consumer/footprint.uvue create mode 100644 pages/mall/consumer/index - 副本 (2).uvue create mode 100644 pages/mall/consumer/index - 副本 (3).uvue create mode 100644 pages/mall/consumer/index - 副本.uvue create mode 100644 pages/mall/consumer/indexback.uvue create mode 100644 pages/mall/consumer/messages.uvue create mode 100644 pages/mall/consumer/orders - 副本.uvue create mode 100644 pages/mall/consumer/orders.uvue create mode 100644 pages/mall/consumer/payment.uvue create mode 100644 pages/mall/consumer/refund.uvue create mode 100644 pages/mall/consumer/review.uvue create mode 100644 pages/mall/consumer/search.uvue create mode 100644 pages/mall/consumer/settings.uvue create mode 100644 pages/mall/consumer/wallet.uvue create mode 100644 static/images/default-banner.png create mode 100644 static/images/default-product.png create mode 100644 types/mall-types - 副本.uts create mode 100644 unpackage/cache/.app-android/tsc/app-android/.tsbuildInfo 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/ak/config.uts b/ak/config.uts index 93ff692b..fdd0db6d 100644 --- a/ak/config.uts +++ b/ak/config.uts @@ -4,8 +4,8 @@ // export const SUPA_KEY: string = 'your-anon-key' // 生产环境 - Supabase 云服务 -export const SUPA_URL: string = 'https://ak3.oulog.com' -export const SUPA_KEY: string = 'your-anon-key' +//export const SUPA_URL: string = 'https://ak3.oulog.com' +//export const SUPA_KEY: string = 'your-anon-key' // WebSocket 实时连接 export const WS_URL: string = 'wss://ak3.oulog.com/realtime/v1/websocket' 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 1b25ca34..928fe829 100644 --- a/components/supadb/aksupainstance.uts +++ b/components/supadb/aksupainstance.uts @@ -1,18 +1,31 @@ -import AkSupa from './aksupa.uts' -import { SUPA_URL, SUPA_KEY } from '@/ak/config.uts' +// /components/supadb/aksupainstance.uts +import { createClient } from './aksupa.uts' -const supa = new AkSupa(SUPA_URL, SUPA_KEY) +// 创建并导出 Supabase 客户端实例 +const supabaseUrl = 'https://your-project.supabase.co' // 替换为你的 Supabase URL +const supabaseAnonKey = 'your-anon-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 const supabase = createClient(supabaseUrl, supabaseAnonKey) -export { supaReady } -export default supa \ No newline at end of file +// 导出 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() +} \ No newline at end of file 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 234c8c9b..a6f3b3e4 100644 --- a/main.uts +++ b/main.uts @@ -6,9 +6,13 @@ 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) - } + 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/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 fed5ab00..2a92a152 100644 --- a/pages.json +++ b/pages.json @@ -3,210 +3,72 @@ { "path": "pages/mall/consumer/index", "style": { - "navigationBarTitleText": "商城首页", - "navigationStyle": "custom" + "navigationBarTitleText": "首页", + "navigationStyle": "custom", + "enablePullDownRefresh": true } }, { - "path": "pages/user/boot", + "path": "pages/mall/consumer/category", "style": { - "navigationBarTitleText": "" + "navigationBarTitleText": "分类" } }, { - "path": "pages/user/login", + "path": "pages/mall/consumer/messages", "style": { - "navigationBarTitleText": "登录" + "navigationBarTitleText": "消息", + "enablePullDownRefresh": true } }, { - "path": "pages/user/register", + "path": "pages/mall/consumer/cart", "style": { - "navigationBarTitleText": "注册" + "navigationBarTitleText": "购物车" } }, { - "path": "pages/user/forgot-password", + "path": "pages/mall/consumer/profile", "style": { - "navigationBarTitleText": "忘记密码" + "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", + "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" } ] } diff --git a/pages/mall/consumer/address-edit.uvue b/pages/mall/consumer/address-edit.uvue new file mode 100644 index 00000000..ef81282c --- /dev/null +++ b/pages/mall/consumer/address-edit.uvue @@ -0,0 +1,793 @@ + +