Browse Source

一级市场的修改

李书文 1 year ago
parent
commit
df0800d10f

+ 10 - 0
common/style.scss

@@ -377,6 +377,7 @@
 	margin-top: 10px;
 	padding-bottom: 7px;
 	border-radius: 8px;
+	overflow: hidden;
 	.msn {
 		float: left;
 		width: 25%;
@@ -617,6 +618,10 @@
 				color: #abacb0;
 				font-weight: bold;
 			}
+			.del{
+				font-size: 20px;
+				color: #F44336;
+			}
 		}
 		.pic {
 			float: left;
@@ -661,6 +666,11 @@
 			border-top: 1px solid $line;
 			color: #a0a2a6;
 			padding-top: 10px;
+			overflow: hidden;
+			.date{
+				float: left;
+				margin-top: 6px;
+			}
 			.an{
 				float: right;
 				margin-left: 15px;

+ 0 - 5
components/productType/productType.vue

@@ -2,7 +2,6 @@
 	<view class="select">
 		<u-popup :show="value" @close="close()" round="15">
 			<view class="ppopup">
-				<u-divider :text="desc"></u-divider>
 				<scroll-view scroll-y="true" style="height: 350px">
 					<view class="items" v-for="(item, index) in list" :key="index" @click="check(item)">
 						<view class="check">
@@ -34,10 +33,6 @@ export default {
 			type: String,
 			default: 'province'
 		},
-		desc: {
-			type: String,
-			default: '选择发货区域'
-		},
 		multiple: {
 			type: Boolean,
 			default: false

+ 51 - 55
pages.json

@@ -280,62 +280,58 @@
 				"enablePullDownRefresh": false
 			}
 
+		}, {
+			"path": "pages/market/two/purchaser/order/list",
+			"style": {
+				"navigationBarTitleText": "订单列表",
+				"enablePullDownRefresh": true
+			}
+
+		}, {
+			"path": "pages/market/two/purchaser/order/detail",
+			"style": {
+				"navigationBarTitleText": "订单详情",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/market/one/list",
+			"style": {
+				"navigationBarTitleText": "一级市场",
+				"enablePullDownRefresh": true
+			}
+
+		}, {
+			"path": "pages/market/one/detail",
+			"style": {
+				"navigationBarTitleText": "商品详情",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/market/one/leader/order",
+			"style": {
+				"navigationBarTitleText": "订单列表",
+				"enablePullDownRefresh": true
+			}
+
+		}, {
+			"path": "pages/market/one/leader/cart",
+			"style": {
+				"navigationBarTitleText": "购物车",
+				"enablePullDownRefresh": true,
+				"app-plus": {
+					"titleNView": {
+						"buttons": [{
+							"text": "清空",
+							"fontSize": "14px"
+						}]
+					}
+				}
+			}
+
 		}
-	    ,{
-            "path" : "pages/market/two/purchaser/order/list",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "订单列表",
-                "enablePullDownRefresh": true
-            }
-            
-        }
-        ,{
-            "path" : "pages/market/two/purchaser/order/detail",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "订单详情",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/market/one/list",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "一级市场",
-                "enablePullDownRefresh": true
-            }
-            
-        }
-        ,{
-            "path" : "pages/market/one/detail",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "商品详情",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/market/one/leader/order",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "订单列表",
-                "enablePullDownRefresh": true
-            }
-            
-        }
-        ,{
-            "path" : "pages/market/one/leader/cart",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "购物车",
-                "enablePullDownRefresh": true
-            }
-            
-        }
-    ],
+	],
 	"tabBar": {
 		"color": "#7A7E83",
 		"selectedColor": "#4581fb",

+ 12 - 19
pages/market/one/detail.vue

@@ -35,7 +35,7 @@
 				<view class="contents">八角茴香是木兰科八角属的常绿乔木。树皮灰褐色或红褐色;叶互生或叶簇生于枝端;叶片革质,椭圆状倒卵</view>
 			</view>
 		</view>
-		<view class="mfooter">
+		<view class="mfooter" v-if="user.userType == 2">
 			<view class="flex">
 				<view class="f">
 					<button class="save btn" @click="addCar()">加入购物车</button>
@@ -67,28 +67,25 @@ export default {
 		}
 	},
 	methods: {
+		//加入购物车
 		addCar() {
 			let params = {
 				buyUserId: this.user.id,
-				enterpriseId: this.goods.merchantId,
-				shopId: this.goods.shopId,
-				tradeAreaId: this.goods.tradeAreaId,
-				saleGoodsInfoId: this.goods.id,
-				goodsImg: this.goods.goodsImg,
-				goodsName: this.goods.goodsName
-				// buyNum: parseInt(this.num)
+				enterpriseId: this.item.merchantId,
+				shopId: this.item.shopId,
+				tradeAreaId: this.item.tradeAreaId,
+				saleGoodsInfoId: this.item.id,
+				goodsImg: this.item.goodsImg,
+				goodsName: this.item.goodsName,
+				publishGoodsId: this.item.id
 			};
 			this.http.request({
 				url: '/level-one-server/app/TbGoodsCart/addGoodsInShopCart',
 				data: params,
-				contentType: 'application/json; charset=utf-8',
 				method: 'POST',
+				contentType: 'application/json; charset=utf-8',
 				success: res => {
-					setTimeout(function () {
-						uni.showToast({
-							title: res.data.msg
-						});
-					}, 1000);
+					uni.showToast({ title: '添加成功' });
 				}
 			});
 		},
@@ -100,11 +97,7 @@ export default {
 				method: 'POST',
 				contentType: 'application/json; charset=utf-8',
 				success: res => {
-					uni.showToast({ title: '操作成功' });
-					setTimeout(() => {
-						uni.$emit('purchaser_buy_list');
-						uni.navigateBack();
-					}, 1000);
+					uni.redirectTo({ url: '/pages/market/one/leader/success' });
 				}
 			});
 		}

