Преглед на файлове

Merge branch 'master' of http://139.9.50.163:3000/Project2024/menber-center

LinWuTai преди 2 месеца
родител
ревизия
b06e48a33f
променени са 2 файла, в които са добавени 34 реда и са изтрити 26 реда
  1. 6 6
      components/lgSwiper.vue
  2. 28 20
      pages/index/index.vue

+ 6 - 6
components/lgSwiper.vue

@@ -1,13 +1,13 @@
 <template>
 	<view class="container">
 		<swiper class="swiper" :circular="true" :autoplay="false" :duration="500" :previous-margin="'200rpx'"
-			:next-margin="'200rpx'" :style="{ height: '400rpx' }" :current="currentIndex" 
+			:next-margin="'200rpx'" :style="{ height: '300rpx' }" :current="currentIndex" 
 			:easing-function="easeInOutCubic"
 			@change="changeCurrent">
 			<swiper-item v-for="(slide, index) in processedSildeItems" :key="index" style="overflow: initial;"
 				:class="index==currentIndex? 'swiper-item-active':'swiper-item-normal'">
 				<view :class="index==currentIndex? 'swiper-item active':'swiper-item'">
-					<image style="width: 100%;height: 70%;" mode="aspectFill" :src="slide.tupian"></image>
+					<image style="width: 100%;height: 90%;" mode="aspectFill" :src="slide.tupian"></image>
 					<text class="swiper-text">{{ slide.biaoti }}</text>
 				</view>
 			</swiper-item>
@@ -58,10 +58,14 @@
 
 	.swiper-item-active {
 		z-index: 10;
+		display: flex;
+		align-items: center;
 	}
 
 	.swiper-item-normal {
 		z-index: 1;
+		display: flex;
+		    align-items: center;
 	}
 
 	.swiper-item {
@@ -81,7 +85,6 @@
 			text-overflow: ellipsis;
 			margin-top: 10rpx;
 		}
-		
 	}
 
 	.active {
@@ -90,10 +93,7 @@
 		width: 93%;
 		margin: auto;
 		justify-content: center;
-		// align-items: center;
 		font-size: 24rpx;
-		// border-radius: 10px;
-		// flex-direction: column;
 		.swiper-text {
 			white-space: nowrap;
 			overflow: hidden;

+ 28 - 20
pages/index/index.vue

@@ -1,7 +1,5 @@
 <template>
 	<view class="container">
-		<!-- <view :style="{height: statusBarHeight + 'px'}"></view> -->
-		<!-- <view :style="{height: navBarHeight + 'px'}"></view> -->
 		<u-navbar :is-back="false" title="" :background="{ background: '#f7f7f7' }" :border-bottom="false">
 			<view class="slot-wrap">
 				<image src="/static/images/login-icon.png" mode="aspectFit" style="width: 200rpx;"></image>
@@ -62,6 +60,12 @@
 				</template>
 			</u-card>
 		</view>
+		<u-modal v-model="loginModal" mask-close-able class="modal" show-cancel-button
+			:title-style="{fontWeight: 'bold'}" @confirm="confirmModal">
+			<view class="modal-content">
+				<text>请登录后使用该功能</text>
+			</view>
+		</u-modal>
 	</view>
 </template>
 
@@ -85,13 +89,12 @@
 	const navBarHeight = ref(0)
 	// 是否登录
 	const isLogin = ref(true)
+	
+	const loginModal = ref(false)
 	// 是否为会员,从缓存里拿取用户信息
 	// const userInfo = uni.getStorageSync("userinfo") || {}
 	// const isMember = userInfo?.isMember || false
-    const items= ref(['内容1', '内容2', '内容3', '内容4'])
-	const onChange = (e) => {
-      console.log('当前索引:', e.detail.current);
-    }
+    
 	// 首页-轮播图
 	const swiperList = ref([{
 			tupian: 'https://tse3-mm.cn.bing.net/th/id/OIP-C.YKoZzgmubNBxQ8j-mmoTKAHaEK?rs=1&pid=ImgDetMain',
@@ -123,7 +126,6 @@
 			biaoti: '挑剔42341255243'
 		},
 	])
-	const current = ref(0)
 	// 首页-导航栏
 	const navList = ref([{
 			id: 'notice',
@@ -225,15 +227,19 @@
 			return
 		}
 		if (!authStore.isAuthenticated) {
-			uni.navigateTo({
-				url: "/pages/login/login"
-			})
+			loginModal.value = true
+			
 			return
 		}
 		uni.navigateTo({
 			url: data.url
 		})
 	}
+	const confirmModal = () => {
+		uni.navigateTo({
+			url: "/pages/login/login"
+		})
+	}
 	const toPage = () => {
 		if (!authStore.isAuthenticated) {
 			uni.navigateTo({
@@ -242,15 +248,6 @@
 			return
 		}
 	}
-	const onSwiperChange = (event) => {
-		this.current = event.detail.current; // 更新当前项
-	}
-	const onSwiper = (swiper) => {
-		console.log(swiper);
-	};
-	const onSlideChange = () => {
-		console.log('slide change');
-	}
 	onReady(() => {
 		uni.getSystemInfo({
 			success(e) {
@@ -272,7 +269,7 @@
 	.container {
 		width: 100vw;
 		background-color: $uni-bg-color;
-		padding: 0 20rpx;
+		padding: 0 20rpx 5rpx;
 	}
 
 	.slot-wrap {
@@ -422,4 +419,15 @@
 	  color: white;
 	  background: linear-gradient(45deg, #ff5858, #f09819); /* 示例背景 */
 	}
+	
+	// 登录模拟态
+	.modal {
+		.modal-content {
+			padding: 50rpx;
+	
+			.content-a {
+				color: #2979ff;
+			}
+		}
+	}
 </style>