eraser 4 年之前
父节点
当前提交
a9ff358a15
共有 5 个文件被更改,包括 93 次插入292 次删除
  1. 二进制
      assets/home/homeBG.png
  2. 29 12
      components/manager/assets.vue
  3. 32 14
      components/manager/project.vue
  4. 32 16
      components/manager/user.vue
  5. 0 250
      components/manager/zc.vue

二进制
assets/home/homeBG.png


+ 29 - 12
components/manager/assets.vue

@@ -29,11 +29,11 @@
 		</view>
 		<view class="m_right_footer">
 			<view class="m_paging">
-				<text class="m_paging_item m_paging_upper" v-show="bShowLastPageBtn">上一页</text>
+				<text class="m_paging_item m_paging_upper" v-show="bShowLastPageBtn" @click="last()">上一页</text>
 				<text class="m_paging_item" v-for="i in pageTotalNum" @click="paging(i)" :key="i" :class="i==currentPage?'p_act':''">
 					{{i}}
 				</text>
-				<text class="m_paging_item m_paging_lower" v-show="bShowNextPageBtn">下一页</text>
+				<text class="m_paging_item m_paging_lower" v-show="bShowNextPageBtn" @click="paging(i)">下一页</text>
 			</view>
 		</view>
 		<popForm ref="popForm"></popForm>
@@ -91,14 +91,14 @@
 							console.log("请求全部资产", res);
 							this.dataUsers_all = res.data.Items;
 							this.pageTotalNum = Math.ceil(res.data.AllOfItem/this.totalItem);
-							console.log("this.pageTotalNum=", this.pageTotalNum);
+							this.currentPage = i;					
+							this.showNextOrLastPageBtn();
 						}
 						//200失败
 						else {
 							console.log('suc200', res);
 						}
