mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-07-04 18:46:10 +08:00
修正Recommendation的拼写
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
<span :class="[view === 'Recommandation' ? 'active ': ''] + 'zy-svg'" @click="changeView('Recommandation')">
|
||||
<span :class="[view === 'Recommendation' ? 'active ': ''] + 'zy-svg'" @click="changeView('Recommendation')">
|
||||
<svg role="img" xmlns="http://www.w3.org/2000/svg" width="48px" height="48px" viewBox="0 0 24 24" aria-labelledby="thumbUpIconTitle" stroke="#2329D6" stroke-width="1" stroke-linecap="square" stroke-linejoin="miter" fill="none" color="#2329D6">
|
||||
<title id="thumbUpIconTitle">影视推荐</title>
|
||||
<path d="M8,8.73984815 C8,8.26242561 8.17078432,7.80075162 8.4814868,7.43826541 L13.2723931,1.84887469 C13.7000127,1.34998522 14.4122932,1.20614658 15,1.5 C15.5737957,1.78689785 15.849314,2.45205792 15.6464466,3.06066017 L14,8 L18.6035746,8 C18.7235578,8 18.8432976,8.01079693 18.9613454,8.03226018 C20.0480981,8.22985158 20.7689058,9.27101818 20.5713144,10.3577709 L19.2985871,17.3577709 C19.1256814,18.3087523 18.2974196,19 17.3308473,19 L10,19 C8.8954305,19 8,18.1045695 8,17 L8,8.73984815 Z"/>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="listpage" id="recommandataions">
|
||||
<div class="listpage-header" id="recommandataions-header">
|
||||
<el-switch v-model="viewMode" active-text="海报" active-value="picture" inactive-text="列表" inactive-value="list" @change="updateViewMode"></el-switch>
|
||||
<el-button type="text">视频数:{{ recommandations.length }}</el-button>
|
||||
<el-button type="text">视频数:{{ recommendations.length }}</el-button>
|
||||
<el-select v-model="selectedAreas" multiple collapse-tags placeholder="地区" :popper-append-to-body="false">
|
||||
<el-option
|
||||
v-for="item in areas"
|
||||
@@ -25,7 +25,7 @@
|
||||
<div class="show-table" id="star-table" v-show="viewMode === 'list'">
|
||||
<el-table size="mini" fit height="100%" row-key="id"
|
||||
ref="recommandataionsTable"
|
||||
:data="filteredRecommandations"
|
||||
:data="filteredRecommendations"
|
||||
@row-click="detailEvent">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
@@ -47,12 +47,12 @@
|
||||
width="100"
|
||||
align="center">
|
||||
</el-table-column>
|
||||
<el-table-column v-if="filteredRecommandations.some(e => e.detail.note)"
|
||||
<el-table-column v-if="filteredRecommendations.some(e => e.detail.note)"
|
||||
prop="detail.note"
|
||||
width="120"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column v-if="filteredRecommandations.some(e => e.rate)"
|
||||
<el-table-column v-if="filteredRecommendations.some(e => e.rate)"
|
||||
prop="rate"
|
||||
width="120"
|
||||
label="豆瓣评分">
|
||||
@@ -71,7 +71,7 @@
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="show-picture" id="star-picture" v-show="viewMode === 'picture'">
|
||||
<Waterfall ref="recommandataionsWaterfall" :list="filteredRecommandations" :gutter="20" :width="240"
|
||||
<Waterfall ref="recommandataionsWaterfall" :list="filteredRecommendations" :gutter="20" :width="240"
|
||||
:breakpoints="{
|
||||
1200: { //当屏幕宽度小于等于1200
|
||||
rowPerView: 4,
|
||||
@@ -117,15 +117,15 @@
|
||||
</template>
|
||||
<script>
|
||||
import { mapMutations } from 'vuex'
|
||||
import { history, recommandation, setting } from '../lib/dexie'
|
||||
import { history, recommendation, setting } from '../lib/dexie'
|
||||
import zy from '../lib/site/tools'
|
||||
import Waterfall from 'vue-waterfall-plugin'
|
||||
const { clipboard } = require('electron')
|
||||
export default {
|
||||
name: 'recommandations',
|
||||
name: 'recommendations',
|
||||
data () {
|
||||
return {
|
||||
recommandations: [],
|
||||
recommendations: [],
|
||||
sites: [],
|
||||
viewMode: 'picture',
|
||||
loading: false,
|
||||
@@ -171,16 +171,16 @@ export default {
|
||||
this.SET_SHARE(val)
|
||||
}
|
||||
},
|
||||
filteredRecommandations () {
|
||||
var filteredData = this.recommandations.filter(x => (this.selectedAreas.length === 0) || this.selectedAreas.includes(x.detail.area))
|
||||
filteredRecommendations () {
|
||||
var filteredData = this.recommendations.filter(x => (this.selectedAreas.length === 0) || this.selectedAreas.includes(x.detail.area))
|
||||
filteredData = filteredData.filter(x => (this.selectedTypes.length === 0) || this.selectedTypes.includes(x.detail.type))
|
||||
return filteredData
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
view () {
|
||||
if (this.view === 'Recommandation') {
|
||||
this.getRecommandations()
|
||||
if (this.view === 'Recommendation') {
|
||||
this.getRecommendations()
|
||||
this.$refs.recommandataionsWaterfall.refresh()
|
||||
}
|
||||
}
|
||||
@@ -198,21 +198,24 @@ export default {
|
||||
}
|
||||
},
|
||||
updateEvent () {
|
||||
const url = 'https://raw.githubusercontent.com/Hunlongyu/ZY-Player/master/src/lib/dexie/iniData/Recommandations.json'
|
||||
const url = 'https://raw.githubusercontent.com/Hunlongyu/ZY-Player/master/src/lib/dexie/iniData/Recommendations.json'
|
||||
this.loading = true
|
||||
const axios = require('axios')
|
||||
axios.get(url).then(res => {
|
||||
if (res.status === 200) {
|
||||
if (res.data.length > 0) {
|
||||
this.recommandations = res.data.sort(function (a, b) {
|
||||
this.recommendations = res.data.sort(function (a, b) {
|
||||
return b.detail.year - a.detail.year
|
||||
})
|
||||
recommandation.clear().then(recommandation.bulkAdd(this.recommandations))
|
||||
recommendation.clear().then(recommendation.bulkAdd(this.recommendations))
|
||||
this.getFilterData()
|
||||
this.$message.success('更新推荐成功')
|
||||
}
|
||||
}
|
||||
this.loading = false
|
||||
}).catch(error => {
|
||||
this.loading = false
|
||||
this.$message.error('更新推荐失败. ' + error)
|
||||
})
|
||||
},
|
||||
async playEvent (e) {
|
||||
@@ -225,13 +228,13 @@ export default {
|
||||
this.view = 'Play'
|
||||
},
|
||||
deleteEvent (e) {
|
||||
recommandation.remove(e.id).then(res => {
|
||||
recommendation.remove(e.id).then(res => {
|
||||
if (res) {
|
||||
this.$message.warning('删除失败')
|
||||
} else {
|
||||
this.$message.success('删除成功')
|
||||
}
|
||||
this.getRecommandations()
|
||||
this.getRecommendations()
|
||||
})
|
||||
},
|
||||
shareEvent (e) {
|
||||
@@ -283,32 +286,32 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
getRecommandations () {
|
||||
recommandation.all().then(res => {
|
||||
this.recommandations = res.sort(function (a, b) {
|
||||
getRecommendations () {
|
||||
recommendation.all().then(res => {
|
||||
this.recommendations = res.sort(function (a, b) {
|
||||
return b.id - a.id
|
||||
})
|
||||
this.getFilterData()
|
||||
})
|
||||
},
|
||||
getFilterData () {
|
||||
this.types = [...new Set(this.recommandations.map(ele => ele.detail.type))].filter(x => x)
|
||||
this.areas = [...new Set(this.recommandations.map(ele => ele.detail.area))].filter(x => x)
|
||||
this.types = [...new Set(this.recommendations.map(ele => ele.detail.type))].filter(x => x)
|
||||
this.areas = [...new Set(this.recommendations.map(ele => ele.detail.area))].filter(x => x)
|
||||
},
|
||||
getViewMode () {
|
||||
setting.find().then(res => {
|
||||
this.viewMode = res.recommandationViewMode
|
||||
this.viewMode = res.recommendationViewMode
|
||||
})
|
||||
},
|
||||
updateViewMode () {
|
||||
setting.find().then(res => {
|
||||
res.recommandationViewMode = this.viewMode
|
||||
res.recommendationViewMode = this.viewMode
|
||||
setting.update(res)
|
||||
})
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getRecommandations()
|
||||
this.getRecommendations()
|
||||
this.getViewMode()
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import Share from './Share'
|
||||
import History from './History'
|
||||
import EditSites from './EditSites'
|
||||
import IPTV from './IPTV'
|
||||
import Recommandation from './Recommandation'
|
||||
import Recommendation from './Recommendation'
|
||||
export default {
|
||||
registerComponents () {
|
||||
Vue.component('Aside', Aside)
|
||||
@@ -24,6 +24,6 @@ export default {
|
||||
Vue.component('History', History)
|
||||
Vue.component('EditSites', EditSites)
|
||||
Vue.component('IPTV', IPTV)
|
||||
Vue.component('Recommandation', Recommandation)
|
||||
Vue.component('Recommendation', Recommendation)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user