index.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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(item)" 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 current = ref(0)
  20. const inputDialog = ref()
  21. const swiperList = [{ url: 'https://minio.menduner.com/dev/260c94447f93c5258e6b5c0db453f9da92ce59bebd1eef6bff3a8063d91d07f1.jpg', path: 'https://mp.weixin.qq.com/s/lI7_iHY1yaEqrb_kG1MusA' }]
  22. const currentPage = getCurrentPages()[0].route
  23. const closeAdd = () => {
  24. inputDialog.value.close()
  25. uni.removeStorageSync('firstOpen')
  26. }
  27. const openDialog = () => {
  28. inputDialog.value.open()
  29. }
  30. const skipLink = ({path}) => {
  31. closeAdd()
  32. // if (!uni.getStorageSync('token') && currentPage !== 'pages/login/index') {
  33. // uni.switchTab({
  34. // url: '/pages/index/my'
  35. // })
  36. // }
  37. if (path) {
  38. uni.navigateTo({ url: `/pages/addWebView/index?url=${path}` })
  39. }
  40. }
  41. const swiperChange = (e) => {
  42. current.value = e.detail.current
  43. }
  44. onMounted(() => {
  45. if(uni.getStorageSync('firstOpen')) openDialog()
  46. })
  47. </script>
  48. <style scoped lang="scss">
  49. .popup-content {
  50. align-items: center;
  51. justify-content: center;
  52. width: 80vw;
  53. height: 100vh;
  54. }
  55. .img-item{
  56. width: 100%;
  57. height: 60vh;
  58. margin: 0;
  59. border-radius: 20px;
  60. }
  61. .swiper-box{
  62. height: 100vh;
  63. }
  64. .f-straight{
  65. display: flex;
  66. justify-content: center;
  67. flex-direction: column;
  68. }
  69. </style>