From 1f478b4b033d518f6de21f931d828d2a175b2a3e Mon Sep 17 00:00:00 2001
From: wzp <2880584989@qq.com>
Date: 星期二, 08 三月 2022 13:40:51 +0800
Subject: [PATCH] 最新版本,修复bug

---
 assetMgtH5/pages/apply/apply.vue |  147 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 147 insertions(+), 0 deletions(-)

diff --git a/assetMgtH5/pages/apply/apply.vue b/assetMgtH5/pages/apply/apply.vue
index 8183fd0..969bed9 100644
--- a/assetMgtH5/pages/apply/apply.vue
+++ b/assetMgtH5/pages/apply/apply.vue
@@ -1,22 +1,169 @@
 <template>
 	<view>
+		<view class="">
+			<cu-custom bgColor="bg-gradual-blue" >
+				<!-- <block slot="backText">杩斿洖</block> -->
+				<block slot="content">鎴戠殑鐢宠</block>
+			</cu-custom>
+		</view>
 		
+		<view class="tabBox">
+			<u-subsection
+				:list="curlist"
+				mode="button"
+				:current="current"
+				@change="changeCurrent"
+			></u-subsection>
+		</view>
+		
+		<view class="contentBox">
+			
+				<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback">
+					<view class="cu-list menu-avatar">
+						<view class="cu-item" v-for="(item,index) in assetsList" :key="index" @click="navTo(item.id)">
+							<view class="cu-avatar radius lg bg-white"
+								style="background-image:url(../../static/device.png);">
+							</view>
+							<view class="content">
+								<view>
+									<view class="text-cut text-bold text-xl">{{item.approvalAssets[0].assets.name}}</view>
+									<view class="cu-tag radius bg-orange sm">鏁伴噺锛歿{item.approvalAssets[0].quantity}}</view>
+								</view>
+								<view class="text-gray text-sm flex">
+									<view class="text-cut">鐢宠鏃堕棿:{{item.createTime}}</view>
+								</view>
+								
+							</view>
+							<view class="action">
+							<view class="text-grey text-xs">鐢宠鐘舵��</view>
+							<view class="cu-tag round bg-red sm">{{current+1===1?'寰呭鎵�':current+1===2?'閫氳繃':"鏈�氳繃"}}</view>
+							</view>
+						</view>
+					</view>
+					
+					
+				</mescroll-body>
+			
+			
+			<view class=""  v-if="assetsList.length===0">
+				<u-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png">
+				</u-empty>
+			</view>
+		</view>
+		
+	
+	
+	
 	</view>
 </template>
 
 <script>
+	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
 	export default {
+		mixins: [MescrollMixin], // 浣跨敤mixin
 		data() {
 			return {
+				assetsList:[],
 				
+				current: 0,
+				status:0,
+				curlist: ['寰呭鎵�', '宸插畬鎴�', '鏈�氳繃'],
 			}
 		},
+		onShow() {
+			// this.getAssetList();
+			this.page = 1;
+			let page ={};
+			page.num =1;
+			this.upCallback(page);
+		},
 		methods: {
+			changeCurrent(index) {
+				this.current = index
+				// this.getAssetList();
+				this.page = 1;
+				let page ={};
+				page.num =1;
+				this.upCallback(page);
+			},
 			
+			
+			//鎺ュ彛鏈夐棶棰�
+			upCallback(page) {
+				let pageNum = page.num; //椤电爜锛岄粯璁や粠1寮�濮�
+				let pageSize = 10; //椤甸暱锛岄粯璁ゆ瘡椤�10鏉�
+				
+				console.log("this.current",this.current)
+				this.$http.get('/assets/approval/myApply',{params:{
+					"pageNum":1,
+					"pageSize":100,
+					"type":this.current+1
+				}})
+					.then(res => {
+						// debugger;
+						if (res.data.code === 0) {
+							let data = res.data.data;
+							console.log('鍒楄〃锛�'+ data.length)
+							if (page.num == 1) this.assetsList = []; //濡傛灉鏄涓�椤碉紝闇�鎵嬪姩缃┖鍒楄〃
+							this.assetsList = this.assetsList.concat(data); //杩藉姞鏂版暟鎹�
+							// console.log('鏁版嵁',JSON.stringify(this.assetsList[0]));
+							this.mescroll.endBySize(this.assetsList.length, res.data.total);
+						}
+						else{
+							this.mescroll.endBySize(0, 0);
+						}
+						
+					})
+					.catch(err => {
+						this.mescroll.endErr();
+						console.log('寮傚父', err);
+					});
+			},
+			
+			//璇锋眰
+			getAssetList() {
+				this.$http.get('/assets/approval/myApply',{params:{
+					"pageNum":1,
+					"pageSize":100,
+					"type":this.current+1
+				}})
+					.then(res => {
+						// debugger;
+						
+						if(res.data.code===0 ){
+							let data =res.data.data;
+							this.assetsList =data;
+							console.log("缁撴灉",data)
+							
+						}
+						
+					}).catch(err => {
+						console.log(err.data)
+					})
+			},
+			
+			navTo(id) {
+				uni.navigateTo({
+					url: `./applyInfo?id=${id}&type=${this.current+1}`
+				})
+			}
 		}
 	}
 </script>
 
 <style>
+.tabBox{
+	z-index: 100;
+	position: fixed;
+	width: 100%;
+	top:90rpx;
+	
 
+}
+.contentBox{
+	z-index: 99;
+	position: fixed;
+	width: 100%;
+	top:165rpx;
+}
 </style>

--
Gitblit v1.9.1