diff --git a/jiuyi2/common/js/util.js b/jiuyi2/common/js/util.js index da7c5309..a093f6e5 100644 --- a/jiuyi2/common/js/util.js +++ b/jiuyi2/common/js/util.js @@ -1804,6 +1804,34 @@ const util = { }) }) }, + + // 获取我的任务 + getMyTask() { + // 验证登录 + util.isLogin().then(() => { + // 获取任务 + api.intergral.viewingTasks({}).then(rs => { + if (rs.code == 200) { + uni.$store.commit('setState', { + key: 'task', + value: rs.data, + }) + return + } + }) + }).catch(() => { + // 修改为默认值 + uni.$store.commit('setState', { + key: 'task', + value: { + //任务类型 0.任务读秒 1.流量点(种子)读秒 + taskType: 0, + //有效时长 + viewingDuration: 0, + }, + }) + }) + }, } export default util \ No newline at end of file diff --git a/jiuyi2/components/index/indexVideo.vue b/jiuyi2/components/index/indexVideo.vue index edf24f4b..cebde561 100644 --- a/jiuyi2/components/index/indexVideo.vue +++ b/jiuyi2/components/index/indexVideo.vue @@ -106,17 +106,17 @@ return result }) + watch(() => props.current, (nV) => { + if (nV == props.index) play() + else pause() + }) + // 挂载后调用 onMounted(() => { // 视频上下文对象 videoCtx.value = uni.createVideoContext(`video${props.tabIndex}${props.index}`) }) - watch(() => props.current, (nV) => { - if (nV == props.index) play() - else pause() - }) - // 格式化 function formatNumber(result) { result = parseFloat(result) * 10 @@ -464,11 +464,14 @@ @touchcancel="onTouchCancel" @longpress="longtap"> -