guhongwei 2 年之前
父節點
當前提交
152a73d5f7
共有 2 個文件被更改,包括 59 次插入9 次删除
  1. 1 1
      pages/index/index.vue
  2. 58 8
      pagesRest/activity/info.vue

+ 1 - 1
pages/index/index.vue

@@ -53,7 +53,7 @@
 							data: res,
 							success: function() {
 								uni.redirectTo({
-									// url: `/pagesRest/activity/list`
+									// url: `/pagesRest/activity/info`
 									url: `/pages/home/index`
 								})
 							}

+ 58 - 8
pagesRest/activity/info.vue

@@ -17,8 +17,13 @@
 						<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
 							<view class="list-scroll-view">
 								<view class="pubu">
-									<view class="list" v-for="(item,index) in list" :key="index">
-										{{item.goods}}
+									<view class="list" v-for="(item,index) in list" :key="index" @tap="toBuy(item.goods)">
+										<view class="img">
+											<image class="image" :src="item.goods.file&&item.goods.file.length?item.goods.file[0].url:''" mode=""></image>
+										</view>
+										<view class="name">
+											<text>{{item.goods.name}}</text>
+										</view>
 									</view>
 								</view>
 								<view class="is_bottom" v-if="is_bottom">
@@ -155,13 +160,18 @@
 				that.clearPage();
 				that.search();
 			},
+			// 购买
+			toBuy(e) {
+				const that = this;
+				that.clearPage();
+				uni.navigateTo({
+					url: `/pagesHome/order/detail?id=${e.id||e._id}`
+				})
+			},
 			// 选择底部菜单
 			barChange(index, item) {
 				const that = this;
 				that.$set(that, `barActive`, index);
-				// uni.setNavigationBarTitle({
-				// 	title: item.name
-				// });
 			},
 			// 清空列表
 			clearPage() {
@@ -204,6 +214,7 @@
 				.one_2_1 {
 					border-bottom: 1px solid var(--f85Color);
 					padding: 2vw;
+					margin: 0 0 2vw 0;
 
 					input {
 						padding: 2vw;
@@ -214,7 +225,37 @@
 				}
 
 				.one_2_2 {
-					padding: 2vw;
+					position: relative;
+					width: 96vw;
+					height: 81vh;
+					margin: 0 2vw;
+
+					.pubu {
+						column-count: 2;
+						column-gap: 2vw;
+
+						.list {
+							break-inside: avoid;
+							padding: 2vw;
+							background-color: #f1f1f1;
+							margin: 0 0 2vw 0;
+							border-radius: 5px;
+
+							.img {
+								.image {
+									width: 100%;
+									height: 30vh;
+									border-radius: 5px;
+								}
+							}
+
+							.name {
+								text {
+									font-size: 14px;
+								}
+							}
+						}
+					}
 				}
 			}
 		}
@@ -251,8 +292,17 @@
 
 		.list-scroll-view {
 			display: flex;
-			flex-direction: row;
-			flex-wrap: wrap;
+			flex-direction: column;
+		}
+	}
+
+	.is_bottom {
+		text-align: center;
+		width: 100vw;
+
+		text {
+			padding: 1vw 0;
+			display: inline-block;
 		}
 	}
 </style>