Browse Source

首农专区

zs 2 years ago
parent
commit
53b30d6b16
1 changed files with 258 additions and 4 deletions
  1. 258 4
      pagesHome/farming/index.vue

+ 258 - 4
pagesHome/farming/index.vue

@@ -3,7 +3,31 @@
 		<view class="main">
 		<view class="main">
 			<view class="one">
 			<view class="one">
 				<view class="one_1" v-if="barActive=='0'">
 				<view class="one_1" v-if="barActive=='0'">
-					微店首页
+					<view class="first">
+						<image class="image" :src="oneUrl" mode=""></image>
+					</view>
+					<view class="second">
+						<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage">
+							<view class="list-scroll-view">
+								<view class="list" v-for="(item,index) in list" :key="index"
+									@tap="toCommon('pagesHome/order/detail')">
+									<image class="image" :src="item.url" mode=""></image>
+									<view class="name">
+										{{item.name}}
+									</view>
+									<view class="other">
+										<view class="money">
+											<text>¥</text>
+											<text>{{item.money}}</text>
+										</view>
+										<view class="btn">
+											<button type="default" size="mini">购买</button>
+										</view>
+									</view>
+								</view>
+							</view>
+						</scroll-view>
+					</view>
 				</view>
 				</view>
 				<view class="one_2" v-else-if="barActive=='1'">
 				<view class="one_2" v-else-if="barActive=='1'">
 					商品分类
 					商品分类
@@ -12,7 +36,33 @@
 					全部商品
 					全部商品
 				</view>
 				</view>
 				<view class="one_4" v-else-if="barActive=='3'">
 				<view class="one_4" v-else-if="barActive=='3'">
-					店铺简介
+					<view class="first">
+						<image class="image" :src="info.url" mode=""></image>
+						<view class="name">{{info.name}}</view>
+					</view>
+					<view class="second">
+						<view class="second_1">
+							<view class="grade">
+								<view>{{info.grade||'5'}}</view>
+								商品
+							</view>
+							<view class="grade">
+								<view>{{info.grade||'5'}}</view>
+								发货
+							</view>
+							<view class="grade">
+								<view>{{info.grade||'5'}}</view>
+								服务
+							</view>
+						</view>
+						<view class="second_2">
+							<image class="image" :src="info.url" mode=""></image>
+						</view>
+					</view>
+					<view class="collect">
+						<text v-if="!collection" @click="toCollect" class="iconfont icon-kongxin"></text>
+						<text v-else @click="toCollect" class="iconfont icon-shixin"></text>
+					</view>
 				</view>
 				</view>
 			</view>
 			</view>
 			<view class="two">
 			<view class="two">
@@ -52,7 +102,42 @@
 						acticon: "icon-qiyejianjie-copy",
 						acticon: "icon-qiyejianjie-copy",
 						name: '店铺简介'
 						name: '店铺简介'
 					}
 					}
-				]
+				],
+				oneUrl: require('@/static/test.png'),
+				info: {
+					url: require('@/static/test.png'),
+					name: '首农食品旗舰店',
+					money: 100,
+				},
+				list: [ //
+					{
+						url: require('@/static/test.png'),
+						name: '商品名称',
+						money: 100,
+					},
+					{
+						url: require('@/static/test.png'),
+						name: '商品名称',
+						money: 100,
+					},
+					{
+						url: require('@/static/test.png'),
+						name: '商品名称',
+						money: 100,
+					},
+					{
+						url: require('@/static/test.png'),
+						name: '商品名称',
+						money: 100,
+					},
+					{
+						url: require('@/static/test.png'),
+						name: '商品名称',
+						money: 100,
+					},
+				],
+				// 收藏
+				collection: false,
 			};
 			};
 		},
 		},
 		onShow: function() {},
 		onShow: function() {},
