lhl 3 år sedan
förälder
incheckning
9dd59b2a69
4 ändrade filer med 425 tillägg och 40 borttagningar
  1. 19 0
      api/whole.js
  2. 67 3
      pages/user/buySellDetail.vue
  3. 339 37
      pages/user/myWholesale.vue
  4. BIN
      static/icon/close.png

+ 19 - 0
api/whole.js

@@ -45,6 +45,7 @@ export function getMyPackage(data) {
 	});
 }
 
+
 // 上传评证
 export function upEvaluation(data) {
 	return request({
@@ -54,6 +55,15 @@ export function upEvaluation(data) {
 	});
 }
 
+// 获取审核列表
+export function getMySellout(data) {
+	return request({
+		url: '/api/package/order',
+		method: 'post',
+		data
+	});
+}
+
 // 获取新人礼包
 export function getNewList(data) {
 	return request({
@@ -61,4 +71,13 @@ export function getNewList(data) {
 		method: 'get',
 		data
 	});
+}
+
+// 拒绝
+export function packageAudit(data) {
+	return request({
+		url: '/api/package/audit',
+		method: 'post',
+		data
+	});
 }

+ 67 - 3
pages/user/buySellDetail.vue

@@ -80,7 +80,7 @@
 				<view class="info-tit">
 					微信收款码:
 				</view>
-				<image :src="chooseItem.touser.wx_qr" mode="" class="info-img"></image>
+				<image :src="chooseItem.touser.wx_qr" mode="" class="info-img" @click="lookimg(chooseItem.touser.wx_qr)"></image>
 			</view>
 			<view class="info-wrap">
 				<view class="info-tit">
@@ -104,6 +104,16 @@
 				立即支付
 			</view>
 		</view>
+		<uni-popup ref="lookimg" type="center">
+			<view class="pop-wrap" style="position: relative;" >
+				<movable-area class="popup-box">
+					<movable-view class="popup-item" :scale="true" direction="all">
+						<image :src="chooseImg" mode="aspectFit"></image>
+					</movable-view>
+				</movable-area>
+				<image src="../../static/icon/close.png" mode="" class="close" style="width: 80rpx;height: 80rpx;" @click="closePup"></image>
+			</view>
+		</uni-popup>
 	</view>
 </template>
 
@@ -113,6 +123,7 @@
 	export default {
 		data() {
 			return {
+				chooseImg: '',
 				upimg: '',
 				chooseItem: '',
 				can_addit: false
@@ -180,9 +191,26 @@
 					id: obj.chooseItem.id,
 					pay_evaluation: obj.upimg
 				}).then(res => {
-					console.log(res)
+					obj.$api.prePage().refreshList();
+					uni.showToast({
+						title:'支付成功',
+						duration:2000
+					});
+					setTimeout(function() {
+						uni.navigateBack();
+					}, 800);
 				})
-			}
+			},
+			closePup() {
+				this.chooseImg = ''
+				this.$refs.lookimg.close()
+			},
+			// 查看大图
+			lookimg(src) {
+				console.log(src,'chooseImg++++++')
+				this.chooseImg = src
+				this.$refs.lookimg.open()
+			},
 		}
 	}
 </script>
@@ -347,4 +375,40 @@
 		}
 
 	}
+	.pop-wrap {
+		width: 522rpx;
+		height: 800rpx;
+		// background-color: red;
+	}
+	.popup-box {
+		width: 522rpx;
+		height: 800rpx;
+		border-radius: 20rpx;
+		position: relative;
+		overflow: hidden;
+		background-color: #fff;
+		.popup-item {
+			width: 100%;
+			height: 100%;
+			
+			
+			image {
+				width: 100%;
+				// height: 100%;
+			}
+		}
+		
+	}
+	.close {
+		display: block;
+		width: 40rpx;
+		height: 40rpx;
+		border: 50%;
+		position: absolute;
+		// background-color: red;
+		bottom: -100rpx;
+		left: 0;
+		right: 0;
+		margin: 0 auto;
+	}
 </style>

+ 339 - 37
pages/user/myWholesale.vue

@@ -6,14 +6,12 @@
 				{{navitem.tit}}
 			</view>
 		</view>
