Commit 43fed0e7 authored by 王永阿飞's avatar 王永阿飞
parents 687fcdfa f27dce45
......@@ -8,9 +8,7 @@
<image :src="item"></image>
</swiper-item>
</swiper>
<swiper circular v-else :indicator-dots="indicatorDots" autoplay="true" interval="3000" duration="500">
<swiper-item v-for="(item,i) in bannerlist ":key="i" >
<image :src="item"></image>
</swiper-item>
......
......@@ -219,16 +219,16 @@
console.log(this.activityInfo);
//时间格式处理
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)
// this.activityInfo.activityEnd = this.activityInfo.activityEnd
index = this.activityInfo.activityStart.indexOf(' ')
// this.activityInfo.activityStart = this.activityInfo.activityStart.substr(0, index)
let activityStart = this.activityInfo.activityStart.substr(0, index)
// this.activityInfo.activityStart = this.activityInfo.activityStart
this.activityInfo.activityTime = this.activityInfo.activityStart + '-' + this.activityInfo
.activityEnd
// this.activityInfo.activityTime = activityStart + '—' + activityEnd
// this.activityInfo.activityTime = this.activityInfo.activityStart + '-' + this.activityInfo
// .activityEnd
this.activityInfo.activityTime = activityStart + '—' + activityEnd
this.activityInfo.signupTime = this.activityInfo.signupTime
// this.getDaysBetween(this.activityInfo.signupTime)
selectexamType(this.activityInfo.examType).then(response=>{
......
......@@ -64,7 +64,8 @@
<view class="home_activity_item" v-for="(item1,index1) in activityList" :key="index1"
@click="goActDetil(item1)">
<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 class="activity-body">
<view class="activity_image_title">
......@@ -187,35 +188,39 @@
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() {
// if (!this.token) {
this.getActivityList()
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() {
listActivityStart().then(res => {
this.activityList = [...this.activityList, ...res.data] || []
console.log(res.data);
console.log("热门活动", res.data);
}).catch(err => {
})
......@@ -223,6 +228,7 @@
getExerciseList() {
listExercise().then(res => {
this.exerciseList = [...this.exerciseList, ...res.data] || []
console.log("训练体验", res.data);
}).catch(err => {
})
......@@ -269,8 +275,18 @@
}
},
onLoad() {
this.login()
this.marginHight = uni.getStorageSync('menuInfo').statusBarHeight + 9 + 'px'
},
onShow() {
this.getWXUserCode().then(() => {
this.activityList = []
this.exerciseList = []
this.login()
})
},
onHide() {
this.activityList = []
this.exerciseList = []
}
}
</script>
......
......@@ -212,26 +212,17 @@
<style lang="scss" scoped>
.head_bg {
width: 100%;
height: 299px;
height: 100%;
position: relative;
overflow-x: hidden;
overflow-y: hidden;
// top: 88rpx;
/* #ifdef APP-PLUS */
top: 88rpx;
top: calc(var(--top-window-height) + 0px);
/* #endif */
-webkit-overflow-scroll:touch;
left: 0;
.home{
position: absolute;
z-index: 2;
margin: 8% 0 0 3%;
}
.avatar {
position: absolute;
z-index: 2;
......
......@@ -126,7 +126,8 @@
total: 0,
signInList: [],
signupexamlist:{},
signuplist:{}
signuplist:{},
str1:null,
}
},
......@@ -185,6 +186,8 @@
getMyActivitySignupByWechatId(wechatId).then(response => {
console.log(response)
this.myActivitylist = [...this.myActivitylist, ...response.rows] || []
this.str1=this.myActivitylist.activityTime.slice('6');
console.log(this.myActivitylist)
this.total = response.total || [];
console.log(this.total)
......
......@@ -173,7 +173,7 @@
// 跳转对应的详情页
toVoteDetail(item) {
console.log("跳转放到投票详情页面---", item)
console.log("跳转放到投票详情页面---")
this.voteObject.activityId = this.activity.activityId
this.voteObject.opusType = this.opusType
// 将当前项目下的项目id传给voteObject
......@@ -184,8 +184,8 @@
this.voteObject.opusBrief = item.opusBrief
this.voteObject.tjtActivityPictureList = item.tjtActivityPictureList
uni.navigateTo({
url: '/pages_vote/tjty_vote_detail/tjty_vote_detail?param=' + encodeURIComponent(JSON
.stringify(this.voteObject)),
// url: '/pages_vote/tjty_vote_detail/tjty_vote_detail?param=' + encodeURIComponent(JSON.stringify(this.voteObject)),
url: '/pages_vote/tjty_vote_detail/tjty_vote_detail?param=' +JSON.stringify(this.voteObject),
})
}
},
......
......@@ -28,6 +28,9 @@
</template>
<script>
import {
mapState
} from 'vuex'
import {
setVoteAxios,
getCurrentVoteAxios
......@@ -47,6 +50,26 @@
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: {
clickImg(imgUrl) {
......@@ -99,26 +122,7 @@
})
}
},
computed: {
...mapState('m_user', ['userInfo']),
},
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
}
this.weChatId = this.userInfo.wechatId
}
}
}
</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