From d6311c6e6c818c6d70d00d9571d0be141d340d5e Mon Sep 17 00:00:00 2001 From: dzq Date: Sat, 8 Nov 2025 15:38:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=BB=93=E7=AE=97=E9=A1=B5):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=8A=9F=E8=83=BD=E5=B9=B6=E5=AE=8C=E5=96=84=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在结算页面实现微信小程序支付功能 - 添加页面导航栏标题配置 - 扩展订单提交接口类型,增加微信小程序标识字段 --- src/api/shop/types.ts | 4 +++- src/pages.json | 5 ++++- src/pages/index/checkout.vue | 13 ++++++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/api/shop/types.ts b/src/api/shop/types.ts index 0b80382..640d1fb 100644 --- a/src/api/shop/types.ts +++ b/src/api/shop/types.ts @@ -78,7 +78,9 @@ export interface SubmitOrderRequestData { cellId: number /** 运行模式(0-支付模式 1-审批模式 2-借还模式 3-会员模式 4-耗材模式) */ mode: number; - }> + }>; + /** 是否微信小程序订单 0否 1是 */ + isWxMp: number; } export type SubmitOrderResponseData = { diff --git a/src/pages.json b/src/pages.json index f9b357a..1c5405c 100644 --- a/src/pages.json +++ b/src/pages.json @@ -71,7 +71,10 @@ }, { "path": "pages/index/checkout", - "type": "page" + "type": "page", + "style": { + "navigationBarTitleText": "结算购物车" + } }, { "path": "pages/login/login", diff --git a/src/pages/index/checkout.vue b/src/pages/index/checkout.vue index 40acdbe..045aeae 100644 --- a/src/pages/index/checkout.vue +++ b/src/pages/index/checkout.vue @@ -10,6 +10,12 @@ import { useRentingCabinetStore } from "@/pinia/stores/rentingCabinet"; // 导入支付方式映射 import { paymentMethodOptions, modeToPaymentMethodMap } from "@/utils/maps/payment"; +definePage({ + style: { + navigationBarTitleText: '结算购物车', + }, +}) + const cartStore = useCartStore(); const { cartItems, totalPrice } = storeToRefs(cartStore); @@ -71,7 +77,7 @@ const paymentValueToType: Record = { async function callUniPay(paymentInfo: any) { return new Promise((resolve, reject) => { // uni-app支付API - /* uni.requestPayment({ + wx.requestPayment({ provider: 'wxpay', timeStamp: paymentInfo.timeStamp, nonceStr: paymentInfo.nonceStr, @@ -86,7 +92,7 @@ async function callUniPay(paymentInfo: any) { fail: (err) => { reject(new Error(err.errMsg || '支付未完成')); } - }); */ + }); }); } @@ -160,7 +166,8 @@ async function handleSubmit() { applyRemark: applyRemark.value, qyUserid: wxStore.userid, mode: productStore.selectedShop?.mode || 0, - isInternal: isInternal + isInternal: isInternal, + isWxMp: 1 }; const { code, data } = await submitOrderApi(requestData);