+ 75 - 7
pages/market/one/leader/cart.vue

@@ -1,19 +1,87 @@
 <template>
 	<view>
-		
+		<view class="goodsList animated fadeInDown">
+			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
+				<view class="title">{{ item.shopName }}</view>
+				<view class="state" @click.stop="del(item)"><text class="icon del">&#xe852;</text></view>
+				<image src="../../../../static/news.jpg" mode="aspectFill" class="pic"></image>
+				<view class="con">
+					<view class="productName omit">{{ item.goodsName }}</view>
+					<view class="desc omit">
+						<text>{{ item.netWeight }}吨</text>
+						<text>{{ item.tradeAreaName }}</text>
+					</view>
+					<view class="price">¥ {{ item.totalPrice }}</view>
+				</view>
+				<view class="clear"></view>
+				<view class="op">
+					<view class="date">{{ item.createTime }}</view>
+					<view class="an btn" @click.stop="confirm(item.id, 1, '确认接单?')">立即够买</view>
+				</view>
+			</view>
+			<u-empty v-if="list.length == 0"></u-empty>
+		</view>
 	</view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				
-			};
+export default {
+	data() {
+		return {
+			list: []
+		};
+	},
+	onLoad() {
+		this.getData();
+	},
+	methods: {
+		getData() {
+			this.http.request({
+				url: '/level-one-server/app/TbGoodsCart/getList',
+				data: this.param,
+				success: res => {
+					this.list = res.data.data || [];
+				}
+			});
+		},
+		detail(item) {
+			uni.navigateTo({ url: '/pages/market/one/detail?id=' + item.publishGoodsId });
+		},
+		del(item) {
+			let ids = item.id || this.list.map(i => i.id);
+			uni.showModal({
+				title: '提示',
+				content: item.id ? '确定删除该购物车?' : '清空所有购物车',
+				success: res => {
+					if (res.confirm) {
+						this.http.request({
+							url: '/level-one-server/app/TbGoodsCart/cleanCart/' + ids,
+							success: res => {
+								uni.showToast({ title: '删除成功' });
+								this.getData();
+							}
+						});
+					}
+				}
+			});
 		}
+	},
+	onNavigationBarButtonTap() {
+		this.del({});
 	}
+};
 </script>
 
 <style lang="scss">
-
+page {
+	background-color: $pg;
+}
+.date {
+}
+.an {
+	padding: 6px 15px;
+	font-size: 14px;
+	margin-top: 0px !important;
+	font-weight: normal !important;
+}
 </style>

+ 124 - 7
pages/market/one/leader/order.vue

@@ -1,19 +1,136 @@
 <template>
 	<view>
