Commit f27dce45 authored by 刘鑫鹏's avatar 刘鑫鹏

Merge remote-tracking branch 'origin/dev' into dev

parents a8193369 8eb921e3
...@@ -14,14 +14,14 @@ ...@@ -14,14 +14,14 @@
<view class="font-body"> <view class="font-body">
<!-- // type 1--赛事活动 2-答题活动 signupNum--赛事活动人数 signupExamNum--答题活动人数 --> <!-- // type 1--赛事活动 2-答题活动 signupNum--赛事活动人数 signupExamNum--答题活动人数 -->
<view class="activity_title"> <view class="activity_title">
<view style="padding: 2% 4%;">{{item.activityName |ellipsis}}</view> <view style="padding: 2% 4%;white-space:pre-wrap">{{item.activityName |ellipsis}}</view>
</view> </view>
<view style="margin-top: -70rpx;"> <view style="margin-top: -70rpx;">
<view class="activity_font"> <text <view class="activity_font"> <text
style="padding-top: -1rpx;">报名截止:&nbsp;&nbsp;{{!item.signupTime ? '—' : item.signupTime}}</text> style="padding-top: -1rpx;">报名截止:&nbsp;&nbsp;{{!item.signupTime ? '—' : item.signupTime}}</text>
</view> </view>
<view class="activity_font"> <view class="activity_font">
<text>组织机构:&nbsp;&nbsp;{{item.mechanismName |ellipsisInstitutions}}</text></view> <text style="white-space:pre-wrap">组织机构:&nbsp;&nbsp;{{item.mechanismName |ellipsisInstitutions}}</text></view>
<view class="activity_font" style="padding-bottom:10rpx;"> <text>已报名:&nbsp;&nbsp;<text <view class="activity_font" style="padding-bottom:10rpx;"> <text>已报名:&nbsp;&nbsp;<text
style="color: #FCA624; margin-left: 12rpx;"> style="color: #FCA624; margin-left: 12rpx;">
<text v-if="item.type ==='1'">{{item.signupNum}}</text> <text v-if="item.type ==='1'">{{item.signupNum}}</text>
...@@ -89,11 +89,6 @@ ...@@ -89,11 +89,6 @@
this.login() this.login()
// this.getList() // this.getList()
}, },
created() {
// uni.setStorageSync("title", '赛事活动')
// this.getList()
// this.getList()
},
onShow() { onShow() {
console.log('onShow') console.log('onShow')
this.getList() this.getList()
......
...@@ -74,7 +74,8 @@ import { ...@@ -74,7 +74,8 @@ import {
errorMessage: '请输入姓名', errorMessage: '请输入姓名',
}, { }, {
validateFunction: function(rule, value, data, callback) { validateFunction: function(rule, value, data, callback) {
let nameReg = /^[A-z]{2,16}$|^[\u4E00-\u9FA5]{2,16}$/ // let nameReg = /^[A-z]{2,16}$|^[\u4E00-\u9FA5]{2,16}$/
let nameReg = /^[A-z | \u4E00-\u9FA5]{2,16}$/
if (!nameReg.test(value)) { if (!nameReg.test(value)) {
callback('姓名只能输入汉字或字母且长度为2-16') callback('姓名只能输入汉字或字母且长度为2-16')
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<view class="signIn-body"><text>项目:<text style="display: block;float: right;margin-right: 20rpx;">{{item.projectName}}</text></text></view> <view class="signIn-body"><text>项目:<text style="display: block;float: right;margin-right: 20rpx;">{{item.projectName}}</text></text></view>
<view class="signIn-body"><text>费用:<text style="display: block;float: right;margin-right: 20rpx; color: #F28723;">{{item.projectFee}}/人</text></text></view> <view class="signIn-body"><text>费用:<text style="display: block;float: right;margin-right: 20rpx; color: #F28723;">{{item.projectFee}}/人</text></text></view>
<view class="signIn-body" v-if="item.projectFee!==0"><text>缴费方式:<text style="display: block;float: right;margin-right: 20rpx;">微信支付</text></text></view> <view class="signIn-body" v-if="item.projectFee!==0"><text>缴费方式:<text style="display: block;float: right;margin-right: 20rpx;">微信支付</text></text></view>
<view class="signIn-body" v-if="item.projectFee!==0"><text>缴费时间:<text style="display: block;float: right;margin-right: 20rpx;" >{{item.transactionTime}}</text></text></view> <view class="signIn-body" v-if="item.projectFee!==0"><text>缴费时间:<text style="display: block;float: right;margin-right: 20rpx;" >{{item.transactionTime===null?'未缴费':item.transactionTime}}</text></text></view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -117,15 +117,15 @@ ...@@ -117,15 +117,15 @@
export default { export default {
data() { data() {
return { return {
titleTime: '',//当前试题应该是哪一天的卷子 titleTime: '', //当前试题应该是哪一天的卷子
marginHight: '',//页面内容到手机顶部的距离 marginHight: '', //页面内容到手机顶部的距离
flagCode: '', //完成情况 flagCode: '', //完成情况
dateList: [], //从活动开始到现在的日期 dateList: [], //从活动开始到现在的日期
finishStatus: [], //完成情况过滤中间数组 finishStatus: [], //完成情况过滤中间数组
finishSituationList: [],//完成情况数组 finishSituationList: [], //完成情况数组
activityInfo: '',//活动信息 activityInfo: '', //活动信息
signupId: null,//报名人id signupId: null, //报名人id
activityId: null,//活动id activityId: null, //活动id
examId: '', //试卷id examId: '', //试卷id
examTime: '', //试卷的日期 examTime: '', //试卷的日期
flagTime: '', //标志时间 flagTime: '', //标志时间
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
hour: 0, hour: 0,
minutes: 0, minutes: 0,
seconds: 0, seconds: 0,
questionScore:'' questionScore: ''
}; };
}, },
methods: { methods: {
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
this.getFinishSituation().then(() => { this.getFinishSituation().then(() => {
console.log("finishSituationList", this.finishSituationList); console.log("finishSituationList", this.finishSituationList);
let i = 0; let i = 0;
if (i === this.day-1) { if (i === this.day - 1) {
console.log("所有答题已完成"); console.log("所有答题已完成");
uni.showToast({ uni.showToast({
title: '所有答题已完成,请退出答题页面', title: '所有答题已完成,请退出答题页面',
...@@ -183,9 +183,9 @@ ...@@ -183,9 +183,9 @@
return return
} }
for (i = 0; i < this.day; i++) { for (i = 0; i < this.day; i++) {
console.log('i',i); console.log('i', i);
console.log('this.day',this.day); console.log('this.day', this.day);
if (i < this.day-1) { if (i < this.day - 1) {
if (this.finishSituationList[i].flag === false) { if (this.finishSituationList[i].flag === false) {
console.log(this.finishSituationList[i]); console.log(this.finishSituationList[i]);
this.getNotFinish(this.finishSituationList[i].date, i) this.getNotFinish(this.finishSituationList[i].date, i)
...@@ -254,11 +254,11 @@ ...@@ -254,11 +254,11 @@
// this.timer = null // this.timer = null
} }
let addScoreData = { let addScoreData = {
signupId:this.signupId, signupId: this.signupId,
examId:this.examId, examId: this.examId,
score:this.score, score: this.score,
activityId:this.activityId, activityId: this.activityId,
examTime:this.flagTime examTime: this.flagTime
} }
console.log(addScoreData); console.log(addScoreData);
// addScore(this.signupId, this.examId, this.score, this.activityId, this.flagTime).then(res => { // addScore(this.signupId, this.examId, this.score, this.activityId, this.flagTime).then(res => {
...@@ -292,6 +292,7 @@ ...@@ -292,6 +292,7 @@
//获取未完成的试卷 //获取未完成的试卷
getNotFinish(date, index) { getNotFinish(date, index) {
this.$refs.masks.open('center') this.$refs.masks.open('center')
this.show = false
//显示加载框 //显示加载框
uni.showLoading({ uni.showLoading({
title: '试题抽取中' title: '试题抽取中'
...@@ -318,7 +319,7 @@ ...@@ -318,7 +319,7 @@
console.log("date", date); console.log("date", date);
// dailyQuestion(this.signupId, date).then(res => { // dailyQuestion(this.signupId, date).then(res => {
getExamPapers(this.signupId, this.activityId, date).then(res => { getExamPapers(this.signupId, this.activityId, date).then(res => {
// console.log(res); console.log("试卷",res);
if (res.code === 200) { if (res.code === 200) {
// this.flagTime = formatDate(res.data[0].examTime, 'yyyy-MM-dd') //标志时间 // this.flagTime = formatDate(res.data[0].examTime, 'yyyy-MM-dd') //标志时间
this.flagTime = res.data[0].examTime //标志时间 this.flagTime = res.data[0].examTime //标志时间
...@@ -338,7 +339,7 @@ ...@@ -338,7 +339,7 @@
} }
}) })
this.total = res.data[0].questionsNum this.total = res.data[0].questionsNum
this.questionScore = res.data[0].score/res.data[0].questionsNum this.questionScore = res.data[0].score / res.data[0].questionsNum
//将取到的题目id集合反转 //将取到的题目id集合反转
questionId = questionId.reverse() questionId = questionId.reverse()
for (let i = 0; i < res.data.length / 4; i++) { for (let i = 0; i < res.data.length / 4; i++) {
...@@ -421,7 +422,7 @@ ...@@ -421,7 +422,7 @@
this.flagTime = res.data[0].examTime this.flagTime = res.data[0].examTime
// this.flagTime = formatDate(res.data[0].examTime, 'yyyy-MM-dd') // this.flagTime = formatDate(res.data[0].examTime, 'yyyy-MM-dd')
this.examTime = res.data[0].examTime //今天的日期 this.examTime = res.data[0].examTime //今天的日期
this.questionScore = res.data[0].score/res.data[0].questionsNum this.questionScore = res.data[0].score / res.data[0].questionsNum
// this.examTime = formatDate(res.data[0].examTime, 'yyyy-MM-dd') //今天的日期 // this.examTime = formatDate(res.data[0].examTime, 'yyyy-MM-dd') //今天的日期
// this.day = this.getDaysBetween(res.data[0].activityStart, res.data[0] // this.day = this.getDaysBetween(res.data[0].activityStart, res.data[0]
// .examTime) //今天是答题活动的第几天 // .examTime) //今天是答题活动的第几天
...@@ -572,11 +573,11 @@ ...@@ -572,11 +573,11 @@
this.marginHight = uni.getStorageSync('menuInfo').statusBarHeight + uni.getStorageSync('menuInfo') this.marginHight = uni.getStorageSync('menuInfo').statusBarHeight + uni.getStorageSync('menuInfo')
.navBarHeight + 15 + 'px' .navBarHeight + 15 + 'px'
this.begin() this.begin()
this.getFinishSituation().then(()=>{ this.getFinishSituation().then(() => {
let titleTime = new Date().toISOString().substring(0, 10) let titleTime = new Date().toISOString().substring(0, 10)
if(titleTime != options.examTime){ if (titleTime != options.examTime) {
this.titleTime = options.examTime this.titleTime = options.examTime
console.log('titleTime',this.titleTime); console.log('titleTime', this.titleTime);
} }
}) //判断是否完成答题 }) //判断是否完成答题
this.getDailyQuestion() this.getDailyQuestion()
...@@ -730,7 +731,7 @@ ...@@ -730,7 +731,7 @@
} }
.content-select { .content-select {
margin: 4% 2%; margin: 6% 2%;
font-size: 16px; font-size: 16px;
font-family: Source Han Sans CN, Source Han Sans CN-Regular; font-family: Source Han Sans CN, Source Han Sans CN-Regular;
font-weight: 400; font-weight: 400;
...@@ -770,11 +771,12 @@ ...@@ -770,11 +771,12 @@
button { button {
position: relative; position: relative;
top: 10%; top: 20%;
width: 88%; width: 85%;
height: 80%; height: 88rpx;
background: #3b7cde; background: #3b7cde;
border-radius: 16px; border-radius: 16px;
line-height: 2;
text { text {
position: relative; position: relative;
...@@ -870,8 +872,6 @@ ...@@ -870,8 +872,6 @@
} }
} }
.masks-popup{ .masks-popup {}
}
} }
</style> </style>
...@@ -219,16 +219,16 @@ ...@@ -219,16 +219,16 @@
console.log(this.activityInfo); console.log(this.activityInfo);
//时间格式处理 //时间格式处理
let index = this.activityInfo.activityEnd.indexOf(' ') let index = this.activityInfo.activityEnd.indexOf(' ')
// this.activityInfo.activityEnd = this.activityInfo.activityEnd.substr(0, index) this.activityInfo.activityEnd = this.activityInfo.activityEnd.substr(0, index)
let activityEnd = this.activityInfo.activityEnd.substr(0, index) let activityEnd = this.activityInfo.activityEnd.substr(0, index)
// this.activityInfo.activityEnd = this.activityInfo.activityEnd // this.activityInfo.activityEnd = this.activityInfo.activityEnd
index = this.activityInfo.activityStart.indexOf(' ') index = this.activityInfo.activityStart.indexOf(' ')
// this.activityInfo.activityStart = this.activityInfo.activityStart.substr(0, index) // this.activityInfo.activityStart = this.activityInfo.activityStart.substr(0, index)
let activityStart = this.activityInfo.activityStart.substr(0, index) let activityStart = this.activityInfo.activityStart.substr(0, index)
// this.activityInfo.activityStart = this.activityInfo.activityStart // this.activityInfo.activityStart = this.activityInfo.activityStart
this.activityInfo.activityTime = this.activityInfo.activityStart + '-' + this.activityInfo // this.activityInfo.activityTime = this.activityInfo.activityStart + '-' + this.activityInfo
.activityEnd // .activityEnd
// this.activityInfo.activityTime = activityStart + '—' + activityEnd this.activityInfo.activityTime = activityStart + '—' + activityEnd
this.activityInfo.signupTime = this.activityInfo.signupTime this.activityInfo.signupTime = this.activityInfo.signupTime
// this.getDaysBetween(this.activityInfo.signupTime) // this.getDaysBetween(this.activityInfo.signupTime)
selectexamType(this.activityInfo.examType).then(response=>{ selectexamType(this.activityInfo.examType).then(response=>{
......
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
import { import {
mapState mapState
} from 'vuex' } from 'vuex'
import { resolve } from 'path';
// import { info } from 'console'; // import { info } from 'console';
export default { export default {
data() { data() {
...@@ -286,12 +287,15 @@ ...@@ -286,12 +287,15 @@
}, },
//获取当前报名此活动者 //获取当前报名此活动者
getPerson() { getPerson() {
// return new Promise((resolve,reject)=>{
getPeople(this.info.activityId).then(res => { getPeople(this.info.activityId).then(res => {
console.log("报名信息", res); console.log("报名信息", res);
if (res.length > 0) { if (res.length > 0) {
this.peopleList = res this.peopleList = res
} }
}) })
resolve()
// })
}, },
//活动详情 //活动详情
getActivityDetial(id) { getActivityDetial(id) {
...@@ -358,14 +362,34 @@ ...@@ -358,14 +362,34 @@
} }
addTjtActivitySignupExams(this.info).then(res => { addTjtActivitySignupExams(this.info).then(res => {
console.log(res); console.log(res);
if (res >= 0 && res !== '') { this.cityIndex = this.cityList.length - 1
if (Date.parse(this.activityInfo.activityStart) > new Date()) { this.cityCode = ''
this.cityCancel() this.info.cityId = ''
this.info.areId = 1 this.areaIndex = 16
this.areaDisable = true
this.areaCode = ''
this.info.cityAreaId = ''
this.schoolIndex = -1
this.schoolCode = ''
this.info.schoolId = ''
this.schoolDisable = true
this.info.idFlag = false
this.info.areaId = 1
this.info.parentName = '' this.info.parentName = ''
this.info.name = '' this.info.name = ''
this.info.phone = '' this.info.phone = ''
this.info.idCard = '' this.info.idCard = ''
this.info.cityId = ''
this.info.cityAreaId = ''
this.info.schoolId = ''
if (res >= 0 && res !== '') {
if (Date.parse(this.activityInfo.activityStart) > new Date()) {
this.cityCancel()
// this.info.areId = 1
// this.info.parentName = ''
// this.info.name = ''
// this.info.phone = ''
// this.info.idCard = ''
return uni.$showMsg('报名成功,活动开始时间为:' + this.activityInfo.activityStart) return uni.$showMsg('报名成功,活动开始时间为:' + this.activityInfo.activityStart)
} else { } else {
let time = new Date().toISOString().substring(0, 10) let time = new Date().toISOString().substring(0, 10)
...@@ -386,11 +410,11 @@ ...@@ -386,11 +410,11 @@
}) })
} else { } else {
this.cityCancel() this.cityCancel()
this.info.areId = 1 // this.info.areId = 1
this.info.parentName = '' // this.info.parentName = ''
this.info.name = '' // this.info.name = ''
this.info.phone = '' // this.info.phone = ''
this.info.idCard = '' // this.info.idCard = ''
return uni.$showMsg('报名成功,今日无考试') return uni.$showMsg('报名成功,今日无考试')
} }
}) })
......
...@@ -64,7 +64,8 @@ ...@@ -64,7 +64,8 @@
<view class="home_activity_item" v-for="(item1,index1) in activityList" :key="index1" <view class="home_activity_item" v-for="(item1,index1) in activityList" :key="index1"
@click="goActDetil(item1)"> @click="goActDetil(item1)">
<view class="activity_image"> <view class="activity_image">
<image class="image" :src="'https://www.aiwanyundong.com/stage-api' + item1.bannerImage"></image> <image class="image" :src="'https://www.aiwanyundong.com/stage-api' + item1.bannerImage">
</image>
</view> </view>
<view class="activity-body"> <view class="activity-body">
<view class="activity_image_title"> <view class="activity_image_title">
...@@ -187,35 +188,39 @@ ...@@ -187,35 +188,39 @@
icon: 'none' icon: 'none'
}) })
}, },
getWXUserCode() {
return new Promise((resolve, reject) => {
if (!this.token) {
resolve();
return
}
console.log(this.token);
console.log("获取登录信息")
new
uni.login({
provider: 'weixin',
success: res => {
console.log("uni.login res", res.code)
let code = res.code
getToken(code, this.token).then(res => {
// console.log(res);
this.updateToken(res.data.token)
this.updateUserInfo(res.data.user)
})
}
})
resolve();
})
},
//登录判断 //登录判断
login() { login() {
// if (!this.token) {
this.getActivityList() this.getActivityList()
this.getExerciseList() this.getExerciseList()
// } else {
// this.getExerciseListHaveToken()
// this.getActivityListHaveToken()
// }
}, },
// getExerciseListHaveToken() {
// listExerciseHaveToken().then(res => {
// this.exerciseList = [...this.exerciseList, ...res.data] || []
// }).catch(err => {
// })
// },
// getActivityListHaveToken() {
// listActivityStartHaveToken().then(res => {
// this.activityList = [...this.activityList, ...res.data] || []
// }).catch(err => {
// })
// },
getActivityList() { getActivityList() {
listActivityStart().then(res => { listActivityStart().then(res => {
this.activityList = [...this.activityList, ...res.data] || [] this.activityList = [...this.activityList, ...res.data] || []
console.log(res.data); console.log("热门活动", res.data);
}).catch(err => { }).catch(err => {
}) })
...@@ -223,6 +228,7 @@ ...@@ -223,6 +228,7 @@
getExerciseList() { getExerciseList() {
listExercise().then(res => { listExercise().then(res => {
this.exerciseList = [...this.exerciseList, ...res.data] || [] this.exerciseList = [...this.exerciseList, ...res.data] || []
console.log("训练体验", res.data);
}).catch(err => { }).catch(err => {
}) })
...@@ -269,8 +275,18 @@ ...@@ -269,8 +275,18 @@
} }
}, },
onLoad() { onLoad() {
this.login()
this.marginHight = uni.getStorageSync('menuInfo').statusBarHeight + 9 + 'px' this.marginHight = uni.getStorageSync('menuInfo').statusBarHeight + 9 + 'px'
},
onShow() {
this.getWXUserCode().then(() => {
this.activityList = []
this.exerciseList = []
this.login()
})
},
onHide() {
this.activityList = []
this.exerciseList = []
} }
} }
</script> </script>
......
...@@ -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("跳转放到投票详情页面---")
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
...@@ -175,8 +184,8 @@ ...@@ -175,8 +184,8 @@
this.voteObject.opusBrief = item.opusBrief this.voteObject.opusBrief = item.opusBrief
this.voteObject.tjtActivityPictureList = item.tjtActivityPictureList this.voteObject.tjtActivityPictureList = item.tjtActivityPictureList
uni.navigateTo({ uni.navigateTo({
url: '/pages_vote/tjty_vote_detail/tjty_vote_detail?param=' + encodeURIComponent(JSON // url: '/pages_vote/tjty_vote_detail/tjty_vote_detail?param=' + encodeURIComponent(JSON.stringify(this.voteObject)),
.stringify(this.voteObject)), url: '/pages_vote/tjty_vote_detail/tjty_vote_detail?param=' +JSON.stringify(this.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">
...@@ -29,6 +28,9 @@ ...@@ -29,6 +28,9 @@
</template> </template>
<script> <script>
import {
mapState
} from 'vuex'
import { import {
setVoteAxios, setVoteAxios,
getCurrentVoteAxios getCurrentVoteAxios
...@@ -43,11 +45,31 @@ ...@@ -43,11 +45,31 @@
productionId: '', productionId: '',
bannerList: [], bannerList: [],
opusBrief: '', opusBrief: '',
weChatId: 1, weChatId: '',
opusType: 1, opusType: 1,
opusId: '' opusId: ''
} }
}, },
computed: {
...mapState('m_user', ['userInfo']),
},
onLoad(option) { //option为object类型,会序列化上个页面传递的参数
this.weChatId = this.userInfo.wechatId
console.log("详情页获取的信息:", JSON.parse(option.param))
if (option.param) {
console.log("详情页获取的信息:", JSON.parse(option.param))
this.name = JSON.parse(option.param).productionName
this.votes = JSON.parse(option.param).productionVote
this.projectId = JSON.parse(option.param).projectId
this.activityId = JSON.parse(option.param).activityId
this.productionId = JSON.parse(option.param).productionId
this.bannerList = JSON.parse(option.param).tjtActivityPictureList
this.opusBrief = JSON.parse(option.param).opusBrief
this.opusType = JSON.parse(option.param).opusType
this.opusId = JSON.parse(option.param).productionId
}
},
methods: { methods: {
clickImg(imgUrl) { clickImg(imgUrl) {
...@@ -101,27 +123,6 @@ ...@@ -101,27 +123,6 @@
} }
}, },
onLoad(option) { //option为object类型,会序列化上个页面传递的参数
if (option) {
if (option.param) {
console.log("详情页获取的信息:", JSON.parse(decodeURIComponent(option.param)))
this.name = JSON.parse(decodeURIComponent(option.param)).productionName
this.votes = JSON.parse(decodeURIComponent(option.param)).productionVote
this.projectId = JSON.parse(decodeURIComponent(option.param)).projectId
this.activityId = JSON.parse(decodeURIComponent(option.param)).activityId
this.productionId = JSON.parse(decodeURIComponent(option.param)).productionId
this.bannerList = JSON.parse(decodeURIComponent(option.param)).tjtActivityPictureList
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)
}
}
}
} }
</script> </script>
......
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