Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-customer-new-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-app-customer-new-master
Commits
3f673085
Commit
3f673085
authored
Nov 20, 2024
by
honghy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
短信功能实作
parent
45d1838c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
199 additions
and
118 deletions
+199
-118
changeTel.vue
src/pages/changeTel/changeTel.vue
+37
-25
forget.vue
src/pages/forget/forget.vue
+18
-4
login.vue
src/pages/login/login.vue
+18
-8
order.vue
src/pages/order/order.vue
+29
-13
order_mail.vue
src/pages/order_mail/order_mail.vue
+19
-9
register.vue
src/pages/register/register.vue
+41
-34
telcode.vue
src/pages/telcode/telcode.vue
+37
-25
No files found.
src/pages/changeTel/changeTel.vue
View file @
3f673085
...
...
@@ -36,7 +36,9 @@
<view
class=
"login-vp"
>
<input
class=
"vp-input"
v-model=
"code"
type=
"number"
:placeholder=
"$lang.lang.notices.code"
>
<view
class=
"login-code"
v-if=
"leftTime
<
60
"
>
{{
leftTime
}}
S
</view>
<view
class=
"login-code"
v-else
@
click=
"sendCode"
>
{{
$lang
.
lang
.
editEmail
.
getCode
}}
</view>
<picker
class=
"login-code"
:range=
"smsName"
@
change=
"sendCode"
v-else
>
<view
class=
"uni-input"
>
{{
$lang
.
lang
.
editEmail
.
getCode
}}
</view>
</picker>
</view>
</view>
<view
class=
"login-vp login-v"
>
...
...
@@ -78,7 +80,10 @@
areaName
:
[],
leftTime
:
60
,
oldMobile
:
''
,
userInfo
:{}
userInfo
:{},
smsName
:
[
'
SMS
'
,
'
WhatsApp
'
],
smsData
:
[
1
,
2
],
smsIndex
:
0
}
},
onLoad
()
{
...
...
@@ -95,27 +100,6 @@
})
},
ismobile
(
code
,
mobile
){
this
.
$request
.
get
(
'
/app-api/param/validator/mobile
'
,{
code
:
code
,
mobile
:
mobile
}).
then
(
res
=>
{
if
(
res
.
code
==
0
){
this
.
$request
.
post
(
'
/app-api/member/send-sms-code
'
,
{
areaCode
:
this
.
areaData
[
this
.
areaIndexs
],
mobile
:
this
.
mobile
,
scene
:
2
}).
then
(
res
=>
{
if
(
res
.
code
==
0
){
this
.
countDown
()
}
else
{
uni
.
showToast
({
title
:
res
.
msg
,
icon
:
'
none
'
,
})
}
})
}
else
{
uni
.
showToast
({
title
:
this
.
$lang
.
lang
.
notices
.
nophone
,
icon
:
'
error
'
,
})
}
})
},
Country
()
{
let
that
=
this
that
.
$request
.
get
(
'
/app-api/ecw/country/list-all
'
).
then
(
res
=>
{
...
...
@@ -131,7 +115,7 @@
}
})
},
sendCode
()
{
sendCode
(
e
)
{
if
(
this
.
mobile
==
''
){
return
uni
.
showToast
({
title
:
this
.
$lang
.
lang
.
notices
.
phone
,
...
...
@@ -141,7 +125,35 @@
if
(
this
.
leftTime
<
60
)
{
return
false
}
this
.
ismobile
(
this
.
areaData
[
this
.
areaIndexs
],
this
.
mobile
)
var
data
=
{
mobile
:
this
.
mobile
,
nodeValue
:
'
user-sms-update-mobile
'
,
areaCode
:
this
.
areaData
[
this
.
areaIndexs
],
code
:
this
.
areaData
[
this
.
areaIndexs
],
isTransport
:
0
,
transportId
:
0
,
isOrders
:
0
,
messageType
:
this
.
smsData
[
e
.
detail
.
value
]
}
this
.
$request
.
get
(
'
/app-api/param/validator/mobile
'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
0
){
this
.
$request
.
post
(
'
/app-api/member/send-sms-code
'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
0
){
this
.
countDown
()
}
else
{
uni
.
showToast
({
title
:
res
.
msg
,
icon
:
'
none
'
,
})
}
})
}
else
{
uni
.
showToast
({
title
:
this
.
$lang
.
lang
.
notices
.
nophone
,
icon
:
'
error
'
,
})
}
})
},
countDown
()
{
this
.
leftTime
--
...
...
src/pages/forget/forget.vue
View file @
3f673085
...
...
@@ -20,7 +20,9 @@
<view
class=
"items-vw"
>
<input
type=
"number"
v-model=
"FormData.code"
:placeholder=
"$lang.lang.notices.code"
>
<text
class=
"code"
v-if=
"leftTime
<
60
"
>
{{
leftTime
}}
S
</text>
<text
class=
"code"
@
click=
"sendCode"
v-else
>
{{
$lang
.
lang
.
forget
.
code
}}
</text>
<picker
class=
"code"
:range=
"smsName"
@
change=
"sendCode"
v-else
>
<view
class=
"uni-input"
>
{{
$lang
.
lang
.
forget
.
code
}}
</view>
</picker>
</view>
</view>
<view
class=
"item"
>
...
...
@@ -67,7 +69,10 @@
code
:
this
.
$lang
.
lang
.
notices
.
code
,
password
:
this
.
$lang
.
lang
.
notices
.
newPsd
,
passworded
:
this
.
$lang
.
lang
.
notices
.
nextPsd
,
}
},
smsName
:
[
'
SMS
'
,
'
WhatsApp
'
],
smsData
:
[
1
,
2
],
smsIndex
:
0
}
},
onLoad
()
{
...
...
@@ -122,7 +127,7 @@
}
})
},
sendCode
()
{
sendCode
(
e
)
{
if
(
this
.
FormData
.
mobile
==
''
){
return
uni
.
showToast
({
title
:
this
.
$lang
.
lang
.
notices
.
phone
,
...
...
@@ -132,7 +137,16 @@
if
(
this
.
leftTime
<
60
)
{
return
false
}
this
.
$request
.
post
(
'
/app-api/member/send-sms-code
'
,
{
areaCode
:
this
.
areaData
[
this
.
areaIndex
],
mobile
:
this
.
FormData
.
mobile
,
scene
:
3
}).
then
(
res
=>
{
var
data
=
{
mobile
:
this
.
FormData
.
mobile
,
nodeValue
:
'
user-sms-reset-password
'
,
areaCode
:
this
.
areaData
[
this
.
areaIndex
],
isTransport
:
0
,
transportId
:
0
,
isOrders
:
0
,
messageType
:
this
.
smsData
[
e
.
detail
.
value
]
}
this
.
$request
.
post
(
'
/app-api/member/send-sms-code
'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
0
){
this
.
countDown
()
}
else
{
...
...
src/pages/login/login.vue
View file @
3f673085
...
...
@@ -88,7 +88,9 @@
:placeholder=
"$lang.lang.notices.code"
/>
<text
class=
"code"
v-if=
"leftTime
<
60
"
>
{{
leftTime
}}
S
</text>
<text
class=
"code"
@
click=
"sendCode"
v-else
>
{{
$lang
.
lang
.
login
.
code
}}
</text>
<picker
class=
"code"
:range=
"smsName"
@
change=
"sendCode"
v-else
>
<view
class=
"uni-input"
>
{{
$lang
.
lang
.
login
.
code
}}
</view>
</picker>
</view>
</view>
</view>
...
...
@@ -174,7 +176,10 @@ export default {
forceUpdate
:
0
,
showdownLine
:
false
,
downloadNum
:
0
,
//下载百分比
totalSize
:
0
//下载总量
totalSize
:
0
,
//下载总量
smsName
:
[
'
SMS
'
,
'
WhatsApp
'
],
smsData
:
[
1
,
2
],
smsIndex
:
0
}
},
onLoad
()
{
...
...
@@ -275,7 +280,7 @@ export default {
}
})
},
sendCode
()
{
sendCode
(
e
)
{
if
(
this
.
mobile
==
''
)
{
return
uni
.
showToast
({
title
:
this
.
$lang
.
lang
.
notices
.
phone
,
...
...
@@ -285,12 +290,17 @@ export default {
if
(
this
.
leftTime
<
60
)
{
return
false
}
var
data
=
{
mobile
:
this
.
mobile
,
nodeValue
:
'
user-sms-login
'
,
areaCode
:
this
.
areaData
[
this
.
areaIndex
],
isTransport
:
0
,
transportId
:
0
,
isOrders
:
0
,
messageType
:
this
.
smsData
[
e
.
detail
.
value
]
}
this
.
$request
.
post
(
'
/app-api/member/send-sms-code
'
,
{
areaCode
:
this
.
areaData
[
this
.
areaIndex
],
mobile
:
this
.
mobile
,
scene
:
1
})
.
post
(
'
/app-api/member/send-sms-code
'
,
data
)
.
then
((
res
)
=>
{
if
(
res
.
code
==
0
)
{
this
.
countDown
()
...
...
src/pages/order/order.vue
View file @
3f673085
...
...
@@ -274,7 +274,9 @@
<view
class=
"corder-tab1-item"
v-if=
"controlType==1"
>
<input
class=
"vp-input"
autocomplete=
"off"
v-model=
"lendingFrom.code"
type=
"code"
:placeholder=
"$lang.lang.notices.code"
>
<view
class=
"code"
v-if=
"leftTime
<
60
"
>
{{
leftTime
}}
S
</view>
<view
class=
"code"
@
click=
"sendCode"
v-else
>
{{
$lang
.
lang
.
order
.
getCode
}}
</view>
<picker
class=
"code"
:range=
"smsName"
@
change=
"sendCode"
v-else
>
<view
class=
"uni-input"
>
{{
$lang
.
lang
.
order
.
getCode
}}
</view>
</picker>
</view>
<view
class=
"corder-tab1-item"
v-if=
"controlType==2"
>
<text>
{{
$lang
.
lang
.
site
.
controlPsd
}}
<span
class=
"redcolor"
>
*
</span></text>
...
...
@@ -355,7 +357,9 @@
<view
class=
"corder-tab1-item"
v-if=
"controlType==1"
>
<input
class=
"vp-input"
autocomplete=
"off"
v-model=
"transferFrom.code"
type=
"code"
:placeholder=
"$lang.lang.notices.code"
>
<view
class=
"code"
v-if=
"leftTimes
<
60
"
>
{{
leftTimes
}}
S
</view>
<view
class=
"code"
@
click=
"sendTransCode"
v-else
>
{{
$lang
.
lang
.
order
.
getCode
}}
</view>
<picker
class=
"code"
:range=
"smsName"
@
change=
"sendTransCode"
v-else
>
<view
class=
"uni-input"
>
{{
$lang
.
lang
.
order
.
getCode
}}
</view>
</picker>
</view>
<view
class=
"corder-tab1-item"
v-if=
"controlType==2"
>
<text>
{{
$lang
.
lang
.
site
.
controlPsd
}}
<span
class=
"redcolor"
>
*
</span></text>
...
...
@@ -509,7 +513,10 @@
controlLogData
:[],
controlType
:
1
,
//放货方式
transType
:[],
loading
:
false
loading
:
false
,
smsName
:
[
'
SMS
'
,
'
WhatsApp
'
],
smsData
:
[
1
,
2
],
smsIndex
:
0
}
},
onLoad
()
{
...
...
@@ -790,15 +797,19 @@
}
})
},
sendTransCode
(){
sendTransCode
(
e
){
if
(
this
.
leftTimes
<
60
)
{
return
false
}
var
params
=
{
orderId
:
this
.
selectOrder
.
orderId
,
scene
:
4
var
data
=
{
nodeValue
:
'
transfer-control-goods
'
,
orderId
:
this
.
selectOrder
.
orderId
,
isTransport
:
0
,
transportId
:
0
,
isOrders
:
0
,
messageType
:
this
.
smsData
[
e
.
detail
.
value
]
}
this
.
$request
.
post
(
'
/app-api/order/order-cargo-control/send-sms-code
'
,
params
).
then
(
res
=>
{
this
.
$request
.
post
(
'
/app-api/order/order-cargo-control/send-sms-code
'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
0
){
this
.
countDowns
()
}
else
{
...
...
@@ -817,15 +828,20 @@
this
.
leftTimes
=
60
}
},
sendCode
()
{
sendCode
(
e
)
{
if
(
this
.
leftTime
<
60
)
{
return
false
}
var
params
=
{
orderId
:
this
.
selectOrder
.
orderId
,
scene
:
5
var
data
=
{
nodeValue
:
'
delivery-verification-sms
'
,
orderId
:
this
.
selectOrder
.
orderId
,
isTransport
:
0
,
transportId
:
0
,
isOrders
:
0
,
messageType
:
this
.
smsData
[
e
.
detail
.
value
]
}
this
.
$request
.
post
(
'
/app-api/order/order-cargo-control/send-sms-code
'
,
params
).
then
(
res
=>
{
this
.
$request
.
post
(
'
/app-api/order/order-cargo-control/send-sms-code
'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
0
){
this
.
countDown
()
}
else
{
...
...
src/pages/order_mail/order_mail.vue
View file @
3f673085
...
...
@@ -80,9 +80,11 @@
<
view
class
=
"
main-footer
"
>
<
view
class
=
"
mobile
"
>
{{
mobile
}}
<
/view
>
<
input
class
=
"
inp
"
:
placeholder
=
"
integral.codePlaceloader
"
v
-
model
=
"
code
"
/>
<
view
class
=
"
btn
"
@
click
=
"
handleCode
"
>
{{
codeTime
==
0
?
integral
.
code
:
integral
.
codeTimeText
(
codeTime
)
}}
<
/view
>
<
text
class
=
"
code
"
v
-
if
=
"
codeTime >0
"
>
{{
integral
.
codeTimeText
(
codeTime
)
}}
<
/text
>
<
picker
class
=
"
code
"
:
range
=
"
smsName
"
@
change
=
"
handleCode
"
v
-
else
>
<
view
class
=
"
uni-input
"
>
{{
integral
.
code
}}
<
/view
>
<
/picker
>
<
/view
>
<
/view
>
<
/view
>
...
...
@@ -210,7 +212,9 @@ export default {
code
:
''
,
// 验证码倒计时
codeTime
:
0
,
mobile
:
''
mobile
:
''
,
smsName
:
[
'
SMS
'
,
'
WhatsApp
'
],
smsData
:
[
1
,
2
],
}
}
,
onLoad
(
route
)
{
...
...
@@ -274,7 +278,7 @@ export default {
}
}
,
// 获取验证码
async
handleCode
()
{
async
handleCode
(
e
)
{
if
(
this
.
codeTime
>
0
)
return
this
.
codeTime
=
60
this
.
timer
=
setInterval
(()
=>
{
...
...
@@ -284,10 +288,16 @@ export default {
}
}
,
1000
)
try
{
const
memberId
=
this
.
$store
.
getters
.
id
await
this
.
$request
.
post
(
'
/app-api/reward/redeem/send-sms-code
'
,
{
memberId
}
)
var
data
=
{
memberId
:
this
.
$store
.
getters
.
id
,
nodeValue
:
'
user-sms-redeem-reward
'
,
isTransport
:
0
,
transportId
:
0
,
isOrders
:
0
,
messageType
:
this
.
smsData
[
e
.
detail
.
value
]
}
await
this
.
$request
.
post
(
'
/app-api/reward/redeem/send-sms-code
'
,
data
)
}
catch
(
error
)
{
}
}
,
// 打开弹出层
...
...
src/pages/register/register.vue
View file @
3f673085
...
...
@@ -57,9 +57,9 @@
:placeholder=
"$lang.lang.notices.code"
/>
<view
class=
"login-code"
v-if=
"leftTime
<
60
"
>
{{
leftTime
}}
S
</view>
<view
class=
"login-code"
v-else
@
click=
"sendCode"
>
{{
$lang
.
lang
.
login
.
code
}}
</view
>
<picker
class=
"login-code"
:range=
"smsName"
@
change=
"sendCode"
v-else
>
<view
class=
"uni-input"
>
{{
$lang
.
lang
.
login
.
code
}}
</view>
</picker
>
</view>
</view>
<view
class=
"login-v"
>
...
...
@@ -147,6 +147,9 @@ export default {
areaName
:
[],
leftTime
:
60
,
referralCode
:
""
,
smsName
:
[
'
SMS
'
,
'
WhatsApp
'
],
smsData
:
[
1
,
2
],
smsIndex
:
0
};
},
onLoad
()
{
...
...
@@ -187,36 +190,7 @@ export default {
areaChange
(
e
)
{
this
.
areaIndex
=
e
.
detail
.
value
;
},
ismobile
(
code
,
mobile
)
{
this
.
$request
.
get
(
"
/app-api/param/validator/mobile
"
,
{
code
:
code
,
mobile
:
mobile
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
0
)
{
this
.
$request
.
post
(
"
/app-api/member/send-sms-code
"
,
{
areaCode
:
this
.
areaData
[
this
.
areaIndex
],
mobile
:
this
.
mobile
,
scene
:
0
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
0
)
{
this
.
countDown
();
}
else
{
uni
.
showToast
({
title
:
res
.
msg
||
"
error
"
,
icon
:
"
none
"
,
});
}
});
}
else
{
uni
.
showToast
({
title
:
this
.
$lang
.
lang
.
notices
.
nophone
,
icon
:
"
error
"
,
});
}
});
},
sendCode
()
{
sendCode
(
e
)
{
if
(
this
.
mobile
==
""
)
{
return
uni
.
showToast
({
title
:
this
.
$lang
.
lang
.
notices
.
phone
,
...
...
@@ -226,7 +200,40 @@ export default {
if
(
this
.
leftTime
<
60
)
{
return
false
;
}
this
.
ismobile
(
this
.
areaData
[
this
.
areaIndex
],
this
.
mobile
);
var
data
=
{
mobile
:
this
.
mobile
,
nodeValue
:
'
user-sms-reg
'
,
areaCode
:
this
.
areaData
[
this
.
areaIndex
],
code
:
this
.
areaData
[
this
.
areaIndex
],
isTransport
:
0
,
transportId
:
0
,
isOrders
:
0
,
messageType
:
this
.
smsData
[
e
.
detail
.
value
]
}
this
.
$request
.
get
(
"
/app-api/param/validator/mobile
"
,
data
)
.
then
((
res
)
=>
{
if
(
res
.
code
==
0
)
{
this
.
$request
.
post
(
"
/app-api/member/send-sms-code
"
,
data
)
.
then
((
res
)
=>
{
if
(
res
.
code
==
0
)
{
this
.
countDown
();
}
else
{
uni
.
showToast
({
title
:
res
.
msg
||
"
error
"
,
icon
:
"
none
"
,
});
}
});
}
else
{
uni
.
showToast
({
title
:
this
.
$lang
.
lang
.
notices
.
nophone
,
icon
:
"
error
"
,
});
}
});
},
countDown
()
{
this
.
leftTime
--
;
...
...
src/pages/telcode/telcode.vue
View file @
3f673085
...
...
@@ -19,7 +19,9 @@
<view
class=
"login-vp"
>
<input
class=
"vp-input"
autocomplete=
"off"
v-model=
"code"
type=
"number"
:placeholder=
"$lang.lang.notices.code"
>
<view
class=
"login-code"
v-if=
"leftTime
<
60
"
>
{{
leftTime
}}
S
</view>
<view
class=
"login-code"
v-else
@
click=
"sendCode"
>
{{
$lang
.
lang
.
editEmail
.
getCode
}}
</view>
<picker
class=
"login-code"
:range=
"smsName"
@
change=
"sendCode"
v-else
>
<view
class=
"uni-input"
>
{{
$lang
.
lang
.
editEmail
.
code
}}
</view>
</picker>
</view>
</view>
<view
class=
"login-vp login-v"
>
...
...
@@ -55,7 +57,10 @@
leftTime
:
60
,
password
:
''
,
password2
:
''
,
userInfo
:
''
userInfo
:
''
,
smsName
:
[
'
SMS
'
,
'
WhatsApp
'
],
smsData
:
[
1
,
2
],
smsIndex
:
0
}
},
onLoad
()
{
...
...
@@ -70,27 +75,6 @@
}
})
},
ismobile
(
mobile
){
this
.
$request
.
get
(
'
/app-api/param/validator/mobile
'
,{
code
:
this
.
userInfo
.
areaCode
,
mobile
:
this
.
userInfo
.
mobile
}).
then
(
res
=>
{
if
(
res
.
code
==
0
){
this
.
$request
.
post
(
'
/app-api/member/send-sms-code
'
,
{
areaCode
:
this
.
userInfo
.
areaCode
,
mobile
:
this
.
userInfo
.
mobile
,
scene
:
3
}).
then
(
res
=>
{
if
(
res
.
code
==
0
){
this
.
countDown
()
}
else
{
uni
.
showToast
({
title
:
res
.
msg
,
icon
:
'
none
'
,
})
}
})
}
else
{
uni
.
showToast
({
title
:
this
.
$lang
.
lang
.
notices
.
nophone
,
icon
:
'
error
'
,
})
}
})
},
Country
()
{
let
that
=
this
that
.
$request
.
get
(
'
/app-api/ecw/country/list-all
'
).
then
(
res
=>
{
...
...
@@ -106,11 +90,39 @@
}
})
},
sendCode
()
{
sendCode
(
e
)
{
if
(
this
.
leftTime
<
60
)
{
return
false
}
this
.
ismobile
(
this
.
userInfo
.
mobile
)
var
data
=
{
mobile
:
this
.
userInfo
.
mobile
,
nodeValue
:
'
user-sms-reset-password
'
,
areaCode
:
this
.
userInfo
.
areaCode
,
code
:
this
.
userInfo
.
areaCode
,
isTransport
:
0
,
transportId
:
0
,
isOrders
:
0
,
messageType
:
this
.
smsData
[
e
.
detail
.
value
]
}
this
.
$request
.
get
(
'
/app-api/param/validator/mobile
'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
0
){
this
.
$request
.
post
(
'
/app-api/member/send-sms-code
'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
0
){
this
.
countDown
()
}
else
{
uni
.
showToast
({
title
:
res
.
msg
,
icon
:
'
none
'
,
})
}
})
}
else
{
uni
.
showToast
({
title
:
this
.
$lang
.
lang
.
notices
.
nophone
,
icon
:
'
error
'
,
})
}
})
},
countDown
()
{
this
.
leftTime
--
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment