sakura 1 year ago
parent
commit
438155e6de
2 changed files with 65 additions and 4 deletions
  1. 13 2
      pages/theater/index/index.scss
  2. 52 2
      pages/theater/index/index.vue

+ 13 - 2
pages/theater/index/index.scss

@@ -16,13 +16,24 @@
 		display: flex;
 		flex-direction: column;
 		margin-top: 50px;
-		
+		.swiper-item{
+				margin-top: 70px;
+				opacity: 0.7;
+				border-radius: 10px;
+				width:95%;
+				margin: 50px auto 20px;
+				overflow: hidden;
+			}
+			.swiper-img{
+				width: 100%;
+				
+			}
 		.section1{
 			display: flex; 
 			width:100%;
 			flex-direction: column;
 			justify-content: space-between;
-			margin-top:50px;
+			// margin-top:50px;
 			font-size:12px;
 			.caption{
 				color:#FFF;

+ 52 - 2
pages/theater/index/index.vue

@@ -4,6 +4,28 @@
 		<uni-nav-bar :fixed="true" height="180rpx" title="社区中心" color="#FFF"  left-icon="home" backgroundColor="rgb(0,0,0,0)"  :border="false" @clickLeft="onHome"/>
 		
 		<view class="community-top">
+			 <view class="swiper-item">
+			        <swiper
+			          indicator-dots="true"
+			          autoplay="true"
+			          interval="2000"
+			          duration="500"
+			        >
+			          <swiper-item
+			            v-for="(item, index) in bannerList"
+			            :key="index"
+			            style="width: 100%"
+			          >
+			            <view class="swiper-img" style="width: 100%">
+			              <image
+			                :src="item.imageUrl"
+			                style="width: 100%; height: 150px"
+			                @click="goInfo(item)"
+			              ></image>
+			            </view>
+			          </swiper-item>
+			        </swiper>
+			      </view>
 			 <view class="section1">
 				 <view class="caption">
 					 <view class="left">正在上演</view>
@@ -97,6 +119,7 @@
 		},
 		data() {
 			return {
+				bannerList: [],
 				topList:[],//顶部剧场活动列表  
 				PerformerList:[],//获取主持人信息列表 
 				queryForm:{
@@ -193,6 +216,7 @@
 			} 
 		},
 		onShow(){ 
+			this.initBanner();
 			this.onSearchTop(); 
 			this.onSearchPerformer();
 			
@@ -203,7 +227,13 @@
 			_this.onSearch();
 		},
 		methods:{
-			
+			//活动详情页
+			    goInfo(item) {
+			      console.log(item.other_link);
+			      uni.navigateTo({
+			        url: item.other_link,
+			      });
+			    },
 			initSearchArea(){
 				let _this=this;
 				_this.$http.request('zc/searcharea',{}, "", "", hideLoading).then(res => { 
@@ -304,7 +334,27 @@
 					_this.PerformerList=res.data.dataList;  
 				}).catch(err => {})
 			},
-		 
+			//轮播图
+			    initBanner() {
+			      let _this = this;
+			      this.$http
+			        .request(
+			          "banner/search",
+			          {
+			            page: 1,
+			            pageSize: 10,
+			            type: 3,
+			          },
+			          "",
+			          "",
+			          hideLoading
+			        )
+			        .then((res) => {
+			          console.log("112", res);
+			          _this.bannerList = res.data.dataList;
+			        })
+			        .catch((err) => {});
+			    },