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/main.vue |  162 +++++++++++++++++++++++++++++-------------------------
 1 files changed, 87 insertions(+), 75 deletions(-)

diff --git a/pages/index/main.vue b/pages/index/main.vue
index b12e452..aaaaa63 100644
--- a/pages/index/main.vue
+++ b/pages/index/main.vue
@@ -5,7 +5,7 @@
 		<!-- 椤堕儴鑷畾涔夊鑸� -->
 		<!-- <view class=""> -->
 
-		<tn-nav-bar fixed>
+		<tn-nav-bar fixed :isBack="false">
 			<text class="page-title">淇℃伅</text>
 		</tn-nav-bar>
 		<!-- </view> -->
@@ -16,7 +16,7 @@
 				style="margin-top: 100px;">
 
 				<view v-for="(item, index) in list" :key="index">
-				
+
 					<view>
 						<tn-button class="modal-btn" backgroundColor="#01BEFF" size="sm"
 							@click="itemClick(item,index)">澶勭悊</tn-button>
@@ -141,6 +141,7 @@
 			}, 400)
 		},
 		onLoad() {
+			console.log(4444444);
 			this.lock = false
 
 		},
@@ -152,27 +153,29 @@
 				const params = {
 					ids: this.checkboxValue1
 				}
-				moreprocessingWarn(params).then((res) => {
-					if (res.code == 0) {
-						this.$refs.refSuccess.showBox({
-							type: 'success',
-							txt: '澶勭悊鎴愬姛'
-						});
-						this.show = false
-						// location.reload();
-						this.handleRefresh({
-							page: 1,
-							size: this.pageSize
-						}, () => {
-							// 鍙互鍦ㄨ繖閲屽鐞嗗姞杞藉畬鎴愬悗鐨勯�昏緫
-						});
-					} else {
-						this.$refs.refSuccess.showBox({
-							type: 'error',
-							txt: '澶勭悊澶辫触'
-						});
-					}
-				})
+				if (this.vuex_is_login) {
+					moreprocessingWarn(params).then((res) => {
+						if (res.code == 0) {
+							this.$refs.refSuccess.showBox({
+								type: 'success',
+								txt: '澶勭悊鎴愬姛'
+							});
+							this.show = false
+							// location.reload();
+							this.handleRefresh({
+								page: 1,
+								size: this.pageSize
+							}, () => {
+								// 鍙互鍦ㄨ繖閲屽鐞嗗姞杞藉畬鎴愬悗鐨勯�昏緫
+							});
+						} else {
+							this.$refs.refSuccess.showBox({
+								type: 'error',
+								txt: '澶勭悊澶辫触'
+							});
+						}
+					})
+				}
 			},
 			checkboxChange(n) {
 				this.show = true
@@ -195,24 +198,30 @@
 					size: data.size,
 					company: this.company,
 				}
+				if (this.vuex_is_login) {
+					findwarning(params).then((res) => {
 
-				findwarning(params).then((res) => {
-					console.log(res);
-					if (res.code == 0) {
-						let list = [];
-						setTimeout(() => {
-							let list = res.data.map(item => ({
-								...item,
-								checked: false // 鍒濆鍖朿hecked灞炴�т负false
-							}));
-							this.list = [...this.list, ...list];
-							callback({
-								list: this.list,
-								total: res.data.length
-							});
-						}, 1500);
-					}
-				})
+						if (res.code == 0) {
+							let list = [];
+							setTimeout(() => {
+								let list = res.data.map(item => ({
+									...item,
+									checked: false // 鍒濆鍖朿hecked灞炴�т负false
+								}));
+								this.list = [...this.list, ...list];
+								callback({
+									list: this.list,
+									total: res.data.length
+								});
+							}, 1500);
+						}
+					})
+				}else{
+					callback({
+						list: [],
+						total: 0
+					});
+				}
 			},
 			handleSearch(data, callback) {
 				const params = {
@@ -221,52 +230,55 @@
 					objectid: this.keyword,
 					company: this.company,
 				}
-
-				findwarning(params).then((res) => {
-					this.list = []
-					if (res.code == 0) {
-						let list = [];
-						setTimeout(() => {
+				if (this.vuex_is_login) {
+					findwarning(params).then((res) => {
+						this.list = []
+						if (res.code == 0) {
 							let list = [];
-							for (var i = 0; i < res.data.length; i++) {
-								list.push(res.data[i]);
-							}
-							this.list = [...this.list, ...list];
-							callback({
-								list: this.list,
-								total: res.data.length
-							});
-						}, 1500);
-					}
-				})
+							setTimeout(() => {
+								let list = [];
+								for (var i = 0; i < res.data.length; i++) {
+									list.push(res.data[i]);
+								}
+								this.list = [...this.list, ...list];
+								callback({
+									list: this.list,
+									total: res.data.length
+								});
+							}, 1500);
+						}
+					})
+				}
 			},
 			// 妯℃嫙璇锋眰鏁版嵁鍒锋柊
 			handleRefresh(data, callback) {
 				const params = {
 					current: data.page,
 					size: data.size,
+					objectid: data.objectid,
 					company: this.company,
 				}
-				findwarning(params).then((res) => {
-					if (res.code == 0) {
-						let list = [];
-						setTimeout(() => {
+				if (this.vuex_is_login) {
+					findwarning(params).then((res) => {
+						if (res.code == 0) {
 							let list = [];
-							for (var i = 0; i < res.data.length; i++) {
-								list.push(res.data[i]);
-							}
-							this.list = []
-							this.list = [...this.list, ...list];
-							callback({
-								list: this.list,
-								total: res.data.length
-							});
-						}, 1500);
-					}
-				})
+							setTimeout(() => {
+								let list = [];
+								for (var i = 0; i < res.data.length; i++) {
+									list.push(res.data[i]);
+								}
+								this.list = []
+								this.list = [...this.list, ...list];
+								callback({
+									list: this.list,
+									total: res.data.length
+								});
+							}, 1500);
+						}
+					})
+				}
 			},
 			itemClick(item, index) {
-				console.log('鐐瑰嚮浜�', item);
 				this.lock = true
 				this.warlist = item
 				this.warnindex = index
@@ -276,7 +288,7 @@
 			},
 			prosuccess(e) {
 				this.lock = false
-				
+
 				if (e == '宸插鐞�') {
 					this.$refs.refSuccess.showBox({
 						type: 'success',

--
Gitblit v1.9.3