Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uniapp_vedio
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
android
uniapp_vedio
Commits
c992094b
Commit
c992094b
authored
Aug 09, 2024
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
288e3652
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
1516 additions
and
953 deletions
+1516
-953
BookshelfBookItem.js
vedio/common/models/BookshelfBookItem.js
+14
-14
index.js
vedio/common/services/index.js
+10
-1
banner.vue
vedio/components/banner/banner.vue
+74
-0
book-list-item.vue
vedio/components/book-list-item/book-list-item.vue
+5
-5
book-list-item2.vue
vedio/components/book-list-item2/book-list-item2.vue
+94
-0
bookcity.vue
vedio/components/bookcity/bookcity.vue
+88
-0
bookcity-list.vue
vedio/components/bookcity/components/bookcity-list.vue
+122
-0
index.js
vedio/components/bookcity/services/index.js
+8
-0
bookshelf.vue
vedio/components/bookshelf/bookshelf.vue
+15
-37
bookshelf-list.vue
vedio/components/bookshelf/components/bookshelf-list.vue
+63
-40
index.js
vedio/components/bookshelf/services/index.js
+8
-1
c-shelf-empty.vue
vedio/components/c-shelf-empty/c-shelf-empty.vue
+6
-6
my.vue
vedio/components/home/my.vue
+283
-304
read-time-count-row.vue
vedio/components/read-time-count-row/read-time-count-row.vue
+115
-109
recommend-list.vue
vedio/components/recommend-list/recommend-list.vue
+163
-0
category-bar.vue
vedio/components/warehouse/components/category-bar.vue
+167
-165
warehouse.vue
vedio/components/warehouse/warehouse.vue
+6
-9
book-search.vue
vedio/page-subs/sub_A/book-search/book-search.vue
+112
-114
search-header-bar.vue
...e-subs/sub_A/book-search/components/search-header-bar.vue
+0
-1
search-placeholder.vue
...-subs/sub_A/book-search/components/search-placeholder.vue
+139
-127
home.vue
vedio/pages/home.vue
+24
-20
No files found.
vedio/com
ponents/bookshelf
/models/BookshelfBookItem.js
→
vedio/com
mon
/models/BookshelfBookItem.js
View file @
c992094b
import
Book
from
"../
../../common/models/Book"
;
import
Book
from
"../
models/Book.js"
;
import
{
getTimeDesc
}
from
"../
../../common/utils/timeUtil"
;
}
from
"../
utils/timeUtil"
;
export
default
class
BookshelfBookItem
extends
Book
{
constructor
(
param
)
{
...
...
vedio/common/services/index.js
View file @
c992094b
...
...
@@ -284,6 +284,14 @@ function getBookBeanPackData(callback) {
})
}
function
getCollects
(
callback
)
{
apiPOST
({
url
:
"/book/collectList"
,
data
:
{},
callback
})
}
/**
* 解锁书籍
...
...
@@ -300,6 +308,7 @@ function buyBookWithBookBean(bookId, callback) {
})
}
module
.
exports
=
{
getCollects
,
getOpens
,
getReadTimeCount
,
startCountReadTime
,
...
...
vedio/components/banner/banner.vue
0 → 100644
View file @
c992094b
<
template
>
<view
class=
"banneritem"
>
<swiper
:autoplay=
"true"
:interval=
"2000"
:duration=
"500"
>
<swiper-item
@
click=
"handleBanner"
v-for=
'(item, index) in bannerList'
:key=
'index'
>
<image
class=
"banner-img"
src=
"https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/img/ic_banner_ar.png"
mode=
"scaleToFill"
></image>
</swiper-item>
</swiper>
</view>
</
template
>
<
script
>
import
SystemInfoMixin
from
"../../common/mixins/system-info-mixin.js"
import
{
watchUserInfoChange
,
removeUserInfoChangeWatch
}
from
"../../common/services/userServices.js"
;
export
default
{
mixins
:
[
SystemInfoMixin
],
data
()
{
return
{
bannerList
:
[
''
,
''
,
''
]
};
},
onReady
()
{
// this.initHeight();
// 监听用户变动
watchUserInfoChange
((
info
)
=>
{
if
(
info
.
userInfo
)
{
this
.
initData
();
}
},
this
)
},
onShow
()
{},
onUnload
()
{
// 移除监听
removeUserInfoChangeWatch
(
this
);
},
methods
:
{
show
()
{
// 监听用户变动
watchUserInfoChange
((
info
)
=>
{
if
(
info
.
userInfo
)
{
this
.
initData
();
}
},
this
)
},
handleBanner
()
{},
hide
()
{
},
initData
()
{
this
.
refreshList
();
},
// 刷新数据列表
refreshList
()
{
}
}
}
</
script
>
<
style
lang=
"scss"
>
.banneritem
{
margin
:
20rpx
20rpx
0
20rpx
;
height
:
260rpx
;
.banner-img
{
height
:
260rpx
;
}
}
</
style
>
\ No newline at end of file
vedio/components/book-list-item/book-list-item.vue
View file @
c992094b
...
...
@@ -99,7 +99,7 @@
.book-list-item
{
display
:
flex
;
flex-direction
:
row
;
padding
:
20rpx
4
0rpx
;
padding
:
20rpx
2
0rpx
;
.row
{
margin-bottom
:
20rpx
;
...
...
@@ -173,8 +173,8 @@
}
.label-color-2
{
color
:
#
3d99fd
;
background
:
#
d8ebff
;
color
:
#
F1413C
;
background
:
#
FEF3F3
;
}
.label-color-3
{
...
...
@@ -186,8 +186,8 @@
.cover-box
{
.cover
{
width
:
1
50
rpx
;
height
:
2
0
0rpx
;
width
:
1
65
rpx
;
height
:
2
2
0rpx
;
border-radius
:
15rpx
;
}
}
...
...
vedio/components/book-list-item2/book-list-item2.vue
0 → 100644
View file @
c992094b
<
template
>
<view
class=
"cover-box"
@
click=
"tapItem"
>
<!--
<image
v-show=
"imageError"
class=
"cover"
src=
"/static/images/image_error.png"
mode=
"aspectFill"
></image>
-->
<image
class=
"cover"
v-if=
"!last"
:src=
"item.avatar"
mode=
"aspectFill"
></image>
<image
v-else
class=
"cover"
src=
"/static/images/image_error.png"
mode=
"aspectFill"
></image>
<view
class=
"title"
v-if=
"!last"
>
{{
item
.
title
}}
</view>
<view
class=
"c-flex_row c-align_center label-box"
v-if=
"!last"
>
<slot
name=
"footer"
>
<view
class=
"label label-color-1"
v-if=
'showCategory'
>
{{
item
.
categoryName
}}
</view>
<view
class=
"label label-color-2"
v-for=
'(label, labelIndex) in item.tagList'
:key=
'labelIndex'
>
{{
label
.
name
}}
</view>
</slot>
</view>
</view>
</
template
>
<
script
>
export
default
{
props
:
{
item
:
{
type
:
Object
,
default
:
function
()
{
return
{}
}
},
last
:
{
type
:
Boolean
,
default
:
false
}
},
data
:
function
()
{
return
{
imageError
:
true
}
},
watch
:
{},
computed
:
{
showCategory
:
function
()
{
return
this
.
item
.
categoryName
},
showErrorImage
:
function
()
{
return
this
.
imageError
;
},
hideErrorImage
:
function
()
{
return
!
this
.
imageError
}
},
methods
:
{
tapItem
()
{
this
.
$emit
(
"tapItem"
,
{
detail
:
{
data
:
this
.
item
}
})
},
loadImage
()
{
this
.
imageError
=
false
;
},
errorImage
()
{
this
.
imageError
=
true
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.cover-box
{
display
:
flex
;
flex-direction
:
column
;
.title
{
width
:
100%
;
font-size
:
26rpx
;
margin-top
:
10rpx
;
color
:
#383B3D
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
}
.cover
{
width
:
100%
;
height
:
220rpx
;
border-radius
:
15rpx
;
}
}
</
style
>
\ No newline at end of file
vedio/components/bookcity/bookcity.vue
0 → 100644
View file @
c992094b
<
template
>
<scroll-view
scroll-y
style=
"height: 100%;"
>
<book-search-box
id=
'search'
></book-search-box>
<Banner></Banner>
<RecommendList
ref=
'recommendList1'
:listType=
"1"
></RecommendList>
<RecommendList
ref=
'recommendList2'
:listType=
"2"
></RecommendList>
<view
style=
"height: 20rpx;"
></view>
</scroll-view>
</
template
>
<
script
>
import
RecommendList
from
"../recommend-list/recommend-list.vue"
;
import
Banner
from
"../banner/banner.vue"
;
import
SystemInfoMixin
from
"../../common/mixins/system-info-mixin.js"
import
{
watchUserInfoChange
,
removeUserInfoChangeWatch
}
from
"../../common/services/userServices.js"
;
export
default
{
mixins
:
[
SystemInfoMixin
],
components
:
{
RecommendList
,
Banner
},
data
()
{
return
{
listHeight
:
0
};
},
onReady
()
{
// this.initHeight();
// 监听用户变动
watchUserInfoChange
((
info
)
=>
{
if
(
info
.
userInfo
)
{
this
.
initData
();
}
},
this
)
this
.
refreshList
()
},
onShow
()
{},
onUnload
()
{
// 移除监听
removeUserInfoChangeWatch
(
this
);
},
methods
:
{
show
()
{
// 监听用户变动
watchUserInfoChange
((
info
)
=>
{
if
(
info
.
userInfo
)
{
this
.
initData
();
}
},
this
)
},
hide
()
{
},
initData
()
{
this
.
refreshList
();
},
// 刷新数据列表
refreshList
()
{
let
ref2
=
this
.
$refs
.
recommendList1
;
if
(
ref2
)
{
ref2
.
refreshList
();
}
let
ref
=
this
.
$refs
.
recommendList2
;
if
(
ref
)
{
ref
.
refreshList
();
}
},
initHeight
()
{
const
query
=
uni
.
createSelectorQuery
().
in
(
this
);
query
.
exec
((
res
)
=>
{
let
result
=
0
;
res
.
forEach
(
item
=>
{
result
=
result
+
item
.
height
;
})
this
.
listHeight
=
this
.
windowHeight
-
result
;
})
},
}
}
</
script
>
<
style
lang=
"scss"
>
</
style
>
\ No newline at end of file
vedio/components/bookcity/components/bookcity-list.vue
0 → 100644
View file @
c992094b
<
template
>
<view
class=
"bookshelf"
>
<read-time-count-row
id=
'count'
ref=
'timeCount'
></read-time-count-row>
<view
class=
"bookitem"
v-if=
"dataList.length>0"
>
<book-list-item2
class=
"item"
v-for=
'(item, index) in dataList'
:key=
'index'
:item=
'item'
:last=
"index>=dataList.length-1"
@
tapItem=
'tapItem($event, index)'
@
close=
'tapClose($event, index)'
>
</book-list-item2>
</view>
<c-shelf-empty
v-else
></c-shelf-empty>
</view>
</
template
>
<
script
>
import
common
from
'@/mixins/common'
;
import
{
getCollects
,
}
from
"../../../common/services/index.js"
import
{
gotoBookContentPage
}
from
'../../../common/services/page-route'
;
import
BookshelfBookItem
from
'../../../common/models/BookshelfBookItem.js'
;
import
{
collectionBook
,
noticeCollectionListChange
}
from
"../../../common/services/index.js"
export
default
{
mixins
:
[
common
],
props
:
{
height
:
{
type
:
Number
,
default
:
0
},
},
data
:
function
()
{
return
{
dataList
:
[],
}
},
methods
:
{
refreshList
()
{
getCollects
((
success
,
data
)
=>
{
if
(
success
)
{
this
.
changeData
(
data
)
}
})
this
.
refreshTimeCount
()
},
refreshTimeCount
()
{
let
ref
=
this
.
$refs
.
timeCount
;
if
(
ref
)
{
ref
.
refresh
()
}
},
changeData
(
e
)
{
this
.
dataList
=
e
.
records
.
map
(
item
=>
{
return
new
BookshelfBookItem
(
item
)
})
this
.
dataList
.
push
({})
},
tapItem
(
e
,
index
)
{
if
(
index
>=
this
.
dataList
.
length
-
1
)
{
uni
.
$emit
(
'goWareHouse'
)
return
}
gotoBookContentPage
(
e
.
detail
.
data
.
id
,
e
.
detail
.
data
.
shortis
)
},
tapClose
(
e
,
index
)
{
let
item
=
e
.
detail
.
data
;
uni
.
showModal
({
title
:
"确认移除"
,
content
:
`是否确认从书架中移除《
${
item
.
title
}
》`
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
collectionBook
(
false
,
item
.
id
,
(
success
,
data
)
=>
{
if
(
success
)
{
this
.
dataList
.
splice
(
index
,
1
)
this
.
$forceUpdate
()
noticeCollectionListChange
(
item
.
id
,
false
)
}
})
}
}
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.bookshelf
{
display
:
flex
;
flex-direction
:
column
;
border-radius
:
20rpx
;
background-color
:
white
;
margin
:
30rpx
;
.bookitem
{
display
:
flex
;
flex-direction
:
row
;
flex-wrap
:
wrap
;
padding-left
:
20rpx
;
.item
{
width
:
22%
;
margin-bottom
:
20rpx
;
margin-right
:
20rpx
;
}
.item
:last-child
{
margin-bottom
:
0
;
margin-right
:
0
;
}
}
}
</
style
>
\ No newline at end of file
vedio/components/bookcity/services/index.js
0 → 100644
View file @
c992094b
import
{
apiGET
,
apiPOST
}
from
"../../../common/utils/apiRequest.js"
module
.
exports
=
{
}
\ No newline at end of file
vedio/components/bookshelf/bookshelf.vue
View file @
c992094b
<
template
>
<z-paging>
<c-navi
id=
'navi'
></c-navi>
<book-search-box
id=
'search'
:searchType=
'searchType'
></book-search-box>
<read-time-count-row
id=
'count'
ref=
'timeCount'
@
resize=
'resizeTimeCount'
></read-time-count-row>
<BookshelfList
ref=
'bookList'
:height=
'listHeight'
></BookshelfList>
<c-login></c-login>
</z-paging>
<scroll-view
scroll-y
style=
"height: 100%;"
>
<BookshelfList
ref=
'bookList'
></BookshelfList>
<RecommendList
ref=
'recommendList'
></RecommendList>
<view
style=
"height: 20rpx;"
></view>
</scroll-view>
</
template
>
<
script
>
import
BookshelfList
from
"./components/bookshelf-list.vue"
;
import
RecommendList
from
"../recommend-list/recommend-list.vue"
;
import
SystemInfoMixin
from
"../../common/mixins/system-info-mixin.js"
import
{
watchUserInfoChange
,
removeUserInfoChangeWatch
}
from
"../../common/services/userServices.js"
;
import
{
ENUM_SEARCH_TYPE
}
from
"../../static/enums/enum_value"
;
import
{
removeCollectionChangeWatch
,
watchCollectionChange
...
...
@@ -25,16 +21,16 @@
export
default
{
mixins
:
[
SystemInfoMixin
],
components
:
{
BookshelfList
BookshelfList
,
RecommendList
},
data
()
{
return
{
searchType
:
ENUM_SEARCH_TYPE
.
BOOKSHELF
,
listHeight
:
0
};
},
onReady
()
{
this
.
initHeight
();
//
this.initHeight();
// 监听用户变动
watchUserInfoChange
((
info
)
=>
{
if
(
info
.
userInfo
)
{
...
...
@@ -57,9 +53,7 @@
},
methods
:
{
show
()
{
this
.
$refs
.
timeCount
.
refresh
()
this
.
initHeight
();
// this.initHeight();
// 监听用户变动
watchUserInfoChange
((
info
)
=>
{
if
(
info
.
userInfo
)
{
...
...
@@ -73,39 +67,23 @@
},
hide
()
{
},
resizeTimeCount
()
{
this
.
initHeight
();
},
initData
()
{
this
.
refreshList
();
},
// 初始化刷新
initRefresh
()
{
let
ref
=
this
.
$refs
.
bookList
;
if
(
ref
)
{
ref
.
initRefresh
();
}
},
// 刷新数据列表
refreshList
()
{
let
ref2
=
this
.
$refs
.
recommendList
;
if
(
ref2
)
{
ref2
.
refreshList
();
}
let
ref
=
this
.
$refs
.
bookList
;
if
(
ref
)
{
ref
.
refreshList
();
}
},
refreshTimeCount
()
{
let
ref
=
this
.
$refs
.
timeCount
;
if
(
ref
)
{
ref
.
refresh
();
}
},
initHeight
()
{
const
query
=
uni
.
createSelectorQuery
().
in
(
this
);
query
.
select
(
"#navi"
).
boundingClientRect
();
query
.
select
(
"#search"
).
boundingClientRect
();
query
.
select
(
"#count"
).
boundingClientRect
();
query
.
select
(
"#count"
).
boundingClientRect
();
query
.
exec
((
res
)
=>
{
let
result
=
0
;
res
.
forEach
(
item
=>
{
...
...
vedio/components/bookshelf/components/bookshelf-list.vue
View file @
c992094b
<
template
>
<view>
<c-list
ref=
'list'
:showShelfEmpty=
"true"
flag=
'bookshelf'
:needLogin=
"true"
:height=
"height"
url=
'/book/collectList'
:param=
"requestParam"
@
change=
'changeData'
method=
"POST"
>
<book-list-item
v-for=
'(item, index) in dataList'
:key=
'index'
:item=
'item'
@
tapItem=
'tapItem($event, index)'
@
close=
'tapClose($event, index)'
>
<template
v-slot:footer
>
<view
class=
"c-flex_row c-aligns_center"
>
<uni-icons
type=
'calendar'
size=
"16"
color=
"#999"
></uni-icons>
<view
class=
"info"
>
{{
item
.
lastReadTime
}}
前阅读过
<view
class=
"bookshelf"
>
<read-time-count-row
id=
'count'
ref=
'timeCount'
></read-time-count-row>
<view
class=
"bookitem"
v-if=
"dataList.length>0"
>
<book-list-item2
class=
"item"
v-for=
'(item, index) in dataList'
:key=
'index'
:item=
'item'
:last=
"index>=dataList.length-1"
@
tapItem=
'tapItem($event, index)'
@
close=
'tapClose($event, index)'
>
</book-list-item2>
</view>
</view>
</
template
>
</book-list-item>
</c-list>
<c-shelf-empty
v-else
></c-shelf-empty>
</view>
</
template
>
<
script
>
import
common
from
'@/mixins/common'
;
import
{
getCollects
,
}
from
"../../../common/services/index.js"
import
{
gotoBookContentPage
}
from
'../../../common/services/page-route'
;
import
{
isEmpty
}
from
'../../../common/utils/util'
;
import
BookshelfBookItem
from
'../models/BookshelfBookItem'
;
import
BookshelfBookItem
from
'../../../common/models/BookshelfBookItem.js'
;
import
{
collectionBook
,
noticeCollectionListChange
}
from
"../../../common/services/index.js"
export
default
{
mixins
:
[
common
],
props
:
{
height
:
{
type
:
Number
,
...
...
@@ -41,30 +41,33 @@
dataList
:
[],
}
},
computed
:
{
requestParam
:
function
()
{
return
{}
}
},
methods
:
{
initRefresh
()
{
if
(
isEmpty
(
this
.
dataList
))
{
this
.
refreshList
();
refreshList
()
{
getCollects
((
success
,
data
)
=>
{
if
(
success
)
{
this
.
changeData
(
data
)
}
})
this
.
refreshTimeCount
()
},
refresh
Lis
t
()
{
let
ref
=
this
.
$refs
.
lis
t
;
refresh
TimeCoun
t
()
{
let
ref
=
this
.
$refs
.
timeCoun
t
;
if
(
ref
)
{
ref
.
onPullRefreshing
();
ref
.
refresh
()
}
},
changeData
(
e
)
{
console
.
log
(
e
)
this
.
dataList
=
e
.
detail
.
data
.
map
(
item
=>
{
this
.
dataList
=
e
.
records
.
map
(
item
=>
{
return
new
BookshelfBookItem
(
item
)
})
this
.
dataList
.
push
({})
},
tapItem
(
e
,
index
)
{
if
(
index
>=
this
.
dataList
.
length
-
1
)
{
uni
.
$emit
(
'goWareHouse'
)
return
}
gotoBookContentPage
(
e
.
detail
.
data
.
id
,
e
.
detail
.
data
.
shortis
)
},
tapClose
(
e
,
index
)
{
...
...
@@ -76,9 +79,9 @@
if
(
res
.
confirm
)
{
collectionBook
(
false
,
item
.
id
,
(
success
,
data
)
=>
{
if
(
success
)
{
this
.
dataList
.
splice
(
index
,
1
)
;
this
.
$forceUpdate
()
;
noticeCollectionListChange
(
item
.
id
,
false
)
;
this
.
dataList
.
splice
(
index
,
1
)
this
.
$forceUpdate
()
noticeCollectionListChange
(
item
.
id
,
false
)
}
})
}
...
...
@@ -91,9 +94,29 @@
</
script
>
<
style
lang=
"scss"
scoped
>
.info
{
font-size
:
26rpx
;
color
:
#999
;
margin-left
:
10rpx
;
.bookshelf
{
display
:
flex
;
flex-direction
:
column
;
border-radius
:
20rpx
;
background-color
:
white
;
margin
:
30rpx
;
.bookitem
{
display
:
flex
;
flex-direction
:
row
;
flex-wrap
:
wrap
;
padding-left
:
20rpx
;
.item
{
width
:
22%
;
margin-bottom
:
20rpx
;
margin-right
:
20rpx
;
}
.item
:last-child
{
margin-bottom
:
0
;
margin-right
:
0
;
}
}
}
</
style
>
\ No newline at end of file
vedio/components/bookshelf/services/index.js
View file @
c992094b
module
.
exports
=
{}
\ No newline at end of file
import
{
apiGET
,
apiPOST
}
from
"../../../common/utils/apiRequest.js"
module
.
exports
=
{
}
\ No newline at end of file
vedio/components/c-shelf-empty/c-shelf-empty.vue
View file @
c992094b
...
...
@@ -4,7 +4,7 @@
暂未添加到书架
</view>
<view
class=
"empty-button"
@
click=
"goWareHouse"
>
去书
库
去书
城看看
</view>
<slot></slot>
</view>
...
...
@@ -36,20 +36,20 @@
align-items
:
center
;
justify-content
:
center
;
width
:
100%
;
height
:
8
00rpx
;
height
:
4
00rpx
;
.empty-title
{
color
:
#999
;
font-size
:
26rpx
;
margin-bottom
:
4
0rpx
;
margin-bottom
:
2
0rpx
;
}
.empty-button
{
font-size
:
30rpx
;
border
:
1px
solid
#FECF02
;
padding
:
10rpx
40rpx
;
border-radius
:
30rpx
;
color
:
#FECF02
;
color
:
white
;
background
:
linear-gradient
(
90deg
,
#F1413C
,
#FD6864
);
}
}
</
style
>
\ No newline at end of file
vedio/components/home/my.vue
View file @
c992094b
<
template
>
<view
class=
"body"
>
<!--
<z-paging
style=
"height: 100%;"
>
-->
<view
v-if=
"showMask"
class=
"show-mask flex-v"
@
click=
"showMask=false"
>
<view
class=
"mt-30"
style=
"width: 90%;text-align: right;"
>
<image
style=
"width: 30rpx;height: 30rpx;padding:6rpx;
...
...
@@ -23,8 +22,6 @@
</view>
</view>
<read-time-count-row
id=
'count'
ref=
'timeCount'
@
resize=
'resizeTimeCount'
></read-time-count-row>
<view
style=
"display: flex;height: 200rpx;margin:30rpx 20rpx;background: #263358;border-radius: 20rpx;"
>
<view
style=
"flex-grow: 2; margin-left: 20rpx;"
>
<view
style=
"width: 100%;height: 100%;display: flex;flex-direction: column;justify-content: center;"
>
...
...
@@ -87,12 +84,10 @@
<view
style=
"display: flex;justify-content: center;margin-top: 20rpx;font-size: 26rpx;color: gray;"
>
{{
versionName
}}
</view>
<!--
</z-paging>
-->
<coin-popup
:show=
"showAnimate"
@
close=
"showAnimate = false"
@
paySuccess=
"paySuccess"
>
</coin-popup>
<kefu-popup
:show=
"showKefuPop"
@
close=
"showKefuPop = false"
/>
</view>
</
template
>
<
script
>
import
common
from
'@/mixins/common'
;
...
...
@@ -132,24 +127,8 @@
};
},
methods
:
{
resizeTimeCount
()
{
this
.
initHeight
();
},
refreshTimeCount
()
{
let
ref
=
this
.
$refs
.
timeCount
;
if
(
ref
)
{
ref
.
refresh
();
}
},
initHeight
()
{
const
query
=
uni
.
createSelectorQuery
().
in
(
this
);
query
.
select
(
"#count"
).
boundingClientRect
();
},
show
()
{
this
.
versionName
=
'v '
+
VERSION_CODE
// 更新阅读时间统计
this
.
refreshTimeCount
();
this
.
versionName
=
'v '
+
VERSION_CODE
this
.
post
({
url
:
'/user/baseMsg'
,
showLoading
:
false
,
...
...
vedio/components/read-time-count-row/read-time-count-row.vue
View file @
c992094b
<
template
>
<view
class=
"c-flex_row c-aligns_center c-justify_between read-time-count-row"
>
<view
class=
"c-flex_
column c-aligns_center"
>
<view
class=
"c-flex_
row c-aligns_center"
>
<view
class=
"title"
>
今日
阅读时间
今日
<br>
已读
</view>
<view
class=
"value"
v-if=
'count.count'
>
<view
class=
"count"
v-if=
'count.hour'
>
<view
class=
"count-value"
>
{{
count
.
hour
}}
</view>
<view
class=
"count-unit"
>
小时
</view>
<!--
<view
class=
"value"
v-if=
'count.count'
>
-->
<view
class=
"value"
>
<view
class=
"count"
>
<view
class=
"count-value"
>
{{
count
.
hour
?
count
.
hour
:
'00'
}}
</view>
<view
class=
"count-unit"
>
h
</view>
</view>
<view
class=
"count"
v-if=
'count.minute'
>
<view
class=
"count-value"
>
{{
count
.
minute
}}
</view>
<view
class=
"count-unit"
>
分钟
</view>
<view
class=
"count"
>
<view
class=
"count-value"
>
{{
count
.
minute
?
count
.
minute
:
'00'
}}
</view>
<view
class=
"count-unit"
>
m
</view>
</view>
<view
class=
"count"
v-if=
'count.second'
>
<view
class=
"count-value"
>
{{
count
.
second
}}
</view>
<view
class=
"count-unit"
>
秒
</view>
<view
class=
"count"
>
<view
class=
"count-value"
>
{{
count
.
second
?
count
.
second
:
'00'
}}
</view>
<view
class=
"count-unit"
>
s
</view>
</view>
</view>
<
view
class=
"value"
v-else
>
<
!--
<view
class=
"value"
v-else
>
<view
class=
"count"
>
<view
class=
"count-value"
style=
"color: #ffffff00;"
>
0
...
...
@@ -27,7 +28,7 @@
尚未开始
</view>
</view>
</view>
</view>
-->
</view>
<view
class=
"c-flex_column c-aligns_center"
>
<slot
name=
"right"
></slot>
...
...
@@ -71,38 +72,43 @@
<
style
lang=
"scss"
>
.read-time-count-row
{
padding
:
20rpx
40rpx
;
padding
:
20rpx
;
.title
{
font-size
:
28rpx
;
color
:
#333
;
margin-bottom
:
20rpx
;
width
:
80rpx
;
font-size
:
30rpx
;
color
:
#000000
;
margin-right
:
15rpx
;
}
.value
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
.count
{
display
:
flex
;
flex-direction
:
row
;
margin-right
:
10rpx
;
position
:
relative
;
margin-right
:
15rpx
;
font-size
:
24rpx
;
color
:
#333
;
background-color
:
#FEF3F3
;
border-radius
:
10rpx
;
width
:
90rpx
;
height
:
90rpx
;
color
:
#000000
;
.count-value
{
color
:
#007aff
;
font-size
:
38rpx
;
position
:
absolute
;
top
:
50%
;
left
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
color
:
#000000
;
font-size
:
46rpx
;
font-weight
:
700
;
height
:
40rpx
;
line-height
:
40rpx
;
}
.count-unit
{
margin-left
:
8rpx
;
height
:
40rpx
;
line-height
:
40rpx
;
position
:
absolute
;
right
:
8rpx
;
bottom
:
8rpx
;
}
}
}
...
...
vedio/components/recommend-list/recommend-list.vue
0 → 100644
View file @
c992094b
<
template
>
<view
class=
"recommendlist"
>
<view
class=
"booklabel"
>
<view
class=
"title"
>
{{
title
}}
</view>
<view
class=
"change"
@
click=
"refreshList"
>
换一换
</view>
</view>
<view
class=
"rowitem"
v-if=
"listType==0||listType==2"
>
<book-list-item2
class=
"item"
v-for=
'(item, index) in dataList'
:key=
'index'
:item=
'item'
@
tapItem=
'tapItem($event, index)'
>
</book-list-item2>
</view>
<view
class=
"columnitem"
v-else-if=
"listType==1"
>
<book-list-item
:item=
'dataList[0]'
:showClose=
'false'
>
</book-list-item>
<view
class=
"rowitem"
>
<book-list-item2
class=
"item"
:item=
'item'
v-if=
"index!=0"
v-for=
'(item, index) in dataList'
:key=
'index'
@
tapItem=
'tapItem($event, index)'
>
</book-list-item2>
</view>
</view>
<view
class=
"columnitem"
v-else-if=
"listType==3"
>
<book-list-item
class=
"item"
v-for=
'(item, index) in dataList'
:key=
'index'
:item=
'item'
@
tapItem=
'tapItem($event, index)'
:showClose=
'false'
>
</book-list-item>
</view>
</view>
</
template
>
<
script
>
import
common
from
'@/mixins/common'
;
import
{
getCollects
,
}
from
"../../common/services/index.js"
import
{
gotoBookContentPage
}
from
'../../common/services/page-route.js'
;
import
BookshelfBookItem
from
'../../common/models/BookshelfBookItem.js'
;
import
{
collectionBook
,
noticeCollectionListChange
}
from
"../../common/services/index.js"
export
default
{
mixins
:
[
common
],
props
:
{
listType
:
{
type
:
Number
,
default
:
0
}
},
data
:
function
()
{
return
{
dataList
:
[],
title
:
'猜你喜欢'
,
}
},
mounted
()
{
if
(
this
.
listType
==
0
)
{
this
.
title
=
'猜你喜欢'
}
else
if
(
this
.
listType
==
1
||
this
.
listType
==
3
)
{
this
.
title
=
'热门推荐'
}
else
if
(
this
.
listType
==
2
)
{
this
.
title
=
'新书推荐'
}
},
methods
:
{
refreshList
()
{
if
(
this
.
listType
==
0
)
{
getCollects
((
success
,
data
)
=>
{
if
(
success
)
{
this
.
changeData
(
data
)
}
})
}
else
if
(
this
.
listType
==
1
)
{
getCollects
((
success
,
data
)
=>
{
if
(
success
)
{
this
.
changeData
(
data
)
}
})
}
else
if
(
this
.
listType
==
2
)
{
getCollects
((
success
,
data
)
=>
{
if
(
success
)
{
this
.
changeData
(
data
)
}
})
}
else
if
(
this
.
listType
==
3
)
{
getCollects
((
success
,
data
)
=>
{
if
(
success
)
{
this
.
changeData
(
data
)
}
})
}
},
changeData
(
e
)
{
this
.
dataList
=
e
.
records
.
map
(
item
=>
{
return
new
BookshelfBookItem
(
item
)
})
},
tapItem
(
e
,
index
)
{
gotoBookContentPage
(
e
.
detail
.
data
.
id
,
e
.
detail
.
data
.
shortis
)
},
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.recommendlist
{
display
:
flex
;
flex-direction
:
column
;
border-radius
:
20rpx
;
background-color
:
white
;
margin
:
30rpx
;
margin-bottom
:
0
;
.booklabel
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
space-between
;
height
:
100rpx
;
line-height
:
100rpx
;
padding
:
0
20rpx
;
.title
{
font-weight
:
500
;
font-size
:
34rpx
;
color
:
#383B3D
;
}
.change
{
font-weight
:
400
;
font-size
:
24rpx
;
color
:
#A5A5AD
;
}
}
.columnitem
{
display
:
flex
;
flex-direction
:
column
;
}
.rowitem
{
display
:
flex
;
flex-direction
:
row
;
flex-wrap
:
wrap
;
padding-left
:
20rpx
;
.item
{
width
:
22%
;
margin-bottom
:
20rpx
;
margin-right
:
20rpx
;
}
.item
:last-child
{
margin-bottom
:
0
;
margin-right
:
0
;
}
}
}
</
style
>
\ No newline at end of file
vedio/components/warehouse/components/category-bar.vue
View file @
c992094b
...
...
@@ -129,6 +129,7 @@
<
style
lang=
"scss"
>
.bar-box
{
margin
:
20rpx
0
;
white-space
:
nowrap
;
padding
:
0
20rpx
;
width
:
calc
(
100%
-
40rpx
);
...
...
@@ -139,10 +140,12 @@
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
padding
:
25rpx
20rpx
;
border-radius
:
30rpx
;
padding
:
8rpx
16rpx
;
font-size
:
30rpx
;
background
:
transparent
;
color
:
#888
;
background
:
#EEEEEE
;
color
:
#6B6B6B
;
margin
:
0
16rpx
;
.title
{
min-width
:
80rpx
;
...
...
@@ -151,16 +154,15 @@
}
.tab-item
:first-child
{
padding-left
:
0
;
margin-left
:
0
;
}
.tab-item
:last-child
{
padding-right
:
0
;
margin-right
:
0
;
}
.tab-item-selected
{
font-size
:
36rpx
;
font-weight
:
700
;
color
:
#333
background
:
#F1413C
;
color
:
white
;
}
</
style
>
\ No newline at end of file
vedio/components/warehouse/warehouse.vue
View file @
c992094b
<
template
>
<z-paging>
<c-navi
id=
'navi'
></c-navi>
<book-search-box
id=
'search'
></book-search-box>
<scroll-view
scroll-y
style=
"height: 100%;"
>
<CategoryBar
id=
'category'
:range=
'categorys'
:current=
'currentIndex'
@
change=
'changeCategory'
@
ready=
'readyCategory'
></CategoryBar>
<view
:style=
"[listStyle]"
v-if=
'showEmpty'
>
...
...
@@ -12,12 +10,11 @@
@
change=
"changeSwiper"
>
<swiper-item
v-for=
'(item, index) in categorys'
:key=
'index'
>
<WarehouseList
:ref=
"`bookList$
{index}`" :category='item' :height='listHeight'>
</WarehouseList>
<!--
<WarehouseList
ref=
"bookList"
:category=
'item'
:height=
'listHeight'
></WarehouseList>
-->
</swiper-item>
</swiper>
</view>
<
c-login></c-login>
</
z-paging
>
<
view
style=
"height: 20rpx;"
></view>
</
scroll-view
>
</
template
>
<
script
>
...
...
@@ -60,7 +57,7 @@
},
listStyle
:
function
()
{
return
{
height
:
`
${
this
.
listHeight
}
px`
height
:
`
${
this
.
listHeight
}
px`
,
}
},
categroyChange
:
function
()
{
...
...
vedio/page-subs/sub_A/book-search/book-search.vue
View file @
c992094b
<
template
>
<
view>
<
scroll-view
scroll-y
style=
"height: 100%;background: #FFF7F7;"
>
<search-header-bar
id=
'headerBar'
:keyword=
'keyword'
@
clear=
'clearSearch'
@
start=
'startSearch'
></search-header-bar>
<view
:style=
'[placeholderViewStyle]'
>
...
...
@@ -10,8 +10,8 @@
<search-result-view
ref=
'searchList'
:height=
'listHeight'
:keyword=
'keyword'
:searchType=
'searchType'
:result=
'result'
@
change=
'changeResult'
></search-result-view>
</view>
<
c-login></c-login>
</
view>
<
view
style=
"height: 20rpx;"
></view>
</
scroll-view>
</
template
>
<
script
>
...
...
@@ -109,7 +109,5 @@
</
script
>
<
style
lang=
"scss"
scoped
>
.test
{
display
:
none
;
}
</
style
>
\ No newline at end of file
vedio/page-subs/sub_A/book-search/components/search-header-bar.vue
View file @
c992094b
...
...
@@ -90,7 +90,6 @@
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
background
:
#fff
;
font-size
:
28rpx
;
.item
{
...
...
vedio/page-subs/sub_A/book-search/components/search-placeholder.vue
View file @
c992094b
<
template
>
<view>
<
c-list
ref=
'list'
:height=
"height"
:ableRefresh=
"true"
:ableLoadMore=
"true"
:customRequest=
"true"
:sources=
"[1]"
:needLogin=
"false"
@
refresh=
'refreshData'
@
loadMore=
'loadMoreData'
>
<
!--
<c-list
ref=
'list'
:height=
"height"
:ableRefresh=
"true"
:ableLoadMore=
"true"
:customRequest=
"true"
:sources=
"[1]"
:needLogin=
"false"
@
refresh=
'refreshData'
@
loadMore=
'loadMoreData'
>
-->
<placeholder-section
title=
'搜索历史'
:itemSource=
'searchHistory'
@
tapItem=
'tapItem($event, "history")'
>
<template
v-slot:headerButton
>
<view
class=
"header-button"
@
click=
"tapDeleteHistory"
>
...
...
@@ -11,13 +11,13 @@
</placeholder-section>
<placeholder-section
title=
'热门搜索'
:itemSource=
'hotSearch'
@
tapItem=
'tapItem($event, "hot")'
v-if=
'false'
>
</placeholder-section>
<placeholder-section
title=
'热门推荐'
>
<c-empty
v-if=
'recommondEmpty'
></c-empty>
<
template
v-else
>
<recommond-item
v-for=
'(item, index) in hotRecommond'
:key=
'index'
:item=
'item'
></recommond-item>
</
template
>
</placeholder-section>
<
/c-list>
<RecommendList
ref=
'recommendList'
:listType=
"3"
></RecommendList>
<!-- <placeholder-section title='热门推荐'> -->
<!-- <c-empty v-if='recommondEmpty'></c-empty> -->
<!-- <template v-else> -->
<!-- </template> -->
<!-- </placeholder-section> -->
<
!-- </c-list> -->
</view>
</template>
...
...
@@ -31,14 +31,16 @@
getHotRecommondData
,
}
from
"../services/index.js"
import
HotRecommondBook
from
"../models/HotRecommondBook.js"
import
RecommondItem
from
"./recommond-item.vue"
// import RecommondItem from "./recommond-item.vue"
import
RecommendList
from
"../../../../components/recommend-list/recommend-list.vue"
import
{
isEmpty
}
from
"../../../../common/utils/util"
export
default
{
components
:
{
PlaceholderSection
,
RecommondItem
// RecommondItem,
RecommendList
},
props
:
{
height
:
{
...
...
@@ -79,9 +81,14 @@
})
},
initRefresh
()
{
let
ref
=
this
.
$refs
.
list
;
// let ref = this.$refs.list;
// if (ref) {
// ref.initRefresh();
// }
let
ref
=
this
.
$refs
.
recommendList
;
if
(
ref
)
{
ref
.
initRefresh
();
ref
.
refreshList
();
}
},
refreshData
(
e
)
{
...
...
@@ -95,22 +102,27 @@
this
.
getHotRecommondData
(
pageNo
,
pageSize
)
},
getHotRecommondData
(
pageNo
,
pageSize
)
{
getHotRecommondData
(
pageNo
,
pageSize
,
(
success
,
data
)
=>
{
let
ref
=
this
.
$refs
.
list
;
if
(
success
)
{
ref
.
pageNoStep
();
data
=
data
.
map
(
item
=>
{
return
new
HotRecommondBook
(
item
)
})
if
(
pageNo
==
0
)
{
this
.
hotRecommond
=
data
;
}
else
{
this
.
hotRecommond
=
this
.
hotRecommond
.
concat
(
data
);
}
let
ref
=
this
.
$refs
.
recommendList
;
if
(
ref
)
{
ref
.
refreshList
();
}
ref
.
closeTrigger
();
ref
.
changeLoadMoreStatus
(
this
.
hotRecommond
.
length
<
16
,
false
);
})
// getHotRecommondData(pageNo, pageSize, (success, data) => {
// let ref = this.$refs.list;
// if (success) {
// ref.pageNoStep();
// data = data.map(item => {
// return new HotRecommondBook(item)
// })
// if (pageNo == 0) {
// this.hotRecommond = data;
// } else {
// this.hotRecommond = this.hotRecommond.concat(data);
// }
// }
// ref.closeTrigger();
// ref.changeLoadMoreStatus(this.hotRecommond.length
<
16
,
false
);
// })
},
}
}
...
...
vedio/pages/home.vue
View file @
c992094b
...
...
@@ -2,12 +2,12 @@
<view
v-if=
"localActiviteFlag==1"
class=
"body"
>
<view
style=
"height: 92%;"
>
<bookshelf
v-show=
"currentPage==0"
ref=
"index"
/>
<warehouse
v-show=
"currentPage==1"
ref=
"recommend"
/>
<userPage
v-show=
"currentPage==2"
ref=
"user"
/>
<bookcity
v-show=
"currentPage==1"
ref=
"city"
/>
<warehouse
v-show=
"currentPage==2"
ref=
"recommend"
/>
<userPage
v-show=
"currentPage==3"
ref=
"user"
/>
</view>
<view
class=
"tabs-bar"
style=
"z-index: 999;"
>
<view
:class=
"currentPage==0?'tab active': 'tab'"
:style=
"'padding-bottom:' + bottomSafePadding + 'px;'"
@
click=
"tabChange(0)"
>
<view
:class=
"currentPage==0?'tab active': 'tab'"
@
click=
"tabChange(0)"
>
<view
style=
"margin: 16rpx 0 11rpx;"
>
<image
v-if=
"currentPage==0"
class=
"tabs-image"
src=
"/static/tab/index_selected.png"
mode=
"heightFix"
>
...
...
@@ -16,19 +16,25 @@
</view>
书架
</view>
<view
:class=
"currentPage == 1?'tab active': 'tab'"
:style=
"'padding-bottom:' + bottomSafePadding + 'px;'"
@
click=
"tabChange(1)"
>
<view
:class=
"currentPage == 1?'tab active': 'tab'"
@
click=
"tabChange(1)"
>
<view
style=
"margin: 16rpx 0 11rpx;"
>
<image
v-if=
"currentPage==1"
class=
"tabs-image"
src=
"/static/tab/promote_selected.png"
mode=
"heightFix"
></image>
<image
v-else
class=
"tabs-image"
src=
"/static/tab/promote_unselected.png"
mode=
"heightFix"
></image>
</view>
书城
</view>
<view
:class=
"currentPage == 2?'tab active': 'tab'"
@
click=
"tabChange(2)"
>
<view
style=
"margin: 16rpx 0 11rpx;"
>
<image
v-if=
"currentPage==2"
class=
"tabs-image"
src=
"/static/tab/promote_selected.png"
mode=
"heightFix"
></image>
<image
v-else
class=
"tabs-image"
src=
"/static/tab/promote_unselected.png"
mode=
"heightFix"
></image>
</view>
书库
</view>
<view
:class=
"currentPage == 2?'tab active': 'tab'"
:style=
"'padding-bottom:' + bottomSafePadding + 'px;'"
@
click=
"tabChange(2)"
>
<view
:class=
"currentPage == 3?'tab active': 'tab'"
@
click=
"tabChange(3)"
>
<view
style=
"margin: 16rpx 0 11rpx;"
>
<image
v-if=
"currentPage==
2
"
class=
"tabs-image"
src=
"/static/tab/my_selected.png"
mode=
"heightFix"
>
<image
v-if=
"currentPage==
3
"
class=
"tabs-image"
src=
"/static/tab/my_selected.png"
mode=
"heightFix"
>
</image>
<image
v-else
class=
"tabs-image"
src=
"/static/tab/my_unselected.png"
mode=
"heightFix"
></image>
</view>
...
...
@@ -63,6 +69,7 @@
const
app
=
getApp
();
import
bookshelf
from
"@/components/bookshelf/bookshelf.vue"
;
import
bookcity
from
"@/components/bookcity/bookcity.vue"
;
import
warehouse
from
"@/components/warehouse/warehouse.vue"
;
import
userPage
from
"@/components/home/my.vue"
;
...
...
@@ -71,6 +78,7 @@
mixins
:
[
common
],
components
:
{
bookshelf
,
bookcity
,
warehouse
,
userPage
},
...
...
@@ -91,13 +99,7 @@
},
onShow
()
{
try
{
// 在子组件重写show()代替onShow()
// if (this.currentPage == 0) {
// this.$refs.index.show();
// } else if (this.currentPage == 1) {
// this.$refs.recommend.show();
// } else
if
(
this
.
currentPage
==
2
)
{
if
(
this
.
currentPage
==
3
)
{
this
.
$refs
.
user
.
show
();
}
}
catch
(
e
)
{
...
...
@@ -108,7 +110,7 @@
uni
.
$on
(
'refreshPreviousPage'
,
(
data
)
=>
{
if
(
data
.
vipFlag
==
'1'
)
{
// 开通vip刷新状态
if
(
that
.
currentPage
==
2
)
{
if
(
that
.
currentPage
==
3
)
{
that
.
$refs
.
user
.
show
();
}
}
...
...
@@ -138,13 +140,15 @@
if
(
this
.
currentPage
==
0
)
{
this
.
$refs
.
index
.
show
();
}
else
if
(
this
.
currentPage
==
1
)
{
this
.
$refs
.
recommend
.
show
();
this
.
$refs
.
city
.
show
();
}
else
if
(
this
.
currentPage
==
2
)
{
this
.
$refs
.
recommend
.
show
();
}
else
if
(
this
.
currentPage
==
3
)
{
this
.
$refs
.
user
.
show
();
}
}
else
{
if
(
this
.
currentPage
==
1
)
{
this
.
$refs
.
recommend
.
show
();
this
.
$refs
.
city
.
show
();
}
}
}
...
...
@@ -155,7 +159,7 @@
<
style
lang=
"scss"
>
.body
{
height
:
100%
;
background
-color
:
whitesmoke
;
background
:
#FFF7F7
;
}
.avatar
{
...
...
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