Browse Source

一级市场页面

mym 1 năm trước cách đây
mục cha
commit
e4676d60b6
3 tập tin đã thay đổi với 63 bổ sung131 xóa
  1. 0 6
      pages.json
  2. 63 13
      pages/oneMarket/oneMarket.vue
  3. 0 112
      pages/order/order.vue

+ 0 - 6
pages.json

@@ -39,12 +39,6 @@
 
 		},
 		{
-			"path": "pages/order/order",
-			"style": {
-				"navigationBarTitleText": "订单中心"
-			}
-		},
-		{
 			"path": "pages/message/message",
 			"style": {
 				"navigationBarTitleText": "消息中心"

+ 63 - 13
pages/oneMarket/oneMarket.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
-		<navigation-bar title="一级市场" background-color="#fff" front-color="#000000" :left-button="null" />
-		<u-list class="list" width="100%" @scrolltolower="scrolltolower">
+		<navigation-bar :title="title" background-color="#fff" front-color="#000000" :left-button="null" />
+		<u-list v-if="active==1" class="list" width="100%" @scrolltolower="scrolltolower">
 			<u-list-item v-for="(item, index) in goods" :key="index">
 				<view class="card" @click="toDetails(item.id)">
 					<view class="card-body">
@@ -15,13 +15,10 @@
 					</view>
 				</view>
 			</u-list-item>
-			<!-- 	<u-loadmore v-if="goods" :status="loadmoreStatus" margin-top="20" @loadmore="clickLoadMore"
-				margin-bottom="50" /> -->
 		</u-list>
-		<view style="padding: 20px; display: flex;">
-			<u-button type="primary" text="市场"></u-button>
-			<u-button type="primary" text="购物车"></u-button>
-			<u-button type="primary" text="订单列表" @click="swiTap"></u-button>
+		<order v-if="active==3"></order>
+		<view class="tab">
+			<view :class="active==item.id ? 'active-btn' : 'tabBtn'" v-for="item in tabList" :key="item.id" @click="tabClick(item.id)">{{item.name}}</view>
 		</view>
 	</view>
 </template>
@@ -33,11 +30,25 @@
 				loadmoreStatus: 'loadmore',
 				goods: [],
 				active: 1,
+				title: '一级市场',
+				tabList: [
+					{
+						id: 1,
+						name: "市场"
+					},
+					{
+						id: 2,
+						name: "购物车"
+					},
+					{
+						id: 3,
+						name: "订单列表"
+					}
+				]
 			}
 		},
 		onLoad() {
 			this.getGoodsList()
-			// this.loadmore()
 		},
 		// onShow() {
 		// 	var a = document.getElementsByClassName('uni-page-head-hd')[0]
@@ -65,10 +76,19 @@
 			toDetails(id) {
 				this.$common.to('/pages/goodsDetails/goodsDetails?id=' + id)
 			},
-			swiTap() {
-				uni.navigateTo({
-					url: '/pages/order/order'
-				})
+			change(index) {
+				console.log(index)
+				this.active = index
+			},
+			tabClick(id) {
+				this.active = id
+				if(id==1) {
+					this.title='一级市场'
+				}else if(id==2) {
+					this.title='购物车'
+				} else{
+					this.title='订单列表'
+				}
 			}
 		}
 	}
@@ -112,4 +132,34 @@
 		top: 50rpx;
 		/* left: 5rpx; */
 	}
+	
+	.tab{
+		position: absolute;
+		bottom: 1rpx;
+		width: 100%;
+		height: 100rpx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		border-top: #CFCFCF 1rpx solid;
+	}
+	
+	.tabBtn{
+		width: 35%;
+		height: 100%;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		margin: 0 30rpx;
+	}
+	
+	.active-btn{
+		width: 35%; 
+		height: 100%;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		color: #fff;
+		background-color: #00BFFF;
+	}
 </style>

+ 0 - 112
pages/order/order.vue

@@ -1,112 +0,0 @@
-<template>
-	<view>
-		<u-tabs lineWidth="50" :list="list" itemStyle="height:60rpx;width: 100rpx;" :is-scroll="false" :current="current"
-			@change="change"></u-tabs>
-		<u-list style="margin-top: 10rpx" @scrolltolower="scrolltolower">
-			<u-list-item v-for="(item, index) in orderList" :key="index">
-				<view class="item-box">
-					<view class="goods-item">
-						<u-row>
-							<u-col span="10">
-								{{item.shopName}}
-							</u-col>
-							<u-col span="2" v-if="item.finishStatus">
-								已完成
-							</u-col>
-							<u-col span="2" v-else-if="item.resaleStatus">
-								转售中
-							</u-col>
-							<u-col span="2" v-else>
-								待确认
-							</u-col>
-						</u-row>
-					</view>
-					<view class="goods-item">
-						<u-row>
-							<u-col span="4">
-								<u--image :showLoading="true" :src="src" width="230rpx" height="210rpx"></u--image>
-							</u-col>
-							<u-col span="5">
-								<u--text lines="1" size="18" :text="item.goodsNames"></u--text>
-								<u--text prefixIcon="map" style="margin-top: 40rpx;" lineHeight="70" iconStyle="font-size: 20px"  lines="1" :text="item.tradeAreaName"></u--text>
-							</u-col>
-							<u-col span="3">
-								<u--text color="#FF4500" align="center" lineHeight="50" size="20" lines="1" :text="`¥${item.totalPrice}`"></u--text>
-								<u--text lines="1" align="center" :text="`${item.totalWeight}吨`"></u--text>
-							</u-col>
-						</u-row>
-					</view>
-					<view class="goods-item">
-						<u-row>
-							<u-col span="9">
-								{{item.tradeTime}}
-							</u-col>
-							<u-col span="3">
-								<u-button type="error" size="mini" text="通知商家"></u-button>
-							</u-col>
-						</u-row>
-					</view>
-				</view>
-			</u-list-item>
-		</u-list>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				list: [{
-					name: '全部'
-				}, {
-					name: '待确认'
-				}, {
-					name: '申报中'
-				}, {
-					name: '已完成'
-				}, {
-					name: '转售中'
-				}, {
-					name: '已取消'
-				}],
-				current: 0,
-				orderList: [],
-				status: 0
-			}
-		},
-		onLoad() {
-			this.getOrderList()
-		},
-		methods: {
-			change(item) {
-				this.current = item.index
-			},
-			getOrderList() {
-				this.http.request({
-					url: '/level-one-server/app/TbOrder/getList',
-					success: res => {
-						this.orderList = res.data.data;
-					}
-				});
-			}
-		}
-	}
-</script>
-
-<style lang="scss">
-	page{
-		padding: 15rpx;
-	}
-	
-	.goods-item{
-		margin-bottom: 8rpx;
-	}
-	
-	.item-box{
-		height: 300rpx;
-		padding: 10rpx;
-		border: 1rpx #888 solid;
-		margin: 10rpx 0rpx;
-		border-radius: 10rpx;
-	}
-</style>