收藏
回答

windows 企业微信 小程序 支付失败

加载完就没反应了

支付使用的是uniapp提供的 uni.requestPayment

// 微信小程序支付
async function wxAppPay() {
	const userInfo = uni.getStorageSync('userInfo');
	let data = await http.pay.wxAppletPay({
		data: {
			customerOrderId: orderInfo.orderId,
			openId: userInfo.openId // 用户openId
		}
	});
	uni.requestPayment({
		provider: 'wxpay',
		orderInfo: orderInfo.info.salesOrderProductVos,
		...data,
		success(res) {
			console.log(res, '成功');
			if (window.navigator.userAgent.includes('MicroMessenger')) {
				alert(JSON.stringify(err));
			}
		},
		fail(err) {
			console.log(err, 'err');
			alert(JSON.stringify(err));
			uni.showToast({
				title: '支付失败!',
				icon: 'error'
			});
		}
	});
}


在手机企业微信app和windows微信中打开小程序均可以支付,企业微信中打开小程序就不行

最后一次编辑于  2022-12-06
回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容