require('../../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/users/components/verifition/verify/verifyPoint"],{"1f3e":function(e,t,i){"use strict";var n=i("607f"),r=i.n(n);r.a},"607f":function(e,t,i){},bd90:function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=i("2975"),r=i("b8bf"),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:""}},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 e=this;this.fontPos.splice(0,this.fontPos.length),this.checkPosArr.splice(0,this.checkPosArr.length),this.num=1,this.$nextTick((function(){e.refresh(),e.$parent.$emit("ready",e)}))},canvasClick:function(t){var i=this,c=e.createSelectorQuery().in(this);c.select("#image").boundingClientRect((function(e){i.imgLeft=Math.ceil(e.left),i.imgTop=Math.ceil(e.top),i.checkPosArr.push(i.getMousePos(i.$refs.canvas,t)),i.num==i.checkNum&&(i.num=i.createPoint(i.getMousePos(i.$refs.canvas,t)),i.checkPosArr=i.pointTransfrom(i.checkPosArr,i.imgSize),setTimeout((function(){var e=i.secretKey?(0,n.aesEncrypt)(i.backToken+"---"+JSON.stringify(i.checkPosArr),i.secretKey):i.backToken+"---"+JSON.stringify(i.checkPosArr),t={captchaType:i.captchaType,pointJson:i.secretKey?(0,n.aesEncrypt)(JSON.stringify(i.checkPosArr),i.secretKey):JSON.stringify(i.checkPosArr),token:i.backToken};(0,r.ajcaptchaCheck)(t).then((function(t){var n=t.data;"0000"==n.repCode?(i.barAreaColor="#4cae4c",i.barAreaBorderColor="#5cb85c",i.text="验证成功",i.bindingClick=!1,"pop"==i.mode&&setTimeout((function(){i.$parent.clickShow=!1,i.refresh()}),1500),setTimeout((function(){i.tipWords="",i.$emit("success",{captchaVerification:e})}),1e3)):(i.$parent.$emit("error",i),i.barAreaColor="#d9534f",i.barAreaBorderColor="#d9534f",i.text="验证失败",setTimeout((function(){i.refresh()}),700))}))}),400)),i.num<i.checkNum&&(i.num=i.createPoint(i.getMousePos(i.$refs.canvas,t)))})).exec()},getMousePos:function(e,t){var i={x:Math.ceil(t.detail.x)-this.imgLeft,y:Math.ceil(t.detail.y)-this.imgTop};return i},createPoint:function(e){return this.tempPoints.push(Object.assign({},e)),++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 t=this,i={captchaType:this.captchaType,clientUid:e.getStorageSync("point"),ts:Date.now()};(0,r.getAjcaptcha)(i).then((function(e){var i=e.data;"0000"==i.repCode?(t.pointBackImgBase=i.repData.originalImageBase64,t.backToken=i.repData.token,t.secretKey=i.repData.secretKey,t.poinTextList=i.repData.wordList,t.text="请依次点击【"+t.poinTextList.join(",")+"】"):t.text=i.repMsg,"6201"==e.repCode&&(t.pointBackImgBase=null)})).catch((function(){t.pointBackImgBase=null}))},pointTransfrom:function(e,t){var i=e.map((function(e){var i=Math.round(310*e.x/parseInt(t.width)),n=Math.round(155*e.y/parseInt(t.height));return{x:i,y:n}}));return i}},watch:{type:{immediate:!0,handler:function(){this.init()}}},mounted:function(){}};t.default=c}).call(this,i("df3c")["default"])},bfca:function(e,t,i){"use strict";i.r(t);var n=i("e154"),r=i("f0c9");for(var c in r)["default"].indexOf(c)<0&&function(e){i.d(t,e,(function(){return r[e]}))}(c);i("1f3e");var o=i("828b"),a=Object(o["a"])(r["default"],n["b"],n["c"],!1,null,"6142e6b2",null,!1,n["a"],void 0);t["default"]=a.exports},e154:function(e,t,i){"use strict";i.d(t,"b",(function(){return n})),i.d(t,"c",(function(){return r})),i.d(t,"a",(function(){}));var n=function(){var e=this,t=e.$createElement,i=(e._self._c,e.__map(e.tempPoints,(function(t,i){var n=e.__get_orig(t),r=parseInt(t.y-10),c=parseInt(t.x-10);return{$orig:n,m0:r,m1:c}})));e._isMounted||(e.e0=function(t){e.bindingClick&&e.canvasClick(t)}),e.$mp.data=Object.assign({},{$root:{l0:i}})},r=[]},f0c9:function(e,t,i){"use strict";i.r(t);var n=i("bd90"),r=i.n(n);for(var c in n)["default"].indexOf(c)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(c);t["default"]=r.a}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'pages/users/components/verifition/verify/verifyPoint-create-component',
    {
        'pages/users/components/verifition/verify/verifyPoint-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('df3c')['createComponent'](__webpack_require__("bfca"))
        })
    },
    [['pages/users/components/verifition/verify/verifyPoint-create-component']]
]);
