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
aebb3153
Commit
aebb3153
authored
Sep 01, 2020
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 分享测试
parent
21687474
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
5 deletions
+52
-5
shareInfo.js
src/api/shareInfo.js
+2
-2
http.js
src/service/http.js
+3
-0
wxJsSdk.js
src/service/wxJsSdk.js
+31
-3
index.vue
src/views/Consultant/Buy/index.vue
+4
-0
CIIDetail.vue
src/views/Goods/Detail/CIIDetail.vue
+4
-0
LIDetail.vue
src/views/Goods/Detail/LIDetail.vue
+4
-0
MIDetail.vue
src/views/Goods/Detail/MIDetail.vue
+4
-0
No files found.
src/api/shareInfo.js
View file @
aebb3153
import
getWxShareInfo
from
"
@/service/wxJsSdk
"
;
import
{
setShare
}
from
"
@/service/wxJsSdk
"
;
const
currentOrigin
=
window
.
location
.
origin
+
"
/share.html?path=
"
;
const
currentOrigin
=
window
.
location
.
origin
+
"
/share.html?path=
"
;
const
logo
=
currentOrigin
+
"
/shareImg/index.png
"
;
const
logo
=
currentOrigin
+
"
/shareImg/index.png
"
;
const
shareList
=
{
const
shareList
=
{
...
@@ -102,6 +102,6 @@ export const getShare = to => {
...
@@ -102,6 +102,6 @@ export const getShare = to => {
}
}
const
_name
=
shareName
.
toLowerCase
();
const
_name
=
shareName
.
toLowerCase
();
if
(
shareList
[
_name
])
{
if
(
shareList
[
_name
])
{
getWxShareInfo
(
shareList
[
_name
]);
setShare
(
shareList
[
_name
]);
}
}
};
};
src/service/http.js
View file @
aebb3153
...
@@ -57,6 +57,9 @@ axios.interceptors.request.use(
...
@@ -57,6 +57,9 @@ axios.interceptors.request.use(
pending
[
config
.
url
](
"
取消重复请求
"
);
pending
[
config
.
url
](
"
取消重复请求
"
);
}
}
config
.
cancelToken
=
new
CancelToken
(
c
=>
(
pending
[
config
.
url
]
=
c
));
config
.
cancelToken
=
new
CancelToken
(
c
=>
(
pending
[
config
.
url
]
=
c
));
// ! 上线需要删掉
// eslint-disable-next-line
config
.
baseURL
=
baseUrl
||
config
.
baseURL
;
// 添加token
// 添加token
const
token
=
localStorage
.
get
(
"
mongoToken
"
);
const
token
=
localStorage
.
get
(
"
mongoToken
"
);
if
(
token
)
{
if
(
token
)
{
...
...
src/service/wxJsSdk.js
View file @
aebb3153
...
@@ -2,13 +2,22 @@
...
@@ -2,13 +2,22 @@
* @Description: weixin-js-sdk
* @Description: weixin-js-sdk
* @LastEditors: gzw
* @LastEditors: gzw
* @Date: 20120-08-30 18:40:11
* @Date: 20120-08-30 18:40:11
* @LastEditTime: 2020-09-01 1
5:31:27
* @LastEditTime: 2020-09-01 1
7:23:22
*/
*/
import
cfg
from
"
@/config/index
"
;
import
cfg
from
"
@/config/index
"
;
import
{
getwxAuth
}
from
"
@/api/user
"
;
import
{
getwxAuth
}
from
"
@/api/user
"
;
import
wx
from
"
weixin-js-sdk
"
;
import
wx
from
"
weixin-js-sdk
"
;
import
{
isWeixinBrower
}
from
"
@/service/validation
"
;
export
default
async
function
({
title
=
""
,
desc
=
""
,
link
=
window
.
location
.
href
,
imgUrl
=
""
})
{
import
localStorage
from
"
@/service/localStorage
"
;
/**
* @description: 微信分享
*/
export
async
function
setShare
({
title
=
""
,
desc
=
""
,
link
=
window
.
location
.
href
,
imgUrl
=
""
})
{
// console.log(title, desc, link, imgUrl);
// console.log(title, desc, link, imgUrl);
const
res
=
await
getwxAuth
({
const
res
=
await
getwxAuth
({
appId
:
cfg
.
wxAppId
,
appId
:
cfg
.
wxAppId
,
...
@@ -53,3 +62,22 @@ export default async function({ title = "", desc = "", link = window.location.hr
...
@@ -53,3 +62,22 @@ export default async function({ title = "", desc = "", link = window.location.hr
});
});
});
});
}
}
/**
* @description: 检查微信环境,分享进入,是否存在openid,否则重定向加载
*/
export
function
checkOpenId
()
{
const
openId
=
localStorage
.
get
(
"
openId
"
);
const
local
=
window
.
location
.
href
;
if
(
!
openId
&&
isWeixinBrower
)
{
window
.
location
.
href
=
"
https://open.weixin.qq.com/connect/oauth2/authorize?appid=
"
+
cfg
.
wxAppId
+
"
&redirect_uri=
"
+
encodeURIComponent
(
local
)
+
"
&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect
"
;
return
false
;
}
else
{
return
true
;
}
}
src/views/Consultant/Buy/index.vue
View file @
aebb3153
...
@@ -89,6 +89,7 @@ import Card from "@/components/Card";
...
@@ -89,6 +89,7 @@ import Card from "@/components/Card";
import
Collapse
from
"
@/components/Collapse
"
;
import
Collapse
from
"
@/components/Collapse
"
;
import
PayWaitLayer
from
"
@/components/PayWaitLayer
"
;
import
PayWaitLayer
from
"
@/components/PayWaitLayer
"
;
import
CpsQa
from
"
../../Goods/Detail/modules/CpsQA
"
;
import
CpsQa
from
"
../../Goods/Detail/modules/CpsQA
"
;
import
{
checkOpenId
}
from
"
@/service/wxJsSdk
"
;
const
SUM
=
300
;
const
SUM
=
300
;
export
default
{
export
default
{
name
:
"
ConsultantBuy
"
,
name
:
"
ConsultantBuy
"
,
...
@@ -227,6 +228,9 @@ export default {
...
@@ -227,6 +228,9 @@ export default {
methods
:
{
methods
:
{
...
mapActions
([
"
setIsShowLogin
"
]),
...
mapActions
([
"
setIsShowLogin
"
]),
checkLogin
()
{
checkLogin
()
{
if
(
!
checkOpenId
())
{
return
;
}
if
(
!
this
.
isLogin
)
{
if
(
!
this
.
isLogin
)
{
this
.
setIsShowLogin
(
true
);
this
.
setIsShowLogin
(
true
);
return
;
return
;
...
...
src/views/Goods/Detail/CIIDetail.vue
View file @
aebb3153
...
@@ -103,6 +103,7 @@ import Detail from "@/api/detail.huatai.zhongjixian";
...
@@ -103,6 +103,7 @@ import Detail from "@/api/detail.huatai.zhongjixian";
import
{
trail
,
list
}
from
"
@/api/product
"
;
import
{
trail
,
list
}
from
"
@/api/product
"
;
import
{
isIdNo
}
from
"
@/service/validation
"
;
import
{
isIdNo
}
from
"
@/service/validation
"
;
import
{
getRealAge
,
getBirthDate
}
from
"
@/service/utils
"
;
import
{
getRealAge
,
getBirthDate
}
from
"
@/service/utils
"
;
import
{
checkOpenId
}
from
"
@/service/wxJsSdk
"
;
export
default
{
export
default
{
name
:
"
GoodsDetail-CII
"
,
name
:
"
GoodsDetail-CII
"
,
...
@@ -251,6 +252,9 @@ export default {
...
@@ -251,6 +252,9 @@ export default {
this
.
$notify
({
type
:
"
warn
"
,
message
:
"
被保人年龄不在可投保范围,请仔细核对
"
});
this
.
$notify
({
type
:
"
warn
"
,
message
:
"
被保人年龄不在可投保范围,请仔细核对
"
});
return
;
return
;
}
}
if
(
!
checkOpenId
())
{
return
;
}
if
(
localStorage
.
get
(
"
mongoToken
"
))
{
if
(
localStorage
.
get
(
"
mongoToken
"
))
{
this
.
$refs
.
insureForm
.
getFamilyList
(
true
).
then
(()
=>
{
this
.
$refs
.
insureForm
.
getFamilyList
(
true
).
then
(()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
...
src/views/Goods/Detail/LIDetail.vue
View file @
aebb3153
...
@@ -128,6 +128,7 @@ import detailLoginMixin from "./modules/detailLogin.mixin";
...
@@ -128,6 +128,7 @@ import detailLoginMixin from "./modules/detailLogin.mixin";
import
Detail
from
"
@/api/detail.huagui.shouxian
"
;
import
Detail
from
"
@/api/detail.huagui.shouxian
"
;
import
{
trail
,
list
}
from
"
@/api/product
"
;
import
{
trail
,
list
}
from
"
@/api/product
"
;
import
{
checkOpenId
}
from
"
@/service/wxJsSdk
"
;
export
default
{
export
default
{
name
:
"
GoodsDetail-LI
"
,
name
:
"
GoodsDetail-LI
"
,
...
@@ -236,6 +237,9 @@ export default {
...
@@ -236,6 +237,9 @@ export default {
// this.currentPupopIndex = 6;
// this.currentPupopIndex = 6;
// return;
// return;
// }
// }
if
(
!
checkOpenId
())
{
return
;
}
this
.
showLoginPopup
();
this
.
showLoginPopup
();
this
.
popupShow
=
false
;
this
.
popupShow
=
false
;
},
},
...
...
src/views/Goods/Detail/MIDetail.vue
View file @
aebb3153
...
@@ -102,6 +102,7 @@ import localStorage from "@/service/localStorage";
...
@@ -102,6 +102,7 @@ import localStorage from "@/service/localStorage";
import
{
getRealAge
,
getBirthDate
}
from
"
@/service/utils
"
;
import
{
getRealAge
,
getBirthDate
}
from
"
@/service/utils
"
;
import
Detail
from
"
@/api/detail.taikang.yiliaobaozhang
"
;
import
Detail
from
"
@/api/detail.taikang.yiliaobaozhang
"
;
import
{
isIdNo
}
from
"
@/service/validation
"
;
import
{
isIdNo
}
from
"
@/service/validation
"
;
import
{
checkOpenId
}
from
"
@/service/wxJsSdk
"
;
let
socialSecurityCache
=
""
;
let
socialSecurityCache
=
""
;
export
default
{
export
default
{
...
@@ -234,6 +235,9 @@ export default {
...
@@ -234,6 +235,9 @@ export default {
this
.
$notify
({
type
:
"
warning
"
,
message
:
"
被保人年龄不在可投保范围,请仔细核对
"
});
this
.
$notify
({
type
:
"
warning
"
,
message
:
"
被保人年龄不在可投保范围,请仔细核对
"
});
return
;
return
;
}
}
if
(
!
checkOpenId
())
{
return
;
}
if
(
localStorage
.
get
(
"
mongoToken
"
))
{
if
(
localStorage
.
get
(
"
mongoToken
"
))
{
socialSecurityCache
=
this
.
formData
.
socialSecurity
;
socialSecurityCache
=
this
.
formData
.
socialSecurity
;
this
.
$refs
.
insureForm
.
getFamilyList
(
true
).
then
(()
=>
{
this
.
$refs
.
insureForm
.
getFamilyList
(
true
).
then
(()
=>
{
...
...
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