Parcourir la source

Merge branch 'master' of http://git.aseanbusiness.cn/qzyReal/market-app-ui

# Conflicts:
#	pages/oneMarket/oneMarket.vue
mym il y a 1 an
Parent
commit
1989a3c12d

+ 0 - 112
components/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;padding: 15rpx;" @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>

+ 29 - 2
pages.json

@@ -95,8 +95,26 @@
 		},{
 			"path": "pages/goodsManage/oneMarket/goodsHandle",
 			"style": {
-				"navigationBarTitleText": "商品管理",
-				"enablePullDownRefresh": true
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": true,
+				"navigationStyle": "custom",
+				"app-plus": {
+					"titleNView": {
+						"autoBackButton": false
+					}
+				}
+				/*"app-plus": {
+					"titleNView": {
+						"buttons": [{
+							"text": "新增商品",
+							"type": "none",
+							"color": "#fff",
+							"fontSize": "15px",
+							"float": "right",
+							"width": "80px"
+						}]
+					}
+				} */
 			}
 		},
 		{
@@ -228,6 +246,15 @@
             }
             
         }
+        ,{
+            "path" : "pages/goodsManage/oneMarket/goodsOrders",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "订单列表",
+                "enablePullDownRefresh": true
+            }
+            
+        }
     ],
 	"tabBar": {
 		"color": "#7A7E83",

+ 1 - 1
pages/goodsManage/oneMarket/editGoods.vue

@@ -79,7 +79,7 @@
 			// 获取商品详情
 			getGoodsTransitDetail(){
 				this.http.request({
-					url: '/level-one-server/app/TbGoodsTransit/update',
+					url: '/level-one-server/app/TbGoodsTransit/getById',
 					method:'POST',
 					data: {id:this.id},
 					success: res => {

+ 116 - 157
pages/goodsManage/oneMarket/goodsHandle.vue

@@ -1,51 +1,51 @@
 <template>
 	<view>
-		<navigation-bar :title="title" background-color="#fff" front-color="#000000" />
-
-		<u-button v-if="active==1" style="width: 20%;margin-left: 6px;" type="primary" @click="addGoods()">新增商品</u-button>
-		<u-list v-if="active==1" class="list" width="100%" @scrolltolower="scrolltolower1">
+		<uni-nav-bar color="#fff" height="60" left-icon="back" @clickLeft="back()" @clickRight="rightClick()"
+			 right-text="新增商品" :border="false" backgroundColor="#0081ff" title="商品管理" />
+		</u-navbar>
+		
+		<u-list 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">
-						<image
-							src="https://img11.360buyimg.com/n7/jfs/t1/94448/29/2734/524808/5dd4cc16E990dfb6b/59c256f85a8c3757.jpg"
-							mode="aspectFill" class="img">
-						</image>
-						<view class="txt">
-							<view style="font-size: 30rpx;height: 140rpx;">{{item.goodsName}}</view>
-							<view class="piece">{{item.price}} 元</view>
-						</view>
-						<u-button class="custom-style" type="primary" @click="editGoods(item.id)">编辑</u-button>
-						<u-button class="custom-style" type="error" @click.stop="deleteGoods(item.id)">删除</u-button>
+				<view class="item-box">
+					<view class="goods-item">
+						<u-row>
+							<u-col span="5" @click="toDetails(item.id)">
+								<u--image :showLoading="true" src="" width="270rpx" height="220rpx"></u--image>
+							</u-col>
+							<u-col span="7">
+								<view class="t1 txt" @click="toDetails(item.id)">
+									<text>{{item.goodsName}}</text>
+								</view>
+								<view class="txt">
+									<text v-if="item.grossWeight">{{item.grossWeight}}吨</text>
+								</view>
+								<view class="txt" v-if="item.tradeAreaName">
+									<u-tag style="width: 250rpx" :text="item.tradeAreaName" plain size="mini"></u-tag>
+								</view>
+								<view class="t4">
+									<view class="price">¥{{item.price}}</view>
+									<view class="edit" @click="editGoods(item.id)">
+										<u-icon color="#fff" name="edit-pen-fill" size="30"></u-icon>
+									</view>
+									<view class="delete" @click="deleteGoods(item.id)">
+										<u-icon color="#fff" name="warning-fill" size="30"></u-icon>
+									</view>
+								</view>
+							</u-col>
+						</u-row>
 					</view>
 				</view>
 			</u-list-item>
-			<u-loadmore v-if="goods" :status="loadmoreStatus" margin-top="20" @loadmore="clickLoadMore" margin-bottom="50" />
 		</u-list>
-
-		<u-list v-if="active==2" class="list" width="100%" @scrolltolower="scrolltolower2">
-			<u-list-item v-for="(item, index) in orders" :key="index">
-				<view class="card" ><!-- @click="toDetails(item.id)" -->
-					<view class="card-body">
-						<image
-							src="https://img11.360buyimg.com/n7/jfs/t1/94448/29/2734/524808/5dd4cc16E990dfb6b/59c256f85a8c3757.jpg"
-							mode="aspectFill" class="img">
-						</image>
-						<view class="txt">
-							<view style="font-size: 30rpx;height: 140rpx;">{{item.goodsName}}</view>
-							<view class="piece">{{item.price}} 元</view>
-						</view>
-						<u-button class="custom-style" type="primary" @click="orderConfirm(item.id,1)">确认</u-button>
-						<u-button class="custom-style" type="warning" @click="orderConfirm(item.id,2)">拒绝</u-button>
-					</view>
-				</view>
-			</u-list-item>
-			<u-loadmore v-if="orders" :status="loadmoreStatus" margin-top="20" @loadmore="clickLoadMore" margin-bottom="50" />
-		</u-list>
-
-		<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 class="tabBtn" @click="BtnClick(1)">
+				<u-icon label="商品列表" size="30" color="#ef732a" labelColor="#ef732a" name="shopping"></u-icon>
+			</view> -->
+			<view class="tabBtn" @click="BtnClick()">
+				<u-icon label="订单列表" size="30" color="#1E90FF" labelColor="#1E90FF" name="order"></u-icon>
+			</view>
 		</view>
 	</view>
 </template>
@@ -59,18 +59,7 @@
 				goods: [],
 				orders: [],
 				item: {},
-				active: 1,
-				title: '商品管理',
-				tabList: [
-					{
-						id: 1,
-						name: "商品列表"
-					},
-					{
-						id: 2,
-						name: "订单列表"
-					}
-				],
+				
 
 			}
 		},
@@ -114,139 +103,118 @@
 					}
 				});
 			},
