Răsfoiți Sursa

二级市场组长接单

李书文 1 an în urmă
părinte
comite
a9e64fb1d8

+ 5 - 0
common/style.scss

@@ -703,10 +703,15 @@
 		}
 		.desc {
 			float: right;
+			width: 60%;
+			text-align: right;
 		}
 		input {
+			width: 60%;
 			text-align: right;
 			font-size: 15px;
+			float: right;
+			margin-top: -21px;
 		}
 	}
 }

+ 8 - 13
pages/market/two/detail.vue

@@ -1,47 +1,42 @@
 <template>
 	<view>
 		<view class="product_detail">
-			<!-- <image :src="item.goodsImg" mode="widthFix" class="pic"></image> -->
 			<image src="../../../static/news.jpg" mode="widthFix" class="pic"></image>
 			<view class="box">
-				<view class="title">{{item.goodsName}}</view>
-				<!-- <view class="price">¥ 5000</view> -->
+				<view class="title">{{ item.goodsName }}</view>
 				<view class="clear"></view>
 				<u-divider text="规格参数"></u-divider>
 				<view class="item">
 					<text class="desc">商品量:</text>
-					<text>{{item.goodsQuantity}}</text>
+					<text>{{ item.goodsQuantity }}</text>
 					<view class="clear"></view>
 				</view>
 				<view class="item">
 					<text class="desc">计量单位:</text>
-					<text>{{item.goodsUnit}}</text>
+					<text>{{ item.goodsUnit }}</text>
 					<view class="clear"></view>
 				</view>
-				<!-- 商户后续查,目前商户不对 -->
 				<view class="item">
 					<text class="desc">商户:</text>
-					<text>{{item.createName}}</text>
+					<text>{{ item.createName }}</text>
 					<view class="clear"></view>
 				</view>
 				<view class="item">
 					<text class="desc">互市区:</text>
-					<text>{{item.tradeAreaName}}</text>
+					<text>{{ item.tradeAreaName }}</text>
 					<view class="clear"></view>
 				</view>
 				<view class="item">
 					<text class="desc">发布时间:</text>
-					<text>{{item.createTime}}</text>
+					<text>{{ item.createTime }}</text>
 					<view class="clear"></view>
 				</view>
-				<!-- <u-divider text="商品介绍"></u-divider>
-				<view class="contents">八角茴香是木兰科八角属的常绿乔木。树皮灰褐色或红褐色;叶互生或叶簇生于枝端;叶片革质,椭圆状倒卵</view> -->
 			</view>
 		</view>
 		<view class="mfooter">
 			<view class="flex">
 				<view class="f">
-					<button class="btn" v-if="user.userType !== 5" @click="pay()">立即接单</button>
+					<button class="btn" v-if="user.userType == 2" @click="pay()">立即接单</button>
 				</view>
 			</view>
 		</view>
@@ -68,7 +63,7 @@ export default {
 	},
 	methods: {
 		pay() {
-			uni.navigateTo({ url: '/pages/market/two/leader/confirm' });
+			uni.navigateTo({ url: '/pages/market/two/leader/confirm?item=' + JSON.stringify(this.item) });
 		}
 	}
 };

+ 26 - 22
pages/market/two/leader/confirm.vue

@@ -12,23 +12,23 @@
 				<u-divider text="订单信息"></u-divider>
 				<view class="item" style="padding-top: 0px">
 					<text class="label">收购商品</text>
-					<text class="desc">越南榴莲</text>
+					<text class="desc omit">{{ item.goodsName }}</text>
 				</view>
 				<view class="item">
 					<text class="label">商品编号</text>
-					<text class="desc">25吨</text>
+					<text class="desc">{{ item.goodsNo }}</text>
 				</view>
 				<view class="item">
 					<text class="label">计价单位</text>
-					<text class="desc"></text>
+					<text class="desc">{{ item.goodsUnit }}</text>
 				</view>
 				<view class="item">
 					<text class="label">商品数量</text>
-					<text class="desc">35</text>
+					<text class="desc">{{ item.goodsQuantity }}</text>
 				</view>
 				<view class="item">
 					<text class="label">发布时间</text>
-					<text class="desc">2023-08 15:35</text>
+					<text class="desc">{{ item.createTime }}</text>
 				</view>
 				<view class="item">
 					<text class="label">订单状态</text>
@@ -36,12 +36,12 @@
 				</view>
 				<view class="item">
 					<text class="label">接单人</text>