-						uni.hideLoading();
-						this.showNextOrLastPageBtn();
+						uni.hideLoading();					
 					},
 					fail: (res) => {
 						console.log("请求失败****");	
@@ -109,15 +109,26 @@
 			initPage() {
 				this.paging(1);
 			},
+			last()
+			{
+				this.currentPage--;
+				this.paging(this.currentPage);
+			},
+			next()
+			{
+				this.currentPage++;
+				this.paging(this.currentPage);
+			},
 			showNextOrLastPageBtn()
 			{
-				if((this.pageTotalNum-this.totalItem)>0)
-				{
-					this.bShowLastPageBtn = false;
-					this.bShowNextPageBtn = false;
-					// console.log('0000')
-				}
-				else if(this.pageTotalNum==this.currentPage)
+				// if((this.pageTotalNum-this.totalItem)>0)
+				// {
+				// 	this.bShowLastPageBtn = false;
+				// 	this.bShowNextPageBtn = false;
+				// 	// console.log('0000')
+				// }
+				// else 
+				if(this.pageTotalNum==this.currentPage)
 				{
 					this.bShowLastPageBtn = true;
 					this.bShowNextPageBtn = false;
@@ -135,6 +146,12 @@
 					this.bShowNextPageBtn = true;
 					// console.log('333333')
 				}
+				
+				if(this.pageTotalNum==1){
+					this.bShowLastPageBtn = false;
+					this.bShowNextPageBtn = false;
+					// console.log('444444')
+				}
 			},
 			addZc(){
 				

+ 32 - 14
components/manager/project.vue

@@ -38,11 +38,11 @@
 		</view>
 		<view class="m_right_footer">
 			<view class="m_paging">
-				<text class="m_paging_item m_paging_upper" v-show="bShowLastPageBtn">上一页</text>
+				<text class="m_paging_item m_paging_upper" v-show="bShowLastPageBtn" @click="last()">上一页</text>
 				<text class="m_paging_item" :key="i" v-for="i in pageTotalNum" @click="paging(i)" :class="i==currentPage?'p_act':''">
 					{{i}}
 				</text>
-				<text class="m_paging_item m_paging_lower" v-show="bShowNextPageBtn">下一页</text>
+				<text class="m_paging_item m_paging_lower" v-show="bShowNextPageBtn" @click="next()">下一页</text>
 			</view>
 		</view>
 		<popForm ref="popForm"></popForm>
@@ -100,13 +100,14 @@
 							console.log("请求全部项目", res);
 							this.dataUsers_all = res.data.Projects;
 							this.pageTotalNum = Math.ceil(res.data.AllNumOfList/this.totalItem);
+							this.currentPage = i;
+							this.showNextOrLastPageBtn();
 						}
 						//200失败
 						else {
 							console.log('suc200', res);
 						}
-						uni.hideLoading();
-						this.showNextOrLastPageBtn();
+						uni.hideLoading();					
 					},
 					fail: (res) => {
 						console.log("请求失败****");	
@@ -117,31 +118,48 @@
 			initPage() {
 				this.paging(1);
 			},
+			last()
+			{
+				this.currentPage--;
+				this.paging(this.currentPage);
+			},
+			next()
+			{
+				this.currentPage++;
+				this.paging(this.currentPage);
+			},
 			showNextOrLastPageBtn()
 			{
-				if((this.pageTotalNum-this.totalItem)>0)
-				{
-					this.bShowLastPageBtn = false;
-					this.bShowNextPageBtn = false;
-					// console.log('0000')
-				}
-				else if(this.pageTotalNum==this.currentPage)
+				// if((this.pageTotalNum-this.totalItem)>0)
+				// {
+				// 	this.bShowLastPageBtn = false;
+				// 	this.bShowNextPageBtn = false;
+				// 	console.log('0000')
+				// }
+				// else 
+				if(this.pageTotalNum==this.currentPage)
 				{
 					this.bShowLastPageBtn = true;
 					this.bShowNextPageBtn = false;
-					// console.log('11111')
+					console.log('11111')
 				}
 				else if(1==this.currentPage)
 				{
 					this.bShowLastPageBtn = false;
 					this.bShowNextPageBtn = true;
-					// console.log('2222')
+					console.log('2222')
 				}
 				else
 				{
 					this.bShowLastPageBtn = true;
 					this.bShowNextPageBtn = true;
-					// console.log('333333')
+					console.log('333333')
+				}
+				
+				if(this.pageTotalNum==1){
+					this.bShowLastPageBtn = false;
+					this.bShowNextPageBtn = false;
+					console.log('444444')
 				}
 			},
 			addProject()

+ 32 - 16
components/manager/user.vue

@@ -37,12 +37,12 @@
 		</view>
 		<view class="m_right_footer">
 			<view class="m_paging">
-				<text class="m_paging_item m_paging_upper" v-show="bShowLastPageBtn">上一页</text>
+				<text class="m_paging_item m_paging_upper" v-show="bShowLastPageBtn" @click="last()">上一页</text>
 				<!-- <text class="m_paging_item" :key="i" v-for="i in pageTotalNum" @click="paging(i)" :class="i==index?'p_act':''"> -->
 				<text class="m_paging_item" :key="i" v-for="i in pageTotalNum" @click="paging(i)" :class="i==currentPage?'p_act':''">
 					{{i}}
 				</text>
-				<text class="m_paging_item m_paging_lower" v-show="bShowNextPageBtn">下一页</text>
+				<text class="m_paging_item m_paging_lower" v-show="bShowNextPageBtn" @click="next()">下一页</text>
 			</view>
 		</view>
 		<popForm ref="popForm"></popForm>
@@ -85,7 +85,7 @@
 					"BeginNum": fromIndex, //用户数组索引
 					"EndNum": toIndex //用户数组索引结束
 				}
-				// console.log('data===',data)
+				console.log('data===',data)
 				uni.request({
 					header: {
 						'Content-Type': 'application/json;charset=UTF-8'
@@ -100,17 +100,16 @@
 							console.log("请求全部用户res", res);
 							this.dataUsers_all = res.data.Users;
 							this.pageTotalNum = Math.ceil(res.data.AllNumOfList/this.totalItem);
-							this.setTotalScore();
-							this.currentPage = i;
-							uni.hideLoading();
-							
+							this.currentPage = i;																		
 							this.showNextOrLastPageBtn();
+							
+							this.setTotalScore();
 						}
 						//200失败
 						else {
-							console.log('suc200', res);
-							uni.hideLoading();
+							console.log('suc200', res);							
 						}
+						uni.hideLoading();
 					},
 					fail: (res) => {
 						console.log("请求失败****");
@@ -134,15 +133,26 @@
 					this.dataUsers_all[i].TotalScore = totalScore;
 				}
 			},
