require('../../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/merchant/components/verify/verifyPoint/verifyPoint"],{"034b":function(t,e,n){"use strict";n.r(e);var i=n("32a4"),r=n("a7c0");for(var c in r)["default"].indexOf(c)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(c);n("7b82");var o=n("828b"),a=Object(o["a"])(r["default"],i["b"],i["c"],!1,null,"f83405c2",null,!1,i["a"],void 0);e["default"]=a.exports},"32a4":function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.__map(t.tempPoints,(function(e,n){var i=t.__get_orig(e),r=parseInt(e.y-10),c=parseInt(e.x-10);return{$orig:i,m0:r,m1:c}})));t._isMounted||(t.e0=function(e){t.bindingClick&&t.canvasClick(e)}),t.$mp.data=Object.assign({},{$root:{l0:n}})},r=[]},"7b82":function(t,e,n){"use strict";var i=n("d661"),r=n.n(i);r.a},a7c0:function(t,e,n){"use strict";n.r(e);var i=n("e011"),r=n.n(i);for(var c in i)["default"].indexOf(c)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(c);e["default"]=r.a},d661:function(t,e,n){},e011:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n("e2f6"),r=n("360a"),c={name:"VerifyPoints",props:{mode:{type:String,default:"fixed"},captchaType:{type:String},vSpace:{type:Number,default:5},imgSize:{type:Object,default:function(){return{width:"310px",height:"155px"}}},barSize:{type:Object,default:function(){return{width:"310px",height:"40px"}}},defaultImg:{type:String,default:""}},inject:["scrollTopFn"],data:function(){return{secretKey:"",checkNum:3,fontPos:[],checkPosArr:[],num:1,pointBackImgBase:"",poinTextList:[],backToken:"",imgRand:0,setSize:{imgHeight:0,imgWidth:0,barHeight:0,barWidth:0},showImage:!0,tempPoints:[],text:"",barAreaColor:"#fff",barAreaBorderColor:"#fff",showRefresh:!0,bindingClick:!0,imgLeft:"",imgTop:""}},methods:{init:function(){var t=this;this.fontPos.splice(0,this.fontPos.length),this.checkPosArr.splice(0,this.checkPosArr.length),this.num=1,this.$nextTick((function(){t.refresh(),t.$parent.$emit("ready",t)}))},canvasClick:function(e){var n=this,c=t.createSelectorQuery().in(this);c.select("#image").boundingClientRect((function(t){n.imgLeft=Math.ceil(t.left),n.imgTop=Math.ceil(t.top),n.checkPosArr.push(n.getMousePos(n.$refs.canvas,e)),n.num==n.checkNum&&(n.num=n.createPoint(n.getMousePos(n.$refs.canvas,e)),n.checkPosArr=n.pointTransfrom(n.checkPosArr,n.imgSize),setTimeout((function(){var t=n.secretKey?(0,i.aesEncrypt)(n.backToken+"---"+JSON.stringify(n.checkPosArr),n.secretKey):n.backToken+"---"+JSON.stringify(n.checkPosArr),e={captchaType:n.captchaType,pointJson:n.secretKey?(0,i.aesEncrypt)(JSON.stringify(n.checkPosArr),n.secretKey):JSON.stringify(n.checkPosArr),token:n.backToken};(0,r.ajcaptchaCheck)(e).then((function(e){e.data;n.barAreaColor="#4cae4c",n.barAreaBorderColor="#5cb85c",n.text="验证成功",n.bindingClick=!1,n.$emit("success",{captchaVerification:t})})).catch((function(t){n.$parent.$emit("error",n),n.barAreaColor="#d9534f",n.barAreaBorderColor="#d9534f",n.text="验证失败",setTimeout((function(){n.refresh()}),700)}))}),400)),n.num<n.checkNum&&(n.num=n.createPoint(n.getMousePos(n.$refs.canvas,e)))})).exec()},getMousePos:function(t,e){var n={x:Math.ceil(e.detail.x)-this.imgLeft,y:Math.ceil(e.detail.y)-this.imgTop-this.scrollTop};return n},createPoint:function(t){return this.tempPoints.push(Object.assign({},t)),++this.num},refresh:function(){this.tempPoints.splice(0,this.tempPoints.length),this.barAreaColor="#000",this.barAreaBorderColor="#ddd",this.bindingClick=!0,this.fontPos.splice(0,this.fontPos.length),this.checkPosArr.splice(0,this.checkPosArr.length),this.num=1,this.getPictrue(),this.showRefresh=!0},getPictrue:function(){var e=this,n={captchaType:this.captchaType,clientUid:t.getStorageSync("point"),ts:Date.now()};(0,r.getAjcaptcha)(n).then((function(t){var n=t.data;e.pointBackImgBase=n.originalImageBase64,e.backToken=n.token,e.secretKey=n.secretKey,e.poinTextList=n.wordList,e.text="请依次点击【"+e.poinTextList.join(",")+"】"})).catch((function(){e.pointBackImgBase=null}))},pointTransfrom:function(t,e){var n=t.map((function(t){var n=Math.round(310*t.x/parseInt(e.width)),i=Math.round(155*t.y/parseInt(e.height));return{x:n,y:i}}));return n}},watch:{type:{immediate:!0,handler:function(){this.init()}}},computed:{scrollTop:function(){return this.scrollTopFn()}},mounted:function(){this.init()}};e.default=c}).call(this,n("df3c")["default"])}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'pages/merchant/components/verify/verifyPoint/verifyPoint-create-component',
    {
        'pages/merchant/components/verify/verifyPoint/verifyPoint-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('df3c')['createComponent'](__webpack_require__("034b"))
        })
    },
    [['pages/merchant/components/verify/verifyPoint/verifyPoint-create-component']]
]);