-		
+		<view class="tab">
+			<u-tabs :list="tab" @click="click" :lineHeight="5"></u-tabs>
+		</view>
+		<view class="goodsList">
+			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
+				<view class="title">广西京东自营店南宁分店</view>
+				<view class="state" v-if="item.enterpriseConfirm == 0">
+					<text class="icon">&#xe830;</text>
+					<text>待确认</text>
+				</view>
+				<view class="state" v-if="item.enterpriseConfirm == 1">
+					<text class="icon" style="color: #13ce66">&#xe830;</text>
+					<text>已确认</text>
+				</view>
+				<view class="state" v-if="item.enterpriseConfirm == 2">
+					<text class="icon" style="color: #f44336">&#xe622;</text>
+					<text>已拒绝</text>
+				</view>
+				<image src="../../../../static/news.jpg" mode="aspectFill" class="pic"></image>
+				<view class="con">
+					<view class="productName omit">越南巴沙鱼</view>
+					<view class="desc omit">
+						<text>50吨</text>
+						<text>{{ item.tradeAreaName }}</text>
+					</view>
+					<view class="price">¥ {{ item.price }}</view>
+				</view>
+				<view class="clear"></view>
+				<view class="op">
+					<view class="date">2022-12-12:12:12</view>
+					<template v-if="item.enterpriseConfirm == 0">
+						<view class="an" style="color: #f44336" @click.stop="confirm(item.id, 2, '确认拒绝?')">取消订单</view>
+						<view class="an" style="color: #4581fb" @click.stop="confirm(item.id, 1, '确认接单?')">确认订单</view>
+					</template>
+				</view>
+			</view>
+			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
+			<u-empty v-if="!loadMore && list.length == 0"></u-empty>
+		</view>
 	</view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				
-			};
+export default {
+	data() {
+		return {
+			tab: [
+				{ name: '全部', enterpriseConfirm: '' },
+				{ name: '待确认', enterpriseConfirm: 0 },
+				{ name: '申报中', enterpriseConfirm: 1 },
+				{ name: '已完成', enterpriseConfirm: 2 },
+				{ name: '转售中', enterpriseConfirm: 2 },
+				{ name: '已取消', enterpriseConfirm: 2 }
+			],
+			param: { pageNo: 1, pageSize: 10},
+			list: [],
+			loadMore: true
+		};
+	},
+	onLoad() {
+		this.getData();
+	},
+	methods: {
+		getData() {
+			this.http.request({
+				url: '/level-one-server/app/TbOrder/getList',
+				loading: 'false',
+				data: this.param,
+				success: res => {
+					this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
+					if(res.data.data){
+						this.list.push(...res.data.data);
+					}
+				}
+			});
+		},
+		//点击tab切换
+		click(e) {
+			this.param.enterpriseConfirm = e.enterpriseConfirm;
+			this.refresh();
+		},
+		detail(item) {
+			uni.navigateTo({ url: '/pages/market/one/merchant/order/detail?id=' + item.id });
+		},
+		//刷新数据
+		refresh() {
+			this.loadMore = true;
+			this.param.pageNo = 1;
+			this.list = [];
+			this.getData();
+		},
+		//通知商家
+		confirm(item) {
+			uni.showModal({
+				title: '提示',
+				content:'是否确认通知商家?',
+				success: res => {
+					if (res.confirm) {
+						this.http.request({
+							url: '/level-one-server/app/TbGoodsTransit/update',
+							data: { id: id, enterpriseConfirm: status },
+							method: 'POST',
+							success: resp => {
+								uni.showToast({ title: '操作成功' });
+								this.refresh();
+							}
+						});
+					}
+				}
+			});
+		}
+	},
+	//下拉刷新
+	onPullDownRefresh() {
+		setTimeout(() => {
+			this.refresh();
+			uni.stopPullDownRefresh();
+		}, 1000);
+	},
+	//上拉加载
+	onReachBottom() {
+		if (this.loadMore) {
+			this.param.pageNo++;
+			this.getData();
 		}
 	}
+};
 </script>
 
 <style lang="scss">
-
+page {
+	background-color: $pg;
+}
 </style>

+ 5 - 3
pages/market/one/list.vue

@@ -31,6 +31,8 @@
 				</view>
 				<view class="clear"></view>
 			</view>
+			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
+			<u-empty v-if="!loadMore && list.length == 0"></u-empty>
 		</view>
 	</view>
 </template>
@@ -62,7 +64,7 @@ export default {
 				}
 			],
 			list: [],
-			param: { pageNo: 1, pageSize: 10 },
+			param: { pageNo: 1, pageSize: 10, },
 			loadMore: true
 		};
 	},
