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