Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦想橡皮擦
uni-starter
提交
a3cad55d
U
uni-starter
项目概览
梦想橡皮擦
/
uni-starter
与 Fork 源项目一致
Fork自
DCloud / uni-starter
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-starter
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
a3cad55d
编写于
4月 25, 2021
作者:
DCloud_JSON
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改组件名称
上级
1882983f
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
242 addition
and
258 deletion
+242
-258
App.vue
App.vue
+1
-1
baseapp.config.js
baseapp.config.js
+5
-1
common/appInit.js
common/appInit.js
+5
-1
components/send-sms-code/send-sms-code.vue
components/send-sms-code/send-sms-code.vue
+13
-33
js_sdk/request.js
js_sdk/request.js
+0
-17
manifest.json
manifest.json
+17
-8
pages.json
pages.json
+14
-13
pages/grid/grid.vue
pages/grid/grid.vue
+1
-3
pages/ucenter/edit/bind-mobile/bind-mobile.vue
pages/ucenter/edit/bind-mobile/bind-mobile.vue
+30
-31
pages/ucenter/edit/edit.vue
pages/ucenter/edit/edit.vue
+3
-1
pages/ucenter/login-page/phone-code/phone-code.vue
pages/ucenter/login-page/phone-code/phone-code.vue
+71
-71
pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue
pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue
+60
-60
pages/ucenter/ucenter.vue
pages/ucenter/ucenter.vue
+7
-4
uniCloud-aliyun/cloudfunctions/user-center/index.js
uniCloud-aliyun/cloudfunctions/user-center/index.js
+15
-14
未找到文件。
App.vue
浏览文件 @
a3cad55d
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
console
.
log
(
'
App Launch
'
)
console
.
log
(
'
App Launch
'
)
initApp
();
initApp
();
// #ifdef APP-PLUS
// #ifdef APP-PLUS
checkIsAgree
();
//checkIsAgree(); 暂时先用默认生成的,自定义的等待原生支持后实现。因为启动vue界面时已经,请求了部分权限这并不符合国家的法规
// #endif
// #endif
//#ifdef APP-NVUE || H5
//#ifdef APP-NVUE || H5
...
...
baseapp.config.js
浏览文件 @
a3cad55d
...
@@ -34,6 +34,10 @@ module.exports = {
...
@@ -34,6 +34,10 @@ module.exports = {
"
url
"
:
"
https://ask.dcloud.net.cn/protocol.html
"
"
url
"
:
"
https://ask.dcloud.net.cn/protocol.html
"
}
}
],
],
"
download
"
:
"
https://m3w.cn/uniapp
"
"
download
"
:
"
https://m3w.cn/uniapp
"
},
"
marketId
"
:{
//用于打开应用市场评分界面
"
ios
"
:
"
id1417078253
"
,
"
android
"
:
"
123456
"
}
}
}
}
common/appInit.js
浏览文件 @
a3cad55d
...
@@ -5,7 +5,11 @@ import callCheckVersion from '@/uni_modules/uni-upgrade-center-app/utils/call-ch
...
@@ -5,7 +5,11 @@ import callCheckVersion from '@/uni_modules/uni-upgrade-center-app/utils/call-ch
// #endif
// #endif
export
default
function
()
{
export
default
function
()
{
// 初始化appVersion(仅app生效)
// 初始化appVersion(仅app生效)
initAppVersion
();
initAppVersion
();
// baseappConfig挂载到getApp().
getApp
({
allowDefault
:
true
}).
config
=
baseappConfig
;
//自定义路由拦截
//自定义路由拦截
const
{
const
{
...
...
components/
login-short-code/login-short
-code.vue
→
components/
send-sms-code/send-sms
-code.vue
浏览文件 @
a3cad55d
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
}
}
}
}
export
default
{
export
default
{
name
:
"
login-short
-code
"
,
name
:
"
send-sms
-code
"
,
props
:
{
props
:
{
/**
/**
* 倒计时时长 s
* 倒计时时长 s
...
@@ -35,6 +35,15 @@
...
@@ -35,6 +35,15 @@
phone
:
{
phone
:
{
type
:
[
String
,
Number
],
type
:
[
String
,
Number
],
default
:
''
default
:
''
},
/*
验证码类型,用于防止不同功能的验证码混用,目前支持的类型login登录、register注册、bind绑定手机、unbind解绑手机
*/
codeType
:{
type
:
String
,
default
(){
return
'
login
'
}
}
}
},
},
data
()
{
data
()
{
...
@@ -69,7 +78,7 @@
...
@@ -69,7 +78,7 @@
this
.
request
(
'
user-center/sendSmsCode
'
,
this
.
request
(
'
user-center/sendSmsCode
'
,
{
{
"
mobile
"
:
this
.
phone
,
"
mobile
"
:
this
.
phone
,
"
type
"
:
"
login
"
"
type
"
:
this
.
codeType
},(
data
,
result
)
=>
{
},(
data
,
result
)
=>
{
console
.
log
(
data
,
result
);
console
.
log
(
data
,
result
);
uni
.
showToast
({
uni
.
showToast
({
...
@@ -79,37 +88,8 @@
...
@@ -79,37 +88,8 @@
this
.
reverseNumber
=
Number
(
this
.
count
);
this
.
reverseNumber
=
Number
(
this
.
count
);
this
.
getCode
();
this
.
getCode
();
this
.
$emit
(
'
getCode
'
);
this
.
$emit
(
'
getCode
'
);
})
}
)
// uniCloud.callFunction({
// "name": "user-center",
// "data": {
// "action": "sendSmsCode",
// "params": {
// "mobile": this.phone,
// "type": "login"
// }
// },
// success: (e) => {
// uni.showToast({
// title: "短信验证码发送成功",
// icon: 'none'
// });
// this.reverseNumber = Number(this.count);
// this.getCode();
// this.$emit('getCode');
// },
// fail: (err) => {
// console.log(err);
// uni.showToast({
// title: '短信验证码发送失败',
// icon: 'none'
// });
// },
// complete: () => {
// uni.hideLoading()
// }
// })
},
},
getCode
()
{
getCode
()
{
if
(
this
.
reverseNumber
==
0
)
{
if
(
this
.
reverseNumber
==
0
)
{
...
...
js_sdk/request.js
浏览文件 @
a3cad55d
...
@@ -9,7 +9,6 @@ const debug = true;//开启后,会alert错误信息
...
@@ -9,7 +9,6 @@ const debug = true;//开启后,会alert错误信息
export
default
function
request
(
name
,
params
,
callback
=
false
,{
showLoading
=
false
,
loadText
=
''
,
fail
=
()
=>
{}}
=
{}){
export
default
function
request
(
name
,
params
,
callback
=
false
,{
showLoading
=
false
,
loadText
=
''
,
fail
=
()
=>
{}}
=
{}){
// console.log('request');
// console.log('request');
showLoading
||
loadText
?
uni
.
showLoading
({
title
:
loadText
}):
''
;
showLoading
||
loadText
?
uni
.
showLoading
({
title
:
loadText
}):
''
;
let
routers
=
name
.
split
(
'
/
'
);
let
routers
=
name
.
split
(
'
/
'
);
var
action
=
false
var
action
=
false
if
(
routers
.
length
>
1
){
if
(
routers
.
length
>
1
){
...
@@ -23,28 +22,12 @@ export default function request(name,params,callback=false,{showLoading=false,lo
...
@@ -23,28 +22,12 @@ export default function request(name,params,callback=false,{showLoading=false,lo
console
.
log
(
e
);
console
.
log
(
e
);
const
{
result
:{
data
,
code
}}
=
e
const
{
result
:{
data
,
code
}}
=
e
console
.
log
(
data
,
code
);
console
.
log
(
data
,
code
);
if
(
code
!=
0
)
{
if
(
debug
){
uni
.
showModal
({
content
:
JSON
.
stringify
(
e
),
showCancel
:
false
,
confirmText
:
'
知道了
'
})
}
}
resolve
(
e
)
resolve
(
e
)
return
callback
(
data
,
e
.
result
,
e
)
return
callback
(
data
,
e
.
result
,
e
)
},
},
fail
(
err
){
fail
(
err
){
reject
(
err
)
reject
(
err
)
console
.
log
(
err
);
console
.
log
(
err
);
if
(
debug
){
uni
.
showModal
({
content
:
JSON
.
stringify
(
err
),
showCancel
:
false
,
confirmText
:
'
知道了
'
})
}
fail
(
err
)
fail
(
err
)
},
},
complete
()
{
complete
()
{
...
...
manifest.json
浏览文件 @
a3cad55d
...
@@ -7,6 +7,15 @@
...
@@ -7,6 +7,15 @@
"transformPx"
:
false
,
"transformPx"
:
false
,
/*
5
+App特有相关
*/
/*
5
+App特有相关
*/
"app-plus"
:
{
"app-plus"
:
{
"privacy"
:
{
"prompt"
:
"template"
,
"template"
:
{
"title"
:
"服务协议和隐私政策"
,
"message"
:
" 请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/> 你可阅读<a href=
\"\"
>《服务协议》</a>和<a href=
\"\"
>《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。"
,
"buttonAccept"
:
"我知道了"
,
"buttonRefuse"
:
"暂不同意"
}
},
"compatible"
:
{
"compatible"
:
{
"ignoreVersion"
:
true
//
true
表示忽略版本检查提示框,HBuilderX
1.9
.
0
及以上版本支持
"ignoreVersion"
:
true
//
true
表示忽略版本检查提示框,HBuilderX
1.9
.
0
及以上版本支持
},
},
...
@@ -31,14 +40,14 @@
...
@@ -31,14 +40,14 @@
"distribute"
:
{
"distribute"
:
{
/*
android打包配置
*/
/*
android打包配置
*/
"android"
:
{
"android"
:
{
"permissionExternalStorage"
:
{
//
"permissionExternalStorage"
:
{
"request"
:
"none"
,
//
"request"
:
"none"
,
"prompt"
:
"应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
//
"prompt"
:
"应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
},
//
},
"permissionPhoneState"
:
{
//
"permissionPhoneState"
:
{
"request"
:
"none"
,
//
"request"
:
"none"
,
"prompt"
:
"为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许。"
//
"prompt"
:
"为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许。"
},
//
},
"permissions"
:
[
"permissions"
:
[
"<uses-feature android:name=
\"
android.hardware.camera
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera.autofocus
\"
/>"
,
"<uses-feature android:name=
\"
android.hardware.camera.autofocus
\"
/>"
,
...
...
pages.json
浏览文件 @
a3cad55d
...
@@ -61,16 +61,16 @@
...
@@ -61,16 +61,16 @@
}
}
},
{
},
{
"path"
:
"pages/ucenter/edit/bind-mobile/bind-mobile"
,
"path"
:
"pages/ucenter/edit/bind-mobile/bind-mobile"
,
"style"
:
{
"navigationBarTitleText"
:
"绑定手机号码"
}
},
{
"path"
:
"pages/ucenter/ucenter"
,
"style"
:
{
"style"
:
{
"navigationStyle"
:
"custom"
"navigationStyle"
:
"custom"
}
}
},
},
{
{
"path"
:
"pages/ucenter/ucenter"
,
"style"
:
{
"navigationStyle"
:
"custom"
}
},{
"path"
:
"uni_modules/uni-feedback/pages/opendb-feedback/list"
,
"path"
:
"uni_modules/uni-feedback/pages/opendb-feedback/list"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"常见问题"
"navigationBarTitleText"
:
"常见问题"
...
@@ -90,8 +90,7 @@
...
@@ -90,8 +90,7 @@
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"关于"
"navigationBarTitleText"
:
"关于"
//
#ifdef
APP-PLUS
//
#ifdef
APP-PLUS
,
,
"app-plus"
:
{
"app-plus"
:
{
"titleNView"
:
{
"titleNView"
:
{
"buttons"
:
[{
"buttons"
:
[{
"type"
:
"share"
"type"
:
"share"
...
@@ -138,7 +137,9 @@
...
@@ -138,7 +137,9 @@
"path"
:
"uni_modules/uni-agree/pages/uni-agree/uni-agree"
,
"path"
:
"uni_modules/uni-agree/pages/uni-agree/uni-agree"
,
"style"
:
{
"style"
:
{
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"app-plus"
:{
"popGesture"
:
"none"
}
"app-plus"
:
{
"popGesture"
:
"none"
}
}
}
},
{
},
{
"path"
:
"pages/ucenter/settings/settings"
,
"path"
:
"pages/ucenter/settings/settings"
,
...
@@ -195,8 +196,8 @@
...
@@ -195,8 +196,8 @@
},
},
{
{
"path"
:
"uni_modules/uni-news-favorite/pages/uni-news-favorite/list"
,
"path"
:
"uni_modules/uni-news-favorite/pages/uni-news-favorite/list"
,
"style"
:{
"style"
:
{
"navigationBarTitleText"
:
"阅读记录"
,
"navigationBarTitleText"
:
"阅读记录"
,
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
}
}
...
@@ -246,4 +247,4 @@
...
@@ -246,4 +247,4 @@
"text"
:
"我的"
"text"
:
"我的"
}]
}]
}
}
}
}
pages/grid/grid.vue
浏览文件 @
a3cad55d
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
disabled
/>
disabled
/>
</
template
>
</
template
>
<!-- banner -->
<!-- banner -->
<unicloud-db
ref=
"bannerdb"
v-slot:default=
"{data, loading, error, options}"
:collection=
"collection
"
<unicloud-db
ref=
"bannerdb"
v-slot:default=
"{data, loading, error, options}"
collection=
"opendb-banner
"
:field=
"field"
@
load=
"load"
>
:field=
"field"
@
load=
"load"
>
<uni-swiper-dot
class=
"uni-swiper-dot-box"
@
clickItem=
"clickItem"
:info=
"data || bannerFormate(data, loading)"
<uni-swiper-dot
class=
"uni-swiper-dot-box"
@
clickItem=
"clickItem"
:info=
"data || bannerFormate(data, loading)"
:current=
"current"
:mode=
"mode"
:dots-styles=
"dotsStyles"
field=
"content"
>
:current=
"current"
:mode=
"mode"
:dots-styles=
"dotsStyles"
field=
"content"
>
...
@@ -88,8 +88,6 @@
...
@@ -88,8 +88,6 @@
text
:
'
Grid 9
'
text
:
'
Grid 9
'
}
}
],
],
collection
:
'
opendb-banner
'
,
// 查询字段,多个字段用 , 分割
// 查询字段,多个字段用 , 分割
field
:
'
_id,bannerfile,open_url,title
'
,
field
:
'
_id,bannerfile,open_url,title
'
,
where
:
'
category_id==grid
'
,
where
:
'
category_id==grid
'
,
...
...
pages/ucenter/edit/bind-mobile/bind-mobile.vue
浏览文件 @
a3cad55d
<
template
>
<
template
>
<view
class=
"box"
>
<view
class=
"box"
>
<!-- 登录框 (选择手机号所属国家和地区需要另行实现) -->
<!-- 登录框 (选择手机号所属国家和地区需要另行实现) -->
<uni-easyinput
focus
type=
"number"
class=
"phone-
input-box"
:inputBorder=
"false"
v-model=
"formData.phone"
<uni-easyinput
clearable
focus
type=
"number"
class=
"
input-box"
:inputBorder=
"false"
v-model=
"formData.phone"
maxlength=
"11"
placeholder=
"请输入手机号"
></uni-easyinput>
maxlength=
"11"
placeholder=
"请输入手机号"
></uni-easyinput>
<uni-easyinput
type=
"number"
class=
"phone-
input-box"
:inputBorder=
"false"
v-model=
"formData.code"
maxlength=
"6"
<uni-easyinput
clearable
type=
"number"
class=
"
input-box"
:inputBorder=
"false"
v-model=
"formData.code"
maxlength=
"6"
placeholder=
"请输入验证码"
>
placeholder=
"请输入验证码"
>
<template
slot=
"right"
>
<template
slot=
"right"
>
<
login-short-code
ref=
"shortCode"
:phone=
"formData.phone"
></login-short
-code>
<
send-sms-code
ref=
"shortCode"
code-type=
"bind"
:phone=
"formData.phone"
></send-sms
-code>
</
template
>
</
template
>
</uni-easyinput>
</uni-easyinput>
<button
class=
"send-btn-box"
type=
"primary"
@
click=
"submit"
>
提交
</button>
<button
class=
"send-btn-box"
type=
"primary"
@
click=
"submit"
>
提交
</button>
</view>
</view>
</template>
</template>
<
script
>
<
script
>
import
{
import
{
mapMutations
,
mapMutations
,
mapGetters
mapGetters
}
from
'
vuex
'
;
}
from
'
vuex
'
;
export
default
{
export
default
{
data
()
{
data
()
{
...
@@ -39,28 +39,28 @@
...
@@ -39,28 +39,28 @@
},
},
onReady
()
{
onReady
()
{
},
},
methods
:
{
methods
:
{
...
mapMutations
({
...
mapMutations
({
setUserInfo
:
'
user/login
'
setUserInfo
:
'
user/login
'
}),
}),
/**
/**
* 完成并提交
* 完成并提交
*/
*/
submit
()
{
submit
()
{
console
.
log
(
this
.
formData
);
console
.
log
(
this
.
formData
);
this
.
request
(
'
user-center/bind_mobile_by_sms
'
,
{
this
.
request
(
'
user-center/bind_mobile_by_sms
'
,
{
"
mobile
"
:
this
.
formData
.
phone
,
"
mobile
"
:
this
.
formData
.
phone
,
"
code
"
:
this
.
formData
.
code
"
code
"
:
this
.
formData
.
code
},
(
data
,
result
)
=>
{
},
(
data
,
result
)
=>
{
console
.
log
(
result
);
console
.
log
(
result
);
this
.
setUserInfo
({
"
mobile
"
:
result
.
mobile
})
this
.
setUserInfo
({
"
mobile
"
:
result
.
mobile
})
uni
.
showToast
({
uni
.
showToast
({
title
:
result
.
msg
,
title
:
result
.
msg
,
icon
:
'
none
'
icon
:
'
none
'
});
});
if
(
result
.
code
===
0
)
{
if
(
result
.
code
===
0
)
{
uni
.
navigateBack
()
uni
.
navigateBack
()
}
}
})
})
}
}
}
}
...
@@ -71,16 +71,15 @@
...
@@ -71,16 +71,15 @@
.box
{
.box
{
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
padding
:
50
rpx
;
padding-top
:
10px
;
padding-top
:
10px
;
}
}
.box
/
deep
/
.uni-easyinput__content
{
.box
/
deep
/
.uni-easyinput__content
{
height
:
45
px
;
height
:
50
px
;
}
}
.phone-input-box
{
.input-box
{
width
:
650
rpx
;
height
:
50px
;
margin-top
:
16px
;
margin-top
:
16px
;
background-color
:
#f9f9f9
;
background-color
:
#f9f9f9
;
border-radius
:
6
rpx
;
border-radius
:
6
rpx
;
...
@@ -92,4 +91,4 @@
...
@@ -92,4 +91,4 @@
width
:
650
rpx
;
width
:
650
rpx
;
margin-top
:
15px
;
margin-top
:
15px
;
}
}
</
style
>
</
style
>
pages/ucenter/edit/edit.vue
浏览文件 @
a3cad55d
...
@@ -91,7 +91,9 @@
...
@@ -91,7 +91,9 @@
},
},
fail
:
(
err
)
=>
{
fail
:
(
err
)
=>
{
console
.
log
(
err
);
console
.
log
(
err
);
this
.
bindMobileBySmsCode
()
if
(
err
.
code
==
'
30002
'
){
this
.
bindMobileBySmsCode
()
}
}
}
})
})
},
},
...
...
pages/ucenter/login-page/phone-code/phone-code.vue
浏览文件 @
a3cad55d
...
@@ -5,31 +5,31 @@
...
@@ -5,31 +5,31 @@
<!-- 顶部文字 -->
<!-- 顶部文字 -->
<text
class=
"content-top-title"
>
请输入验证码
</text>
<text
class=
"content-top-title"
>
请输入验证码
</text>
<login-ikonw
class=
"login-iknow"
:text=
"tipText"
></login-ikonw>
<login-ikonw
class=
"login-iknow"
:text=
"tipText"
></login-ikonw>
<!-- 登录框 (选择手机号所属国家和地区需要另行实现) -->
<!-- 登录框 (选择手机号所属国家和地区需要另行实现) -->
<uni-forms
ref=
"form"
:value=
"formData"
:rules=
"rules"
>
<uni-forms
ref=
"form"
:value=
"formData"
:rules=
"rules"
>
<uni-forms-item
name=
"phone"
>
<uni-forms-item
name=
"phone"
>
<!--
<uni-easyinput
type=
"number"
class=
"phone-input-box"
:inputBorder=
"false"
<!--
<uni-easyinput
type=
"number"
class=
"phone-input-box"
:inputBorder=
"false"
v-model=
"formData.phone"
maxlength=
"11"
placeholder=
"请输入手机号码"
>
v-model=
"formData.phone"
maxlength=
"11"
placeholder=
"请输入手机号码"
>
</uni-easyinput>
-->
</uni-easyinput>
-->
<uni-easyinput
type=
"number"
class=
"phone-input-box"
:inputBorder=
"false"
<uni-easyinput
type=
"number"
class=
"phone-input-box"
:inputBorder=
"false"
v-model=
"formData.code"
maxlength=
"6"
placeholder=
"请输入验证码"
>
v-model=
"formData.code"
maxlength=
"6"
placeholder=
"请输入验证码"
>
<template
slot=
"right"
>
<template
slot=
"right"
>
<
login-short-code
:phone=
"formData.phone"
ref=
"shortCode"
></login-short-code>
<
send-sms-code
:phone=
"formData.phone"
ref=
"shortCode"
></send-sms-code>
</
template
>
</
template
>
</uni-easyinput>
</uni-easyinput>
</uni-forms-item>
</uni-forms-item>
<button
class=
"send-btn-box"
:disabled=
"!canSubmit"
:type=
"canSubmit?'primary':'default'"
<button
class=
"send-btn-box"
:disabled=
"!canSubmit"
:type=
"canSubmit?'primary':'default'"
@
click=
"submit"
>
登录
</button>
@
click=
"submit"
>
登录
</button>
</uni-forms>
</uni-forms>
</view>
</view>
</view>
</view>
<uni-quick-login></uni-quick-login>
<uni-quick-login></uni-quick-login>
</view>
</view>
</template>
</template>
<
script
>
<
script
>
import
mixin
from
'
../common/loginPage.mixin.js
'
;
import
mixin
from
'
../common/loginPage.mixin.js
'
;
export
default
{
export
default
{
mixins
:[
mixin
],
mixins
:[
mixin
],
data
()
{
data
()
{
return
{
return
{
...
@@ -47,62 +47,62 @@
...
@@ -47,62 +47,62 @@
onLoad
({
phoneNumber
,
phoneArea
})
{
onLoad
({
phoneNumber
,
phoneArea
})
{
this
.
formData
.
phone
=
phoneNumber
;
this
.
formData
.
phone
=
phoneNumber
;
this
.
currenPhoneArea
=
'
+
'
+
Number
(
phoneArea
);
this
.
currenPhoneArea
=
'
+
'
+
Number
(
phoneArea
);
},
onReady
()
{
this
.
$refs
.
shortCode
.
start
();
},
},
methods
:
{
onReady
()
{
/**
this
.
$refs
.
shortCode
.
start
();
* 完成并提交
},
*/
methods
:
{
submit
(){
/**
uniCloud
.
callFunction
({
//联网验证登陆
* 完成并提交
"
name
"
:
"
user-center
"
,
*/
"
data
"
:
{
submit
(){
"
action
"
:
"
loginBySms
"
,
uniCloud
.
callFunction
({
//联网验证登陆
"
params
"
:{
"
name
"
:
"
user-center
"
,
"
mobile
"
:
this
.
formData
.
phone
,
"
data
"
:
{
"
code
"
:
this
.
formData
.
code
"
action
"
:
"
loginBySms
"
,
}
"
params
"
:{
},
"
mobile
"
:
this
.
formData
.
phone
,
success
:
async
(
e
)
=>
{
"
code
"
:
this
.
formData
.
code
uni
.
hideLoading
()
}
console
.
log
(
e
.
result
);
},
if
(
e
.
result
.
code
===
0
){
success
:
async
(
e
)
=>
{
this
.
loginSuccess
(
e
.
result
)
uni
.
hideLoading
()
}
else
{
console
.
log
(
e
.
result
);
uni
.
showModal
({
if
(
e
.
result
.
code
===
0
){
title
:
'
错误
'
,
this
.
loginSuccess
(
e
.
result
)
content
:
e
.
result
.
msg
,
}
else
{
showCancel
:
false
,
uni
.
showModal
({
confirmText
:
'
知道了
'
,
title
:
'
错误
'
,
});
content
:
e
.
result
.
msg
,
}
showCancel
:
false
,
},
confirmText
:
'
知道了
'
,
fail
:
(
err
)
=>
{
});
console
.
log
(
err
);
}
uni
.
showModal
({
},
title
:
'
错误
'
,
fail
:
(
err
)
=>
{
content
:
JSON
.
stringify
(
err
),
console
.
log
(
err
);
showCancel
:
false
,
uni
.
showModal
({
confirmText
:
'
知道了
'
,
title
:
'
错误
'
,
});
content
:
JSON
.
stringify
(
err
),
if
(
err
.
errCode
===
30002
){
showCancel
:
false
,
confirmText
:
'
知道了
'
,
}
});
},
if
(
err
.
errCode
===
30002
){
complete
:
()
=>
{
uni
.
hideLoading
()
}
}
},
})
complete
:
()
=>
{
uni
.
hideLoading
()
}
})
}
}
}
}
}
}
</
script
>
</
script
>
<
style
>
<
style
>
@import
url("../common/loginPage.css")
;
@import
url("../common/loginPage.css")
;
.phone-input-box
{
.phone-input-box
{
margin-top
:
10px
;
margin-top
:
10px
;
}
}
</
style
>
</
style
>
pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue
浏览文件 @
a3cad55d
...
@@ -3,46 +3,46 @@
...
@@ -3,46 +3,46 @@
<view
class=
"wrap-content"
>
<view
class=
"wrap-content"
>
<view
class=
"content"
>
<view
class=
"content"
>
<!-- 顶部文字 -->
<!-- 顶部文字 -->
<text
class=
"content-top-title"
>
重置密码
</text>
<text
class=
"content-top-title"
>
重置密码
</text>
<login-ikonw
v-show=
"isPhone"
class=
"login-iknow"
:text=
"tipText"
></login-ikonw>
<login-ikonw
v-show=
"isPhone"
class=
"login-iknow"
:text=
"tipText"
></login-ikonw>
<!-- 登录框 (选择手机号所属国家和地区需要另行实现) -->
<!-- 登录框 (选择手机号所属国家和地区需要另行实现) -->
<uni-forms
ref=
"form"
:value=
"formData"
:rules=
"rules"
>
<uni-forms
ref=
"form"
:value=
"formData"
:rules=
"rules"
>
<uni-forms-item
name=
"phone"
>
<uni-forms-item
name=
"phone"
>
<!-- focus规则如果上一页携带来“手机号码”数据就focus验证码输入框,否则focus手机号码输入框 -->
<!-- focus规则如果上一页携带来“手机号码”数据就focus验证码输入框,否则focus手机号码输入框 -->
<uni-easyinput
:focus=
"!formData.phone.length"
type=
"number"
class=
"phone-input-box"
:inputBorder=
"false"
<uni-easyinput
:focus=
"!formData.phone.length"
type=
"number"
class=
"phone-input-box"
:inputBorder=
"false"
v-model=
"formData.phone"
maxlength=
"11"
placeholder=
"请输入手机号"
></uni-easyinput>
v-model=
"formData.phone"
maxlength=
"11"
placeholder=
"请输入手机号"
></uni-easyinput>
</uni-forms-item>
</uni-forms-item>
<uni-forms-item
name=
"code"
>
<uni-forms-item
name=
"code"
>
<uni-easyinput
:focus=
"formData.phone.length"
type=
"number"
class=
"phone-input-box"
:inputBorder=
"false"
<uni-easyinput
:focus=
"formData.phone.length"
type=
"number"
class=
"phone-input-box"
:inputBorder=
"false"
v-model=
"formData.code"
maxlength=
"6"
placeholder=
"请输入验证码"
>
v-model=
"formData.code"
maxlength=
"6"
placeholder=
"请输入验证码"
>
<template
slot=
"right"
>
<template
slot=
"right"
>
<
login-short-code
ref=
"shortCode"
:phone=
"formData.phone"
></login-short-code>
<
send-sms-code
ref=
"shortCode"
:phone=
"formData.phone"
></send-sms-code>
</
template
>
</
template
>
</uni-easyinput>
</uni-easyinput>
</uni-forms-item>
</uni-forms-item>
<uni-forms-item
name=
"pwd"
>
<uni-forms-item
name=
"pwd"
>
<uni-easyinput
type=
"password"
class=
"phone-input-box"
:inputBorder=
"false"
<uni-easyinput
type=
"password"
class=
"phone-input-box"
:inputBorder=
"false"
v-model=
"formData.pwd"
placeholder=
"请输入新密码"
></uni-easyinput>
v-model=
"formData.pwd"
placeholder=
"请输入新密码"
></uni-easyinput>
</uni-forms-item>
</uni-forms-item>
<uni-forms-item
name=
"pwd2"
>
<uni-forms-item
name=
"pwd2"
>
<uni-easyinput
type=
"password"
class=
"phone-input-box"
:inputBorder=
"false"
<uni-easyinput
type=
"password"
class=
"phone-input-box"
:inputBorder=
"false"
v-model=
"formData.pwd2"
placeholder=
"请确认新密码"
></uni-easyinput>
v-model=
"formData.pwd2"
placeholder=
"请确认新密码"
></uni-easyinput>
</uni-forms-item>
</uni-forms-item>
<button
class=
"send-btn-box"
:disabled=
"!canSubmit"
:type=
"canSubmit?'primary':'default'"
<button
class=
"send-btn-box"
:disabled=
"!canSubmit"
:type=
"canSubmit?'primary':'default'"
@
click=
"submit"
>
完成
</button>
@
click=
"submit"
>
完成
</button>
</uni-forms>
</uni-forms>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
</template>
<
script
>
<
script
>
import
mixin
from
'
../common/loginPage.mixin.js
'
;
import
mixin
from
'
../common/loginPage.mixin.js
'
;
export
default
{
export
default
{
mixins
:[
mixin
],
mixins
:[
mixin
],
data
()
{
data
()
{
return
{
return
{
currenPhoneArea
:
''
currenPhoneArea
:
''
}
}
},
},
computed
:
{
computed
:
{
...
@@ -58,42 +58,42 @@ import mixin from '../common/loginPage.mixin.js';
...
@@ -58,42 +58,42 @@ import mixin from '../common/loginPage.mixin.js';
this
.
formData
.
phone
=
event
.
phoneNumber
;
this
.
formData
.
phone
=
event
.
phoneNumber
;
this
.
currenPhoneArea
=
'
+
'
+
Number
(
event
.
phoneArea
);
this
.
currenPhoneArea
=
'
+
'
+
Number
(
event
.
phoneArea
);
}
}
},
onReady
()
{
if
(
this
.
formData
.
phone
){
this
.
$refs
.
shortCode
.
start
();
}
},
},
methods
:
{
onReady
()
{
/**
if
(
this
.
formData
.
phone
){
* 完成并提交
this
.
$refs
.
shortCode
.
start
();
*/
}
submit
(){
},
this
.
$refs
.
form
.
submit
()
methods
:
{
.
then
(
res
=>
{
/**
this
.
request
(
'
user-center/resetPwdBySmsCode
'
,{
* 完成并提交
"
mobile
"
:
this
.
formData
.
phone
,
*/
"
code
"
:
this
.
formData
.
code
,
submit
(){
"
password
"
:
this
.
formData
.
pwd
this
.
$refs
.
form
.
submit
()
},(
data
,
result
)
=>
{
.
then
(
res
=>
{
console
.
log
(
result
);
this
.
request
(
'
user-center/resetPwdBySmsCode
'
,{
uni
.
showToast
({
"
mobile
"
:
this
.
formData
.
phone
,
title
:
result
.
msg
,
"
code
"
:
this
.
formData
.
code
,
icon
:
'
none
'
"
password
"
:
this
.
formData
.
pwd
});
},(
data
,
result
)
=>
{
if
(
result
.
code
===
0
){
console
.
log
(
result
);
uni
.
navigateBack
()
uni
.
showToast
({
}
title
:
result
.
msg
,
})
icon
:
'
none
'
})
});
if
(
result
.
code
===
0
){
uni
.
navigateBack
()
}
})
})
}
}
}
}
}
}
</
script
>
</
script
>
<
style
>
<
style
>
@import
url("../common/loginPage.css")
;
@import
url("../common/loginPage.css")
;
.
phone-input-box
{
.
content-top-title
{
margin-
top
:
20
r
px
;
margin-
bottom
:
6
px
;
}
}
</
style
>
</
style
>
pages/ucenter/ucenter.vue
浏览文件 @
a3cad55d
...
@@ -111,7 +111,10 @@
...
@@ -111,7 +111,10 @@
appVersion
()
{
appVersion
()
{
return
getApp
().
appVersion
return
getApp
().
appVersion
}
}
// #endif
// #endif
,
appConfig
(){
return
getApp
().
config
}
},
},
methods
:
{
methods
:
{
...
mapMutations
({
...
mapMutations
({
...
@@ -156,15 +159,15 @@
...
@@ -156,15 +159,15 @@
* 去应用市场评分
* 去应用市场评分
*/
*/
gotoMarket
()
{
gotoMarket
()
{
// #ifdef APP-PLUS
// #ifdef APP-PLUS
if
(
uni
.
getSystemInfoSync
().
platform
==
"
ios
"
)
{
if
(
uni
.
getSystemInfoSync
().
platform
==
"
ios
"
)
{
// 这里填写appstore应用id
// 这里填写appstore应用id
let
appstoreid
=
'
id1417078253
'
;
let
appstoreid
=
this
.
appConfig
.
marketId
.
ios
;
//
'id1417078253';
plus
.
runtime
.
openURL
(
"
itms-apps://
"
+
'
itunes.apple.com/cn/app/wechat/
'
+
appstoreid
+
'
?mt=8
'
);
plus
.
runtime
.
openURL
(
"
itms-apps://
"
+
'
itunes.apple.com/cn/app/wechat/
'
+
appstoreid
+
'
?mt=8
'
);
}
}
if
(
uni
.
getSystemInfoSync
().
platform
==
"
android
"
)
{
if
(
uni
.
getSystemInfoSync
().
platform
==
"
android
"
)
{
var
Uri
=
plus
.
android
.
importClass
(
"
android.net.Uri
"
);
var
Uri
=
plus
.
android
.
importClass
(
"
android.net.Uri
"
);
var
uri
=
Uri
.
parse
(
"
market://details?id=
"
+
plus
.
runtime
.
app
id
);
var
uri
=
Uri
.
parse
(
"
market://details?id=
"
+
this
.
appConfig
.
marketId
.
andro
id
);
var
Intent
=
plus
.
android
.
importClass
(
'
android.content.Intent
'
);
var
Intent
=
plus
.
android
.
importClass
(
'
android.content.Intent
'
);
var
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
uri
);
var
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
uri
);
var
main
=
plus
.
android
.
runtimeMainActivity
();
var
main
=
plus
.
android
.
runtimeMainActivity
();
...
...
uniCloud-aliyun/cloudfunctions/user-center/index.js
浏览文件 @
a3cad55d
...
@@ -124,19 +124,20 @@ exports.main = async (event, context) => {
...
@@ -124,19 +124,20 @@ exports.main = async (event, context) => {
mobile
:
params
.
mobile
,
mobile
:
params
.
mobile
,
code
:
params
.
code
code
:
params
.
code
});
});
let
verifyCode
=
await
uniID
.
verifyCode
({
// let verifyCode = await uniID.verifyCode({
mobile
:
params
.
mobile
,
// mobile: params.mobile,
code
:
params
.
code
// code: params.code
// })
// if (verifyCode.code === 0) {
// } else {
// res = verifyCode
// }
res
=
await
uniID
.
bindMobile
({
uid
:
params
.
uid
,
mobile
:
params
.
mobile
,
code
:
params
.
code
})
})
if
(
verifyCode
.
code
===
0
)
{
console
.
log
(
res
);
res
=
await
uniID
.
bindMobile
({
uid
:
params
.
uid
,
mobile
:
params
.
mobile
})
}
else
{
res
=
verifyCode
}
console
.
log
(
res
,
verifyCode
);
break
;
break
;
case
'
register
'
:
case
'
register
'
:
let
{
let
{
...
@@ -210,10 +211,10 @@ exports.main = async (event, context) => {
...
@@ -210,10 +211,10 @@ exports.main = async (event, context) => {
break
;
break
;
case
'
sendSmsCode
'
:
case
'
sendSmsCode
'
:
//123546
return
uniID
.
setVerifyCode
({
return
uniID
.
setVerifyCode
({
mobile
:
params
.
mobile
,
mobile
:
params
.
mobile
,
code
:
'
123456
'
code
:
'
123456
'
,
type
:
params
.
type
})
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录