修改活动样式

This commit is contained in:
zmr900709 2020-08-18 11:28:51 +08:00
commit 8f83aeec8e
4 changed files with 347 additions and 344 deletions

View File

@ -1,341 +1,341 @@
<template> <template>
<view> <view>
<!-- <image v-if="type" class="welcome_images" src="../../static/pageA/welcome_img.jpg" mode="aspectFill"></image> --> <!-- <image v-if="type" class="welcome_images" src="../../static/pageA/welcome_img.jpg" mode="aspectFill"></image> -->
<view v-if="type" id="video_mp4"> <view v-if="type" id="video_mp4">
<view class="page-body"> <view class="page-body">
<view class="page-section"> <view class="page-section">
<video id="myVideo" enable-progress-gesture="false" :src=" 'https://' + vide0_url" autoplay controls="false" @error="videoErrorCallback" @timeupdate="timeupdate" <video id="myVideo" enable-progress-gesture="false" :src=" 'https://' + vide0_url" autoplay controls="false" @error="videoErrorCallback" @timeupdate="timeupdate"
enable-danmu danmu-btn></video> enable-danmu danmu-btn></video>
</view> </view>
</view> </view>
</view> </view>
<view v-if="type" class="welcome_jumpes" @click="leap_over">跳过{{remaining}}</view> <view v-if="type" class="welcome_jumpes" @click="leap_over">跳过{{remaining}}</view>
<view v-if="banner" class="welcome_jumpes" @click="leap_overto">跳过</view> <view v-if="banner" class="welcome_jumpes" @click="leap_overto">跳过</view>
<!-- 轮播图 --> <!-- 轮播图 -->
<view class="uni-padding-wrap" v-if="banner" > <view class="uni-padding-wrap" v-if="banner" >
<view> <view>
<view class="uni-padding-wrap"> <view class="uni-padding-wrap">
<view class="page-section swiper"> <view class="page-section swiper">
<view class="page-section-spacing"> <view class="page-section-spacing">
<swiper class="swiper" :indicator-dots="true" :style="{height:heightOut+'px'}" :autoplay="false" :interval="3000" :duration="300" @animationfinish="tiaoguos" @change="qiehuan"> <swiper class="swiper" :indicator-dots="true" :style="{height:heightOut+'px'}" :autoplay="false" :interval="3000" :duration="300" @animationfinish="tiaoguos" @change="qiehuan">
<swiper-item v-for="(item,index) in list" :key="index"> <swiper-item v-for="(item,index) in list" :key="index">
<view class="swiper-item uni-bg-red"> <view class="swiper-item uni-bg-red">
<image :src=" 'https://' + item.launch_path"></image> <image :src=" 'https://' + item.launch_path"></image>
</view> </view>
<view class="btn-init" v-if="parseInt(index) == 2" @click="goNext">立即体验</view> <view class="btn-init" v-if="parseInt(index) == 2" @click="goNext">立即体验</view>
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 用户协议弹窗 --> <!-- 用户协议弹窗 -->
<view class="welcome_backes" v-if="protocol"> <view class="welcome_backes" v-if="protocol">
<view class="content"> <view class="content">
<view class="title">{{ agreement.document_title }}</view> <view class="title">{{ agreement.document_title }}</view>
<!-- <text class="protocol_content"></text> --> <!-- <text class="protocol_content"></text> -->
<scroll-view scroll-y class="scroll"> <scroll-view scroll-y class="scroll">
<rich-text class="protocol_content" :nodes="agreement.document_content"></rich-text> <rich-text class="protocol_content" :nodes="agreement.document_content"></rich-text>
</scroll-view> </scroll-view>
<view class="to_agree" @click="to_agree">我同意</view> <view class="to_agree" @click="to_agree">我同意</view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import common from '@/static/js/common.js' import common from '@/static/js/common.js'
export default { export default {
data() { data() {
return { return {
remaining: 7, remaining: 7,
type: true, type: true,
banner: false, banner: false,
protocol: false, protocol: false,
heightOut: '', heightOut: '',
imgurl: [], imgurl: [],
vide0_url: '', vide0_url: '',
agreement: { // agreement: { //
document_title: "", document_title: "",
document_content: "" document_content: ""
}, },
heightesStyle : { heightesStyle : {
height : '' height : ''
}, },
title: 'video', title: 'video',
src: '', src: '',
inputValue: '', inputValue: '',
controls: false, controls: false,
list: [], list: [],
background: ['color1', 'color2', 'color3'], background: ['color1', 'color2', 'color3'],
indicatorDots: true, indicatorDots: true,
interval: 2000, interval: 2000,
duration: 500, duration: 500,
swiper_index: "", swiper_index: "",
tiaoguo:false, tiaoguo:false,
weizhi:0 weizhi:0
}; };
}, },
onReady: function(res) { onReady: function(res) {
this.videoContext = uni.createVideoContext('myVideo'); this.videoContext = uni.createVideoContext('myVideo');
}, },
methods: { methods: {
tiaoguos(a){ tiaoguos(a){
console.log(a.detail) console.log(a.detail)
if(this.weizhi == a.detail.current && a.detail.current == this.list.length -1){ if(this.weizhi == a.detail.current && a.detail.current == this.list.length -1){
this.leap_overto() this.leap_overto()
} }
this.weizhi = a.detail.current this.weizhi = a.detail.current
}, },
qiehuan(a){ qiehuan(a){
console.log(a) console.log(a)
this.tiaoguo = a.detail.current this.tiaoguo = a.detail.current
}, },
apiwelcome() { apiwelcome() {
this.$u.api.documentInfo({ this.$u.api.documentInfo({
document_code: 'agreement' document_code: 'agreement'
}).then((res) => { }).then((res) => {
if (res.errCode == 0) { if (res.errCode == 0) {
let agreement = res.data; let agreement = res.data;
// console.log(agreement.document_content) // console.log(agreement.document_content)
agreement.document_content = common.unescapeHTML(agreement.document_content); agreement.document_content = common.unescapeHTML(agreement.document_content);
// console.log(agreement); // console.log(agreement);
this.agreement = agreement; this.agreement = agreement;
} }
}) })
// //
this.$u.api.pageList({}).then((res) => { this.$u.api.pageList({}).then((res) => {
console.log('协议', res) console.log('协议', res)
let data_image = res.data.welcome_page let data_image = res.data.welcome_page
let vide0_url = res.data.start_page[0].launch_path let vide0_url = res.data.start_page[0].launch_path
this.list = data_image; this.list = data_image;
this.vide0_url = vide0_url; this.vide0_url = vide0_url;
}) })
}, },
// 3 // 3
remaining_time() { remaining_time() {
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.remaining--; this.remaining--;
if (this.remaining <= 0) { if (this.remaining <= 0) {
clearInterval(this.timer); clearInterval(this.timer);
console.log("完了") console.log("完了")
this.type = !this.type; this.type = !this.type;
this.banner = !this.banner; this.banner = !this.banner;
} }
}, 1000); }, 1000);
}, },
leap_over() { leap_over() {
this.type = !this.type this.type = !this.type
this.banner = !this.banner; this.banner = !this.banner;
clearInterval(this.timer) clearInterval(this.timer)
// //
this.getSystemInfo() this.getSystemInfo()
}, },
leap_overto() { leap_overto() {
this.protocol = true; this.protocol = true;
this.banner = false; this.banner = false;
}, },
getSystemInfo() { getSystemInfo() {
let that = this; let that = this;
// //
uni.getSystemInfo({ uni.getSystemInfo({
success: function(res) { success: function(res) {
that.heightOut = res.windowHeight; that.heightOut = res.windowHeight;
console.log(that.heightOut) console.log(that.heightOut)
} }
}); });
}, },
// //
goNext() { goNext() {
this.protocol = true; this.protocol = true;
this.banner = false; this.banner = false;
}, },
// //
to_agree() { to_agree() {
uni.setStorage({ uni.setStorage({
key: 'launchFlag', key: 'launchFlag',
data: true, data: true,
success: function() { success: function() {
console.log('点击存储launchFlag'); console.log('点击存储launchFlag');
} }
}); });
uni.navigateTo({ uni.navigateTo({
url: '/pageA/login/login' url: '/pageA/login/login'
}); });
}, },
// //
bindInputBlur: function(e) { bindInputBlur: function(e) {
this.inputValue = e.target.value; this.inputValue = e.target.value;
console.log(e.target.value); console.log(e.target.value);
}, },
bindButtonTap: function() { bindButtonTap: function() {
var that = this var that = this
uni.chooseVideo({ uni.chooseVideo({
sourceType: ['album', 'camera'], sourceType: ['album', 'camera'],
maxDuration: 60, maxDuration: 60,
camera: ['front', 'back'], camera: ['front', 'back'],
success: function(res) { success: function(res) {
this.src = res.tempFilePath this.src = res.tempFilePath
} }
}) })
}, },
bindSendDanmu: function() { bindSendDanmu: function() {
this.videoContext.sendDanmu({ this.videoContext.sendDanmu({
text: this.inputValue, text: this.inputValue,
color: this.getRandomColor() color: this.getRandomColor()
}) })
}, },
videoErrorCallback: function(e) { videoErrorCallback: function(e) {
console.log('视频错误信息:',e); console.log('视频错误信息:',e);
}, },
timeupdate(e) { timeupdate(e) {
console.log(e); console.log(e);
}, },
getRandomColor: function() { getRandomColor: function() {
const rgb = [] const rgb = []
for (let i = 0; i < 3; ++i) { for (let i = 0; i < 3; ++i) {
let color = Math.floor(Math.random() * 256).toString(16) let color = Math.floor(Math.random() * 256).toString(16)
color = color.length == 1 ? '0' + color : color color = color.length == 1 ? '0' + color : color
rgb.push(color) rgb.push(color)
} }
return '#' + rgb.join('') return '#' + rgb.join('')
} }
}, },
mounted() { mounted() {
// 3 // 3
this.remaining_time(); this.remaining_time();
this.apiwelcome(); this.apiwelcome();
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.uni-padding-wrap{ .uni-padding-wrap{
// height: 400rpx; // height: 400rpx;
} }
.btn-init { .btn-init {
z-index: 1000; z-index: 1000;
position: absolute; position: absolute;
bottom: 100rpx; bottom: 100rpx;
right: 230rpx; right: 230rpx;
width: 300rpx; width: 300rpx;
height: 80rpx; height: 80rpx;
line-height: 80rpx; line-height: 80rpx;
text-align: center; text-align: center;
color: #fff; color: #fff;
border-radius: 40rpx; border-radius: 40rpx;
background-color: #007AFF; background-color: #007AFF;
} }
.welcome_jumpes { .welcome_jumpes {
z-index: 100; z-index: 100;
position: absolute; position: absolute;
top: 80rpx; top: 80rpx;
right: 60rpx; right: 60rpx;
width: 100rpx; width: 100rpx;
height: 40rpx; height: 40rpx;
border-radius: 20rpx; border-radius: 20rpx;
font-size: 22rpx; font-size: 22rpx;
text-align: center; text-align: center;
line-height: 40rpx; line-height: 40rpx;
color: #fff; color: #fff;
background-color: rgba(0,0,0,0.5); background-color: rgba(0,0,0,0.5);
} }
#myVideo { #myVideo {
width: 100%; width: 100%;
} }
uni-video { uni-video {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.uni-video-container { .uni-video-container {
background-color: none !important; background-color: none !important;
} }
.welcome_images { .welcome_images {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
position: fixed; position: fixed;
} }
uni-swiper, uni-swiper,
uni-view, uni-view,
uni-image { uni-image {
width: 100%; width: 100%;
// position: fixed; // position: fixed;
height: 100vh; height: 100vh;
} }
uni-image { uni-image {
width: 100%; width: 100%;
} }
// //
uni-swiper .uni-swiper-dot-active { uni-swiper .uni-swiper-dot-active {
background-color: #fff !important; background-color: #fff !important;
} }
.welcome_backes { .welcome_backes {
width: 100%; width: 100%;
position: fixed; position: fixed;
height: 100%; height: 100%;
background: #999999; background: #999999;
.content { .content {
width: 558rpx; width: 558rpx;
height: 730rpx; height: 730rpx;
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
top: 0; top: 0;
margin: auto; margin: auto;
.title { .title {
width: 558rpx; width: 558rpx;
text-align: center; text-align: center;
height: 29rpx; height: 29rpx;
font-size: 30rpx; font-size: 30rpx;
font-weight: bold; font-weight: bold;
color: rgba(51, 51, 51, 1); color: rgba(51, 51, 51, 1);
line-height: 29rpx; line-height: 29rpx;
margin: 30rpx 0 24rpx 0; margin: 30rpx 0 24rpx 0;
} }
.scroll { .scroll {
height: 560rpx; height: 560rpx;
.protocol_content { .protocol_content {
display: block; display: block;
width: 494rpx; width: 494rpx;
height: 528rpx; height: 528rpx;
margin: 10rpx auto 30rpx; margin: 10rpx auto 30rpx;
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
text-align: left; text-align: left;
line-height: 36rpx; line-height: 36rpx;
text-align: justify; text-align: justify;
letter-spacing: 1rpx; letter-spacing: 1rpx;
text-indent: 2rem; text-indent: 2rem;
color: rgba(51, 51, 51, 1); color: rgba(51, 51, 51, 1);
} }
} }
.to_agree { .to_agree {
width: 558rpx; width: 558rpx;
font-size: 30rpx; font-size: 30rpx;
font-weight: bold; font-weight: bold;
color: rgba(255, 121, 16, 1); color: rgba(255, 121, 16, 1);
text-align: center; text-align: center;
padding-top: 27rpx; padding-top: 27rpx;
border-top: #D8D8D8 solid 1px; border-top: #D8D8D8 solid 1px;
} }
} }
} }
</style> </style>

View File

@ -19,7 +19,7 @@
</view> </view>
<view class="next" @click="viewMore"> <view class="next" @click="viewMore">
<text>查看更多</text> <text>查看更多</text>
<u-icon name="arrow-right" color="#999" size="18"></u-icon> <u-icon name="arrow-right" color="#999" size="22"></u-icon>
</view> </view>
</view> </view>
<view class="list"> <view class="list">

View File

@ -73,11 +73,11 @@ export default {
width: 90%; width: 90%;
margin: 0 auto; margin: 0 auto;
padding: 16upx 0; padding: 16upx 0;
font-size: 26upx; font-size: 30upx;
color: #333; color: #333;
} }
.rict_type { .rict_type {
text-indent: 1rem; text-indent: 1rem;
line-height: 1.2; line-height: 1.4;
} }
</style> </style>

View File

@ -335,6 +335,7 @@
color: #333; color: #333;
font-size: 28rpx; font-size: 28rpx;
.title { .title {
line-height: 40rpx;
} }
.name { .name {
width: 500rpx; width: 500rpx;
@ -345,6 +346,8 @@
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
margin:8rpx 0;
line-height:36rpx;
} }
.price { .price {
color: #FF3131; color: #FF3131;