deming/components/remaining/remaining.vue

340 lines
7.7 KiB
Vue
Raw Normal View History

2020-06-18 14:57:26 +08:00
<template>
2020-06-02 08:49:13 +08:00
<view>
2020-06-19 19:20:33 +08:00
<!-- <image v-if="type" class="welcome_images" src="../../static/pageA/welcome_img.jpg" mode="aspectFill"></image> -->
<view v-if="type" id="video_mp4">
<view class="page-body">
<view class="page-section">
2020-07-14 08:30:28 +08:00
<video id="myVideo" :src=" 'https://' + vide0_url" :controls="controls" :autoplay="autoplayes" :loop="loop" @error="videoErrorCallback"
enable-danmu danmu-btn></video>
2020-06-19 19:20:33 +08:00
</view>
</view>
</view>
<view v-if="type" class="welcome_jumpes" @click="leap_over">跳过{{remaining}}</view>
<view v-if="banner" class="welcome_jumpes" @click="leap_overto">跳过</view>
2020-06-02 08:49:13 +08:00
<!-- 轮播图 -->
2020-07-15 16:04:31 +08:00
<view class="uni-padding-wrap" v-if="banner" >
2020-07-14 08:30:28 +08:00
<view>
<view class="uni-padding-wrap">
<view class="page-section swiper">
<view class="page-section-spacing">
<swiper class="swiper" :indicator-dots="true" :style="{height:heightOut+'px'}" :autoplay="false" :interval="3000" :duration="1000">
<swiper-item v-for="item in list" >
<view class="swiper-item uni-bg-red">
<image :src=" 'https://' + item.launch_path"></image>
</view>
2020-07-15 16:04:31 +08:00
</swiper-item>
2020-07-14 08:30:28 +08:00
</swiper>
</view>
2020-06-19 19:20:33 +08:00
</view>
2020-06-02 08:49:13 +08:00
</view>
</view>
</view>
<!-- 用户协议弹窗 -->
<view class="welcome_backes" v-if="protocol">
<view class="content">
2020-06-18 14:57:26 +08:00
<view class="title">{{ agreement.document_title }}</view>
<!-- <text class="protocol_content"></text> -->
<scroll-view scroll-y class="scroll">
<rich-text class="protocol_content" :nodes="agreement.document_content"></rich-text>
</scroll-view>
2020-06-02 08:49:13 +08:00
<view class="to_agree" @click="to_agree">我同意</view>
</view>
2020-06-18 14:57:26 +08:00
</view>
</view>
</template>
<script>
2020-07-01 17:32:36 +08:00
import common from '@/static/js/common.js'
2020-06-18 14:57:26 +08:00
export default {
data() {
return {
2020-07-02 08:39:38 +08:00
remaining: 4,
2020-06-19 19:20:33 +08:00
type: true,
banner: false,
protocol: false,
2020-07-14 08:30:28 +08:00
heightOut: '',
2020-06-19 19:20:33 +08:00
imgurl: [],
2020-07-14 08:30:28 +08:00
loop: 'true',
vide0_url: '',
2020-06-18 14:57:26 +08:00
agreement: { // 用户协议内容
document_title: "",
document_content: ""
2020-06-19 19:20:33 +08:00
},
2020-07-14 08:30:28 +08:00
heightesStyle : {
height : ''
},
2020-06-19 19:20:33 +08:00
title: 'video',
src: '',
2020-07-14 08:30:28 +08:00
inputValue: '',
controls: false,
autoplayes: true,
list: [],
2020-06-19 19:20:33 +08:00
danmuList: [{
text: '第 1s 出现的弹幕',
color: '#ff0000',
time: 1
},
{
text: '第 3s 出现的弹幕',
color: '#ff00ff',
time: 3
}
2020-07-14 08:30:28 +08:00
],
background: ['color1', 'color2', 'color3'],
indicatorDots: true,
autoplay: true,
interval: 2000,
duration: 500
2020-06-18 14:57:26 +08:00
};
2020-06-19 19:20:33 +08:00
},
onReady: function(res) {
this.videoContext = uni.createVideoContext('myVideo')
2020-06-02 08:49:13 +08:00
},
methods: {
2020-06-19 19:20:33 +08:00
apiwelcome() {
2020-06-17 12:09:28 +08:00
this.$u.api.documentInfo({
2020-06-19 19:20:33 +08:00
document_code: 'agreement'
}).then((res) => {
2020-06-18 14:57:26 +08:00
if (res.errCode == 0) {
let agreement = res.data;
2020-06-19 19:20:33 +08:00
// console.log(agreement.document_content)
2020-07-01 17:32:36 +08:00
agreement.document_content = common.unescapeHTML(agreement.document_content);
2020-06-18 14:57:26 +08:00
// console.log(agreement);
this.agreement = agreement;
}
2020-06-17 12:09:28 +08:00
})
// 启动页
2020-06-19 19:20:33 +08:00
this.$u.api.pageList({}).then((res) => {
console.log('协议', res)
let data_image = res.data.welcome_page
2020-07-14 08:30:28 +08:00
let vide0_url = res.data.start_page[0].launch_path
2020-06-19 19:20:33 +08:00
this.list = data_image;
this.vide0_url = vide0_url;
console.log(this.list)
2020-06-17 12:09:28 +08:00
})
},
2020-06-02 08:49:13 +08:00
// 3秒倒计时
2020-06-19 19:20:33 +08:00
remaining_time() {
this.timer = setInterval(() => {
2020-06-02 08:49:13 +08:00
this.remaining--;
2020-06-19 19:20:33 +08:00
if (this.remaining <= 0) {
2020-06-02 08:49:13 +08:00
clearInterval(this.timer);
2020-06-19 19:20:33 +08:00
console.log("完了")
2020-06-02 08:49:13 +08:00
this.type = !this.type
this.banner = !this.banner;
}
2020-06-19 19:20:33 +08:00
}, 1000);
2020-06-02 08:49:13 +08:00
},
2020-06-19 19:20:33 +08:00
leap_over() {
2020-06-02 08:49:13 +08:00
this.type = !this.type
this.banner = !this.banner;
2020-07-14 08:30:28 +08:00
clearInterval(this.timer)
// 获取屏幕高度
this.getSystemInfo()
2020-06-02 08:49:13 +08:00
},
2020-06-19 19:20:33 +08:00
leap_overto() {
2020-07-14 08:30:28 +08:00
this.protocol = true;
this.banner = false;
2020-06-02 08:49:13 +08:00
},
2020-06-19 19:20:33 +08:00
getSystemInfo() {
2020-07-14 08:30:28 +08:00
let that = this;
2020-06-02 08:49:13 +08:00
// 获取屏幕高度
uni.getSystemInfo({
2020-06-19 19:20:33 +08:00
success: function(res) {
2020-07-14 08:30:28 +08:00
that.heightOut = res.windowHeight;
console.log('666666666666666' + that.heightOut)
2020-06-19 19:20:33 +08:00
}
2020-06-02 08:49:13 +08:00
});
},
// 我同意
2020-06-19 19:20:33 +08:00
to_agree() {
2020-06-02 08:49:13 +08:00
uni.navigateTo({
2020-06-19 19:20:33 +08:00
url: '/pageA/login/login'
2020-06-02 08:49:13 +08:00
});
2020-06-19 19:20:33 +08:00
},
// 视频引入
bindInputBlur: function(e) {
this.inputValue = e.target.value
},
bindButtonTap: function() {
var that = this
uni.chooseVideo({
sourceType: ['album', 'camera'],
maxDuration: 60,
camera: ['front', 'back'],
success: function(res) {
this.src = res.tempFilePath
}
})
},
bindSendDanmu: function() {
this.videoContext.sendDanmu({
text: this.inputValue,
color: this.getRandomColor()
})
},
videoErrorCallback: function(e) {
console.log('视频错误信息:')
console.log(e.target.errMsg)
},
getRandomColor: function() {
const rgb = []
for (let i = 0; i < 3; ++i) {
let color = Math.floor(Math.random() * 256).toString(16)
color = color.length == 1 ? '0' + color : color
rgb.push(color)
}
return '#' + rgb.join('')
2020-07-14 08:30:28 +08:00
},
changeIndicatorDots(e) {
this.indicatorDots = !this.indicatorDots
},
changeAutoplay(e) {
this.autoplay = !this.autoplay
},
intervalChange(e) {
this.interval = e.target.value
},
durationChange(e) {
this.duration = e.target.value
2020-07-15 16:04:31 +08:00
},
refreshToken_function(){
this.$u.api.refreshToken({}).then((res) => {
console.log(res)
if (res.errCode == 0) {
let token = res.data.token;
uni.setStorageSync('token', token);//存储toke值
}
})
2020-06-02 08:49:13 +08:00
}
2020-07-14 08:30:28 +08:00
},
mounted() {
2020-07-15 16:04:31 +08:00
this.refreshToken_function()
2020-07-14 08:30:28 +08:00
// 3秒倒计时调用
this.remaining_time()
this.apiwelcome()
}
2020-06-18 14:57:26 +08:00
}
</script>
2020-06-02 08:49:13 +08:00
2020-06-18 14:57:26 +08:00
<style lang="scss" scoped>
2020-07-14 08:30:28 +08:00
.uni-padding-wrap{
// height: 400rpx;
}
2020-06-19 19:20:33 +08:00
.welcome_jumpes {
2020-07-15 16:04:31 +08:00
width: 94rpx;
height: 36rpx;
2020-06-19 19:20:33 +08:00
opacity: 0.5;
border-radius: 18rpx;
2020-06-02 08:49:13 +08:00
position: absolute;
right: 37rpx;
2020-07-15 16:04:31 +08:00
top: 66rpx;
font-size: 22rpx;
2020-06-02 08:49:13 +08:00
text-align: center;
line-height: 35rpx;
color: #fff;
background: #C4CAC6;
z-index: 10;
}
2020-07-14 08:30:28 +08:00
#myVideo {
2020-06-19 19:20:33 +08:00
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
margin: auto;
}
2020-07-14 08:30:28 +08:00
uni-video {
2020-06-19 19:20:33 +08:00
width: 100%;
height: auto;
}
2020-07-14 08:30:28 +08:00
.uni-video-container {
background-color: none !important;
2020-06-19 19:20:33 +08:00
}
2020-07-14 08:30:28 +08:00
2020-06-02 08:49:13 +08:00
.welcome_images {
width: 100%;
position: fixed;
height: 100%
}
2020-06-19 19:20:33 +08:00
uni-swiper,
uni-view,
uni-image {
2020-06-02 08:49:13 +08:00
width: 100%;
2020-06-18 14:57:26 +08:00
// position: fixed;
2020-06-02 08:49:13 +08:00
height: 100%
}
2020-06-19 19:20:33 +08:00
uni-image {
2020-06-02 08:49:13 +08:00
width: 100%;
}
2020-06-19 19:20:33 +08:00
2020-06-02 08:49:13 +08:00
// 轮播图分页器颜色
2020-06-19 19:20:33 +08:00
uni-swiper .uni-swiper-dot-active {
background-color: #fff !important;
2020-06-02 08:49:13 +08:00
}
2020-06-19 19:20:33 +08:00
.welcome_backes {
2020-06-02 08:49:13 +08:00
width: 100%;
position: fixed;
height: 100%;
2020-06-19 19:20:33 +08:00
background: #999999;
.content {
width: 558rpx;
height: 730rpx;
background: rgba(255, 255, 255, 1);
2020-06-02 08:49:13 +08:00
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
margin: auto;
2020-06-19 19:20:33 +08:00
.title {
width: 558rpx;
2020-06-02 08:49:13 +08:00
text-align: center;
2020-06-19 19:20:33 +08:00
height: 29rpx;
font-size: 30rpx;
font-weight: bold;
color: rgba(51, 51, 51, 1);
line-height: 29rpx;
2020-06-02 08:49:13 +08:00
margin: 30rpx 0 24rpx 0;
}
2020-06-19 19:20:33 +08:00
2020-06-18 14:57:26 +08:00
.scroll {
height: 560rpx;
2020-06-19 19:20:33 +08:00
.protocol_content {
width: 494rpx;
height: 528rpx;
font-size: 24rpx;
font-weight: 400;
color: rgba(51, 51, 51, 1);
2020-06-18 14:57:26 +08:00
display: block;
text-align: left;
margin: 80rpx auto 33rpx;
letter-spacing: 1rpx;
text-align: justify;
line-height: 36rpx;
}
2020-06-02 08:49:13 +08:00
}
2020-06-19 19:20:33 +08:00
.to_agree {
width: 558rpx;
font-size: 30rpx;
font-weight: bold;
color: rgba(255, 121, 16, 1);
2020-06-02 08:49:13 +08:00
text-align: center;
padding-top: 27rpx;
border-top: #D8D8D8 solid 1px;
}
}
2020-06-18 14:57:26 +08:00
}
2020-07-14 08:30:28 +08:00
</style>