-					<text class="desc">张三</text>
+					<text class="desc">{{ user.name }}</text>
 				</view>
 				<view class="item">
 					<text class="label">出价金额(必填)</text>
 					<text class="desc">
-						<input type="number" v-model="price" placeholder="请输入" />
+						<input type="number" v-model="order.price" placeholder="请输入(元)" />
 					</text>
 				</view>
 			</view>
@@ -60,34 +60,38 @@
 export default {
 	data() {
 		return {
+			user: this.getUser(),
 			item: {},
-			price: ''
+			order: {}
 		};
 	},
 	onLoad(e) {
-		if (e.id) {
-			// let params = {
-			// 	goodsDemandId: e.id,
-			// 	isOrders: 1,
-			// 	price: parseInt(this.price),
-			// 	purchaserId: 
-			// }
-			// this.http.request({
-			// 	url: '/level-two-server/app/TbDemandQuotation/quotation',
-			// 	success: res => {
-			// 		this.content = res.data.data;
-			// 	}
-			// });
+		if (e.item) {
+			this.item = JSON.parse(e.item);
+			this.order.purchaserId = this.item.purchaserId;
+			this.order.goodsDemandId = this.item.id;
 		}
 	},
 	methods: {
 		pay() {
+			let rule = [{ name: 'price', checkType: 'notnull', errorMsg: '请输入报价' }];
+			if (!this.verify.check(this.order, rule)) {
+				uni.showModal({ content: this.verify.error, showCancel: false });
+				return false;
+			}
 			uni.showModal({
 				title: '提示',
 				content: '我已核对订单信息无误',
 				success: res => {
 					if (res.confirm) {
-						uni.navigateTo({ url: '/pages/market/two/leader/success' });
+						this.http.request({
+							url: '/level-two-server/app/TbDemandQuotation/quotation',
+							method: 'POST',
+							data:this.order,
+							success: res => {
+								uni.navigateTo({ url: '/pages/market/two/leader/success' });
+							}
+						});
 					}
 				}
 			});

+ 11 - 12
pages/market/two/list.vue

@@ -17,18 +17,17 @@
 				</view>
 				<view class="clear"></view>
 			</view>
-			<view class="item" v-for="(item, index) in list" :key="index" >
-				<view class="title" @click="detail(item)">{{item.createName}}</view>
-				<!-- <image :src="item.goodsImg" mode="aspectFill" class="pic"></image> -->
+			<view class="item" v-for="(item, index) in list" :key="index">
+				<view class="title" @click="detail(item)">{{ item.createName }}</view>
 				<image @click="detail(item)" src="../../../static/news.jpg" mode="aspectFill" class="pic"></image>
 				<view class="con">
-					<view class="productName omit" @click="detail(item)">{{item.goodsName}}</view>
-					<view class="desc" @click="detail(item)">{{item.goodsQuantity}}吨</view>
-					<!-- <view class="price">¥ 5000</view> -->
+					<view class="productName omit" @click="detail(item)">{{ item.goodsName }}</view>
+					<view class="desc" @click="detail(item)">{{ item.goodsQuantity }}吨</view>
 					<view class="btn" v-if="user.userType == 2" @click="confirm(item)">立即接单</view>
 				</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>
 		<productType v-model="show"></productType>
 	</view>
@@ -52,7 +51,7 @@ export default {
 	methods: {
 		getData() {
 			this.http.request({
-				url: '/level-two-server/app/TbGoodsDemand/getAppList',
+				url: '/level-two-server/app/TbGoodsDemand/getList',
 				data: this.param,
 				loading: 'false',
 				success: res => {
@@ -64,8 +63,8 @@ export default {
 		detail(item) {
 			uni.navigateTo({ url: '/pages/market/two/detail?id=' + item.id });
 		},
-		confirm(item){
-			uni.navigateTo({ url: '/pages/market/two/leader/confirm?id=' + item.id })
+		confirm(item) {
+			uni.navigateTo({ url: '/pages/market/two/leader/confirm?id=' + item.id });
 		},
 		//刷新数据
 		refresh() {
@@ -99,12 +98,12 @@ page {
 .search {
 	padding: 12px 12px 0px 12px;
 }
-.btn{
+.btn {
 	width: 120rpx;
 	height: 40rpx;
 	background-color: #fff;
 	color: #000;
-	border: #B5B5B5 1px solid;
+	border: #b5b5b5 1px solid;
 	position: relative;
 	left: 350rpx;
 	font-size: 14px;