Merge branch 'dev1.0.0' into develop

msb_beta
ch 3 years ago
commit cc6c7ba01e

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-04-28 16:30:54 * @Date: 2022-04-28 16:30:54
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-04-28 17:00:54 * @LastEditTime: 2022-04-28 18:11:12
* @Description: file content * @Description: file content
*/ */
@ -24,8 +24,15 @@ export const ApiGetOpenId = ({code}) =>
ToAsyncAwait(MsbRequest.get(`${BASE_URL}/wx/mp/getOpenId/${APPID}`, {code})); ToAsyncAwait(MsbRequest.get(`${BASE_URL}/wx/mp/getOpenId/${APPID}`, {code}));
/** /**
* 获取支付参数 * 微信h5支付获取支付URL
* @param {*} data * @param {*} data
*/ */
export const ApiPostWxPay = (data) => export const ApiPostWxH5Pay = (data) =>
ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/pay/wxPay/h5`, data)); ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/pay/wxPay/h5`, data));
/**
* 微信JSAPI支付获取支付参数
* @param {*} data
*/
export const ApiPostWxJsApiPay = (data) =>
ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/pay/wxPay/jsapi`, data));

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-03-22 18:28:52 * @Date: 2022-03-22 18:28:52
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-04-28 16:45:47 * @LastEditTime: 2022-04-28 18:05:32
* @Description: file content * @Description: file content
*/ */
import Vue from 'vue' import Vue from 'vue'
@ -44,6 +44,9 @@ export default new Vuex.Store({
}, },
SET_SESSION_MSG_COUNT (state, data){ SET_SESSION_MSG_COUNT (state, data){
state.sessionMsgCount = data; state.sessionMsgCount = data;
},
SET_OPEN_ID (state, data){
state.openId = data;
} }
}, },
actions : { actions : {

@ -1,2 +1,2 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>马士兵严选</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) <!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>马士兵严选</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<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' : '') + '" />')</script><link rel=stylesheet href=/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.b5602bf5.js></script><script src=/static/js/index.6659aa56.js></script></body></html> document.write('<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' : '') + '" />')</script><link rel=stylesheet href=/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.b5602bf5.js></script><script src=/static/js/index.2586c214.js></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-03-20 14:14:53 * @Date: 2022-03-20 14:14:53
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-04-28 17:15:11 * @LastEditTime: 2022-04-28 18:18:30
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -81,7 +81,7 @@
<script> <script>
import UiCell from '@/components/UiCell'; import UiCell from '@/components/UiCell';
import {ApiPostSubmitOrder, ApiGetBeforeOrder, ApiGetBeforeCartOrder} from '@/common/api/order'; import {ApiPostSubmitOrder, ApiGetBeforeOrder, ApiGetBeforeCartOrder} from '@/common/api/order';
import { ApiPostWxPay } from '@/common/api/wx'; import { ApiPostWxH5Pay, ApiPostWxJsApiPay } from '@/common/api/wx';
import UiButton from '@/components/UiButton.vue'; import UiButton from '@/components/UiButton.vue';
import UiWhiteBox from '../../components/UiWhiteBox.vue'; import UiWhiteBox from '../../components/UiWhiteBox.vue';
export default { export default {
@ -181,14 +181,24 @@ export default {
} }
}, },
async wxpay(orderId){ async wxpay(orderId){
const ua = navigator.userAgent.toLowerCase(); const openId = this.$store.state.openId;
if(openId) {
if(ua.includes('micromessenger')) {
// JSAPI // JSAPI
const {error, result} = await ApiPostWxJsApiPay({orderId,openId});
if(error){
uni.$u.toast(error.message);
return false;
}
WeixinJSBridge.invoke('getBrandWCPayRequest', result.dataInfo, res => {
if(res.err_msg === 'get_brand_wcpay_request:cancel'){
this.$$Router.replace(`/payResult?orderId=${orderId}`);
}else{
this.$$Router.replace(`/orderDetail?id=${orderId}`);
}
})
}else{ }else{
// h5 // h5
const {error, result} = await ApiPostWxPay({orderId}); const {error, result} = await ApiPostWxH5Pay({orderId});
if(error){ if(error){
uni.$u.toast(error.message); uni.$u.toast(error.message);
return false; return false;

Loading…
Cancel
Save