From d1c0419d768081c417e2d72e27077b6f3247417a Mon Sep 17 00:00:00 2001
From: yankang <745567571@qq.com>
Date: Tue, 2 Jun 2026 14:59:50 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=98=E5=AE=9D=E6=8E=88=E6=9D=83=E6=8E=A8?=
=?UTF-8?q?=E9=80=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 17 +
components/bottom-nav/bottom-nav.vue | 19 +-
main.js | 4 +-
pages/activity/activity.vue | 175 ++----
pages/auth/auth.vue | 592 +++++++++---------
pages/category/category.vue | 112 ++--
pages/category/category_detail.vue | 188 +++---
pages/classify/classify.vue | 36 +-
pages/detail/detail.vue | 41 +-
pages/index/index.vue | 111 ++--
pages/rank/rank.vue | 20 +-
pages/search/search.vue | 71 ++-
pages/special-sale/choicen.vue | 78 ++-
pages/special-sale/details.vue | 30 +-
request/request.js | 257 ++++++++
scratch/test_request.mjs | 257 ++++++++
store/index.js | 26 +-
test.vue | 150 +++++
.../dist/cache/.vite/deps/_metadata.json | 8 +-
utils/index.js | 5 +
20 files changed, 1495 insertions(+), 702 deletions(-)
create mode 100644 request/request.js
create mode 100644 scratch/test_request.mjs
create mode 100644 test.vue
create mode 100644 utils/index.js
diff --git a/App.vue b/App.vue
index 72f9919..17069c5 100644
--- a/App.vue
+++ b/App.vue
@@ -3,6 +3,23 @@
export default {
globalData: {
+ /**
+ * urlParams - 当前页面 URL 参数集合
+ *
+ * 来源:
+ * 1. H5 环境下从 window.location(search + hash)解析
+ * 2. 小程序/App 环境下从页面栈 currentPage.options 获取
+ * 3. 分享/扫码进入时从 App.onLaunch/onShow 的 options.query 合并
+ *
+ * 目前业务中实际使用的参数:
+ * - token {string} 用户登录凭证
+ * - code {string} 淘宝后返回授权码
+ * - state {string} 状态值,格式通常为 "uidxxx",用于提取用户 ID(淘宝授权返回)
+ * - exuid {string} 推广人/邀请人用户 ID(三方进入用户标识)
+ * - page_uri {string} 授权成功后需要跳转的目标页面路径(必须授权过的用户该参数才有效)
+ *
+ * 注:UrlQuery 支持获取任意 URL 参数,以上仅为业务代码中显式消费的字段
+ */
urlParams: {}
},
onLaunch: function(options) {
diff --git a/components/bottom-nav/bottom-nav.vue b/components/bottom-nav/bottom-nav.vue
index a6b396c..473eccc 100644
--- a/components/bottom-nav/bottom-nav.vue
+++ b/components/bottom-nav/bottom-nav.vue
@@ -8,6 +8,8 @@
diff --git a/pages/category/category.vue b/pages/category/category.vue
index 6ec39eb..012c19e 100644
--- a/pages/category/category.vue
+++ b/pages/category/category.vue
@@ -82,6 +82,12 @@
{{ goods.couponValue }}元
+
+
+ 预估消费券
+ {{ $estimateCoupon(goods.tkmoney) }}
+
+
@@ -103,6 +109,7 @@
+
+
diff --git a/unpackage/dist/cache/.vite/deps/_metadata.json b/unpackage/dist/cache/.vite/deps/_metadata.json
index d316793..b492e34 100644
--- a/unpackage/dist/cache/.vite/deps/_metadata.json
+++ b/unpackage/dist/cache/.vite/deps/_metadata.json
@@ -1,8 +1,8 @@
{
- "hash": "0694fca5",
- "configHash": "6057985e",
- "lockfileHash": "e3b0c442",
- "browserHash": "9518c2ac",
+ "hash": "aee3647b",
+ "configHash": "43aa957d",
+ "lockfileHash": "32773baf",
+ "browserHash": "732cb9f3",
"optimized": {},
"chunks": {}
}
\ No newline at end of file
diff --git a/utils/index.js b/utils/index.js
new file mode 100644
index 0000000..861a7cd
--- /dev/null
+++ b/utils/index.js
@@ -0,0 +1,5 @@
+// 预估消费券函数
+export function estimateCoupon(tkmoney = 0, percentage = 0.3) {
+ let result = (tkmoney * percentage).toFixed(2);
+ return result;
+}