DaMowang 2 年之前
父节点
当前提交
bcb8344ed1
共有 4 个文件被更改,包括 695 次插入690 次删除
  1. 1 1
      src/pages/orderingfood/tabs.js
  2. 375 372
      src/pagesB/cinema/choiceMovie.vue
  3. 12 3
      src/pagesB/cinema/cinemaList.vue
  4. 307 314
      src/pagesB/components/u-swiper.vue

+ 1 - 1
src/pages/orderingfood/tabs.js

@@ -11,7 +11,7 @@ export default [
   },
   {
       ico: "http://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/head_pic/e3d3719e646469f2615abce1ef61753ea7de0b19png",
-    //   url: "/pagesB/cinema/cinemaList",
+      url: "/pagesB/cinema/cinemaList",
       tit: "影院"
   },
   {

+ 375 - 372
src/pagesB/cinema/choiceMovie.vue

@@ -1,382 +1,385 @@
 <template>
-	<view>
-		<view class="movie-position">
-			<view class="position-text">{{cinemaInfo.cinemaName}}</view>
-			<view class="position-item">
-				<view class="item-texts">{{cinemaInfo.cinemaAddress}}</view>
-				<view class="item-img-list">
-					<span @click="openm" class="iconfont">&#xe634;</span>
-				</view>
-			</view>
-		</view>
-		<!-- 轮播盒子 start -->
-		<view class="swiper_main">
-			<image class="background-img-vague" :src="chooseMovice.posterUrl" mode=""></image>
-			<view class="wrap">
-				<swipers :list="movieList" height="260" mode="none" name="posterUrl" :autoplay="false" img-mode="scaleToFill" class="swiper_bg"
-				 :effect3d="true" bg-color="none" :circular="false" effect3d-previous-margin="280" @change="setBackground" @click="setBackground" :current="swiperCurrent"></swipers>
-			</view>
-			<div class="box"></div>
-		</view>
-		<!-- 轮播盒子 end -->
-		
-		<view class="moive-name">{{chooseMovice.movieName}}</view>
-		<view class="moive-info">{{chooseMovice.duration}}分钟{{chooseMovice.movieType}}{{chooseMovice.cast}}</view>
-		
-		<view class="moive-tab-list">
-			<view class="tabs-list-item" :class="{'tab-sel':index==tabIndexs}" v-for="(value,index) in tabLists" :key="index" @click="getTimeTab(value,index)">
-				{{value.time}}
-				<view class="bottoms" v-if="index==tabIndexs"></view>
-			</view>
-		</view>
-		
-		<view class="ticket-list" v-for="(value,index) in timeList" :key="index">
-			<view style="width: 79%;">
-				<view class="ticet-left">
-					<view style="display: flex;align-items: center;">
-						<text class="left-time">{{getTime(value.stopSellTime)}}</text>
-						<text class="left-type">{{value.showVersionType}}</text>
-					</view>
-					<view style="display: flex;align-items: center;">
-						<view class="ret-price"><text>¥</text>{{value.userPrice}}</view>
-						<view class="ret-yuans">¥{{value.showPrice}}</view>
-					</view>
-				</view>
-				<view class="ticet-left" style="margin-top: 20rpx;">
-					<view class="ticet-booms">
-						<text>时长:{{value.duration}}分钟</text>
-						<text style="margin-left: 25rpx;">{{value.hallName}}</text>
-					</view>
-					<view class="ticet-boom-ret">
-						<view class="sheng-text">省</view>
-						<view class="sheng-pirce">¥{{province(value.showPrice,value.userPrice)}}</view>
-					</view>
-				</view>
-			</view>
-			<view class="buy-btns" @click="getGou(value)">购票</view>
-		</view>
-		
-		<view v-if="isLoad&&timeList.length==0" style="text-align: center;padding-top: 30rpx;font-size: 28rpx;">暂无排片!</view>
-		
-		
-	</view>
+    <view>
+        <view class="movie-position">
+            <view class="position-text">{{cinemaInfo.restaurant_name}}</view>
+            <view class="position-item">
+                <view class="item-texts">{{cinemaInfo.restaurant_address}}</view>
+                <view class="item-img-list">
+                    <span @click="openm" class="iconfont">&#xe634;</span>
+                </view>
+            </view>
+        </view>
+        <!-- 轮播盒子 start -->
+        <view class="swiper_main">
+            <image class="background-img-vague" :src="chooseMovice.posterUrl" mode=""></image>
+            <view class="wrap">
+                <swipers :list="movieList" height="260" mode="none" name="posterUrl" :autoplay="false" img-mode="scaleToFill" class="swiper_bg" :effect3d="true" bg-color="none" :circular="false" effect3d-previous-margin="280" @change="setBackground" @click="setBackground" :current="swiperCurrent"></swipers>
+            </view>
+            <div class="box"></div>
+        </view>
+        <!-- 轮播盒子 end -->
+        <view class="moive-name">{{chooseMovice.movieName}}</view>
+        <view class="moive-info">{{chooseMovice.duration}}分钟{{chooseMovice.movieType}}{{chooseMovice.cast}}</view>
+        <view class="moive-tab-list">
+            <view class="tabs-list-item" :class="{'tab-sel':index==tabIndexs}" v-for="(value,index) in tabLists" :key="index" @click="getTimeTab(value,index)">
+                {{value.time}}
+                <view class="bottoms" v-if="index==tabIndexs"></view>
+            </view>
+        </view>
+        <view class="ticket-list" v-for="(value,index) in timeList" :key="index">
+            <view style="width: 79%;">
+                <view class="ticet-left">
+                    <view style="display: flex;align-items: center;">
+                        <text class="left-time">{{value.stopSellTime}}</text>
+                        <text class="left-type">{{value.showVersionType}}</text>
+                    </view>
+                    <view style="display: flex;align-items: center;">
+                        <view class="ret-price"><text>¥</text>{{value.userPrice}}</view>
+                        <view class="ret-yuans">¥{{value.showPrice}}</view>
+                    </view>
+                </view>
+                <view class="ticet-left" style="margin-top: 20rpx;">
+                    <view class="ticet-booms">
+                        <text>时长:{{value.duration}}分钟</text>
+                        <text style="margin-left: 25rpx;">{{value.hallName}}</text>
+                    </view>
+                    <view class="ticet-boom-ret">
+                        <view class="sheng-text">省</view>
+                        <view class="sheng-pirce">¥{{province(value.showPrice,value.userPrice)}}</view>
+                    </view>
+                </view>
+            </view>
+            <view class="buy-btns" @click="getGou(value)">购票</view>
+        </view>
+        <view v-if="isLoad&&timeList.length==0" style="text-align: center;padding-top: 30rpx;font-size: 28rpx;">暂无排片!</view>
+    </view>
 </template>
-
 <script>
-	import swipers from '@/pagesB/components/u-swiper.vue'
-	// import {filmList,filmScheduling} from "@/api/film.js"
-	// import config from "@/utils/config.js"
-	export default {
-		components:{swipers},
-		data() {
-			return {
-				movieList: [
-					{
-						movieId:12343,
-						duration:149,
-						movieType:'剧情|历史|战争',
-						cast:'吴京 易烊千玺 段奕宏 张涵予 朱亚文',
-						movieName:'长津湖之水门桥',
-						posterUrl: "https://gw.alicdn.com/i1/O1CN01sSmj2b1daSm6IAUcs_!!6000000003752-0-alipicbeacon.jpg_480x480Q30s150.jpg"
-					},
-					{
-						cast: "易烊千玺 田雨 陈哈琳 齐溪 公磊 许君聪 王宁 黄尧 巩金国",
-						duration: 106,
-						movieId: 147885,
-						movieName: "奇迹·笨小孩",
-						movieType: "剧情",
-						posterUrl: "https://gw.alicdn.com/i1/O1CN013Ggc2s1Z8HwrwxAfn_!!6000000003149-0-alipicbeacon.jpg_480x480Q30s150.jpg"
+import swipers from '@/pagesB/components/u-swiper.vue'
+import { post } from "@/request/api.js";
+export default {
+    components: { swipers },
+    data() {
+        return {
+            movieList: [],	//选中的电影
+            chooseMovice: {},	//swiper默认选中
+            swiperCurrent: 0,
+
+            tabIndexs: 0,
+            cinemaInfo: {}, //影院信息
+            tabLists: {},
+            timeList: [], //排期数据
+            isLoad: false
+        }
+    },
+    onLoad(da) {
+        this.cinemaInfo = uni.getStorageSync("cinemaItem");
+		this.getlists(da)
+    },
+    methods: {
+		// 获取场次
+        getlists(da) {
+            post("local/getPreferential", da).then(res => {
+                if (res.code == 0) {
+                    let da = res.data.data
+					let arr = [], obj = {};
+					for (let it of da.showInfor) {
+						if(!arr.includes(it.movieId)) {
+							arr.push(it.movieId)
+							obj[it.movieId] = [];
+						}
+						obj[it.movieId].push(it);
 					}
-					
-				],
-				//选中的电影
-				chooseMovice: {
-					movieId:'',
-					duration:149,
-					movieType:'剧情|历史|战争',
-					cast:'吴京 易烊千玺 段奕宏 张涵予 朱亚文'
-				}, 
-				//swiper默认选中
-				swiperCurrent: 0,
-				
-				tabIndexs:0,
-				cinemaInfo:{},//影院信息
-				tabLists:[
-					{
-						time: "05-14",
-						list:[
-							{
-								duration: 149,
-								hallName: "2号厅-口罩自备",
-								movieId: 146629,
-								showId: "MjUyNDkjQGltYW5tQCMxNDY2MjkjQGltYW5tQCMxNjUyNTI4NDAwI0BpbWFubUAjMTA5I0BpbWFubUAjNDk=",
-								showPrice: 25.9,
-								showTime: "2022-05-14 19:40:00",
-								showVersionType: "国语 2D",
-								stopSellTime: "2022-05-14 18:25:00",
-								userPrice: 22.5,
-							},
-							{
-								duration: 149,
-								hallName: "7号厅-口罩自备",
-								movieId: 146629,
-								showId: "MjUyNDkjQGltYW5tQCMxNDY2MjkjQGltYW5tQCMxNjUyNTIzMDAwI0BpbWFubUAjMTA5I0BpbWFubUAjNDk=",
-								showPrice: 24.9,
-								showTime: "2022-05-14 18:10:00",
-								showVersionType: "国语 2D",
-								stopSellTime: "2022-05-14 16:55:00",
-								userPrice: 21.7,
+					for (let i in obj) {
+						let ar = [], ob = {};
+						for (let b of obj[i]) {
+							let tim = b.showTime.slice(5,10)
+							if(!ar.includes(tim)) {
+								ar.push(tim)
+								ob[tim] = [];
 							}
-						]
+							ob[tim].push(b);
+						}
+						let ar2 = []
+						for (let c in ob) {
+							ar2.push({
+								time: c, list: ob[c]
+							})
+						}
+						obj[i] = ar2
 					}
-				],
-				timeList:[],//排期数据
-				isLoad:false
-			}
-		},
-		onLoad(option) {
-			// this.swiperCurrent = 0
-			// this.chooseMovice.movieId = option.movieId
-			this.chooseMovice = this.movieList[0]
-			this.timeList = this.tabLists[0].list
-			this.cinemaInfo =JSON.parse(decodeURIComponent(option.item));
-			
-			// console.log(this.timeList)
-		},
-		methods: {
-			
-			// 切换轮播改变背景
-			setBackground(index) {
-				console.log(index)
-				this.swiperCurrent = index
-				this.chooseMovice = this.movieList[index]
-				// this.getScheduling()
-			},
-			// getTimeTab(data,index){
-			// 	if(this.tabIndexs!=index){
-			// 		this.tabIndexs=index
-			// 		this.timeList = data.list
-			// 	}
-			// },
-			getTime(time){
-				// return config.turnTime(time,0)
-				return time
-			},
-			getGou(data){
-				// console.log(data)
-				let _this = this
-				uni.navigateTo({
-					url:'/pages/movie/Seat?item='+encodeURIComponent(JSON.stringify(data))+'&cinemaId='+this.cinemaInfo.cinemaId,
-					success(res) {
-						 res.eventChannel.emit('moviceDataFrom', { data: _this.chooseMovice})
+					console.log(obj);
+                    let movies = uni.getStorageSync("movies")
+					let MS = []
+					for (let m of movies) {
+						if(arr.includes(m.movieId)) MS.push(m)
 					}
-				})
-			},
-			province(original,price){
-				let val = original-price
-				return Math.floor(val * 100) / 100
-			},
-		}
-	}
-</script>
+					this.movieList = MS
+        			this.chooseMovice = this.movieList[0]
+					this.tabLists = obj[this.chooseMovice.movieId];
+                }
+            })
+        },
+        openm(){
+            let latitude = parseFloat(this.cinemaInfo.latitude);
+            let longitude = parseFloat(this.cinemaInfo.longitude);
+            let name = this.cinemaInfo.restaurant_name;
+            let address = this.cinemaInfo.restaurant_address;
+            uni.openLocation({
+                latitude, longitude, scale: 5, name, address,
+                success: function () {
+                    console.log('success');
+                }
+            });
+        },
 
+        // 切换轮播改变背景
+        setBackground(index) {
+            this.swiperCurrent = index
+            this.chooseMovice = this.movieList[index]
+        },
+        getTimeTab(data,index){
+        	if(this.tabIndexs!=index){
+        		this.tabIndexs=index
+        		this.timeList = data.list
+        	}
+        },
+        getGou(data) {
+            let _this = this
+            uni.navigateTo({
+                url: '/pages/movie/Seat?item=' + encodeURIComponent(JSON.stringify(data)) + '&cinemaId=' + this.cinemaInfo.cinemaId,
+                success(res) {
+                    res.eventChannel.emit('moviceDataFrom', { data: _this.chooseMovice })
+                }
+            })
+        },
+        province(original, price) {
+            let val = original - price
+            return Math.floor(val * 100) / 100
+        },
+    }
+}
+</script>
 <style lang="scss">
 // 轮播图中间
-		.swiper_main {
-			position: relative;
-			height: 324rpx;
-			overflow: hidden;
-
-			.background-img-vague {
-				position: absolute;
-				left: 0;
-				right: 0;
-				width: 100%;
-				// transform: translateX(-50%);
-				filter: blur(15px);
-				-webkit-filter: blur(15px);
-			}
-
-			::v-deep.u-swiper-item {
-				width: 193rpx !important;
-				height: 260rpx !important;
-			}
-
-			// 影院背景图
-			.moviebg {
-				width: 100%;
-				height: 100%;
-				filter: blur(10rpx);
-			}
-
-			.wrap {
-				position: absolute;
-				left: 0;
-				top: 26rpx;
-				right: 0;
-				margin: 0 auto;
-			}
-
-			.box {
-				width: 0;
-				height: 0;
-				border: 10rpx solid;
-				border-color: transparent transparent #fff #fff;
-				transform: rotate(135deg);
-				position: absolute;
-				bottom: -10rpx;
-				left: 0;
-				right: 0;
-				margin: 0 auto;
-			}
-
-		}
-		.movie-position{
-			padding: 30rpx 32rpx;
-			.position-text{
-				color: #2D3039;
-				font-size: 32rpx;
-				font-weight: 550;
-			}
-			.position-item{
-				display: flex;
-				margin-top: 10rpx;
-			}
-			.item-texts{
-				color: #636775;
-				font-size: 24rpx;
-				width: 72%;
-			}
-			.item-img-list{
-				margin-left: auto;
-				display: flex;
-				// align-items: center;
-				.collion{
-					width: 48rpx;
-					height: 48rpx;
-					margin-right: 50rpx;
-				}
-				.locaion-img{
-					width: 44rpx;
-					height: 44rpx;
-				}
-			}
-		}
-		.moive-name{
-			text-align: center;
-			margin-top: 30rpx;
-			color: #2D3039;
-			font-size: 36rpx;
-			font-weight: 600;
-		}
-		.moive-info{
-			text-align: center;
-			margin-top: 14rpx;
-			color: #636775;
-			font-size: 24rpx;
-		}
-		
-		.moive-tab-list{
-			margin-top: 40rpx;
-			padding: 24rpx 12rpx;
-			border-bottom: 2rpx solid #DFE0E2;
-			overflow-x: auto;
-			white-space:nowrap;
-			width: auto;
-			overflow-y: hidden;
-			.tabs-list-item{
-				padding: 0rpx 20rpx;
-				display: inline-block;
-				position: relative;
-				color: #636775;
-				font-size: 28rpx;
-			}
-			.tab-sel{
-				color: #FE602B!important;
-				font-size: 28rpx;
-				font-weight: 550;
-			}
-			.bottoms{
-				position: absolute;
-				bottom: -30rpx;
-				right:50%;
-				left:50%;
-				transform: translate(-50%, -50%);
-				width: 52rpx;
-				height: 8rpx;
-				background-color: #FE602B;
-				// border-radius: 5rpx 5rpx 0px 0px;
-			}
-		}
-		
-		.ticket-list{
-			margin: 0rpx 32rpx;
-			padding: 38rpx 0rpx;
-			border-bottom: 2rpx solid #E0E1E3;
-			display: flex;
-			align-items: center;
-			.ticet-left{
-				display: flex;
-				align-items: center;
-				justify-content: space-between;
-				.left-time{
-					color: #2D3039;
-					font-size: 42rpx;
-				}
-				.left-type{
-					color: #2D3039;
-					font-size: 28rpx;
-					margin-left: 32rpx;
-				}
-			}
-			.ret-price{
-				color: #FE602B;
-				font-size: 42rpx;
-				font-weight: 550;
-				text{
-					font-size: 28rpx;
-				}
-			}
-			.ret-yuans{
-				color: #A6A8AE;
-				font-size: 28rpx;
-				margin-left: 13rpx;
-				text-decoration: line-through;
-			}
-		}
-		.ticet-booms{
-			color: #A6A8AE;
-			font-size: 24rpx;
-		}
-		.ticet-boom-ret{
-			display: flex;
-			align-items: center;
-			.sheng-text{
-				padding: 0rpx 8rpx;
-				height: 30rpx;
-				line-height: 30rpx;
-				background-color: #3DB97C;
-				border-radius: 4rpx;
-				color: #FFFFFF;
-				font-size: 20rpx;
-				text-align: center;
-				margin-right: 12rpx;
-			}
-			.sheng-pirce{
-				color: #A6A8AE;
-				font-size: 24rpx;
-			}
-		}
-		.buy-btns{
-			width: 110rpx;
-			height: 58rpx;
-			text-align: center;
-			line-height: 58rpx;
-			background: linear-gradient(207deg, #FF9272 0%, #FC5421 100%);
-			border-radius: 30rpx;
-			color: #FFFFFF;
-			font-size: 24rpx;
-			font-weight: 550;
-			margin-left: auto;
-		}
-</style>
+.swiper_main {
+    position: relative;
+    height: 324rpx;
+    overflow: hidden;
+
+    .background-img-vague {
+        position: absolute;
+        left: 0;
+        right: 0;
+        width: 100%;
+        // transform: translateX(-50%);
+        filter: blur(15px);
+        -webkit-filter: blur(15px);
+    }
+
+    ::v-deep.u-swiper-item {
+        width: 193rpx !important;
+        height: 260rpx !important;
+    }
+
+    // 影院背景图
+    .moviebg {
+        width: 100%;
+        height: 100%;
+        filter: blur(10rpx);
+    }
+
+    .wrap {
+        position: absolute;
+        left: 0;
+        top: 26rpx;
+        right: 0;
+        margin: 0 auto;
+    }
+
+    .box {
+        width: 0;
+        height: 0;
+        border: 10rpx solid;
+        border-color: transparent transparent #fff #fff;
+        transform: rotate(135deg);
+        position: absolute;
+        bottom: -10rpx;
+        left: 0;
+        right: 0;
+        margin: 0 auto;
+    }
+
+}
+
+.movie-position {
+    padding: 30rpx 32rpx;
+
+    .position-text {
+        color: #2D3039;
+        font-size: 32rpx;
+        font-weight: 550;
+    }
+
+    .position-item {
+        display: flex;
+        margin-top: 10rpx;
+    }
+
+    .item-texts {
+        color: #636775;
+        font-size: 24rpx;
+        width: 72%;
+    }
+
+    .item-img-list {
+        margin-left: auto;
+        display: flex;
+
+        // align-items: center;
+        .collion {
+            width: 48rpx;
+            height: 48rpx;
+            margin-right: 50rpx;
+        }
+
+        .locaion-img {
+            width: 44rpx;
+            height: 44rpx;
+        }
+    }
+}
+
+.moive-name {
+    text-align: center;
+    margin-top: 30rpx;
+    color: #2D3039;
+    font-size: 36rpx;
+    font-weight: 600;
+}
+
+.moive-info {
+    text-align: center;
+    margin-top: 14rpx;
+    color: #636775;
+    font-size: 24rpx;
+}
+
+.moive-tab-list {
+    margin-top: 40rpx;
+    padding: 24rpx 12rpx;
+    border-bottom: 2rpx solid #DFE0E2;
+    overflow-x: auto;
+    white-space: nowrap;
+    width: auto;
+    overflow-y: hidden;
+
+    .tabs-list-item {
+        padding: 0rpx 20rpx;
+        display: inline-block;
+        position: relative;
+        color: #636775;
+        font-size: 28rpx;
+    }
+
+    .tab-sel {
+        color: #FE602B !important;
+        font-size: 28rpx;
+        font-weight: 550;
+    }
+
+    .bottoms {
+        position: absolute;
+        bottom: -30rpx;
+        right: 50%;
+        left: 50%;
+        transform: translate(-50%, -50%);
+        width: 52rpx;
+        height: 8rpx;
+        background-color: #FE602B;
+        // border-radius: 5rpx 5rpx 0px 0px;
+    }
+}
+
+.ticket-list {
+    margin: 0rpx 32rpx;
+    padding: 38rpx 0rpx;
+    border-bottom: 2rpx solid #E0E1E3;
+    display: flex;
+    align-items: center;
+
+    .ticet-left {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+
+        .left-time {
+            color: #2D3039;
+            font-size: 42rpx;
+        }
+
+        .left-type {
+            color: #2D3039;
+            font-size: 28rpx;
+            margin-left: 32rpx;
+        }
+    }
+
+    .ret-price {
+        color: #FE602B;
+        font-size: 42rpx;
+        font-weight: 550;
+
+        text {
+            font-size: 28rpx;
+        }
+    }
+
+    .ret-yuans {
+        color: #A6A8AE;
+        font-size: 28rpx;
+        margin-left: 13rpx;
+        text-decoration: line-through;
+    }
+}
+
+.ticet-booms {
+    color: #A6A8AE;
+    font-size: 24rpx;
+}
+
+.ticet-boom-ret {
+    display: flex;
+    align-items: center;
+
+    .sheng-text {
+        padding: 0rpx 8rpx;
+        height: 30rpx;
+        line-height: 30rpx;
+        background-color: #3DB97C;
+        border-radius: 4rpx;
+        color: #FFFFFF;
+        font-size: 20rpx;
+        text-align: center;
+        margin-right: 12rpx;
+    }
+
+    .sheng-pirce {
+        color: #A6A8AE;
+        font-size: 24rpx;
+    }
+}
+
+.buy-btns {
+    width: 110rpx;
+    height: 58rpx;
+    text-align: center;
+    line-height: 58rpx;
+    background: linear-gradient(207deg, #FF9272 0%, #FC5421 100%);
+    border-radius: 30rpx;
+    color: #FFFFFF;
+    font-size: 24rpx;
+    font-weight: 550;
+    margin-left: auto;
+}
+</style>

+ 12 - 3
src/pagesB/cinema/cinemaList.vue

@@ -48,10 +48,18 @@ export default {
             })
         },
         goCinema(da) {
-            uni.setStorageSync("MerchantItem", da)
+            uni.setStorageSync("cinemaItem", da)
             this.goto("/pagesB/cinema/choiceMovie", {
-                brand_id: da.brand_id,
-                restaurant_id: da.restaurant_id
+                cinema_id: da.restaurant_id
+            })
+        },
+        // 获取影片列表
+        getFilm() {
+            post("local/getFilm", this.Query).then(res => {
+                if (res.code == 0) {
+                    let movies = res.data
+                    uni.setStorageSync("movies", movies)
+                }
             })
         },
     },
@@ -59,6 +67,7 @@ export default {
         let adres = uni.getStorageSync("adres")
         this.Query = { ...this.Query, ...adres }
         this.getlists();
+        this.getFilm();
     },
     onShow() {},
     mounted() {},

+ 307 - 314
src/pagesB/components/u-swiper.vue

@@ -1,348 +1,341 @@
 <template>
-	<view class="u-swiper-wrap" :style="{
+    <view class="u-swiper-wrap" :style="{
 		borderRadius: `${borderRadius}rpx`
 	}">
-		<swiper :current="elCurrent" @change="change" @animationfinish="animationfinish" :interval="interval" :circular="circular" :duration="duration" :autoplay="autoplay"
-		 :previous-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :next-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'"
-		 :style="{
+        <swiper :current="elCurrent" @change="change" @animationfinish="animationfinish" :interval="interval" :circular="circular" :duration="duration" :autoplay="autoplay" :previous-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :next-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :style="{
 				height: height + 'rpx',
 				backgroundColor: bgColor
 			}">
-			<swiper-item class="u-swiper-item" v-for="(item, index) in list" :key="index">
-				<view class="u-list-image-wrap" @tap.stop.prevent="listClick(index)" :class="[uCurrent != index ? 'u-list-scale' : '']" :style="{
+            <swiper-item class="u-swiper-item" v-for="(item, index) in list" :key="index">
+                <view class="u-list-image-wrap" @tap.stop.prevent="listClick(index)" :class="[uCurrent != index ? 'u-list-scale' : '']" :style="{
 						borderRadius: `${borderRadius}rpx`,
 						transform: (effect3d && uCurrent != index ? 'scale(0.75)' : 'scale(1)'),
 						margin: effect3d && uCurrent != index ? '0' : 0,
 					}">
-					<image class="u-swiper-image" :src="item[name] || item" :mode="imgMode"></image>
-					<view v-if="title && item.title" class="u-swiper-title u-line-1" :style="[{
+                    <image class="u-swiper-image" :src="item[name] || item" :mode="imgMode"></image>
+                    <view v-if="title && item.title" class="u-swiper-title u-line-1" :style="[{
 							'padding-bottom': titlePaddingBottom
 						}, titleStyle]">
