Kaynağa Gözat

修复多处bug 刷新

xiaocao 5 ay önce
ebeveyn
işleme
fae3244c14
4 değiştirilmiş dosya ile 28 ekleme ve 24 silme
  1. 2 2
      common/config.js
  2. 1 1
      pages/index/index.vue
  3. 10 6
      pages/tabbar/my.vue
  4. 15 15
      pages/tabbar/visitor.vue

+ 2 - 2
common/config.js

@@ -4,8 +4,8 @@
 
 const config = {
 	// DEVE_URL: "http://cht320621.gnway.cc:22075",
-	DEVE_URL: "http://192.168.16.9:9002",
-	// DEVE_URL: "https://zhijidaouniapp.dianjingkeji.net/prod-api",
+	// DEVE_URL: "http://192.168.16.9:9002",
+	DEVE_URL: "https://zhijidaouniapp.dianjingkeji.net/prod-api",
 	// PRODUCT_URL: "http://localhost:8085",
 	PRODUCT_URL: "https://api.ndtk.site/api",
 	IMG_URL: 'https://abinmalm.oss-cn-shenzhen.aliyuncs.com/icon/',

+ 1 - 1
pages/index/index.vue

@@ -559,7 +559,7 @@
 			// 构建提交数据
 			const submitData = {
 				visitDate: this.formData.visitTime, // 访问时间
-				// userId: this.formData.employeeId, // 员工id(从选择的员工中获取user_id)后端不用了
+				userId: this.formData.employeeId, // 员工id(从选择的员工中获取user_id)后端不用了
 				empName: this.formData.employeeName, // 访问部门人(员工姓名)
 				visDept: this.formData.department, // 访客部门
 				visitPerson: this.formData.visitorName, // 访客姓名

+ 10 - 6
pages/tabbar/my.vue

@@ -8,7 +8,8 @@
 		<!-- 内容区域 -->
 		<view class="content-area">
 			<!-- 访客信息表单 -->
-			<view class="visitor-form" @tap="goLogin">
+<!--			<view class="visitor-form" @tap="goLogin">-->
+				<view class="visitor-form" >
 				<view v-if="isLogin">
 					<view class="form-item">
 						<text class="label">姓名</text>
@@ -178,21 +179,24 @@ import {
 							// 更新store状态
 							this.$store.commit('isLogin', true);
 							this.isEmployeeLogin = true
-            this.getUserInfo()
+                this.getUserInfo()
 							// uni.switchTab({
 							// 	url: '/pages/tabbar/home' // 替换为实际首页路径
 							// });
 						} else {
-							throw new Error('微信登录接口返回异常');
+							console.log('微信登录接口返回异常');
+							uni.navigateTo({
+								url: '/pagesA/public/phone-login'
+							});
 						}
 
 					} catch (error) {
 						console.error('登录失败:', error);
 
 						// 4. 微信授权或登录失败,跳转到手机号登录页
-						uni.navigateTo({
-							url: '/pagesA/public/phone-login'
-						});
+						// uni.navigateTo({
+						// 	url: '/pagesA/public/phone-login'
+						// });
 					}
 
 					// uni.navigateTo({

+ 15 - 15
pages/tabbar/visitor.vue

@@ -121,7 +121,7 @@
 			// Refresh list
 			refresh() {
 				this.visitList = []
-				this.params.current = 1
+				// this.params.current = 1
 				this.hasMore = true
 				this.loadMoreStatus = 'loadmore'
 				this.getList()
@@ -129,10 +129,10 @@
 
 			// Handle reaching bottom of scroll
 			onReachBottom() {
-				if (!this.hasMore || this.loadMoreStatus === 'loading') return
-
-				this.params.current++
-				this.getList(true)
+				// if (!this.hasMore || this.loadMoreStatus === 'loading') return
+				//
+				// this.params.current++
+				// this.getList(true)
 			},
 
 			// Get status class for styling
@@ -215,16 +215,16 @@
 							};
 						});
 
-						if (loadMore) {
-							this.visitList = [...this.visitList, ...list];
-						} else {
-							this.visitList = list;
-						}
-
-						// 根据返回的数据判断是否还有更多数据
-						// 这里简单处理,如果返回的数据少于每页数量,说明没有更多了
-						this.hasMore = response.rows.length >= this.params.size;
-						this.loadMoreStatus = this.hasMore ? 'loadmore' : 'nomore';
+						// if (loadMore) {
+						// 	this.visitList = [...this.visitList, ...list];
+						// } else {
+						// 	this.visitList = list;
+						// }
+						//
+						// // 根据返回的数据判断是否还有更多数据
+						// // 这里简单处理,如果返回的数据少于每页数量,说明没有更多了
+						// this.hasMore = response.rows.length >= this.params.size;
+						// this.loadMoreStatus = this.hasMore ? 'loadmore' : 'nomore';
 					} else {
 						uni.showToast({
 							title: response.msg || '获取数据失败',