Commit 44c66293 authored by 王永阿飞's avatar 王永阿飞
parents d98a9156 a67de785
......@@ -19,9 +19,9 @@
<view class="production-bottom">
<view class="production-content" v-for="(productionItem,productionIndex) in productionList"
:key="productionIndex">
<image v-if="opusType == 1" :src="productionItem.tjtActivityPictureList[0].url" mode=""></image>
<image v-if="opusType == '1'" :src="productionItem.tjtActivityPictureList[0].url" mode=""></image>
<video v-if=" opusType == 2" id="myVideo" class="video" :controls="false" :show-center-play-btn="false"
<video v-if="opusType == '2'" id="myVideo" class="video" :controls="false" :show-center-play-btn="false"
:show-fullscreen-btn="false" :src="productionItem.tjtActivityPictureList[0].url"
@timeupdate='timeupdate'></video>
......@@ -49,14 +49,15 @@
data() {
return {
// 活动作品形式(1--图片, 2--视频)
opusType: 2,
opusType: '1',
//活动id
projectIdMoment: '',
activity: {
activityId: '',
activityName: '',
bannerImage: ''
bannerImage: '',
},
// 点击投票时的数据
voteObject: {
......@@ -127,17 +128,25 @@
this.activity.activityId = res.data[0].activityId
this.activity.activityName = res.data[0].activityName
this.activity.bannerImage = res.data[0].bannerImage
this.opusType = res.data[0].fileType
this.projectList = res.data[0].tjtActivityProjectVoList
this.productionList = this.projectList[0].tjtActivityOpusVoList
console.log("投票通道获取内容----?", this.productionList)
//获取最后一个.的位置
var index = this.productionList[0].tjtActivityPictureList[0].url.lastIndexOf(".");
//获取后缀
var ext = this.productionList[0].tjtActivityPictureList[0].url.substr(index + 1);
if (ext != 'mp4') {
this.opusType = 1
} else {
this.opusType = 2
}
// for(let item in this.productionList){
// if(!this.productionList[item].tjtActivityPictureList[0].url){
// var index = this.productionList[item].tjtActivityPictureList[0].url.lastIndexOf(".");
// //获取后缀
// var ext = this.productionList[item].tjtActivityPictureList[0].url.substr(index + 1);
// if (ext != 'mp4') {
// this.opusType = 1
// } else {
// this.opusType = 2
// }
// return
// }
// }
this.projectIdMoment = this.projectList[0].projectId
} else {
......@@ -164,7 +173,7 @@
// 跳转对应的详情页
toVoteDetail(item) {
console.log("跳转放到投票详情页面---", item)
this.voteObject.activityId = this.activity.activityId
this.voteObject.opusType = this.opusType
// 将当前项目下的项目id传给voteObject
......
<template>
<view>
<view class="production-content">
<swiper v-if="opusType == 1" class="swiper-home" indicator-dots="true" autoplay="true" interval="2000"
<swiper v-if="opusType == '1'" class="swiper-home" indicator-dots="true" autoplay="true" interval="2000"
circular="true" indicator-color="#000" indicator-active-color="#FF0000">
<swiper-item v-for="(item,index) in bannerList" :key="index">
<image :src="item.url" :webp="true" @click="clickImg(item.url)"></image>
</swiper-item>
</swiper>
<video v-if=" opusType == 2" id="myVideo" class="video" show-fullscreen-btn :src="bannerList[0].url" :controls="true"
:show-mute-btn="true" direction="0"></video>
<video v-if=" opusType == '2'" id="myVideo" class="video" show-fullscreen-btn :src="bannerList[0].url"
:controls="true" :show-mute-btn="true" direction="0"></video>
<view class="vote-main">
<text class="production-name">{{name}}的作品</text>
<text class="vote-message">
......@@ -43,7 +42,7 @@
productionId: '',
bannerList: [],
opusBrief: '',
weChatId: 1,
weChatId: '',
opusType: 1,
opusId: ''
}
......@@ -100,7 +99,9 @@
})
}
},
computed: {
...mapState('m_user', ['userInfo']),
},
onLoad(option) { //option为object类型,会序列化上个页面传递的参数
if (option) {
if (option.param) {
......@@ -114,12 +115,8 @@
this.opusBrief = JSON.parse(decodeURIComponent(option.param)).opusBrief
this.opusType = JSON.parse(decodeURIComponent(option.param)).opusType
this.opusId = JSON.parse(decodeURIComponent(option.param)).productionId
console.log("作品id:", this.opusId)
console.log("作品id:", this.bannerList)
}
this.weChatId = this.userInfo.wechatId
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment