feat:部分项目中心
This commit is contained in:
@@ -8,11 +8,19 @@ import {
|
||||
} from '@/types/result-page'
|
||||
|
||||
const pageType = ref<ResultPageType>('register')
|
||||
const projectId = ref('')
|
||||
const countdown = ref(RESULT_REDIRECT_DELAY / 1000)
|
||||
let timer: ReturnType<typeof setInterval> | null = null
|
||||
|
||||
const pageConfig = computed(() => RESULT_PAGE_CONFIG[pageType.value])
|
||||
|
||||
const redirectUrl = computed(() => {
|
||||
if (pageType.value === 'afterSalesSuccess' && projectId.value) {
|
||||
return `${pageConfig.value.redirectUrl}?id=${encodeURIComponent(projectId.value)}&tab=aftersales`
|
||||
}
|
||||
return pageConfig.value.redirectUrl
|
||||
})
|
||||
|
||||
const title = computed(() => pageConfig.value.title)
|
||||
|
||||
const subtitle = computed(() => `${countdown.value}秒后自动跳转至${pageConfig.value.subtitleTarget}`)
|
||||
@@ -29,6 +37,13 @@ onLoad((options) => {
|
||||
}
|
||||
if (type === 'submitSuccess') {
|
||||
pageType.value = 'submitSuccess'
|
||||
return
|
||||
}
|
||||
if (type === 'afterSalesSuccess') {
|
||||
pageType.value = 'afterSalesSuccess'
|
||||
const id = options?.id
|
||||
if (id)
|
||||
projectId.value = decodeURIComponent(String(id))
|
||||
}
|
||||
})
|
||||
|
||||
@@ -41,7 +56,7 @@ onMounted(() => {
|
||||
timer = null
|
||||
}
|
||||
uni.redirectTo({
|
||||
url: pageConfig.value.redirectUrl,
|
||||
url: redirectUrl.value,
|
||||
})
|
||||
}
|
||||
}, 1000)
|
||||
@@ -74,40 +89,5 @@ onUnmounted(() => {
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '@/styles/variables.scss';
|
||||
|
||||
.result-page {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 100vh;
|
||||
background: $color-bg-page;
|
||||
}
|
||||
|
||||
.result-page__content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 0 64rpx;
|
||||
}
|
||||
|
||||
.result-page__icon {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
}
|
||||
|
||||
.result-page__title {
|
||||
margin-top: 48rpx;
|
||||
font-size: 40rpx;
|
||||
font-weight: 700;
|
||||
color: $color-text-primary;
|
||||
letter-spacing: 1rpx;
|
||||
}
|
||||
|
||||
.result-page__subtitle {
|
||||
margin-top: 24rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
color: $color-text-secondary;
|
||||
}
|
||||
@import './index.scss';
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user