Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
mongo-ui
Commits
68773159
Commit
68773159
authored
Aug 28, 2020
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 微信不支持location.href跳转
parent
ca054818
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
80 additions
and
6 deletions
+80
-6
App.vue
src/App.vue
+3
-0
detail.zhongan.yiwai.js
src/api/detail.zhongan.yiwai.js
+1
-1
openTip.png
src/assets/images/openTip.png
+0
-0
OpenBrowerTip.vue
src/components/OpenBrowerTip.vue
+50
-0
pay.js
src/service/pay.js
+9
-3
index.js
src/store/index.js
+7
-0
detailPay.mixin.js
src/views/Goods/Detail/modules/detailPay.mixin.js
+10
-2
No files found.
src/App.vue
View file @
68773159
...
...
@@ -12,6 +12,7 @@
<login-modal
/>
<auth-from-xyqb
v-if=
"showAuthXyqb !== -1"
/>
<net-error
/>
<open-brower-tip
/>
<public-popup
:value=
"isShowPublicPopup"
:title=
"publicPupopData.title"
...
...
@@ -27,11 +28,13 @@ import LoginModal from "@/components/LoginModal";
import
AuthFromXyqb
from
"
@/components/AuthFromXyqb
"
;
import
PopupWithIframe
from
"
@/components/PopupWithIframe
"
;
import
NetError
from
"
@/components/NetError
"
;
import
OpenBrowerTip
from
"
@/components/OpenBrowerTip
"
;
export
default
{
components
:
{
LoginModal
,
AuthFromXyqb
,
NetError
,
OpenBrowerTip
,
PublicPopup
:
PopupWithIframe
},
data
()
{
...
...
src/api/detail.zhongan.yiwai.js
View file @
68773159
...
...
@@ -4,7 +4,7 @@
* @Description:众安50万意外险
* @Date: 2020-07-27 15:46:37
* @LastEditors: gzw
* @LastEditTime: 2020-08-28
10:48:31
* @LastEditTime: 2020-08-28
20:10:36
*/
import
goodsBg
from
"
@/assets/images/goods/detail/yiwaixian/bg.png
"
;
import
title
from
"
@/assets/images/goods/detail/yiwaixian/title.png
"
;
...
...
src/assets/images/openTip.png
0 → 100644
View file @
68773159
20.9 KB
src/components/OpenBrowerTip.vue
0 → 100644
View file @
68773159
<
template
>
<cr-overlay
class=
"user-mask"
:show=
"isShowOpenBrower"
@
click=
"setIsShowOpenBrower(false)"
>
<cr-image
class=
"user-mask-image"
width=
"290px"
height=
"211px"
fit=
"cover"
src=
"@/assets/images/openTip.png"
/>
</cr-overlay>
</
template
>
<
script
>
import
{
mapState
,
mapActions
}
from
"
vuex
"
;
export
default
{
name
:
"
OpenBrowerTip
"
,
computed
:
{
...
mapState
([
"
isShowOpenBrower
"
])
},
methods
:
{
...
mapActions
([
"
setIsShowOpenBrower
"
])
}
};
</
script
>
<
style
lang=
"less"
scoped
>
.user-mask {
display: flex;
flex-direction: column;
justify-content: top;
align-items: flex-end;
padding: 20px 20px 0 0;
z-index: 101;
&-image {
margin-bottom: 10px;
}
&-title {
font-size: 15px;
line-height: 24px;
font-weight: 600;
color: #ffffff;
}
&-desc {
font-size: 20px;
line-height: 24px;
font-weight: 600;
color: #ffffff;
}
}
</
style
>
src/service/pay.js
View file @
68773159
...
...
@@ -2,7 +2,7 @@
* @Description: 支付微信h5, jsapi, 第三方收银台,跳转)
* @Date: 2020-07-28 15:03:52
* @LastEditors: gzw
* @LastEditTime: 2020-08-28
14:25:10
* @LastEditTime: 2020-08-28
21:19:45
*/
import
qs
from
"
qs
"
;
...
...
@@ -62,7 +62,10 @@ function payByWeixinH5(info) {
"
/payWaiting
"
+
qs
.
stringify
(
info
.
params
,
{
encode
:
true
,
addQueryPrefix
:
true
})
);
window
.
location
.
href
=
`
${
info
.
url
}
&redirect_url=
${
currentPath
}
`
;
// window.location.href = `${info.url}&redirect_url=${currentPath}`;
const
nextPage
=
document
.
createElement
(
"
a
"
);
nextPage
.
setAttribute
(
"
href
"
,
`
${
info
.
url
}
&redirect_url=
${
currentPath
}
`
);
nextPage
.
click
();
}
/**
...
...
@@ -81,7 +84,10 @@ function payByThirdPartyCashier(info) {
"
/payWaiting
"
+
qs
.
stringify
(
info
.
params
,
{
encode
:
true
,
addQueryPrefix
:
true
})
);
window
.
location
.
href
=
`
${
info
.
url
}
&redirect_uri=
${
currentPath
}
`
;
const
nextPage
=
document
.
createElement
(
"
a
"
);
nextPage
.
setAttribute
(
"
href
"
,
`
${
info
.
url
}
&redirect_uri=
${
currentPath
}
`
);
nextPage
.
click
();
// window.location.href = `${info.url}&redirect_uri=${currentPath}`;
}
/**
...
...
src/store/index.js
View file @
68773159
...
...
@@ -13,6 +13,7 @@ export default new Vuex.Store({
isShowLogin
:
false
,
isPayWait
:
false
,
isShowPublicPopup
:
false
,
isShowOpenBrower
:
false
,
publicPupopData
:
{
title
:
""
,
content
:
""
,
...
...
@@ -33,6 +34,9 @@ export default new Vuex.Store({
setIsPayWait
(
state
,
value
)
{
state
.
isPayWait
=
value
;
},
setIsShowOpenBrower
(
state
,
value
)
{
state
.
isShowOpenBrower
=
value
;
},
setAuthXyqb
(
state
,
value
)
{
state
.
showAuthXyqb
=
value
;
localStorage
.
set
(
"
xyqbAuthState
"
,
value
);
...
...
@@ -59,6 +63,9 @@ export default new Vuex.Store({
setIsPayWait
({
commit
},
args
)
{
commit
(
"
setIsPayWait
"
,
args
);
},
setIsShowOpenBrower
({
commit
},
args
)
{
commit
(
"
setIsShowOpenBrower
"
,
args
);
},
setAuthXyqb
({
commit
},
args
)
{
commit
(
"
setAuthXyqb
"
,
args
);
},
...
...
src/views/Goods/Detail/modules/detailPay.mixin.js
View file @
68773159
...
...
@@ -20,7 +20,7 @@ export default {
this
.
tradeType
=
this
.
customTradeType
??
(
isXyqb
?
"
MWEB
"
:
isWeixinBrower
?
"
JSAPI
"
:
"
MWEB
"
);
},
methods
:
{
...
mapActions
([
"
setIsLoading
"
,
"
setIsPayWait
"
]),
...
mapActions
([
"
setIsLoading
"
,
"
setIsPayWait
"
,
"
setIsShowOpenBrower
"
]),
async
generateOrder
(
detailType
)
{
this
.
setIsLoading
(
true
);
const
res
=
await
placeOrder
.
create
({
...
...
@@ -34,6 +34,7 @@ export default {
},
async
goPay
()
{
this
.
setIsLoading
(
false
);
// let isThird = false;
const
{
tradeType
,
orderInfo
,
openId
}
=
this
;
const
{
payOrderNo
,
payType
}
=
orderInfo
;
if
(
!
payOrderNo
)
{
...
...
@@ -61,7 +62,7 @@ export default {
state
:
1
}
};
}
else
if
(
tradeType
===
"
JSAPI
"
&&
!
res
.
pay
Info
.
payUrl
&&
!
res
.
payUrl
)
{
}
else
if
(
tradeType
===
"
JSAPI
"
&&
!
res
.
pay
Url
&&
res
.
payInfo
&&
!
res
.
payInfo
.
payUrl
)
{
payInfo
=
res
.
payInfo
;
}
else
{
payInfo
=
{
...
...
@@ -72,13 +73,20 @@ export default {
state
:
1
}
};
// isThird = true;
}
// if (isThird && isWeixinBrower) {
// this.setIsPayWait(false);
// this.setIsShowOpenBrower(true);
// return;
// }
payByWay
(
tradeType
,
payInfo
)
.
then
(()
=>
{
this
.
getPayResult
();
})
.
catch
(()
=>
{
console
.
log
(
"
h5支付
"
);
return
;
});
}
else
{
this
.
setIsPayWait
(
false
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment