This commit is contained in:
2024-04-11 15:09:35 +08:00
parent 19c25f27e8
commit 2ad1790eff
4 changed files with 30 additions and 4 deletions

View 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'),
},
})
}

View File

@ -198,6 +198,7 @@
line-height: 30rpx;
text-align: center;
color: white;
font-size: 18rpx;
}
.time {

View File

@ -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}`
})
}
},

View File

@ -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