feat: 样式调整
This commit is contained in:
@@ -33,14 +33,17 @@ Page({
|
||||
onShow() {
|
||||
this._loadPrograms()
|
||||
this._onPlayerChange = () => this._updatePlayState()
|
||||
this._onSubChange = () => this._loadPrograms()
|
||||
this._onSubChange = () => this._loadChannelDetail()
|
||||
this._onVipChange = () => this._loadChannelDetail()
|
||||
app.on('playerStateChange', this._onPlayerChange)
|
||||
app.on('subscriptionChange', this._onSubChange)
|
||||
app.on('vipChange', this._onVipChange)
|
||||
},
|
||||
|
||||
onHide() {
|
||||
if (this._onPlayerChange) app.off('playerStateChange', this._onPlayerChange)
|
||||
if (this._onSubChange) app.off('subscriptionChange', this._onSubChange)
|
||||
if (this._onVipChange) app.off('vipChange', this._onVipChange)
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -78,6 +81,8 @@ Page({
|
||||
isVip: app.globalData.isVip,
|
||||
canPlay
|
||||
})
|
||||
// 详情加载后刷新节目列表(更新 _isLocked 状态)
|
||||
self._loadPrograms()
|
||||
}
|
||||
}).catch(function (err) {
|
||||
console.error('[ChannelDetail] 加载频道详情失败:', err)
|
||||
@@ -105,7 +110,7 @@ Page({
|
||||
return Object.assign({}, item, {
|
||||
_displayIndex: String(total - idx).padStart(2, '0'),
|
||||
_dateDot: item.createdAt ? item.createdAt.substring(0, 10).replace(/-/g, '.') : '',
|
||||
durationText: util.formatTime(item.duration || 0),
|
||||
durationText: item.duration > 0 ? util.formatTime(item.duration) : '',
|
||||
_isThisPlaying: gd.activeContent && gd.activeContent.id === item.id,
|
||||
_isLocked: !canPlay // 所有集全部锁定,没有试听
|
||||
})
|
||||
@@ -195,6 +200,11 @@ Page({
|
||||
},
|
||||
|
||||
goFirstProgram() {
|
||||
// 权限保护:不可播放时引导到订阅/VIP
|
||||
if (!this.data.canPlay) {
|
||||
this.onSubscribe()
|
||||
return
|
||||
}
|
||||
var list = this.data.domainContents
|
||||
if (list && list.length > 0) {
|
||||
var first = list[0]
|
||||
@@ -222,5 +232,24 @@ Page({
|
||||
|
||||
goBack() {
|
||||
wx.navigateBack()
|
||||
},
|
||||
|
||||
// ===================== 分享钩子 =====================
|
||||
onShareAppMessage() {
|
||||
const domain = this.data.domain || {}
|
||||
return {
|
||||
title: domain.name ? '听全声汇频道:' + domain.name : '全声汇 - 精选频道',
|
||||
path: '/pages/channel-detail/index?id=' + this._domainId,
|
||||
imageUrl: ''
|
||||
}
|
||||
},
|
||||
|
||||
onShareTimeline() {
|
||||
const domain = this.data.domain || {}
|
||||
return {
|
||||
title: domain.name ? '听全声汇频道:' + domain.name : '全声汇 - 精选频道',
|
||||
query: 'id=' + this._domainId,
|
||||
imageUrl: ''
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user