xg
This commit is contained in:
parent
19c25f27e8
commit
2ad1790eff
12
api/pagesC/noticedetails/index.js
Normal file
12
api/pagesC/noticedetails/index.js
Normal file
@ -0,0 +1,12 @@
|
||||
import request from "@/api/request.js"
|
||||
|
||||
// 视频观看完成后增加积分
|
||||
export function videoadd(identity, actId) {
|
||||
return request({
|
||||
url: `/applet/score/prizeExchange/video/add/${identity}/${actId}`,
|
||||
method: 'get',
|
||||
header: {
|
||||
region: uni.getStorageSync('region'),
|
||||
},
|
||||
})
|
||||
}
|
||||
@ -198,6 +198,7 @@
|
||||
line-height: 30rpx;
|
||||
text-align: center;
|
||||
color: white;
|
||||
font-size: 18rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
}
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: `/pagesC/noticedetails/noticedetails?item=${JSON.stringify(item)}&title=${this.title}&messageNo=${item.messageNo}`
|
||||
url: `/pagesC/noticedetails/noticedetails?item=${JSON.stringify(item)}&title=${this.title}&messageNo=${item.messageNo}&actId=${item.actId}`
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@ -11,16 +11,19 @@
|
||||
</view>
|
||||
<view class="" style="height: 2rpx;width: 100%;background-color: #f6f6f6;">
|
||||
</view>
|
||||
<!-- @timeupdate="videoFun" -->
|
||||
<video v-if="messageNo" id="myVideo" :src="messageNo" :initial-time="initial_time"
|
||||
<video v-if="messageNo" id="myVideo" @timeupdate="videoFun" :src="messageNo" :initial-time="initial_time"
|
||||
@ended='ended' />
|
||||
<view class="text">
|
||||
<text>{{currentItem.content}}</text>
|
||||
</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
videoadd
|
||||
} from '@/api/pagesC/noticedetails/index.js'
|
||||
import baseurl from '@/api/baseurl.js'
|
||||
export default {
|
||||
data() {
|
||||
@ -30,6 +33,8 @@
|
||||
messageNo: null,
|
||||
video_real_time: 0, //实时播放进度
|
||||
nitial_time: '', //视频跳转进度 秒
|
||||
actId: '',
|
||||
cardNo: uni.getStorageSync('userinfo').cardNo
|
||||
};
|
||||
},
|
||||
onReady() { //更改导航栏文字
|
||||
@ -38,6 +43,7 @@
|
||||
});
|
||||
},
|
||||
onLoad(options) {
|
||||
this.actId = options.actId
|
||||
this.initial_time = '0' //视频进度
|
||||
this.title = options.title
|
||||
this.currentItem = JSON.parse(options.item)
|
||||
@ -47,7 +53,14 @@
|
||||
},
|
||||
methods: {
|
||||
ended(e) {
|
||||
console.log(e)
|
||||
videoadd(this.cardNo, this.actId).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$refs.uToast.show({
|
||||
title: '已为您增加积分',
|
||||
type: 'success',
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
videoFun(e) {
|
||||
var isReady = 1; // 是否开启可以视频快进 1 禁止开启
|
||||
|
||||
Loading…
Reference in New Issue
Block a user