Эх сурвалжийг харах

二级市场收购商发布需求列表修改

linbl 1 жил өмнө
parent
commit
294a9ca4bc

+ 20 - 4
pages/market/two/purchaser/buy/detail.vue

@@ -8,10 +8,14 @@
 						<text class="icon">&#xe830;</text>
 						<text>未接单</text>
 					</text>
-					<text class="desc" v-else>
+					<text class="desc" v-if="item.isOrders == 1">
 						<text class="icon" style="color: #13ce66">&#xe830;</text>
 						<text>已接单</text>
 					</text>
+					<text class="desc" v-if="item.isConfirm == 1">
+						<text class="icon" style="color: #13ce66">&#xe830;</text>
+						<text>已确认</text>
+					</text>
 				</view>
 			</view>
 			<view class="box order_detail">
@@ -48,8 +52,8 @@
 					<text class="desc">{{ item.createTime }}</text>
 				</view>
 			</view>
-			<button class="btn">同意接单并支付</button>
-			<button class="btn" style="background-color: #F44336;">拒绝接单</button>
+			<button class="btn" @click.stop="confirm()" v-if="item.isConfirm != 1">同意接单并支付</button>
+			<button class="btn" style="background-color: #F44336;" v-if="item.isConfirm != 1">拒绝接单</button>
 		</view>
 	</view>
 </template>
@@ -71,7 +75,19 @@ export default {
 			});
 		}
 	},
-	methods: {}
+	methods: {
+		confirm() {
+			this.http.request({
+				url: '/level-two-server/app/TbOrders/add',
+				data: this.item,
+				success: res => {
+					uni.showToast({ title: '操作成功' });
+					// 收购商已确认
+					this.item.isConfirm = 1
+				}
+			});
+		}
+	}
 };
 </script>
 

+ 13 - 11
pages/market/two/purchaser/buy/list.vue

@@ -8,8 +8,9 @@
 				<view class="top">
 					<view class="title omit">{{ item.goodsName }}</view>
 					<view class="state" v-if="item.isRelease == 0" @click.stop="del(item)" style="color: #f44336">删除</view>
-					<view class="state" style="color: #4581fb" v-if="item.isRelease == 1 && item.isOrders == 0">发布中</view>
-					<view class="state" style="color: #4caf50" v-if="item.isRelease == 1 && item.isOrders == 1">已接单</view>
+					<view class="state" style="color: #4581fb" v-if="item.isRelease == 1 && item.isOrders == 0 && item.isConfirm == 0">发布中</view>
+					<view class="state" style="color: #4caf50" v-if="item.isRelease == 1 && item.isOrders == 1 && item.isConfirm == 0">已接单</view>
+					<view class="state" style="color: #4caf50" v-if="item.isRelease == 1 && item.isOrders == 1 && item.isConfirm == 1">已确认</view>
 				</view>
 				<view class="con">
 					<view class="flex fs">
@@ -24,9 +25,9 @@
 				<view class="op">
 					<view class="flex">
 						<view class="f rline" v-if="item.isRelease == 0 && item.isOrders == 0" @click.stop="edit(item)">编辑</view>
-						<view class="f" v-if="item.isRelease == 0 && item.isOrders == 0" style="color: #4581fb" @click.stop="op(item, 1)">发布</view>
-						<view class="f" v-if="item.isRelease == 1 && item.isOrders == 0" style="color: #f44336" @click.stop="op(item, 0)">取消发布</view>
-						<view class="f" v-if="item.isRelease == 1 && item.isOrders == 1" style="color: #4581fb" @click.stop="confirm(item, 0)">前往确认</view>
+						<view class="f" v-if="item.isRelease == 0 && item.isOrders == 0 && item.isConfirm == 0" style="color: #4581fb" @click.stop="op(item, 1)">发布</view>
+						<view class="f" v-if="item.isRelease == 1 && item.isOrders == 0 && item.isConfirm == 0" style="color: #f44336" @click.stop="op(item, 0)">取消发布</view>
+						<view class="f" v-if="item.isRelease == 1 && item.isOrders == 1 && item.isConfirm == 0" style="color: #4581fb" @click.stop="confirm(item, 0)">前往确认</view>
 					</view>
 				</view>
 			</view>
@@ -41,12 +42,12 @@ export default {
 	data() {
 		return {
 			tab: [
-				//isRelease:是否发布[0=待发布,1=已发布]  isOrders:是否被接单[0=待接单,1=已被接单]
-				{ name: '全部', isRelease: '', isOrders: '' },
-				{ name: '待发布', isRelease: 0, isOrders: 0 },
-				{ name: '发布中', isRelease: 1, isOrders: 0 },
-				{ name: '已接单', isRelease: 1, isOrders: 1 }
-				//{ name: '已确认', isRelease: 1 ,isOrders: 1},
+				//isRelease:是否发布[0=待发布,1=已发布]  isOrders:是否被接单[0=待接单,1=已被接单]  isConfirm:收购商是否确认:0=未确认,1=已确认
+				{ name: '全部', isRelease: '', isOrders: '' ,isConfirm:''},
+				{ name: '待发布', isRelease: 0, isOrders: 0 ,isConfirm: 0},
+				{ name: '发布中', isRelease: 1, isOrders: 0 ,isConfirm: 0},
+				{ name: '已接单', isRelease: 1, isOrders: 1 ,isConfirm: 0},
+				{ name: '已确认', isRelease: 1, isOrders: 1 ,isConfirm: 1},
 				//{ name: '已完成', isRelease: 1 ,isOrders: 1}
 			],
 			list: [],
@@ -76,6 +77,7 @@ export default {
 		click(e) {
 			this.param.isRelease = e.isRelease;
 			this.param.isOrders = e.isOrders;
+			this.param.isConfirm = e.isConfirm;
 			this.refresh();
 		},
 		detail(item) {