Merge branch '6.3'
Showing
3 changed files
with
83 additions
and
71 deletions
| ... | @@ -248,25 +248,6 @@ | ... | @@ -248,25 +248,6 @@ |
| 248 | </view> | 248 | </view> |
| 249 | </uni-popup> | 249 | </uni-popup> |
| 250 | 250 | ||
| 251 | <!-- 调动确认弹框 --> | ||
| 252 | <uni-popup ref="transferPopup" class="add-student-popup" type="center" :mask-click="false" style="z-index: 1001"> | ||
| 253 | <view class="add-popup"> | ||
| 254 | <view class="popup-title">系统提示</view> | ||
| 255 | <view class="popup-content"> | ||
| 256 | <view class="transfer-tip"> | ||
| 257 | 该人员已在其他机构登记,是否申请调入? | ||
| 258 | </view> | ||
| 259 | <view class="transfer-tip sub-tip"> | ||
| 260 | 如仅办理业务,请前往业务页面,点击【添加】直接办理。 | ||
| 261 | </view> | ||
| 262 | </view> | ||
| 263 | <view class="popup-btns"> | ||
| 264 | <view class="popup-btn cancel" @click="handleTransfer">调动</view> | ||
| 265 | <view class="popup-btn confirm" @click="handleAddFromTransfer">添加</view> | ||
| 266 | </view> | ||
| 267 | </view> | ||
| 268 | </uni-popup> | ||
| 269 | |||
| 270 | <custom-modal | 251 | <custom-modal |
| 271 | ref="confirmModalRef" | 252 | ref="confirmModalRef" |
| 272 | :title="confirmModal.title" | 253 | :title="confirmModal.title" |
| ... | @@ -358,7 +339,6 @@ const range = ref([{ | ... | @@ -358,7 +339,6 @@ const range = ref([{ |
| 358 | 339 | ||
| 359 | // 添加考生弹框相关 | 340 | // 添加考生弹框相关 |
| 360 | const addPopup = ref(null) | 341 | const addPopup = ref(null) |
| 361 | const transferPopup = ref(null) | ||
| 362 | const addForm = ref({ | 342 | const addForm = ref({ |
| 363 | name: '', | 343 | name: '', |
| 364 | idcType: '0', | 344 | idcType: '0', |
| ... | @@ -696,26 +676,6 @@ function closeAddPopup() { | ... | @@ -696,26 +676,6 @@ function closeAddPopup() { |
| 696 | addPopup.value?.close() | 676 | addPopup.value?.close() |
| 697 | } | 677 | } |
| 698 | 678 | ||
| 699 | // 关闭调动确认弹框 | ||
| 700 | function closeTransferPopup() { | ||
| 701 | transferPopup.value?.close() | ||
| 702 | } | ||
| 703 | |||
| 704 | // 跳转调动页面 | ||
| 705 | function handleTransfer() { | ||
| 706 | closeTransferPopup() | ||
| 707 | addPopup.value?.close() | ||
| 708 | uni.navigateTo({ | ||
| 709 | url: `/personalVip/mobilize` | ||
| 710 | }) | ||
| 711 | } | ||
| 712 | |||
| 713 | // 从调动弹框点击添加 | ||
| 714 | async function handleAddFromTransfer() { | ||
| 715 | closeTransferPopup() | ||
| 716 | await handelAddPerson() | ||
| 717 | } | ||
| 718 | |||
| 719 | // 证件类型选择 | 679 | // 证件类型选择 |
| 720 | function onIdcTypeChange(e) { | 680 | function onIdcTypeChange(e) { |
| 721 | idcTypeIndex.value = e.detail.value | 681 | idcTypeIndex.value = e.detail.value |
| ... | @@ -729,24 +689,7 @@ async function confirmAdd() { | ... | @@ -729,24 +689,7 @@ async function confirmAdd() { |
| 729 | return | 689 | return |
| 730 | } | 690 | } |
| 731 | 691 | ||
| 732 | uni.showLoading({ title: '校验中...', mask: true }) | 692 | await handelAddPerson() |
| 733 | |||
| 734 | try { | ||
| 735 | const checkRes = await api.inMyMember({ idcCode: addForm.value.idcCode }) | ||
| 736 | uni.hideLoading() | ||
| 737 | |||
| 738 | if (checkRes.data) { | ||
| 739 | // 人员已存在,直接添加 | ||
| 740 | await handelAddPerson() | ||
| 741 | } else { | ||
| 742 | // 人员不在本机构,显示自定义确认弹框(不关闭添加弹框,保留表单数据) | ||
| 743 | closeLevelDropdown() | ||
| 744 | transferPopup.value?.open() | ||
| 745 | } | ||
| 746 | } catch (err) { | ||
| 747 | uni.hideLoading() | ||
| 748 | console.log(err) | ||
| 749 | } | ||
| 750 | } | 693 | } |
| 751 | 694 | ||
| 752 | // 执行添加考生 | 695 | // 执行添加考生 | ... | ... |
| ... | @@ -2,9 +2,12 @@ | ... | @@ -2,9 +2,12 @@ |
| 2 | <view class="exam-point-list"> | 2 | <view class="exam-point-list"> |
| 3 | <!-- 顶部申请按钮 --> | 3 | <!-- 顶部申请按钮 --> |
| 4 | <view v-if="status==0" class="apply-btn-box"> | 4 | <view v-if="status==0" class="apply-btn-box"> |
| 5 | <button :disabled="memberInfo.isPoints==0 || formInfo.auditStatus==1" class="apply-btn" | 5 | <button :disabled="isApplyDisabled" class="apply-btn" |
| 6 | @click="goApply">申请考点 | 6 | @click="goApply">申请考点 |
| 7 | </button> | 7 | </button> |
| 8 | <view :class="{ refreshing: refreshing }" class="refresh-icon" @click="refreshStatus()"> | ||
| 9 | <uni-icons color="#C4121B" size="24" type="refreshempty"></uni-icons> | ||
| 10 | </view> | ||
| 8 | </view> | 11 | </view> |
| 9 | 12 | ||
| 10 | <!-- 列表 --> | 13 | <!-- 列表 --> |
| ... | @@ -51,33 +54,75 @@ | ... | @@ -51,33 +54,75 @@ |
| 51 | </template> | 54 | </template> |
| 52 | 55 | ||
| 53 | <script setup> | 56 | <script setup> |
| 54 | import {ref} from 'vue' | 57 | import {computed, ref} from 'vue' |
| 55 | import {onLoad, onShow, onReachBottom} from '@dcloudio/uni-app' | 58 | import {onLoad, onShow, onReachBottom} from '@dcloudio/uni-app' |
| 56 | import {getMyRecentExam} from '@/common/api' | 59 | import {getMyOwnMemberInfo, getMyRecentExam} from '@/common/api' |
| 57 | 60 | ||
| 58 | const app = getApp() | 61 | const app = getApp() |
| 59 | const list = ref([]) | 62 | const list = ref([]) |
| 60 | const loading = ref(false) | 63 | const loading = ref(false) |
| 64 | const refreshing = ref(false) | ||
| 61 | const noMore = ref(false) | 65 | const noMore = ref(false) |
| 62 | const pageNum = ref(1) | 66 | const pageNum = ref(1) |
| 63 | const pageSize = ref(10) | 67 | const pageSize = ref(10) |
| 64 | const memberInfo = app.globalData.memberInfo | 68 | const memberInfo = ref(app.globalData.memberInfo || {}) |
| 65 | const formInfo = ref({}) | 69 | const formInfo = ref({}) |
| 66 | const status = ref(0) | 70 | const status = ref(0) |
| 71 | |||
| 72 | const isApplyDisabled = computed(() => { | ||
| 73 | const auditStatus = String(formInfo.value?.auditStatus ?? '') | ||
| 74 | const isPoints = String(memberInfo.value?.isPoints ?? '') | ||
| 75 | return isPoints === '0' || auditStatus === '1' || auditStatus === '2' | ||
| 76 | }) | ||
| 77 | |||
| 67 | onShow(() => { | 78 | onShow(() => { |
| 68 | loadData() | 79 | refreshStatus(false) |
| 69 | }) | 80 | }) |
| 70 | 81 | ||
| 71 | onLoad((option) => { | 82 | onLoad((option) => { |
| 72 | status.value = option.status ?? 0 | 83 | status.value = option.status ?? 0 |
| 73 | loadData() | 84 | refreshStatus(false) |
| 74 | }) | 85 | }) |
| 75 | 86 | ||
| 76 | function loadData() { | 87 | async function refreshMemberInfo() { |
| 77 | if (loading.value) return | 88 | try { |
| 89 | const res = await getMyOwnMemberInfo() | ||
| 90 | if (res?.data?.memberInfo) { | ||
| 91 | app.globalData.authenticationStatus = res.data.authenticationStatus | ||
| 92 | app.globalData.memberInfo = res.data.memberInfo | ||
| 93 | app.globalData.isExam = res.data.memberInfo?.isPoints | ||
| 94 | memberInfo.value = res.data.memberInfo | ||
| 95 | } | ||
| 96 | } catch (e) { | ||
| 97 | console.error('刷新会员信息失败', e) | ||
| 98 | } | ||
| 99 | } | ||
| 100 | |||
| 101 | async function refreshStatus(showToast = true) { | ||
| 102 | if (loading.value || refreshing.value) return | ||
| 103 | refreshing.value = true | ||
| 104 | pageNum.value = 1 | ||
| 105 | noMore.value = false | ||
| 106 | try { | ||
| 107 | await refreshMemberInfo() | ||
| 108 | await loadData(true) | ||
| 109 | if (showToast) { | ||
| 110 | uni.showToast({ | ||
| 111 | title: '已刷新', | ||
| 112 | icon: 'none' | ||
| 113 | }) | ||
| 114 | } | ||
| 115 | } finally { | ||
| 116 | refreshing.value = false | ||
| 117 | } | ||
| 118 | } | ||
| 119 | |||
| 120 | function loadData(reset = false) { | ||
| 121 | if (loading.value) return Promise.resolve() | ||
| 78 | loading.value = true | 122 | loading.value = true |
| 79 | 123 | if (reset) list.value = [] | |
| 80 | getMyRecentExam().then(res => { | 124 | |
| 125 | return getMyRecentExam().then(res => { | ||
| 81 | formInfo.value = res.data ?? {} | 126 | formInfo.value = res.data ?? {} |
| 82 | if (res.data && res.data.auditLogs) { | 127 | if (res.data && res.data.auditLogs) { |
| 83 | try { | 128 | try { |
| ... | @@ -88,6 +133,7 @@ function loadData() { | ... | @@ -88,6 +133,7 @@ function loadData() { |
| 88 | } else { | 133 | } else { |
| 89 | list.value = [] | 134 | list.value = [] |
| 90 | } | 135 | } |
| 136 | noMore.value = true | ||
| 91 | }).finally(() => { | 137 | }).finally(() => { |
| 92 | loading.value = false | 138 | loading.value = false |
| 93 | }) | 139 | }) |
| ... | @@ -101,6 +147,7 @@ onReachBottom(() => { | ... | @@ -101,6 +147,7 @@ onReachBottom(() => { |
| 101 | }) | 147 | }) |
| 102 | 148 | ||
| 103 | function goApply() { | 149 | function goApply() { |
| 150 | if (isApplyDisabled.value) return | ||
| 104 | uni.navigateTo({ | 151 | uni.navigateTo({ |
| 105 | url: '/pages/index/notice-examPointApply' | 152 | url: '/pages/index/notice-examPointApply' |
| 106 | }) | 153 | }) |
| ... | @@ -132,10 +179,13 @@ function formatDate(dateStr) { | ... | @@ -132,10 +179,13 @@ function formatDate(dateStr) { |
| 132 | 179 | ||
| 133 | .apply-btn-box { | 180 | .apply-btn-box { |
| 134 | padding: 20rpx 30rpx; | 181 | padding: 20rpx 30rpx; |
| 182 | display: flex; | ||
| 183 | align-items: center; | ||
| 184 | gap: 20rpx; | ||
| 135 | } | 185 | } |
| 136 | 186 | ||
| 137 | .apply-btn { | 187 | .apply-btn { |
| 138 | width: 100%; | 188 | flex: 1; |
| 139 | height: 80rpx; | 189 | height: 80rpx; |
| 140 | line-height: 80rpx; | 190 | line-height: 80rpx; |
| 141 | background: #C4121B; | 191 | background: #C4121B; |
| ... | @@ -156,6 +206,24 @@ function formatDate(dateStr) { | ... | @@ -156,6 +206,24 @@ function formatDate(dateStr) { |
| 156 | } | 206 | } |
| 157 | } | 207 | } |
| 158 | 208 | ||
| 209 | .refresh-icon { | ||
| 210 | width: 80rpx; | ||
| 211 | height: 80rpx; | ||
| 212 | border-radius: 50%; | ||
| 213 | background: #fff; | ||
| 214 | border: 2rpx solid #f0d0d2; | ||
| 215 | display: flex; | ||
| 216 | align-items: center; | ||
| 217 | justify-content: center; | ||
| 218 | box-shadow: 0 6rpx 18rpx rgba(196, 18, 27, 0.08); | ||
| 219 | } | ||
| 220 | |||
| 221 | .refresh-icon.refreshing { | ||
| 222 | opacity: 0.6; | ||
| 223 | transform: rotate(180deg); | ||
| 224 | transition: transform 0.3s ease; | ||
| 225 | } | ||
| 226 | |||
| 159 | .list-content { | 227 | .list-content { |
| 160 | padding: 0 20rpx 20rpx; | 228 | padding: 0 20rpx 20rpx; |
| 161 | } | 229 | } | ... | ... |
| ... | @@ -235,11 +235,12 @@ function checkImgExist() { | ... | @@ -235,11 +235,12 @@ function checkImgExist() { |
| 235 | } | 235 | } |
| 236 | 236 | ||
| 237 | function handleAccountStatus() { | 237 | function handleAccountStatus() { |
| 238 | const authStatus = String(app.globalData.authenticationStatus) | 238 | const rawAuthStatus = app.globalData.authenticationStatus |
| 239 | const authStatus = rawAuthStatus === undefined || rawAuthStatus === null || rawAuthStatus === '' ? '0' : String(rawAuthStatus) | ||
| 239 | const memberInfoData = app.globalData.memberInfo || {} | 240 | const memberInfoData = app.globalData.memberInfo || {} |
| 240 | const activeStatus = memberInfoData.activeStatus | 241 | const activeStatus = memberInfoData.activeStatus |
| 241 | 242 | ||
| 242 | if (authStatus === '0' || authStatus === '3') { | 243 | if (authStatus === '0' || authStatus === 'undefined' || authStatus === '3') { |
| 243 | goPerfectFromDaoGuan() | 244 | goPerfectFromDaoGuan() |
| 244 | return | 245 | return |
| 245 | } | 246 | } | ... | ... |
-
Please register or sign in to post a comment