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
0f160df4
Commit
0f160df4
authored
Aug 22, 2024
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
c13fbd42
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
229 deletions
+36
-229
book-content.vue
vedio/page-subs/sub_A/book-content/book-content.vue
+19
-28
detail-content.vue
...age-subs/sub_A/book-content/components/detail-content.vue
+4
-2
detail-new-buy.vue
...age-subs/sub_A/book-content/components/detail-new-buy.vue
+5
-163
book-long-content.vue
...o/page-subs/sub_A/book-long-content/book-long-content.vue
+8
-36
No files found.
vedio/page-subs/sub_A/book-content/book-content.vue
View file @
0f160df4
...
...
@@ -2,10 +2,8 @@
<z-paging
:style=
"[bgStyle]"
>
<template>
<detail-thumb
:detail=
'bookData'
></detail-thumb>
<detail-content
@
tapVip=
'tapVipPop'
:detail=
'bookData'
:userInfo=
'userInfo'
></detail-content>
<detail-new-buy
v-if=
"bookData.isUnlock==0 && !isVip()"
:detail=
'bookData'
:userInfo=
'userInfo'
@
tapVip=
'tapVipPop'
></detail-new-buy>
<detail-content
:detail=
'bookData'
:userInfo=
'userInfo'
@
tapVip=
'tapVipPop'
></detail-content>
<detail-new-buy
v-if=
"bookData.isUnlock==0 && !isVip()"
@
tapVip=
'tapVipPop'
></detail-new-buy>
<detail-bottom
:detail=
'bookData'
:userInfo=
'userInfo'
@
tapBottomItem=
'tapBottomItem'
></detail-bottom>
<setting-pop
:show=
'showSetting'
@
close=
'closePop'
></setting-pop>
<coin-popup
v-if=
"bookData.isUnlock==0 && !isVip()"
:show=
"showVip"
@
close=
"coinClose($event)"
...
...
@@ -32,7 +30,7 @@
collectionBook
}
from
"../../../common/services/index.js"
import
DetailThumb
from
"./components/detail-thumb.vue"
;
import
DetailContent
from
"./components/detail-content.vue"
;
import
DetailContent
from
"./components/detail-content.vue"
;
import
DetailNewBuy
from
"./components/detail-new-buy.vue"
;
import
DetailBottom
from
"./components/detail-bottom.vue"
;
import
config
from
"../../../config/index.js"
;
...
...
@@ -56,21 +54,21 @@
DetailThumb
,
DetailContent
,
DetailBottom
,
SettingPop
,
SettingPop
,
DetailNewBuy
,
VipbackPopup
,
CoinPopup
,
},
data
()
{
return
{
bookId
:
null
,
bookData
:
null
,
bookId
:
''
,
bookData
:
{}
,
backgroundColor
:
"#fff"
,
showSetting
:
false
,
showVip
:
false
,
userInfo
:
null
,
userInfo
:
{}
,
showVipOpen
:
0
,
showVipbackPop
:
false
,
showVipbackPop
:
false
,
vipPopRefresh
:
false
,
backvipBean
:
null
,
};
...
...
@@ -135,9 +133,6 @@
return
result
;
},
computed
:
{
showEmpty
:
function
()
{
return
isEmpty
(
this
.
bookData
)
},
bgStyle
:
function
()
{
let
height
=
300
;
if
(
this
.
windowHeight
)
{
...
...
@@ -162,10 +157,6 @@
}
},
methods
:
{
// 解锁回调
unlockBook
()
{
this
.
$set
(
this
.
bookData
,
"isUnlock"
,
true
);
},
// 文章数据刷新
refreshBookData
(
bookId
)
{
getBookDetailData
(
bookId
,
(
success
,
data
)
=>
{
...
...
@@ -215,10 +206,10 @@
// 关闭设置弹窗
closePop
(
e
)
{
this
.
showSetting
=
false
;
},
},
// 价格弹窗
coinClose
(
e
)
{
this
.
vipPopRefresh
=
false
;
coinClose
(
e
)
{
this
.
vipPopRefresh
=
false
;
let
item
=
e
.
detail
.
data
;
if
(
item
!=
null
)
{
...
...
@@ -229,18 +220,18 @@
}
else
{
this
.
showVip
=
false
;
}
},
},
// 价格挽留弹窗
vipbackClose
()
{
this
.
vipPopRefresh
=
false
;
vipbackClose
()
{
this
.
vipPopRefresh
=
false
;
// this.showVip = false;
this
.
showVipbackPop
=
false
;
this
.
showVipbackPop
=
false
;
this
.
vipPopRefresh
=
true
;
},
},
// 价格挽留弹窗-支付成功回调
vipbackpaySuccess
(
largeType
)
{
this
.
vipPopRefresh
=
false
;
this
.
showVip
=
false
;
vipbackpaySuccess
(
largeType
)
{
this
.
vipPopRefresh
=
false
;
this
.
showVip
=
false
;
this
.
showVipbackPop
=
false
;
this
.
$set
(
this
.
bookData
,
"isUnlock"
,
true
);
...
...
vedio/page-subs/sub_A/book-content/components/detail-content.vue
View file @
0f160df4
...
...
@@ -48,7 +48,7 @@
},
data
:
function
()
{
return
{
user
:
null
,
user
:
{}
,
fontSize
:
`18px`
,
PRECENT_VALUE
:
40
}
...
...
@@ -79,7 +79,9 @@
},
computed
:
{
contentSources
:
function
()
{
return
[...
this
.
detail
.
free
,
...
this
.
detail
.
charge
];
return
this
.
detail
&&
this
.
detail
.
free
&&
this
.
detail
.
charge
?
[...
this
.
detail
.
free
,
...
this
.
detail
.
charge
]
:
[];
},
preContentSources
:
function
()
{
return
this
.
detail
&&
this
.
detail
.
free
?
[...
this
.
detail
.
free
]
:
[];
...
...
vedio/page-subs/sub_A/book-content/components/detail-new-buy.vue
View file @
0f160df4
<
template
>
<view
class=
"detail-buy"
>
<view
class=
"book-card"
>
<view
v-if=
"!isVip() "
class=
"section"
style=
"margin-top: 30rpx;"
>
<button
class=
"btn2"
:disabled=
"loading"
:loading=
"loading"
@
click=
"tapVip"
>
开通会员,免费阅读本书
</button>
<view
class=
"section"
style=
"margin-top: 30rpx;"
>
<button
class=
"btn2"
@
click=
"tapVip"
>
开通会员,免费阅读本书
</button>
</view>
</view>
<view
class=
"warn-box"
>
...
...
@@ -24,99 +23,13 @@
</
template
>
<
script
>
import
Pack
from
"../../../../common/models/Pack.js"
;
import
BookBeanPack
from
"../../../../common/models/BookBeanPack.js"
import
{
showLoginView
,
}
from
"../../../../common/services/userServices.js"
import
{
buyBookWithBookBean
}
from
"../../../../common/services/index.js"
;
import
{
toastHide
,
toastLoading
,
toastMessage
}
from
"../../../../common/utils/toastUtil.js"
;
export
default
{
props
:
{
detail
:
{
type
:
Object
,
default
:
function
()
{
return
{}
}
},
userInfo
:
{
type
:
Object
,
default
:
function
()
{
return
null
}
},
showVipOpen
:
{
type
:
Number
,
default
:
1
},
showBeanOpen
:
{
type
:
Number
,
default
:
1
}
},
data
:
function
()
{
return
{
selectedIndex
:
0
,
loading
:
false
,
imageError
:
true
}
},
computed
:
{
bookBeanText
:
function
()
{
if
(
this
.
userInfo
&&
this
.
detail
)
{
if
(
this
.
userInfo
.
bookLegumes
<
this
.
detail
.
bookLegumes
)
{
return
'余额不足,立即充值'
}
}
return
'全本订阅'
;
},
bookAllBeanCount
:
function
()
{
if
(
this
.
userInfo
)
return
this
.
userInfo
.
bookLegumes
return
0
;
},
bookBeanCount
:
function
()
{
return
this
.
detail
&&
this
.
detail
.
bookLegumes
?
`
${
this
.
detail
.
bookLegumes
}
`
:
"免费"
},
},
mounted
()
{
return
{}
},
methods
:
{
isVip
()
{
if
(
this
.
userInfo
!=
null
&&
this
.
userInfo
.
memberFlag
)
{
let
cDate
=
new
Date
();
cDate
=
cDate
.
getTime
();
return
this
.
userInfo
.
memberExpirationDate
>=
cDate
;
}
return
false
;
},
tapBeanBtn
()
{
let
isIOS
=
wx
.
getSystemInfoSync
().
platform
;
if
(
isIOS
===
'ios'
)
{
uni
.
showToast
({
title
:
'暂不支持IOS系统'
,
icon
:
'none'
})
return
}
if
(
this
.
userInfo
&&
this
.
detail
)
{
if
(
this
.
userInfo
.
bookLegumes
<
this
.
detail
.
bookLegumes
)
{
this
.
tapBean
()
return
}
}
this
.
tapBuy
()
},
tapVip
()
{
let
isIOS
=
wx
.
getSystemInfoSync
().
platform
;
let
isIOS
=
tt
.
getSystemInfoSync
().
platform
;
if
(
isIOS
===
'ios'
)
{
uni
.
showToast
({
title
:
'暂不支持IOS系统'
,
...
...
@@ -127,41 +40,7 @@
}
// 展示充值VIP弹框
this
.
$emit
(
'tapVip'
)
},
tapBean
()
{
// 展示充值书豆弹框
this
.
$emit
(
'tapBean'
)
},
tapBuy
()
{
if
(
!
this
.
userInfo
)
{
uni
.
showModal
({
title
:
"登录"
,
content
:
"购买前请前往登录系统"
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
showLoginView
()
}
}
})
return
;
}
if
(
this
.
userInfo
.
bookLegumes
<
this
.
detail
.
bookLegumes
)
{
uni
.
showModal
({
title
:
"余额不足"
,
content
:
`当前余额:
${
this
.
userInfo
.
bookLegumes
}
, 请前往充值`
,
showCancel
:
false
,
confirmText
:
"知道了"
})
return
;
}
toastLoading
(
"购买中"
);
buyBookWithBookBean
(
this
.
detail
.
id
,
(
success
,
data
)
=>
{
toastHide
();
if
(
success
)
{
this
.
$emit
(
"unlockBook"
)
}
})
},
}
}
}
</
script
>
...
...
@@ -205,43 +84,6 @@
line-height
:
80rpx
;
}
}
.line-box
{
display
:
flex
;
flex-direction
:
row
;
padding
:
30rpx
;
flex-wrap
:
wrap
;
align-items
:
center
;
.line
{
width
:
30%
;
background-color
:
lightgray
;
height
:
1rpx
;
}
.text
{
text-align
:
center
;
width
:
36%
;
color
:
lightgray
;
font-size
:
26rpx
;
}
}
.text-box
{
display
:
flex
;
flex-direction
:
row
;
.text1
{
font-size
:
24rpx
;
color
:
black
;
}
.text2
{
padding
:
0
10rpx
;
font-size
:
24rpx
;
color
:
#DCBD3B
;
}
}
}
.warn-box
{
...
...
vedio/page-subs/sub_A/book-long-content/book-long-content.vue
View file @
0f160df4
...
...
@@ -8,9 +8,6 @@
<setting-pop
:show=
'showSetting'
@
close=
'closePop'
></setting-pop>
<catalogue-pop
:detail=
'bookData'
:show=
'showCatalogue'
@
close=
'closeCataPop'
:current=
"current"
@
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"
:vipPopRefresh=
"vipPopRefresh"
>
</coin-popup>
...
...
@@ -32,7 +29,6 @@
import
{
collectionBook
}
from
"../../../common/services/index.js"
import
DetailWarn
from
"./components/detail-warn.vue"
;
import
DetailThumb
from
"./components/detail-thumb.vue"
;
import
DetailContent
from
"./components/detail-content.vue"
;
import
DetailBottom
from
"./components/detail-bottom.vue"
;
...
...
@@ -40,11 +36,8 @@
import
config
from
"../../../config/index.js"
;
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
CoinPopup
from
"@/components/coin-popup/coin-popup.vue"
;
import
RecommendPop
from
"./components/recommend-pop.vue"
;
import
SystemInfoMixin
from
"../../../common/mixins/system-info-mixin.js"
;
import
{
gotoBookCoverPage
...
...
@@ -53,13 +46,11 @@
watchUserInfoChange
,
removeUserInfoChangeWatch
,
refreshUserInfo
,
postPhone
}
from
"../../../common/services/userServices.js"
import
{
noticeCollectionListChange
,
startCountReadTime
,
endCountReadTime
,
getOpens
}
from
"../../../common/services/index.js"
import
{
saveStorage
,
...
...
@@ -88,14 +79,10 @@
showSetting
:
false
,
showCatalogue
:
false
,
showVip
:
false
,
showBean
:
false
,
showRecommend
:
false
,
userInfo
:
null
,
showVipOpen
:
0
,
showBeanOpen
:
0
,
current
:
1
,
height
:
0
,
showVipbackPop
:
false
,
showVipbackPop
:
false
,
vipPopRefresh
:
false
,
backvipBean
:
null
,
};
...
...
@@ -186,8 +173,8 @@
},
methods
:
{
// 解锁回调
paySuccess
()
{
this
.
vipPopRefresh
=
false
;
paySuccess
()
{
this
.
vipPopRefresh
=
false
;
this
.
showVip
=
false
;
this
.
$set
(
this
.
bookData
,
"isUnlock"
,
1
);
...
...
@@ -251,15 +238,11 @@
closeCataPop
(
e
)
{
this
.
showCatalogue
=
false
;
},
// 关闭推荐弹窗
closeRecommendPop
(
e
)
{
this
.
showRecommend
=
false
;
},
changeCurrent
(
current
)
{
this
.
current
=
current
},
coinClose
(
e
)
{
this
.
vipPopRefresh
=
false
;
coinClose
(
e
)
{
this
.
vipPopRefresh
=
false
;
let
item
=
e
.
detail
.
data
;
if
(
item
!=
null
)
{
...
...
@@ -269,26 +252,15 @@
},
300
);
}
else
{
this
.
showVip
=
false
;
// if (this.bookData.isUnlock == 0) {
// setTimeout(() => {
// this.showRecommend = true;
// }, 300);
// }
}
},
vipbackClose
()
{
// this.showVip = false;
this
.
showVipbackPop
=
false
;
this
.
showVipbackPop
=
false
;
this
.
vipPopRefresh
=
true
;
// if (this.bookData.isUnlock == 0) {
// setTimeout(() => {
// this.showRecommend = true;
// }, 300);
// }
},
vipbackpaySuccess
(
largeType
)
{
this
.
vipPopRefresh
=
false
;
vipbackpaySuccess
(
largeType
)
{
this
.
vipPopRefresh
=
false
;
this
.
showVip
=
false
;
this
.
showVipbackPop
=
false
;
...
...
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