yuanyiming 1 rok temu
rodzic
commit
72d19caa83
2 zmienionych plików z 31 dodań i 20 usunięć
  1. 17 10
      pages/index/index.vue
  2. 14 10
      pages/teachingList/teachingList.vue

+ 17 - 10
pages/index/index.vue

@@ -60,7 +60,8 @@
 							style="width: 28rpx; height: 26rpx" mode="aspectFill"></image>
 					</template>
 					<template #Dicon>
-						<image src="http://43.139.158.220:5007/img/static/yym/Vector (Stroke).png" style="width: 22rpx; height: 26rpx" mode="aspectFill"></image>
+						<image src="http://43.139.158.220:5007/img/static/yym/Vector (Stroke).png"
+							style="width: 22rpx; height: 26rpx" mode="aspectFill"></image>
 					</template>
 					<template #btn>
 						<button class="list1btn sBtn-font" @click.stop="join">
@@ -151,17 +152,17 @@
 				})
 			},
 			// 获取推荐课程list 数据
-			getlistBlock1Data(){
-				let data={
-					openid:uni.getStorageSync('oId'),
-					ty:3,
-					page:1, //下拉获取更多的备用字段
-					lim:6   //一次获取多少数据
+			getlistBlock1Data() {
+				let data = {
+					openid: uni.getStorageSync('oId'),
+					ty: 3,
+					page: 1, //下拉获取更多的备用字段
+					lim: 6 //一次获取多少数据
 				}
-				this.$request('/selectActivity',"POST",data).then(res=>{
-					console.log('推荐课程',res[0]);
+				this.$request('/selectActivity', "POST", data).then(res => {
+					console.log('推荐课程', res[0]);
 					// this.activeList=[...this.activeList,...res[0]]
-					this.classList=res[0]
+					this.classList = res[0]
 				})
 			},
 			// 跳转到推荐课程查看更多
@@ -272,6 +273,12 @@
 <style lang="scss" scoped>
 	.content {
 
+		// .listBlock1PIC {
+		// 	width: 160rpx;
+		// 	height: 160rpx;
+		// 	border-radius: 10rpx;
+		// }
+
 		.list1btn {
 			z-index: 5;
 			border: none;

+ 14 - 10
pages/teachingList/teachingList.vue

@@ -11,7 +11,7 @@
 				<!-- 推荐课程插槽组件 -->
 				<listBlock1 v-for="i in classList">
 					<template #pic>
-						<image :src="i.pic" mode="aspectFill"></image>
+						<image :src="i.pic" class="listBlock1PIC" mode="aspectFill"></image>
 					</template>
 					<template #tit>
 						{{i.acName}}
@@ -24,7 +24,8 @@
 							style="width: 28rpx; height: 26rpx" mode="aspectFill"></image>
 					</template>
 					<template #Dicon>
-						<image src="http://43.139.158.220:5007/img/static/yym/Vector (Stroke).png" style="width: 22rpx; height: 26rpx" mode="aspectFill"></image>
+						<image src="http://43.139.158.220:5007/img/static/yym/Vector (Stroke).png"
+							style="width: 22rpx; height: 26rpx" mode="aspectFill"></image>
 					</template>
 					<template #btn>
 						<button class="list1btn sBtn-font" @click.stop="join">
@@ -50,7 +51,7 @@
 					title: '推荐课程',
 					btn: 1
 				},
-				
+
 				teaData: {
 					btn: 1,
 					btn_2: 1,
@@ -72,14 +73,14 @@
 					lim: 10 //一次获取多少数据
 				}
 				this.$request('/selectActivity', "POST", data).then(res => {
-					console.log('获取数据',res[0]);
+					console.log('获取数据', res[0]);
 					if (!res[0].length) {
 						this.newsLoading = 2
 					} else {
 						this.newsLoading = 0
 					}
 					// return
-					this.classList=[...this.classList,...res[0]]
+					this.classList = [...this.classList, ...res[0]]
 					// this.activeList = res[0]
 				})
 			},
@@ -92,10 +93,10 @@
 			}
 			this.newsLoading = 1
 			this.currentPage++
-			setTimeout(this.getData,2000)
-			
+			setTimeout(this.getData, 2000)
+
 		},
-		
+
 		onLoad() {
 			// 一进页面就加载数据
 			this.getData()
@@ -105,15 +106,16 @@
 
 <style lang="scss">
 	.teachingList {
-		.loading{
+		.loading {
 			height: 50rpx;
 			text-align: center;
 			padding-top: 20rpx;
 			padding-bottom: 100rpx;
 			font-size: 26rpx;
-			color:#888;
+			color: #888;
 			line-height: 2em;
 		}
+
 		.list1btn {
 			z-index: 5;
 			border: none;
@@ -129,5 +131,7 @@
 			line-height: 48rpx;
 			letter-spacing: 1px;
 		}
+
+		
 	}
 </style>