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
13a8f693
Commit
13a8f693
authored
Jun 24, 2025
by
yuzhenWang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
兼容ipad样式
parent
6b6bae6f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
31 deletions
+86
-31
components/search/search.vue
+1
-1
pages/courselist/courselist.vue
+17
-30
util/dataHandling.ts
+68
-0
No files found.
components/search/search.vue
View file @
13a8f693
...
@@ -114,7 +114,7 @@
...
@@ -114,7 +114,7 @@
padding
:
0
15
rpx
;
padding
:
0
15
rpx
;
.searchInput{
.searchInput{
margin-left
:
20
rpx
;
margin-left
:
20
rpx
;
width
:
85
%
;
width
:
100
%
;
padding
:
15
rpx
;
padding
:
15
rpx
;
color
:
#fff
;
color
:
#fff
;
font-size
:
26
rpx
;
font-size
:
26
rpx
;
...
...
pages/courselist/courselist.vue
View file @
13a8f693
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
</view>
</view>
</view>
</view>
<view
class=
"productBox"
>
<view
class=
"productBox"
>
<view
class=
"productList"
>
<view
class=
"productList"
:style=
"
{marginTop}"
>
<view
class=
"productItem"
v-for=
"item in cffpCourseInfos"
:key=
"item.fileId"
>
<view
class=
"productItem"
v-for=
"item in cffpCourseInfos"
:key=
"item.fileId"
>
<view
class=
"top"
@
click=
"goDetail(item)"
>
<view
class=
"top"
@
click=
"goDetail(item)"
>
<view
class=
"left"
>
<view
class=
"left"
>
...
@@ -82,31 +82,7 @@
...
@@ -82,31 +82,7 @@
</view>
</view>
</view>
</view>
</view>
</view>
<!--搜索组件-->
<!--
<search
:isSearch=
"1"
:userId =
"userId"
@
send=
"getCourseList"
:initialQuery=
"queryName"
></search>
-->
<!--轮播组件-->
<!--
<view
class=
"banner"
>
<view
class=
"uni-margin-wrap"
>
<carousel
:carouselList=
"fileUploadItemCFFPList"
></carousel>
</view>
</view>
-->
<!--
<h4
v-if=
"cffpCourseInfos.length
<
=
0
"
class=
"noListTip"
>
暂无产品列表
</h4>
<view
class=
"ulBox"
v-if=
"cffpCourseInfos.length>0"
>
<view
class=
"liBox"
v-for=
"item in cffpCourseInfos"
:key=
"item.fileId"
@
click=
"goDetail(item)"
>
<course-item
:thumbnailPath=
"item.displayImage"
:title=
"item.fileTitle"
:summaryBox=
"item.fileSynopsis"
:dataList=
"
{coursePrice:item.coursePrice,salesNumber:item.salesNumber}"
>
</course-item>
</view>
</view>
-->
</view>
</view>
<!--
<tabBar
:currentPage=
"currentPage"
v-if=
"onlyShowList!=0"
></tabBar>
-->
<!--
<tabBar
:currentPage=
"currentPage"
v-if=
"onlyShowList!=0"
></tabBar>
-->
</
template
>
</
template
>
...
@@ -136,7 +112,8 @@
...
@@ -136,7 +112,8 @@
userId
:
uni
.
getStorageSync
(
'cffp_userId'
),
userId
:
uni
.
getStorageSync
(
'cffp_userId'
),
runEnv
:
dataHandling
.
getRuntimeEnv
(),
//运行的环境 browser、app、h5
runEnv
:
dataHandling
.
getRuntimeEnv
(),
//运行的环境 browser、app、h5
shareTipsFlag
:
false
,
shareTipsFlag
:
false
,
sourceType
:
'1'
,
//根据来源展示二维码 默认是cffp
sourceType
:
'1'
,
//根据来源展示二维码 默认是cffp,
env
:
dataHandling
.
getRuntimeEnv2
()
}
}
},
},
name
:
'courselist'
,
name
:
'courselist'
,
...
@@ -156,6 +133,15 @@
...
@@ -156,6 +133,15 @@
this
.
courseList
();
this
.
courseList
();
this
.
sourceType
=
uni
.
getStorageSync
(
'addSystemType'
)
||
'1'
;
this
.
sourceType
=
uni
.
getStorageSync
(
'addSystemType'
)
||
'1'
;
},
},
computed
:{
marginTop
(){
if
(
this
.
env
.
device
.
isMobile
){
return
'-5%'
}
else
{
return
'-1.5%'
}
}
},
methods
:{
methods
:{
gotoShare
(
item
){
gotoShare
(
item
){
if
(
this
.
runEnv
==
'browser'
){
if
(
this
.
runEnv
==
'browser'
){
...
@@ -362,7 +348,7 @@
...
@@ -362,7 +348,7 @@
.productList{
.productList{
width
:
100%
;
width
:
100%
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
margin-top
:
-7
%
;
//
margin-top
:
-2
%
;
background-color
:
#fff
;
background-color
:
#fff
;
padding
:
20
rpx
;
padding
:
20
rpx
;
border-radius
:
10
rpx
;
border-radius
:
10
rpx
;
...
@@ -431,8 +417,9 @@
...
@@ -431,8 +417,9 @@
}
}
.right
{
.right
{
//
display
:
flex
;
display
:
flex
;
//
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
padding
:
15
rpx
10
rpx
15
rpx
15
rpx
;
padding
:
15
rpx
10
rpx
15
rpx
15
rpx
;
background
:
rgba
(
36
,
37
,
137
,
1
);
background
:
rgba
(
36
,
37
,
137
,
1
);
width
:
20%
;
width
:
20%
;
...
...
util/dataHandling.ts
View file @
13a8f693
...
@@ -205,5 +205,72 @@ export default{
...
@@ -205,5 +205,72 @@ export default{
console
.
warn
(
'环境判断失败:'
,
e
);
console
.
warn
(
'环境判断失败:'
,
e
);
return
'unknown'
;
return
'unknown'
;
}
}
},
/**
* 判断当前运行环境
* @returns {Object} 包含环境信息的对象
*/
getRuntimeEnv2
()
{
// 获取uni-app系统信息
const
systemInfo
=
uni
.
getSystemInfoSync
()
// 判断平台类型
const
isH5
=
systemInfo
.
platform
===
'h5'
const
isApp
=
systemInfo
.
platform
===
'android'
||
systemInfo
.
platform
===
'ios'
const
isMP
=
systemInfo
.
platform
===
'mp-weixin'
// 微信小程序
// 判断设备类型
let
isMobile
=
false
let
isTablet
=
false
let
isDesktop
=
false
// 在H5环境下需要额外判断
if
(
isH5
)
{
// 通过userAgent判断
const
userAgent
=
navigator
.
userAgent
.
toLowerCase
()
const
isMobileUserAgent
=
/mobile|android|iphone|ipad|ipod/
.
test
(
userAgent
)
// 通过屏幕尺寸判断
const
isSmallScreen
=
window
.
innerWidth
<
768
// 在开发环境下,如果浏览器开启了手机模拟器模式,也认为是手机
isMobile
=
isMobileUserAgent
||
isSmallScreen
// 平板判断
isTablet
=
!
isMobile
&&
(
systemInfo
.
windowWidth
>=
768
&&
systemInfo
.
windowWidth
<
992
)
// 桌面判断
isDesktop
=
!
isMobile
&&
!
isTablet
return
}
else
{
// 非H5环境使用uni-app提供的信息
isMobile
=
systemInfo
.
deviceType
===
'phone'
isTablet
=
systemInfo
.
deviceType
===
'pad'
isDesktop
=
false
// 非H5环境下不会有桌面端
}
return
{
// 平台类型
platform
:
{
isH5
,
isApp
,
isMP
,
isWeixin
:
isMP
,
// 微信小程序别名
isAndroid
:
systemInfo
.
platform
===
'android'
,
isIOS
:
systemInfo
.
platform
===
'ios'
,
},
// 设备类型
device
:
{
isMobile
,
isTablet
,
isDesktop
,
isIPhone
:
systemInfo
.
model
&&
systemInfo
.
model
.
includes
(
'iPhone'
),
isIPad
:
systemInfo
.
model
&&
systemInfo
.
model
.
includes
(
'iPad'
),
},
// 原始系统信息
systemInfo
,
}
}
}
}
}
\ No newline at end of file
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