-			// 新增商品
-			addGoods() {
-				this.$common.to('/pages/goodsManage/oneMarket/addGoods')
-			},
 			// 编辑商品
 			editGoods(id) {
 				this.$common.to('/pages/goodsManage/oneMarket/editGoods?id='+id)
 			},
-			scrolltolower1() {
+			scrolltolower() {
 				this.getTransitList()
 			},
-
-			// 订单列表
-			getOrderTransitList() {
-				this.form = {
-					isOrders: 1,//是否已被下单[0=未被下单,1=已被下单]
-					enterpriseConfirm: 0,//商铺确认情况[0=待确认,1=已确认,2=拒绝]
-					goodsStatus: 1,//商品状态(0=下架,1=在售)
-				}
-				this.http.request({
-					url: '/level-one-server/app/TbGoodsTransit/getTransitList',
-					data: this.form,
-					method: 'POST',
-					success: resp => {
-						console.log('resp',resp)
-						this.orders = resp.data.data;
-						/* this.orders.forEach((item, index) => {
-							if (index === this.orders.length - 1) {
-								this.loadmoreStatus = 'nomore'
-							} else {
-								this.loadmoreStatus = 'loadmore'
-							}
-						}) */
-					}
-				});
+			BtnClick(type) {
+				uni.navigateTo({
+					url: '/pages/goodsManage/oneMarket/goodsOrders'
+				})
 			},
-			// 商家确认
-			orderConfirm(id,status) {
-				this.form = {
-					id: id,
-					//isOrders: 0,//是否已被下单[0=未被下单,1=已被下单]
-					enterpriseConfirm: status,//商铺确认情况[0=待确认,1=已确认,2=拒绝]
-					//goodsStatus: 1,//商品状态(0=下架,1=在售)
-				}
-				this.http.request({
-					url: '/level-one-server/app/TbGoodsTransit/update',
-					data: this.form,
-					method: 'POST',
-					success: resp => {
-						console.log('resp',resp)
-						uni.showToast({ title: '操作成功' });
-					}
+			back() {
+				uni.switchTab({
+					url: '/pages/index/index'
 				});
 			},
-			scrolltolower2() {
-				this.getTransitList()
+			rightClick() {
+				this.$common.to('/pages/goodsManage/oneMarket/addGoods')
 			},
 
-
-
-			change(index) {
-				console.log(index)
-				this.active = index
-			},
-			tabClick(id) {
-				this.active = id
-				if(id==1) {
-					this.title='商品管理'
-					this.getTransitList()
-				}else if(id==2) {
-					this.title='订单确认'
-					this.getOrderTransitList()
-				}
-			}
-		}
+			
+		}/* ,
+		onNavigationBarButtonTap(e) { //导航栏新增商品按钮
+			this.$common.to('/pages/goodsManage/oneMarket/addGoods')
+		} */
 	}
 </script>
 
-<style>
-	.custom-style {
-		width: 20%;
-		height: 100rpx;
-		font-size: 20rpx;
-	}
+<style lang="scss">
+
 	.list {
-		height: 90%;
+		height: auto;
 		border-radius: 10rpx;
-		background-color: #fff;
+		margin: 15rpx;
 	}
 
-	.card {
-		padding: 10rpx;
+	.goods-item {
+		margin-bottom: 8rpx;
 	}
 
-	.card-body {
-		display: flex;
-		height: 300rpx;
-		width: 100%;
-		/* border: #888 1rpx solid; */
-		box-shadow:  1rpx 1rpx #888;
+	.item-box {
+		height: 230rpx;
+		width: 90%;
+		padding: 20rpx;
+		background-color: #fff;
+		border: 1rpx #FFF solid;
+		margin: 10rpx 0rpx;
 		border-radius: 10rpx;
 	}
 
-	.img {
-		height: 300rpx;
-		width: 300rpx;
-		margin-right: 10rpx;
+	.txt {
+		/* height: 50rpx; */
+		margin-bottom: 20rpx;
 	}
 
-	.txt {
-		padding: 10rpx;
-		width: 300rpx;
+	.t1 {
+		font-size: 32rpx;
+		font-weight: bold;
+		word-wrap: break-word;
+		position: relative;
+		top: 1rpx;
+		right: 5rpx;
 	}
 
-	.piece {
-		margin: 50rpx 10rpx;
-		color: red;
+	.t4 {
+		display: flex;
 		position: relative;
-		top: 50rpx;
-		/* left: 5rpx; */
+		bottom: 1rpx;
+		right: 5rpx;
+	}
+	
+	.price {
+		color: #ef732a;
+		width: 400rpx;
+		font-weight: bold;
 	}
-	.tab{
-		position: absolute;
+
+	.edit {
+		background-color: #0081ff;
+		width: 60rpx;
+		height: 60rpx;
+		border-radius: 30rpx;
+		text-align: center;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+	.delete {
+		background-color: indianred;
+		width: 60rpx;
+		height: 60rpx;
+		border-radius: 30rpx;
+		text-align: center;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+	.tab {
+		position: fixed;
 		bottom: 1rpx;
 		width: 100%;
 		height: 100rpx;
 		display: flex;
 		align-items: center;
 		justify-content: center;
-		border-top: #CFCFCF 1rpx solid;
+		border-top: #ffffff 1rpx solid;
+		background-color: #ffffff;
 	}
+	
 
-	.tabBtn{
+	.tabBtn {
 		width: 35%;
 		height: 100%;
 		display: flex;
@@ -254,13 +222,4 @@
 		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>

+ 173 - 0
pages/goodsManage/oneMarket/goodsOrders.vue

@@ -0,0 +1,173 @@
+<template>
+	<view>
+		
+		<u-list class="list" width="100%" @scrolltolower="scrolltolower">
+			<u-list-item v-for="(item, index) in orders" :key="index">
+				<view class="item-box">
+					<view class="goods-item">
+						<u-row>
+							<u-col span="5" @click="toDetails(item.id)">
+								<u--image :showLoading="true" src="" width="270rpx" height="220rpx"></u--image>
+							</u-col>
+							<u-col span="7">
+								<view class="t1 txt" @click="toDetails(item.id)">
+									<text>{{item.goodsName}}</text>
+								</view>
+								<view class="txt">
+									<text v-if="item.grossWeight">{{item.grossWeight}}吨</text>
+								</view>
+								<view class="txt" v-if="item.tradeAreaName">
+									<u-tag style="width: 250rpx" :text="item.tradeAreaName" plain size="mini"></u-tag>
+								</view>
+								<view class="t4">
+									<view class="price">¥{{item.price}}</view>
+									<!-- 接受 商铺确认情况[0=待确认,1=已确认,2=拒绝]-->
+									<view class="edit" @click="orderConfirm(item.id,1)">
+										<u-icon color="#fff" name="edit-pen-fill" size="30"></u-icon>
+									</view>
+									<!-- 拒绝 -->
+									<view class="delete" @click="orderConfirm(item.id,2)">
+										<u-icon color="#fff" name="edit-pen-fill" size="30"></u-icon>
+									</view>
+								</view>
+							</u-col>
+						</u-row>
+					</view>
+				</view>
+			</u-list-item>
+		</u-list>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				loadmoreStatus: 'loadmore',
+				form: {},
+				orders: [],
+			}
+		},
+		onLoad() {
+			this.getOrderTransitList()
+		},
+		methods: {
+			// 订单列表
+			getOrderTransitList() {
+				this.form = {
+					isOrders: 1,//是否已被下单[0=未被下单,1=已被下单]
+					enterpriseConfirm: 0,//商铺确认情况[0=待确认,1=已确认,2=拒绝]
+					goodsStatus: 1,//商品状态(0=下架,1=在售)
+				}
+				this.http.request({
+					url: '/level-one-server/app/TbGoodsTransit/getTransitList',
+					data: this.form,
+					method: 'POST',
+					success: resp => {
+						console.log('resp',resp)
+						this.orders = resp.data.data;
+						this.orders.forEach((item, index) => {
+							if (index === this.orders.length - 1) {
+								this.loadmoreStatus = 'nomore'
+							} else {
+								this.loadmoreStatus = 'loadmore'
+							}
+						})
+					}
+				});
+			},
+			// 商家确认
+			orderConfirm(id,status) {
+				this.form = {
+					id: id,
+					//isOrders: 0,//是否已被下单[0=未被下单,1=已被下单]
+					enterpriseConfirm: status,//商铺确认情况[0=待确认,1=已确认,2=拒绝]
+					//goodsStatus: 1,//商品状态(0=下架,1=在售)
+				}
+				this.http.request({
+					url: '/level-one-server/app/TbGoodsTransit/update',
+					data: this.form,
+					method: 'POST',
+					success: resp => {
+						console.log('resp',resp)
+						uni.showToast({ title: '操作成功' });
+					}
+				});
+			},
+			scrolltolower() {
+				this.getOrderTransitList()
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.list {
+		height: auto;
+		border-radius: 10rpx;
+		margin: 15rpx;
+	}
+
+	.goods-item {
+		margin-bottom: 8rpx;
+	}
+
+	.item-box {
+		height: 230rpx;
+		width: 90%;
+		padding: 20rpx;
+		background-color: #fff;
+		border: 1rpx #FFF solid;
+		margin: 10rpx 0rpx;
+		border-radius: 10rpx;
+	}
+
+	.txt {
+		/* height: 50rpx; */
+		margin-bottom: 20rpx;
+	}
+
+	.t1 {
+		font-size: 32rpx;
+		font-weight: bold;
+		word-wrap: break-word;
+		position: relative;
+		top: 1rpx;
+		right: 5rpx;
+	}
+
+	.t4 {
+		display: flex;
+		position: relative;
+		bottom: 1rpx;
+		right: 5rpx;
+	}
+	
+	.price {
+		color: #ef732a;
+		width: 400rpx;
+		font-weight: bold;
+	}
+
+	.edit {
+		background-color: #0081ff;
+		width: 60rpx;
+		height: 60rpx;
+		border-radius: 30rpx;
+		text-align: center;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+	.delete {
+		background-color: indianred;
+		width: 60rpx;
+		height: 60rpx;
+		border-radius: 30rpx;
+		text-align: center;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+</style>