require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["plugin/contract/sign"],{"0db2":function(t,n,i){"use strict";i.r(n);var e=i("7aa3"),s=i.n(e);for(var o in e)["default"].indexOf(o)<0&&function(t){i.d(n,t,(function(){return e[t]}))}(o);n["default"]=s.a},"11ab":function(t,n,i){},"7aa3":function(t,n,i){"use strict";(function(t){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i={data:function(){return{id:"",contract:{},canvasCtx:null,isTouchMove:!1,startX:0,startY:0,moveX:0,moveY:0,is_sign:!1,isPC:!1,pageOffsetLeft:0,pageOffsetTop:0}},onLoad:function(t){this.id=t.id,this.init()},onReady:function(t){this.initCanvas()},methods:{sel:function(){this.$util.openDocument(this.contract.content)},clear:function(){this.canvasCtx.draw()},submit:function(){var n=this;if(!this.is_sign)return this.toast("请先签名");t.showModal({title:"提示",content:"确定签署合同吗？",success:function(i){i.confirm&&t.canvasToTempFilePath({canvasId:"contract",success:function(t){var i=t.tempFilePath;n.$util.uploadImage((function(t){var i=t.url;n.$util.get("contract/contract/signContract",{id:n.id,sign_img:i}).then((function(t){1==t.code?n.toast(t.message,1500,(function(){n.signContract()})):n.toast(t.message,2e3)}))}),i)},fail:function(t){}},n)}})},init:function(){var n=this;this.$util.get("contract/contract/info",{id:this.id}).then((function(i){1==i.code?(n.contract=i.data,t.setNavigationBarTitle({title:n.contract.name})):n.toast(i.message,2e3,(function(){n.jump("/pages/index/index",3)}))}))},signContract:function(){var n=this;this.$util.get("contract/contract/getSignContract",{},!1).then((function(i){1==i.code?(n.clear(),n.contract=i.data,n.id=n.contract.id,t.setNavigationBarTitle({title:n.contract.name}),t.showModal({title:"提示",content:"您还有合同《".concat(n.contract.name,"》未签署！"),confirmText:"继续签署",showCancel:!1,success:function(t){}})):n.jump("/pages/index/index",3)}))},initCanvas:function(){this.canvasCtx=t.createCanvasContext("contract"),this.canvasCtx.setLineWidth(5)},touchStart:function(t){this.startX=t.touches&&t.touches.length>0?t.touches[0].x:t.clientX,this.startY=t.touches&&t.touches.length>0?t.touches[0].y:t.clientY,this.startX=this.startX-this.pageOffsetLeft,this.startY=this.startY-this.pageOffsetTop,this.canvasCtx.moveTo(this.startX,this.startY),this.isTouchMove=!0},touchMove:function(t){this.isTouchMove&&(this.moveX=t.touches&&t.touches.length>0?t.touches[0].x:t.clientX,this.moveY=t.touches&&t.touches.length>0?t.touches[0].y:t.clientY,this.moveX=this.moveX-this.pageOffsetLeft,this.moveY=this.moveY-this.pageOffsetTop,this.canvasCtx.setLineWidth(6),this.canvasCtx.lineTo(this.moveX,this.moveY),this.canvasCtx.stroke(),this.canvasCtx.setLineCap("round"),this.canvasCtx.draw(!0),this.canvasCtx.moveTo(this.moveX,this.moveY),this.startX=this.moveX,this.startY=this.moveY)},touchEnd:function(){this.isTouchMove=!1,this.is_sign=!0}}};n.default=i}).call(this,i("df3c")["default"])},8882:function(t,n,i){"use strict";var e=i("11ab"),s=i.n(e);s.a},c8eb:function(t,n,i){"use strict";i.r(n);var e=i("dfdb"),s=i("0db2");for(var o in s)["default"].indexOf(o)<0&&function(t){i.d(n,t,(function(){return s[t]}))}(o);i("8882");var a=i("828b"),c=Object(a["a"])(s["default"],e["b"],e["c"],!1,null,null,null,!1,e["a"],void 0);n["default"]=c.exports},dfdb:function(t,n,i){"use strict";i.d(n,"b",(function(){return s})),i.d(n,"c",(function(){return o})),i.d(n,"a",(function(){return e}));var e={uButton:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-button/u-button")]).then(i.bind(null,"043e"))}},s=function(){var t=this.$createElement;this._self._c},o=[]},f93b:function(t,n,i){"use strict";(function(t,n){var e=i("47a9");i("4c1a");e(i("3240"));var s=e(i("c8eb"));t.__webpack_require_UNI_MP_PLUGIN__=i,n(s.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])}},[["f93b","common/runtime","common/vendor"]]]);