-						{{ item.title }}
-					</view>
-				</view>
-			</swiper-item>
-		</swiper>
-		<view class="u-swiper-indicator" :style="{
+                        {{ item.title }}
+                    </view>
+                </view>
+            </swiper-item>
+        </swiper>
+        <view class="u-swiper-indicator" :style="{
 				top: indicatorPos == 'topLeft' || indicatorPos == 'topCenter' || indicatorPos == 'topRight' ? '12rpx' : 'auto',
 				bottom: indicatorPos == 'bottomLeft' || indicatorPos == 'bottomCenter' || indicatorPos == 'bottomRight' ? '12rpx' : 'auto',
 				justifyContent: justifyContent,
 				padding: `0 ${effect3d ? '74rpx' : '24rpx'}`
 			}">
-			<block v-if="mode == 'rect'">
-				<view class="u-indicator-item-rect" :class="{ 'u-indicator-item-rect-active': index == uCurrent }" v-for="(item, index) in list"
-				 :key="index"></view>
-			</block>
-			<block v-if="mode == 'dot'">
-				<view class="u-indicator-item-dot" :class="{ 'u-indicator-item-dot-active': index == uCurrent }" v-for="(item, index) in list"
-				 :key="index"></view>
-			</block>
-			<block v-if="mode == 'round'">
-				<view class="u-indicator-item-round" :class="{ 'u-indicator-item-round-active': index == uCurrent }" v-for="(item, index) in list"
-				 :key="index"></view>
-			</block>
-			<block v-if="mode == 'number'">
-				<view class="u-indicator-item-number">{{ uCurrent + 1 }}/{{ list.length }}</view>
-			</block>
-		</view>
-	</view>
+            <block v-if="mode == 'rect'">
+                <view class="u-indicator-item-rect" :class="{ 'u-indicator-item-rect-active': index == uCurrent }" v-for="(item, index) in list" :key="index"></view>
+            </block>
+            <block v-if="mode == 'dot'">
+                <view class="u-indicator-item-dot" :class="{ 'u-indicator-item-dot-active': index == uCurrent }" v-for="(item, index) in list" :key="index"></view>
+            </block>
+            <block v-if="mode == 'round'">
+                <view class="u-indicator-item-round" :class="{ 'u-indicator-item-round-active': index == uCurrent }" v-for="(item, index) in list" :key="index"></view>
+            </block>
+            <block v-if="mode == 'number'">
+                <view class="u-indicator-item-number">{{ uCurrent + 1 }}/{{ list.length }}</view>
+            </block>
+        </view>
+    </view>
 </template>
