|
|
@@ -6,7 +6,7 @@ import {
|
|
|
getCollectRealVideoUrl,
|
|
|
getRecCollectList,
|
|
|
} from "../../api/api";
|
|
|
-import { rnd, SendEvent } from "../../utils/util";
|
|
|
+import { rnd, SendEvent, rndone } from "../../utils/util";
|
|
|
import { apple } from "../../config/config";
|
|
|
|
|
|
const app = getApp();
|
|
|
@@ -323,15 +323,24 @@ Page({
|
|
|
videoStatus: 0,
|
|
|
});
|
|
|
|
|
|
- // 切换下一集
|
|
|
const nextEp = this.data.playingEp + 1;
|
|
|
- if (nextEp <= this.data.eps.length - 1) {
|
|
|
+ // 最后一集播放完,随机播放下一个合集
|
|
|
+ if (nextEp === this.data.eps.length && this.data.videoList.length > 0) {
|
|
|
+ const rndCollect = rndone(this.data.videoList);
|
|
|
this.setData({
|
|
|
- playingEp: nextEp,
|
|
|
- videoDetail: this.data.eps[nextEp],
|
|
|
+ collectId: rndCollect.id,
|
|
|
});
|
|
|
- if (!this.data.videoDetail.lock) {
|
|
|
- this.getVideoPlayUrl();
|
|
|
+ this.getCollectVideoDetail();
|
|
|
+ } else {
|
|
|
+ // 切换下一集
|
|
|
+ if (nextEp <= this.data.eps.length - 1) {
|
|
|
+ this.setData({
|
|
|
+ playingEp: nextEp,
|
|
|
+ videoDetail: this.data.eps[nextEp],
|
|
|
+ });
|
|
|
+ if (!this.data.videoDetail.lock) {
|
|
|
+ this.getVideoPlayUrl();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|