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; line-height: 30rpx;
text-align: center; text-align: center;
color: white; color: white;
font-size: 18rpx;
} }
.time { .time {

View File

@ -79,7 +79,7 @@
} }
} else { } else {
uni.navigateTo({ 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>
<view class="" style="height: 2rpx;width: 100%;background-color: #f6f6f6;"> <view class="" style="height: 2rpx;width: 100%;background-color: #f6f6f6;">
</view> </view>
<!-- @timeupdate="videoFun" --> <video v-if="messageNo" id="myVideo" @timeupdate="videoFun" :src="messageNo" :initial-time="initial_time"
<video v-if="messageNo" id="myVideo" :src="messageNo" :initial-time="initial_time"
@ended='ended' /> @ended='ended' />
<view class="text"> <view class="text">
<text>{{currentItem.content}}</text> <text>{{currentItem.content}}</text>
</view> </view>
<u-toast ref="uToast" />
</view> </view>
</template> </template>
<script> <script>
import {
videoadd
} from '@/api/pagesC/noticedetails/index.js'
import baseurl from '@/api/baseurl.js' import baseurl from '@/api/baseurl.js'
export default { export default {
data() { data() {
@ -30,6 +33,8 @@
messageNo: null, messageNo: null,
video_real_time: 0, // video_real_time: 0, //
nitial_time: '', // nitial_time: '', //
actId: '',
cardNo: uni.getStorageSync('userinfo').cardNo
}; };
}, },
onReady() { // onReady() { //
@ -38,6 +43,7 @@
}); });
}, },
onLoad(options) { onLoad(options) {
this.actId = options.actId
this.initial_time = '0' // this.initial_time = '0' //
this.title = options.title this.title = options.title
this.currentItem = JSON.parse(options.item) this.currentItem = JSON.parse(options.item)
@ -47,7 +53,14 @@
}, },
methods: { methods: {
ended(e) { 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) { videoFun(e) {
var isReady = 1; // 1 var isReady = 1; // 1