Skip to content

Commit

Permalink
优化集数
Browse files Browse the repository at this point in the history
  • Loading branch information
Hunlongyu committed Nov 18, 2020
1 parent d435aae commit bf79be2
Show file tree
Hide file tree
Showing 4 changed files with 204 additions and 153 deletions.
43 changes: 32 additions & 11 deletions pages/detail/detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,39 @@ export default {
const res = await http.detail(key, id);
this.detail = res;
const arr = [];
let num = 1
for (const i of res.m3u8List) {
const j = i.split("$");
let d = {
index: i,
value: j[1],
label: j[0],
extra: {
site: key,
id: id,
},
};
arr.push(d);
const j = i.split('$')
let label = res.m3u8List.length > 1 ? `${num}`: this.detail.name
if (j.length > 1) {
for (let m = 0; m < j.length; m++) {
if (j[m].indexOf('.m3u8') >= 0 && j[m].startsWith('http')) {
let d = {
index: i,
value: j[m],
label: label,
extra: {
site: key,
id: id,
},
};
arr.push(d);
break
}
}
} else {
let d = {
index: i,
value: j[0],
label: label,
extra: {
site: key,
id: id,
},
};
arr.push(d);
}
num++
}
this.playList = arr;
},
Expand Down
45 changes: 33 additions & 12 deletions pages/play/play.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<u-icon name="share" size="60" color="#1e88e5" style="margin-right: 30rpx"></u-icon>
<u-icon v-if="!starShow" name="star" size="60" @click="addStar()"></u-icon>
<u-icon v-if="starShow" name="star-fill" color="#ff4445" size="60" @click="removeStar()"></u-icon>
<u-icon name="play-circle" size="70" color="#6dd143" @click="selectPlay()" style="margin-left: 30rpx"></u-icon>
<u-icon name="play-circle" size="70" color="#6dd143" @click="selectPlay()" style="margin-left: 30rpx" v-if="playList.length > 0"></u-icon>
</view>
<view class="box-info">
<view class="name-box">
Expand Down Expand Up @@ -73,18 +73,39 @@ export default {
const res = await http.detail(key, id);
this.detail = res;
const arr = [];
let num = 1
for (const i of res.m3u8List) {
const j = i.split("$");
let d = {
index: i,
value: j[1],
label: j[0],
extra: {
site: key,
id: id,
},
};
arr.push(d);
const j = i.split('$')
let label = res.m3u8List.length > 1 ? `${num}`: this.detail.name
if (j.length > 1) {
for (let m = 0; m < j.length; m++) {
if (j[m].indexOf('.m3u8') >= 0 && j[m].startsWith('http')) {
let d = {
index: i,
value: j[m],
label: label,
extra: {
site: key,
id: id,
},
};
arr.push(d);
break
}
}
} else {
let d = {
index: i,
value: j[0],
label: label,
extra: {
site: key,
id: id,
},
};
arr.push(d);
}
num++
}
this.playList = arr;
},
Expand Down
Loading

0 comments on commit bf79be2

Please sign in to comment.