123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- <template>
- <view>
- <view class="header">
- <image class="header-image" :src="list.main_image"></image>
- </view>
- <view class="main">
- <view class="main-title">活动信息</view>
- <view class="main-card">
- <view class="card-item">
- <view class="item-name">活动标题:</view>
- <view class="item-content" style="color: black;">{{list.title}}</view>
- </view>
- <view class="card-item">
- <view class="item-name">开始时间:</view>
- <view class="item-content">{{list.start_time}}</view>
- </view>
- <view class="card-item">
- <view class="item-name">活动地址:</view>
- <view class="item-content">{{list.address}}</view>
- </view>
- <!-- <view class="card-item">
- <view class="item-name">活动内容:</view>
- <view class="item-content"><u-parse :content="list.content"></u-parse></view>
- </view> -->
- <view class="card-item">
- <view class="item-name">参加人数:</view>
- <view class="item-content">{{list.join_num}}</view>
- </view>
- </view>
- </view>
-
- <view class="actDetail">
- <view class="actDetail-title">活动详情</view>
- <view class="actDetail-content">
- <u-parse :content="list.content"></u-parse>
- </view>
- </view>
- <view class="bottomEmpty"></view>
- <view class="bottomArea">
- <view class="bottomButton" v-if="join_status == false" @tap="submit">立即报名</view>
- <view class="bottomButton-exist" v-if="join_status == true">已报名</view>
- </view>
- </view>
- </template>
- <script>
- var _this;
- export default {
- data() {
- return {
- actId: 0,
- list: {},
- join_status: false,
- userinfo: null,
- }
- },
- onLoad(option) {
- _this = this;
- _this.actId = option.id || 0;
- _this.userinfo = uni.getStorageSync('userinfo') || false;
- _this.getMore();
- },
- methods: {
- pageRefresh: function() {
- _this.getMore();
- },
-
- submit() {
- _this.$req.ajax({
- path: "activity/joinActivity",
- data: {
- id: _this.actId,
- userid: _this.userinfo.id,
- }
- }).then((data) => {
- _this.pageRefresh();
- console.log("加入", data)
- }).catch((err) => {
- uni.showModal({
- title: '信息提示',
- content: err,
- showCancel: false
- });
- });
- },
- getMore() {
- _this.$req.ajax({
- path: "activity/detailActivity",
- data: {
- id: _this.actId,
- userid: _this.userinfo.id,
- }
- }).then((data) => {
- _this.join_status = data.join_status
- _this.list = data.list;
- console.log("详情数据", data)
- }).catch((err) => {
- uni.showModal({
- title: '信息提示',
- content: err,
- showCancel: false
- });
- });
- }
- }
- }
- </script>
- <style lang="scss">
- .header {
- margin: 30rpx 20rpx;
- .header-image {
- width: 100%;
- height: 400rpx;
- border-radius: 20rpx;
- }
- }
- .main {
- margin: 0 20rpx 30rpx;
- .main-title {
- font-size: 35rpx;
- font-weight: bold;
- margin-bottom: 30rpx;
- }
- .main-card {
- padding: 0 20rpx;
- border-radius: 20rpx;
- background-color: #FFFFFF;
- box-shadow: 5rpx 5rpx 10rpx 2rpx rgba(149, 149, 149, 0.3);
- .card-item {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 30rpx 0;
- border-bottom: 1rpx solid #f1f1f1;
- .item-name {
- width: 25%;
- }
- .item-content {
- flex: 1;
- text-align: right;
- color: #999999;
- }
- // .item-content {
- // flex: 1;
- // text-align: right;
- // overflow: hidden;
- // text-overflow: ellipsis;
- // -webkit-line-clamp: 1;
- // display: -webkit-box;
- // -webkit-box-orient: vertical;
- // }
- }
- }
- }
-
- .actDetail {
- margin: 0 20rpx;
- padding: 20rpx 20rpx;
- border-radius: 20rpx;
- background-color: #FFFFFF;
- box-shadow: 5rpx 5rpx 10rpx 2rpx rgba(149, 149, 149, 0.3);
-
- .actDetail-title {
- font-size: 35rpx;
- font-weight: bold;
- margin-bottom: 30rpx;
- }
- }
- .bottomEmpty {
- margin-top: 80rpx;
- height: 130rpx;
- }
- .bottomArea {
- position: fixed;
- bottom: 0;
- z-index: 100;
- width: 100%;
- height: 130rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: #FFFFFF;
- box-shadow: -10rpx -12rpx 12rpx 2rpx rgba(52, 85, 73, 0.16);
- .bottomButton {
- margin: 0 28rpx;
- width: 696rpx;
- height: 90rpx;
- line-height: 90rpx;
- background: #CA151C;
- font-size: 33rpx;
- text-align: center;
- color: #FFFFFF;
- border-radius: 10rpx;
- }
- .bottomButton-exist {
- margin: 0 28rpx;
- width: 696rpx;
- height: 90rpx;
- line-height: 90rpx;
- background: #e8e8e8;
- font-size: 33rpx;
- text-align: center;
- border-radius: 10rpx;
- }
- }
- </style>
|