From 7d91779d2bb2bfec7f4f803a9e2cf65b90e401c6 Mon Sep 17 00:00:00 2001 From: 819527061@qq.com <123456> Date: 星期二, 25 六月 2024 15:23:37 +0800 Subject: [PATCH] soket --- pages/login/resetPassword/resetPassword.vue | 42 +++++++++++++++++++++++++++++++++++++++++- 1 files changed, 41 insertions(+), 1 deletions(-) diff --git a/pages/login/resetPassword/resetPassword.vue b/pages/login/resetPassword/resetPassword.vue index 5ab3c12..62db9f2 100644 --- a/pages/login/resetPassword/resetPassword.vue +++ b/pages/login/resetPassword/resetPassword.vue @@ -126,7 +126,7 @@ const regex2 = /^[A-Za-z]+$/ // 鏍¢獙绗﹀彿 const regex3 = - /^[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]路~锛丂#锟�%鈥︹��&*锛堬級鈥斺�擻-+={}|銆娿�嬶紵锛氣�溾�濄�愩�戙�侊紱鈥�'锛屻�傘�乚+$/ + /^[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]路~锛丂#锟�%鈥︹��&*锛堬級鈥斺�擻-+={}|銆娿�嬶紵锛氣�溾�濄�愩�戙�侊紱鈥�'锛屻�傘�乚+$/; if(regex1.test(value)) { this.level.push('low') return callback('瀵嗙爜寮哄害杩囦綆') @@ -223,6 +223,10 @@ onReady() { this.$refs.uForm.setRules(this.rules) }, + onShow(){ + this.userAuthorization(); + + }, methods: { getUserInfo(phone, idCard) { this.$reqGet('phoneAndCard', { phone, idCard }).then(res => { @@ -234,6 +238,42 @@ }) }, + userAuthorization() { + wx.getSetting({ + success(res) { + // wx.startRecord(); + console.log('鎺堟潈鐩告満/楹﹀厠椋庢潈闄恠uccess'); + 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 -- Gitblit v1.9.1