@@ -90,8 +92,8 @@ export default {
 				tradeAreaId: goods.tradeAreaId,
 				saleGoodsInfoId: goods.id,
 				goodsImg: goods.goodsImg,
-				goodsName: goods.goodsName
-				// buyNum: parseInt(this.num)
+				goodsName: goods.goodsName,
+				publishGoodsId: goods.id
 			};
 			this.http.request({
 				url: '/level-one-server/app/TbGoodsCart/addGoodsInShopCart',

+ 40 - 11
pages/personal/personal.vue

@@ -20,9 +20,9 @@
 				<text class="icon edit">&#xe645;</text>
 				<view class="clear"></view>
 			</view>
-			<!--菜单-->
-			<view class="menu">
-				<view class="msn" @click="go()" v-if="user.userType == 2">
+			<!--组长菜单-->
+			<view class="menu" v-if="user.userType == 2">
+				<view class="msn" @click="go('/pages/market/one/leader/cart')">
 					<view class="out">
 						<view class="int">
 							<view class="icon ioc" style="background-color: #fff6e0; color: #f1ba41">&#xe604;</view>
@@ -30,7 +30,26 @@
 						</view>
 					</view>
 				</view>
-				<view class="msn" @click="go('/pages/market/one/merchant/goods/list')" v-if="user.userType == 3">
+				<view class="msn" @click="go('/pages/market/one/leader/order')">
+					<view class="out">
+						<view class="int">
+							<view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
+							<view class="tit">一级订单</view>
+						</view>
+					</view>
+				</view>
+				<view class="msn" @click="go('/pages/market/two/leader/order')">
+					<view class="out">
+						<view class="int">
+							<view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
+							<view class="tit">二级订单</view>
+						</view>
+					</view>
+				</view>
+			</view>
+			<!--外籍商户-->
+			<view class="menu" v-if="user.userType == 3">
+				<view class="msn" @click="go('/pages/market/one/merchant/goods/list')">
 					<view class="out">
 						<view class="int">
 							<view class="icon ioc" style="background-color: #e1f6e9; color: #47cf74">&#xe634;</view>
@@ -38,15 +57,26 @@
 						</view>
 					</view>
 				</view>
-				<view class="msn" @click="go('/pages/market/two/purchaser/buy/list')" v-if="user.userType == 4">
+				<view class="msn" @click="go('/pages/market/one/merchant/order/list')">
 					<view class="out">
 						<view class="int">
-							<view class="icon ioc" style="background-color: #eaf1fe; color: #2a95fe">&#xe64f;</view>
+							<view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
+							<view class="tit">我的订单</view>
+						</view>
+					</view>
+				</view>
+			</view>
+			<!--收购商-->
+			<view class="menu" v-if="user.userType == 4">
+				<view class="msn" @click="go('/pages/market/two/purchaser/buy/list')">
+					<view class="out">
+						<view class="int">
+							<view class="icon ioc" style="background-color: #e1f6e9; color: #47cf74">&#xe634;</view>
 							<view class="tit">收购管理</view>
 						</view>
 					</view>
 				</view>
-				<view class="msn" @click="order()">
+				<view class="msn" @click="go('/pages/market/two/purchaser/order/list')">
 					<view class="out">
 						<view class="int">
 							<view class="icon ioc" style="background-color: #f0dcfc; color: #b064d8">&#xe628;</view>
@@ -54,7 +84,6 @@
 						</view>
 					</view>
 				</view>
-				<view class="clear"></view>
 			</view>
 			<view class="cmd">
 				<view class="s_item" @click="show = true">
@@ -106,15 +135,15 @@ export default {
 		order() {
 			//组长
 			if (this.user.userType == 2) {
-				uni.navigateTo({url: '/pages/market/one/merchant/order/list'});
+				uni.navigateTo({ url: 'user' });
 			}
 			//外籍商户
 			if (this.user.userType == 3) {
-				uni.navigateTo({url: '/pages/market/one/merchant/order/list'});
+				uni.navigateTo({ url: '/pages/market/one/merchant/order/list' });
 			}
 			//外籍商户
 			if (this.user.userType == 4) {
-				uni.navigateTo({url: '/pages/market/two/purchaser/order/list'});
+				uni.navigateTo({ url: '/pages/market/two/purchaser/order/list' });
 			}
 		},
 		go(url) {