123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- <template>
- <view>
- <u-navbar :title="navbarTitle"></u-navbar>
- <!-- <view class="img">
- <img src="../../static/img/activity.png" alt="">
- </view> -->
- <view class="details">
- <view class="article-con" v-html="detail.introduction" >
-
- </view>
- <!-- <view class="detail-item">
- <view class="title">
- 活动名称:
- </view>
- <view class="content" v-text="detail.title">
- </view>
- </view>
- <view class="detail-item">
- <view class="title">
- 活动地址:
- </view>
- <view class="content">
- {{detail.address}}
- </view>
- </view>
- <view class="detail-item">
- <view class="title">
- 报名时间:
- </view>
- <view class="content">
- {{detail.endTime}}截止
- </view>
- </view>
- <view class="detail-item">
- <view class="title">
- 活动时间:
- </view>
- <view class="content">
- {{detail.activityStartTime}}~{{detail.activityEndTime}}
- </view>
- </view>
- <view class="detail-item">
- <view class="title">
- 活动介绍:
- </view>
- <view class="content" v-html="detail.introduction">
- </view>
- </view>
- <view class="detail-item">
- <view class="title">
- 特别说明:
- </view>
- <view class="content">
- {{detail.remark}}
- </view>
- </view> -->
- </view>
-
- <u-modal v-model="show" :show-title="false" :content="content"
- :content-style="{color: '#101010',fontSize: '16px'}" @confirm="confirm" confirm-color="#FF7C70"
- :show-cancel-button="true" @cancel="cancel" ref="uModal" :async-close="true"></u-modal>
- <view class="bottom" v-if="detail.isShow">
- <u-button v-if="!detail.isJoin && !endShow" @click="signUp">立即报名</u-button>
- <u-button v-if="detail.isJoin" style="background-color: #CCCCCC;color: #fff;" disabled>已报名</u-button>
- <u-button v-if="endShow" style="background-color: #CCCCCC;color: #fff;" disabled>
- {{startShow ? '报名未开始' : '报名已结束'}}</u-button>
- </view>
- </view>
- </template>
- <script>
- import * as API from '@/apis/news.js'
-
- export default {
- data() {
- return {
- navbarTitle: '',
- id: '',
- detail: {},
- userId: '',
- show: false,
- content: '您已报名成功!',
- endShow: false,
- startShow: false,
- }
- },
- onLoad(op) {
- if(op.id) {
- this.id = op.id;
- this.getActivityDetail();
- }
- },
- onShow() {
- if(this.carhelp.getPersonInfo()) {
- this.userId = this.carhelp.getPersonInfo().id;
- }
- },
- methods: {
- getActivityDetail() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API.activityDetail({id:this.id}).then(response => {
- uni.hideLoading();
-
- this.detail = response.data;
- this.navbarTitle = this.detail.title;
-
- var date = new Date();
- var oDate1 = new Date(this.detail.startTime);
- var oDate2 = new Date(this.detail.endTime);
- if(date.getTime() > oDate1.getTime() && date.getTime() < oDate2.getTime()){
- this.endShow = false;
- } else {
- this.endShow = true;
- if(date.getTime() < oDate1.getTime()) {
- this.startShow = true;
- }
- }
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- signUp() {
- if(this.userId) {
- this.show = true;
- } else {
- uni.navigateTo({
- url:'../../pagesA/pages/login/index'
- })
- }
- },
- cancel() {
- this.show = false;
- },
- confirm() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API.activitySave({id:this.id}).then(response => {
- uni.hideLoading();
-
- this.getActivityDetail();
- this.show = false;
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .slot-wrap {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- flex: 1;
- position: absolute;
- left: 0;
- right: 0;
- height: 30px;
- text-align: center;
- flex-shrink: 0;
-
- .slot-title {
- color: rgb(96, 98, 102);
- font-size: 17px;
- left: 125px;
- right: 125px;
- width: 80%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- }
-
- .article-con{
- padding: 15px 0 35px;
- font-size: 14px;
- line-height: 28px;
- img{
- width: 100%;
- margin: 10px 0;
- }
- }
-
- /deep/.u-line-1 {
- overflow: inherit;
- }
- .img {
- margin: 32rpx;
- height: 404rpx;
- img {
- width: 100%;
- height: 100%;
- }
- }
- .details {
- margin: 32rpx;
- font-size: 16px;
- color: #333333;
- padding-bottom: 70px;
- .detail-item {
- display: flex;
- margin-bottom: 24rpx;
- .title {
- // width: 26%;
- }
- .content {
- flex: 1;
- margin-left: 24rpx;
- }
- }
- }
- .bottom {
- width: 100%;
- height: 56px;
- position: fixed;
- bottom: 0;
- background-color: #fff;
- display: flex;
- }
-
- .u-btn {
- width: 74.4%;
- line-height: 44px;
- border-radius: 50px;
- background-color: #FF5E5E;
- font-size: 16px;
- color: #ffffff;
- position: fixed;
- bottom: 8px;
- left: 0;
- right: 0;
- }
- /deep/.u-hairline-border:after {
- border: none;
- }
- </style>
|