-		<swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab"
-			:style="{'height': height}">
-			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex"
-				:style="{'height': height}">
+		<swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="getMyPackage('tab')"
+			:style="{'height': height}" disable-touch>
+			<swiper-item class="tab-content" :style="{'height': height}">
 				<scroll-view class="list-scroll-content" scroll-y @scrolltolower="getMyPackage">
-					<empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
-
-					<view @click="goToOrderDetail(item)" v-for="(item, index) in tabItem.orderList" :key="index"
+					<empty v-if="navList[0].loaded === true && navList[0].orderList.length === 0"></empty>
+					<view @click="goToOrderDetail(item)" v-for="(item, index) in navList[0].orderList" :key="index"
 						class="order-item">
 						<view class="i-top b-b">
 							<text class="time">订单编号:{{ item.order_id }}</text>
@@ -22,14 +20,9 @@
 							<text v-if="item.status === 4" class="del-btn iconfont icondelete"
 								@click="deleteOrder(index)"></text>
 						</view>
-						<!-- <scroll-view v-if="item.whole.length > 1" class="goods-box" scroll-x> -->
-						<!-- <view v-for="(goodsItem, goodsIndex) in item.whole" :key="goodsIndex" class="goods-item">
-								<image class="goods-img" :src="goodsItem.productInfo.image" mode="aspectFill"></image>
-							</view> -->
-						<!-- </scroll-view> -->
-
 						<view class="goods-box-single">
-							<image class="goods-img" :src="item.whole.image" mode="scaleToFill"></image>
+							<image class="goods-img" :src="item.whole.image" mode="scaleToFill"
+								@click="lookimg(item.whole.image)"></image>
 							<view class="right">
 								<view class="flex-start" style="justify-content: space-between;">
 									<text class="title clamp">{{ item.whole.title }}</text>
@@ -45,13 +38,74 @@
 							<button class="action-btn" @click.stop="lookMore(item)">查看详情</button>
 							<button v-if="item.status == 0" class="action-btn recom"
 								@click.stop="payNew(item)">立即支付</button>
+							<button v-if="item.status >= 1" class="action-btn recom"
+								@click.stop="stopItem(item)">提货</button>
 						</view>
 					</view>
-
-					<uni-load-more :status="tabItem.loadingType"></uni-load-more>
+					<uni-load-more :status="navList[0].loadingType"></uni-load-more>
+				</scroll-view>
+			</swiper-item>
+			<swiper-item class="tab-content" :style="{'height': height}">
+				<scroll-view class="list-scroll-content" scroll-y @scrolltolower="getMyPackage">
+					<empty v-if="navList[1].loaded === true && navList[1].orderList.length === 0"></empty>
+					<view class="out-wrapper" v-for="item in navList[1].orderList" :class="{'outt': item.status == 2}">
+						<view class="out-top flex">
+							<view class="buy-info flex">
+								<view class="fsz">买家:</view>
+								<image :src="item.user.avatar" mode="" class="user-logo fsz"></image>
+								<view class="user-name fsz clamp">{{item.user.real_name}}</view>
+								<view class="user-phone fsz" @click="call(item.user.phone)">
+									{{item.user.phone}}
+								</view>
+							</view>
+							<view class="buy-status">{{item.status | statusTitle}}</view>
+						</view>
+						<view class="item-info">
+							<view class="info-data">
+								<view class="info-tit">编号:</view>
+								<view class="info-val">{{item.order_id}}</view>
+							</view>
+							<view class="info-data">
+								<view class="info-tit">价值:</view>
+								<view class="info-val">{{item.price}}</view>
+							</view>
+						</view>
+						<view class="upimg">
+							<view class="up-tit">
+								打款凭证:
+							</view>
+							<view class="img-wrap" v-if="item.pay_evaluation" @click="lookimg(item.pay_evaluation)">
+								<image :src="item.pay_evaluation" mode=""></image>
+							</view>
+							<view class="" style="color: #0F253A;font-weight: bold;font-size: 26rpx;" v-else>
+								买家未上传支付凭证
+							</view>
+						</view>
+						<template v-if="item.status == 1">
+							<view class="mc-btn pass" @click="passPackage(item)">
+								通过
+							</view>
+							<!-- <view class="mc-btn fail" @click="openrefuse(item)">
+								拒绝
+							</view> -->
+						</template>
+					</view>
+					<uni-load-more :status="navList[1].loadingType"></uni-load-more>
 				</scroll-view>