+			last()
+			{
+				this.currentPage--;
+				this.paging(this.currentPage);
+			},
+			next()
+			{
+				this.currentPage++;
+				this.paging(this.currentPage);
+			},
 			showNextOrLastPageBtn()
 			{
-				if((this.pageTotalNum-this.totalItem)>0)
-				{
-					this.bShowLastPageBtn = false;
-					this.bShowNextPageBtn = false;
-					// console.log('0000')
-				}
-				else if(this.pageTotalNum==this.currentPage)
+				// if((this.pageTotalNum-this.totalItem)>0)
+				// {
+				// 	this.bShowLastPageBtn = false;
+				// 	this.bShowNextPageBtn = false;
+				// 	// console.log('0000')
+				// }
+				// else 
+				if(this.pageTotalNum==this.currentPage)
 				{
 					this.bShowLastPageBtn = true;
 					this.bShowNextPageBtn = false;
@@ -160,6 +170,12 @@
 					this.bShowNextPageBtn = true;
 					// console.log('333333')
 				}
+				
+				if(this.pageTotalNum==1){
+					this.bShowLastPageBtn = false;
+					this.bShowNextPageBtn = false;
+					// console.log('444444')
+				}
 			},
 			addUser(){
 				this.$refs.popForm.isShow(true);

+ 0 - 250
components/manager/zc.vue

@@ -1,250 +0,0 @@
-<template>
-	<view class="m_right">
-		<view class="m_right_hander">
-			<button size="mini" class="m_btn_red">添加资产</button>
-		</view>
-		<view class="m_right_container">
-			<table style="width: 100%;border: 1px solid #DDDDDD;border-collapse: collapse">
-				<thead class="m-table-hander">
-					<tr>
-						<th>用户名</th>
-						<th>班级</th>
-						<th>学号</th>
-						<th>电话</th>
-						<th>ilab账户</th>
-						<th>注册时间</th>
-						<th>分数</th>
-						<th>修改信息</th>
-						<th>删除</th>
-					</tr>
-				</thead>
-				<tbody>
-					<tr v-for="(dataUser,dataUserI) in dataUsers_all" :key="dataUserI">
-						<th style="color: #EA252C;">dataUser.Name</th>
-						<th>dataUser.Id</th>
-						<th>dataUser.Id</th>
-						<th>dataUser.Id</th>
-						<th>dataUser.Id</th>
-						<th>dataUser.Id</th>
-						<th>dataUser.Id</th>
-						<th style="position: relative;"><button type="default" size="mini" class="m_edit">修改</button></th>
-						<th style="position: relative;"><button type="default" size="mini" class="m_delete">删除</button></th>
-					</tr>
-					
-				</tbody>
-			</table>
-		</view>
-		<view class="m_right_footer">
-			<view class="m_paging">
-				<text class="m_paging_item m_paging_upper">上一页</text>
-				<text class="m_paging_item" v-for="i in 8" @click="paging(i)" :class="i==index?'p_act':''">
-					{{i}}
-				</text>
-				<text class="m_paging_item m_paging_lower">下一页</text>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		name: "manager_zc",
-		data() {
-			return {
-				pageTotalNum:1,
-				currentPage:0,
-				totalItem:2,
-				dataUsers_all: []
-			}
-		},
-		methods: {
-			paging(i) {
-				uni.showLoading({
-				    title: '加载中'  
-				});
-				
-				let fromIndex = this.totalItem*(i-1);
-				let toIndex = fromIndex+this.totalItem;
-				
-				let data = {
-					"UserID": mydata_userInfo.userID,
-					"BeginNum": 0, //用户数组索引
-					"EndNum": 15, //用户数组索引结束
-					"ItemType":""//道具 角色 场景  空为全部
-				}
-				
-				uni.request({
-					header: {
-						'Content-Type': 'application/json;charset=UTF-8'
-					},
-					url: mydata_api + '/item/getitemlist',
-					method: 'POST',
-					data: data,
-					dataType: 'json',
-					success: (res) => {
-						//100成功
-						if (res.data.Code == 100) {
-							console.log("请求全部用户", res);
-							this.dataUsers_all = res.data.Users;
-							this.pageTotalNum = parseInt(res.data.AllNumOfList/this.totalItem);
-						}
-						//200失败
-						else {
-							console.log('suc200', res);
-						}
-						uni.hideLoading();
-					},
-					fail: (res) => {
-						console.log("请求失败****");	
-						uni.hideLoading();
-					}
-				});
-			},
-			initPage() {
-				
-				uni.showLoading({
-				    title: '加载中'  
-				});
-				
-				let data = {
-					"UserID": mydata_userInfo.userID,
-					"BeginNum": 0, //用户数组索引
-					"EndNum": 15, //用户数组索引结束
-					"ItemType":""//道具 角色 场景  空为全部
-				}
-				
-				uni.request({
-					header: {
-						'Content-Type': 'application/json;charset=UTF-8'
-					},
-					url: mydata_api + '/item/getitemlist',
-					method: 'POST',
-					data: data,
-					dataType: 'json',
-					success: (res) => {
-						//100成功
-						if (res.data.Code == 100) {
-							console.log("请求全部用户", res);
-							this.dataUsers_all = res.data.Users;
-							this.pageTotalNum = parseInt(res.data.AllNumOfList/this.totalItem);
-							uni.hideLoading();
-						}
-						//200失败
-						else {
-							console.log('suc200', res);
-							uni.hideLoading();
-						}
-					},
-					fail: (res) => {
-						console.log("请求失败****");	
-						uni.hideLoading();
-					}
-				});
-			}
-		}
-	}
-</script>
-
-<style lang="scss">
-	.m_right {
-		width: 100%;
-		margin-top: 5rpx;
-		padding: 0 150rpx;
-		background-color: #fff;
-		box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
-	
-		.m_right_hander {
-			text-align: right;
-			height: 250rpx;
-			position: relative;
-	
-			.m_btn_red {
-				position: absolute;
-				height: 80rpx;
-				line-height: 80rpx;
-				padding: 0 40rpx;
-				right: 0;
-				top: 50%;
-				transform: translateY(-50%);
-				background: #EA252C;
-				color: #fff;
-			}
-		}
-	
-	}
-	tbody tr {
-		border-top: 2rpx solid #DDDDDD !important;
-	
-	}
-	
-	tbody tr th {
-		font-weight: 400 !important;
-		height: 140rpx;
-		line-height: 140rpx;
-	}
-	
-	tbody tr:hover {
-		// color: #fff;
-		background: #FDEBEC;
-		// opacity: 0.08;
-	}
-	
-	.m-table-hander {
-		background-color: #FFF8F7;
-		height: 140rpx;
-		line-height: 140rpx;
-		font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
-		font-weight: bold;
-	}
-	
-	.m_edit {
-		position: absolute;
-		top: 50%;
-		left: 50%;
-		transform: translate(-50%, -50%);
-		background: rgb(67, 127, 250);
-		color: rgb(255, 255, 255);
-		min-width: 130rpx;
-	}
-	
-	.m_delete {
-		position: absolute;
-		top: 50%;
-		left: 50%;
-		min-width: 130rpx;
-		transform: translate(-50%, -50%);
-		background: rgb(234, 37, 44);
-		color: rgb(255, 255, 255);
-	}
-	
-	.m_right_footer {
-		margin-top: 80rpx;
-	}
-	
-	.m_paging {
-		text-align: right;
-	
-		.m_paging_item {
-			padding: 10rpx 18rpx;
-			border: 1rpx solid #DDDDDD;
-			border-radius: 8rpx;
-			margin-right: 10rpx;
-		}
-	
-		.p_act {
-			background: #EA252C;
-			color: #fff;
-			border: inherit;
-		}
-	}
-	
-	.m_paging_item:hover {
-		background: #EA252C;
-		color: #fff;
-		border: inherit;
-	}
-	
-	.m_act1 {
-		color: #FF0019;
-	}
-</style>