Merge remote-tracking branch 'origin/feature/mall_product' into feature/mall_product_new

pull/2/head
perry 2023-05-18 19:28:21 +08:00
commit 12228e7d09
3 changed files with 39 additions and 19 deletions

View File

@ -75,6 +75,35 @@
action: 'payClose' action: 'payClose'
}); });
}, },
// JSAPI
wxPayJSAPI(payData) {
function onBridgeReady() {
WeixinJSBridge.invoke('getBrandWCPayRequest', {
"appId": payData.appId, //ID
"timeStamp": payData.timeStamp, //1970
"nonceStr": payData.nonceStr, //
"package": payData.packageValue,
"signType": payData.signType, //
"paySign": payData.paySign //
},
function(res) {
if (res.err_msg == "get_brand_wcpay_request:ok") {
// 使,
//res.err_msgok
}
})
}
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false)
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', onBridgeReady)
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady)
}
} else {
onBridgeReady()
}
},
goPay: function(paytype) { goPay: function(paytype) {
let that = this; let that = this;
if (that.payInfo.orderInfos.length === 0) return that.$util.Tips({ if (that.payInfo.orderInfos.length === 0) return that.$util.Tips({
@ -83,14 +112,13 @@
uni.showLoading({ uni.showLoading({
title: '支付中' title: '支付中'
}); });
that.payInfo.openid = 'omq7W6DxNcTjsvzahB5D3gwkGPzI' if(paytype === 'WXPAY' && !that.openId) {
// if(paytype === 'WXPAY' && !that.openId) { return that.$util.Tips({
// return that.$util.Tips({ title: '请在微信客户端进行支付操作'
// title: '' });
// }); } else {
// } else { that.payInfo.openid = that.openId
// that.payInfo.openid = that.openId }
// }
memberTopUp({ memberTopUp({
...that.payInfo, ...that.payInfo,
payType: paytype payType: paytype
@ -99,16 +127,7 @@
switch (paytype) { switch (paytype) {
case 'WXPAY': case 'WXPAY':
uni.hideLoading(); uni.hideLoading();
location.replace(jsConfig.h5Url + '&redirect_url=' + window.location.protocol + that.wxPayJSAPI(jsConfig.jsapiResult)
'//' + window.location.host + goPages + '&status=1');
return that.$util.Tips({
title: "支付中",
icon: 'success'
}, () => {
that.$emit('onChangeFun', {
action: 'pay_complete'
});
});
break; break;
case 'ALIPAY': case 'ALIPAY':
uni.hideLoading(); uni.hideLoading();

View File

@ -9,6 +9,7 @@
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />') (coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script> </script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<title></title> <title></title>
<!--preload-links--> <!--preload-links-->
<!--app-context--> <!--app-context-->

View File

@ -1,6 +1,6 @@
{ {
"name" : "crmeb", "name" : "crmeb",
"appid" : "__UNI__E8BDBA5", "appid" : "__UNI__B5A2217",
"description" : "crmeb商城", "description" : "crmeb商城",
"versionName" : "1.0.0", "versionName" : "1.0.0",
"versionCode" : 1001, "versionCode" : 1001,