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
62cb8ae5
Commit
62cb8ae5
authored
May 31, 2024
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
772c36dc
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
58 deletions
+52
-58
User.js
vedio/common/models/User.js
+2
-2
userServices.js
vedio/common/services/userServices.js
+13
-13
bookshelf.vue
vedio/components/bookshelf/bookshelf.vue
+16
-16
my.vue
vedio/components/home/my.vue
+0
-3
warehouse.vue
vedio/components/warehouse/warehouse.vue
+6
-5
book-content.vue
vedio/page-subs/sub_A/book-content/book-content.vue
+11
-14
home.vue
vedio/pages/home.vue
+4
-5
No files found.
vedio/common/models/User.js
View file @
62cb8ae5
...
...
@@ -15,11 +15,11 @@ export default class User {
bookLegumes
}
=
param
||
{}
this
.
id
=
id
;
this
.
name
=
name
||
"
微信
用户"
;
this
.
name
=
name
||
"用户"
;
this
.
phone
=
phone
;
this
.
sign
=
sign
||
'书中自有颜如玉,书中自有黄金屋,书中自有千钟黍'
;
this
.
avater
=
'/static/images/logo.png'
;
this
.
nickName
=
nickName
||
"
微信
用户"
;
this
.
nickName
=
nickName
||
"用户"
;
this
.
roleId
=
roleId
;
this
.
sex
=
sex
;
this
.
status
=
status
;
...
...
vedio/common/services/userServices.js
View file @
62cb8ae5
...
...
@@ -104,15 +104,15 @@ function login(data, callback) {
function
refreshUserInfo
()
{
requestUserInfo
((
success
,
userData
)
=>
{
if
(
success
)
{
console
.
log
(
userData
)
let
user
=
new
User
({
...
userData
,
name
:
userData
.
usern
ame
,
nickName
:
userData
.
nick
n
ame
,
name
:
userData
.
nickN
ame
,
nickName
:
userData
.
nick
N
ame
,
avater
:
userData
.
avatar
,
isVip
:
userData
.
expireTime
>
0
id
:
userData
.
idcode
,
memberExpirationDate
:
userData
.
expireTime
})
console
.
log
(
user
)
console
.
log
(
userData
)
saveNickname
(
userData
.
nickname
);
saveUserInfo
(
user
);
// 存储用户数据
postNotification
(
KEY_NOTIFICATION_LOGIN_SUCCESS
);
// 通知登录成功
...
...
vedio/components/bookshelf/bookshelf.vue
View file @
62cb8ae5
vedio/components/home/my.vue
View file @
62cb8ae5
...
...
@@ -136,9 +136,6 @@
initHeight
()
{
const
query
=
uni
.
createSelectorQuery
().
in
(
this
);
query
.
select
(
"#count"
).
boundingClientRect
();
},
onShow
(){
},
show
()
{
// 更新阅读时间统计
...
...
vedio/components/warehouse/warehouse.vue
View file @
62cb8ae5
...
...
@@ -11,7 +11,7 @@
<swiper
:style=
"[listStyle]"
:indicator-dots=
"false"
:autoplay=
"false"
:current=
"currentIndex"
@
change=
"changeSwiper"
>
<swiper-item
v-for=
'(item, index) in categorys'
:key=
'index'
>
<WarehouseList
ref=
'bookList'
:category=
'item'
:height=
'listHeight'
></WarehouseList>
<WarehouseList
:ref=
"`bookList$
{index}`"
:category='item' :height='listHeight'>
</WarehouseList>
</swiper-item>
</swiper>
</view>
...
...
@@ -76,10 +76,11 @@
categroyChange
:
{
handler
:
function
(
n
,
o
)
{
this
.
$nextTick
(()
=>
{
let
ref
=
this
.
$refs
.
bookList
;
if
(
ref
)
{
ref
[
n
.
currentIndex
].
initRefresh
();
}
this
.
$refs
[
`bookList
${
n
.
currentIndex
}
`
][
0
].
initRefresh
();
// let ref = this.$refs.bookList;
// if (ref) {
// ref[n.currentIndex].initRefresh();
// }
})
},
deep
:
true
...
...
vedio/page-subs/sub_A/book-content/book-content.vue
View file @
62cb8ae5
...
...
@@ -10,10 +10,14 @@
@
tapVip=
'tapVipPop'
@
tapBean=
'tapBeanPop'
></detail-new-buy>
<detail-bottom
:detail=
'bookData'
:userInfo=
'userInfo'
@
tapBottomItem=
'tapBottomItem'
></detail-bottom>
<setting-pop
:show=
'showSetting'
@
close=
'closePop'
></setting-pop>
<vip-pop
v-if=
"bookData.isUnlock==0 && !isVip()"
:show=
'showVip'
@
close=
'closeVipPop'
></vip-pop>
<
!--
<
vip-pop
v-if=
"bookData.isUnlock==0 && !isVip()"
:show=
'showVip'
@
close=
'closeVipPop'
></vip-pop>
<bean-pop
v-if=
"bookData.isUnlock==0 && userInfo.bookLegumes
<bookData
.
bookLegumes
"
:show=
'showBean'
@
close=
'closeBeanPop'
></bean-pop>
@
close=
'closeBeanPop'
></bean-pop>
-->
<recommend-pop
:show=
'showRecommend'
@
close=
'closeRecommendPop'
:bookId=
"bookId"
></recommend-pop>
<coin-popup
v-if=
"bookData.isUnlock==0 && !isVip()"
:show=
"showVip"
@
close=
"closeVipPop"
@
paySuccess=
"paySuccess"
>
</coin-popup>
</
template
>
<c-login
:isShareLink=
"true"
></c-login>
<popup
:show=
"showMoibleLogin"
@
close=
"showMoibleLogin=false"
>
...
...
@@ -127,11 +131,8 @@
if
(
info
.
userInfo
)
{
addReadRecord
(
this
.
bookId
)
}
console
.
log
(
info
)
console
.
log
(
this
.
userInfo
)
// this.showVipOpen = data.openVips
// this.showVipOpen = data.openVips
// // 用户变动,需要刷新数据
// this.$nextTick(() => {
// uni.startPullDownRefresh({})
...
...
@@ -259,10 +260,8 @@
setTimeout
(()
=>
{
uni
.
stopPullDownRefresh
();
if
(
success
)
{
this
.
bookData
=
new
BookDetail
(
data
);
console
.
log
(
'bookData='
+
JSON
.
stringify
(
this
.
bookData
));
// console.log('bookData=' + JSON.stringify(this.bookData));
}
},
1000
)
})
...
...
@@ -290,10 +289,8 @@
}
},
isVip
()
{
if
(
this
.
userInfo
!=
null
&&
this
.
userInfo
.
memberFlag
)
{
let
cDate
=
new
Date
();
cDate
=
cDate
.
getTime
();
return
this
.
userInfo
.
memberExpirationDate
>=
cDate
;
if
(
this
.
userInfo
!=
null
&&
this
.
userInfo
.
memberExpirationDate
>
0
)
{
return
true
;
}
return
false
;
},
...
...
vedio/pages/home.vue
View file @
62cb8ae5
...
...
@@ -68,7 +68,6 @@
if
(
index
!=
''
&&
index
!=
undefined
)
{
this
.
currentPage
=
index
}
},
onShow
()
{
// try {
...
...
@@ -92,7 +91,7 @@
tabChange
(
index
)
{
if
(
this
.
currentPage
==
index
)
return
this
.
currentPage
=
index
;
//
this.loadComponentData();
this
.
loadComponentData
();
},
loadComponentData
()
{
if
(
this
.
currentPage
==
0
)
{
...
...
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