mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-05-11 11:05:56 +08:00
收藏页面添加观看至第几集的信息
This commit is contained in:
@@ -134,20 +134,18 @@ export default {
|
|||||||
},
|
},
|
||||||
starEvent () {
|
starEvent () {
|
||||||
star.find({ key: this.detail.key, ids: this.info.id }).then(res => {
|
star.find({ key: this.detail.key, ids: this.info.id }).then(res => {
|
||||||
const docs = {
|
|
||||||
key: this.detail.key,
|
|
||||||
ids: this.info.id,
|
|
||||||
name: this.info.name,
|
|
||||||
type: this.info.type,
|
|
||||||
year: this.info.year,
|
|
||||||
last: this.info.last,
|
|
||||||
note: this.info.note
|
|
||||||
}
|
|
||||||
if (res) {
|
if (res) {
|
||||||
star.update(res.id, docs).then(res => {
|
this.$message.info('该影片已被收藏')
|
||||||
this.$message.success('已存在,更新成功')
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
|
const docs = {
|
||||||
|
key: this.detail.key,
|
||||||
|
ids: this.info.id,
|
||||||
|
name: this.info.name,
|
||||||
|
type: this.info.type,
|
||||||
|
year: this.info.year,
|
||||||
|
last: this.info.last,
|
||||||
|
note: this.info.note
|
||||||
|
}
|
||||||
star.add(docs).then(res => {
|
star.add(docs).then(res => {
|
||||||
this.$message.success('收藏成功')
|
this.$message.success('收藏成功')
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<li v-show="this.history.length > 0">
|
<li v-show="this.history.length > 0">
|
||||||
<span class="name">名字</span>
|
<span class="name">名字</span>
|
||||||
<span class="site">片源</span>
|
<span class="site">片源</span>
|
||||||
<span class="note">播放至</span>
|
<span class="note">观看至</span>
|
||||||
<span class="operate">
|
<span class="operate">
|
||||||
<span class="btn"></span>
|
<span class="btn"></span>
|
||||||
<span class="btn"></span>
|
<span class="btn"></span>
|
||||||
|
|||||||
@@ -407,6 +407,7 @@ export default {
|
|||||||
history.add(doc)
|
history.add(doc)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
this.updateStar()
|
||||||
this.timerEvent()
|
this.timerEvent()
|
||||||
},
|
},
|
||||||
changeVideo () {
|
changeVideo () {
|
||||||
@@ -465,21 +466,33 @@ export default {
|
|||||||
this.right.history = res.reverse()
|
this.right.history = res.reverse()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
starEvent () {
|
updateStar () {
|
||||||
const info = this.video.info
|
const info = this.video.info
|
||||||
star.find({ key: this.video.key, ids: info.id }).then(res => {
|
star.find({ key: this.video.key, ids: info.id }).then(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
this.$message.info('已存在')
|
res.index = info.index
|
||||||
|
star.update(res.id, res)
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message.warning('检查收藏失败')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
starEvent () {
|
||||||
|
const info = this.video.info
|
||||||
|
star.find({ key: this.video.key, ids: info.id }).then(res => {
|
||||||
|
const doc = {
|
||||||
|
key: this.video.key,
|
||||||
|
ids: info.id,
|
||||||
|
name: info.name,
|
||||||
|
type: info.type,
|
||||||
|
year: info.year,
|
||||||
|
last: info.last,
|
||||||
|
note: info.note,
|
||||||
|
index: info.index
|
||||||
|
}
|
||||||
|
if (res) {
|
||||||
|
star.update(res.id, doc)
|
||||||
} else {
|
} else {
|
||||||
const doc = {
|
|
||||||
key: this.video.key,
|
|
||||||
ids: info.id,
|
|
||||||
name: info.name,
|
|
||||||
type: info.type,
|
|
||||||
year: info.year,
|
|
||||||
last: info.last,
|
|
||||||
note: info.note
|
|
||||||
}
|
|
||||||
star.add(doc).then(starRes => {
|
star.add(doc).then(starRes => {
|
||||||
this.$message.success('收藏成功')
|
this.$message.success('收藏成功')
|
||||||
this.isStar = true
|
this.isStar = true
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
<span class="time">上映</span>
|
<span class="time">上映</span>
|
||||||
<span class="site">片源</span>
|
<span class="site">片源</span>
|
||||||
<span class="note">备注</span>
|
<span class="note">备注</span>
|
||||||
|
<span class="note">观看至</span>
|
||||||
<span class="operate">
|
<span class="operate">
|
||||||
<span class="btn"></span>
|
<span class="btn"></span>
|
||||||
<span class="btn"></span>
|
<span class="btn"></span>
|
||||||
@@ -29,6 +30,7 @@
|
|||||||
<span class="time">{{i.year}}</span>
|
<span class="time">{{i.year}}</span>
|
||||||
<span class="site">{{getSiteName(i.key)}}</span>
|
<span class="site">{{getSiteName(i.key)}}</span>
|
||||||
<span class="note">{{i.note}}</span>
|
<span class="note">{{i.note}}</span>
|
||||||
|
<span class="note">{{getHistoryNote(i.index)}}</span>
|
||||||
<span class="operate">
|
<span class="operate">
|
||||||
<span class="btn" @click.stop="playEvent(i)">播放</span>
|
<span class="btn" @click.stop="playEvent(i)">播放</span>
|
||||||
<span class="btn" @click.stop="shareEvent(i)">分享</span>
|
<span class="btn" @click.stop="shareEvent(i)">分享</span>
|
||||||
@@ -96,19 +98,6 @@ export default {
|
|||||||
this.SET_SHARE(val)
|
this.SET_SHARE(val)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// draggableList: {
|
|
||||||
// get () {
|
|
||||||
// return this.list
|
|
||||||
// },
|
|
||||||
// set (value) {
|
|
||||||
// star.clear().then(res1 => {
|
|
||||||
// star.bulkAdd(value).then(res2 => {
|
|
||||||
// this.$message.success('排序成功')
|
|
||||||
// this.list = value
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
view () {
|
view () {
|
||||||
@@ -263,6 +252,13 @@ export default {
|
|||||||
return site.name
|
return site.name
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getHistoryNote (index) {
|
||||||
|
if (index !== null && index !== undefined) {
|
||||||
|
return `第${index + 1}集`
|
||||||
|
} else {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
},
|
||||||
getStarList () {
|
getStarList () {
|
||||||
star.all().then(res => {
|
star.all().then(res => {
|
||||||
this.list = res.reverse()
|
this.list = res.reverse()
|
||||||
|
|||||||
Reference in New Issue
Block a user