2 lines
3.7 KiB
JavaScript
2 lines
3.7 KiB
JavaScript
webpackJsonp([7],{Txz9:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s={data:function(){return{codes:[],ctx:"",colors:["red","yellow","blue","green","pink","black"],code_Len:4}},mounted:function(){this.draw()},computed:{codeString:function(){for(var t="",e=0;e<this.codes.length;e++)t+=this.codes[e];return t.toUpperCase()}},watch:{codeString:function(t){this.$emit("change",t)}},methods:{generateRandom:function(){this.codes=[];for(var t="abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789".split(""),e=0;e<this.code_Len;e++){var a=Math.floor(Math.random()*t.length);this.codes.push(t[a])}},draw:function(){this.generateRandom(),this.drawText()},drawLine:function(){for(var t=0;t<3;t++)this.ctx.strokeStyle=this.colors[Math.floor(5*Math.random())],this.ctx.beginPath(),this.ctx.moveTo(Math.floor(140*Math.random()),Math.floor(30*Math.random())),this.ctx.lineTo(Math.floor(140*Math.random()),Math.floor(30*Math.random())),this.ctx.stroke()},drawText:function(){var t=this.$refs.canvas;this.ctx=t.getContext("2d"),this.ctx.fillStyle="#BFEFFF",this.ctx.fillRect(0,0,140,40),this.ctx.font="20px Verdana";for(var e=15,a=0;a<this.code_Len;a++)this.ctx.fillStyle=this.colors[Math.floor(5*Math.random())],this.ctx.fillText(this.codes[a],e,25),e+=30;this.drawLine()}}},i={render:function(){var t=this.$createElement;return(this._self._c||t)("canvas",{ref:"canvas",staticStyle:{cursor:"pointer"},attrs:{width:"140",height:"40"},on:{click:this.draw}})},staticRenderFns:[]},n={components:{ValidateCode:a("VU/8")(s,i,!1,null,null,null).exports},data:function(){return{inputVal:"",checkCode:"",result:""}},methods:{changeCode:function(t){this.checkCode=t},compare:function(){this.inputVal.toUpperCase()===this.checkCode?(console.log(this.inputVal),this.result="比对成功"):(console.log(this.inputVal),this.result="比对失败,请重新输入",this.inputVal="",this.$refs.ref_validateCode.draw())}}},r={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"queryall"},[t._m(0),t._v(" "),a("div",{staticClass:"querymain"},[a("div",{staticClass:"querytitlename"},[t._v("证书查询")]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),a("div",{staticClass:"queryfill"},[a("span",{staticClass:"querykey"},[t._v("验证码")]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.inputVal,expression:"inputVal"}],staticClass:"queryvalue",attrs:{type:"text",placeholder:"",clearable:""},domProps:{value:t.inputVal},on:{input:function(e){e.target.composing||(t.inputVal=e.target.value)}}}),a("br")]),t._v(" "),a("validate-code",{ref:"ref_validateCode",staticStyle:{padding:"10px","border-radius":"15px"},attrs:{id:"canvas"},on:{change:t.changeCode}}),t._v(" "),t._m(3)],1)])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("header",[e("img",{staticClass:"querylogo",attrs:{src:a("X3zq"),alt:"上海建科检验有限公司"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"queryfill"},[e("span",{staticClass:"querykey"},[this._v("姓名")]),this._v(" "),e("input",{staticClass:"queryvalue",attrs:{type:"text"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"queryfill"},[e("span",{staticClass:"querykey"},[this._v("证书编号")]),this._v(" "),e("input",{staticClass:"queryvalue",attrs:{type:"text"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",[e("button",{attrs:{type:"button",id:"bt"}},[this._v("点击查询")])])}]};var o=a("VU/8")(n,r,!1,function(t){a("Wqe+")},null,null);e.default=o.exports},"Wqe+":function(t,e){},X3zq:function(t,e,a){t.exports=a.p+"static/img/jianke_logo.a6cb8a7.png"}});
|
|
//# sourceMappingURL=7.9e96e5077b81687afbaa.js.map
|