index.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view >
  3. <uni-popup ref="inputDialog" class="pop" :mask-click="false" @close="closeAdd">
  4. <view class="popup-content" >
  5. <swiper class="swiper-box" @change="swiperChange">
  6. <swiper-item v-for="(item ,index) in swiperList" :key="index" class="f-straight">
  7. <image class="img-item" :src="item.url" @click="skipLink()" mode="widthFix"></image>
  8. <view @click="closeAdd" class="f-horizon-center">
  9. <uni-icons style="display: flex;justify-content: flex-end;" type="closeempty" size="40" color="#fff"/>
  10. </view>
  11. </swiper-item>
  12. </swiper>
  13. </view>
  14. </uni-popup>
  15. </view>
  16. </template>
  17. <script setup>
  18. import { ref, onMounted } from 'vue'
  19. const emit = defineEmits(['login'])
  20. const current = ref(0)
  21. const inputDialog = ref()
  22. const swiperList = [{ url: 'https://minio.citupro.com/dev/menduner/advertisement.jpg', path: '' }]
  23. const closeAdd = () => {
  24. inputDialog.value.close()
  25. uni.removeStorageSync('firstOpen')
  26. }
  27. const openDialog = () => {
  28. inputDialog.value.open()
  29. }
  30. const skipLink = () => {
  31. closeAdd()
  32. emit('login')
  33. }
  34. const swiperChange = (e) => {
  35. current.value = e.detail.current
  36. }
  37. onMounted(() => {
  38. if(uni.getStorageSync('firstOpen')) openDialog()
  39. })
  40. </script>
  41. <style scoped lang="scss">
  42. .popup-content {
  43. align-items: center;
  44. justify-content: center;
  45. width: 80vw;
  46. height: 100vh;
  47. }
  48. .img-item{
  49. width: 100%;
  50. height: 60vh;
  51. margin: 0;
  52. border-radius: 20px;
  53. }
  54. .swiper-box{
  55. height: 100vh;
  56. }
  57. .f-straight{
  58. display: flex;
  59. justify-content: center;
  60. flex-direction: column;
  61. }
  62. </style>