Commit 5b004ee6 authored by zhangsan's avatar zhangsan

1

parent 279dcc97
No related merge requests found
...@@ -11,7 +11,16 @@ ...@@ -11,7 +11,16 @@
</slot> </slot>
</div> </div>
<div class="guide-footer"> <div class="guide-footer guide-footer1" v-if="guideList[currentIndex]?.bh.includes('.html')">
<button class="guide-button" @click="jumpto(guideList[currentIndex]?.bh)">
{{ guideList[currentIndex]?.noticeTitle }}
</button>
<var-divider vertical style="margin: 0;" />
<button class="guide-button" @click="handleAction">
{{ isLastPage ? '我知道了' : '下一页' }}
</button>
</div>
<div class="guide-footer" v-else>
<button class="guide-button" @click="handleAction"> <button class="guide-button" @click="handleAction">
{{ isLastPage ? '我知道了' : '下一页' }} {{ isLastPage ? '我知道了' : '下一页' }}
</button> </button>
...@@ -21,59 +30,60 @@ ...@@ -21,59 +30,60 @@
</div> </div>
</Transition> </Transition>
</Teleport> </Teleport>
</template> </template>
<script setup lang="ts">
import { ref, computed } from 'vue'
interface Props { <script setup lang="ts">
import { ref, computed } from 'vue'
interface Props {
guideList: string[] guideList: string[]
modelValue: boolean modelValue: boolean
} }
const props = defineProps<Props>() const props = defineProps<Props>()
const emit = defineEmits(['update:modelValue']) const emit = defineEmits(['update:modelValue'])
const currentIndex = ref(0) const currentIndex = ref(0)
const slideDirection = ref('next') const slideDirection = ref('next')
const transitionName = computed(() => `slide-${slideDirection.value}`) const transitionName = computed(() => `slide-${slideDirection.value}`)
const visible = computed({ const visible = computed({
get: () => props.modelValue, get: () => props.modelValue,
set: (value) => emit('update:modelValue', value) set: (value) => emit('update:modelValue', value)
}) })
const jumpto = (url) => {
window.location.href = window.location.origin + url
}
const isLastPage = computed(() => currentIndex.value === props.guideList.length - 1)
const isLastPage = computed(() => currentIndex.value === props.guideList.length - 1) const handleAction = () => {
const handleAction = () => {
if (isLastPage.value) { if (isLastPage.value) {
handleClose() handleClose()
} else { } else {
slideDirection.value = 'next' slideDirection.value = 'next'
currentIndex.value++ currentIndex.value++
} }
} }
const handleClose = () => { const handleClose = () => {
visible.value = false visible.value = false
// 重置状态 // 重置状态
setTimeout(() => { setTimeout(() => {
currentIndex.value = 0 currentIndex.value = 0
slideDirection.value = 'next' slideDirection.value = 'next'
}, 300) }, 300)
} }
const beforeLeave = () => { const beforeLeave = () => {
document.body.style.overflow = 'hidden' document.body.style.overflow = 'hidden'
} }
const afterLeave = () => { const afterLeave = () => {
document.body.style.overflow = '' document.body.style.overflow = ''
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.guide-modal-overlay { .guide-modal-overlay {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
...@@ -84,9 +94,9 @@ ...@@ -84,9 +94,9 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
z-index: 1000; z-index: 1000;
} }
.guide-modal { .guide-modal {
background: #fff; background: #fff;
border-radius: 5px; border-radius: 5px;
width: 100%; // 调整宽度为90% width: 100%; // 调整宽度为90%
...@@ -95,9 +105,9 @@ ...@@ -95,9 +105,9 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden; // 防止内容溢出 overflow: hidden; // 防止内容溢出
} }
.guide-content { .guide-content {
flex: 1; flex: 1;
overflow-y: auto; // 内容过多时可滚动 overflow-y: auto; // 内容过多时可滚动
padding: 20px; padding: 20px;
...@@ -107,15 +117,18 @@ ...@@ -107,15 +117,18 @@
max-width: 100%; max-width: 100%;
height: auto; height: auto;
} }
} }
.guide-footer { .guide-footer {
background: #fff; // 确保底部背景色 background: #fff; // 确保底部背景色
border-top: 1px solid #eee; border-top: 1px solid #eee;
} }
.guide-footer1 {
display: flex;
}
.guide-button { .guide-button {
width: 100%; // 按钮宽度设为90% width: 100%; // 按钮宽度设为90%
margin: 0 auto; margin: 0 auto;
display: block; display: block;
...@@ -126,44 +139,44 @@ ...@@ -126,44 +139,44 @@
font-size: 16px; font-size: 16px;
cursor: pointer; cursor: pointer;
transition: opacity 0.3s; transition: opacity 0.3s;
} }
// 淡入淡出动画 // 淡入淡出动画
.fade-enter-active, .fade-enter-active,
.fade-leave-active { .fade-leave-active {
transition: opacity 0.3s ease; transition: opacity 0.3s ease;
} }
.fade-enter-from, .fade-enter-from,
.fade-leave-to { .fade-leave-to {
opacity: 0; opacity: 0;
} }
// 滑动动画 // 滑动动画
.slide-next-enter-active, .slide-next-enter-active,
.slide-next-leave-active, .slide-next-leave-active,
.slide-prev-enter-active, .slide-prev-enter-active,
.slide-prev-leave-active { .slide-prev-leave-active {
transition: all 0.3s ease-out; transition: all 0.3s ease-out;
} }
.slide-next-enter-from { .slide-next-enter-from {
transform: translateX(100%); transform: translateX(100%);
opacity: 0; opacity: 0;
} }
.slide-next-leave-to { .slide-next-leave-to {
transform: translateX(-100%); transform: translateX(-100%);
opacity: 0; opacity: 0;
} }
.slide-prev-enter-from { .slide-prev-enter-from {
transform: translateX(-100%); transform: translateX(-100%);
opacity: 0; opacity: 0;
} }
.slide-prev-leave-to { .slide-prev-leave-to {
transform: translateX(100%); transform: translateX(100%);
opacity: 0; opacity: 0;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -33,7 +33,11 @@ const fetchData = async () => { ...@@ -33,7 +33,11 @@ const fetchData = async () => {
} }
const handleJump = (item) => { const handleJump = (item) => {
if(item.createMan){
window.location.href = window.location.origin + `/product/detail.html?id=${item.productId}` window.location.href = window.location.origin + `/product/detail.html?id=${item.productId}`
}else{
showFailToast('暂未开放世界银行项目产品')
}
} }
fetchData() fetchData()
......
...@@ -18,15 +18,22 @@ declare module 'vue' { ...@@ -18,15 +18,22 @@ declare module 'vue' {
VanEmpty: typeof import('vant/es')['Empty'] VanEmpty: typeof import('vant/es')['Empty']
VanIcon: typeof import('vant/es')['Icon'] VanIcon: typeof import('vant/es')['Icon']
VanList: typeof import('vant/es')['List'] VanList: typeof import('vant/es')['List']
VanPopup: typeof import('vant/es')['Popup']
VanRadio: typeof import('vant/es')['Radio'] VanRadio: typeof import('vant/es')['Radio']
VanRadioGroup: typeof import('vant/es')['RadioGroup'] VanRadioGroup: typeof import('vant/es')['RadioGroup']
VanTag: typeof import('vant/es')['Tag'] VanTag: typeof import('vant/es')['Tag']
VarAppBar: typeof import('@varlet/ui')['AppBar'] VarAppBar: typeof import('@varlet/ui')['AppBar']
VarButton: typeof import('@varlet/ui')['Button'] VarButton: typeof import('@varlet/ui')['Button']
VarDivider: typeof import('@varlet/ui')['Divider'] VarDivider: typeof import('@varlet/ui')['Divider']
VarForm: typeof import('@varlet/ui')['Form']
VarIcon: typeof import('@varlet/ui')['Icon'] VarIcon: typeof import('@varlet/ui')['Icon']
VarInput: typeof import('@varlet/ui')['Input']
VarLoading: typeof import('@varlet/ui')['Loading'] VarLoading: typeof import('@varlet/ui')['Loading']
VarOverlay: typeof import('@varlet/ui')['Overlay']
VarPaper: typeof import('@varlet/ui')['Paper'] VarPaper: typeof import('@varlet/ui')['Paper']
VarSpace: typeof import('@varlet/ui')['Space']
VarTab: typeof import('@varlet/ui')['Tab']
VarTabs: typeof import('@varlet/ui')['Tabs']
XModal: typeof import('./../src/components/x-modal/x-modal.vue')['default'] XModal: typeof import('./../src/components/x-modal/x-modal.vue')['default']
} }
export interface ComponentCustomProperties { export interface ComponentCustomProperties {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment