zzzz
2024-03-20 d25a45190cee44b36296693d5022a0ce9ae9b698
1
{"ast":null,"code":"import \"vant/es/swipe-item/style\";\nimport _SwipeItem from \"vant/es/swipe-item\";\nimport \"vant/es/swipe/style\";\nimport _Swipe from \"vant/es/swipe\"; //\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport \"core-js/modules/es.array.push.js\";\nimport { mapGetters } from \"vuex\";\nimport Axios from \"@/API/userCenter.js\";\nexport default {\n  name: \"IndexSwiper\",\n  components: {\n    [_Swipe.name]: _Swipe,\n    [_SwipeItem.name]: _SwipeItem\n  },\n  props: {\n    keyNum: {\n      type: Number,\n      default: 1\n    },\n    type: {\n      type: String,\n      default: \"home\"\n    }\n  },\n  data() {\n    return {\n      bannerList: [],\n      timer: null\n    };\n  },\n  computed: {\n    ...mapGetters(\"language\", [\"language\"]),\n    imgList() {\n      return this.type === \"home\" ? [{\n        id: 1,\n        img: \"swiper_item\",\n        title: this.$t(\"參與挖礦贏大獎\"),\n        subTitle: this.$t(\"加入我們,收益超乎你的想像!\"),\n        btnText: this.$t(\"立即加入\")\n      }, {\n        id: 2,\n        img: \"swiper_item\",\n        title: this.$t(\"收益更簡單,免費領空投!\"),\n        subTitle: \"\",\n        btnText: this.$t(\"立即加入\")\n      }\n      // { id: 3, img: 'swiper_item', title: this.$t('收益更簡單,免費領空投!'), subTitle: '', btnText: this.$t('立即加入') }\n      ] : [{\n        id: 3,\n        img: \"swiper_item\"\n      }];\n    },\n    language() {\n      this.getBanner();\n      return this.$i18n.locale;\n    }\n  },\n  mounted() {\n    this.getBanner();\n  },\n  activated() {\n    this.getBanner();\n    this.timer = setTimeout(() => {\n      this.$refs.swipe.resize();\n    }, 300);\n  },\n  deactivated() {\n    clearTimeout(this.timer);\n  },\n  methods: {\n    toPath(url) {\n      if (url) {\n        this.$router.push(url);\n      }\n    },\n    getBanner() {\n      let language;\n      if (this.$i18n.locale === \"en-US\") {\n        language = \"en\";\n      } else if (this.$i18n.locale.indexOf(\"CN\") >= 0) {\n        language = \"CN\";\n      } else {\n        language = this.$i18n.locale;\n      }\n      Axios.getBanner({\n        model: \"top\",\n        language\n      }).then(res => {\n        this.bannerList = res.data;\n      }).catch(error => {\n        if (error.code === \"ECONNABORTED\") {\n          this.$toast(this.$t(\"网络超时!\"));\n        } else if (error.msg !== undefined) {\n          this.$toast(this.$t(error.msg));\n        }\n      });\n    }\n  }\n};","map":{"version":3,"names":["mapGetters","Axios","name","components","_Swipe","_SwipeItem","props","keyNum","type","Number","default","String","data","bannerList","timer","computed","imgList","id","img","title","$t","subTitle","btnText","language","getBanner","$i18n","locale","mounted","activated","setTimeout","$refs","swipe","resize","deactivated","clearTimeout","methods","toPath","url","$router","push","indexOf","model","then","res","catch","error","code","$toast","msg","undefined"],"sources":["src/components/ioe-swiper/index.vue"],"sourcesContent":["<template>\n  <div class=\"ioe-swiper h-304\">\n    <van-swipe\n      ref=\"swipe\"\n      :autoplay=\"3000\"\n      :show-indicators=\"false\"\n      lazy-render\n    >\n      <van-swipe-item\n        v-for=\"(item, index) in bannerList\"\n        :key=\"index + language\"\n        class=\"w-full h-304\"\n      >\n        <img\n          :src=\"item.image\"\n          alt=\"\"\n          title=\"\"\n          @click=\"toPath(item.url)\"\n          class=\"h-304 border bannerimg w-full\"\n        />\n        <!-- <div class=\"w-full h-420 absolute top-1 flex flex-col text-white\"\n             :class=\"item.subTitle ? 'pl-60' : 'items-center'\">\n          <template v-if=\"$i18n.locale === 'CN' || $i18n.locale === 'zh-CN'\">\n            <p :class=\"item.subTitle ? 'font-60 mt-124 mb-16' : 'font-48  mt-140 mb-54'\">{{item.title}}</p>\n          </template>\n          <template v-else>\n            <p :class=\"item.subTitle ? 'font-45 mt-124 mb-16' : 'font-48  mt-140 mb-54'\">{{item.title}}</p>\n          </template>\n          <p v-show=\"item.subTitle\" class=\"font-25 mb-50\">{{item.subTitle}}</p>\n          <p class=\"font-35 btn w-222 h-65 btnMain flex justify-center items-center\">{{item.btnText}}</p>\n        </div> -->\n      </van-swipe-item>\n    </van-swipe>\n\n    <div class=\"guanggao\">3333</div>\n  </div>\n</template>\n\n<script>\nimport { Swipe, SwipeItem } from \"vant\";\nimport { mapGetters } from \"vuex\";\nimport Axios from \"@/API/userCenter.js\";\nexport default {\n  name: \"IndexSwiper\",\n  components: {\n    [Swipe.name]: Swipe,\n    [SwipeItem.name]: SwipeItem,\n  },\n  props: {\n    keyNum: {\n      type: Number,\n      default: 1,\n    },\n    type: {\n      type: String,\n      default: \"home\",\n    },\n  },\n  data() {\n    return {\n      bannerList: [],\n      timer: null,\n    };\n  },\n  computed: {\n    ...mapGetters(\"language\", [\"language\"]),\n    imgList() {\n      return this.type === \"home\"\n        ? [\n            {\n              id: 1,\n              img: \"swiper_item\",\n              title: this.$t(\"參與挖礦贏大獎\"),\n              subTitle: this.$t(\"加入我們,收益超乎你的想像!\"),\n              btnText: this.$t(\"立即加入\"),\n            },\n            {\n              id: 2,\n              img: \"swiper_item\",\n              title: this.$t(\"收益更簡單,免費領空投!\"),\n              subTitle: \"\",\n              btnText: this.$t(\"立即加入\"),\n            },\n            // { id: 3, img: 'swiper_item', title: this.$t('收益更簡單,免費領空投!'), subTitle: '', btnText: this.$t('立即加入') }\n          ]\n        : [{ id: 3, img: \"swiper_item\" }];\n    },\n    language() {\n      this.getBanner();\n      return this.$i18n.locale;\n    },\n  },\n  mounted() {\n    this.getBanner();\n  },\n  activated() {\n    this.getBanner();\n    this.timer = setTimeout(() => {\n      this.$refs.swipe.resize();\n    }, 300);\n  },\n  deactivated() {\n    clearTimeout(this.timer);\n  },\n  methods: {\n    toPath(url) {\n      if (url) {\n        this.$router.push(url);\n      }\n    },\n    getBanner() {\n      let language;\n      if (this.$i18n.locale === \"en-US\") {\n        language = \"en\";\n      } else if (this.$i18n.locale.indexOf(\"CN\") >= 0) {\n        language = \"CN\";\n      } else {\n        language = this.$i18n.locale;\n      }\n      Axios.getBanner({\n        model: \"top\",\n        language,\n      })\n        .then((res) => {\n          this.bannerList = res.data;\n        })\n        .catch((error) => {\n          if (error.code === \"ECONNABORTED\") {\n            this.$toast(this.$t(\"网络超时!\"));\n          } else if (error.msg !== undefined) {\n            this.$toast(this.$t(error.msg));\n          }\n        });\n    },\n  },\n};\n</script>\n<style lang=\"scss\" scoped>\n.ioe-swiper {\n  box-sizing: border-box;\n  -webkit-overflow-scrolling: touch;\n}\n.btn {\n  border-radius: 55px;\n}\n.bannerimg {\n  border-radius: 9px;\n}\n\n\n.guanggao{\n  position: absolute;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAAA,UAAA;AACA,OAAAC,KAAA;AACA;EACAC,IAAA;EACAC,UAAA;IACA,CAAAC,MAAA,CAAAF,IAAA,GAAAE,MAAA;IACA,CAAAC,UAAA,CAAAH,IAAA,GAAAG;EACA;EACAC,KAAA;IACAC,MAAA;MACAC,IAAA,EAAAC,MAAA;MACAC,OAAA;IACA;IACAF,IAAA;MACAA,IAAA,EAAAG,MAAA;MACAD,OAAA;IACA;EACA;EACAE,KAAA;IACA;MACAC,UAAA;MACAC,KAAA;IACA;EACA;EACAC,QAAA;IACA,GAAAf,UAAA;IACAgB,QAAA;MACA,YAAAR,IAAA,cACA,CACA;QACAS,EAAA;QACAC,GAAA;QACAC,KAAA,OAAAC,EAAA;QACAC,QAAA,OAAAD,EAAA;QACAE,OAAA,OAAAF,EAAA;MACA,GACA;QACAH,EAAA;QACAC,GAAA;QACAC,KAAA,OAAAC,EAAA;QACAC,QAAA;QACAC,OAAA,OAAAF,EAAA;MACA;MACA;MAAA,CACA,GACA;QAAAH,EAAA;QAAAC,GAAA;MAAA;IACA;IACAK,SAAA;MACA,KAAAC,SAAA;MACA,YAAAC,KAAA,CAAAC,MAAA;IACA;EACA;EACAC,QAAA;IACA,KAAAH,SAAA;EACA;EACAI,UAAA;IACA,KAAAJ,SAAA;IACA,KAAAV,KAAA,GAAAe,UAAA;MACA,KAAAC,KAAA,CAAAC,KAAA,CAAAC,MAAA;IACA;EACA;EACAC,YAAA;IACAC,YAAA,MAAApB,KAAA;EACA;EACAqB,OAAA;IACAC,OAAAC,GAAA;MACA,IAAAA,GAAA;QACA,KAAAC,OAAA,CAAAC,IAAA,CAAAF,GAAA;MACA;IACA;IACAb,UAAA;MACA,IAAAD,QAAA;MACA,SAAAE,KAAA,CAAAC,MAAA;QACAH,QAAA;MACA,gBAAAE,KAAA,CAAAC,MAAA,CAAAc,OAAA;QACAjB,QAAA;MACA;QACAA,QAAA,QAAAE,KAAA,CAAAC,MAAA;MACA;MACAzB,KAAA,CAAAuB,SAAA;QACAiB,KAAA;QACAlB;MACA,GACAmB,IAAA,CAAAC,GAAA;QACA,KAAA9B,UAAA,GAAA8B,GAAA,CAAA/B,IAAA;MACA,GACAgC,KAAA,CAAAC,KAAA;QACA,IAAAA,KAAA,CAAAC,IAAA;UACA,KAAAC,MAAA,MAAA3B,EAAA;QACA,WAAAyB,KAAA,CAAAG,GAAA,KAAAC,SAAA;UACA,KAAAF,MAAA,MAAA3B,EAAA,CAAAyB,KAAA,CAAAG,GAAA;QACA;MACA;IACA;EACA;AACA","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}