| | |
| | | const regex2 = /^[A-Za-z]+$/ |
| | | // 校验符号 |
| | | const regex3 = |
| | | /^[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]+$/ |
| | | /^[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]+$/; |
| | | if(regex1.test(value)) { |
| | | this.level.push('low') |
| | | return callback('密码强度过低') |
| | |
| | | onReady() { |
| | | this.$refs.uForm.setRules(this.rules) |
| | | }, |
| | | onShow(){ |
| | | this.userAuthorization(); |
| | | |
| | | }, |
| | | methods: { |
| | | getUserInfo(phone, idCard) { |
| | | this.$reqGet('phoneAndCard', { phone, idCard }).then(res => { |
| | |
| | | }) |
| | | |
| | | }, |
| | | userAuthorization() { |
| | | wx.getSetting({ |
| | | success(res) { |
| | | // wx.startRecord(); |
| | | console.log('授权相机/麦克风权限success'); |
| | | if (!res.authSetting['scope.record'] || !res.authSetting['scope.camera']) { |
| | | if (!res.authSetting['scope.camera']) { |
| | | wx.authorize({ |
| | | scope: 'scope.camera', |
| | | success() { |
| | | // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问 |
| | | console.log('授权成功'); |
| | | }, |
| | | fail() { |
| | | console.log('授权失败'); |
| | | } |
| | | }); |
| | | } else if (!res.authSetting['scope.record']) { |
| | | wx.authorize({ |
| | | scope: 'scope.record', |
| | | success() { |
| | | // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问 |
| | | console.log('授权成功'); |
| | | }, |
| | | fail: () => { |
| | | console.log('授权失败'); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | fail() { |
| | | console.log('获取失败'); |
| | | } |
| | | }); |
| | | }, |
| | | checkChange(name) { |
| | | this.inputType = name.length === 0 ? 'password' : '' |
| | | this.isFocus = true |