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.
xxdj1/unpackage/dist/build/h5/static/js/user-pages-coupon-poster.4e...

2 lines
41 KiB

1 year ago
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["user-pages-coupon-poster"],{1290:function(t,e,r){"use strict";r("7a82");var n=r("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n(r("3835")),i=n(r("5530")),a=n(r("c7eb")),u=n(r("1da1")),l=r("26cb"),s=n(r("d4bb")),c={components:{wxmlToCanvas:s.default},props:{},data:function(){return{src:"",options:""}},computed:(0,l.mapState)({primaryColor:function(t){return t.config.configInfo.primaryColor},configInfo:function(t){return t.config.configInfo},userInfo:function(t){return t.user.userInfo}}),onLoad:function(t){var e=this;return(0,u.default)((0,a.default)().mark((function r(){var n;return(0,a.default)().wrap((function(r){while(1)switch(r.prev=r.next){case 0:e.options=t,e.$util.setNavigationBarColor({bg:e.primaryColor}),e.widget=e.$refs.canvas,e.$util.showLoading(),n=e,setTimeout((function(){n.renderToCanvas()}),1e3);case 6:case"end":return r.stop()}}),r)})))()},methods:(0,i.default)((0,i.default)({},(0,l.mapActions)(["user/report"])),{},{renderToCanvas:function(){var t=this;return(0,u.default)((0,a.default)().mark((function e(){var r,n,o,i,u,l,s,c,f,d,h,p,y;return(0,a.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:r=t,n=t.userInfo,o=n.nickName,i=n.avatarUrl,u=t.$util.getPage(-1),l=u.qr_code,s=u.detail,c=s.share_img,o=o.substring(0,10),f=12*o.length+33,d=t.configInfo.app_name,h='\n\t\t\t\t<view class="code-img">\n\t\t\t\t\t<image class="cover" src="'+c+'"></image>\n\t\t\t\t<view class="cover abs">\n\t\t\t\t\t<view class="user-info">\n\t\t\t\t\t\t<text class="user-font">'.concat(o,'</text>\n\t\t\t\t\t</view>\n\t\t\t\t\t<image class="avatar" src="')+i+'"></image> \n\t\t\t\t</view>\n\t\t\t\t\t\n\t\t\t\t\t\t<text class="qr-text">'.concat(d,'</text> \n\t\t\t\t\t\t<text class="qr-text">微信扫一扫立即使用</text> \n\t\t\t\t\t<image class="qr" src="')+l+'"></image>\n\t\t\t\t</view>\n\t\t\t\n\t\t\t\t',console.log(h,"wxml"),p={rel:{position:"relative"},abs:{position:"absolute"},codeImg:{width:326,height:482,backgroundColor:"#fff",borderRadius:15},cover:{width:326,height:326,top:0,left:0},userInfo:{top:15,left:27,fontSize:12,color:"#333",width:f,height:27,borderRadius:14,backgroundColor:"#ffffff",textAlign:"center"},userFont:{top:4,left:8},avatar:{width:32,height:32,top:-15,left:15,borderRadius:16},qrText:{top:60,left:25,width:345,height:23,fontSize:14,textAlign:"left",color:"#333"},qr:{width:121,height:121,borderRadius:62,top:-28,left:180}},y=t.widget.renderToCanvas({wxml:h,style:p}),console.log(y,"===========ppppppppp1"),y.then((function(e){console.log("container",e.layoutBox),t.container=e,r.extraImage(),r.$util.hideAll()}));case 13:case"end":return e.stop()}}),e)})))()},extraImage:function(){var t=this;return(0,u.default)((0,a.default)().mark((function e(){var r;return(0,a.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:r=t.widget.canvasToTempFilePath(),r.then((function(e){t.src=e.tempFilePath}));case 2:case"end":return e.stop()}}),e)})))()},previewImage:function(){var t=this.src;uni.previewImage({current:t,urls:[t]})},saveImage:function(){var t=this;return(0,u.default)((0,a.default)().mark((function e(){var r,n,i,u;return(0,a.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$util.checkAuth({type:"writePhotosAlbum"});case 2:return r=t.src,e.next=5,uni.saveImageToPhotosAlbum({filePath:r});case 5:if(n=e.sent,i=(0,o.default)(n,2),u=i[0],i[1],!u){e.next=11;break}return e.abrupt("return");case 11:uni.showToast({icon:"none",title:"保存成功"});case 12:case"end":return e.stop()}}),e)})))()}})};e.default=c},"148d":function(t,e,r){"use strict";r.r(e);var n=r("7cf3"),o=r.n(n);for(var i in n)["default"].indexOf(i)<0&&function(t){r.d(e,t,(function(){return n[t]}))}(i);e["default"]=o.a},"1ec9":function(t,e,r){"use strict";r.r(e);var n=r("a0c7"),o=r("4784");for(var i in o)["default"].indexOf(i)<0&&function(t){r.d(e,t,(function(){return o[t]}))}(i);r("9e14");var a=r("f0c5"),u=Object(a["a"])(o["default"],n["b"],n["c"],!1,null,"5402fbeb",null,!1,n["a"],void 0);e["defaul
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t.exports=o=function(){return e},t.exports.__esModule=!0,t.exports["default"]=t.exports;var e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},l=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",c=u.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(C){f=function(t,e,r){return t[e]=r}}function d(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),u=new E(n||[]);return a(i,"_invoke",{value:S(t,r,u)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(C){return{type:"throw",arg:C}}}e.wrap=d;var p={};function y(){}function v(){}function g(){}var b={};f(b,l,(function(){return this}));var m=Object.getPrototypeOf,x=m&&m(m(T([])));x&&x!==r&&i.call(x,l)&&(b=x);var w=g.prototype=y.prototype=Object.create(b);function _(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){var r;a(this,"_invoke",{value:function(o,a){function u(){return new e((function(r,u){(function r(o,a,u,l){var s=h(t[o],t,a);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==n(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,u,l)}),(function(t){r("throw",t,u,l)})):e.resolve(f).then((function(t){c.value=t,u(c)}),(function(t){return r("throw",t,u,l)}))}l(s.arg)})(o,a,r,u)}))}return r=r?r.then(u,u):u()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=L(a,r);if(u){if(u===p)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=h(t,e,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function L(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator["return"]&&(e.method="return",e.arg=void 0,L(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=h(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,p;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(t){if(t){var e=t[l];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(i.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:P}}function P(){return{value:void 0,done:!0}}return v.prototype=g,a(w,"constructor",{value:g,configurable:!0}),a(g,"constructor",{value:v,configurable:!0}),v.displayName=f(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,f(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},_(k.prototype),f(k.prototype,s,(f