123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <template>
- <view >
- <uni-popup ref="inputDialog" class="pop" :mask-click="false" @close="closeAdd">
- <view class="popup-content" >
- <swiper class="swiper-box" @change="swiperChange">
- <swiper-item v-for="(item ,index) in swiperList" :key="index" class="f-straight">
- <image class="img-item" :src="item.img" @click="skipLink(item)" mode="widthFix"></image>
- <view @click="closeAdd" class="f-horizon-center">
- <uni-icons style="display: flex;justify-content: flex-end;" type="closeempty" size="40" color="#fff"/>
- </view>
- </swiper-item>
- </swiper>
- </view>
- </uni-popup>
- </view>
- </template>
- <script setup>
- import { ref, onMounted } from 'vue'
- import { getWebContent } from '@/api/common'
- const current = ref(0)
- const inputDialog = ref()
- const swiperList = ref([
- // {
- // url: 'https://minio.menduner.com/dev/260c94447f93c5258e6b5c0db453f9da92ce59bebd1eef6bff3a8063d91d07f1.jpg',
- // path: 'https://mp.weixin.qq.com/s/lI7_iHY1yaEqrb_kG1MusA'
- // }
- // {
- // url: 'https://minio.menduner.com/dev/menduner/advertisement.jpg' // 注册广告
- // }
- ])
- const currentPage = getCurrentPages()[0].route
- // 获取广告图
- const getSystemWebContent = async () => {
- const { data } = await getWebContent()
- swiperList.value = data.appAdvertisement || []
- }
- getSystemWebContent()
- const closeAdd = () => {
- inputDialog.value.close()
- uni.removeStorageSync('firstOpen')
- }
- const openDialog = () => {
- inputDialog.value.open()
- }
- const skipLink = ({ link, title }) => {
- closeAdd()
- // if (!uni.getStorageSync('token') && currentPage !== 'pages/login/index') {
- // uni.switchTab({
- // url: '/pages/index/my'
- // })
- // }
- if (link) {
- uni.navigateTo({ url: `/pages/addWebView/index?url=${link}&title=${title}` })
- }
- }
- const swiperChange = (e) => {
- current.value = e.detail.current
- }
- onMounted(() => {
- if(uni.getStorageSync('firstOpen')) openDialog()
- })
- </script>
- <style scoped lang="scss">
- .popup-content {
- align-items: center;
- justify-content: center;
- width: 80vw;
- height: 100vh;
- }
- .img-item{
- width: 100%;
- height: 60vh;
- margin: 0;
- border-radius: 20px;
- }
- .swiper-box{
- height: 100vh;
- }
- .f-straight{
- display: flex;
- justify-content: center;
- flex-direction: column;
- }
- </style>
|