shish 11 月之前
父節點
當前提交
2f2b0852ba

+ 1 - 1
mallApp/dist/build/h5/index.html

@@ -1,3 +1,3 @@
 <!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><title>商城</title><script>document.addEventListener('DOMContentLoaded', function() {
 				document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
-			})</script><link rel="stylesheet" href="/static/index.css"/><script defer="defer" src="/static/js/chunk-vendors.dd919b35.js"></script><script defer="defer" src="/static/js/index.7784a62c.js"></script></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div><script>/*BAIDU_STAT*/</script></body></html>
+			})</script><link rel="stylesheet" href="/static/index.css"/><script defer="defer" src="/static/js/chunk-vendors.dd919b35.js"></script><script defer="defer" src="/static/js/index.a4040b96.js"></script></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div><script>/*BAIDU_STAT*/</script></body></html>

文件差異過大導致無法顯示
+ 0 - 0
mallApp/dist/build/h5/static/js/index.a4040b96.js


文件差異過大導致無法顯示
+ 0 - 0
mallApp/dist/build/h5/static/js/pages-callback-index.0a442a3d.js


文件差異過大導致無法顯示
+ 0 - 0
mallApp/dist/build/h5/static/js/pages-callback-index.c7c69d99.js


文件差異過大導致無法顯示
+ 0 - 0
mallApp/dist/build/h5/static/js/pages-callback-pay.d4737021.js


文件差異過大導致無法顯示
+ 0 - 0
mallApp/dist/build/h5/static/js/pages-callback-pay.f7b95c4f.js


文件差異過大導致無法顯示
+ 0 - 0
mallApp/dist/build/h5/static/js/pages-class-index.4d8d0abc.js


文件差異過大導致無法顯示
+ 0 - 0
mallApp/dist/build/h5/static/js/pages-class-index.9615bd80.js


文件差異過大導致無法顯示
+ 0 - 0
mallApp/dist/build/h5/static/js/pages-member-recharge.187f82dc.js


文件差異過大導致無法顯示
+ 0 - 0
mallApp/dist/build/h5/static/js/pages-member-recharge.783ffd47.js


文件差異過大導致無法顯示
+ 0 - 0
mallApp/dist/build/h5/static/js/pages-pay-index.376882c3.js


文件差異過大導致無法顯示
+ 0 - 0
mallApp/dist/build/h5/static/js/pages-pay-index.bc614965.js


文件差異過大導致無法顯示
+ 0 - 0
mallApp/dist/build/h5/static/js/pages-settle-pay.04ce0d35.js


文件差異過大導致無法顯示
+ 0 - 0
mallApp/dist/build/h5/static/js/pages-settle-pay.5b9c25bc.js


+ 57 - 18
mallApp/src/pages/pay/index.vue

@@ -1,5 +1,9 @@
 <template>
 	<div class="app-content pay-wrap">
+		<!-- 加载状态 -->
+		<div class="loading-wrap" v-if="$util.isEmpty(orderShop)">
+			<div class="loading-text">正在加载...</div>
+		</div>
 
 		<div class="delivery-wrap" v-if="!$util.isEmpty(orderShop)">
 			<div class="shop-logo-wrap" v-if="!$util.isEmpty(orderShop)">
@@ -122,9 +126,19 @@
 		onLoad(option) {
             // #ifdef H5
 			this.specialInit()
+            // #endif
+            // #ifndef H5
+            this.specialInit()
+            // #endif
+		},
+		mounted() {
+            // H5环境下确保数据加载完成
+            // #ifdef H5
+            if (this.$util.isEmpty(this.orderShop)) {
+                this.specialInit()
+            }
             // #endif
 		},
