Commit eb0f2a01 authored by jyx's avatar jyx

代码优化

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