@@ -61,7 +146,31 @@
 			barChange(index, item) {
 			barChange(index, item) {
 				const that = this;
 				const that = this;
 				that.$set(that, `barActive`, index);
 				that.$set(that, `barActive`, index);
-			}
+			},
+			// 公共跳转
+			toCommon(e) {
+				uni.navigateTo({
+					url: `/${e}`
+				})
+			},
+			// 收藏
+			toCollect() {
+				const that = this;
+				that.collection = !that.collection;
+				if (that.collection == true) {
+					uni.showToast({
+						title: `收藏成功`,
+						icon: 'none'
+					})
+				} else {
+					uni.showToast({
+						title: `取消成功`,
+						icon: 'none'
+					})
+				}
+			},
+			// 分页
+			toPage() {}
 		}
 		}
 	}
 	}
 </script>
 </script>
@@ -76,6 +185,137 @@
 		.one {
 		.one {
 			position: relative;
 			position: relative;
 			flex-grow: 1;
 			flex-grow: 1;
+
+			.one_1 {
+				display: flex;
+				flex-direction: column;
+				width: 96vw;
+				height: 90vh;
+				padding: 2vw;
+				background-color: var(--fFB1Color);
+
+				.first {
+					margin: 0 0 2vw 0;
+
+					.image {
+						width: 100%;
+						height: 50vw;
+					}
+				}
+
+				.second {
+					position: relative;
+					flex-grow: 1;
+
+					.list {
+						margin: 0 2vw 2vw 0;
+						background-color: var(--fffColor);
+						padding: 2vw;
+						width: 43vw;
+						border-radius: 5px;
+
+						.image {
+							width: 100%;
+							height: 49vw;
+							margin: 0 0 1vw 0;
+						}
+
+						.name {
+							font-size: var(--font15Size);
+							margin: 0 0 2vw 0;
+						}
+
+						.other {
+							display: flex;
+							flex-direction: row;
+							justify-content: space-between;
+
+							.money {
+								color: var(--ff0Color);
+
+								text:nth-child(1) {
+									font-size: var(--font12Size);
+								}
+							}
+
+							.btn {
+								button {
+									border-radius: 25px;
+									color: var(--fffColor);
+									background-color: var(--ff0Color);
+									font-size: var(--font12Size);
+								}
+							}
+						}
+					}
+
+					.list:nth-child(2n) {
+						margin: 0 0 2vw 0;
+					}
+				}
+			}
+
+			.one_4 {
+				.first {
+					display: flex;
+					flex-direction: column;
+					align-items: center;
+					background-color: var(--fFB1Color);
+					border-bottom-right-radius: 10vw;
+					border-bottom-left-radius: 10vw;
+
+					.image {
+						width: 20vw;
+						height: 20vw;
+						border-radius: 20vw;
+					}
+
+					.name {
+						margin: 2vw 0;
+						font-size: var(--font16Szie);
+						font-weight: bold;
+						color: var(--mainColor);
+					}
+				}
+
+				.second {
+					margin: 2vw 0;
+
+					.second_1 {
+						display: flex;
+						justify-content: space-evenly;
+
+						.grade {
+							display: flex;
+							flex-direction: column;
+							align-items: center;
+							color: var(--f85Color);
+							font-size: var(--font13Size);
+
+							view {
+								margin: 1vw 0 0 0;
+								color: var(--ff0Color);
+							}
+						}
+					}
+
+					.second_2 {
+						display: flex;
+						justify-content: center;
+						margin: 20vw 0 0 0;
+					}
+				}
+			}
+
+			.collect {
+				position: fixed;
+				top: 4vw;
+				right: 5vw;
+
+				.iconfont {
+					font-size: 25px;
+				}
+			}
 		}
 		}
 
 
 		.two {
 		.two {
@@ -100,4 +340,18 @@
 			}
 			}
 		}
 		}
 	}
 	}
+
+	.scroll-view {
+		position: absolute;
+		top: 0;
+		left: 0;
+		right: 0;
+		bottom: 0;
+
+		.list-scroll-view {
+			display: flex;
+			flex-direction: row;
+			flex-wrap: wrap;
+		}
+	}
 </style>
 </style>