From 1f4c2c75eb7c1f1e4343b0c3470f1080d6c6c303 Mon Sep 17 00:00:00 2001
From: Sun_sun <469361609@qq.com>
Date: Thu, 23 Oct 2025 10:18:06 +0800
Subject: [PATCH] =?UTF-8?q?2025-10-23=20=E6=94=AF=E4=BB=98=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/address.js | 2 +-
api/common.js | 2 +-
api/finnancial.js | 3 +-
api/group.js | 3 +-
api/mall.js | 4 +-
api/message.js | 3 +-
api/program.js | 3 +-
api/user.js | 6 +-
pages.json | 18 +-
pages/home/index.vue | 6 +-
pages/home/mallDetail.vue | 16 +-
pages/home/mallSearch.vue | 15 ++
pages/home/pay.vue | 435 ++++++++++++++++++++++++++++++++++++--
pages/my/my.vue | 21 +-
pages/my/order.vue | 13 ++
static/icon/jifen.png | Bin 0 -> 1858 bytes
static/icon/rongdou.png | Bin 9183 -> 161837 bytes
util/common.js | 144 +++++++------
18 files changed, 581 insertions(+), 113 deletions(-)
create mode 100644 pages/home/mallSearch.vue
create mode 100644 pages/my/order.vue
create mode 100644 static/icon/jifen.png
diff --git a/api/address.js b/api/address.js
index 66d9eb7..9c7eeae 100644
--- a/api/address.js
+++ b/api/address.js
@@ -3,7 +3,7 @@ import {
} from "../util/api"
// const baseURL = "http://192.168.0.12:3005/term"
-const baseURL = "http://192.168.0.26:3000/api"
+const baseURL = "http://192.168.0.11:3000/api"
// 项目相关API
export const addressAPI = {
diff --git a/api/common.js b/api/common.js
index 58cea4b..2ea273b 100644
--- a/api/common.js
+++ b/api/common.js
@@ -1,6 +1,6 @@
import { http } from "../util/api";
-const baseURL = "http://192.168.0.26:3000/api"
+const baseURL = "http://192.168.0.11:3000/api"
export const commonAPI = {
getRegion: () => http.get(baseURL + '/regions/provinces'),
diff --git a/api/finnancial.js b/api/finnancial.js
index c0729f5..1c2c997 100644
--- a/api/finnancial.js
+++ b/api/finnancial.js
@@ -2,7 +2,8 @@ import {
http
} from "../util/api"
-const baseURL = "http://192.168.0.15:3008"
+// const baseURL = "http://192.168.0.15:3008" // 本地
+const baseURL = "http://192.168.0.4:3008" // 测试服务器
// 项目相关API
export const financeAPI = {
diff --git a/api/group.js b/api/group.js
index e7e2162..7dc24cd 100644
--- a/api/group.js
+++ b/api/group.js
@@ -2,7 +2,8 @@ import {
http
} from "../util/api";
-const baseURL = "http://192.168.0.15:3007"
+// const baseURL = "http://192.168.0.15:3007" // 本地
+const baseURL = "http://192.168.0.4:3007" // 测试服务器
export const groupAPI = {
getList: (params) => http.get(baseURL + '/group/list', params),
diff --git a/api/mall.js b/api/mall.js
index 3f7aba9..d612d68 100644
--- a/api/mall.js
+++ b/api/mall.js
@@ -2,7 +2,7 @@ import {
http
} from "../util/api";
-const baseUrl = "http://192.168.0.26:3000"
+const baseUrl = "http://192.168.0.11:3000"
export const mallAPI = {
getMallList: (params) => http.get(baseUrl + '/api/products', params),
@@ -12,6 +12,8 @@ export const mallAPI = {
addCart: (data) => http.post(baseUrl +"/api/cart/add", data), // 添加购物车
createOrder: (data) => http.post(baseUrl + `/api/orders/create-from-cart`,data), // 创建订单
getOrder: (orderId) => http.get(baseUrl + `/api/orders/pending-payment/${orderId}`), // 获取订单
+ payment: (data) => http.post(baseUrl + "/api/orders/confirm-payment", data), // 支付订单
+ getCouponList: (uid) => http.get(baseUrl + `/api/coupon/user/${uid}`)
}
export default {
diff --git a/api/message.js b/api/message.js
index f8e5e8d..6d2b39e 100644
--- a/api/message.js
+++ b/api/message.js
@@ -3,7 +3,8 @@ import {
} from "../util/api"
// const baseURL = "http://192.168.0.12:3005/chat"
-const baseURL = "http://192.168.0.15:3007"
+// const baseURL = "http://192.168.0.15:3007" // 本地
+const baseURL = "http://192.168.0.4:3007" // 测试服务器
// 项目相关API
export const messageAPI = {
diff --git a/api/program.js b/api/program.js
index 1b2b849..aa4e0b5 100644
--- a/api/program.js
+++ b/api/program.js
@@ -3,7 +3,8 @@ import {
} from "../util/api"
// const baseURL = "http://192.168.0.12:3005/term"
-const baseURL = "http://192.168.0.15:3006"
+// const baseURL = "http://192.168.0.15:3006"
+const baseURL = "http://192.168.0.4:3006"
// 项目相关API
export const programAPI = {
diff --git a/api/user.js b/api/user.js
index e735f3a..c04481a 100644
--- a/api/user.js
+++ b/api/user.js
@@ -2,6 +2,8 @@ import {
http
} from "../util/api"
+const baseURL = "http://192.168.0.4:3000/api"
+
// 用户相关API
export const userAPI = {
// 获取用户列表
@@ -19,7 +21,9 @@ export const userAPI = {
delete: (id) => http.delete(`/users/${id}`),
// 获取用户统计
- getStats: () => http.get('/users/stats/overview')
+ getStats: () => http.get('/users/stats/overview'),
+
+ getProfile: () => http.get(baseURL + '/user/profile')
}
export default {
diff --git a/pages.json b/pages.json
index 774aef9..6c4b2d7 100644
--- a/pages.json
+++ b/pages.json
@@ -142,7 +142,23 @@
"style" :
{
"navigationBarTitleText" : "确认订单",
- "backgroundColor": "#E4ECFF"
+ "backgroundColor": "#E4ECFF",
+ "enablePullDownRefresh": true
+ }
+ },
+ {
+ "path" : "pages/my/order",
+ "style" :
+ {
+ "navigationBarTitleText" : "我的订单"
+ }
+ },
+ {
+ "path" : "pages/home/mallSearch",
+ "style" :
+ {
+ "navigationBarTitleText" : "搜索商品",
+ "navigationStyle": "custom"
}
}
],
diff --git a/pages/home/index.vue b/pages/home/index.vue
index 8001f36..391375d 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -82,13 +82,12 @@
{{item.name}}
- ¥{{item.price}}
{{item.rongdou_price}}
-
+
{{item.points_price}}
@@ -112,13 +111,12 @@
{{item.name}}
- ¥{{item.price}}
{{item.rongdou_price}}
-
+
{{item.points_price}}
diff --git a/pages/home/mallDetail.vue b/pages/home/mallDetail.vue
index 09ab07e..9a2d60c 100644
--- a/pages/home/mallDetail.vue
+++ b/pages/home/mallDetail.vue
@@ -31,7 +31,7 @@
{{dataInfo.rongdou_price}}
-
+
{{dataInfo.points_price}}
@@ -67,7 +67,7 @@
{{item.price}}
-
+
{{item.points}}
@@ -85,7 +85,7 @@
{{item.price}}
-
+
{{item.points}}
@@ -98,7 +98,7 @@
-
@@ -199,7 +199,7 @@
mallAPI
} from '../../api/mall';
import {
- getImageUrl
+ getImageUrl, arrayContainsAll
} from '../../util/common.js';
const instance = getCurrentInstance();
@@ -312,11 +312,6 @@
return hasValidCombination;
}
- // arr1是否包含arr2
- const arrayContainsAll = (arr1, arr2) => {
- return arr2.every(item => arr1.includes(item));
- }
-
// 是否被选中
const isChose = (key) => {
return choseKeys.value.includes(key)
@@ -385,6 +380,7 @@
cart_item_ids: [cartItemId]
}).then(response => {
if (response.success) {
+ showSure.value = false
// 进入支付页面
uni.navigateTo({
url: '/pages/home/pay?preOrderId=' + response.data
diff --git a/pages/home/mallSearch.vue b/pages/home/mallSearch.vue
new file mode 100644
index 0000000..5655d3e
--- /dev/null
+++ b/pages/home/mallSearch.vue
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/pages/home/pay.vue b/pages/home/pay.vue
index 165a0cb..2d9cd87 100644
--- a/pages/home/pay.vue
+++ b/pages/home/pay.vue
@@ -2,14 +2,13 @@
-
+
-
+
- 张三 |
- 浙江省 宁波市 海曙区
+ {{selectAddressLabel}}
-
+
@@ -49,68 +48,449 @@
-
-
+
+ 选择优惠券
+
+ 选择优惠券后自动换算扣除
+
+
+
+
支付方式
-
+
融豆
-
+
+
+
+
+
+ 积分
+
+
+
+
+
+
+
+ 融豆+积分
+
+
+
+
+
+
+
+ 支付宝
+
+
+
+
+
+
+
+ 微信
+
+
+
-
+
- 实际支付:1231
+ 实际支付:
+
+
+ {{allPayNum}}
- 确认支付
+ 确认支付
+
+
+
+
+
+
+
+
@@ -118,9 +498,10 @@
.pay-container {
width: 100%;
height: 100%;
- background: var(--Color, #E4ECFF);
+ background: #E4ECFF;
.scroll-container {
+ padding-bottom: 200rpx;
.box-bg {
background: #F5F8FF;
@@ -135,6 +516,8 @@
.text {
display: flex;
align-items: center;
+ // border: 1px solid #000;
+ flex: 1;
}
.right-icon {
@@ -176,6 +559,10 @@
}
}
+ .discount {
+ padding: 30rpx 40rpx;
+ }
+
.pay-method {
padding: 30rpx 40rpx;
@@ -208,7 +595,15 @@
background: #F5F8FF;
- .text {}
+ .text {
+ display: flex;
+ align-items: center;
+
+ .icon {
+ height: 30rpx;
+ width: 30rpx;
+ }
+ }
.btn {}
}
diff --git a/pages/my/my.vue b/pages/my/my.vue
index 2391346..eef0024 100644
--- a/pages/my/my.vue
+++ b/pages/my/my.vue
@@ -9,6 +9,10 @@