Quellcode durchsuchen

feat: 交易明细列表,点击刷新等操作时scroll-view滚动到顶部

ext.zhangbin71 vor 1 Woche
Ursprung
Commit
b67bd75cee

+ 1 - 1
api/merchant.js

@@ -52,5 +52,5 @@ export function fetchMerchantRecordAPI(params) {
  * @param
  */
 export function fetchMerchantRestockListAPI(params) {
-  return request.get(`merchant/restock/list?metalType=${params.metalType}&limit=${params.limit}&page=${params.page}&type=${params.type}`);
+  return request.get(`merchant/restock/list?metalType=${params.metalType}&limit=${params.limit}&page=${params.page}`);
 }

+ 1 - 1
pages/users/user_asset/asset_info/asset_info.vue

@@ -349,7 +349,7 @@
 	.asset_container {
 		// padding-top: 92rpx;
 		background-color: #F9F7F0;
-		height: 100%;
+		height: 100vh;
 		display: flex;
 		flex-direction: column;
 		justify-content: flex-start;

+ 68 - 19
pages/users/user_asset/record_list/record_list.vue

@@ -134,7 +134,7 @@
 				</view>
 			</view>
 		</view>
-		<view class="list_filter" v-show="menuType==1">
+		<view class="list_filter" v-if="menuType==1">
 			<view class="filter_title">
 
 			</view>
@@ -168,6 +168,12 @@
 					</view>
 				</view>
 			</view>
+			<view class="noMore" v-if="recordList.length>0&&!recordParams.hasMore">
+				到底了
+			</view>
+			<view class="empty" v-if="!recordList||recordList.length==0">
+				暂无数据
+			</view>
 
 		</scroll-view>
 		<scroll-view class="asset_list" scroll-y="true" v-show="menuType==2" :lower-threshold='100'
@@ -184,6 +190,9 @@
 								{{item.auditStatus==2?'审核拒绝':item.auditStatus==0?'审核中':'审核通过'}}
 							</view>
 						</view>
+						<view class="record_time reject_reason" v-if="item.auditStatus==2">
+							拒绝原因:{{item.rejectReason}}
+						</view>
 						<view class="record_time">
 							{{item.createTime}}
 						</view>
@@ -193,6 +202,12 @@
 					</view>
 				</view>
 			</view>
+			<view class="noMore" v-if="approveList.length>0&&!approveParams.hasMore">
+				到底了
+			</view>
+			<view class="empty empty-1" v-if="!approveList||approveList.length==0">
+				暂无数据
+			</view>
 
 		</scroll-view>
 	</view>
@@ -279,12 +294,15 @@
 
 	const approveList = ref([])
 	
+	
 	function scrollRecord(e){
-		console.log(e.detail.scrollTop,recordScrollTop)
+		// console.log(e.detail.scrollTop,recordScrollTop.value)
+		// oldScroll1 = e.detail.scrollTop
 	}
 	
 	function scrollApprove(e){
-		console.log(e.detail.scrollTop,approveScrollTop)
+		// console.log(e.detail.scrollTop,approveScrollTop.value)
+		// oldScroll2 = e.detail.scrollTop
 	}
 
 
@@ -303,7 +321,7 @@
 				uni.showToast({
 					title: '刷新成功',
 					icon: 'none',
-					duration: 1000
+					duration: 800
 				})
 			}
 
@@ -347,11 +365,12 @@
 	function nextPageRecord() {
 		console.log("到底了")
 		if (!recordParams.value.hasMore) {
-			return uni.showToast({
-				title: "没有更多了",
-				icon: "none",
-				duration: 1000
-			})
+			// uni.showToast({
+			// 	title: "没有更多了",
+			// 	icon: "none",
+			// 	duration: 1000
+			// })
+			return 
 		}
 		recordParams.value.page += 1;
 		fetchRecordList()
@@ -361,11 +380,12 @@
 	function nextPageApprove() {
 		// console.log("到底了")
 		if (!approveParams.value.hasMore) {
-			return uni.showToast({
-				title: "没有更多了",
-				icon: "none",
-				duration: 1000
-			})
+			// uni.showToast({
+			// 	title: "没有更多了",
+			// 	icon: "none",
+			// 	duration: 1000
+			// })
+			return 
 		}
 		approveParams.value.page += 1;
 		fetchApproveList()
@@ -395,7 +415,10 @@
 			uni.hideLoading()
 			if (recordParams.value.page == 1) {
 				recordList.value = res?.data?.list || [];
-				recordScrollTop.value = 0
+				recordScrollTop.value = 1
+				setTimeout(()=>{
+					recordScrollTop.value = 0
+				},100)
 			} else {
 				recordList.value = recordList.value.concat(res?.data?.list || []);
 			}
@@ -422,7 +445,10 @@
 			uni.hideLoading()
 			if (approveParams.value.page == 1) {
 				approveList.value = res?.data?.list || [];
-				approveScrollTop.value = 0
+				approveScrollTop.value = 1
+				setTimeout(()=>{
+					approveScrollTop.value = 0
+				},100)
 			} else {
 				approveList.value = approveList.value.concat(res?.data?.list || []);
 			}
@@ -526,7 +552,7 @@
 	.asset_container {
 		// padding-top: 92rpx;
 		background-color: #F9F7F0;
-		height: 100%;
+		height: 100vh;
 		display: flex;
 		flex-direction: column;
 		justify-content: flex-start;
@@ -559,7 +585,7 @@
 				color: #F8C008;
 
 				.filter_icon {
-					// width: 32rpx;
+					width: 32rpx;
 					height: 32rpx;
 					margin-right: 8rpx;
 				}
@@ -708,12 +734,13 @@
 		margin-bottom: 16rpx;
 
 		.record_left {
+			margin-right: 20rpx;
 
 			.record_title {
 				display: flex;
 				justify-content: flex-start;
 				align-items: center;
-				margin-bottom: 20rpx;
+				margin-bottom: 10rpx;
 
 				.record_name {
 					font-size: 28rpx;
@@ -748,6 +775,12 @@
 			.record_time {
 				font-size: 24rpx;
 				color: #333;
+				margin-top: 10rpx;
+			}
+			.reject_reason{
+				font-size: 28rpx;
+				line-height: 34rpx;
+				margin-bottom: 10rpx;
 			}
 		}
 
@@ -804,4 +837,20 @@
 			}
 		}
 	}
+	.empty{
+		width: 100%;
+		text-align: center;
+		padding: 200rpx 0;
+		color:#dedede;
+		&.empty-1{
+			padding-top: 268rpx;
+		}
+	}
+	.noMore{
+		width: 100%;
+		color:#dedede;
+		text-align: center;
+		line-height: 40rpx;
+		padding-bottom: 20rpx;
+	}
 </style>

+ 2 - 2
pages/users/user_asset/stock_in/stock_in.vue

@@ -203,8 +203,8 @@
 					title: "补货申请条件成功,正在审核中"
 				})
 				setTimeout(() => {
-					// uni.navigateBack()
-					submitting = false;
+					uni.navigateBack()
+					// submitting = false;
 				}, 500)
 
 			}).catch(() => {