-		mounted() {},
 		methods: {
 			fillGetMan(){
 				this.tabIndex = this.tabIndex == 0 ? 1 : 0
@@ -141,24 +155,36 @@
 					this.tabIndex = parseInt(this.option.pageType)
 				}
 				getOrderShop(true).then(res => {
-					this.inpFocus = true
-					uni.setNavigationBarTitle({
-						title: `向【${res.shop.showName}】付款`
-					})
-					this.$refs.couponSel._getUserDiscount().then(status => {
-						this.discountArr = status
-					})
-					// 设置分享
-					let shareParams = {
-						title: `点我付款`, // 分享标题
-						desc: '享随机优惠,最高20元', // 分享内容
-						imgUrl: '',
-						pagePath: `/pages/pay/index?account=${res.shop.id}&store=0&fromType=3`
+					if (res) {
+						this.inpFocus = true
+						uni.setNavigationBarTitle({
+							title: `向【${res.shop.showName}】付款`
+						})
+						this.$refs.couponSel._getUserDiscount().then(status => {
+							this.discountArr = status
+						})
+						// 设置分享
+						let shareParams = {
+							title: `点我付款`, // 分享标题
+							desc: '享随机优惠,最高20元', // 分享内容
+							imgUrl: '',
+							pagePath: `/pages/pay/index?account=${res.shop.id}&store=0&fromType=3`
+						}
+                        // #ifdef MP-WEIXIN
+						this.jweixinFn(shareParams)
+                        // #endif
+						console.log(`/pages/pay/index?account=${res.shop.id}&store=0&fromType=3`)
+					} else {
+						// H5环境下数据获取失败的处理
+						// #ifdef H5
+						this.$msg('数据加载失败,请刷新页面重试')
+						// #endif
 					}
-                    // #ifdef MP-WEIXIN
-					this.jweixinFn(shareParams)
-                    // #endif
-					console.log(`/pages/pay/index?account=${res.shop.id}&store=0&fromType=3`)
+				}).catch(err => {
+					console.error('获取订单商店信息失败:', err)
+					// #ifdef H5
+					this.$msg('网络异常,请检查网络连接')
+					// #endif
 				})
 			},
 			_pay() {
@@ -286,6 +312,19 @@
 		min-height: calc(100vh - 20upx);
 		padding-top: 20upx;
 	}
+	
+	// 加载状态样式
+	.loading-wrap {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		height: 400upx;
+		.loading-text {
+			font-size: 28upx;
+			color: #999;
+		}
+	}
+	
 	.tabs-wrap {
 		position: fixed;
 		top: 0;

+ 37 - 30
mallApp/src/utils/pay/wxPay.js

@@ -25,40 +25,47 @@ let wexinPay = null
 // #ifdef H5
 const wx = require('jweixin-module')
 wexinPay = (data, cb, errorCb) => {
-	let [appId, timestamp, nonceStr, signature, packages, paySign] = [data.appId, data.timeStamp, data.nonceStr, data.signature,
-		data.package, data.paySign
-	]
+	try {
+		let [appId, timestamp, nonceStr, signature, packages, paySign] = [data.appId, data.timeStamp, data.nonceStr, data.signature,
+			data.package, data.paySign
+		]
 
-	wx.config({
-		debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-		appId, // 必填,公众号的唯一标识
-		timestamp, // 必填,生成签名的时间戳
-		nonceStr, // 必填,生成签名的随机串
-		signature, // 必填,签名,见附录1
-		jsApiList: ['chooseWXPay'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
-	})
+		wx.config({
+			debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+			appId, // 必填,公众号的唯一标识
+			timestamp, // 必填,生成签名的时间戳
+			nonceStr, // 必填,生成签名的随机串
+			signature, // 必填,签名,见附录1
+			jsApiList: ['chooseWXPay'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
+		})
 
-	wx.ready(function() {
-		wx.chooseWXPay({
-			timestamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
-			nonceStr, // 支付签名随机串,不长于 32 位
-			'package': packages, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=***)
-			signType: 'MD5', // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
-			paySign, // 支付签名
-			success(res) {
-				// 支付成功后的回调函数
-				cb(res)
-			},
-			fail(res) {
-				errorCb(res)
-			}
+		wx.ready(function() {
+			wx.chooseWXPay({
+				timestamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
+				nonceStr, // 支付签名随机串,不长于 32 位
+				'package': packages, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=***)
+				signType: 'MD5', // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
+				paySign, // 支付签名
+				success(res) {
+					// 支付成功后的回调函数
+					cb(res)
+				},
+				fail(res) {
+					console.error('微信支付失败:', res)
+					errorCb(res)
+				}
+			})
 		})
-	})
 
-	wx.error(function(res) {
-		// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
-		/* alert("config信息验证失败");*/
-	})
+		wx.error(function(res) {
+			// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
+			console.error('微信配置验证失败:', res)
+			errorCb(res)
+		})
+	} catch (error) {
+		console.error('微信支付初始化失败:', error)
+		errorCb(error)
+	}
 }
 // #endif
 // #ifdef MP-WEIXIN

部分文件因文件數量過多而無法顯示