Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
intel_promotion_uniapp
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘怀志
intel_promotion_uniapp
Commits
c5bcb5a7
Commit
c5bcb5a7
authored
Jun 21, 2024
by
杨硕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接接口
parent
d8940d5d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
540 additions
and
126 deletions
+540
-126
pages.json
pages.json
+21
-4
detail.vue
pages/myArticle/detail.vue
+56
-0
index.vue
pages/myArticle/index.vue
+50
-9
detail.vue
pages/myVedio/detail.vue
+67
-0
index.vue
pages/myVedio/index.vue
+53
-45
index.vue
pages/shop/index.vue
+144
-54
index.vue
pages/sort/index.vue
+111
-14
jsencrypt.js
store/jsencrypt.js
+38
-0
No files found.
pages.json
View file @
c5bcb5a7
...
...
@@ -13,7 +13,9 @@
"pages"
:
[{
"path"
:
"pages/shop/index"
,
"style"
:
{}
"style"
:
{
"onReachBottomDistance"
:
80
//开启触底加载
}
},
{
"path"
:
"pages/shop/search"
,
"style"
:
{
...
...
@@ -48,12 +50,26 @@
{
"path"
:
"pages/myArticle/index"
,
"style"
:
{
"navigationBarTitleText"
:
"我的文章"
"navigationBarTitleText"
:
"我的文章"
,
"onReachBottomDistance"
:
80
}
},
{
"path"
:
"pages/myArticle/detail"
,
"style"
:
{
"navigationBarTitleText"
:
"文章详情"
}
},{
"path"
:
"pages/myVedio/index"
,
"style"
:
{
"navigationBarTitleText"
:
"我的视频"
"navigationBarTitleText"
:
"我的视频"
,
"onReachBottomDistance"
:
80
}
},
{
"path"
:
"pages/myVedio/detail"
,
"style"
:
{
"navigationBarTitleText"
:
"视频详情"
}
},
{
...
...
@@ -112,7 +128,8 @@
"style"
:
{
"navigationBarTitleText"
:
"分类"
,
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
,
"onReachBottomDistance"
:
80
//开启触底加载
}
},{
...
...
pages/myArticle/detail.vue
0 → 100644
View file @
c5bcb5a7
<
template
>
<view
class=
"top"
>
<view
class=
"title"
>
{{
articleInfo
.
title
}}
</view>
<view
class=
"date"
>
{{
articleInfo
.
releaseDate
}}
</view>
<view
class=
"detail"
>
<view
v-html=
"articleInfo.details"
></view>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
businessId
:
''
,
articleInfo
:
{}
}
},
onLoad
(
option
)
{
this
.
businessId
=
option
.
businessId
this
.
init
()
},
methods
:
{
init
(){
this
.
$u
.
get
(
'/cmsnews/detail/'
+
this
.
businessId
).
then
(
res
=>
{
this
.
articleInfo
=
res
console
.
log
(
"this.articleInfo"
,
this
.
articleInfo
);
// 处理图片样式问题
this
.
articleInfo
.
details
=
res
.
details
.
replace
(
/\<img/gi
,
'<img style="max-width:100%;height:auto;border-radius: 12px 12px 12px 12px;" '
)
})
}
}
}
</
script
>
<
style
>
.top
{
background-color
:
#F6F6F6
;
min-height
:
100vh
;
padding
:
26
rpx
;
}
.title
{
width
:
100%
;
font-size
:
40
rpx
;
color
:
#000000
;
font-weight
:
bold
;
margin-bottom
:
30
rpx
;
}
.date
{
margin-bottom
:
30
rpx
;
}
.detail
{
}
</
style
>
\ No newline at end of file
pages/myArticle/index.vue
View file @
c5bcb5a7
<
template
>
<view
class=
"top"
>
<view
v-if=
"hotList.length > 0"
>
<view
v-for=
"(item,index) in hotList"
:key=
"index"
class=
"indexcard"
>
<image
class=
"cardimage"
:src=
"item.path"
@
click=
"toDetail(item.
i
d)"
></image>
<view
class=
"cardtitle"
@
click=
"toDetail(item.
i
d)"
>
<image
class=
"cardimage"
:src=
"item.path"
@
click=
"toDetail(item.
businessI
d)"
></image>
<view
class=
"cardtitle"
@
click=
"toDetail(item.
businessI
d)"
>
<view
class=
"cardtitle1"
>
{{
item
.
title
}}
</view>
<view
class=
"cardtitle2"
>
{{
item
.
details
.
replace
(
/<
[^
>
]
*>/g
,
''
)
}}
</view>
<!--
<view
class=
"cardtitle3"
>
¥
{{
formatPrice
(
item
.
price
)
}}
</view>
-->
</view>
</view>
<u-loadmore
:status=
"articleStatus"
/>
</view>
<view
v-else
style=
"margin-top: 200rpx;"
>
<u-empty
mode=
"data"
>
</u-empty>
</view>
</view>
</
template
>
...
...
@@ -15,7 +25,11 @@
export
default
{
data
()
{
return
{
hotList
:
[]
hotList
:
[],
page
:
1
,
rows
:
5
,
total
:
0
,
articleStatus
:
"loadmore"
}
},
onLoad
()
{
...
...
@@ -23,17 +37,44 @@
},
methods
:
{
init
(){
this
.
articleStatus
=
this
.
page
*
this
.
rows
>=
this
.
total
?
'nomore'
:
'loadmore'
const
unitList
=
this
.
vuex_unit
this
.
$u
.
get
(
'cmsnews/miniProgram/listByClassification?page=1&rows=10&unitId='
+
unitList
[
0
].
businessId
).
then
(
res
=>
{
const
videoChild
=
res
.
records
this
.
hotList
=
videoChild
this
.
$u
.
get
(
'cmsnews/miniProgram/listByClassification?page='
+
this
.
page
+
'&rows='
+
this
.
rows
+
'&unitId='
+
unitList
[
0
].
businessId
).
then
(
res
=>
{
if
(
this
.
page
===
1
)
{
let
list
=
res
.
records
;
this
.
hotList
=
list
;
this
.
total
=
res
.
total
}
else
{
let
list1
=
res
.
records
;
this
.
hotList
=
[...
this
.
hotList
,
...
list1
]
}
})
},
toDetail
(
id
){
this
.
$u
.
route
({
url
:
'pages/myArticle/detail'
,
params
:
{
businessId
:
id
}
})
}
}
},
// 触底事件 - 上拉加载
onReachBottom
()
{
console
.
log
(
"触底加载"
);
// 加判断: 页码数 * 每一页获取数据的条数 >= 总条数,如果符合条件说明数据已经全部加载完毕
let
that
=
this
if
(
that
.
page
*
that
.
rows
>=
that
.
total
)
{
that
.
articleStatus
=
"nomore"
return
}
else
{
that
.
articleStatus
=
"loading"
that
.
page
++
// 每触发一次触底事件,页码加1
that
.
init
()
}
}
}
</
script
>
...
...
pages/myVedio/detail.vue
0 → 100644
View file @
c5bcb5a7
<
template
>
<view
class=
"top"
>
<view
class=
"title"
>
{{
videoInfo
.
videoTitle
}}
</view>
<view
class=
"date"
>
{{
videoInfo
.
releaseTime
}}
</view>
<view
class=
"detail"
>
<!--
<view
v-html=
"videoInfo.details"
></view>
-->
<video
style=
"width: 100%;"
id=
"myVideo"
:src=
"videoUrl"
controls
></video>
</view>
</view>
</
template
>
<
script
>
import
{
urlDecrypt
}
from
'@/store/jsencrypt.js'
export
default
{
data
()
{
return
{
businessId
:
''
,
videoInfo
:
{},
videoUrl
:
''
}
},
onLoad
(
option
)
{
this
.
businessId
=
option
.
businessId
this
.
init
()
},
onReady
:
function
(
res
)
{
// #ifndef MP-ALIPAY
this
.
videoContext
=
uni
.
createVideoContext
(
'myVideo'
)
// #endif
},
methods
:
{
init
(){
this
.
$u
.
get
(
'/cmsvideo/detail/'
+
this
.
businessId
).
then
(
res
=>
{
this
.
videoInfo
=
res
console
.
log
(
"this.videoInfo"
,
this
.
videoInfo
);
if
(
res
.
videoUrlId
!=
null
&&
res
.
videoUrlId
!=
''
){
this
.
$u
.
get
(
'/cmsvideo/getVideoUrl?videoUrlId='
+
res
.
videoUrlId
).
then
(
item
=>
{
this
.
videoUrl
=
urlDecrypt
(
item
.
path
)
console
.
log
(
"视频地址"
,
this
.
videoUrl
);
})
}
})
}
}
}
</
script
>
<
style
>
.top
{
background-color
:
#F6F6F6
;
min-height
:
100vh
;
padding
:
26
rpx
;
}
.title
{
width
:
100%
;
font-size
:
40
rpx
;
color
:
#000000
;
font-weight
:
bold
;
margin-bottom
:
30
rpx
;
}
.date
{
margin-bottom
:
30
rpx
;
}
.detail
{
border
:
1px
#000000
;
}
</
style
>
\ No newline at end of file
pages/myVedio/index.vue
View file @
c5bcb5a7
<
template
>
<view
class=
"top"
>
<view
v-if=
"hotList.length>0"
>
<view
v-for=
"(item,index) in hotList"
:key=
"index"
class=
"indexcard"
>
<image
class=
"cardimage"
:src=
"item.path"
@
click=
"toDetail(item.
i
d)"
></image>
<view
class=
"cardtitle"
@
click=
"toDetail(item.
i
d)"
>
<image
class=
"cardimage"
:src=
"item.path"
@
click=
"toDetail(item.
businessI
d)"
></image>
<view
class=
"cardtitle"
@
click=
"toDetail(item.
businessI
d)"
>
<view
class=
"cardtitle1"
>
{{
item
.
videoTitle
}}
</view>
<!--
<view
class=
"cardtitle2"
>
{{
item
.
details
.
replace
(
/<
[^
>
]
*>/g
,
''
)
}}
</view>
-->
<!--
<view
class=
"cardtitle3"
>
¥
{{
formatPrice
(
item
.
price
)
}}
</view>
-->
</view>
</view>
<!--
<view>
<video
id=
"myVideo"
src=
"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4"
@
error=
"videoErrorCallback"
controls
></video>
</view>
-->
<u-loadmore
:status=
"status"
/>
</view>
<view
v-else
style=
"margin-top: 200rpx;"
>
<u-empty
mode=
"data"
>
</u-empty>
</view>
</view>
</
template
>
...
...
@@ -22,39 +26,15 @@
export
default
{
data
()
{
return
{
hotList
:
[
{
'title'
:
'11111'
,
'details'
:
'1111'
,
'path'
:
'http://106.3.99.36:20083/intelServer/newInformation/20240607/C866A367676C45E79A1776ED34F6722A.png'
},
{
'title'
:
'11111'
,
'details'
:
'1111'
,
'path'
:
'http://106.3.99.36:20083/intelServer/newInformation/20240607/C866A367676C45E79A1776ED34F6722A.png'
},
{
'title'
:
'11111'
,
'details'
:
'1111'
,
'path'
:
'http://106.3.99.36:20083/intelServer/newInformation/20240607/C866A367676C45E79A1776ED34F6722A.png'
},
{
'title'
:
'11111'
,
'details'
:
'1111'
,
'path'
:
'http://106.3.99.36:20083/intelServer/newInformation/20240607/C866A367676C45E79A1776ED34F6722A.png'
},
{
'title'
:
'11111'
,
'details'
:
'1111'
,
'path'
:
'http://106.3.99.36:20083/intelServer/newInformation/20240607/C866A367676C45E79A1776ED34F6722A.png'
}
],
src
:
'http://vjs.zencdn.net/v/oceans.mp4'
,
// 视频地址
controls
:
true
,
// 是否显示控制条
autoplay
:
false
,
// 是否自动播放
}
hotList
:
[],
page
:
1
,
rows
:
10
,
total
:
0
,
status
:
"loadmore"
}
},
on
Load
()
{
on
Show
()
{
this
.
init
()
},
onReady
:
function
(
res
)
{
...
...
@@ -64,17 +44,45 @@
},
methods
:
{
init
(){
this
.
status
=
this
.
page
*
this
.
rows
>=
this
.
total
?
'nomore'
:
'loadmore'
const
unitList
=
this
.
vuex_unit
this
.
$u
.
get
(
'cmsvideo/miniProgram/listByClassification?page=1&rows=10&unitId='
+
unitList
[
0
].
businessId
).
then
(
res
=>
{
const
videoChild
=
res
.
records
this
.
hotList
=
videoChild
if
(
this
.
page
===
1
)
{
let
list
=
res
.
records
;
this
.
hotList
=
list
;
this
.
total
=
res
.
total
}
else
{
let
list1
=
res
.
records
;
this
.
hotList
=
[...
this
.
hotList
,
...
list1
]
}
})
},
toDetail
(
id
){
this
.
$u
.
route
({
url
:
'pages/myVedio/detail'
,
params
:
{
businessId
:
id
}
})
}
}
},
// 触底事件 - 上拉加载
onReachBottom
()
{
console
.
log
(
"触底加载"
);
// 加判断: 页码数 * 每一页获取数据的条数 >= 总条数,如果符合条件说明数据已经全部加载完毕
let
that
=
this
if
(
that
.
page
*
that
.
rows
>=
that
.
total
)
{
that
.
status
=
"nomore"
return
}
else
{
that
.
status
=
"loading"
that
.
page
++
// 每触发一次触底事件,页码加1
that
.
init
()
}
}
}
...
...
pages/shop/index.vue
View file @
c5bcb5a7
...
...
@@ -5,25 +5,59 @@
<u-col
style=
"padding:0px;"
v-for=
"(topic,index) in topicList"
:key=
"index"
:span=
"(index+3)%3===0?12:6"
>
<view
class=
"topimage"
>
<!--
<u-image
width=
"100%"
height=
"274rpx"
:src=
"topic.img"
@
click=
"toTopic(topic.id)"
></u-image>
-->
<image
:src=
"topic.url"
@
click=
"toTopic(topic.id)"
class=
"imagedeatil"
></image>
<image
:src=
"topic.url"
class=
"imagedeatil"
></image>
</view>
</u-col>
</u-row>
<view
style=
"padding-bottom: 30rpx;"
>
<view
class=
"gl-title"
>
<view
style=
"height: 35px;display: flex;align-items: center;"
>
<image
src=
"../../static/img/image/home_icon_remen@2x.png"
class=
"smallicon"
></image>
<span>
热门推荐
</span>
</view>
<view>
<view
style=
"width: 40%;"
>
<u-subsection
:list=
"list"
:current=
"curNow"
@
change=
"sectionChange"
></u-subsection>
</view>
</view>
<view
v-if=
"curNow === 0 && hotList.length > 0"
>
<view
v-for=
"(item,index) in hotList"
:key=
"index"
class=
"indexcard"
>
<image
class=
"cardimage"
:src=
"item.path"
@
click=
"toDetail(item.
i
d)"
></image>
<view
class=
"cardtitle"
@
click=
"toDetail(item.
i
d)"
>
<image
class=
"cardimage"
:src=
"item.path"
@
click=
"toDetail(item.
businessI
d)"
></image>
<view
class=
"cardtitle"
@
click=
"toDetail(item.
businessI
d)"
>
<view
class=
"cardtitle1"
>
{{
item
.
title
}}
</view>
<view
class=
"cardtitle2"
>
{{
item
.
details
.
replace
(
/<
[^
>
]
*>/g
,
''
)
}}
</view>
<!--
<view
class=
"cardtitle3"
>
¥
{{
formatPrice
(
item
.
price
)
}}
</view>
-->
</view>
</view>
<u-loadmore
:status=
"articleStatus"
/>
</view>
<view
v-else-if=
"curNow === 0 && hotList.length
<
=
0
"
style=
"margin-top: 200rpx;"
>
<u-empty
mode=
"data"
>
</u-empty>
</view>
<view
v-else-if=
"curNow === 1 && newList.length > 0"
>
<view
v-for=
"(item,index) in newList"
:key=
"index"
class=
"indexcard"
>
<image
class=
"cardimage"
:src=
"item.path"
@
click=
"toDetail(item.businessId)"
></image>
<view
class=
"cardtitle"
@
click=
"toDetail(item.businessId)"
>
<view
class=
"cardtitle1"
>
{{
item
.
videoTitle
}}
</view>
<!--
<view
class=
"cardtitle2"
>
{{
item
.
details
.
replace
(
/<
[^
>
]
*>/g
,
''
)
}}
</view>
-->
<!--
<view
class=
"cardtitle3"
>
¥
{{
formatPrice
(
item
.
price
)
}}
</view>
-->
</view>
</view>
<u-loadmore
:status=
"videoStatus"
/>
</view>
<view
v-else-if=
"curNow === 1 && newList.length
<
=
0
"
style=
"margin-top: 200rpx;"
>
<u-empty
mode=
"data"
>
</u-empty>
</view>
</view>
<!--
<view>
-->
...
...
@@ -56,8 +90,19 @@ import pic2 from '../../static/image/pic2.png'
activeNav
:
0
,
newList
:
[],
hotList
:
[],
topicList
:
[]
}
topicList
:
[],
list
:
[
'文章'
,
'视频'
],
curNow
:
0
,
infoShow
:
0
,
articlePage
:
1
,
articleRows
:
10
,
videoPage
:
1
,
videoRows
:
10
,
articleTotal
:
0
,
videoTotal
:
0
,
articleStatus
:
"loadmore"
,
videoStatus
:
"loadmore"
}
},
onLoad
()
{
this
.
init
()
...
...
@@ -67,18 +112,13 @@ import pic2 from '../../static/image/pic2.png'
},
methods
:
{
init
()
{
// this.$u.get('category/list').then(res => {
// let navList = res
// navList.splice(0, 0, {
// name: '推荐',
// id: '0'
// })
// // this.navList = navList;
// this.$u.vuex('vuex_navlist', navList);
// });
this
.
queryGoods
();
this
.
queryArticle
();
this
.
queryVideo
()
this
.
queryTopic
();
},
sectionChange
(
index
)
{
this
.
curNow
=
index
;
},
changeNav
(
index
)
{
console
.
log
(
"index"
,
index
);
this
.
activeNav
=
index
;
...
...
@@ -91,28 +131,42 @@ import pic2 from '../../static/image/pic2.png'
});
}
},
queryGoods
()
{
click
(
item
)
{
console
.
log
(
'item'
,
item
);
},
queryArticle
()
{
this
.
articleStatus
=
this
.
articlePage
*
this
.
articleRows
>=
this
.
articleTotal
?
'nomore'
:
'loadmore'
const
baseApi
=
this
.
baseApi
;
// this.$u.get('goods/searchNew').then(res => {
// let list = res
// for (const index in list) {
// const item = list[index]
// item.img = baseApi + '/file/getImgStream?idFile=' + item.pic
// }
// this.newList = list
// });
this
.
$u
.
get
(
'/cmsnews/miniProgram/listByTop?page=1&rows=10'
).
then
(
res
=>
{
let
list
=
res
.
records
;
console
.
log
(
"数据"
,
res
)
// for (const index in list) {
// const detail = index.details
// detail.replace(/
<
[
^>
]
*>
/g, ''
)
// }
this
.
hotList
=
list
;
this
.
$u
.
get
(
'/cmsnews/miniProgram/listByTop?page='
+
this
.
articlePage
+
'&rows='
+
this
.
articleRows
).
then
(
res
=>
{
if
(
this
.
articlePage
===
1
)
{
let
list
=
res
.
records
;
this
.
hotList
=
list
;
this
.
articleTotal
=
res
.
total
}
else
{
let
list1
=
res
.
records
;
this
.
hotList
=
[...
this
.
hotList
,
...
list1
]
}
});
},
queryVideo
()
{
this
.
videoStatus
=
this
.
videoPage
*
this
.
videoRows
>=
this
.
videoTotal
?
'nomore'
:
'loadmore'
this
.
$u
.
get
(
'/cmsnews/miniProgram/listByTopVideo?page='
+
this
.
videoPage
+
'&rows='
+
this
.
videoRows
).
then
(
res
=>
{
if
(
this
.
videoPage
===
1
)
{
let
list
=
res
.
records
;
this
.
newList
=
list
;
this
.
videoTotal
=
res
.
total
}
else
{
let
list1
=
res
.
records
;
this
.
newList
=
[...
this
.
newList
,
...
list1
]
}
});
},
queryTopic
()
{
const
baseApi
=
this
.
baseApi
;
...
...
@@ -125,27 +179,55 @@ import pic2 from '../../static/image/pic2.png'
this
.
topicList
=
list
.
records
;
})
},
toTopic
(
id
)
{
this
.
$u
.
route
({
url
:
'/pages/topic/detail'
,
params
:
{
id
:
id
}
})
},
toDetail
(
id
)
{
this
.
$u
.
route
({
url
:
'/goods/goods/goods'
,
params
:
{
id
:
id
}
})
},
formatPrice
(
price
)
{
return
(
price
/
100
).
toFixed
(
2
);
if
(
this
.
curNow
===
0
)
{
this
.
$u
.
route
({
url
:
'pages/myArticle/detail'
,
params
:
{
businessId
:
id
}
})
}
if
(
this
.
curNow
===
1
)
{
this
.
$u
.
route
({
url
:
'pages/myVedio/detail'
,
params
:
{
businessId
:
id
}
})
}
}
}
},
// 触底事件 - 上拉加载
onReachBottom
()
{
console
.
log
(
"触底加载"
);
// 加判断: 页码数 * 每一页获取数据的条数 >= 总条数,如果符合条件说明数据已经全部加载完毕
let
that
=
this
if
(
that
.
curNow
===
0
)
{
if
(
that
.
articlePage
*
that
.
articleRows
>=
that
.
articleTotal
)
{
that
.
articleStatus
=
"nomore"
return
}
else
{
that
.
articleStatus
=
"loading"
that
.
articlePage
++
// 每触发一次触底事件,页码加1
that
.
queryArticle
()
}
}
if
(
that
.
curNow
===
1
)
{
if
(
that
.
videoPage
*
that
.
videoRows
>=
that
.
videoTotal
)
{
that
.
videoStatus
=
"nomore"
return
}
else
{
that
.
videoStatus
=
"loading"
that
.
videoPage
++
// 每触发一次触底事件,页码加1
that
.
queryVideo
()
}
}
}
}
</
script
>
...
...
@@ -156,11 +238,13 @@ import pic2 from '../../static/image/pic2.png'
}
.gl-title
{
/* padding: 20rpx; */
margin
:
50
rpx
0
40
rpx
38
rpx
;
margin
:
50
rpx
38
rpx
40
rpx
38
rpx
;
font-size
:
18px
;
font-family
:
Source
Han
Sans
CN-Bold
,
Source
Han
Sans
CN
;
font-weight
:
bold
;
color
:
#222222
;
display
:
flex
;
justify-content
:
space-between
;
}
.gl-img
{
...
...
@@ -244,4 +328,10 @@ import pic2 from '../../static/image/pic2.png'
font-weight
:
500
;
color
:
#D94343
;
}
/
deep
/
.u-tabs
{
background
:
#F6F6F6
!important
;
}
/
deep
/
.u-item-bg
{
width
:
50%
!important
;
}
</
style
>
pages/sort/index.vue
View file @
c5bcb5a7
...
...
@@ -2,22 +2,44 @@
<view
class=
"u-wrap"
>
<u-subsection
:list=
"list"
:current=
"curNow"
@
change=
"sectionChange"
></u-subsection>
<view
class=
"body"
>
<view
v-if=
"curNow===0"
v-for=
"(item,index) in hotList"
:key=
"index"
class=
"indexcard"
>
<image
class=
"cardimage"
:src=
"item.path"
@
click=
"toDetail(item.id)"
></image>
<view
class=
"cardtitle"
@
click=
"toDetail(item.id)"
>
<view
v-if=
"curNow===0 && hotList.length>0"
>
<view
v-for=
"(item,index) in hotList"
:key=
"index"
class=
"indexcard"
>
<image
class=
"cardimage"
:src=
"item.path"
@
click=
"toDetail(item.businessId)"
></image>
<view
class=
"cardtitle"
@
click=
"toDetail(item.businessId)"
>
<view
class=
"cardtitle1"
>
{{
item
.
title
}}
</view>
<view
class=
"cardtitle2"
>
{{
item
.
details
.
replace
(
/<
[^
>
]
*>/g
,
''
)
}}
</view>
<!--
<view
class=
"cardtitle3"
>
¥
{{
formatPrice
(
item
.
price
)
}}
</view>
-->
</view>
</view>
<view
v-if=
"curNow===1"
v-for=
"(item,index) in videoList"
:key=
"index"
class=
"indexcard"
>
<image
class=
"cardimage"
:src=
"item.path"
@
click=
"toDetail(item.id)"
></image>
<view
class=
"cardtitle"
@
click=
"toDetail(item.id)"
>
<u-loadmore
:status=
"videoStatus"
/>
</view>
<view
v-else-if=
"curNow === 0 && hotList.length
<
=
0
"
style=
"margin-top: 200rpx;"
>
<u-empty
mode=
"data"
>
</u-empty>
</view>
<view
v-else-if=
"curNow===1 && videoList.length>0"
>
<view
v-for=
"(item,index) in videoList"
:key=
"index"
class=
"indexcard"
>
<image
class=
"cardimage"
:src=
"item.path"
@
click=
"toDetail(item.businessId)"
></image>
<view
class=
"cardtitle"
@
click=
"toDetail(item.businessId)"
>
<view
class=
"cardtitle1"
>
{{
item
.
videoTitle
}}
</view>
<!--
<view
class=
"cardtitle2"
>
{{
item
.
details
.
replace
(
/<
[^
>
]
*>/g
,
''
)
}}
</view>
-->
<!--
<view
class=
"cardtitle3"
>
¥
{{
formatPrice
(
item
.
price
)
}}
</view>
-->
</view>
</view>
<u-loadmore
:status=
"videoStatus"
/>
</view>
<view
v-else-if=
"curNow === 1 && videoList.length
<
=
0
"
style=
"margin-top: 200rpx;"
>
<u-empty
mode=
"data"
>
</u-empty>
</view>
</view>
</view>
</
template
>
...
...
@@ -30,29 +52,104 @@
list
:
[
'文章'
,
'视频'
],
curNow
:
0
,
hotList
:
[],
videoList
:
[]
videoList
:
[],
articlePage
:
1
,
articleRows
:
10
,
videoPage
:
1
,
videoRows
:
10
,
articleTotal
:
0
,
videoTotal
:
0
,
articleStatus
:
"loadmore"
,
videoStatus
:
"loadmore"
}
},
onLoad
()
{
this
.
init
()
this
.
queryVideo
()
},
methods
:
{
sectionChange
(
index
)
{
this
.
curNow
=
index
;
},
init
()
{
this
.
articleStatus
=
this
.
articlePage
*
this
.
articleRows
>=
this
.
articleTotal
?
'nomore'
:
'loadmore'
const
unitList
=
this
.
vuex_unit
this
.
$u
.
get
(
'cmsnews/miniProgram/listByClassification?page=1&rows=10&unitId='
+
unitList
[
0
].
businessId
).
then
(
res
=>
{
const
videoChild
=
res
.
records
this
.
hotList
=
videoChild
this
.
$u
.
get
(
'cmsnews/miniProgram/listByClassification?page='
+
this
.
articlePage
+
'&rows='
+
this
.
articleRows
+
'&unitId='
+
unitList
[
0
].
businessId
).
then
(
res
=>
{
if
(
this
.
articlePage
===
1
)
{
let
list
=
res
.
records
;
this
.
hotList
=
list
;
this
.
articleTotal
=
res
.
total
}
else
{
let
list1
=
res
.
records
;
this
.
hotList
=
[...
this
.
hotList
,
...
list1
]
}
})
this
.
$u
.
get
(
'cmsvideo/miniProgram/listByClassification?page=1&rows=10&unitId='
+
unitList
[
0
].
businessId
).
then
(
res
=>
{
const
videoChild
=
res
.
records
this
.
videoList
=
videoChild
},
queryVideo
(){
this
.
videoStatus
=
this
.
videoPage
*
this
.
videoRows
>=
this
.
videoTotal
?
'nomore'
:
'loadmore'
const
unitList
=
this
.
vuex_unit
this
.
$u
.
get
(
'cmsvideo/miniProgram/listByClassification?page='
+
this
.
videoPage
+
'&rows='
+
this
.
videoRows
+
'&unitId='
+
unitList
[
0
].
businessId
).
then
(
res
=>
{
if
(
this
.
videoPage
===
1
)
{
let
list
=
res
.
records
;
this
.
videoList
=
list
;
this
.
videoTotal
=
res
.
total
}
else
{
let
list1
=
res
.
records
;
this
.
videoList
=
[...
this
.
videoList
,
...
list1
]
}
})
},
toDetail
(
id
){
if
(
this
.
curNow
===
0
)
{
this
.
$u
.
route
({
url
:
'pages/myArticle/detail'
,
params
:
{
businessId
:
id
}
})
}
else
if
(
this
.
curNow
===
1
){
this
.
$u
.
route
({
url
:
'pages/myVedio/detail'
,
params
:
{
businessId
:
id
}
})
}
}
}
},
// 触底事件 - 上拉加载
onReachBottom
()
{
console
.
log
(
"触底加载"
);
// 加判断: 页码数 * 每一页获取数据的条数 >= 总条数,如果符合条件说明数据已经全部加载完毕
let
that
=
this
if
(
that
.
curNow
===
0
)
{
if
(
that
.
articlePage
*
that
.
articleRows
>=
that
.
articleTotal
)
{
that
.
articleStatus
=
"nomore"
return
}
else
{
that
.
articleStatus
=
"loading"
that
.
articlePage
++
// 每触发一次触底事件,页码加1
that
.
init
()
}
}
if
(
that
.
curNow
===
1
)
{
if
(
that
.
videoPage
*
that
.
videoRows
>=
that
.
videoTotal
)
{
that
.
videoStatus
=
"nomore"
return
}
else
{
that
.
videoStatus
=
"loading"
that
.
videoPage
++
// 每触发一次触底事件,页码加1
that
.
queryVideo
()
}
}
}
}
</
script
>
...
...
store/jsencrypt.js
View file @
c5bcb5a7
...
...
@@ -28,3 +28,41 @@ export function rsaDecrypt (msg) {
return
decryptMsg
}
const
urlPrivateKey
=
'MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDOv5+1+x4nG'
+
'XdcO59HCqt9atsBZa2i/JzcLzbpXFb2Gw3R+mUch0LK1R7ubup/kQdhJJdf/u/IDO6LSL9AW2fm6YPsMzdABdA33JfGp1d'
+
'DJYbqkW5ELyeHrdOAa4vibv3O8dFyYpPeTI0p9Z5lL6TD+xP0rG5e4LgTsVw94aeZBqb3TVoA4Y83CZogxoWYubLieVSdM'
+
'9uxxtKqkyEwRGTTRAwbdV3pInrlyHZevvHvcjdIjA06rxMlvL9zfIHhDfyc54luNuJX31+jodioqvXX+OwAuMcA0I7/iGQ'
+
'CQuoaFOMCcEHYRhwZTqu5/iIoO7J6TmCXw38qW3wiQ/p5VsxxAgMBAAECggEAA+8Te+P2U+ohIkkkI7bpQm6pEiK8JhDGb'
+
'04armAKa45iOe+Ywu0z8SYS+5hyr9Czoj6O/s2cBGNymoXc1b2ngXZKA1GKKJazuoxg+u+uMmHhak8wGO4Iw4UkNBpXxAw'
+
'2mhxxzspfY+hy+yxoQiag7PW3EH3Db9y4w+8pAShtBvVXqQRqeDbSadhhpnhpekd/NGcDWlZP+Sce3lNbDslMdKCx2ucdO'
+
'lqfjDo6EsRknqvXS0rpVQyeYFG4iv5i60p1a5YCntXJQgkZgsZME1jb8j6c65x+Hc8/1EkuutRH8T8jdJc3iqcM4rwz983'
+
'1XB0LwktCv8FzWGq+O+ouoELFwQKBgQD54dqHgjvmIQqjKvc634IwMASyKTUg7TZ2YLvcpzzjM26VkBMj3s95yqMVjFMTv'
+
'rQu5NbBmiAr2zjnqYXd40W91BjJhC/RyWLR1Nvpf/gefojzhjLO6S1PQUAJ6hQzgzJejnG8OaiDLnCfrxBm9uk9wPHdyUd'
+
'KCwws1k2uy1aHmQKBgQDTz22XCSjrQi0NxzIMYL2sL9hAdOKKbbSxZLAu80w60ECG2F/xELgHS6Qv9qmU40CbJXZY+rEZm'
+
'bzxTcaeuFDS/x8umUObXv2SJQkYfu9XotE+2RQWaeKNpQd56ZQsusthZ1VVZxCn8qZ5QcHDzNnFIQe3W6+Ci3sb1qeOuC8'
+
'SmQKBgCeS0DQDuQ7CDtg2dr75JLoS8LtycTqMtsJaoYXZangk7g97qLxWjg8gu2EvPvzyh8Chdy1kBlJLvqBZpZy1YJcmn'
+
'uJTL+uOdDr89fLt1FKoAXJnv2YrYYSatdScIKTj0zdMYdDIZNqZoTZ42CUmV1vzUZqpRMQCKeRz8AuNol+JAoGBAKvU2JQ'
+
'yEycgLYrC8eBGzzkUK3zHFk21CGTtSV0dddc0wVRjzxmzNYh9nfpnQlYOMohq0OMIpYoeRcEBFsQGxVMXM4XLQqSWYGIid'
+
'4mO2L6g0N4Kn5g7WFcO7czCaLoM5BfmC71X+pQ1b0ZpyTb+RiD9VdQzpmPiogIIlzBaTZ3pAoGAK9eRtXRE0no6T2hH/6l'
+
'0U0j9b9PsIQc7ufliGFDiM1cLQreeLYeRVPe2HkUeym9zaZiLRME16rvBYc0As+0OeSi2pIsm9pkqQ4xzKpx1dDqltY2o6'
+
'+axwmA5nesaYRzH2bOC47XGfWe6F0wnI/ZkpcAZ2mXawKREsQW9d/+xtF0='
const
urlPublicKey
=
'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzr+ftfseJxl3XDuf'
+
'RwqrfWrbAWWtovyc3C826VxW9hsN0fplHIdCytUe7m7qf5EHYSSXX/7vyAzui0i/QFtn5umD7DM3QAXQN9yXxqdXQyWG6p'
+
'FuRC8nh63TgGuL4m79zvHRcmKT3kyNKfWeZS+kw/sT9KxuXuC4E7FcPeGnmQam901aAOGPNwmaIMaFmLmy4nlUnTPbscbS'
+
'qpMhMERk00QMG3Vd6SJ65ch2Xr7x73I3SIwNOq8TJby/c3yB4Q38nOeJbjbiV99fo6HYqKr11/jsALjHANCO/4hkAkLqGhT'
+
'jAnBB2EYcGU6ruf4iKDuyek5gl8N/Klt8IkP6eVbMcQIDAQAB'
// 视频,pdf加密
export
function
urlEncrypt
(
txt
)
{
const
encryptor
=
new
JSEncrypt
()
encryptor
.
setPublicKey
(
urlPublicKey
)
// 设置公钥
return
encryptor
.
encrypt
(
txt
)
// 对需要加密的数据进行加密
}
// 视频,pdf解密
export
function
urlDecrypt
(
txt
)
{
const
encryptor
=
new
JSEncrypt
()
encryptor
.
setPrivateKey
(
urlPrivateKey
)
return
encryptor
.
decrypt
(
txt
)
}
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