7fdf5c86 by lttnew

引导页

1 parent d0fda066
......@@ -248,25 +248,6 @@
</view>
</uni-popup>
<!-- 调动确认弹框 -->
<uni-popup ref="transferPopup" class="add-student-popup" type="center" :mask-click="false" style="z-index: 1001">
<view class="add-popup">
<view class="popup-title">系统提示</view>
<view class="popup-content">
<view class="transfer-tip">
该人员已在其他机构登记,是否申请调入?
</view>
<view class="transfer-tip sub-tip">
如仅办理业务,请前往业务页面,点击【添加】直接办理。
</view>
</view>
<view class="popup-btns">
<view class="popup-btn cancel" @click="handleTransfer">调动</view>
<view class="popup-btn confirm" @click="handleAddFromTransfer">添加</view>
</view>
</view>
</uni-popup>
<custom-modal
ref="confirmModalRef"
:title="confirmModal.title"
......@@ -358,7 +339,6 @@ const range = ref([{
// 添加考生弹框相关
const addPopup = ref(null)
const transferPopup = ref(null)
const addForm = ref({
name: '',
idcType: '0',
......@@ -696,26 +676,6 @@ function closeAddPopup() {
addPopup.value?.close()
}
// 关闭调动确认弹框
function closeTransferPopup() {
transferPopup.value?.close()
}
// 跳转调动页面
function handleTransfer() {
closeTransferPopup()
addPopup.value?.close()
uni.navigateTo({
url: `/personalVip/mobilize`
})
}
// 从调动弹框点击添加
async function handleAddFromTransfer() {
closeTransferPopup()
await handelAddPerson()
}
// 证件类型选择
function onIdcTypeChange(e) {
idcTypeIndex.value = e.detail.value
......@@ -729,24 +689,7 @@ async function confirmAdd() {
return
}
uni.showLoading({ title: '校验中...', mask: true })
try {
const checkRes = await api.inMyMember({ idcCode: addForm.value.idcCode })
uni.hideLoading()
if (checkRes.data) {
// 人员已存在,直接添加
await handelAddPerson()
} else {
// 人员不在本机构,显示自定义确认弹框(不关闭添加弹框,保留表单数据)
closeLevelDropdown()
transferPopup.value?.open()
}
} catch (err) {
uni.hideLoading()
console.log(err)
}
}
// 执行添加考生
......
......@@ -2,9 +2,12 @@
<view class="exam-point-list">
<!-- 顶部申请按钮 -->
<view v-if="status==0" class="apply-btn-box">
<button :disabled="memberInfo.isPoints==0 || formInfo.auditStatus==1" class="apply-btn"
<button :disabled="isApplyDisabled" class="apply-btn"
@click="goApply">申请考点
</button>
<view :class="{ refreshing: refreshing }" class="refresh-icon" @click="refreshStatus()">
<uni-icons color="#C4121B" size="24" type="refreshempty"></uni-icons>
</view>
</view>
<!-- 列表 -->
......@@ -51,33 +54,75 @@
</template>
<script setup>
import {ref} from 'vue'
import {computed, ref} from 'vue'
import {onLoad, onShow, onReachBottom} from '@dcloudio/uni-app'
import {getMyRecentExam} from '@/common/api'
import {getMyOwnMemberInfo, getMyRecentExam} from '@/common/api'
const app = getApp()
const list = ref([])
const loading = ref(false)
const refreshing = ref(false)
const noMore = ref(false)
const pageNum = ref(1)
const pageSize = ref(10)
const memberInfo = app.globalData.memberInfo
const memberInfo = ref(app.globalData.memberInfo || {})
const formInfo = ref({})
const status = ref(0)
const isApplyDisabled = computed(() => {
const auditStatus = String(formInfo.value?.auditStatus ?? '')
const isPoints = String(memberInfo.value?.isPoints ?? '')
return isPoints === '0' || auditStatus === '1' || auditStatus === '2'
})
onShow(() => {
loadData()
refreshStatus(false)
})
onLoad((option) => {
status.value = option.status ?? 0
loadData()
refreshStatus(false)
})
function loadData() {
if (loading.value) return
async function refreshMemberInfo() {
try {
const res = await getMyOwnMemberInfo()
if (res?.data?.memberInfo) {
app.globalData.authenticationStatus = res.data.authenticationStatus
app.globalData.memberInfo = res.data.memberInfo
app.globalData.isExam = res.data.memberInfo?.isPoints
memberInfo.value = res.data.memberInfo
}
} catch (e) {
console.error('刷新会员信息失败', e)
}
}
async function refreshStatus(showToast = true) {
if (loading.value || refreshing.value) return
refreshing.value = true
pageNum.value = 1
noMore.value = false
try {
await refreshMemberInfo()
await loadData(true)
if (showToast) {
uni.showToast({
title: '已刷新',
icon: 'none'
})
}
} finally {
refreshing.value = false
}
}
function loadData(reset = false) {
if (loading.value) return Promise.resolve()
loading.value = true
if (reset) list.value = []
getMyRecentExam().then(res => {
return getMyRecentExam().then(res => {
formInfo.value = res.data ?? {}
if (res.data && res.data.auditLogs) {
try {
......@@ -88,6 +133,7 @@ function loadData() {
} else {
list.value = []
}
noMore.value = true
}).finally(() => {
loading.value = false
})
......@@ -101,6 +147,7 @@ onReachBottom(() => {
})
function goApply() {
if (isApplyDisabled.value) return
uni.navigateTo({
url: '/pages/index/notice-examPointApply'
})
......@@ -132,10 +179,13 @@ function formatDate(dateStr) {
.apply-btn-box {
padding: 20rpx 30rpx;
display: flex;
align-items: center;
gap: 20rpx;
}
.apply-btn {
width: 100%;
flex: 1;
height: 80rpx;
line-height: 80rpx;
background: #C4121B;
......@@ -156,6 +206,24 @@ function formatDate(dateStr) {
}
}
.refresh-icon {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
background: #fff;
border: 2rpx solid #f0d0d2;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 6rpx 18rpx rgba(196, 18, 27, 0.08);
}
.refresh-icon.refreshing {
opacity: 0.6;
transform: rotate(180deg);
transition: transform 0.3s ease;
}
.list-content {
padding: 0 20rpx 20rpx;
}
......
......@@ -235,11 +235,12 @@ function checkImgExist() {
}
function handleAccountStatus() {
const authStatus = String(app.globalData.authenticationStatus)
const rawAuthStatus = app.globalData.authenticationStatus
const authStatus = rawAuthStatus === undefined || rawAuthStatus === null || rawAuthStatus === '' ? '0' : String(rawAuthStatus)
const memberInfoData = app.globalData.memberInfo || {}
const activeStatus = memberInfoData.activeStatus
if (authStatus === '0' || authStatus === '3') {
if (authStatus === '0' || authStatus === 'undefined' || authStatus === '3') {
goPerfectFromDaoGuan()
return
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!