u-swiper.js.map
23.8 KB
{"version":3,"sources":["webpack:///C:/Users/zhuo/Documents/WeChat Files/wxid_g8pfss2de72222/FileStorage/File/2022-11/beijingTheatre/node_modules/uview-ui/components/u-swiper/u-swiper.vue?f8c9","webpack:///C:/Users/zhuo/Documents/WeChat Files/wxid_g8pfss2de72222/FileStorage/File/2022-11/beijingTheatre/node_modules/uview-ui/components/u-swiper/u-swiper.vue?b062","webpack:///C:/Users/zhuo/Documents/WeChat Files/wxid_g8pfss2de72222/FileStorage/File/2022-11/beijingTheatre/node_modules/uview-ui/components/u-swiper/u-swiper.vue?c101","webpack:///C:/Users/zhuo/Documents/WeChat Files/wxid_g8pfss2de72222/FileStorage/File/2022-11/beijingTheatre/node_modules/uview-ui/components/u-swiper/u-swiper.vue?72de","uni-app:///node_modules/uview-ui/components/u-swiper/u-swiper.vue","webpack:///C:/Users/zhuo/Documents/WeChat Files/wxid_g8pfss2de72222/FileStorage/File/2022-11/beijingTheatre/node_modules/uview-ui/components/u-swiper/u-swiper.vue?d6ee"],"names":["renderjs","component","options","__file","components","uLoadingIcon","uSwiperIndicator","e","message","indexOf","console","error","render","_vm","this","_h","$createElement","g0","_self","_c","$u","addUnit","height","g1","radius","g2","loading","g3","previousMargin","g4","nextMargin","l0","__map","list","item","index","$orig","__get_orig","s0","__get_style","itemStyle","m0","getItemType","g5","g6","m1","getSource","m2","g7","m3","m4","getPoster","g8","showTitle","test","object","title","g9","image","s1","addStyle","indicatorStyle","$mp","data","Object","assign","$root","recyclableRender","staticRenderFns","_withStripped"],"mappings":"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","file":"node-modules/uview-ui/components/u-swiper/u-swiper.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./u-swiper.vue?vue&type=template&id=7b038a67&scoped=true&\"\nvar renderjs\nimport script from \"./u-swiper.vue?vue&type=script&lang=js&\"\nexport * from \"./u-swiper.vue?vue&type=script&lang=js&\"\nimport style0 from \"./u-swiper.vue?vue&type=style&index=0&id=7b038a67&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\runtime\\\\componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"7b038a67\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"node_modules/uview-ui/components/u-swiper/u-swiper.vue\"\nexport default component.exports","export * from \"-!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\templateLoader.js??vue-loader-options!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--16-0!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\template.js!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-uni-app-loader\\\\page-meta.js!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./u-swiper.vue?vue&type=template&id=7b038a67&scoped=true&\"","var components\ntry {\n components = {\n uLoadingIcon: function() {\n return import(\n /* webpackChunkName: \"node-modules/uview-ui/components/u-loading-icon/u-loading-icon\" */ \"uview-ui/components/u-loading-icon/u-loading-icon.vue\"\n )\n },\n uSwiperIndicator: function() {\n return import(\n /* webpackChunkName: \"node-modules/uview-ui/components/u-swiper-indicator/u-swiper-indicator\" */ \"uview-ui/components/u-swiper-indicator/u-swiper-indicator.vue\"\n )\n }\n }\n} catch (e) {\n if (\n e.message.indexOf(\"Cannot find module\") !== -1 &&\n e.message.indexOf(\".vue\") !== -1\n ) {\n console.error(e.message)\n console.error(\"1. 排查组件名称拼写是否正确\")\n console.error(\n \"2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom\"\n )\n console.error(\n \"3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件\"\n )\n } else {\n throw e\n }\n}\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n var g0 = _vm.$u.addUnit(_vm.height)\n var g1 = _vm.$u.addUnit(_vm.radius)\n var g2 = !_vm.loading ? _vm.$u.addUnit(_vm.height) : null\n var g3 = !_vm.loading ? _vm.$u.addUnit(_vm.previousMargin) : null\n var g4 = !_vm.loading ? _vm.$u.addUnit(_vm.nextMargin) : null\n var l0 = !_vm.loading\n ? _vm.__map(_vm.list, function(item, index) {\n var $orig = _vm.__get_orig(item)\n\n var s0 = _vm.__get_style([_vm.itemStyle(index)])\n\n var m0 = _vm.getItemType(item)\n var g5 = m0 === \"image\" ? _vm.$u.addUnit(_vm.height) : null\n var g6 = m0 === \"image\" ? _vm.$u.addUnit(_vm.radius) : null\n var m1 = m0 === \"image\" ? _vm.getSource(item) : null\n var m2 = _vm.getItemType(item)\n var g7 = m2 === \"video\" ? _vm.$u.addUnit(_vm.height) : null\n var m3 = m2 === \"video\" ? _vm.getSource(item) : null\n var m4 = m2 === \"video\" ? _vm.getPoster(item) : null\n var g8 =\n m2 === \"video\"\n ? _vm.showTitle && _vm.$u.test.object(item) && item.title\n : null\n var g9 =\n _vm.showTitle &&\n _vm.$u.test.object(item) &&\n item.title &&\n _vm.$u.test.image(_vm.getSource(item))\n return {\n $orig: $orig,\n s0: s0,\n m0: m0,\n g5: g5,\n g6: g6,\n m1: m1,\n m2: m2,\n g7: g7,\n m3: m3,\n m4: m4,\n g8: g8,\n g9: g9\n }\n })\n : null\n\n var s1 = _vm.__get_style([_vm.$u.addStyle(_vm.indicatorStyle)])\n\n _vm.$mp.data = Object.assign(\n {},\n {\n $root: {\n g0: g0,\n g1: g1,\n g2: g2,\n g3: g3,\n g4: g4,\n l0: l0,\n s1: s1\n }\n }\n )\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./u-swiper.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./u-swiper.vue?vue&type=script&lang=js&\"","<template>\r\n\t<view\r\n\t\tclass=\"u-swiper\"\r\n\t\t:style=\"{\r\n\t\t\tbackgroundColor: bgColor,\r\n\t\t\theight: $u.addUnit(height),\r\n\t\t\tborderRadius: $u.addUnit(radius)\r\n\t\t}\"\r\n\t>\r\n\t\t<view\r\n\t\t\tclass=\"u-swiper__loading\"\r\n\t\t\tv-if=\"loading\"\r\n\t\t>\r\n\t\t\t<u-loading-icon mode=\"circle\"></u-loading-icon>\r\n\t\t</view>\r\n\t\t<swiper\r\n\t\t\tv-else\r\n\t\t\tclass=\"u-swiper__wrapper\"\r\n\t\t\t:style=\"{\r\n\t\t\t\theight: $u.addUnit(height),\r\n\t\t\t}\"\r\n\t\t\t@change=\"change\"\r\n\t\t\t:circular=\"circular\"\r\n\t\t\t:interval=\"interval\"\r\n\t\t\t:duration=\"duration\"\r\n\t\t\t:autoplay=\"autoplay\"\r\n\t\t\t:current=\"current\"\r\n\t\t\t:currentItemId=\"currentItemId\"\r\n\t\t\t:previousMargin=\"$u.addUnit(previousMargin)\"\r\n\t\t\t:nextMargin=\"$u.addUnit(nextMargin)\"\r\n\t\t\t:acceleration=\"acceleration\"\r\n\t\t\t:displayMultipleItems=\"displayMultipleItems\"\r\n\t\t\t:easingFunction=\"easingFunction\"\r\n\t\t>\r\n\t\t\t<swiper-item\r\n\t\t\t\tclass=\"u-swiper__wrapper__item\"\r\n\t\t\t\tv-for=\"(item, index) in list\"\r\n\t\t\t\t:key=\"index\"\r\n\t\t\t>\r\n\t\t\t\t<view\r\n\t\t\t\t\tclass=\"u-swiper__wrapper__item__wrapper\"\r\n\t\t\t\t\t:style=\"[itemStyle(index)]\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<!-- 在nvue中,image图片的宽度默认为屏幕宽度,需要通过flex:1撑开,另外必须设置高度才能显示图片 -->\r\n\t\t\t\t\t<image\r\n\t\t\t\t\t\tclass=\"u-swiper__wrapper__item__wrapper__image\"\r\n\t\t\t\t\t\tv-if=\"getItemType(item) === 'image'\"\r\n\t\t\t\t\t\t:src=\"getSource(item)\"\r\n\t\t\t\t\t\t:mode=\"imgMode\"\r\n\t\t\t\t\t\t@tap=\"clickHandler(index)\"\r\n\t\t\t\t\t\t:style=\"{\r\n\t\t\t\t\t\t\theight: $u.addUnit(height),\r\n\t\t\t\t\t\t\tborderRadius: $u.addUnit(radius)\r\n\t\t\t\t\t\t}\"\r\n\t\t\t\t\t></image>\r\n\t\t\t\t\t<video\r\n\t\t\t\t\t\tclass=\"u-swiper__wrapper__item__wrapper__video\"\r\n\t\t\t\t\t\tv-if=\"getItemType(item) === 'video'\"\r\n\t\t\t\t\t\t:id=\"`video-${index}`\"\r\n\t\t\t\t\t\t:enable-progress-gesture=\"false\"\r\n\t\t\t\t\t\t:src=\"getSource(item)\"\r\n\t\t\t\t\t\t:poster=\"getPoster(item)\"\r\n\t\t\t\t\t\t:title=\"showTitle && $u.test.object(item) && item.title ? item.title : ''\"\r\n\t\t\t\t\t\t:style=\"{\r\n\t\t\t\t\t\t\theight: $u.addUnit(height)\r\n\t\t\t\t\t\t}\"\r\n\t\t\t\t\t\tcontrols\r\n\t\t\t\t\t\t@tap=\"clickHandler(index)\"\r\n\t\t\t\t\t></video>\r\n\t\t\t\t\t<text\r\n\t\t\t\t\t\tv-if=\"showTitle && $u.test.object(item) && item.title && $u.test.image(getSource(item))\"\r\n\t\t\t\t\t\tclass=\"u-swiper__wrapper__item__wrapper__title u-line-1\"\r\n\t\t\t\t\t>{{ item.title }}</text>\r\n\t\t\t\t</view>\r\n\t\t\t</swiper-item>\r\n\t\t</swiper>\r\n\t\t<view class=\"u-swiper__indicator\" :style=\"[$u.addStyle(indicatorStyle)]\">\r\n\t\t\t<slot name=\"indicator\">\r\n\t\t\t\t<u-swiper-indicator\r\n\t\t\t\t\tv-if=\"!loading && indicator && !showTitle\"\r\n\t\t\t\t\t:indicatorActiveColor=\"indicatorActiveColor\"\r\n\t\t\t\t\t:indicatorInactiveColor=\"indicatorInactiveColor\"\r\n\t\t\t\t\t:length=\"list.length\"\r\n\t\t\t\t\t:current=\"currentIndex\"\r\n\t\t\t\t\t:indicatorMode=\"indicatorMode\"\r\n\t\t\t\t></u-swiper-indicator>\r\n\t\t\t</slot>\r\n\t\t</view>\r\n\t</view>\r\n</template>\r\n\r\n<script>\r\n\timport props from './props.js';\r\n\t/**\r\n\t * Swiper 轮播图\r\n\t * @description 该组件一般用于导航轮播,广告展示等场景,可开箱即用,\r\n\t * @tutorial https://www.uviewui.com/components/swiper.html\r\n\t * @property {Array}\t\t\tlist\t\t\t\t\t轮播图数据\r\n\t * @property {Boolean}\t\t\tindicator\t\t\t\t是否显示面板指示器(默认 false )\r\n\t * @property {String}\t\t\tindicatorActiveColor\t指示器非激活颜色(默认 '#FFFFFF' )\r\n\t * @property {String}\t\t\tindicatorInactiveColor\t指示器的激活颜色(默认 'rgba(255, 255, 255, 0.35)' )\r\n\t * @property {String | Object}\tindicatorStyle\t\t\t指示器样式,可通过bottom,left,right进行定位\r\n\t * @property {String}\t\t\tindicatorMode\t\t\t指示器模式(默认 'line' )\r\n\t * @property {Boolean}\t\t\tautoplay\t\t\t\t是否自动切换(默认 true )\r\n\t * @property {String | Number}\tcurrent\t\t\t\t\t当前所在滑块的 index(默认 0 )\r\n\t * @property {String}\t\t\tcurrentItemId\t\t\t当前所在滑块的 item-id ,不能与 current 被同时指定\r\n\t * @property {String | Number}\tinterval\t\t\t\t滑块自动切换时间间隔(ms)(默认 3000 )\r\n\t * @property {String | Number}\tduration\t\t\t\t滑块切换过程所需时间(ms)(默认 300 )\r\n\t * @property {Boolean}\t\t\tcircular\t\t\t\t播放到末尾后是否重新回到开头(默认 false )\r\n\t * @property {String | Number}\tpreviousMargin\t\t\t前边距,可用于露出前一项的一小部分,nvue和支付宝不支持(默认 0 )\r\n\t * @property {String | Number}\tnextMargin\t\t\t\t后边距,可用于露出后一项的一小部分,nvue和支付宝不支持(默认 0 )\r\n\t * @property {Boolean}\t\t\tacceleration\t\t\t当开启时,会根据滑动速度,连续滑动多屏,支付宝不支持(默认 false )\r\n\t * @property {Number}\t\t\tdisplayMultipleItems\t同时显示的滑块数量,nvue、支付宝小程序不支持(默认 1 )\r\n\t * @property {String}\t\t\teasingFunction\t\t\t指定swiper切换缓动动画类型, 只对微信小程序有效(默认 'default' )\r\n\t * @property {String}\t\t\tkeyName\t\t\t\t\tlist数组中指定对象的目标属性名(默认 'url' )\r\n\t * @property {String}\t\t\timgMode\t\t\t\t\t图片的裁剪模式(默认 'aspectFill' )\r\n\t * @property {String | Number}\theight\t\t\t\t\t组件高度(默认 130 )\r\n\t * @property {String}\t\t\tbgColor\t\t\t\t\t背景颜色(默认 \t'#f3f4f6' )\r\n\t * @property {String | Number}\tradius\t\t\t\t\t组件圆角,数值或带单位的字符串(默认 4 )\r\n\t * @property {Boolean}\t\t\tloading\t\t\t\t\t是否加载中(默认 false )\r\n\t * @property {Boolean}\t\t\tshowTitle\t\t\t\t是否显示标题,要求数组对象中有title属性(默认 false )\r\n\t * @event {Function(index)}\tclick\t点击轮播图时触发\tindex:点击了第几张图片,从0开始\r\n\t * @event {Function(index)}\tchange\t轮播图切换时触发(自动或者手动切换)\tindex:切换到了第几张图片,从0开始\r\n\t * @example\t<u-swiper :list=\"list4\" keyName=\"url\" :autoplay=\"false\"></u-swiper>\r\n\t */\r\n\texport default {\r\n\t\tname: 'u-swiper',\r\n\t\tmixins: [uni.$u.mpMixin, uni.$u.mixin, props],\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\tcurrentIndex: 0\r\n\t\t\t}\r\n\t\t},\r\n\t\twatch: {\r\n\t\t\tcurrent(val, preVal) {\r\n\t\t\t\tif(val === preVal) return;\r\n\t\t\t\tthis.currentIndex = val; // 和上游数据关联上\r\n\t\t\t}\r\n\t\t},\r\n\t\tcomputed: {\r\n\t\t\titemStyle() {\r\n\t\t\t\treturn index => {\r\n\t\t\t\t\tconst style = {}\r\n\t\t\t\t\t// #ifndef APP-NVUE || MP-TOUTIAO\r\n\t\t\t\t\t// 左右流出空间的写法不支持nvue和头条\r\n\t\t\t\t\t// 只有配置了此二值,才加上对应的圆角,以及缩放\r\n\t\t\t\t\tif (this.nextMargin && this.previousMargin) {\r\n\t\t\t\t\t\tstyle.borderRadius = uni.$u.addUnit(this.radius)\r\n\t\t\t\t\t\tif (index !== this.currentIndex) style.transform = 'scale(0.92)'\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// #endif\r\n\t\t\t\t\treturn style\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tmethods: {\r\n getItemType(item) {\r\n if (typeof item === 'string') return uni.$u.test.video(this.getSource(item)) ? 'video' : 'image'\r\n if (typeof item === 'object' && this.keyName) {\r\n if (!item.type) return uni.$u.test.video(this.getSource(item)) ? 'video' : 'image'\r\n if (item.type === 'image') return 'image'\r\n if (item.type === 'video') return 'video'\r\n return 'image'\r\n }\r\n },\r\n\t\t\t// 获取目标路径,可能数组中为字符串,对象的形式,额外可指定对象的目标属性名keyName\r\n\t\t\tgetSource(item) {\r\n\t\t\t\tif (typeof item === 'string') return item\r\n\t\t\t\tif (typeof item === 'object' && this.keyName) return item[this.keyName]\r\n\t\t\t\telse uni.$u.error('请按格式传递列表参数')\r\n\t\t\t\treturn ''\r\n\t\t\t},\r\n\t\t\t// 轮播切换事件\r\n\t\t\tchange(e) {\r\n\t\t\t\t// 当前的激活索引\r\n\t\t\t\tconst {\r\n\t\t\t\t\tcurrent\r\n\t\t\t\t} = e.detail\r\n\t\t\t\tthis.pauseVideo(this.currentIndex)\r\n\t\t\t\tthis.currentIndex = current\r\n\t\t\t\tthis.$emit('change', e.detail)\r\n\t\t\t},\r\n\t\t\t// 切换轮播时,暂停视频播放\r\n\t\t\tpauseVideo(index) {\r\n\t\t\t\tconst lastItem = this.getSource(this.list[index])\r\n\t\t\t\tif (uni.$u.test.video(lastItem)) {\r\n\t\t\t\t\t// 当视频隐藏时,暂停播放\r\n\t\t\t\t\tconst video = uni.createVideoContext(`video-${index}`, this)\r\n\t\t\t\t\tvideo.pause()\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t// 当一个轮播item为视频时,获取它的视频海报\r\n\t\t\tgetPoster(item) {\r\n\t\t\t\treturn typeof item === 'object' && item.poster ? item.poster : ''\r\n\t\t\t},\r\n\t\t\t// 点击某个item\r\n\t\t\tclickHandler(index) {\r\n\t\t\t\tthis.$emit('click', index)\r\n\t\t\t}\r\n\t\t},\r\n\t}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n\t@import \"../../libs/css/components.scss\";\r\n\r\n\t.u-swiper {\r\n\t\t@include flex;\r\n\t\tjustify-content: center;\r\n\t\talign-items: center;\r\n\t\tposition: relative;\r\n\t\toverflow: hidden;\r\n\r\n\t\t&__wrapper {\r\n\t\t\tflex: 1;\r\n\r\n\t\t\t&__item {\r\n\t\t\t\tflex: 1;\r\n\r\n\t\t\t\t&__wrapper {\r\n\t\t\t\t\t@include flex;\r\n\t\t\t\t\tposition: relative;\r\n\t\t\t\t\toverflow: hidden;\r\n\t\t\t\t\ttransition: transform 0.3s;\r\n\t\t\t\t\tflex: 1;\r\n\r\n\t\t\t\t\t&__image {\r\n\t\t\t\t\t\tflex: 1;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t&__video {\r\n\t\t\t\t\t\tflex: 1;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t&__title {\r\n\t\t\t\t\t\tposition: absolute;\r\n\t\t\t\t\t\tbackground-color: rgba(0, 0, 0, 0.3);\r\n\t\t\t\t\t\tbottom: 0;\r\n\t\t\t\t\t\tleft: 0;\r\n\t\t\t\t\t\tright: 0;\r\n\t\t\t\t\t\tfont-size: 28rpx;\r\n\t\t\t\t\t\tpadding: 12rpx 24rpx;\r\n\t\t\t\t\t\tcolor: #FFFFFF;\r\n\t\t\t\t\t\tflex: 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t&__indicator {\r\n\t\t\tposition: absolute;\r\n\t\t\tbottom: 10px;\r\n\t\t}\r\n\t}\r\n</style>\r\n","import mod from \"-!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\mini-css-extract-plugin\\\\dist\\\\loader.js??ref--8-oneOf-1-0!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\css-loader\\\\dist\\\\cjs.js??ref--8-oneOf-1-1!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\stylePostLoader.js!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--8-oneOf-1-2!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\postcss-loader\\\\src\\\\index.js??ref--8-oneOf-1-3!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\sass-loader\\\\dist\\\\cjs.js??ref--8-oneOf-1-4!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--8-oneOf-1-5!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./u-swiper.vue?vue&type=style&index=0&id=7b038a67&lang=scss&scoped=true&\"; export default mod; export * from \"-!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\mini-css-extract-plugin\\\\dist\\\\loader.js??ref--8-oneOf-1-0!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\css-loader\\\\dist\\\\cjs.js??ref--8-oneOf-1-1!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\stylePostLoader.js!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--8-oneOf-1-2!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\postcss-loader\\\\src\\\\index.js??ref--8-oneOf-1-3!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\sass-loader\\\\dist\\\\cjs.js??ref--8-oneOf-1-4!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--8-oneOf-1-5!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\HBuilderX.3.4.7.20220422\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./u-swiper.vue?vue&type=style&index=0&id=7b038a67&lang=scss&scoped=true&\""],"sourceRoot":""}