xiaocao преди 5 месеца
родител
ревизия
02f614089c
променени са 5 файла, в които са добавени 57 реда и са изтрити 32 реда
  1. 2 1
      common/config.js
  2. 2 3
      config/api.js
  3. 29 26
      pages/index/index.vue
  4. 13 1
      pages/tabbar/visitor.vue
  5. 11 1
      pagesA/task/detail.vue

+ 2 - 1
common/config.js

@@ -3,8 +3,9 @@
  */
 
 const config = {
-	DEVE_URL: "http://cht320621.gnway.cc:22075",
+	// DEVE_URL: "http://cht320621.gnway.cc:22075",
 	// 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/',

+ 2 - 3
config/api.js

@@ -41,9 +41,8 @@ prefix = ''
 export const getDept = (data) => http.get(prefix + '/system/info/deptList?parentId=' + data.parentId)
 export const selectUser = (data) => http.get(prefix + '/system/info/selectUser?deptId=' + data.deptId)
 export const addVisit = (data) => http.post(prefix + '/system/info/addVisit', data) // 提交访客申请
-export const getVisitList = (data) => http.get(prefix + '/system/info/list?visitStatus=' + data.visitStatus +
-	'&userId=' + data.userId) // 获取访客记录列表
-export const updateVisitInfo = (data) => http.post(prefix + '/system/info/updateVisitInfo', data) // 更新访客状态(通过/拒绝)
+export const getVisitList = (data) => http.get(prefix + '/system/info/list' + (data.visitStatus ? '?visitStatus=' + data.visitStatus + '&userId=' + data.userId : '?userId=' + data.userId)) // 获取访客记录列表
+export const updateVisitInfo = (data) => http.get(prefix + '/system/info/updateVisitInfo'+'?id=' + data.id + '&visitStatus=' + data.visitStatus)  // 更新访客状态(通过/拒绝)
 // export const getFeedback = (data) => http.get(prefix + '/blade-feedback/getFeedback')
 // export const feedbackSave = (params) => http.post(prefix + '//blade-feedback/save', params) // 意见反馈
 /**

+ 29 - 26
pages/index/index.vue

@@ -135,21 +135,21 @@
 		</view>
 
 		<!-- 提交成功弹框 -->
-		<!--		<uni-popup ref="successPopup" type="center" :mask-click="false">-->
-		<!--			<view class="success-popup">-->
-		<!--				<view class="popup-content">-->
-		<!--					<view class="success-icon">-->
-		<!--						<uni-icons type="checkmarkempty" size="60" color="#52c41a"></uni-icons>-->
-		<!--					</view>-->
-		<!--					<view class="popup-title">申请提交成功</view>-->
-		<!--					<view class="popup-message">您的申请已成功提交,请关注公众号即时查询审核结果</view>-->
-		<!--					<view class="popup-buttons">-->
-		<!--						<button class="cancel-btn" @click="closeSuccessPopup">取消</button>-->
-		<!--						<button class="follow-btn" @click="showQRCode">关注</button>-->
-		<!--					</view>-->
-		<!--				</view>-->
-		<!--			</view>-->
-		<!--		</uni-popup>-->
+				<uni-popup ref="successPopup" type="center" :mask-click="false">
+					<view class="success-popup">
+						<view class="popup-content">
+							<view class="success-icon">
+								<uni-icons type="checkmarkempty" size="60" color="#52c41a"></uni-icons>
+							</view>
+							<view class="popup-title">申请提交成功</view>
+							<view class="popup-message">您的申请已成功提交,请关注公众号即时查询审核结果</view>
+							<view class="popup-buttons">
+								<button class="cancel-btn" @click="closeSuccessPopup">取消</button>
+								<button class="follow-btn" @click="showQRCode">关注</button>
+							</view>
+						</view>
+					</view>
+				</uni-popup>
 
 		<!-- 授权登录组件 -->
 		<auth-login-popup ref="authLoginPopup" @success="onLoginSuccess" @close="onLoginClose"></auth-login-popup>
@@ -218,7 +218,7 @@
 			// 页面渲染完成后再次获取,确保准确
 			this.getTabbarHeight()
 			// 打开授权登录弹窗
-			this.$refs.authLoginPopup.open()
+			// this.$refs.authLoginPopup.open()
 		},
 		methods: {
 			// 获取tabbar高度
@@ -553,22 +553,24 @@
 
 					// 检查返回结果(支持 code === 200 或 code === "200")
 					if (response && (response.code === 200 || response.code === "200")) {
+						this.$refs.authLoginPopup.open()
 						uni.showToast({
 							title: response.msg || '操作成功',
 							icon: 'success',
 							duration: 2000
 						});
+						this.$refs.successPopup.open();
 						// 延迟返回上一页
-						setTimeout(() => {
-							uni.navigateBack({
-								fail: () => {
-									// 如果返回失败,跳转到访客页面
-									uni.switchTab({
-										url: '/pages/tabbar/visitor'
-									});
-								}
-							});
-						}, 2000);
+						// setTimeout(() => {
+						// 	uni.navigateBack({
+						// 		fail: () => {
+						// 			// 如果返回失败,跳转到访客页面
+						// 			uni.switchTab({
+						// 				url: '/pages/tabbar/visitor'
+						// 			});
+						// 		}
+						// 	});
+						// }, 2000);
 					} else {
 						// 提交失败
 						uni.showToast({
@@ -587,6 +589,7 @@
 						duration: 2000
 					});
 				}
+
 			},
 
 			// 关闭成功弹框

+ 13 - 1
pages/tabbar/visitor.vue

@@ -81,8 +81,18 @@
 			this.getList();
 
 		},
+
 		onShow() {
 
+			// 监听刷新列表事件
+			uni.$on('refreshVisitList', () => {
+				this.refresh();
+			});
+		},
+
+		onUnload() {
+			// 移除事件监听
+			// uni.$off('refreshVisitList');
 		},
 		onPullDownRefresh() {
 			this.refresh()
@@ -127,10 +137,12 @@
 				this.loadMoreStatus = 'loading'
 
 				try {
+
+
 					// 调用接口获取数据
 					const response = await getVisitList({
 						userId: 100,
-						visitStatus: this.visitStatus || '0' // 可以根据需要传递状态参数,空字符串表示获取所有状态
+						// visitStatus: this.visitStatus || '0' // 可以根据需要传递状态参数,空字符串表示获取所有状态
 					});
 
 					console.log('访客列表接口返回:', response);

+ 11 - 1
pagesA/task/detail.vue

@@ -95,6 +95,7 @@
 
 		<!-- 操作按钮 - 仅待审核状态显示 -->
 		<view class="action-container" v-if="visitDetail.status === '待审核'">
+<!--			<view class="action-container">-->
 			<button class="reject-btn" @click="handleReject">拒绝</button>
 			<button class="approve-btn" @click="handleApprove">通过</button>
 		</view>
@@ -222,12 +223,14 @@
 			handleReject() {
 				this.confirmAction = 'reject';
 				this.$refs.confirmPopup.open();
+
 			},
 
 			// 处理通过
 			handleApprove() {
 				this.confirmAction = 'approve';
 				this.$refs.confirmPopup.open();
+
 			},
 
 			// 取消操作
@@ -248,7 +251,7 @@
 					// 调用接口,状态改为 1=已访问(通过)
 					const response = await updateVisitInfo({
 						id: this.visitDetail.id,
-						visitStatus: '1'
+						visitStatus: '0'
 					});
 
 					uni.hideLoading();
@@ -262,6 +265,9 @@
 						this.resultTitle = '审核通过';
 						this.resultMessage = '访问申请已通过,访客将收到通知';
 						this.$refs.resultPopup.open();
+
+						// 通知 visitor.vue 刷新列表
+						uni.$emit('refreshVisitList');
 					} else {
 						uni.showToast({
 							title: response.msg || '操作失败',
@@ -276,6 +282,7 @@
 						icon: 'none'
 					});
 				}
+
 			},
 
 			// 确认拒绝
@@ -304,6 +311,8 @@
 						this.resultTitle = '审核完成';
 						this.resultMessage = '访问申请已拒绝,访客将收到通知';
 						this.$refs.resultPopup.open();
+// 通知 visitor.vue 刷新列表
+						uni.$emit('refreshVisitList');
 					} else {
 						uni.showToast({
 							title: response.msg || '操作失败',
@@ -318,6 +327,7 @@
 						icon: 'none'
 					});
 				}
+
 			},
 
 			// 关闭结果弹框