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
d8e8eb1b
Commit
d8e8eb1b
authored
Aug 26, 2020
by
郝聪敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 切换微信号清空缓存、支付成功流程bug解决
parent
36cfb01a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
21 deletions
+20
-21
index.js
src/router/index.js
+4
-1
detailPay.mixin.js
src/views/Goods/Detail/modules/detailPay.mixin.js
+16
-1
policyStatus.mixin.js
src/views/Policy/mixin/policyStatus.mixin.js
+0
-19
No files found.
src/router/index.js
View file @
d8e8eb1b
...
...
@@ -57,8 +57,11 @@ async function getAuthInfo(xyqbToken) {
}
async
function
getWxOpenId
(
code
)
{
if
(
localStorage
.
get
(
"
openId
"
))
return
;
// code只能用一次
if
(
!
code
||
code
===
sessionStorage
.
getItem
(
"
latestCode
"
))
return
;
sessionStorage
.
setItem
(
"
latestCode
"
,
code
);
const
res
=
await
getwxOpenId
({
code
,
appId
:
cfg
.
wxAppId
});
// 切换账号时清除缓存
if
(
localStorage
.
get
(
"
openId
"
)
&&
res
.
openId
!==
localStorage
.
get
(
"
openId
"
))
{
console
.
log
(
"
切换账号
"
);
localStorage
.
clear
();
...
...
src/views/Goods/Detail/modules/detailPay.mixin.js
View file @
d8e8eb1b
import
{
payByWay
}
from
"
@/service/pay
"
;
import
{
isXyqb
,
isWeixinBrower
}
from
"
@/service/validation
"
;
import
{
placeOrder
}
from
"
@/api/product
"
;
import
{
getPolicyDetail
}
from
"
@/api/policy
"
;
import
localStorage
from
"
@/service/localStorage
"
;
import
{
mapActions
}
from
"
vuex
"
;
...
...
@@ -81,7 +82,7 @@ export default {
},
getPayResult
()
{
const
{
payOrderNo
,
orderNo
}
=
this
.
orderInfo
;
placeOrder
.
polling
({
payOrderNo
,
payOrderType
:
1
}).
then
(
payRes
=>
{
placeOrder
.
polling
({
payOrderNo
,
payOrderType
:
1
}).
then
(
async
payRes
=>
{
if
(
!
payRes
.
result
&&
payRes
.
payState
===
2
)
{
this
.
payTimer
=
setTimeout
(()
=>
{
this
.
getPayResult
();
...
...
@@ -89,13 +90,27 @@ export default {
}
else
{
this
.
setIsPayWait
(
false
);
this
.
setIsLoading
(
false
);
// 保单详情页支付需重新调用保单接口
if
(
this
.
$route
.
name
===
"
PolicyDetail
"
)
{
this
.
getPolicy
();
return
;
}
// 根据状态跳转页面
const
status
=
await
this
.
getPolicyStatus
(
orderNo
);
if
([
"
6.2-3
"
,
"
6.1-3
"
].
includes
(
status
))
{
this
.
$router
.
replace
(
`/policy/success/
${
orderNo
}
`
);
return
;
}
this
.
$router
.
replace
({
path
:
"
/policy/detail/
"
+
orderNo
});
}
});
},
async
getPolicyStatus
(
orderNo
)
{
const
policy
=
await
getPolicyDetail
(
orderNo
);
return
policy
?.
payState
?
`
${
policy
?.
policyState
}
-
$
{
policy
?.
payState
}
`
: String(policy?.policyState);
}
}
};
src/views/Policy/mixin/policyStatus.mixin.js
View file @
d8e8eb1b
...
...
@@ -4,11 +4,6 @@ import { parseTime } from "@/service/utils";
import
GOODS_LIST
from
"
@/api/goodsList.mock
"
;
export
default
{
data
()
{
return
{
isFromPay
:
false
};
},
methods
:
{
getData
(
policy
)
{
const
key
=
this
.
findKey
(
policy
);
...
...
@@ -50,12 +45,6 @@ export default {
value
.
contend
=
`保障期限:
${
policyPeriod
.
label
}
`
;
}
// 校验是否支付成功
const
status
=
this
.
getStatus
(
policy
);
if
([
"
6.2-3
"
,
"
6.1-3
"
].
includes
(
status
)
&&
this
.
isFromPay
)
{
this
.
$router
.
replace
(
`/policy/success/
${
this
.
$route
.
params
.
orderNo
}
`
);
}
return
{
...
policy
,
...
_
.
find
(
GOODS_LIST
,
{
id
:
policy
?.
productNo
}),
...
...
@@ -77,13 +66,5 @@ export default {
..._.find(GOODS_LIST, { id: policy?.productNo })
};
}
},
beforeRouteEnter(to, from, next) {
next(vm => {
const prePath = ["/goods/inform", "/goods/detail", "/policy/add"];
if (prePath.includes(from.path)) {
vm.isFromPay = true;
}
});
}
};
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