From ab038ec029662aaa9dcd7c624be85d5e35dc6e96 Mon Sep 17 00:00:00 2001
From: cyh666666 <2398882793@qq.com>
Date: Thu, 29 Jan 2026 17:28:47 +0800
Subject: [PATCH] =?UTF-8?q?consumer=E6=A8=A1=E5=9D=97=E5=AE=8C=E6=88=90?=
=?UTF-8?q?=E5=BA=A685%=EF=BC=8C=E8=BF=9E=E6=8E=A5=E6=9C=8D=E5=8A=A1?=
=?UTF-8?q?=E5=99=A8supabase=EF=BC=8C=E6=96=B0=E5=BB=BA=E7=9B=B8=E5=85=B3?=
=?UTF-8?q?=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/supadb/aksupa.uts | 34 +-
pages/mall/consumer/address-list.uvue | 170 +-
pages/mall/consumer/category - 副本.uvue | 1408 +++++++++++-
pages/mall/consumer/category.uvue | 418 +---
.../category完成分类及商品数据获取.uvue | 1131 ++++++++++
...- 副本 (4)完成分类、热销药品数据获取.uvue} | 921 ++++----
pages/mall/consumer/index - 副本.uvue | 1923 -----------------
pages/mall/consumer/index.uvue | 323 +--
pages/mall/consumer/indexback.uvue | 1540 -------------
.../mall/consumer/product-detail - 副本.uvue | 979 +++++++++
pages/mall/consumer/product-detail.uvue | 139 +-
pages/mall/consumer/search.uvue | 130 +-
pages/mall/consumer/wallet.uvue | 13 +
pages/user/login.uvue | 38 +-
utils/supabaseService.uts | 101 +-
15 files changed, 4475 insertions(+), 4793 deletions(-)
create mode 100644 pages/mall/consumer/category完成分类及商品数据获取.uvue
rename pages/mall/consumer/{indexgood.uvue => index - 副本 (4)完成分类、热销药品数据获取.uvue} (70%)
delete mode 100644 pages/mall/consumer/index - 副本.uvue
delete mode 100644 pages/mall/consumer/indexback.uvue
create mode 100644 pages/mall/consumer/product-detail - 副本.uvue
diff --git a/components/supadb/aksupa.uts b/components/supadb/aksupa.uts
index c47057f4..8980aaba 100644
--- a/components/supadb/aksupa.uts
+++ b/components/supadb/aksupa.uts
@@ -82,7 +82,26 @@ export class AkSupaQueryBuilder {
is(field : string, value : any) : AkSupaQueryBuilder { return this._addCond(field, 'is', value); }
contains(field : string, value : any) : AkSupaQueryBuilder { return this._addCond(field, 'cs', value); }
containedBy(field : string, value : any) : AkSupaQueryBuilder { return this._addCond(field, 'cd', value); }
- not(field : string, value : any) : AkSupaQueryBuilder { return this._addCond(field, 'not', value); }
+ not(field : string, opOrValue : any, value?: any) : AkSupaQueryBuilder {
+ if (value !== undefined) {
+ // 三元形式:field, operator, value
+ // 例如 not('badge', 'is', null) -> badge=not.is.null
+ const combinedOp = 'not.' + opOrValue;
+ // 将 null 转换为字符串 'null',避免构造对象时缺少 value 属性
+ let safeValue = value;
+ if (value === null) {
+ safeValue = 'null';
+ }
+ return this._addCond(field, combinedOp, safeValue);
+ } else {
+ // 二元形式:field, value
+ let safeValue = opOrValue;
+ if (opOrValue === null) {
+ safeValue = 'null';
+ }
+ return this._addCond(field, 'not', safeValue);
+ }
+ }
and() : AkSupaQueryBuilder { this._nextLogic = 'and'; return this; }
or(str ?: string) : AkSupaQueryBuilder {
@@ -97,7 +116,12 @@ export class AkSupaQueryBuilder {
private _addCond(afield : string, op : string, value : any) : AkSupaQueryBuilder {
//console.log('add cond:', op, afield, value)
const field = encodeURIComponent(afield)!!
- this._conditions.push({ field, op, value, logic: this._nextLogic });
+ // 将 null 转换为字符串 'null',避免构造对象时缺少 value 属性
+ let safeValue = value;
+ if (value === null) {
+ safeValue = 'null';
+ }
+ this._conditions.push({ field, op, value: safeValue, logic: this._nextLogic });
//console.log(this._conditions)
this._nextLogic = 'and';
return this;
@@ -213,8 +237,8 @@ export class AkSupaQueryBuilder {
const val = cond.value;
if ((op == 'in' || op == 'not.in') && Array.isArray(val)) {
params.push(`${k}=${op}.(${val.map(x => typeof x == 'object' ? encodeURIComponent(JSON.stringify(x)) : encodeURIComponent(x.toString())).join(',')})`);
- } else if (op == 'is' && (val == null || val == 'null')) {
- params.push(`${k}=is.null`);
+ } else if ((op == 'is' || op == 'not.is') && (val == null || val == 'null')) {
+ params.push(`${k}=${op}.null`);
} else {
const opvalstr: string = (typeof val == 'object') ? JSON.stringify(val) : (val as string);
params.push(`${k}=${op}.${encodeURIComponent(opvalstr)}`);
@@ -1051,4 +1075,4 @@ export function createClient(url : string, key : string) : AkSupa {
return new AkSupa(url, key);
}
-export default AkSupa;
\ No newline at end of file
+export default AkSupa;
diff --git a/pages/mall/consumer/address-list.uvue b/pages/mall/consumer/address-list.uvue
index 67c6133d..1b6aeefa 100644
--- a/pages/mall/consumer/address-list.uvue
+++ b/pages/mall/consumer/address-list.uvue
@@ -156,6 +156,42 @@ const selectAddress = (item: Address) => {
diff --git a/pages/mall/consumer/category - 副本.uvue b/pages/mall/consumer/category - 副本.uvue
index d217ab27..5c02cd56 100644
--- a/pages/mall/consumer/category - 副本.uvue
+++ b/pages/mall/consumer/category - 副本.uvue
@@ -1,131 +1,1419 @@
-
-
\ No newline at end of file
diff --git a/pages/mall/consumer/category.uvue b/pages/mall/consumer/category.uvue
index 5c02cd56..ec734cdf 100644
--- a/pages/mall/consumer/category.uvue
+++ b/pages/mall/consumer/category.uvue
@@ -111,320 +111,60 @@
+
+
diff --git a/pages/mall/consumer/indexgood.uvue b/pages/mall/consumer/index - 副本 (4)完成分类、热销药品数据获取.uvue
similarity index 70%
rename from pages/mall/consumer/indexgood.uvue
rename to pages/mall/consumer/index - 副本 (4)完成分类、热销药品数据获取.uvue
index f780dd9d..d074d86d 100644
--- a/pages/mall/consumer/indexgood.uvue
+++ b/pages/mall/consumer/index - 副本 (4)完成分类、热销药品数据获取.uvue
@@ -6,40 +6,34 @@
class="smart-navbar"
:style="{
paddingTop: statusBarHeight + 'px',
- transform: showNavbar ? 'translateY(0)' : 'translateY(-100%)',
- opacity: showNavbar ? 1 : 0
+ transform: showNavbar ? 'translateY(0)' : 'translateY(-100%)'
}"
>
-
-
-
-
-
-
- 康乐医药商城
- 官方认证·正品保障
-
+
+
+
+ 请输入药品名称、症状或品牌
+
+
+
+ 🔳
+
+
+
+
+ 📷
-
-
-
-
- 🔍
-
-
- 语音
- 拍照
-
-
-
+
+
+ 搜索
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
- {{ product.tag }}
- {{ product.featured }}
-
-
-
-
- {{ product.name }}
- {{ product.specification }}
-
-
-
- ⭐
- {{ product.rating }}
-
- {{ product.reviews }}条评价
-
-
-
-
- ¥
- {{ product.price }}
-
-
- ¥{{ product.originalPrice }}
-
-
-
-
-
- 🛒
-
-
-
-
-
-
-
-
-
- 加载中...
-
-
-
- --- 已加载全部内容 ---
-
-
+
@@ -352,6 +268,9 @@
-
-
\ No newline at end of file
diff --git a/pages/mall/consumer/index.uvue b/pages/mall/consumer/index.uvue
index 854af7d0..d074d86d 100644
--- a/pages/mall/consumer/index.uvue
+++ b/pages/mall/consumer/index.uvue
@@ -244,85 +244,7 @@
-
-
-
-
-
-
-
-
-
- {{ product.tag }}
- {{ product.featured }}
-
-
-
-
- {{ product.name }}
- {{ product.specification }}
-
-
-
- ⭐
- {{ product.rating }}
-
- {{ product.reviews }}条评价
-
-
-
-
- ¥
- {{ product.price }}
-
-
- ¥{{ product.originalPrice }}
-
-
-
-
-
- 🛒
-
-
-
-
-
-
-
-
-
- 加载中...
-
-
-
- --- 已加载全部内容 ---
-
-
+
@@ -347,6 +269,8 @@
-
-
\ No newline at end of file
diff --git a/pages/mall/consumer/product-detail - 副本.uvue b/pages/mall/consumer/product-detail - 副本.uvue
new file mode 100644
index 00000000..500dd3ed
--- /dev/null
+++ b/pages/mall/consumer/product-detail - 副本.uvue
@@ -0,0 +1,979 @@
+
+
+
+
+
+
+
+
+
+
+ {{ currentImageIndex + 1 }} / {{ product.images.length }}
+
+
+
+
+
+ ¥{{ product.price }}
+ ¥{{ product.original_price }}
+
+ {{ product.name }}
+ 已售{{ product.sales }}件 · 库存{{ product.stock }}件
+
+
+
+
+
+
+ {{ merchant.shop_name }}
+
+ 评分: {{ merchant.rating.toFixed(1) }}
+ 销量: {{ merchant.total_sales }}
+
+
+ 进店 >
+
+
+
+
+ 规格
+ {{ selectedSpec || '请选择规格' }}
+ >
+
+
+
+
+ 数量
+
+
+ -
+
+
+
+ +
+
+
+ 库存{{ getAvailableStock() }}件
+
+
+
+
+ 商品详情
+ {{ product.description || '暂无详细描述' }}
+
+
+
+
+
+
+ 🛒
+ 购物车
+
+
+ {{ isFavorite ? '❤️' : '🤍' }}
+ {{ isFavorite ? '已收藏' : '收藏' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ getSkuSpecText(sku) }}
+ ¥{{ sku.price }}
+ 库存{{ sku.stock }}
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/mall/consumer/product-detail.uvue b/pages/mall/consumer/product-detail.uvue
index 500dd3ed..27e3757e 100644
--- a/pages/mall/consumer/product-detail.uvue
+++ b/pages/mall/consumer/product-detail.uvue
@@ -109,6 +109,7 @@