From 8a96cad47b93562442a87f30a1381a05d6f21b3e Mon Sep 17 00:00:00 2001
From: huliyong <2783385703@qq.com>
Date: Tue, 29 Apr 2025 22:48:14 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E8=AE=A2=E5=8D=95?=
=?UTF-8?q?=E6=94=AF=E4=BB=98=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BC=98=E5=8C=96?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BA=A4=E4=BA=92?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在order.js中新增orderPay接口用于再次支付订单
- 修改confirmOrder.vue中的导航逻辑,使用uni.reLaunch替换uni.navigateTo
- 在orderList.vue中实现支付功能并添加支付状态管理
- 优化serviceNew.vue页面,增加下单方式显示
- 在payOrderSuccessful.vue中添加跳转功能,完善服务档案和门锁信息
- 移除companionPetInfo.vue中的收藏功能,增加图片预览功能
---
api/order/order.js | 12 ++++++++
pages/companionPetList/companionPetInfo.vue | 18 ++++++++----
pages/index.vue | 6 ++--
pages/newOrder/confirmOrder.vue | 2 +-
pages/newOrder/serviceNew.vue | 11 ++++++++
pages/newOrder/serviceNew2.vue | 1 +
pages_order/order/orderList.vue | 44 ++++++++++++++++++++++++++---
pages_order/order/payOrderSuccessful.vue | 13 ++++++---
8 files changed, 89 insertions(+), 18 deletions(-)
diff --git a/api/order/order.js b/api/order/order.js
index 9536933..464dc69 100644
--- a/api/order/order.js
+++ b/api/order/order.js
@@ -147,3 +147,15 @@ export const orderCancel = (data) => {
+
+// 再次支付订单
+export const orderPay = (data) => {
+ return request({
+ url: '/applet/mall/order/orderPay',
+ headers: {
+ isToken: true
+ },
+ method: "POST",
+ data
+ })
+}
\ No newline at end of file
diff --git a/pages/companionPetList/companionPetInfo.vue b/pages/companionPetList/companionPetInfo.vue
index c9fe021..2f5d5eb 100644
--- a/pages/companionPetList/companionPetInfo.vue
+++ b/pages/companionPetList/companionPetInfo.vue
@@ -22,7 +22,7 @@
style="height: 40rpx;"> -->
-
+
@@ -282,9 +282,9 @@
{{item.serviceTime}}
-
+
- 宠物:{{item.petName}}
+ 宠物:{{ item.petName }}
@@ -294,7 +294,9 @@
-
+
@@ -508,6 +510,12 @@
url: `/pages/newOrder/serviceNew2?userName=${this.companionInfo.name}&servicerId=${this.companionInfo.id}`,
});
},
+ previewImage(urls, current){
+ uni.previewImage({
+ current,
+ urls
+ })
+ },
}
}
diff --git a/pages/index.vue b/pages/index.vue
index abebf8a..51ba288 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -957,11 +957,8 @@
if (!getToken() || !getOpenIdKey()) {
this.login()
} else {
+ this.getCouponListAuth()
}
- this.getCouponListAuth()
-
- // 获取优惠券列表(无需登录)
- this.getCouponListNoAuth()
// 设置默认位置,这样即使用户不选择位置也能显示一些伴宠师
this.$store.commit('setPosition', {
@@ -1116,6 +1113,7 @@
justify-content: space-between;
align-items: center;
height: 60px;
+ font-size: 24rpx;
.card-content {
width: 77%;
diff --git a/pages/newOrder/confirmOrder.vue b/pages/newOrder/confirmOrder.vue
index a766ccc..c7b7c16 100644
--- a/pages/newOrder/confirmOrder.vue
+++ b/pages/newOrder/confirmOrder.vue
@@ -738,7 +738,7 @@
totalPrice: 0,
needPreFamiliarize: []
}
- uni.navigateTo({
+ uni.reLaunch({
url: '/pages_order/order/payOrderSuccessful'
// url: '/pages/details/successful'
});
diff --git a/pages/newOrder/serviceNew.vue b/pages/newOrder/serviceNew.vue
index 42d0c71..88f0add 100644
--- a/pages/newOrder/serviceNew.vue
+++ b/pages/newOrder/serviceNew.vue
@@ -28,6 +28,17 @@
+
+
+
+
+
+
+
+
+ 下单方式:指定喂养员 - {{buyInfo.teacher.userName}}
+
+
+
diff --git a/pages_order/order/orderList.vue b/pages_order/order/orderList.vue
index e1b4774..f2c4878 100644
--- a/pages_order/order/orderList.vue
+++ b/pages_order/order/orderList.vue
@@ -72,12 +72,15 @@
-
+
去评价
再来一单
+
+ 查看服务记录
+
@@ -116,7 +119,8 @@
// getOrderList
} from "@/api/system/user.js"
import {
- getOrderList
+ getOrderList,
+ orderPay
} from "@/api/order/order.js"
import {
getOpenIdKey
@@ -161,6 +165,7 @@
loading: false,
refreshing: false,
currentOrder: null,
+ isPaying : false,
// 示例数据,实际应从API获取
exampleData: [{
id: '1',
@@ -232,10 +237,41 @@
// 去付款
goToPay(orderId) {
- uni.navigateTo({
- url: `/pages/details/order?id=${orderId}`
+ orderPay({
+ orderId: orderId
+ }).then(res => {
+ this.pay(res.data)
+ }).catch(err => {
+ console.log(err);
});
},
+ pay(params) {
+ if (this.isPaying) {
+ return;
+ }
+ this.isPaying = true
+ uni.requestPayment({
+ provider: 'wxpay',
+ timeStamp: params.timeStamp,
+ nonceStr: params.nonceStr,
+ package: params.package_,
+ signType: params.signType,
+ paySign: params.paySign,
+ success: (res) => {
+ this.$modal.showToast('支付成功')
+ this.getOrderList()
+ },
+ fail: (err) => {
+ this.loading = false
+ console.log('支付失败', err)
+ this.$modal.showToast('支付失败')
+ },
+ complete: () => {
+ this.loading = false
+ this.isPaying = false
+ }
+ })
+ },
// 去评价
goToReview({teacherId, orderId}) {
diff --git a/pages_order/order/payOrderSuccessful.vue b/pages_order/order/payOrderSuccessful.vue
index 43c9d76..7f9d6e4 100644
--- a/pages_order/order/payOrderSuccessful.vue
+++ b/pages_order/order/payOrderSuccessful.vue
@@ -29,7 +29,7 @@
完善服务档案
请上传宠物喂养要求及用品摆放位置
-
+
去完善
@@ -42,7 +42,7 @@
完善门锁信息
请上传门锁及相应密码要求
-
+
去完善
@@ -81,6 +81,11 @@
url: "/pages/index"
});
},
+ toPath(url){
+ uni.navigateTo({
+ url
+ })
+ },
}
}
@@ -124,8 +129,8 @@
.item-text {
display: flex;
flex-direction: column;
- justify-content: center;;
- align-items: center;
+ justify-content: center;
+ //align-items: center;
.item-title {
font-size: 28rpx;
color: #333;