-
 <script>
-	/**
-	 * swiper 轮播图
-	 * @description 该组件一般用于导航轮播,广告展示等场景,可开箱即用
-	 * @tutorial https://www.uviewui.com/components/swiper.html
-	 * @property {Array} list 轮播图数据,见官网"基本使用"说明
-	 * @property {Boolean} title 是否显示标题文字,需要配合list参数,见官网说明(默认false)
-	 * @property {String} mode 指示器模式,见官网说明(默认round)
-	 * @property {String Number} height 轮播图组件高度,单位rpx(默认250)
-	 * @property {String} indicator-pos 指示器的位置(默认bottomCenter)
-	 * @property {Boolean} effect3d 是否开启3D效果(默认false)
-	 * @property {Boolean} autoplay 是否自动播放(默认true)
-	 * @property {String Number} interval 自动轮播时间间隔,单位ms(默认2500)
-	 * @property {Boolean} circular 是否衔接播放,见官网说明(默认true)
-	 * @property {String} bg-color 背景颜色(默认#f3f4f6)
-	 * @property {String Number} border-radius 轮播图圆角值,单位rpx(默认8)
-	 * @property {Object} title-style 自定义标题样式
-	 * @property {String Number} effect3d-previous-margin mode = true模式的情况下,激活项与前后项之间的距离,单位rpx(默认50)
-	 * @property {String} img-mode 图片的裁剪模式,详见image组件裁剪模式(默认aspectFill)
-	 * @event {Function} click 点击轮播图时触发
-	 * @example <u-swiper :list="list" mode="dot" indicator-pos="bottomRight"></u-swiper>
-	 */
-	export default {
-		name: "u-swiper",
-		props: {
-			// 轮播图的数据,格式如:[{image: 'xxxx', title: 'xxxx'},{image: 'yyyy', title: 'yyyy'}],其中title字段可选
-			list: {
-				type: Array,
-				default () {
-					return [];
-				}
-			},
-			// 是否显示title标题
-			title: {
-				type: Boolean,
-				default: false
-			},
-			// 用户自定义的指示器的样式
-			indicator: {
-				type: Object,
-				default () {
-					return {};
-				}
-			},
-			// 圆角值
-			borderRadius: {
-				type: [Number, String],
-				default: 8
-			},
-			// 隔多久自动切换
-			interval: {
-				type: [String, Number],
-				default: 3000
-			},
-			// 指示器的模式,rect|dot|number|round
-			mode: {
-				type: String,
-				default: 'round'
-			},
-			// list的高度,单位rpx
-			height: {
-				type: [Number, String],
-				default: 250
-			},
-			// 指示器的位置,topLeft|topCenter|topRight|bottomLeft|bottomCenter|bottomRight
-			indicatorPos: {
-				type: String,
-				default: 'bottomCenter'
-			},
-			// 是否开启缩放效果
-			effect3d: {
-				type: Boolean,
-				default: false
-			},
-			// 3D模式的情况下,激活item与前后item之间的距离,单位rpx
-			effect3dPreviousMargin: {
-				type: [Number, String],
-				default: 50
-			},
-			// 是否自动播放
-			autoplay: {
-				type: Boolean,
-				default: true
-			},
-			// 自动轮播时间间隔,单位ms
-			duration: {
-				type: [Number, String],
-				default: 500
-			},
-			// 是否衔接滑动,即到最后一张时接着滑动,是否自动切换到第一张
-			circular: {
-				type: Boolean,
-				default: true
-			},
-			// 图片的裁剪模式 
-			imgMode: {
-				type: String,
-				default: 'aspectFill'
-			},
-			// 从list数组中读取的图片的属性名
-			name: {
-				type: String,
-				default: 'image'
-			},
-			// 背景颜色
-			bgColor: {
-				type: String,
-				default: '#f3f4f6'
-			},
-			// 初始化时,默认显示第几项
-			current: {
-				type: [Number, String],
-				default: 0
-			},
-			// 标题的样式,对象形式
-			titleStyle: {
-				type: Object,
-				default() {
-					return {}
-				}
-			}
-		},
-		watch: {
-			// 如果外部的list发生变化,判断长度是否被修改,如果前后长度不一致,重置uCurrent值,避免溢出
-			list(nVal, oVal) {
-				if(nVal.length !== oVal.length) this.uCurrent = 0;
-			},
-			// 监听外部current的变化,实时修改内部依赖于此测uCurrent值,如果更新了current,而不是更新uCurrent,
-			// 就会错乱,因为指示器是依赖于uCurrent的
-			current(n) {
-				this.uCurrent = n;
-			}
-		},
-		data() {
-			return {
-				uCurrent: this.current // 当前活跃的swiper-item的index
-			};
-		},
-		computed: {
-			justifyContent() {
-				if (this.indicatorPos == 'topLeft' || this.indicatorPos == 'bottomLeft') return 'flex-start';
-				if (this.indicatorPos == 'topCenter' || this.indicatorPos == 'bottomCenter') return 'center';
-				if (this.indicatorPos == 'topRight' || this.indicatorPos == 'bottomRight') return 'flex-end';
-			},
-			titlePaddingBottom() {
-				let tmp = 0;
-				if (this.mode == 'none') return '12rpx';
-				if (['bottomLeft', 'bottomCenter', 'bottomRight'].indexOf(this.indicatorPos) >= 0 && this.mode == 'number') {
-					tmp = '60rpx';
-				} else if (['bottomLeft', 'bottomCenter', 'bottomRight'].indexOf(this.indicatorPos) >= 0 && this.mode != 'number') {
-					tmp = '40rpx';
-				} else {
-					tmp = '12rpx';
-				}
-				return tmp;
-			},
-			// 因为uni的swiper组件的current参数只接受Number类型,这里做一个转换
-			elCurrent() {
-				return Number(this.current);
-			}
-		},
-		methods: {
-			listClick(index) {
-				this.$emit('click', index);
-			},
-			change(e) {
-				let current = e.detail.current;
-				this.uCurrent = current;
-				// 发出change事件,表示当前自动切换的index,从0开始
-				this.$emit('change', current);
-			},
-			// 头条小程序不支持animationfinish事件,改由change事件
-			// 暂不监听此事件,因为不再给swiper绑定uCurrent属性
-			animationfinish(e) {
-				// #ifndef MP-TOUTIAO
-				// this.uCurrent = e.detail.current;
-				// #endif
-			}
-		}
-	};
+/**
+ * swiper 轮播图
+ * @description 该组件一般用于导航轮播,广告展示等场景,可开箱即用
+ * @tutorial https://www.uviewui.com/components/swiper.html
+ * @property {Array} list 轮播图数据,见官网"基本使用"说明
+ * @property {Boolean} title 是否显示标题文字,需要配合list参数,见官网说明(默认false)
+ * @property {String} mode 指示器模式,见官网说明(默认round)
+ * @property {String Number} height 轮播图组件高度,单位rpx(默认250)
+ * @property {String} indicator-pos 指示器的位置(默认bottomCenter)
+ * @property {Boolean} effect3d 是否开启3D效果(默认false)
+ * @property {Boolean} autoplay 是否自动播放(默认true)
+ * @property {String Number} interval 自动轮播时间间隔,单位ms(默认2500)
+ * @property {Boolean} circular 是否衔接播放,见官网说明(默认true)
+ * @property {String} bg-color 背景颜色(默认#f3f4f6)
+ * @property {String Number} border-radius 轮播图圆角值,单位rpx(默认8)
+ * @property {Object} title-style 自定义标题样式
+ * @property {String Number} effect3d-previous-margin mode = true模式的情况下,激活项与前后项之间的距离,单位rpx(默认50)
+ * @property {String} img-mode 图片的裁剪模式,详见image组件裁剪模式(默认aspectFill)
+ * @event {Function} click 点击轮播图时触发
+ * @example <u-swiper :list="list" mode="dot" indicator-pos="bottomRight"></u-swiper>
+ */
+export default {
+    name: "u-swiper",
+    props: {
+        // 轮播图的数据,格式如:[{image: 'xxxx', title: 'xxxx'},{image: 'yyyy', title: 'yyyy'}],其中title字段可选
+        list: {
+            type: Array,
+            default () {
+                return [];
+            }
+        },
+        // 是否显示title标题
+        title: {
+            type: Boolean,
+            default: false
+        },
+        // 用户自定义的指示器的样式
+        indicator: {
+            type: Object,
+            default () {
+                return {};
+            }
+        },
+        // 圆角值
+        borderRadius: {
+            type: [Number, String],
+            default: 8
+        },
+        // 隔多久自动切换
+        interval: {
+            type: [String, Number],
+            default: 3000
+        },
+        // 指示器的模式,rect|dot|number|round
+        mode: {
+            type: String,
+            default: 'round'
+        },
+        // list的高度,单位rpx
+        height: {
+            type: [Number, String],
+            default: 250
+        },
+        // 指示器的位置,topLeft|topCenter|topRight|bottomLeft|bottomCenter|bottomRight
+        indicatorPos: {
+            type: String,
+            default: 'bottomCenter'
+        },
+        // 是否开启缩放效果
+        effect3d: {
+            type: Boolean,
+            default: false
+        },
+        // 3D模式的情况下,激活item与前后item之间的距离,单位rpx
+        effect3dPreviousMargin: {
+            type: [Number, String],
+            default: 50
+        },
+        // 是否自动播放
+        autoplay: {
+            type: Boolean,
+            default: true
+        },
+        // 自动轮播时间间隔,单位ms
+        duration: {
+            type: [Number, String],
+            default: 500
+        },
+        // 是否衔接滑动,即到最后一张时接着滑动,是否自动切换到第一张
+        circular: {
+            type: Boolean,
+            default: true
+        },
+        // 图片的裁剪模式 
+        imgMode: {
+            type: String,
+            default: 'aspectFill'
+        },
+        // 从list数组中读取的图片的属性名
+        name: {
+            type: String,
+            default: 'image'
+        },
+        // 背景颜色
+        bgColor: {
+            type: String,
+            default: '#f3f4f6'
+        },
+        // 初始化时,默认显示第几项
+        current: {
+            type: [Number, String],
+            default: 0
+        },
+        // 标题的样式,对象形式
+        titleStyle: {
+            type: Object,
+            default () {
+                return {}
+            }
+        }
+    },
+    watch: {
+        // 如果外部的list发生变化,判断长度是否被修改,如果前后长度不一致,重置uCurrent值,避免溢出
+        list(nVal, oVal) {
+            if (nVal.length !== oVal.length) this.uCurrent = 0;
+        },
+        // 监听外部current的变化,实时修改内部依赖于此测uCurrent值,如果更新了current,而不是更新uCurrent,
+        // 就会错乱,因为指示器是依赖于uCurrent的
+        current(n) {
+            this.uCurrent = n;
+        }
+    },
+    data() {
+        return {
+            uCurrent: this.current // 当前活跃的swiper-item的index
+        };
+    },
+    computed: {
+        justifyContent() {
+            if (this.indicatorPos == 'topLeft' || this.indicatorPos == 'bottomLeft') return 'flex-start';
+            if (this.indicatorPos == 'topCenter' || this.indicatorPos == 'bottomCenter') return 'center';
+            if (this.indicatorPos == 'topRight' || this.indicatorPos == 'bottomRight') return 'flex-end';
+        },
+        titlePaddingBottom() {
+            let tmp = 0;
+            if (this.mode == 'none') return '12rpx';
+            if (['bottomLeft', 'bottomCenter', 'bottomRight'].indexOf(this.indicatorPos) >= 0 && this.mode == 'number') {
+                tmp = '60rpx';
+            } else if (['bottomLeft', 'bottomCenter', 'bottomRight'].indexOf(this.indicatorPos) >= 0 && this.mode != 'number') {
+                tmp = '40rpx';
+            } else {
+                tmp = '12rpx';
+            }
+            return tmp;
+        },
+        // 因为uni的swiper组件的current参数只接受Number类型,这里做一个转换
+        elCurrent() {
+            return Number(this.current);
+        }
+    },
+    methods: {
+        listClick(index) {
+            this.$emit('click', index);
+        },
+        change(e) {
+            let current = e.detail.current;
+            this.uCurrent = current;
+            // 发出change事件,表示当前自动切换的index,从0开始
+            this.$emit('change', current);
+        },
+        // 头条小程序不支持animationfinish事件,改由change事件
+        // 暂不监听此事件,因为不再给swiper绑定uCurrent属性
+        animationfinish(e) {
+            // #ifndef MP-TOUTIAO
+            // this.uCurrent = e.detail.current;
+            // #endif
+        }
+    }
+};
 </script>
-
 <style lang="scss" scoped>
-	// @import "@/node_modules/uview-ui/libs/css/style.components.scss";
-	// 定义混入指令,用于在非nvue环境下的flex定义,因为nvue没有display属性,会报错
-	@mixin vue-flex($direction: row) {
-		/* #ifndef APP-NVUE */
-		display: flex;
-		flex-direction: $direction;
-		/* #endif */
-	}
-	
-	.u-swiper-wrap {
-		position: relative;
-		overflow: hidden;
-		transform: translateY(0);
-	}
+// @import "@/node_modules/uview-ui/libs/css/style.components.scss";
+// 定义混入指令,用于在非nvue环境下的flex定义,因为nvue没有display属性,会报错
+@mixin vue-flex($direction: row) {
+    /* #ifndef APP-NVUE */
+    display: flex;
+    flex-direction: $direction;
+    /* #endif */
+}
+
+.u-swiper-wrap {
+    position: relative;
+    overflow: hidden;
+    transform: translateY(0);
+}
 
-	.u-swiper-image {
-		width: 100%;
-		will-change: transform;
-		height: 100%;
-		/* #ifndef APP-NVUE */
-		display: block;
-		/* #endif */
-		/* #ifdef H5 */
-		pointer-events: none;
-		/* #endif */
-		border-radius: 10rpx;
-	}
+.u-swiper-image {
+    width: 100%;
+    will-change: transform;
+    height: 100%;
+    /* #ifndef APP-NVUE */
+    display: block;
+    /* #endif */
+    /* #ifdef H5 */
+    pointer-events: none;
+    /* #endif */
+    border-radius: 10rpx;
+}
 
-	.u-swiper-indicator {
-		padding: 0 24rpx;
-		position: absolute;
-		@include vue-flex;
-		width: 100%;
-		z-index: 1;
-	}
+.u-swiper-indicator {
+    padding: 0 24rpx;
+    position: absolute;
+    @include vue-flex;
+    width: 100%;
+    z-index: 1;
+}
 
-	.u-indicator-item-rect {
-		width: 26rpx;
-		height: 8rpx;
-		margin: 0 6rpx;
-		transition: all 0.5s;
-		background-color: rgba(0, 0, 0, 0.3);
-	}
+.u-indicator-item-rect {
+    width: 26rpx;
+    height: 8rpx;
+    margin: 0 6rpx;
+    transition: all 0.5s;
+    background-color: rgba(0, 0, 0, 0.3);
+}
 
-	.u-indicator-item-rect-active {
-		background-color: rgba(255, 255, 255, 0.8);
-	}
+.u-indicator-item-rect-active {
+    background-color: rgba(255, 255, 255, 0.8);
+}
 
-	.u-indicator-item-dot {
-		width: 14rpx;
-		height: 14rpx;
-		margin: 0 6rpx;
-		border-radius: 20rpx;
-		transition: all 0.5s;
-		background-color: rgba(0, 0, 0, 0.3);
-	}
+.u-indicator-item-dot {
+    width: 14rpx;
+    height: 14rpx;
+    margin: 0 6rpx;
+    border-radius: 20rpx;
+    transition: all 0.5s;
+    background-color: rgba(0, 0, 0, 0.3);
+}
 
-	.u-indicator-item-dot-active {
-		background-color: rgba(255, 255, 255, 0.8);
-	}
+.u-indicator-item-dot-active {
+    background-color: rgba(255, 255, 255, 0.8);
+}
 
-	.u-indicator-item-round {
-		width: 14rpx;
-		height: 14rpx;
-		margin: 0 6rpx;
-		border-radius: 20rpx;
-		transition: all 0.5s;
-		background-color: rgba(0, 0, 0, 0.3);
-	}
+.u-indicator-item-round {
+    width: 14rpx;
+    height: 14rpx;
+    margin: 0 6rpx;
+    border-radius: 20rpx;
+    transition: all 0.5s;
+    background-color: rgba(0, 0, 0, 0.3);
+}
 
-	.u-indicator-item-round-active {
-		width: 34rpx;
-		background-color: rgba(255, 255, 255, 0.8);
-	}
+.u-indicator-item-round-active {
+    width: 34rpx;
+    background-color: rgba(255, 255, 255, 0.8);
+}
 
-	.u-indicator-item-number {
-		padding: 6rpx 16rpx;
-		line-height: 1;
-		background-color: rgba(0, 0, 0, 0.3);
-		border-radius: 100rpx;
-		font-size: 26rpx;
-		color: rgba(255, 255, 255, 0.8);
-	}
+.u-indicator-item-number {
+    padding: 6rpx 16rpx;
+    line-height: 1;
+    background-color: rgba(0, 0, 0, 0.3);
+    border-radius: 100rpx;
+    font-size: 26rpx;
+    color: rgba(255, 255, 255, 0.8);
+}
 
-	.u-list-scale {
-		transform-origin: center center;
-	}
+.u-list-scale {
+    transform-origin: center center;
+}
 
-	.u-list-image-wrap {
-		width: 100%;
-		height: 100%;
-		flex: 1;
-		transition: all 0.2s;
-		overflow: hidden;
-		box-sizing: content-box;
-		position: relative;
-	}
+.u-list-image-wrap {
+    width: 100%;
+    height: 100%;
+    flex: 1;
+    transition: all 0.2s;
+    overflow: hidden;
+    box-sizing: content-box;
+    position: relative;
+}
 
-	.u-swiper-title {
-		position: absolute;
-		background-color: rgba(0, 0, 0, 0.3);
-		bottom: 0;
-		left: 0;
-		width: 100%;
-		font-size: 28rpx;
-		padding: 12rpx 24rpx;
-		color: rgba(255, 255, 255, 0.9);
-	}
+.u-swiper-title {
+    position: absolute;
+    background-color: rgba(0, 0, 0, 0.3);
+    bottom: 0;
+    left: 0;
+    width: 100%;
+    font-size: 28rpx;
+    padding: 12rpx 24rpx;
+    color: rgba(255, 255, 255, 0.9);
+}
 
-	.u-swiper-item {
-		@include vue-flex;
-		overflow: hidden;
-		align-items: center;
-	}
-</style>
+.u-swiper-item {
+    @include vue-flex;
+    overflow: hidden;
+    align-items: center;
+}
+</style>