Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CFFP-HB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chao Sun
CFFP-HB
Commits
e3fc0f40
Commit
e3fc0f40
authored
Apr 26, 2025
by
wenyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品详细页面浏览器打开时不需要分享,并且在没有登录的状态时默认游客登录
parent
898d6d66
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
4 deletions
+40
-4
pages/courseDetail/courseDetail.vue
+39
-4
util/router.js
+1
-0
No files found.
pages/courseDetail/courseDetail.vue
View file @
e3fc0f40
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<uni-popup-share
@
select=
"sharechange"
></uni-popup-share>
<uni-popup-share
@
select=
"sharechange"
></uni-popup-share>
</uni-popup>
</uni-popup>
</view>
</view>
<view
class=
""
style=
"width: 40rpx;height: 40rpx;padding-right: 20rpx;"
>
<view
v-if=
"isWxH5"
class=
""
style=
"width: 40rpx;height: 40rpx;padding-right: 20rpx;"
>
<image
class=
"image"
@
click=
"reinvite"
src=
"../../static/fastentry/Slice122.png"
mode=
""
></image>
<image
class=
"image"
@
click=
"reinvite"
src=
"../../static/fastentry/Slice122.png"
mode=
""
></image>
</view>
</view>
<view
class=
""
style=
"width: 40rpx;height: 40rpx; "
>
<view
class=
""
style=
"width: 40rpx;height: 40rpx; "
>
...
@@ -172,6 +172,7 @@
...
@@ -172,6 +172,7 @@
},
},
data
()
{
data
()
{
return
{
return
{
isWxH5
:
false
,
bannerViewType
:
'1'
,
bannerViewType
:
'1'
,
swiperList
:
[],
swiperList
:
[],
current
:
0
,
current
:
0
,
...
@@ -256,13 +257,30 @@
...
@@ -256,13 +257,30 @@
this
.
sharelogin
=
false
this
.
sharelogin
=
false
}
}
},
},
isWx_Miniprogram
(){
// 判断是否在微信内
// const ua = navigator.userAgent.toLowerCase();
// if (ua.includes('micromessenger') && window.__wxjs_environment === 'miniprogram') {
// this.isWxH5 = true;
// } else {
// this.isWxH5 = false;
// }
if
(
this
.
isWeiXin
()){
this
.
isWxH5
=
true
;
}
else
{
this
.
isWxH5
=
false
;
}
// #ifdef APP-PLUS
this
.
isWxH5
=
true
;
// #endif
},
/**
/**
* 判断是否为微信浏览器
* 判断是否为微信浏览器
* 兼容ios
* 兼容ios
* */
* */
//
isWeiXin() {
isWeiXin
()
{
//
return /micromessenger/i.test(navigator.userAgent.toLowerCase()) || typeof navigator.wxuserAgent !== 'undefined'
return
/micromessenger/i
.
test
(
navigator
.
userAgent
.
toLowerCase
())
||
typeof
navigator
.
wxuserAgent
!==
'undefined'
//
},
},
// openApp(url, callback) {
// openApp(url, callback) {
// let {isAndroid, isIOS, isIOS9} = judgePhoneType();
// let {isAndroid, isIOS, isIOS9} = judgePhoneType();
// if(this.isWeiXin()){
// if(this.isWeiXin()){
...
@@ -780,6 +798,21 @@
...
@@ -780,6 +798,21 @@
this
.
realName
=
res
.
data
.
realName
;
this
.
realName
=
res
.
data
.
realName
;
}
}
})
})
},
init
()
{
if
(
!
uni
.
getStorageSync
(
'isLogin'
))
{
api
.
loginVerification
({
"loginType"
:
1
}).
then
((
res
)
=>
{
if
(
res
[
'success'
])
{
this
.
userId
=
String
(
res
[
'data'
][
'userId'
]);
uni
.
setStorageSync
(
'isLogin'
,
'1'
);
uni
.
setStorageSync
(
'cffp_userId'
,
this
.
userId
);
uni
.
setStorageSync
(
'loginType'
,
'visitor'
);
uni
.
setStorageSync
(
'uni-token'
,
res
.
data
[
'token'
]);
}
})
}
}
}
},
},
onLoad
(
option
)
{
onLoad
(
option
)
{
...
@@ -814,6 +847,8 @@
...
@@ -814,6 +847,8 @@
},
},
onShow
()
{
onShow
()
{
//this.switchTab(1);
//this.switchTab(1);
this
.
init
();
this
.
isWx_Miniprogram
();
this
.
tabType
=
1
;
this
.
tabType
=
1
;
this
.
courseDetail
();
this
.
courseDetail
();
this
.
loginType
=
uni
.
getStorageSync
(
'loginType'
)
this
.
loginType
=
uni
.
getStorageSync
(
'loginType'
)
...
...
util/router.js
View file @
e3fc0f40
...
@@ -7,6 +7,7 @@ const whiteList = [
...
@@ -7,6 +7,7 @@ const whiteList = [
'/pages/orderDetail/orderDetail'
,
'/pages/orderDetail/orderDetail'
,
'/pages/courseDetail/courseDetail'
,
'/pages/courseDetail/courseDetail'
,
'/pages/courselist/courselist'
,
'/pages/courselist/courselist'
,
'/pages/index/index'
,
]
]
export
default
function
initApp
(){
export
default
function
initApp
(){
uni
.
addInterceptor
(
'navigateTo'
,
{
uni
.
addInterceptor
(
'navigateTo'
,
{
...
...
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