Commit eb0f2a01 authored by jyx's avatar jyx

代码优化

parent cb13036e
......@@ -11,16 +11,15 @@
</view>
<view class="shortcut" v-show="showShortcutPop">
<image style="width: 70rpx;height: 70rpx;margin-left: 10rpx;" src="../../static/logo-about.png">
<image style="width:70rpx;height:70rpx;margin-left:10rpx;" src="../../static/logo-about.png">
</image>
<view class="flex1" style="margin-left: 20rpx;">
<view style="font-size: 26rpx;">添加至桌面</view>
<view style="font-size: 20rpx;">下次看剧更方便</view>
<view class="flex1" style="margin-left:20rpx;">
<view style="font-size: 26rpx;font-weight: 700;">添加至桌面</view>
<view style="font-size: 22rpx;">下次看剧更方便</view>
</view>
<button @click="addShortcut" open-type="addShortcut" bindaddshortcut="eventHandler" style="font-size: 24rpx;background-color: crimson;border-radius: 5rpx;color: white;
padding: 0 12rpx;margin-left: 30rpx;">立即添加
</button>
<image @click="closeShortcutPop" style="width: 40rpx; height: 40rpx;" src="../../static/video/close.png">
<button @click="addShortcut" open-type="addShortcut" bindaddshortcut="eventHandler" style="font-size:26rpx;background-color:crimson;border-radius:5rpx;color:white;
height:55rpx;line-height:53rpx;margin-left:30rpx;font-weight:700;">立即添加</button>
<image @click="closeShortcutPop" style="width:30rpx;height:30rpx;" src="../../static/video/close.png">
</image>
</view>
</view>
......@@ -83,7 +82,7 @@
console.log("触发播放进度变化onTimeUpdate回调:", e);
// 播放到第10秒且今天没有弹出 ,弹出加入桌面
if ((e.currentTime > 3) && this.canShowShortcut) {
if ((e.currentTime > 10) && this.canShowShortcut) {
this.showShortcutPop = true
this.canShowShortcut = false
this.setShowShortcut()
......@@ -126,7 +125,8 @@
});
// 推荐位使用简单示例
pm.onChangeEpisode((e) => {
console.log("触发选集切换onChangeEpisode回调:", e);
console.log("触发选集切换onChangeEpisode回调:", e);
this.albumId = e.albumId
this.seq = e.seq
this.episodeId = e.episodeId
......@@ -411,11 +411,14 @@
message.notify(data.msg)
if (data.code == 200) {
this.pm.setCurrentUnlock()
this.pm.setCurrentUnlock()
// this.commitVideo()
} else if (data.code == 301) {
this.pm.setCurrentUnlock()
this.pm.setCurrentUnlock()
// this.commitVideo()
} else if (data.code == 302) {
this.pm.setCurrentUnlock()
this.pm.setCurrentUnlock()
// this.commitVideo()
} else if (data.code == 303) {
this.pm.toggleCustomDialog()
}
......@@ -439,11 +442,14 @@
message.notify(data.msg)
if (data.code == 200) {
that.pm.setCurrentUnlock()
that.pm.setCurrentUnlock()
this.commitVideo()
} else if (data.code == 301) {
that.pm.setCurrentUnlock()
that.pm.setCurrentUnlock()
this.commitVideo()
} else if (data.code == 302) {
that.pm.setCurrentUnlock()
that.pm.setCurrentUnlock()
this.commitVideo()
} else if (data.code == 303) {
that.pm.toggleCustomDialog()
}
......@@ -482,15 +488,15 @@
<style lang="scss">
.shortcut {
position: absolute;
top: 82%;
top: 85%;
left: 40%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: row;
align-items: center;
// justify-content: space-between;
width: 60%;
height: 90rpx;
width: 65%;
height: 100rpx;
padding: 0 20rpx;
background-color: whitesmoke;
border-radius: 10rpx;
......
......@@ -17,20 +17,19 @@
//采用uniapp的生命周期函数
onLoad(option) {
let data = JSON.parse(decodeURIComponent(option.data));
this.loadData(data)
setTimeout(() => {
const p_m = getPlayletManager(this);
p_m.setCatalog({
freeList: data.douyinFreeList,
unlockList: data.douyinUnlockList,
lockList: data.douyinLockList,
});
}, 500)
},
onReady() {
const p_m = getPlayletManager(this);
p_m.setCatalog({
freeList: [{
start_episode_no: 1,
end_episode_no: 5,
}],
lockList: [{
start_episode_no: 6,
end_episode_no: 200,
}],
});
p_m.onPlay((e) => {
console.error("可以播放了,可以播放了,可以播放了,可以播放了", e);
});
......@@ -57,28 +56,27 @@
console.log(num, "cliPause");
},
loadData(data) {
const p_m = getPlayletManager(this);
// const p_m = getPlayletManager(this);
// common.methods.post({
// url: '/vedio/getIndexList',
// data: {
// vedioId: data.vedioId
// },
// showLoading: false,
// success: ({
// data
// }) => {
common.methods.post({
url: '/vedio/getIndexList',
data: {
vedioId: data.vedioId
},
showLoading: false,
success: ({
data
}) => {
let _data = data.vedioMsg
// let _data = data.vedioMsg
p_m.setCatalog({
freeList: _data.douyinFreeList,
unlockList: _data.douyinUnlockList,
lockList: _data.douyinLockList,
});
// p_m.setCatalog({
// freeList: _data.douyinFreeList,
// unlockList: _data.douyinUnlockList,
// lockList: _data.douyinLockList,
// });
}
});
// }
// });
}
},
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment