Pārlūkot izejas kodu

Merge branch 'master' of http://git.jihengcc.cn/liubaiyan/qjd-user-uniapp

zhaoxw 4 gadi atpakaļ
vecāks
revīzija
81d3c3139d
1 mainītis faili ar 14 papildinājumiem un 4 dzēšanām
  1. 14 4
      pages/index/index.vue

+ 14 - 4
pages/index/index.vue

@@ -4,9 +4,9 @@
 			<uni-search-bar radius="100" placeholder="搜索" clearButton="auto" cancelButton="none" bgColor="#ffffff" @confirm="goToGoodList" />
 		</view>
 		<view>
-			<swiper class="swiper" :indicator-dots="false" :autoplay="true" :interval="3000" :duration="500">
+			<swiper class="swiper" :indicator-dots="false" :autoplay="true" :interval="3000" :duration="500" :style="{height: swiperHeight + 'px'}">
 				<swiper-item v-for="(item,index) in advertList" :key="index">
-					<image :src="item.imgPath"  mode="aspectFill"></image>
+					<image :src="item.imgPath" mode="aspectFill" :style="{height: swiperHeight + 'px', width: swiperHeight * 2 + 'px'}"></image>
 				</swiper-item>
 			</swiper>
 		</view>
@@ -67,7 +67,7 @@
 			<view class="title-text">猜你喜欢</view>
 		</view>
 		<view v-if="!goodsList.length" style="margin-left: 12px;">暂无商品</view>
-		<scroll-view  v-if="goodsList.length" class="content-box" scroll-y="false">
+		<scroll-view v-if="goodsList.length" class="content-box" scroll-y="false">
 			<view class="goods-row" v-for="(item,index) in goodsList" :key="index" @click="goToGoodDetails(item)">
 				<image class="goods-img" :src="item.imgPath" mode="aspectFill"></image>
 				<view class="goods-info">
@@ -97,9 +97,15 @@
 				advertList: [],
 				discountList: [],
 				goodsList: [],
+				swiperHeight: 175
 			}
 		},
 		onLoad() {
+			uni.getSystemInfo({
+				success: (res) => {
+					this.swiperHeight = res.windowWidth / 2
+				}
+			})
 			if (!uni.getStorageSync('token')) {
 				uni.reLaunch({
 					url: '/pages/index/login'
@@ -187,7 +193,11 @@
 		}
 	}
 </script>
-
+<style>
+	.search .uni-searchbar {
+		background-color: transparent !important;
+	}
+</style>
 <style lang="less" scoped>
 	.container {
 		background-size: 128px 124px;