From c5e49c10499435802a6551b98772f95660c6f85a Mon Sep 17 00:00:00 2001
From: 王飞 <14095171+wang-fei12345@user.noreply.gitee.com>
Date: 星期五, 07 三月 2025 09:15:56 +0800
Subject: [PATCH] 定位app首次提交

---
 pages/index/equipment.vue |  184 ++++++++++++++++++---------------------------
 1 files changed, 75 insertions(+), 109 deletions(-)

diff --git a/pages/index/equipment.vue b/pages/index/equipment.vue
index c779a85..ad7a074 100644
--- a/pages/index/equipment.vue
+++ b/pages/index/equipment.vue
@@ -2,7 +2,7 @@
 	<view class="template-job tn-safe-area-inset-bottom tn-skeleton">
 
 		<!-- 椤堕儴鑷畾涔夊鑸� -->
-		<tn-nav-bar fixed style="position: absolute;z-index: 999999999;">
+		<tn-nav-bar fixed :isBack="false" style="position: absolute;z-index: 999999999;">
 			<text v-if="isAchor==false" class="title_linespan" style="color: #00aaff;text-decoration: underline;"
 				@click="goAchor">鍩虹珯</text>
 			<text v-else class="title_linespan" @click="goAchor">鍩虹珯</text>
@@ -10,16 +10,17 @@
 		</tn-nav-bar>
 
 		<view v-show="lock==false" class="page-wrap u-skeleton">
-			<view style="display: flex;width: 50%;left: 5%":style="{display:'flex', top: topheight+'px',position: 'absolute',width: '50%',left: '5%'}">
-			
+			<view style="display: flex;width: 50%;left: 5%"
+				:style="{display:'flex', top: topheight+'px',position: 'absolute',width: '50%',left: '5%'}">
+
 				<view style="color: #00aaff;">鍦ㄧ嚎锛歿{online}}</view>
 				<view style="color: #00aaff;margin-left: 20px;">绂荤嚎锛歿{offline}}</view>
 			</view>
 			<!-- <u-search class="searchbg" shape="true" bg-color="rgba(255, 255, 255, 0.5)" placeholder="璇疯緭鍏ュ悕绉�" :show-action="false" v-model="keyword" @search="searchxinxi"
 						:style="{top: topheight+'px',position: 'absolute',width: '90%',left: '5%'}"></u-search> -->
-			<data-list :width = "width" class="data-list" ref="list" @load="handleLoad" @refresh="handleRefresh"
+			<data-list :width="width" class="data-list" ref="list" @load="handleLoad" @refresh="handleRefresh"
 				style="margin-top: 100px;">
-				
+
 
 				<view v-for="(item, index) in list" :key="index">
 					<!-- <view class="avatar"></view> -->
@@ -30,8 +31,7 @@
 					<view style="display: flex;margin-bottom: 10px;" class="flex flex-direction">
 						<u-badge v-if="item.anchormode==1" style="margin-top: 8px;margin-right: 8px;" :isDot="true"
 							type="success"></u-badge>
-						<u-badge v-else style="margin-top: 8px;margin-right: 8px;" :isDot="true"
-							type="info"></u-badge>
+						<u-badge v-else style="margin-top: 8px;margin-right: 8px;" :isDot="true" type="info"></u-badge>
 						<view>缂栧彿:{{item.anchorid}}</view>
 						<view v-if="item.anchormode==1" style="margin-left: 20px;">鍦ㄧ嚎</view>
 						<view v-else style="margin-left: 20px;">绂荤嚎</view>
@@ -51,17 +51,9 @@
 					<u-line style="margin-left: 14px;margin-bottom: 10px;"></u-line>
 					<!-- <view style="margin-left: 10px; background-color: rgba(255, 181, 166, 1.0); " >{{item.type}}</view> -->
 					<!-- </view> -->
-
-
-
-
-
 				</view>
-
-
 			</data-list>
 		</view>
-
 		<tn-skeleton :show="showSkeleton"></tn-skeleton>
 		<successCom ref="refSuccess"></successCom>
 		<!-- <u-empty text="鏆傛湭寮�鏀�" mode="list" style="width: 90%; top: 30%;left: 5%; position: absolute; "></u-empty> -->
@@ -93,7 +85,7 @@
 		},
 		data() {
 			return {
-				width:'40%',
+				width: '40%',
 				online: 0,
 				offline: 0,
 				isAchor: false,
@@ -142,7 +134,6 @@
 			}
 		},
 		mounted() {
-			console.log("鎵撳嵃鏁版嵁=======銆嬨�嬨�嬨�嬨�嬨�嬨�嬨�嬨��");
 			this.topheight = this.vuex_custom_bar_height + 15
 			setTimeout(() => {
 				this.showSkeleton = false
@@ -166,16 +157,10 @@
 			goAchor() {
 				// this.isAchor = true
 				this.lock = false
-				console.log(2323323);
 			},
 			goTag() {
 				this.isAchor = false
 				this.lock = true
-				console.log(2323323);
-				// findTag
-				// uni.reLaunch({
-				// 	url: '/pages/index/tag'
-				// });
 			},
 
 			// 妯℃嫙璇锋眰鍔犺浇鏁版嵁
@@ -185,109 +170,90 @@
 					size: data.size,
 					company: this.company,
 				}
-
-				findAchor(params).then((res) => {
-					console.log(res);
-					this.online = res.online
-					this.offline = res.offline
-					if (res.code == 0) {
-						let list = [];
-						setTimeout(() => {
+				if (this.vuex_is_login) {
+					findAchor(params).then((res) => {
+						this.online = res.online
+						this.offline = res.offline
+						if (res.code == 0) {
 							let list = [];
-							for (var i = 0; i < res.data.records.length; i++) {
-								list.push(res.data.records[i]);
-							}
-							console.log(list);
-							this.list = [...this.list, ...list];
-							callback({
-								list: this.list,
-								total: res.data.total
-							});
-						}, 1500);
-					}
-				})
+							setTimeout(() => {
+								let list = [];
+								for (var i = 0; i < res.data.records.length; i++) {
+									list.push(res.data.records[i]);
+								}
+								this.list = [...this.list, ...list];
+								callback({
+									list: this.list,
+									total: res.data.total
+								});
+							}, 1500);
+						}
+					})
+				}else{
+					callback({
+						list: [],
+						total: 0
+					});
+				}
 			},
 			handleSearch(data, callback) {
-				console.log(555555555);
 				const params = {
 					current: 1,
 					size: 10,
 					objectid: this.keyword,
+					company: this.company,
 				}
-
-				findAchor(params).then((res) => {
-					console.log(res);
-					this.online = res.online
-					this.offline = res.offline
-					this.list = []
-					if (res.code == 0) {
-						let list = [];
-						setTimeout(() => {
+				if (this.vuex_is_login) {
+					findAchor(params).then((res) => {
+						this.online = res.online
+						this.offline = res.offline
+						this.list = []
+						if (res.code == 0) {
 							let list = [];
-							for (var i = 0; i < res.data.records.length; i++) {
-								list.push(res.data.records[i]);
-							}
-							console.log(list);
-							this.list = [...this.list, ...list];
-							callback({
-								list: this.list,
-								total: res.data.total
-							});
-						}, 1500);
-					}
-				})
-				// let name = this.keyword
-				// console.log();
-				// findPerson(name).then((res) => {
-				// 	if (res.code == 0) {
-				// 		this.perlist = res.data
-				// 		console.log(this.perlist);
-				// 	} else {
-				// 		this.$refs.refSuccess.showBox({
-				// 			type: 'error',
-				// 			txt: res.msg
-				// 		});
-				// 	}
-				// })
-
+							setTimeout(() => {
+								let list = [];
+								for (var i = 0; i < res.data.records.length; i++) {
+									list.push(res.data.records[i]);
+								}
+								this.list = [...this.list, ...list];
+								callback({
+									list: this.list,
+									total: res.data.total
+								});
+							}, 1500);
+						}
+					})
+				}
 			},
 			// 妯℃嫙璇锋眰鏁版嵁鍒锋柊
 			handleRefresh(data, callback) {
-				console.log(555555555555555);
 				const params = {
 					current: data.page,
 					size: data.size,
+					objectid: data.objectid,
+					company: this.company,
 				}
-				console.log(data);
-				findAchor(data).then((res) => {
-					this.online = res.online
-					this.offline = res.offline
-					if (res.code == 0) {
-						let list = [];
-						setTimeout(() => {
+				if (this.vuex_is_login) {
+					findAchor(params).then((res) => {
+						this.online = res.online
+						this.offline = res.offline
+						if (res.code == 0) {
 							let list = [];
-							for (var i = 0; i < res.data.records.length; i++) {
-								list.push(res.data.records[i]);
-							}
-							console.log(list);
-							this.list = []
-							this.list = [...this.list, ...list];
-							console.log(this.list);
-							callback({
-								list: this.list,
-								total: res.data.total
-							});
-						}, 1500);
-					}
-				})
-				// console.log(2222222222);
-				// setTimeout(() => {
-				// 	this.list = [];
-				// 	for (var i = 0; i < 3; i++) {
-				// 		this.list.push(i);
-				// 	}
-				// 	callback({ list: this.list, total: 30 });
-				// }, 1500);
+							setTimeout(() => {
+								let list = [];
+								for (var i = 0; i < res.data.records.length; i++) {
+									list.push(res.data.records[i]);
+								}
+								this.list = []
+								this.list = [...this.list, ...list];
+								callback({
+									list: this.list,
+									total: res.data.total
+								});
+							}, 1500);
+						}
+					})
+				}
 			},
 		}
 	}

--
Gitblit v1.9.3