index.vue 1.9 KB

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