+				
 			</swiper-item>
 		</swiper>
+		<uni-popup ref="lookimg" type="center">
+			<view class="pop-wrap" style="position: relative;">
+				<movable-area class="popup-box">
+					<movable-view class="popup-item" :scale="true" direction="all">
+						<image :src="chooseImg" mode="aspectFit"></image>
+					</movable-view>
+				</movable-area>
+				<image src="../../static/icon/close.png" mode="" class="close" style="width: 80rpx;height: 80rpx;"
+					@click="closePup"></image>
+			</view>
+		</uni-popup>
 	</view>
 </template>
 
@@ -60,7 +114,9 @@
 	import empty from '@/components/empty';
 
 	import {
-		getMyPackage
+		getMyPackage,
+		getMySellout,
+		packageAudit
 	} from '@/api/whole.js'
 	export default {
 		components: {
@@ -69,6 +125,7 @@
 		},
 		data() {
 			return {
+				chooseImg: '', //查看大图的图
 				chooseItem: {},
 				height: '',
 				tabCurrentIndex: 0,
@@ -83,14 +140,14 @@
 						status: -4
 					},
 					{
-						tit: '待支付',
+						tit: '转售中',
 						orderList: [],
 						page: 1,
 						limit: 10,
 						loadingType: 'more',
 						loaded: false,
 						day: 'today',
-						status: 1
+						status: 0
 					},
 				],
 			}
@@ -121,7 +178,7 @@
 						str = '支付超时'
 						break;
 					case -1:
-						str = '待支付'
+						str = '拒绝'
 						break;
 					case 0:
 						str = '待支付'
@@ -130,7 +187,7 @@
 						str = '待审核'
 						break;
 					case 2:
-						str = '收款'
+						str = '已通过'
 						break;
 					case 3:
 						str = '重新发放'
@@ -148,6 +205,12 @@
 			}
 		},
 		methods: {
+			// 查看大图
+			lookimg(src) {
+				console.log(src, 'chooseImg++++++')
+				this.chooseImg = src
+				this.$refs.lookimg.open()
+			},
 			// 查看详情
 			lookMore(item) {
 				this.chooseItem = item
@@ -168,6 +231,7 @@
 			},
 			navClick(index) {
 				this.tabCurrentIndex = index
+				// this.getMyPackage('tab')
 			},
 			getMyPackage(tab) {
 				let obj = this
@@ -180,23 +244,80 @@
 					return
 				}
 				navItem.loadingType == 'loading'
-				getMyPackage({
-					page: navItem.page,
-					limit: navItem.limit,
-					data: navItem.day,
-					status: navItem.status
-				}).then(({
-					data
-				}) => {
-					navItem.orderList = navItem.orderList.concat(data.data)
-					navItem.page++
-					if (navItem.limit == data.data.length) {
-						navItem.loadingType = 'more'
-					} else {
-						navItem.loadingType = 'noMore'
-					}
-					navItem.loaded = true
+				if (index == 0) {
+					getMyPackage({
+						page: navItem.page,
+						limit: navItem.limit,
+						data: navItem.day,
+						status: navItem.status
+					}).then(({
+						data
+					}) => {
+						navItem.orderList = navItem.orderList.concat(data.data)
+						navItem.page++
+						if (navItem.limit == data.data.length) {
+							navItem.loadingType = 'more'
+						} else {
+							navItem.loadingType = 'noMore'
+						}
+						navItem.loaded = true
+					})
+				}
+				if (index == 1) {
+					getMySellout({
+						page: navItem.page,
+						limit: navItem.limit,
+					}).then(({
+						data
+					}) => {
+						navItem.orderList = navItem.orderList.concat(data.data)
+						navItem.page++
+						if (navItem.limit == data.data.length) {
+							navItem.loadingType = 'more'
+						} else {
+							navItem.loadingType = 'noMore'
+						}
+						navItem.loaded = true
+					})
+				}
+			},
+			//添加或修改成功之后回调
+			refreshList() {
+				// 重新加载地址
+				let navItem = this.navList[this.tabCurrentIndex]
+				navItem.orderList = []
+				navItem.page = 1,
+					navItem.loadingType = 'more'
+
+				this.loadAddress()
+			},
+			// 同意
+			passPackage(item) {
+				let index = this.navList[1].orderList.indexOf(item)
+				console.log(index, 'index')
+				packageAudit({
+					re: '',
+					id: item.id,
+					status: 2
+				}).then(res => {
+					uni.showToast({
+						title: '审核通过',
+						duration: 2000
+					});
+					console.log(res)
+					this.navList[1].orderList[index].status = 2
+
+					// this.reload()
+
 				})
+			},
+			closePup() {
+				this.chooseImg = ''
+				this.$refs.lookimg.close()
+			},
+			// 提货
+			stopItem(item) {
+
 			}
 		}
 	}
