Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-starter
提交
60c2ced4
U
uni-starter
项目概览
DCloud
/
uni-starter
通知
4671
Star
228
Fork
210
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-starter
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
60c2ced4
编写于
5月 19, 2022
作者:
DCloud_JSON
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- 优化登陆体验,账号密码登陆错误超过2次,再显示图形验证码进行人机校验。
上级
ded9c842
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
304 addition
and
258 deletion
+304
-258
changelog.md
changelog.md
+2
-0
manifest.json
manifest.json
+223
-195
package.json
package.json
+1
-1
pages/ucenter/login-page/index/index.vue
pages/ucenter/login-page/index/index.vue
+2
-2
pages/ucenter/login-page/pwd-login/pwd-login.vue
pages/ucenter/login-page/pwd-login/pwd-login.vue
+6
-4
uni_modules/uni-captcha/changelog.md
uni_modules/uni-captcha/changelog.md
+2
-0
uni_modules/uni-captcha/components/uni-captcha/uni-captcha.vue
...odules/uni-captcha/components/uni-captcha/uni-captcha.vue
+41
-32
uni_modules/uni-captcha/components/uni-popup-captcha/uni-popup-captcha.vue
...aptcha/components/uni-popup-captcha/uni-popup-captcha.vue
+26
-23
uni_modules/uni-captcha/package.json
uni_modules/uni-captcha/package.json
+1
-1
未找到文件。
changelog.md
浏览文件 @
60c2ced4
## 1.2.2(2022-05-19)
-
优化登陆体验,账号密码登陆错误超过2次,再显示图形验证码进行人机校验。
## 1.2.1(2022-05-18)
## 1.2.1(2022-05-18)
-
修复在某些情况下,微信小程序端验证码显示错误的问题
-
修复在某些情况下,微信小程序端验证码显示错误的问题
## 1.2.0(2022-05-16)
## 1.2.0(2022-05-16)
...
...
manifest.json
浏览文件 @
60c2ced4
{
{
"name"
:
"uni-starter-old"
,
"name"
:
""
,
"appid"
:
"__UNI__EC87F46"
,
"appid"
:
"请点击重新获取"
,
"description"
:
"云端一体应用快速开发模版"
,
"description"
:
"云端一体应用快速开发模版"
,
"versionName"
:
"1.0.0"
,
"versionName"
:
"1.0.0"
,
"versionCode"
:
"100"
,
"versionCode"
:
"100"
,
"transformPx"
:
false
,
"transformPx"
:
false
,
"app-plus"
:
{
"app-plus"
:
{
"locales"
:
{
"locales"
:
{
"en"
:
{
"en"
:
{
"name"
:
"uni-starter"
,
"name"
:
"uni-starter"
,
"android"
:
{
"android"
:
{
"strings"
:
{
"strings"
:
{
"CustomKey"
:
"CustomValue"
"CustomKey"
:
"CustomValue"
}
}
},
"ios"
:
{
"privacyDescription"
:
{
"NSPhotoLibraryUsageDescription"
:
"access to the user’s photo library(read)"
},
"infoPlist"
:
{
"CustomKey"
:
"CustomValue"
}
}
},
"zh"
:
{
"name"
:
"统一应用基本项目"
}
},
},
"privacy"
:
{
"ios"
:
{
"prompt"
:
"template"
,
"privacyDescription"
:
{
"template"
:
{
"NSPhotoLibraryUsageDescription"
:
"access to the user’s photo library(read)"
"title"
:
"服务协议和隐私政策"
,
},
"message"
:
" 请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href=
\"
https://ask.dcloud.net.cn/protocol.html
\"
>《服务协议》</a>和<a href=
\"
https://ask.dcloud.net.cn/protocol.html
\"
>《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。"
,
"infoPlist"
:
{
"buttonAccept"
:
"同意"
,
"CustomKey"
:
"CustomValue"
"buttonRefuse"
:
"暂不同意"
}
}
}
},
"zh"
:
{
"name"
:
"统一应用基本项目"
}
},
"privacy"
:
{
"prompt"
:
"template"
,
"template"
:
{
"title"
:
"服务协议和隐私政策"
,
"message"
:
" 请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href=
\"
https://ask.dcloud.net.cn/protocol.html
\"
>《服务协议》</a>和<a href=
\"
https://ask.dcloud.net.cn/protocol.html
\"
>《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。"
,
"buttonAccept"
:
"同意"
,
"buttonRefuse"
:
"暂不同意"
}
},
"compatible"
:
{
"ignoreVersion"
:
true
},
"usingComponents"
:
true
,
"nvueStyleCompiler"
:
"uni-app"
,
"compilerVersion"
:
3
,
"splashscreen"
:
{
"alwaysShowBeforeRender"
:
false
,
"waiting"
:
true
,
"autoclose"
:
true
,
"delay"
:
0
},
"modules"
:
{
"Fingerprint"
:
{
},
"Share"
:
{
},
"OAuth"
:
{
},
"FaceID"
:
{
},
"Geolocation"
:
{
},
"Bluetooth"
:
{
},
"Push"
:
{
},
"Maps"
:
{
}
},
"distribute"
:
{
"android"
:
{
"permissions"
:
[
"<uses-feature android:name=
\"
android.hardware.camera
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera.autofocus
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_WIFI_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CAMERA
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CHANGE_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CHANGE_WIFI_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.FLASHLIGHT
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MODIFY_AUDIO_SETTINGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MOUNT_UNMOUNT_FILESYSTEMS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_LOGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_PHONE_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.USE_FINGERPRINT
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.VIBRATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WAKE_LOCK
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WRITE_SETTINGS
\"
/>"
],
"abiFilters"
:
[
"armeabi-v7a"
,
"arm64-v8a"
,
"x86"
]
},
"ios"
:
{
"capabilities"
:
{
"entitlements"
:
{
"com.apple.developer.associated-domains"
:
[
"applinks:static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com"
]
}
}
},
"sdkConfigs"
:
{
"oauth"
:
{
"apple"
:
{
},
"weixin"
:
{
"appid"
:
""
,
"appsecret"
:
""
,
"UniversalLinks"
:
""
},
"univerify"
:
{
}
},
},
"compatible"
:
{
"ad"
:
{
"ignoreVersion"
:
true
},
},
"usingComponents"
:
true
,
"share"
:
{
"nvueStyleCompiler"
:
"uni-app"
,
"weixin"
:
{
"compilerVersion"
:
3
,
"appid"
:
""
,
"splashscreen"
:
{
"UniversalLinks"
:
""
"alwaysShowBeforeRender"
:
false
,
}
"waiting"
:
true
,
"autoclose"
:
true
,
"delay"
:
0
},
},
"
modules"
:
{
"
geolocation"
:
{
"Fingerprint"
:
{},
"baidu"
:
{
"
Share"
:
{},
"
__platform__"
:
[
"OAuth"
:
{}
,
"ios"
,
"FaceID"
:
{},
"android"
"Geolocation"
:
{}
,
]
,
"
Bluetooth"
:
{}
,
"
appkey_ios"
:
"请填写地图的key"
,
"
Push"
:
{},
"
appkey_android"
:
"请填写地图的key"
"Maps"
:
{
}
}
},
},
"distribute"
:
{
"push"
:
{
"android"
:
{
"unipush"
:
{
"permissions"
:
[
"version"
:
"2"
,
"<uses-feature android:name=
\"
android.hardware.camera
\"
/>"
,
"offline"
:
true
,
"<uses-feature android:name=
\"
android.hardware.camera.autofocus
\"
/>"
,
"meizu"
:
{
"<uses-permission android:name=
\"
android.permission.ACCESS_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.ACCESS_WIFI_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CAMERA
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CHANGE_NETWORK_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.CHANGE_WIFI_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.FLASHLIGHT
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MODIFY_AUDIO_SETTINGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.MOUNT_UNMOUNT_FILESYSTEMS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_LOGS
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.READ_PHONE_STATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.USE_FINGERPRINT
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.VIBRATE
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WAKE_LOCK
\"
/>"
,
"<uses-permission android:name=
\"
android.permission.WRITE_SETTINGS
\"
/>"
],
"abiFilters"
:
[
"armeabi-v7a"
,
"arm64-v8a"
,
"x86"
]
},
},
"ios"
:
{
"mi"
:
{
"capabilities"
:
{
"entitlements"
:
{
"com.apple.developer.associated-domains"
:
[
"applinks:static-76ce2c5e-31c7-4d81-8fcf-ed1541ecbc6e.bspapp.com"
]
}
}
},
},
"sdkConfigs"
:
{
"vivo"
:
{
"oauth"
:
{
"apple"
:
{},
"weixin"
:
{
"appid"
:
""
,
"appsecret"
:
""
,
"UniversalLinks"
:
""
},
"univerify"
:
{}
},
"ad"
:
{},
"share"
:
{
"weixin"
:
{
"appid"
:
""
,
"UniversalLinks"
:
""
}
},
"geolocation"
:
{
"baidu"
:
{
"__platform__"
:
[
"ios"
,
"android"
],
"appkey_ios"
:
"请填写地图的key"
,
"appkey_android"
:
"请填写地图的key"
}
},
"push"
:
{
"unipush"
:
{
"version"
:
"2"
,
"offline"
:
true
,
"meizu"
:
{},
"mi"
:
{},
"vivo"
:
{},
"oppo"
:
{},
"hms"
:
{}
}
},
"payment"
:
{},
"maps"
:
{}
},
},
"icons"
:
{
"oppo"
:
{
"android"
:
{
"hdpi"
:
""
,
"xhdpi"
:
""
,
"xxhdpi"
:
""
,
"xxxhdpi"
:
""
},
"ios"
:
{
"appstore"
:
""
,
"ipad"
:
{
"app"
:
""
,
"app@2x"
:
""
,
"notification"
:
""
,
"notification@2x"
:
""
,
"proapp@2x"
:
""
,
"settings"
:
""
,
"settings@2x"
:
""
,
"spotlight"
:
""
,
"spotlight@2x"
:
""
},
"iphone"
:
{
"app@2x"
:
""
,
"app@3x"
:
""
,
"notification@2x"
:
""
,
"notification@3x"
:
""
,
"settings@2x"
:
""
,
"settings@3x"
:
""
,
"spotlight@2x"
:
""
,
"spotlight@3x"
:
""
}
}
},
},
"splashscreen"
:
{
"hms"
:
{
"iosStyle"
:
"common"
,
"androidStyle"
:
"common"
,
"useOriginalMsgbox"
:
true
}
}
}
},
},
"nvueLaunchMode"
:
""
"payment"
:
{
},
"quickapp"
:
{},
"mp-weixin"
:
{
"appid"
:
""
,
"setting"
:
{
"urlCheck"
:
false
,
"es6"
:
false
},
},
"usingComponents"
:
true
,
"maps"
:
{
"betterScopedSlots"
:
true
,
"permission"
:
{
"scope.userLocation"
:
{
"desc"
:
"演示在onShow生命周期获取地理位置"
}
}
}
},
"icons"
:
{
"android"
:
{
"hdpi"
:
""
,
"xhdpi"
:
""
,
"xxhdpi"
:
""
,
"xxxhdpi"
:
""
},
"ios"
:
{
"appstore"
:
""
,
"ipad"
:
{
"app"
:
""
,
"app@2x"
:
""
,
"notification"
:
""
,
"notification@2x"
:
""
,
"proapp@2x"
:
""
,
"settings"
:
""
,
"settings@2x"
:
""
,
"spotlight"
:
""
,
"spotlight@2x"
:
""
},
"iphone"
:
{
"app@2x"
:
""
,
"app@3x"
:
""
,
"notification@2x"
:
""
,
"notification@3x"
:
""
,
"settings@2x"
:
""
,
"settings@3x"
:
""
,
"spotlight@2x"
:
""
,
"spotlight@3x"
:
""
}
}
},
"splashscreen"
:
{
"iosStyle"
:
"common"
,
"androidStyle"
:
"common"
,
"useOriginalMsgbox"
:
true
}
},
},
"mp-alipay"
:
{
"nvueLaunchMode"
:
""
"usingComponents"
:
true
},
},
"quickapp"
:
{
"mp-baidu"
:
{
},
"usingComponents"
:
true
"mp-weixin"
:
{
},
"appid"
:
""
,
"mp-toutiao"
:
{
"setting"
:
{
"usingComponents"
:
true
"urlCheck"
:
false
,
},
"es6"
:
false
"uniStatistics"
:
{
"enable"
:
false
},
},
"h5"
:
{
"usingComponents"
:
true
,
"template"
:
""
,
"betterScopedSlots"
:
true
,
"sdkConfigs"
:
{
"permission"
:
{
"maps"
:
{
"scope.userLocation"
:
{
"qqmap"
:
{
"desc"
:
"演示在onShow生命周期获取地理位置"
"key"
:
""
}
}
}
}
},
},
"mp-alipay"
:
{
"router"
:
{
"usingComponents"
:
true
"base"
:
""
},
},
"mp-baidu"
:
{
"uniStatistics"
:
{
"usingComponents"
:
true
"enable"
:
true
},
"mp-toutiao"
:
{
"usingComponents"
:
true
},
"uniStatistics"
:
{
"enable"
:
false
},
"h5"
:
{
"template"
:
""
,
"sdkConfigs"
:
{
"maps"
:
{
"qqmap"
:
{
"key"
:
""
}
}
}
},
"router"
:
{
"base"
:
""
},
},
"_spaceID"
:
""
,
"uniStatistics"
:
{
"vueVersion"
:
"2"
"enable"
:
true
}
}
},
"_spaceID"
:
""
,
"vueVersion"
:
"2"
}
\ No newline at end of file
package.json
浏览文件 @
60c2ced4
{
{
"id"
:
"uni-starter"
,
"id"
:
"uni-starter"
,
"displayName"
:
"uni-starter"
,
"displayName"
:
"uni-starter"
,
"version"
:
"1.2.
1
"
,
"version"
:
"1.2.
2
"
,
"description"
:
"云端一体应用快速开发基本项目模版"
,
"description"
:
"云端一体应用快速开发基本项目模版"
,
"keywords"
:
[
"keywords"
:
[
"login"
,
"login"
,
...
...
pages/ucenter/login-page/index/index.vue
浏览文件 @
60c2ced4
...
@@ -10,8 +10,8 @@
...
@@ -10,8 +10,8 @@
<template
v-else
>
<template
v-else
>
<input
type=
"number"
class=
"input-box"
:inputBorder=
"false"
v-model=
"phone"
maxlength=
"11"
<input
type=
"number"
class=
"input-box"
:inputBorder=
"false"
v-model=
"phone"
maxlength=
"11"
:placeholder=
"$t('common.phonePlaceholder')"
/>
:placeholder=
"$t('common.phonePlaceholder')"
/>
<uni-agreements
@
setAgree=
"agree = $event"
></uni-agreements>
<uni-agreements
@
setAgree=
"agree = $event"
></uni-agreements>
<button
class=
"get-code"
:disabled=
"!isPhone
"
:type=
"isPhon
e?'primary':'default'"
<button
class=
"get-code"
:disabled=
"!isPhone
|| !agree"
:type=
"isPhone&&agre
e?'primary':'default'"
@
click=
"sendShortMsg"
>
{{
$t
(
'
login.getVerifyCode
'
)
}}
</button>
@
click=
"sendShortMsg"
>
{{
$t
(
'
login.getVerifyCode
'
)
}}
</button>
<text
class=
"tip"
>
{{
$t
(
'
login.phoneLoginTip
'
)
}}
</text>
<text
class=
"tip"
>
{{
$t
(
'
login.phoneLoginTip
'
)
}}
</text>
</
template
>
</
template
>
...
...
pages/ucenter/login-page/pwd-login/pwd-login.vue
浏览文件 @
60c2ced4
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<text
class=
"title"
>
{{
$t
(
'
pwdLogin.pwdLogin
'
)
}}
</text>
<text
class=
"title"
>
{{
$t
(
'
pwdLogin.pwdLogin
'
)
}}
</text>
<input
class=
"input-box"
:inputBorder=
"false"
v-model=
"username"
:placeholder=
"$t('pwdLogin.placeholder')"
/>
<input
class=
"input-box"
:inputBorder=
"false"
v-model=
"username"
:placeholder=
"$t('pwdLogin.placeholder')"
/>
<input
type=
"password"
class=
"input-box"
:inputBorder=
"false"
v-model=
"password"
:placeholder=
"$t('pwdLogin.passwordPlaceholder')"
/>
<input
type=
"password"
class=
"input-box"
:inputBorder=
"false"
v-model=
"password"
:placeholder=
"$t('pwdLogin.passwordPlaceholder')"
/>
<uni-captcha
scene=
"login"
v-model=
"captcha"
></uni-captcha>
<uni-captcha
v-if=
"needCaptcha"
scene=
"login"
v-model=
"captcha"
></uni-captcha>
<uni-agreements
class=
"agreement"
@
setAgree=
"agree = $event"
></uni-agreements>
<uni-agreements
class=
"agreement"
@
setAgree=
"agree = $event"
></uni-agreements>
<button
class=
"send-btn"
:disabled=
"!canLogin"
:type=
"canLogin?'primary':'default'"
<button
class=
"send-btn"
:disabled=
"!canLogin"
:type=
"canLogin?'primary':'default'"
@
click=
"pwdLogin"
>
{{
$t
(
'
pwdLogin.login
'
)
}}
</button>
@
click=
"pwdLogin"
>
{{
$t
(
'
pwdLogin.login
'
)
}}
</button>
...
@@ -26,12 +26,13 @@
...
@@ -26,12 +26,13 @@
"
password
"
:
""
,
"
password
"
:
""
,
"
username
"
:
""
,
"
username
"
:
""
,
"
agree
"
:
false
,
"
agree
"
:
false
,
"
captcha
"
:
false
"
captcha
"
:
''
,
"
needCaptcha
"
:
false
}
}
},
},
computed
:
{
computed
:
{
canLogin
()
{
canLogin
()
{
return
this
.
username
.
length
&&
this
.
isPwd
;
return
this
.
username
.
length
&&
this
.
isPwd
&&
this
.
agree
;
},
},
isPwd
()
{
isPwd
()
{
return
/^.
{6,20}
$/
.
test
(
this
.
password
);
return
/^.
{6,20}
$/
.
test
(
this
.
password
);
...
@@ -79,7 +80,8 @@
...
@@ -79,7 +80,8 @@
title
:
result
.
msg
||
'
完成
'
,
title
:
result
.
msg
||
'
完成
'
,
icon
:
'
none
'
icon
:
'
none
'
});
});
this
.
createCaptcha
()
this
.
needCaptcha
=
true
// this.createCaptcha()
}
else
{
}
else
{
uni
.
showModal
({
uni
.
showModal
({
title
:
this
.
$t
(
'
common
'
).
error
,
title
:
this
.
$t
(
'
common
'
).
error
,
...
...
uni_modules/uni-captcha/changelog.md
浏览文件 @
60c2ced4
## 0.5.2(2022-05-19)
-
修复在Vue3的兼容问题
## 0.5.1(2022-05-18)
## 0.5.1(2022-05-18)
-
修复在某些情况下微信小程序端验证码显示错误的问题
-
修复在某些情况下微信小程序端验证码显示错误的问题
## 0.5.0(2022-05-17)
## 0.5.0(2022-05-17)
...
...
uni_modules/uni-captcha/components/uni-captcha/uni-captcha.vue
浏览文件 @
60c2ced4
...
@@ -6,46 +6,55 @@
...
@@ -6,46 +6,55 @@
mode="widthFix">
</image>
mode="widthFix">
</image>
</view>
</view>
<input
@
blur=
"focusCaptchaInput = false"
:focus=
"focusCaptchaInput"
type=
"text"
class=
"captcha"
<input
@
blur=
"focusCaptchaInput = false"
:focus=
"focusCaptchaInput"
type=
"text"
class=
"captcha"
:inputBorder=
"false"
maxlength=
"4"
v-model=
"
modelValue
"
placeholder=
"请输入验证码"
>
:inputBorder=
"false"
maxlength=
"4"
v-model=
"
val
"
placeholder=
"请输入验证码"
>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
props
:
{
modelValue
:
String
,
value
:
String
,
scene
:
{
type
:
String
,
default
()
{
return
""
}
},
focus
:
{
type
:
Boolean
,
default
()
{
return
false
}
}
},
computed
:{
val
:{
get
(){
return
this
.
value
||
this
.
modelValue
},
set
(
value
){
// console.log(value);
// TODO 兼容 vue2
// #ifdef VUE2
this
.
$emit
(
'
input
'
,
value
);
// #endif
// TODO 兼容 vue3
// #ifdef VUE3
this
.
$emit
(
'
update:modelValue
'
,
value
)
// #endif
}
}
},
data
()
{
data
()
{
return
{
return
{
focusCaptchaInput
:
false
,
focusCaptchaInput
:
false
,
modelValue
:
""
,
captchaBase64
:
""
,
captchaBase64
:
""
,
loging
:
false
loging
:
false
};
};
},
},
model
:
{
prop
:
'
modelValue
'
,
event
:
'
update:modelValue
'
},
props
:
{
event
:
'
update:modelValue
'
,
scene
:
{
type
:
String
,
default
()
{
return
""
}
},
focus
:
{
type
:
Boolean
,
default
()
{
return
false
}
}
},
watch
:
{
watch
:
{
modelValue
(
value
)
{
// TODO 兼容 vue2
this
.
$emit
(
'
input
'
,
value
);
// TODO 兼容 vue3
this
.
$emit
(
'
update:modelValue
'
,
value
)
},
scene
:
{
scene
:
{
handler
(
scene
)
{
handler
(
scene
)
{
if
(
scene
)
{
if
(
scene
)
{
...
@@ -63,8 +72,8 @@
...
@@ -63,8 +72,8 @@
methods
:
{
methods
:
{
getImageCaptcha
(
focus
=
true
)
{
getImageCaptcha
(
focus
=
true
)
{
this
.
loging
=
true
this
.
loging
=
true
this
.
modelValue
=
''
if
(
focus
)
{
if
(
focus
)
{
this
.
val
=
''
this
.
focusCaptchaInput
=
true
this
.
focusCaptchaInput
=
true
}
}
const
uniIdCo
=
uniCloud
.
importObject
(
"
uni-captcha-co
"
,
{
const
uniIdCo
=
uniCloud
.
importObject
(
"
uni-captcha-co
"
,
{
...
@@ -155,4 +164,4 @@
...
@@ -155,4 +164,4 @@
transform
:
rotate
(
360deg
)
transform
:
rotate
(
360deg
)
}
}
}
}
</
style
>
</
style
>
\ No newline at end of file
uni_modules/uni-captcha/components/uni-popup-captcha/uni-popup-captcha.vue
浏览文件 @
60c2ced4
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<view
class=
"popup-captcha"
>
<view
class=
"popup-captcha"
>
<view
class=
"content"
>
<view
class=
"content"
>
<text
class=
"title"
>
{{
title
}}
</text>
<text
class=
"title"
>
{{
title
}}
</text>
<uni-captcha
:scene=
"scene"
v-model=
"
modelValue
"
></uni-captcha>
<uni-captcha
:scene=
"scene"
v-model=
"
val
"
></uni-captcha>
</view>
</view>
<view
class=
"button-box"
>
<view
class=
"button-box"
>
<view
@
click=
"close"
class=
"btn"
>
取消
</view>
<view
@
click=
"close"
class=
"btn"
>
取消
</view>
...
@@ -14,18 +14,10 @@
...
@@ -14,18 +14,10 @@
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
data
()
{
props
:
{
return
{
modelValue
:
String
,
modelValue
:
""
,
value
:
String
,
};
},
model
:
{
prop
:
'
modelValue
'
,
event
:
'
update:modelValue
'
},
props
:
{
event
:
'
update:modelValue
'
,
scene
:
{
scene
:
{
type
:
String
,
type
:
String
,
default
()
{
default
()
{
...
@@ -37,15 +29,26 @@
...
@@ -37,15 +29,26 @@
default
()
{
default
()
{
return
""
return
""
}
}
},
},
},
},
watch
:
{
computed
:{
modelValue
(
value
)
{
val
:{
// TODO 兼容 vue2
get
(){
this
.
$emit
(
'
input
'
,
value
);
return
this
.
value
||
this
.
modelValue
// TODO 兼容 vue3
},
this
.
$emit
(
'
update:modelValue
'
,
value
)
set
(
value
){
}
// console.log(value);
// TODO 兼容 vue2
// #ifdef VUE2
this
.
$emit
(
'
input
'
,
value
);
// #endif
// TODO 兼容 vue3
// #ifdef VUE3
this
.
$emit
(
'
update:modelValue
'
,
value
)
// #endif
}
}
},
},
methods
:
{
methods
:
{
open
()
{
open
()
{
...
@@ -55,7 +58,7 @@
...
@@ -55,7 +58,7 @@
this
.
$refs
.
popup
.
close
()
this
.
$refs
.
popup
.
close
()
},
},
confirm
()
{
confirm
()
{
if
(
this
.
modelValue
.
length
<
4
){
if
(
this
.
val
.
length
<
4
){
return
uni
.
showToast
({
return
uni
.
showToast
({
title
:
'
请填写验证码
'
,
title
:
'
请填写验证码
'
,
icon
:
'
none
'
icon
:
'
none
'
...
...
uni_modules/uni-captcha/package.json
浏览文件 @
60c2ced4
{
{
"id"
:
"uni-captcha"
,
"id"
:
"uni-captcha"
,
"displayName"
:
"uni-captcha"
,
"displayName"
:
"uni-captcha"
,
"version"
:
"0.5.
1
"
,
"version"
:
"0.5.
2
"
,
"description"
:
"云端一体图形验证码组件"
,
"description"
:
"云端一体图形验证码组件"
,
"keywords"
:
[
"keywords"
:
[
"uniCloud"
,
"uniCloud"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录