chunk-2d0d5c9a.6914f570.js.map 7.9 KB

1
  1. {"version":3,"sources":["webpack:///./src/views/user/promotion/Poster.vue?c287","webpack:///src/views/user/promotion/Poster.vue","webpack:///./src/views/user/promotion/Poster.vue?5eba","webpack:///./src/views/user/promotion/Poster.vue"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","ref","attrs","options","swiperPosters","_l","item","index","key","src","wap_poster","on","click","saveImg","_v","staticRenderFns","Postervue_type_script_lang_js_","name","components","swiper","vue_awesome_swiper","swiperSlide","props","data","speed","effect","slidesPerView","centeredSlides","coverflowEffect","rotate","stretch","depth","modifier","slideShadows","observer","observeParents","info","activeIndex","mounted","getIndex","that","computed","$refs","mySwiper","methods","Object","user","then","res","err","$dialog","message","msg","downloadIamge","imgsrc","image","Image","setAttribute","onload","canvas","document","createElement","width","height","context","getContext","drawImage","url","toDataURL","a","event","MouseEvent","download","href","dispatchEvent","console","log","promotion_Postervue_type_script_lang_js_","component","componentNormalizer","__webpack_exports__"],"mappings":"yHAAA,IAAAA,EAAA,WAA0B,IAAAC,EAAAC,KAAaC,EAAAF,EAAAG,eAA0BC,EAAAJ,EAAAK,MAAAD,IAAAF,EAAwB,OAAAE,EAAA,OAAiBE,YAAA,wBAAmC,CAAAF,EAAA,OAAYE,YAAA,wBAAmC,CAAAF,EAAA,UAAeG,IAAA,WAAAD,YAAA,iBAAAE,MAAA,CAAmDC,QAAAT,EAAAU,gBAA6BV,EAAAW,GAAAX,EAAA,cAAAY,EAAAC,GAAwC,OAAAT,EAAA,eAAyBU,IAAAD,EAAAP,YAAA,gBAAqC,CAAAF,EAAA,OAAYE,YAAA,cAAAE,MAAA,CAAiCO,IAAAH,EAAAI,kBAA2B,OAAAZ,EAAA,OAAmBE,YAAA,oBAAAW,GAAA,CAAoCC,MAAAlB,EAAAmB,UAAqB,CAAAnB,EAAAoB,GAAA,aACrhBC,EAAA,uCCmBAC,EAAA,CACAC,KAAA,SACAC,WAAA,CACAC,OAAAC,EAAA,UACAC,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A,KAAAlC,CACdgC,EACApF,EACAsB,GACF,EACA,KACA,KACA,MAIeiE,EAAA,WAAAF","file":"h5/js/chunk-2d0d5c9a.6914f570.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"distribution-posters\"},[_c('div',{staticClass:\"slider-banner banner\"},[_c('swiper',{ref:\"mySwiper\",staticClass:\"swiper-wrapper\",attrs:{\"options\":_vm.swiperPosters}},_vm._l((_vm.info),function(item,index){return _c('swiperSlide',{key:index,staticClass:\"swiper-slide\"},[_c('img',{staticClass:\"slide-image\",attrs:{\"src\":item.wap_poster}})])}),1)],1),_c('div',{staticClass:\"keep bg-color-red\",on:{\"click\":_vm.saveImg}},[_vm._v(\"保存海报\")])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\r\n <div class=\"distribution-posters\">\r\n <div class=\"slider-banner banner\">\r\n <swiper class=\"swiper-wrapper\" :options=\"swiperPosters\" ref=\"mySwiper\">\r\n <swiperSlide\r\n class=\"swiper-slide\"\r\n v-for=\"(item, index) in info\"\r\n :key=\"index\"\r\n >\r\n <img class=\"slide-image\" :src=\"item.wap_poster\" />\r\n </swiperSlide>\r\n </swiper>\r\n </div>\r\n <div class=\"keep bg-color-red\" @click=\"saveImg\">保存海报</div>\r\n </div>\r\n</template>\r\n<script>\r\nimport { swiper, swiperSlide } from \"vue-awesome-swiper\";\r\nimport \"@assets/css/swiper.min.css\";\r\nimport { getSpreadImg } from \"../../../api/user\";\r\nexport default {\r\n name: \"Poster\",\r\n components: {\r\n swiper,\r\n swiperSlide\r\n },\r\n props: {},\r\n data: function() {\r\n return {\r\n swiperPosters: {\r\n speed: 1000,\r\n effect: \"coverflow\",\r\n slidesPerView: \"auto\",\r\n centeredSlides: true,\r\n coverflowEffect: {\r\n rotate: 0, // 旋转的角度\r\n stretch: -20, // 拉伸 图片间左右的间距和密集度\r\n depth: 100, // 深度 切换图片间上下的间距和密集度\r\n modifier: 3, // 修正值 该值越大前面的效果越明显\r\n slideShadows: false // 页面阴影效果\r\n },\r\n observer: true,\r\n observeParents: true\r\n },\r\n info: [],\r\n activeIndex: 0\r\n };\r\n },\r\n mounted: function() {\r\n this.getIndex();\r\n let that = this;\r\n this.swiper.on(\"slideChange\", function() {\r\n that.activeIndex = that.swiper.activeIndex;\r\n });\r\n },\r\n computed: {\r\n swiper() {\r\n return this.$refs.mySwiper.swiper;\r\n }\r\n },\r\n methods: {\r\n getIndex: function() {\r\n let that = this;\r\n getSpreadImg().then(\r\n res => {\r\n that.info = res.data;\r\n },\r\n err => {\r\n that.$dialog.message(err.msg);\r\n }\r\n );\r\n },\r\n downloadIamge: function(imgsrc, name) {\r\n let image = new Image();\r\n image.setAttribute(\"crossOrigin\", \"anonymous\");\r\n image.onload = function() {\r\n let canvas = document.createElement(\"canvas\");\r\n canvas.width = image.width;\r\n canvas.height = image.height;\r\n let context = canvas.getContext(\"2d\");\r\n context.drawImage(image, 0, 0, image.width, image.height);\r\n let url = canvas.toDataURL(\"image/png\"); //得到图片的base64编码数据\r\n let a = document.createElement(\"a\"); // 生成一个a元素\r\n let event = new MouseEvent(\"click\"); // 创建一个单击事件\r\n a.download = name || \"photo\"; // 设置图片名称\r\n a.href = url; // 将生成的URL设置为a.href属性\r\n a.dispatchEvent(event); // 触发a的单击事件\r\n };\r\n image.src = imgsrc;\r\n },\r\n saveImg: function() {\r\n console.log(this.info[this.activeIndex].wap_poster);\r\n this.downloadIamge(\r\n this.info[this.activeIndex].wap_poster,\r\n \"poster\" + this.activeIndex\r\n );\r\n }\r\n }\r\n};\r\n</script>\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Poster.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Poster.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Poster.vue?vue&type=template&id=27a0d3d0&\"\nimport script from \"./Poster.vue?vue&type=script&lang=js&\"\nexport * from \"./Poster.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}