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/newOrder/serviceNew2.vue b/pages/newOrder/serviceNew2.vue index de6dbce..30787ea 100644 --- a/pages/newOrder/serviceNew2.vue +++ b/pages/newOrder/serviceNew2.vue @@ -18,6 +18,7 @@ + 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;