yunshangxie/pages/index/event_info.vue

181 lines
5.7 KiB
Vue
Raw Normal View History

2024-04-20 14:58:10 +08:00
<template>
<view style="letter-spacing: 1rpx;">
<tn-nav-bar :isBack="false" backTitle="" :bottomShadow="true" backgroundColor="#FFFFFF">
<view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-between">
<view class="tn-flex tn-flex-col-center tn-flex-row-left">
<view style="padding-left: 15rpx;" @click="goBack()">
<text class="tn-icon-left" style="font-size: 40rpx;"></text>
</view>
<view class="tn-margin-top"
style="text-shadow: 1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;">
<tn-tabs :list="[{name:'活动详情'}]" :current="topCurrent" activeColor="#000" :bold="false"
:fontSize="36"></tn-tabs>
</view>
</view>
</view>
</tn-nav-bar>
<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
2024-04-23 11:58:07 +08:00
<image :src="apiImgUrl+info.activity_image" style="width: 100%;" mode="widthFix"></image>
2024-04-20 14:58:10 +08:00
<view style="padding:20rpx 30rpx;">
2024-04-23 11:58:07 +08:00
<view style="font-size: 30rpx;font-weight: 600;">{{info.activity_name}}</view>
2024-04-20 14:58:10 +08:00
<view style="margin-top: 40rpx;">
<view>
<text style="color: #26BB71;"></text>
2024-04-23 11:58:07 +08:00
<text style="margin-left: 10rpx;font-weight: 600;">开始时间</text>
<text style="color: #979797;">{{info.activity_start_time}}</text>
2024-04-20 14:58:10 +08:00
</view>
<view style="margin: 15rpx 0rpx;">
<text style="color: #BE7E28;"></text>
2024-04-23 11:58:07 +08:00
<text style="margin-left: 10rpx;font-weight: 600;">结束时间</text>
2024-05-08 18:14:41 +08:00
<text style="color: #979797;">{{info.activity_end_time}}</text>
2024-04-20 14:58:10 +08:00
</view>
<view>
<text style="color: #DB5022;"></text>
<text style="margin-left: 10rpx;font-weight: 600;">活动地点</text>
2024-04-23 11:58:07 +08:00
<text style="color: #979797;">{{info.activity_location}}</text>
2024-04-20 14:58:10 +08:00
</view>
</view>
<view style="margin-top: 60rpx;font-size: 32rpx;font-weight: 600;">活动介绍</view>
<view>
2024-05-08 18:14:41 +08:00
<view class="ks_html" style="line-height: 50rpx;margin-top: 20rpx;padding-bottom:180rpx">
<div v-html="info.activity_content"></div>
</view>
2024-04-20 14:58:10 +08:00
</view>
</view>
</view>
2024-05-08 18:14:41 +08:00
<view style="position: fixed;bottom: 30rpx; width: 100%;">
<!-- <view class="tn-flex tn-flex-center tn-flex-row-center tn-flex-col-center"-->
<!-- style="background-color: #FDF2EC;text-align: center;padding: 30rpx;">-->
<!-- <view style="font-weight: 600;">-->
<!-- <text style="margin-right: 10rpx;">距报名结束剩<text style="color: #F73909;">119</text></text>-->
<!-- <tn-count-down fontColor="#F73909" backgroundColor="#FDF2EC" :fontSize="30" :timestamp="86400"-->
<!-- :showDays="true" :showHours="true" :showSeconds="true" :showMinutes="true"></tn-count-down>-->
<!-- </view>-->
<!-- </view>-->
<view style="text-align: center;padding:0 30rpx;">
<tn-button @click="application_add" v-if="info.type=='未开始'" backgroundColor="#F73909" height="80rpx"
width="100%" fontColor="#ffffff" shape="round">报名</tn-button>
<tn-button v-if="info.type=='已结束'||info.type=='进行中'" disabled backgroundColor="#E6E6E6" height="80rpx"
width="100%" fontColor="#ffffff" shape="round">报名已结束</tn-button>
2024-04-20 14:58:10 +08:00
</view>
</view>
</view>
</template>
<script>
2024-05-08 18:14:41 +08:00
import {
eventInfo,
applicationAdd
} from '@/util/api.js';
import store from '@/store/index.js'
2024-04-20 14:58:10 +08:00
export default {
data() {
return {
2024-04-23 11:58:07 +08:00
topCurrent: 0,
2024-05-08 18:14:41 +08:00
id: 0,
info: {},
apiImgUrl: this.$store.state.imgUrl
2024-04-20 14:58:10 +08:00
}
},
mounted() {
2024-04-23 11:58:07 +08:00
// this.$wxshare({
// url: 'http://ysh.0rui.cn/#/pages/index/event_info',
// data: {
// url: window.location.href.split("#")[0],
// },
// share_data: {
// title: '河南省青年企业家协会开展走进开封市龙亭区暨产业考察交流活动',
// desc: '河南省青年企业家协会开展走进开封市龙亭区暨产业考察交流活动',
// imgUrl: 'http://ysh.0rui.cn/static/ser.png',
// link: "http://ysh.0rui.cn/#/pages/index/event_info", // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
// }
2024-04-20 14:58:10 +08:00
// })
2024-05-08 18:14:41 +08:00
// var id = this.$route.query.id;
// this.id = id;
// this.getEventInfo();
},
onLoad(d) {
console.log(d);
this.id = d.id;
this.getEventInfo();
2024-04-20 14:58:10 +08:00
},
methods: {
2024-05-08 18:14:41 +08:00
application_add() {
var uid = uni.getStorageSync('uid');
if (!uid) {
uni.showToast({
title: '请登录后报名!',
icon: 'none',
duration: 2000
});
return;
}
applicationAdd({
association_id: store.state.Gid,
member_id: uid,
activity_id: this.id,
application_time: new Date().toISOString().slice(0, 19).replace('T', ' ')
})
.then(res => {
if (res.code == 1) {
uni.showToast({
title: '报名成功!',
icon: 'none',
duration: 2000
});
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
});
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
},
getEventInfo() {
eventInfo({
association_id: store.state.Gid,
id: this.id
})
.then(res => {
console.log(res);
if (res.code == 1) {
var key = res.data;
if (key.activity_content.indexOf("<img") != -1) {
key.activity_content = getApp().addWidthToImages(key.activity_content);
}
this.info = key;
}
})
.catch(error => {
uni.showToast({
title: error,
icon: 'none',
duration: 2000
});
})
2024-04-20 14:58:10 +08:00
},
goBack() {
if (getCurrentPages().length > 1) {
uni.navigateBack()
} else {
uni.redirectTo({
url: '/pages/index/index'
})
}
}
}
}
</script>
<style>
2024-05-08 18:14:41 +08:00
</style>