You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
15 KiB

{"version":3,"sources":["webpack:////Users/yanghao/Desktop/禅易云/zhaoshangMiniApp-uniapp/components/StorePoster.vue?83d7","webpack:////Users/yanghao/Desktop/禅易云/zhaoshangMiniApp-uniapp/components/StorePoster.vue?edb6","webpack:////Users/yanghao/Desktop/禅易云/zhaoshangMiniApp-uniapp/components/StorePoster.vue?dc81","webpack:////Users/yanghao/Desktop/禅易云/zhaoshangMiniApp-uniapp/components/StorePoster.vue?fb95","uni-app:///components/StorePoster.vue","webpack:////Users/yanghao/Desktop/禅易云/zhaoshangMiniApp-uniapp/components/StorePoster.vue?7cb7","webpack:////Users/yanghao/Desktop/禅易云/zhaoshangMiniApp-uniapp/components/StorePoster.vue?e9d3"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAoI;AACpI;AAC+D;AACL;AACsC;;;AAGhG;AAC6M;AAC7M,gBAAgB,iNAAU;AAC1B,EAAE,iFAAM;AACR,EAAE,kGAAM;AACR,EAAE,2GAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,sGAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACvBf;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;AAA0zB,CAAgB,yyBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACyC90B;AACA,yD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAFA;eAIA,EACA,mBADA,EAEA,SACA,0BADA,EAEA,kBAFA,EAGA,cAHA,EAFA,EAOA,uBACA,SACA,mBADA,EAEA,eAFA,GAIA,CAZA,EAaA,SACA,iDACA,gBACA,sCACA,4BACA,sBACA,CAFA,EAGA,CACA,CARA,EAbA,EAuBA,8BAvBA,EAwBA,WACA,+CACA,+BACA,0BACA,mCACA,CALA,EAMA,6BACA,oCACA,CARA,EASA,YATA,wBASA,GATA,EASA,CACA,mBACA,QADA,EAEA,0BACA;AAEA;AACA,uBADA;AAEA,2BAFA;;AAIA,SATA;AAUA;AACA;AACA;AACA,uBADA;AAEA,2BAFA;;AAIA,SAhBA;;AAkBA,KA5BA;AA6BA;AACA;;AAEA;AACA,sBADA;AAEA,kBAFA;;AAIA;AACA,4GADA;;AAGA,UAHA,CAGA;AACA;AACA;AACA,OANA;AAOA,aAPA,CAOA;AACA;AACA,OATA;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAlEA,EAxBA,E;;;;;;;;;;;;;AC5CA;AAAA;AAAA;AAAA;AAAqgD,CAAgB,i6CAAG,EAAC,C;;;;;;;;;;;ACAzhD;AACA,OAAO,KAAU,EAAE,kBAKd","file":"components/StorePoster.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./StorePoster.vue?vue&type=template&id=0de5befa&scoped=true&\"\nvar renderjs\nimport script from \"./StorePoster.vue?vue&type=script&lang=js&\"\nexport * from \"./StorePoster.vue?vue&type=script&lang=js&\"\nimport style0 from \"./StorePoster.vue?vue&type=style&index=0&id=0de5befa&scoped=true&lang=less&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../Applications/HBuilderX.app/Contents/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 \"0de5befa\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"components/StorePoster.vue\"\nexport default component.exports","export * from \"-!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--16-0!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./StorePoster.vue?vue&type=template&id=0de5befa&scoped=true&\"","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 \"-!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./StorePoster.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./StorePoster.vue?vue&type=script&lang=js&\"","<template>\n <view v-if=\"posterImageStatus\" class=\"poster-first\">\n <div class=\"posterCanvasWarp\">\n <canvas class=\"posterCanvas\" canvas-id=\"myCanvas\"></canvas>\n </div>\n <!-- <view class=\"poster-pop\" v-show=\"!canvasStatus\">\n <image\n :src=\"`${$VUE_APP_RESOURCES_URL}/images/poster-close.png`\"\n class=\"close\"\n @click=\"posterImageClose\"\n />\n <view class=\"canvas\" ref=\"poster\">\n <image class=\"image\" :src=\"posterData.image\" alt=\"商品图片\" />\n <view class=\"text black\">\n <text v-text=\"posterData.title\"></text>\n </view>\n <view class=\"text rad\">\n <text v-text=\"'¥' + posterData.price\"></text>\n </view>\n <view class=\"code\">\n <view class=\"code-img\">\n <image :src=\"posterData.code\" show-menu-by-longpress mode=\"widthFix\" alt=\"二维码\" />\n </view>\n <view class=\"code-text\">\n <text>长按识别二维码 立即购买</text>\n </view>\n </view>\n </view>\n <view class=\"save-poster\" @click=\"savePosterPath\">生成图片</view>\n </view>-->\n <view class=\"poster-pop\" v-show=\"canvasStatus\">\n <img :src=\"`${$VUE_APP_RESOURCES_URL}/images/poster-close.png`\" class=\"close\" @click=\"posterImageClose\" mode=\"widthFix\" />\n <image :src=\"posterImage\" alt=\"tp\" class=\"poster-image\" show-menu-by-longpress mode=\"widthFix\" />\n <view class=\"save-poster\" @click=\"saveImg\">保存海报</view>\n </view>\n <view class=\"mask\"></view>\n </view>\n</template>\n\n<script>\n// import html2canvas from \"html2canvas\";\nimport { PosterCanvas } from '@/utils'\nimport { getProductPoster } from '@/api/store'\n\nexport default {\n name: 'StorePoster',\n props: {\n posterImageStatus: Boolean,\n posterData: Object,\n goodId: String,\n },\n data: function() {\n return {\n canvasStatus: false,\n posterImage: '',\n }\n },\n watch: {\n posterImageStatus: function() {\n var that = this\n if (that.posterImageStatus === true) {\n that.$nextTick(function() {\n that.savePosterPath()\n })\n }\n },\n },\n mounted: function() {},\n methods: {\n posterImageClose: function() {\n this.posterImageStatus = false\n this.canvasStatus = false\n this.$emit('setPosterImageStatus')\n },\n saveImg: function() {\n this.downloadFile(this.posterImage)\n },\n downloadFile(url) {\n uni.downloadFile({\n url,\n fail: function(res) {\n console.log(res)\n\n uni.showModal({\n title: '提示',\n content: '保存失败',\n })\n },\n success: function(res) {\n console.log(res)\n uni.showModal({\n title: '提示',\n content: '保存成功',\n })\n },\n })\n },\n savePosterPath: function() {\n const that = this\n\n uni.showLoading({\n title: '海报生成中',\n mask: true,\n })\n getProductPoster(this.goodId, {\n from: this.$deviceType == 'weixin' || this.$deviceType == 'weixinh5' ? 'uniappH5' : this.$deviceType,\n })\n .then(res => {\n this.canvasStatus = true\n this.posterImage = res.data\n })\n .finally(() => {\n uni.hideLoading()\n })\n // return;\n // //清空图片重新生成\n // that.posterImage = \"\";\n // uni.showLoading({ title: \"海报生成中\", mask: true });\n // console.log(this);\n // var prodId = that.$yrouter.currentRoute.query.id;\n // uni.downloadFile({\n // url:\n // this.$VUE_APP_API_URL +\n // \"/shareImg/\" +\n // prodId +\n // \"?shareImgName=\" +\n // this.posterData.code,\n // fail: function(res) {},\n // success: function(res) {\n // that.canvasStatus = true;\n // that.posterImage = res.tempFilePath;\n // uni.hideLoading();\n // }\n // });\n },\n },\n}\n</script>\n\n<style scoped lang=\"less\" lang=\"less\">\n.poster-first {\n overscroll-behavior: contain;\n}\n\n.poster-pop {\n width: 4.5 * 100rpx;\n height: 8 * 100rpx;\n position: fixed;\n left: 50%;\n transform: translateX(-50%);\n z-index: 99;\n top: 50%;\n margin-top: -4.6 * 100rpx;\n}\n\n.poster-pop .canvas {\n background-color: #ffffff;\n height: 8 * 100rpx;\n}\n\n.poster-pop .poster-image {\n width: 100%;\n height: auto;\n}\n\n.poster-pop .canvas .image {\n width: 4.5 * 100rpx;\n height: 4.5 * 100rpx;\n display: block;\n}\n\n.poster-pop .canvas .text {\n text-align: center;\n color: #000000;\n margin-top: 0.32 * 100rpx;\n}\n\n.poster-pop .canvas .text.black {\n height: 0.68 * 100rpx;\n}\n\n.poster-pop .canvas .text.rad {\n color: #ff0000;\n}\n\n.poster-pop .canvas .code {\n height: 1.4 * 100rpx;\n display: flex;\n}\n\n.poster-pop .canvas .code .code-img {\n width: 33%;\n padding: 0.06 * 100rpx;\n}\n\n.poster-pop .canvas .code .code-img image {\n width: 100%;\n}\n\n.poster-pop .canvas .code .code-text {\n width: 60%;\n font-size: 0.12 * 100rpx;\n line-height: 1.64 * 100rpx;\n}\n\n.poster-pop .close {\n width: 0.46 * 100rpx;\n height: 0.75 * 100rpx;\n position: fixed;\n right: 0;\n top: -0.73 * 100rpx;\n display: block;\n}\n\n.poster-pop .save-poster {\n background-color: #df2d0a;\n font-size: 0.22 * 100rpx;\n color: #fff;\n text-align: center;\n height: 0.76 * 100rpx;\n line-height: 0.76 * 100rpx;\n width: 100%;\n margin-top: -0.1 * 100rpx;\n border-radius: 0 0 10rpx 10rpx;\n}\n\n.poster-pop .keep {\n color: #fff;\n text-align: center;\n font-size: 0.25 * 100rpx;\n margin-top: 0.1 * 100rpx;\n}\n\n.mask {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.6);\n z-index: 9;\n}\n</style>\n","import mod from \"-!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--10-oneOf-1-0!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--10-oneOf-1-2!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/less-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--10-oneOf-1-5!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./StorePoster.vue?vue&type=style&index=0&id=0de5befa&scoped=true&lang=less&\"; export default mod; export * from \"-!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--10-oneOf-1-0!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--10-oneOf-1-2!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-3!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/less-loader/dist/cjs.js??ref--10-oneOf-1-4!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--10-oneOf-1-5!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./StorePoster.vue?vue&type=style&index=0&id=0de5befa&scoped=true&lang=less&\"","// extracted by mini-css-extract-plugin\n if(module.hot) {\n // 1635513135598\n var cssReload = require(\"/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/hmr/hotModuleReplacement.js\")(module.id, {\"hmr\":true,\"publicPath\":\"../../\",\"locals\":false});\n module.hot.dispose(cssReload);\n module.hot.accept(undefined, cssReload);\n }\n "],"sourceRoot":""}