diff --git a/src/common/components/Header.vue b/src/common/components/Header.vue
index 02abf52..9034749 100644
--- a/src/common/components/Header.vue
+++ b/src/common/components/Header.vue
@@ -145,8 +145,15 @@ export default {
}
},
doLogout: function () {
- localStorage.clear()
- this.checkLogin()
+ var self = this
+ this.$layer.open({
+ content: '确认退出登录吗?',
+ yes: function () {
+ sessionStorage.clear()
+ self.checkLogin()
+ self.$layer.closeAll()
+ }
+ })
}
},
mounted: function () {
diff --git a/src/pages/ArtTrain/ArtTrain.vue b/src/pages/ArtTrain/ArtTrain.vue
index d94757c..81dfda8 100644
--- a/src/pages/ArtTrain/ArtTrain.vue
+++ b/src/pages/ArtTrain/ArtTrain.vue
@@ -19,7 +19,7 @@
- 活动类别>
+ 活动类别>
@@ -175,6 +175,8 @@ export default {
font-size 14px
span
color #565656
+ display inline-block
+ margin-right 5px
button
width 80px
height 30px
@@ -197,19 +199,22 @@ export default {
margin 25px auto
min-height 400px
.service-container
- overflow hidden
+ &:after
+ content: ''
+ display block
+ clear both
.service-list
float left
width 280px
box-sizing border-box
- border 1px solid #a8a8a8
+ box-shadow:0px 0px 10px 0px rgba(176,176,176,0.3);
margin-right 26px
cursor pointer
margin-bottom 26px
&:nth-child(4n)
margin-right 0
&:hover
- background #eee
+ box-shadow:0px 0px 20px 0px rgba(176,176,176,0.9);
.service-img-box
width 100%
height 185px
diff --git a/src/pages/CultureActivityDetail/CultureActivityDetail.vue b/src/pages/CultureActivityDetail/CultureActivityDetail.vue
index 5dd8c90..8ad9dbe 100644
--- a/src/pages/CultureActivityDetail/CultureActivityDetail.vue
+++ b/src/pages/CultureActivityDetail/CultureActivityDetail.vue
@@ -24,8 +24,24 @@
报名时间:{{activityDetail.activityApplyStartTime}}至{{activityDetail.activityApplyEndTime}}
活动规模: 总数: {{activityDetail.activityUserNum}} 已报名: {{activityDetail.enrollCount}}
活动地址:{{activityDetail.activityAddress}}
-
-
+
@@ -79,17 +95,28 @@ export default {
},
data () {
return {
+ token: sessionStorage.getItem('token'),
swiperOptions: {
// pagination: '.swiper-pagination',
loop: true,
autoplay: 3000
},
- activityDetail: {}
+ activityDetail: {},
+ restTime: 0,
+ signInfo: {
+ userPhone: '',
+ userName: '',
+ userIdCard: '',
+ activityId: '',
+ code: ''
+ }
}
},
computed: {
signState: function () {
- if (this.activityDetail.activityState === '3') {
+ if (this.activityDetail.activityState === '2') {
+ return '已发布 '
+ } else if (this.activityDetail.activityState === '3') {
return '报名中'
} else if (this.activityDetail.activityState === '4') {
return '报名人数已满'
@@ -106,22 +133,81 @@ export default {
getActivityDetail: function () {
var self = this
axios.get('http://192.168.0.111:8080/culturalactivity/app/activitylibrary/getactivitylibrarybyidrelease/' + self.$route.params.id).then(function (res) {
- if (res.data.activityImage.indexOf(',') !== -1) {
- res.data.activityImage = res.data.activityImage.split(',')
- } else {
- res.data.activityImage = [res.data.activityImage]
- }
+ res.data.activityImage = res.data.activityImage.split(',')
self.activityDetail = res.data
+ console.log(self.activityDetail)
})
+ },
+ getActivityDetailToken: function () {
+ var self = this
+ axios.get('http://192.168.0.111:8080/culturalactivity/app/activitylibrary/getactivitylibrarybyid/' + self.$route.params.id, {
+ headers: {
+ token: self.token
+ }
+ }).then(function (res) {
+ console.log(res)
+ res.data.activityImage = res.data.activityImage.split(',')
+ self.activityDetail = res.data
+ console.log(self.activityDetail)
+ })
+ },
+ signActivity: function () {
+ var self = this
+ if (self.token) {
+ self.signInfo.activityId = self.activityDetail.activityLibraryId
+ console.log(self.signInfo)
+ axios.post('http://192.168.0.111:8080/culturalactivity/app/activityuserapply/saveactivityuserapplyrelease', self.signInfo, {
+ headers: {
+ token: self.token
+ }
+ }).then(function (res) {
+ console.log(res)
+ if (res.status === 200) {
+ self.$layer.msg('报名成功!')
+ setTimeout(function () {
+ location.reload()
+ }, 1500)
+ }
+ })
+ } else {
+ self.$layer.msg('请先登录!')
+ setTimeout(function () {
+ self.$router.push('/login')
+ }, 1500)
+ }
+ },
+ getCode: function () {
+ var self = this
+ if (self.signInfo.userPhone) {
+ axios.get('http://192.168.0.111:8080/culturalactivity/app/activityuserapply/saveSmsCoderelease/' + self.signInfo.userPhone).then(function (res) {
+ console.log(res)
+ if (res.status === 200) {
+ self.restTime = 120
+ var timer = setInterval(function () {
+ self.restTime--
+ if (self.restTime === 0) {
+ clearInterval(timer)
+ }
+ }, 1000)
+ }
+ })
+ } else {
+ self.$layer.msg('请先输入手机号')
+ }
}
},
mounted () {
- this.getActivityDetail()
+ if (this.token) {
+ this.getActivityDetailToken()
+ } else {
+ this.getActivityDetail()
+ }
}
}
diff --git a/src/pages/CultureDynamics/CultureDynamics.vue b/src/pages/CultureDynamics/CultureDynamics.vue
index b57d466..438d857 100644
--- a/src/pages/CultureDynamics/CultureDynamics.vue
+++ b/src/pages/CultureDynamics/CultureDynamics.vue
@@ -17,9 +17,9 @@