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
f35d8b1f
Commit
f35d8b1f
authored
Aug 22, 2024
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
b3fa5c61
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
74 additions
and
106 deletions
+74
-106
bookshelf-list.vue
vedio/components/bookshelf/components/bookshelf-list.vue
+1
-1
warehouse-list.vue
vedio/components/warehouse/components/warehouse-list.vue
+3
-0
warehouse.vue
vedio/components/warehouse/warehouse.vue
+6
-4
book-content.vue
vedio/page-subs/sub_A/book-content/book-content.vue
+4
-30
book-long-content.vue
...o/page-subs/sub_A/book-long-content/book-long-content.vue
+39
-51
detail-content.vue
...ubs/sub_A/book-long-content/components/detail-content.vue
+16
-20
home.vue
vedio/pages/home.vue
+5
-0
No files found.
vedio/components/bookshelf/components/bookshelf-list.vue
View file @
f35d8b1f
...
...
@@ -91,7 +91,7 @@
}
},
tapItem
(
e
,
index
)
{
if
(
index
>=
this
.
dataList
.
length
-
1
)
{
if
(
index
>=
this
.
dataList
.
length
-
1
)
{
uni
.
$emit
(
'goWareHouse'
)
return
}
...
...
vedio/components/warehouse/components/warehouse-list.vue
View file @
f35d8b1f
...
...
@@ -54,6 +54,9 @@
this
.
refreshList
();
}
},
isEmpty
()
{
return
isEmpty
(
this
.
dataList
)
},
refreshList
()
{
this
.
$nextTick
(()
=>
{
let
ref
=
this
.
$refs
.
list
;
...
...
vedio/components/warehouse/warehouse.vue
View file @
f35d8b1f
...
...
@@ -76,18 +76,20 @@
watch
:
{
categroyChange
:
{
handler
:
function
(
n
,
o
)
{
setTimeout
(()
=>
{
if
(
this
.
$refs
[
`bookList
${
n
.
currentIndex
}
`
])
{
this
.
$refs
[
`bookList
${
n
.
currentIndex
}
`
][
0
].
initRefresh
();
}
,
300
)
}
},
deep
:
true
}
},
methods
:
{
show
()
{
if
(
this
.
$refs
[
`bookList
${
this
.
currentIndex
}
`
][
0
].
isEmpty
())
{
this
.
$refs
[
`bookList
${
this
.
currentIndex
}
`
][
0
].
initRefresh
();
}
},
hide
()
{
},
hide
()
{},
readyCategory
()
{
setTimeout
(()
=>
{
this
.
initHeight
()
...
...
vedio/page-subs/sub_A/book-content/book-content.vue
View file @
f35d8b1f
...
...
@@ -135,26 +135,9 @@
if
(
info
.
userInfo
)
{
addReadRecord
(
this
.
bookId
)
}
// this.showVipOpen = data.openVips
// // 用户变动,需要刷新数据
// this.$nextTick(() => {
// uni.startPullDownRefresh({})
// })
},
this
)
// 用户变动,需要刷新数据
this
.
$nextTick
(()
=>
{
uni
.
startPullDownRefresh
({})
})
// 绑定分享参数
// #ifdef MP-WEIXIN
wx
.
onCopyUrl
(()
=>
{
return
{
query
:
`bookId=
${
this
.
bookData
.
id
}
`
}
})
// #endif
this
.
refreshBookData
(
this
.
bookId
)
},
onShow
()
{
refreshUserInfo
();
...
...
@@ -177,9 +160,6 @@
wx
.
offCopyUrl
()
// #endif
},
onPullDownRefresh
()
{
this
.
refreshBookData
(
this
.
bookId
)
},
// 文章分享
onShareAppMessage
()
{
let
result
=
{
...
...
@@ -255,21 +235,15 @@
},
// 文章数据刷新
refreshBookData
(
bookId
)
{
// getOpens((success, data) => {
// // this.showBeanOpen = data.openBeans
// this.showVipOpen = data.openVips
// })
getBookDetailData
(
bookId
,
(
success
,
data
)
=>
{
setTimeout
(()
=>
{
uni
.
stopPullDownRefresh
();
if
(
success
)
{
this
.
bookData
=
new
BookDetail
(
data
);
// console.log('bookData=' + JSON.stringify(this.bookData));
}
},
100
)
})
},
paySuccess
()
{
paySuccess
()
{
this
.
showVip
=
false
;
this
.
$set
(
this
.
bookData
,
"isUnlock"
,
true
);
},
...
...
@@ -363,8 +337,8 @@
},
300
);
},
vipbackpaySuccess
(
largeType
)
{
this
.
vipbackClose
();
this
.
vipbackClose
();
this
.
$set
(
this
.
bookData
,
"isUnlock"
,
true
);
}
}
...
...
vedio/page-subs/sub_A/book-long-content/book-long-content.vue
View file @
f35d8b1f
...
...
@@ -10,11 +10,11 @@
@
tabVip=
'tapVipPop'
></catalogue-pop>
<recommend-pop
:show=
'showRecommend'
@
close=
'closeRecommendPop'
:bookId=
"bookId"
></recommend-pop>
<coin-popup
v-if=
"bookData.isUnlock==0 && !isVip()"
:show=
"showVip"
@
close=
"coinClose($event)"
:vedioId=
"bookData.id"
@
paySuccess=
"paySuccess"
>
</coin-popup>
<vipback-popup
:show=
"showVipbackPop"
:vipBean=
"backvipBean"
@
vipbackclose=
"vipbackClose()"
<coin-popup
v-if=
"bookData.isUnlock==0 && !isVip()"
:show=
"showVip"
@
close=
"coinClose($event)"
:vedioId=
"bookData.id"
@
paySuccess=
"paySuccess"
>
</coin-popup>
<vipback-popup
:show=
"showVipbackPop"
:vipBean=
"backvipBean"
@
vipbackclose=
"vipbackClose()"
@
vipbackpaySuccess=
"vipbackpaySuccess"
/>
</
template
>
</view>
...
...
@@ -41,8 +41,8 @@
import
SettingPop
from
"./components/setting-pop.vue"
;
import
CataloguePop
from
"./components/catalogue-pop.vue"
;
import
VipPop
from
"./components/vip-pop.vue"
;
import
BeanPop
from
"./components/bean-pop.vue"
;
import
VipbackPopup
from
'@/components/vipback-popup/vipback-popup.vue'
;
import
BeanPop
from
"./components/bean-pop.vue"
;
import
VipbackPopup
from
'@/components/vipback-popup/vipback-popup.vue'
;
import
CoinPopup
from
"@/components/coin-popup/coin-popup.vue"
;
import
RecommendPop
from
"./components/recommend-pop.vue"
;
import
SystemInfoMixin
from
"../../../common/mixins/system-info-mixin.js"
;
...
...
@@ -77,8 +77,8 @@
VipPop
,
BeanPop
,
RecommendPop
,
CataloguePop
,
VipbackPopup
,
CataloguePop
,
VipbackPopup
,
CoinPopup
,
},
data
()
{
...
...
@@ -94,8 +94,8 @@
showVipOpen
:
0
,
showBeanOpen
:
0
,
current
:
1
,
height
:
0
,
showVipbackPop
:
false
,
height
:
0
,
showVipbackPop
:
false
,
backvipBean
:
null
,
};
},
...
...
@@ -121,17 +121,10 @@
if
(
this
.
isVip
()
&&
this
.
bookData
)
{
this
.
paySuccess
()
}
// // 用户变动,需要刷新数据
// this.$nextTick(() => {
// uni.startPullDownRefresh({})
// })
},
this
)
this
.
$nextTick
(()
=>
{
uni
.
startPullDownRefresh
({})
})
this
.
refreshBookData
(
this
.
bookId
)
let
that
=
this
uni
.
getSystemInfo
({
success
(
res
)
{
...
...
@@ -153,14 +146,6 @@
endCountReadTime
();
// 移除监听
removeUserInfoChangeWatch
(
this
);
// 取消绑定分享参数
// #ifdef MP-WEIXIN
wx
.
offCopyUrl
()
// #endif
},
onPullDownRefresh
()
{
this
.
refreshBookData
(
this
.
bookId
)
},
// 文章分享
onShareAppMessage
()
{
...
...
@@ -200,19 +185,17 @@
},
methods
:
{
// 解锁回调
paySuccess
()
{
this
.
showVip
=
false
;
paySuccess
()
{
this
.
showVip
=
false
;
this
.
$set
(
this
.
bookData
,
"isUnlock"
,
1
);
this
.
$set
(
this
.
bookData
,
"freeNum"
,
this
.
bookData
.
articleChapterList
.
length
);
this
.
$refs
.
content
.
reloadChapterinfoData
()
this
.
$nextTick
(()
=>
{
this
.
$refs
.
content
.
reloadChapterinfoData
()
})
},
// 文章数据刷新
refreshBookData
(
bookId
)
{
// getOpens((success, data) => {
// this.showBeanOpen = data.openBeans
// this.showVipOpen = data.openVips
// })
getBookDetailData
(
bookId
,
(
success
,
data
)
=>
{
uni
.
stopPullDownRefresh
();
if
(
success
)
{
...
...
@@ -274,7 +257,7 @@
},
changeCurrent
(
current
)
{
this
.
current
=
current
},
},
coinClose
(
e
)
{
let
item
=
e
.
detail
.
data
;
...
...
@@ -285,29 +268,34 @@
},
300
);
}
else
{
this
.
showVip
=
false
;
if
(
this
.
bookData
.
isUnlock
==
0
)
{
setTimeout
(()
=>
{
this
.
showRecommend
=
true
;
},
300
);
}
}
},
vipbackClose
()
{
this
.
showVip
=
false
;
this
.
showVipbackPop
=
false
;
this
.
paySuccess
()
if
(
this
.
bookData
.
isUnlock
==
0
)
{
setTimeout
(()
=>
{
this
.
showRecommend
=
true
;
},
300
);
}
},
vipback
Close
(
)
{
vipback
paySuccess
(
largeType
)
{
this
.
showVip
=
false
;
this
.
showVipbackPop
=
false
;
if
(
this
.
bookData
.
isUnlock
==
0
)
{
setTimeout
(()
=>
{
this
.
showRecommend
=
true
;
},
300
);
}
},
vipbackpaySuccess
(
largeType
)
{
this
.
showVip
=
false
;
this
.
showVipbackPop
=
false
;
this
.
$set
(
this
.
bookData
,
"isUnlock"
,
1
);
this
.
$set
(
this
.
bookData
,
"freeNum"
,
this
.
bookData
.
articleChapterList
.
length
);
this
.
$refs
.
content
.
reloadChapterinfoData
()
this
.
$set
(
this
.
bookData
,
"isUnlock"
,
1
);
this
.
$set
(
this
.
bookData
,
"freeNum"
,
this
.
bookData
.
articleChapterList
.
length
);
this
.
$nextTick
(()
=>
{
this
.
$refs
.
content
.
reloadChapterinfoData
()
})
}
}
}
...
...
vedio/page-subs/sub_A/book-long-content/components/detail-content.vue
View file @
f35d8b1f
...
...
@@ -122,27 +122,21 @@
this
.
page
=
this
.
step
/
(
this
.
size
-
1
)
*
100
},
deep
:
true
},
cata
:
{
handler
(
val
,
oldVal
)
{
this
.
page
=
this
.
step
/
(
this
.
size
-
1
)
*
100
},
deep
:
true
}
},
destroyed
()
{
removeContentFormatChangeWatch
(
this
);
},
mounted
()
{
let
_this
=
this
uni
.
getSystemInfo
({
success
(
res
)
{
_this
.
winWidth
=
res
.
screenWidth
_this
.
height
=
res
.
screenHeight
-
66
_this
.
lineHeight
=
(
res
.
screenHeight
-
66
)
/
16
}
})
mounted
()
{
let
_this
=
this
uni
.
getSystemInfo
({
success
(
res
)
{
_this
.
winWidth
=
res
.
screenWidth
_this
.
height
=
res
.
screenHeight
-
66
_this
.
lineHeight
=
(
res
.
screenHeight
-
66
)
/
16
}
})
// 监听样式变动
watchContentFormatChange
((
data
)
=>
{
let
result
=
data
.
getFormatValue
();
...
...
@@ -186,6 +180,8 @@
let
id
=
this
.
detail
.
articleChapterList
[
chapterId
-
1
].
id
getChapterinfoData
(
this
.
detail
.
id
,
id
,
(
success
,
data
)
=>
{
if
(
success
)
{
this
.
read
=
0
this
.
step
=
0
this
.
info
.
data
=
[{
id
:
chapterId
,
sub
:
data
.
chapterId
,
...
...
@@ -201,7 +197,7 @@
getHeight
(
prev
)
{
let
_this
=
this
setTimeout
(
function
()
{
const
query
=
uni
.
createSelectorQuery
().
in
(
_this
);
const
query
=
_this
.
createSelectorQuery
().
in
(
_this
);
query
.
select
(
'#html .content'
).
boundingClientRect
(
data
=>
{
let
_size
=
Math
.
ceil
(
data
.
height
/
_this
.
height
)
_this
.
size
=
Math
.
ceil
((
data
.
height
+
_size
*
(
_this
.
lineHeight
*
2
))
/
...
...
@@ -213,7 +209,7 @@
_this
.
step
=
_this
.
size
-
1
}
}).
exec
();
},
3
00
)
},
5
00
)
},
prev
()
{
let
_this
=
this
...
...
@@ -234,7 +230,7 @@
sub
:
_this
.
catalogue
,
content
:
data
})
_this
.
catalogue
-=
1
_this
.
catalogue
-=
1
_this
.
changeCurrent
()
_this
.
size
=
0
_this
.
getHeight
(
true
)
...
...
@@ -280,7 +276,7 @@
content
:
data
})
_this
.
catalogue
+=
1
_this
.
catalogue
+=
1
_this
.
changeCurrent
()
_this
.
read
+=
1
_this
.
size
=
0
...
...
vedio/pages/home.vue
View file @
f35d8b1f
...
...
@@ -111,6 +111,11 @@
mounted
()
{
// 渲染完成 初始化首页数据
this
.
loadComponentData
();
let
that
=
this
uni
.
$on
(
'goWareHouse'
,
function
(
data
)
{
that
.
tabChange
(
1
)
})
},
methods
:
{
tabChange
(
index
)
{
...
...
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