Commit 43fed0e7 authored by 王永阿飞's avatar 王永阿飞
parents 687fcdfa f27dce45
...@@ -8,9 +8,7 @@ ...@@ -8,9 +8,7 @@
<image :src="item"></image> <image :src="item"></image>
</swiper-item> </swiper-item>
</swiper> </swiper>
<swiper circular v-else :indicator-dots="indicatorDots" autoplay="true" interval="3000" duration="500"> <swiper circular v-else :indicator-dots="indicatorDots" autoplay="true" interval="3000" duration="500">
<swiper-item v-for="(item,i) in bannerlist ":key="i" > <swiper-item v-for="(item,i) in bannerlist ":key="i" >
<image :src="item"></image> <image :src="item"></image>
</swiper-item> </swiper-item>
......
...@@ -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=>{
......
...@@ -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>
......
...@@ -212,26 +212,17 @@ ...@@ -212,26 +212,17 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.head_bg { .head_bg {
width: 100%; width: 100%;
height: 299px; height: 100%;
position: relative; position: relative;
overflow-x: hidden; overflow-x: hidden;
overflow-y: hidden; overflow-y: hidden;
top: 88rpx;
// top: 88rpx;
/* #ifdef APP-PLUS */
top: calc(var(--top-window-height) + 0px); top: calc(var(--top-window-height) + 0px);
/* #endif */
-webkit-overflow-scroll:touch;
left: 0;
.home{ .home{
position: absolute; position: absolute;
z-index: 2; z-index: 2;
margin: 8% 0 0 3%; margin: 8% 0 0 3%;
} }
.avatar { .avatar {
position: absolute; position: absolute;
z-index: 2; z-index: 2;
......
...@@ -126,7 +126,8 @@ ...@@ -126,7 +126,8 @@
total: 0, total: 0,
signInList: [], signInList: [],
signupexamlist:{}, signupexamlist:{},
signuplist:{} signuplist:{},
str1:null,
} }
}, },
...@@ -185,6 +186,8 @@ ...@@ -185,6 +186,8 @@
getMyActivitySignupByWechatId(wechatId).then(response => { getMyActivitySignupByWechatId(wechatId).then(response => {
console.log(response) console.log(response)
this.myActivitylist = [...this.myActivitylist, ...response.rows] || [] this.myActivitylist = [...this.myActivitylist, ...response.rows] || []
this.str1=this.myActivitylist.activityTime.slice('6');
console.log(this.myActivitylist) console.log(this.myActivitylist)
this.total = response.total || []; this.total = response.total || [];
console.log(this.total) console.log(this.total)
......
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
// 跳转对应的详情页 // 跳转对应的详情页
toVoteDetail(item) { toVoteDetail(item) {
console.log("跳转放到投票详情页面---", 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
...@@ -184,8 +184,8 @@ ...@@ -184,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),
}) })
} }
}, },
......
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
</template> </template>
<script> <script>
import {
mapState
} from 'vuex'
import { import {
setVoteAxios, setVoteAxios,
getCurrentVoteAxios getCurrentVoteAxios
...@@ -47,6 +50,26 @@ ...@@ -47,6 +50,26 @@
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) {
...@@ -99,26 +122,7 @@ ...@@ -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> </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