Browse Source

二级市场接口对接

mym 1 year ago
parent
commit
09b3570f9c

+ 15 - 0
pages/index/index.vue

@@ -123,6 +123,21 @@ export default {
 			});
 			});
 		},
 		},
 		navTo(url) {
 		navTo(url) {
+			let info = this.getUser()
+			if(info.userType == 4 && url=='/pages/market/one/list'){
+				uni.showToast({
+					title: '您当前无权限查看该选项',
+					icon:'none',
+				})
+				return;
+			}
+			if(info.userType == 3 && url=='/pages/market/two/list'){
+				uni.showToast({
+					title: '您当前无权限查看该选项',
+					icon:'none',
+				})
+				return;
+			}
 			uni.navigateTo({
 			uni.navigateTo({
 				url: url,
 				url: url,
 				fail: res => {
 				fail: res => {

+ 0 - 1
pages/login/login.vue

@@ -63,7 +63,6 @@ export default {
 				method: 'POST',
 				method: 'POST',
 				success: resp => {
 				success: resp => {
 					let data = resp.data.data;
 					let data = resp.data.data;
-					console.log(data);
 					uni.setStorageSync('token', data.tokenInfo.tokenValue);
 					uni.setStorageSync('token', data.tokenInfo.tokenValue);
 					uni.setStorageSync('info', data.appUser);
 					uni.setStorageSync('info', data.appUser);
 					uni.setStorageSync('menu', data.per_list);
 					uni.setStorageSync('menu', data.per_list);

+ 7 - 7
pages/market/two/detail.vue

@@ -44,7 +44,7 @@
 		<view class="mfooter">
 		<view class="mfooter">
 			<view class="flex">
 			<view class="flex">
 				<view class="f">
 				<view class="f">
-					<button class="btn" @click="pay()">立即接单</button>
+					<button class="btn" v-if="user.userType !== 5" @click="pay()">立即接单</button>
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
@@ -61,12 +61,12 @@ export default {
 	},
 	},
 	onLoad(e) {
 	onLoad(e) {
 		if (e.id) {
 		if (e.id) {
-			/* this.http.request({
-				url: '/level-one-server/app/TbPortNews/getPortNewsDetails?id=' + e.id,
-				success: res => {
-					this.content = res.data.data;
-				}
-			}); */
+			// this.http.request({
+			// 	url: '/level-two-server/app/TbGoodsDemand/getById?id=' + e.id,
+			// 	success: res => {
+			// 		this.content = res.data.data;
+			// 	}
+			// });
 		}
 		}
 	},
 	},
 	methods: {
 	methods: {

+ 19 - 8
pages/market/two/list.vue

@@ -18,13 +18,14 @@
 				<view class="clear"></view>
 				<view class="clear"></view>
 			</view>
 			</view>
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
 			<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
-				<view class="title">广西京东自营店南宁分店</view>
+				<view class="title">{{item.createName}}</view>
+				<!-- <image :src="item.goodsImg" mode="aspectFill" class="pic"></image> -->
 				<image src="../../../static/news.jpg" mode="aspectFill" class="pic"></image>
 				<image src="../../../static/news.jpg" mode="aspectFill" class="pic"></image>
 				<view class="con">
 				<view class="con">
-					<view class="productName omit">八角茴香(未磨)(可食用)</view>
-					<view class="desc">50吨</view>
-					<view class="price">¥ 5000</view>
-					<view class="icon buy" v-if="user.userType == 2">&#xe604;</view>
+					<view class="productName omit">{{item.goodsName}}</view>
+					<view class="desc">{{item.goodsQuantity}}吨</view>
+					<!-- <view class="price">¥ 5000</view> -->
+					<view class="btn" v-if="user.userType == 2">立即接单</view>
 				</view>
 				</view>
 				<view class="clear"></view>
 				<view class="clear"></view>
 			</view>
 			</view>
@@ -40,18 +41,18 @@ export default {
 			user: this.getUser(),
 			user: this.getUser(),
 			show: false,
 			show: false,
 			sort: [{ name: '综合' }, { name: '日期' }, { name: '价格' }],
 			sort: [{ name: '综合' }, { name: '日期' }, { name: '价格' }],
-			list: [{}, {}, {}, {}],
+			list: [],
 			param: { pageNo: 1, pageSize: 10 },
 			param: { pageNo: 1, pageSize: 10 },
 			loadMore: true
 			loadMore: true
 		};
 		};
 	},
 	},
 	onLoad(e) {
 	onLoad(e) {
-		//this.getData();
+		this.getData();
 	},
 	},
 	methods: {
 	methods: {
 		getData() {
 		getData() {
 			this.http.request({
 			this.http.request({
-				url: '/level-one-server/app/TbGoodsTransit/getTransitList',
+				url: '/level-two-server/app/TbGoodsDemand/getAppList',
 				data: this.param,
 				data: this.param,
 				loading: 'false',
 				loading: 'false',
 				success: res => {
 				success: res => {
@@ -95,4 +96,14 @@ page {
 .search {
 .search {
 	padding: 12px 12px 0px 12px;
 	padding: 12px 12px 0px 12px;
 }
 }
+.btn{
+	width: 120rpx;
+	height: 40rpx;
+	background-color: #fff;
+	color: #000;
+	border: #B5B5B5 1px solid;
+	position: relative;
+	left: 340rpx;
+	font-size: 14px;
+}
 </style>
 </style>

+ 36 - 6
pages/market/two/purchaser/buy/list.vue

@@ -44,19 +44,20 @@ export default {
 		return {
 		return {
 			tab: [
 			tab: [
 				{ name: '全部', goodsStatus: '' },
 				{ name: '全部', goodsStatus: '' },
-				{ name: '待发布', goodsStatus: 1 },
-				{ name: '发布中', goodsStatus: 0 },
-				{ name: '已接单', goodsStatus: 0 },
-				{ name: '已确认', goodsStatus: 0 },
-				{ name: '已完成', goodsStatus: 0 }
+				{ name: '未报价', goodsStatus: 1 },
+				{ name: '已报价', goodsStatus: 0 },
+				// { name: '已接单', goodsStatus: 0 },
+				// { name: '已确认', goodsStatus: 0 },
+				// { name: '已完成', goodsStatus: 0 }
 			],
 			],
 			list: [{}, {}, {}, {}, {}],
 			list: [{}, {}, {}, {}, {}],
-			param: { pageNo: 1, pageSize: 10 },
+			param: { pageNo: 1, pageSize: 10, isOrders: 0 },
 			loadMore: true
 			loadMore: true
 		};
 		};
 	},
 	},
 	onLoad(e) {
 	onLoad(e) {
 		//this.getData();
 		//this.getData();
+		this.goodsDemandList()
 	},
 	},
 	methods: {
 	methods: {
 		getData() {
 		getData() {
@@ -70,6 +71,35 @@ export default {
 				}
 				}
 			});
 			});
 		},
 		},
+		//当前已被报价的需求列表
+		goodsDemandList() {
+			this.http.request({
+				url: '/level-two-server/app/TbGoodsDemand/goodsDemandList',
+				data: this.param,
+				loading: 'false',
+				success: res => {
+					this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
+					// this.list.push(...res.data.data);
+				}
+			});
+		},
+		//处理已被报价的需求
+		disposeOrders() {
+			let params = {
+				disposeStatus: 1,
+				goodsDemandId: 1,
+				demandQuotationId: 1
+			}
+			this.http.request({
+				url: '/level-two-server/app/TbGoodsDemand/disposeOrders',
+				data: params,
+				loading: 'false',
+				success: res => {
+					this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
+					// this.list.push(...res.data.data);
+				}
+			});
+		},
 		//点击tab切换
 		//点击tab切换
 		click(e) {
 		click(e) {
 			this.param.goodsStatus = e.goodsStatus;
 			this.param.goodsStatus = e.goodsStatus;

+ 1 - 1
pages/market/two/purchaser/order/list.vue

@@ -59,7 +59,7 @@ export default {
 	methods: {
 	methods: {
 		getData() {
 		getData() {
 			this.http.request({
 			this.http.request({
-				url: '/level-one-server/app/TbGoodsTransit/getTransitList',
+				url: '/level-two-server/app/TbOrders/getList',
 				loading: 'false',
 				loading: 'false',
 				data: this.param,
 				data: this.param,
 				success: res => {
 				success: res => {

+ 5 - 5
pages/personal/personal.vue

@@ -14,8 +14,8 @@
 					<view class="tag" v-if="user.userType == 1">普通边民</view>
 					<view class="tag" v-if="user.userType == 1">普通边民</view>
 					<view class="tag" v-if="user.userType == 2">互市组长</view>
 					<view class="tag" v-if="user.userType == 2">互市组长</view>
 					<view class="tag" v-if="user.userType == 3">外籍商户</view>
 					<view class="tag" v-if="user.userType == 3">外籍商户</view>
-					<view class="tag" v-if="user.userType == 4">收购商</view>
-					<view class="tag" v-if="user.userType == 1">司机</view>
+					<view class="tag" v-if="user.userType == 4">司机</view>
+					<view class="tag" v-if="user.userType == 5">收购商</view>
 				</view>
 				</view>
 				<text class="icon edit">&#xe645;</text>
 				<text class="icon edit">&#xe645;</text>
 				<view class="clear"></view>
 				<view class="clear"></view>
@@ -67,7 +67,7 @@
 				</view>
 				</view>
 			</view>
 			</view>
 			<!--收购商-->
 			<!--收购商-->
-			<view class="menu" v-if="user.userType == 4">
+			<view class="menu" v-if="user.userType == 5">
 				<view class="msn" @click="go('/pages/market/two/purchaser/buy/list')">
 				<view class="msn" @click="go('/pages/market/two/purchaser/buy/list')">
 					<view class="out">
 					<view class="out">
 						<view class="int">
 						<view class="int">
@@ -149,8 +149,8 @@ export default {
 			if (this.user.userType == 3) {
 			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) {
+			//收购商
+			if (this.user.userType == 5) {
 				uni.navigateTo({ url: '/pages/market/two/purchaser/order/list' });
 				uni.navigateTo({ url: '/pages/market/two/purchaser/order/list' });
 			}
 			}
 		},
 		},