wxParseImg.js.map
9.8 KB
{"version":3,"sources":["webpack:///E:/项目/tigerprogram/componentsk/u-parse/components/wxParseImg.vue?3855","webpack:///E:/项目/tigerprogram/componentsk/u-parse/components/wxParseImg.vue?c4d7","webpack:///E:/项目/tigerprogram/componentsk/u-parse/components/wxParseImg.vue?1934","webpack:///E:/项目/tigerprogram/componentsk/u-parse/components/wxParseImg.vue?986d","webpack:///E:/项目/tigerprogram/componentsk/u-parse/components/wxParseImg.vue"],"names":["name","data","newStyleStr","preview","props","node","type","Object","default","methods","wxParseImgTap","e","src","currentTarget","dataset","parent","$parent","wxParseImgLoad","mp","detail","width","height","recal","wxAutoImageCal","imageheight","imageWidth","attr","padding","mode","styleStr","imageHeightStyle","originalWidth","originalHeight","windowWidth","$screen","results","removeImageUrl"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAuH;AACvH;AAC8D;AACL;;;AAGzD;AACqK;AACrK,gBAAgB,+KAAU;AAC1B,EAAE,gFAAM;AACR,EAAE,qFAAM;AACR,EAAE,8FAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,yFAAU;AACZ;AACA;;AAEA;AACA,IAAI,KAAU,EAAE,YAiBf;AACD;AACe,gF;;;;;;;;;;;;ACzCf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACRA;AAAA;AAAA;AAAA;AAAomB,CAAgB,8nBAAG,EAAC,C;;;;;;;;;;;;wFCAxnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEe;AACbA,MAAI,EAAE,YADO;AAEbC,MAFa,kBAEN;AACL,WAAO;AACLC,iBAAW,EAAE,EADR;AAELC,aAAO,EAAE,IAFJ,EAAP;;AAID,GAPY;AAQbC,OAAK,EAAE;AACLC,QA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ACE,OAA5F;AACD,KAtBM;AAuBP;AACAJ,kBAxBO,0BAwBQQ,aAxBR,EAwBuBC,cAxBvB,EAwBuC;AAC5C;AAD4C,UAEpCL,OAFoC,GAExB,KAAKtB,IAAL,CAAUqB,IAFc,CAEpCC,OAFoC;AAG5C,UAAMM,WAAW,GAAG,KAAK5B,IAAL,CAAU6B,OAAV,CAAkBd,KAAlB,GAA2B,IAAIO,OAAnD;AACA,UAAMQ,OAAO,GAAG,EAAhB;;AAEA,UAAIJ,aAAa,GAAG,EAAhB,IAAsBC,cAAc,GAAG,EAA3C,EAA+C;AACrCpB,WADqC,GAC7B,KAAKP,IAAL,CAAUqB,IADmB,CACrCd,GADqC;AAEjD,YAAIG,MAAM,GAAG,KAAKC,OAAlB;AACA,eAAM,CAACD,MAAM,CAACZ,OAAR,IAAmB,OAAOY,MAAM,CAACZ,OAAd,KAA0B,UAAnD,EAA+D;AAC9DY,gBAAM,GAAGA,MAAM,CAACC,OAAhB;AACA;AACDD,cAAM,CAACqB,cAAP,CAAsBxB,GAAtB;AACI,aAAKT,OAAL,GAAe,KAAf;AACD;;AAED;AACA,UAAI4B,aAAa,GAAGE,WAApB,EAAiC;AAC/B;AACAE,eAAO,CAACV,UAAR,GAAqBQ,WAArB;AACAE,eAAO,CAACX,WAAR,GAAsBS,WAAW,IAAID,cAAc,GAAGD,aAArB,CAAjC;AACD,OAJD,MAIO;AACL;AACAI,eAAO,CAACV,UAAR,GAAqBM,aAArB;AACAI,eAAO,CAACX,WAAR,GAAsBQ,cAAtB;AACD;;AAED,aAAOG,OAAP;AACD,KApDM,EAhBI,E","file":"componentsk/u-parse/components/wxParseImg.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./wxParseImg.vue?vue&type=template&id=46339420&\"\nvar renderjs\nimport script from \"./wxParseImg.vue?vue&type=script&lang=js&\"\nexport * from \"./wxParseImg.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!D:\\\\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 null,\n null,\n false,\n components,\n renderjs\n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\vue-hot-reload-api\\\\dist\\\\index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('46339420')) {\n api.createRecord('46339420', component.options)\n } else {\n api.reload('46339420', component.options)\n }\n module.hot.accept(\"./wxParseImg.vue?vue&type=template&id=46339420&\", function () {\n api.rerender('46339420', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"E:/项目/tigerprogram/componentsk/u-parse/components/wxParseImg.vue\"\nexport default component.exports","export * from \"-!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\templateLoader.js??vue-loader-options!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--16-0!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\template.js!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-uni-app-loader\\\\page-meta.js!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./wxParseImg.vue?vue&type=template&id=46339420&\"","var components\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./wxParseImg.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--12-1!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!D:\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./wxParseImg.vue?vue&type=script&lang=js&\"","//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n//\r\n\r\nexport default {\r\n name: 'wxParseImg',\r\n data() {\r\n return {\r\n newStyleStr: '',\r\n preview: true,\r\n };\r\n },\r\n props: {\r\n node: {\r\n type: Object,\r\n default() {\r\n return {};\r\n },\r\n },\r\n },\r\n methods: {\r\n wxParseImgTap(e) {\r\n if (!this.preview) return;\r\n const { src } = e.currentTarget.dataset;\r\n if (!src) return;\r\n let parent = this.$parent;\r\n while(!parent.preview || typeof parent.preview !== 'function') {// TODO 遍历获取父节点执行方法\r\n \tparent = parent.$parent;\r\n }\r\n parent.preview(src, e);\r\n },\r\n // 图片视觉宽高计算函数区\r\n wxParseImgLoad(e) {\r\n const { src } = e.currentTarget.dataset;\r\n if (!src) return;\r\n const { width, height } = e.mp.detail;\r\n const recal = this.wxAutoImageCal(width, height);\r\n const { imageheight, imageWidth } = recal;\r\n const { padding, mode } = this.node.attr;\r\n const { styleStr } = this.node;\r\n const imageHeightStyle = mode === 'widthFix' ? '' : `height: ${imageheight}px;`;\r\n this.newStyleStr = `${styleStr}; ${imageHeightStyle}; width: ${imageWidth}px; padding: 0 ${+padding}px;`;\r\n },\r\n // 计算视觉优先的图片宽高\r\n wxAutoImageCal(originalWidth, originalHeight) {\r\n // 获取图片的原始长宽\r\n const { padding } = this.node.attr;\r\n const windowWidth = this.node.$screen.width - (2 * padding);\r\n const results = {};\r\n\r\n if (originalWidth < 60 || originalHeight < 60) {\r\n const { src } = this.node.attr;\r\n\t\t\t\tlet parent = this.$parent;\r\n\t\t\t\twhile(!parent.preview || typeof parent.preview !== 'function') {\r\n\t\t\t\t\tparent = parent.$parent;\r\n\t\t\t\t}\r\n\t\t\t\tparent.removeImageUrl(src);\r\n this.preview = false;\r\n }\r\n\r\n // 判断按照那种方式进行缩放\r\n if (originalWidth > windowWidth) {\r\n // 在图片width大于手机屏幕width时候\r\n results.imageWidth = windowWidth;\r\n results.imageheight = windowWidth * (originalHeight / originalWidth);\r\n } else {\r\n // 否则展示原来的数据\r\n results.imageWidth = originalWidth;\r\n results.imageheight = originalHeight;\r\n }\r\n\r\n return results;\r\n },\r\n },\r\n};\r\n"],"sourceRoot":""}