{"remainingRequest":"D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\ljzc-fvue\\src\\views\\Login\\components\\PhoneNumberLogin.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\ljzc-fvue\\src\\views\\Login\\components\\PhoneNumberLogin.vue","mtime":1701311302365},{"path":"D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\ljzc-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nexport default {\n name: 'PhoneNumberLogin',\n computed: {},\n data: function data() {\n //这个方法要写在用到这个方法的地方的前面\n var checkPhone = function checkPhone(rule, value, callback) {\n if (!value) {\n return callback(new Error('手机号不能为空'));\n } else {\n var reg = /^1[3-9][0-9]\\d{8}$/; // 这里定义的reg变量没有加引号,所以是一种特殊的数据类型,即正则,可以直接用test()方法\n\n if (reg.test(value)) {\n callback();\n } else {\n // 具体错误信息没有提示\n return callback(new Error('请输入正确的手机号'));\n }\n }\n };\n\n return {\n // 表单\n phoneForm: {\n phone: '',\n verificationCode: ''\n },\n rules: {\n // 从上向下进行验证,如果把min:11写在下面,就不会用到这个判断条件了,因为checkPhone包含了不满11位的验证\n phone: [{\n min: 11,\n max: 11,\n message: '请输入11位的手机号',\n trigger: 'blur'\n }, {\n validator: checkPhone,\n trigger: 'blur'\n }],\n verificationCode: [{\n required: true,\n message: '请获取手机验证码后输入验证码',\n trigger: 'blur'\n }]\n },\n // 表单验证规则\n loading: false,\n // 登录loading\n isGetVerificationCode: false,\n // 是否获取手机验证码\n verificationCodeTime: 0,\n // 请求验证码时间限制\n codeTimer: null // 二维码定时器对象\n\n };\n },\n created: function created() {},\n mounted: function mounted() {},\n methods: {\n // 获取手机验证码\n getVerificationCode: function getVerificationCode() {\n var _this = this;\n\n // 指定60秒的节流时间\n this.$refs.phoneForm.validateField('phone', function (valid) {\n if (_this.verificationCodeTime || valid) return;\n\n _this.$message.success('验证码发送成功');\n\n _this.isGetVerificationCode = true;\n _this.verificationCodeTime = 10;\n _this.codeTimer = setInterval(function () {\n _this.verificationCodeTime -= 1;\n if (!_this.verificationCodeTime) clearInterval(_this.codeTimer);\n }, 1000);\n });\n },\n // 登录\n submitForm: function submitForm(formName) {\n this.$refs[formName].validate(function (valid) {\n if (!valid) return;\n alert('成功');\n });\n }\n },\n beforeDestroy: function beforeDestroy() {\n clearInterval(this.codeTimer);\n }\n};",null]}