@@ -435,4 +556,185 @@
 			}
 		}
 	}
+
+	.out-wrapper {
+		width: 690rpx;
+		// height: 392rpx;
+		background: #FFFFFF;
+		box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
+		border-radius: 20rpx;
+		margin: 0 auto 20rpx;
+		padding: 30rpx;
+		position: relative;
+
+		.outt {
+			height: 392rpx;
+		}
+
+		.out-top {
+			line-height: 46rpx;
+			justify-content: space-between;
+
+			.buy-info {
+				width: 450rpx;
+				font-size: 32rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #0F253A;
+				justify-content: flex-start;
+
+				.fsz {
+					flex-shrink: 0;
+				}
+
+				.user-name {
+					max-width: 180rpx;
+				}
+
+				.user-phone {
+					padding-left: 10rpx;
+					font-size: 24rpx;
+					font-family: PingFang SC;
+					font-weight: 500;
+					color: #999999;
+				}
+
+				.user-logo {
+					display: block;
+					width: 46rpx;
+					height: 46rpx;
+					border-radius: 50%;
+					// background-color: red;
+					// padding-right: 10rpx;
+					margin-right: 10rpx;
+				}
+			}
+
+			.buy-status {
+				font-size: 26rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #6D7C88;
+			}
+		}
+
+		.item-info {
+			width: 100%;
+			margin-top: 28rpx;
+			line-height: 50rpx;
+			font-size: 26rpx;
+			font-family: PingFang SC;
+			display: flex;
+			flex-wrap: wrap;
+
+			.info-data {
+				width: 100%;
+				display: flex;
+
+				.info-tit {
+
+					font-weight: 500;
+					color: #6D7C88;
+				}
+
+				.info-val {
+					color: #0F253A;
+					font-weight: bold;
+				}
+			}
+		}
+
+		.upimg {
+			padding-top: 10rpx;
+			display: flex;
+
+			.up-tit {
+				display: inline-block;
+				font-size: 26rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #6D7C88;
+			}
+
+			.img-wrap {
+				width: 153rpx;
+				height: 152rpx;
+
+				border-radius: 20rpx;
+
+				image {
+					border-radius: 20rpx;
+					width: 153rpx;
+					height: 152rpx;
+					background-color: #ccc;
+				}
+			}
+		}
+
+		.mc-btn {
+			width: 144rpx;
+			line-height: 50rpx;
+			border-radius: 25px;
+			background: #FFFFFF;
+			font-size: 26rpx;
+			font-family: PingFang SC;
+			font-weight: 500;
+			text-align: center;
+			position: absolute;
+			bottom: 47rpx;
+		}
+
+		.pass {
+			color: #FF4C4C;
+			border: 2px solid #FF4C4C;
+			right: 36rpx;
+		}
+
+		.fail {
+			color: #999999;
+			border: 2px solid #EBEBEB;
+
+			right: 36rpx;
+		}
+	}
+
+	.pop-wrap {
+		width: 522rpx;
+		height: 800rpx;
+		// background-color: red;
+	}
+
+	.popup-box {
+		width: 522rpx;
+		height: 800rpx;
+		border-radius: 20rpx;
+		position: relative;
+		overflow: hidden;
+		background-color: #fff;
+
+		.popup-item {
+			width: 100%;
+			height: 100%;
+
+
+			image {
+				width: 100%;
+				// height: 100%;
+			}
+		}
+
+	}
+
+	.close {
+		display: block;
+		width: 40rpx;
+		height: 40rpx;
+		border: 50%;
+		position: absolute;
+		// background-color: red;
+		bottom: -100rpx;
+		left: 0;
+		right: 0;
+		margin: 0 auto;
+	}
 </style>

BIN
static/icon/close.png