You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

191 lines
4.6 KiB

4 years ago
<template>
<view>
<view class="">
<view class="activityBox">
<view class="activityBox-top">
4 years ago
<!-- <image src="../../static/img/img_activity.jpg" style="width: 100%;height: 333rpx;"></image> -->
4 years ago
<swiper autoplay="true" :interval="4000" :duration="1000" :indicator-dots="true"
indicator-active-color="rgba(255, 255, 255, 0.7)" indicator-color="rgba(239, 149, 37, 1)" :current="topSwiperIndex" @change="topSwiperTab">
<swiper-item v-for="(item,index) in list.banners" :key="index">
<view class="swiper-item">
<image :src="item.upload.url" mode="aspectFill"></image>
</view>
</swiper-item>
4 years ago
</swiper>
4 years ago
</view>
<view class="activityBox-content flex-col">
<view class="activityBox-row flex-row justify-between">
4 years ago
<text class="activityBox-title">{{isUnde(list.name)}}</text>
4 years ago
<view class="tag tag_green">
4 years ago
<text>{{isUnde(list.target_name)}}</text>
4 years ago
</view>
</view>
<view class="activityBox-row">
<text class="icon-shijian iconfont"></text>
4 years ago
<text>活动时间{{isUnde(list.start_time)}}-{{isUnde(list.end_time)}}</text>
4 years ago
</view>
<view class="activityBox-row">
<text class="icon-huodongfangshi iconfont"></text>
4 years ago
<text>活动方式{{isUnde(list.area_name)}}</text>
4 years ago
</view>
<view class="activityBox-row">
<text class="icon-huodong iconfont"></text>
4 years ago
<text>活动地址{{isUnde(list.address)}}</text>
4 years ago
</view>
<view class="activityBox-row">
<text class="icon-renshu iconfont"></text>
4 years ago
<text>人数限制{{isUnde(list.total)==0?'不限':isUnde(list.total)}}</text>
4 years ago
</view>
4 years ago
<view class="activityBox-row flex-row align-center">
4 years ago
<text class="icon-ditu-dibiao iconfont"></text>
4 years ago
<text>距离{{isUnde(list.distance)}}km</text>
4 years ago
<view class="tomap">
<text class="icon-daohang1 iconfont" style="margin-right: 0;"></text>
</view>
4 years ago
</view>
4 years ago
</view>
</view>
<view class="infoBox">
<view class="infoBox-title">
<text class="infoBox-titletxt">活动详情</text>
</view>
<view class="infoBox-content">
4 years ago
<rich-text :nodes="list.content"></rich-text>
4 years ago
</view>
</view>
4 years ago
<view class="infofooter flex-row" v-if="list.status!=0">
4 years ago
<view style="margin-right: 14rpx;flex: 1;">
<u-button type="primary" @click="tobook('team')"></u-button>
</view>
<view style="margin-left: 14rpx;flex: 1;">
<u-button type="primary" @click="tobook('user')"></u-button>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
4 years ago
id:"",
latitude:"",
longitude:"",
list:{},
4 years ago
topSwiperIndex: 0,
4 years ago
}
4 years ago
},
onLoad(options){
4 years ago
var that = this;
that.id=options.id;
wx.getLocation({
success(res) {
console.log(res)
that.latitude=res.latitude;
that.longitude=res.longitude;
that.loadActiveInfo()
}
})
4 years ago
},
methods: {
4 years ago
tobook(type) {
4 years ago
4 years ago
uni.navigateTo({
4 years ago
url: "book?type=" + type + "&activity_id="+this.id
4 years ago
})
4 years ago
},
loadActiveInfo(){
var that = this;
this.util.request({
api: '/api/mobile/activity/show',
data:{
id:that.id,
latitude:that.latitude,
longitude:that.longitude
},
utilSuccess: function(res) {
that.list = res;
4 years ago
that.list.end_time = res.end_time.substring(11,res.end_time.length)
4 years ago
wx.setStorage({
key: 'activityinfo',
data: res,
success: ()=> {
console.log('存储成功');
}
})
},
utilFail: function(res) {
}
})
},
topSwiperTab(e) {
4 years ago
var that = this;
this.topSwiperIndex = Number(e.target.current);
},
isUnde(val){
if(val){
return val
}else{
return ""
}
}
4 years ago
}
}
</script>
<style>
@import url("@/static/css/activitybox.css");
page {
background-color: #f7f6f4;
}
.infoBox {
box-sizing: border-box;
padding: 40rpx 0rpx;
background: #FFFFFF;
}
.infoBox-title {
border-left: 3px solid #EF9525;
}
.infoBox-titletxt {
font-size: 26rpx;
color: #4E4E4E;
margin-left: 21rpx;
}
.infoBox-content {
padding: 37rpx 26rpx;
box-sizing: border-box;
font-size: 24rpx;
color: #828282;
}
.infofooter {
position: fixed;
width: 100%;
left: 0;
bottom: 0;
background: #FFFFFF;
box-shadow: 2px 3px 10px 0px rgba(107, 94, 77, 0.3);
padding: 22rpx 25rpx;
box-sizing: border-box;
4 years ago
}
swiper{
height:333rpx
}
swiper image{
width:100%;
height:333rpx;
4 years ago
}
4 years ago
</style>