<div class="history">
<ul>
<template v-for="(item,index) in historyList.elementList" >
<li :id="("lishi_"+index)" :key="index" :class="{"historyHover":pos==2&&itemNo==(index)}" >
<img :src="item.assetImg?item.assetImg:item.elementImg" />
<div class="h_progress" v-show="!(pos==2&&itemNo==(index))">
<p v-show="item.assetType!= undefined && item.assetType!="Movie"">{{parseInt(item.episode)}}
<p v-if="item.recordTime!= undefined && item.recordTime!= "0"">{{getWatchTime(item.recordTime,index)}}
</div>
<span class="history-title" v-show="(pos==2&&itemNo==(index))">{{item.assetName?item.assetName:item.elementName}}</span>
</li>
</template>
</ul>
</div>
created () {
this.jsonData = this.initData;
if (this.jsonData.elementList[0].elementList){
this.eleId = this.jsonData.specialId;
this.swipeList = this.jsonData.elementList[0].elementList;
this.bgPhoto = this.swipeList[0].elementImg;
this.rec = this.jsonData.elementList;
this.historyList = this.jsonData.elementList[3];
this.timeTask();
}
try {
let historyData = JSON.parse(localStorage.getItem("historyList"));
console.log(historyData);
console.log("" + JSON.stringify(historyData));
if (historyData.length == 0) return;
if (historyData.length >= 2){ historyData = historyData.slice(0, 2) };
this.historyList.elementList = historyData;
} catch (error) {
}
},
activated () {
try { //
let historyData = JSON.parse(localStorage.getItem("historyList"));
console.log("" + JSON.stringify(historyData));
if (historyData.length == 0) return;
if (historyData.length >= 2){ historyData = historyData.slice(0, 2) };
this.historyList.elementList = historyData;
} catch (error) {
console.log("");
}
},
methods: {
getWatchTime (ms, index){
console.log(":" + index);
console.log(":" + ms);
// return new Date(parseInt(ms)).format("mm:ss");
},
does anyone know!