| 123456789101112131415161718192021222324252627282930313233343536373839 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/ksp-image-cutter/ksp-image-cutter"],{582:
- /*!********************************************************************************************!*\
- !*** C:/Users/FC/Desktop/大数据平台app/master/components/ksp-image-cutter/ksp-image-cutter.vue ***!
- \********************************************************************************************/
- /*! no static exports found */function(t,e,i){"use strict";i.r(e);var h=i(/*! ./ksp-image-cutter.vue?vue&type=template&id=4e360878&scoped=true& */583),a=i(/*! ./ksp-image-cutter.vue?vue&type=script&lang=js& */585);for(var s in a)"default"!==s&&function(t){i.d(e,t,(function(){return a[t]}))}(s);i(/*! ./ksp-image-cutter.vue?vue&type=style&index=0&id=4e360878&scoped=true&lang=css& */587);var r,m=i(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */10),f=Object(m["default"])(a["default"],h["render"],h["staticRenderFns"],!1,null,"4e360878",null,!1,h["components"],r);f.options.__file="components/ksp-image-cutter/ksp-image-cutter.vue",e["default"]=f.exports},583:
- /*!***************************************************************************************************************************************!*\
- !*** C:/Users/FC/Desktop/大数据平台app/master/components/ksp-image-cutter/ksp-image-cutter.vue?vue&type=template&id=4e360878&scoped=true& ***!
- \***************************************************************************************************************************************/
- /*! exports provided: render, staticRenderFns, recyclableRender, components */function(t,e,i){"use strict";i.r(e);var h=i(/*! -!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./ksp-image-cutter.vue?vue&type=template&id=4e360878&scoped=true& */584);i.d(e,"render",(function(){return h["render"]})),i.d(e,"staticRenderFns",(function(){return h["staticRenderFns"]})),i.d(e,"recyclableRender",(function(){return h["recyclableRender"]})),i.d(e,"components",(function(){return h["components"]}))},584:
- /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
- !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!C:/Users/FC/Desktop/大数据平台app/master/components/ksp-image-cutter/ksp-image-cutter.vue?vue&type=template&id=4e360878&scoped=true& ***!
- \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
- /*! exports provided: render, staticRenderFns, recyclableRender, components */function(t,e,i){"use strict";var h;i.r(e),i.d(e,"render",(function(){return a})),i.d(e,"staticRenderFns",(function(){return r})),i.d(e,"recyclableRender",(function(){return s})),i.d(e,"components",(function(){return h}));var a=function(){var t=this,e=t.$createElement;t._self._c},s=!1,r=[];a._withStripped=!0},585:
- /*!*********************************************************************************************************************!*\
- !*** C:/Users/FC/Desktop/大数据平台app/master/components/ksp-image-cutter/ksp-image-cutter.vue?vue&type=script&lang=js& ***!
- \*********************************************************************************************************************/
- /*! no static exports found */function(t,e,i){"use strict";i.r(e);var h=i(/*! -!./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./ksp-image-cutter.vue?vue&type=script&lang=js& */586),a=i.n(h);for(var s in h)"default"!==s&&function(t){i.d(e,t,(function(){return h[t]}))}(s);e["default"]=a.a},586:
- /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
- !*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!C:/Users/FC/Desktop/大数据平台app/master/components/ksp-image-cutter/ksp-image-cutter.vue?vue&type=script&lang=js& ***!
- \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
- /*! no static exports found */function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={props:{url:{type:String,default:""},fixed:{type:Boolean,default:!1},width:{type:Number,default:200},height:{type:Number,default:200},maxWidth:{type:Number,default:1024},maxHeight:{type:Number,default:1024},blob:{type:Boolean,default:!0}},data:function(){return{mask:{show:!1},frame:{left:50,top:50,width:this.width,height:this.height},image:{left:20,top:20,width:300,height:400},real:{width:100,height:100},target:{width:this.width,height:this.height},touches:[],type:"",start:{frame:{left:0,top:0,width:0,height:0},image:{left:0,top:0,width:0,height:0}},timeoutId:-1,context:null}},mounted:function(){this.context=t.createCanvasContext("canvas",this),this.targetContext=t.createCanvasContext("target",this)},methods:{imageLoad:function(e){var i=this;this.mask.show=!0,this.real.width=e.detail.width,this.real.height=e.detail.height,this.image.width=e.detail.width,this.image.height=e.detail.height,this.frame.width=this.width,this.frame.height=this.height,this.fixed||(this.frame.width=this.image.width,this.frame.height=this.image.height);var h=t.createSelectorQuery().in(this);h.select(".body").boundingClientRect((function(t){var e=t.width,h=t.height,a=i.frame.width,s=i.frame.height,r=.8*e,m=.8*h,f=r/a,n=m/s,o=f;f<n&&(o=n),r=a*o,m=s*o;var g=(e-r)/2,l=(h-m)/2;i.frame.width=r,i.frame.height=m,i.frame.left=g,i.frame.top=l;var c=i.image.width,d=i.image.height;f=r/c,n=m/d,o=f,f<n&&(o=n),i.image.width=c*o,i.image.height=d*o,i.image.left=(e-i.image.width)/2,i.image.top=(h-i.image.height)/2,setTimeout((function(){i.trimImage()}),100)})).exec()},touchHandle:function(){},touchStart:function(t,e){this.stopTime(),this.mask.show=!1,0==this.touches.length&&(this.type=e,this.start.frame.left=this.frame.left,this.start.frame.top=this.frame.top,this.start.frame.width=this.frame.width,this.start.frame.height=this.frame.height,this.start.image.left=this.image.left,this.start.image.top=this.image.top,this.start.image.width=this.image.width,this.start.image.height=this.image.height);for(var i=t.changedTouches,h=0;h<i.length;h++){var a=i[h];this.touches.push(a)}},touchMove:function(t){this.stopTime(),t.preventDefault();var e=t.touches;if(1==this.touches.length)"plank"==this.type||"frame"==this.type||this.fixed?this.moveImage(this.touches[0],e[0]):this.scaleFrame(this.touches[0],e[0],this.type);else if(2==this.touches.length&&2==e.length){var i=this.touches[0],h=this.touches[1],a=e[0],s=e[1];if(i.identifier!=a.identifier){var r=a;a=s,s=r}this.scaleImage(i,h,a,s)}},touchEnd:function(t){this.type="",this.touches=[],this.startTime()},touchCancel:function(t){this.type="",this.touches=[],this.startTime()},startTime:function(){var t=this;this.stopTime(),this.timeoutId=setTimeout((function(){t.trimImage()}),800)},stopTime:function(){this.timeoutId>=0&&(clearTimeout(this.timeoutId),this.timeoutId=-1)},trimImage:function(){var e=this;this.mask.show=!0;var i=t.createSelectorQuery().in(this);i.select(".body").boundingClientRect((function(t){var i=t.width,h=t.height,a=e.frame.width,s=e.frame.height,r=.8*i,m=.8*h,f=r/a,n=m/s,o=f;f>n&&(o=n),r=a*o,m=s*o;var g=(i-r)/2,l=(h-m)/2,c=g-e.frame.left+(e.frame.left-e.image.left)*(1-o),d=l-e.frame.top+(e.frame.top-e.image.top)*(1-o);e.frame.width=r,e.frame.height=m,e.frame.left=g,e.frame.top=l,e.image.width*=o,e.image.height*=o,e.image.left+=c,e.image.top+=d})).exec(),setTimeout((function(){var t=e.image.width/e.real.width,i=(e.frame.left-e.image.left)/t,h=(e.frame.top-e.image.top)/t,a=e.frame.width/t,s=e.frame.height/t;e.context.drawImage(e.url,i,h,a,s,0,0,e.frame.width,e.frame.height),e.context.draw(!1)}),100)},moveImage:function(t,e){var i=e.clientX-t.clientX,h=e.clientY-t.clientY;this.image.left=this.start.image.left+i,this.image.top=this.start.image.top+h,this.image.left>this.frame.left&&(this.image.left=this.frame.left),this.image.top>this.frame.top&&(this.image.top=this.frame.top),this.image.left+this.image.width<this.frame.left+this.frame.width&&(this.image.left=this.frame.left+this.frame.width-this.image.width),this.image.top+this.image.height<this.frame.top+this.frame.height&&(this.image.top=this.frame.top+this.frame.height-this.image.height)},scaleImage:function(t,e,i,h){var a=t.clientX,s=t.clientY,r=e.clientX,m=e.clientY,f=i.clientX,n=i.clientY,o=h.clientX,g=h.clientY,l=Math.sqrt((a-r)*(a-r)+(s-m)*(s-m)),c=Math.sqrt((f-o)*(f-o)+(n-g)*(n-g)),d=(a+r)/2,u=(s+m)/2,p=(f+o)/2,w=(n+g)/2,v=p-d,b=w-u,y=c/l;this.start.image.width*y<this.frame.width&&(y=this.frame.width/this.start.image.width),this.start.image.height*y<this.frame.height&&(y=this.frame.height/this.start.image.height),this.start.image.width*y<this.frame.width&&(y=this.frame.width/this.start.image.width),this.image.left=this.start.image.left+v-(d-this.start.image.left)*(y-1),this.image.top=this.start.image.top+b-(u-this.start.image.top)*(y-1),this.image.width=this.start.image.width*y,this.image.height=this.start.image.height*y,this.image.left>this.frame.left&&(this.image.left=this.frame.left),this.image.top>this.frame.top&&(this.image.top=this.frame.top),this.image.left+this.image.width<this.frame.left+this.frame.width&&(this.image.left=this.frame.left+this.frame.width-this.image.width),this.image.top+this.image.height<this.frame.top+this.frame.height&&(this.image.top=this.frame.top+this.frame.height-this.image.height)},scaleFrame:function(t,e,i){var h=e.clientX-t.clientX,a=e.clientY-t.clientY,s=this.start.frame.left,r=this.start.frame.top,m=this.start.frame.left+this.start.frame.width,f=this.start.frame.top+this.start.frame.height;"left"==i?s+=h:"right"==i?m+=h:"top"==i?r+=a:"bottom"==i?f+=a:"left-top"==i?(s+=h,r+=a):"left-bottom"==i?(s+=h,f+=a):"right-top"==i?(m+=h,r+=a):"right-bottom"==i&&(m+=h,f+=a),s<this.image.left&&(s=this.image.left),r<this.image.top&&(r=this.image.top),m>this.image.left+this.image.width&&(m=this.image.left+this.image.width),f>this.image.top+this.image.height&&(f=this.image.top+this.image.height),this.frame.left=s,this.frame.top=r,this.frame.width=m-s,this.frame.height=f-r},parseBlob:function(t){for(var e=t.split(","),i=e[0].match(/:(.*?);/)[1],h=atob(e[1]),a=h.length,s=new Uint8Array(a),r=0;r<a;r++)s[r]=h.charCodeAt(r);var m=URL||webkitURL;return m.createObjectURL(new Blob([s],{type:i}))},onok:function(){var e=this,i=this.image.width/this.real.width,h=(this.frame.left-this.image.left)/i,a=(this.frame.top-this.image.top)/i,s=this.frame.width/i,r=this.frame.height/i,m=s,f=r;if(this.fixed)m=this.width/2,f=this.height/2;else{if(m>this.maxWidth/2){var n=this.maxWidth/2/m;m*=n,f*=n}if(f>this.maxHeight/2){n=this.maxHeight/2/f;f*=n,m*=n}}this.target.width=m,this.target.height=f,t.showLoading({title:"正在裁剪"}),setTimeout((function(){e.targetContext.drawImage(e.url,h,a,s,r,0,0,m,f),e.targetContext.draw(!1,(function(){t.canvasToTempFilePath({canvasId:"target",success:function(t){var i=t.tempFilePath;e.$emit("ok",{path:i})},fail:function(t){console.log(t)},complete:function(){t.hideLoading()}},e)}))}),100)},oncancle:function(){this.$emit("cancel")}}};e.default=i}).call(this,i(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */1)["default"])},587:
- /*!*****************************************************************************************************************************************************!*\
- !*** C:/Users/FC/Desktop/大数据平台app/master/components/ksp-image-cutter/ksp-image-cutter.vue?vue&type=style&index=0&id=4e360878&scoped=true&lang=css& ***!
- \*****************************************************************************************************************************************************/
- /*! no static exports found */function(t,e,i){"use strict";i.r(e);var h=i(/*! -!./node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--6-oneOf-1-2!./node_modules/postcss-loader/src??ref--6-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./ksp-image-cutter.vue?vue&type=style&index=0&id=4e360878&scoped=true&lang=css& */588),a=i.n(h);for(var s in h)"default"!==s&&function(t){i.d(e,t,(function(){return h[t]}))}(s);e["default"]=a.a},588:
- /*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
- !*** ./node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--6-oneOf-1-2!./node_modules/postcss-loader/src??ref--6-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!C:/Users/FC/Desktop/大数据平台app/master/components/ksp-image-cutter/ksp-image-cutter.vue?vue&type=style&index=0&id=4e360878&scoped=true&lang=css& ***!
- \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
- /*! no static exports found */function(t,e,i){}}]);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/components/ksp-image-cutter/ksp-image-cutter.js.map
- ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
- 'components/ksp-image-cutter/ksp-image-cutter-create-component',
- {
- 'components/ksp-image-cutter/ksp-image-cutter-create-component':(function(module, exports, __webpack_require__){
- __webpack_require__('1')['createComponent'](__webpack_require__(582))
- })
- },
- [['components/ksp-image-cutter/ksp-image-cutter-create-component']]
- ]);
|