Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-web-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-web-master
Commits
07da486f
Commit
07da486f
authored
Nov 20, 2024
by
honghy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
短信功能实作
parent
92f6670d
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
108 additions
and
51 deletions
+108
-51
index.vue
src/components/JdSendCode/index.vue
+11
-2
Release.vue
src/views/jiedao/profile/components/Release.vue
+8
-1
SendSmsCode.vue
src/views/jiedao/profile/components/SendSmsCode.vue
+13
-8
SetControlPassword.vue
src/views/jiedao/profile/components/SetControlPassword.vue
+9
-2
Transfer.vue
src/views/jiedao/profile/components/Transfer.vue
+8
-1
setting.vue
src/views/jiedao/profile/setting.vue
+8
-7
mobileLogin.vue
src/views/login/components/mobileLogin.vue
+16
-11
index.vue
src/views/registered/index.vue
+16
-10
resetpwd.vue
src/views/registered/resetpwd.vue
+19
-9
No files found.
src/components/JdSendCode/index.vue
View file @
07da486f
<
template
>
<el-button
:disabled=
"leftTime > 0 && leftTime
<
60
"
@
click=
"send"
>
{{
text
}}
</el-button>
<el-dropdown
@
command=
"send"
:disabled=
"leftTime > 0 && leftTime
<
60
"
>
<el-button
type=
"primary"
>
{{
text
}}
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
</el-button>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"1"
>
SMS
</el-dropdown-item>
<el-dropdown-item
command=
"2"
>
WhatsApp
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</
template
>
<
script
>
import
{
getCode
}
from
'
@/api/user
'
...
...
@@ -29,9 +37,10 @@ export default {
if
(
this
.
timeout
)
clearTimeout
(
this
.
timeout
)
},
methods
:
{
send
()
{
send
(
messageType
)
{
if
(
this
.
loading
||
(
this
.
leftTime
>
0
&&
this
.
leftTime
<
60
))
return
false
this
.
loading
=
true
this
.
form
[
'
messageType
'
]
=
messageType
getCode
(
this
.
form
).
then
(()
=>
{
this
.
$message
({
message
:
this
.
$t
(
'
common.success
'
),
...
...
src/views/jiedao/profile/components/Release.vue
View file @
07da486f
...
...
@@ -120,7 +120,14 @@
auto-complete=
"new-password"
/>
<!-- <el-button type="success">获取验证码</el-button> -->
<send-sms-code
:order-id=
"detail.orderId"
scene=
"5"
/>
<send-sms-code
:form=
"{
orderId: detail.orderId,
nodeValue: 'delivery-verification-sms',
isTransport: 0,
transportId: 0,
isOrders: 0,
}"
/>
</el-form-item>
<el-form-item
v-if=
"!isSuccess&&radio==1"
:label=
"$t('setting.controlPassword')"
prop=
"controlPassword"
>
<el-input
...
...
src/views/jiedao/profile/components/SendSmsCode.vue
View file @
07da486f
<
template
>
<el-button
:disabled=
"leftTime > 0 && leftTime
<
60
"
@
click=
"send"
>
{{
text
}}
</el-button>
<el-dropdown
@
command=
"send"
:disabled=
"leftTime > 0 && leftTime
<
60
"
>
<el-button
type=
"primary"
>
{{
text
}}
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
</el-button>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"1"
>
SMS
</el-dropdown-item>
<el-dropdown-item
command=
"2"
>
WhatsApp
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</
template
>
<
script
>
import
{
sendSmsCode
}
from
'
@/api/order
'
export
default
{
props
:
{
orderId
:
[
String
,
Number
],
scene
:
[
String
,
Number
]
form
:
Object
},
data
()
{
return
{
...
...
@@ -30,13 +37,11 @@ export default {
if
(
this
.
timeout
)
clearTimeout
(
this
.
timeout
)
},
methods
:
{
send
()
{
send
(
messageType
)
{
if
(
this
.
loading
||
(
this
.
leftTime
>
0
&&
this
.
leftTime
<
60
))
return
false
this
.
loading
=
true
sendSmsCode
({
orderId
:
this
.
orderId
,
scene
:
this
.
scene
}).
then
(
res
=>
{
this
.
form
[
'
messageType
'
]
=
messageType
sendSmsCode
(
this
.
form
).
then
(
res
=>
{
this
.
$message
.
success
(
this
.
$t
(
'
sendSmsCode.success
'
))
this
.
countDown
()
}).
finally
(
res
=>
{
...
...
src/views/jiedao/profile/components/SetControlPassword.vue
View file @
07da486f
<
template
>
<!-- 更换手机号弹窗 -->
<el-dialog
:title=
"$t('setting.setControlPassword')"
visible
width=
"5
0
0px"
append-to-body
:close-on-click-modal=
"false"
:before-close=
"cancel"
>
<el-dialog
:title=
"$t('setting.setControlPassword')"
visible
width=
"5
8
0px"
append-to-body
:close-on-click-modal=
"false"
:before-close=
"cancel"
>
<el-form
ref=
"changePhoneForm"
:model=
"form"
label-width=
"120px"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"24"
>
...
...
@@ -23,7 +23,14 @@
</el-form-item>
</el-col>
<el-col
:span=
"6"
>
<jd-send-code
:form=
"
{ mobile: loginUser.mobile, scene: 3, areaCode: loginUser.areaCode }" />
<jd-send-code
:form=
"
{
mobile: loginUser.mobile,
nodeValue: 'user-sms-reset-password',
isTransport: 0,
transportId: 0,
isOrders: 0,
areaCode: loginUser.areaCode
}" />
</el-col>
</el-row>
</el-form>
...
...
src/views/jiedao/profile/components/Transfer.vue
View file @
07da486f
...
...
@@ -31,7 +31,14 @@
</el-form-item>
<el-form-item
v-if=
"radio==0"
:label=
"$t('release.code')"
prop=
"code"
>
<el-input
v-model.number=
"form.code"
type=
"number"
>
<send-sms-code
slot=
"append"
:order-id=
"orderId"
scene=
"4"
/>
<send-sms-code
slot=
"append"
:form=
"
{
orderId: orderId,
nodeValue: 'transfer-control-goods',
isTransport: 0,
transportId: 0,
isOrders: 0,
}"
/>
</el-input></el-form-item>
<el-form-item
v-if=
"radio==1"
:label=
"$t('setting.controlPassword')"
prop=
"controlPassword"
>
<el-input
...
...
src/views/jiedao/profile/setting.vue
View file @
07da486f
...
...
@@ -1245,13 +1245,14 @@
</el-col>
<el-col
:span=
"6"
>
<!--
<el-button
type=
"primary"
@
click=
"changePhoneCode"
>
{{
$t
(
'
setting.getCode
'
)
}}
</el-button>
-->
<jd-send-code
:form=
"
{
<jd-send-code
:form=
"
{
mobile: changePhoneForm.mobile,
scene: 2,
areaCode: changePhoneForm.areaCode,
}"
/>
nodeValue: 'user-sms-update-mobile',
isTransport: 0,
transportId: 0,
isOrders: 0,
areaCode: changePhoneForm.areaCode
}" />
</el-col>
</el-row>
</el-form>
...
...
src/views/login/components/mobileLogin.vue
View file @
07da486f
...
...
@@ -49,14 +49,15 @@
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-button
:loading=
"loading"
type=
"primary"
:disabled=
"disabled"
round
@
click.native.prevent=
"getValidaCode"
>
{{
getCode
}}
</el-button
>
<el-dropdown
@
command=
"getValidaCode"
:disabled=
"disabled"
>
<el-button
type=
"primary"
>
{{
getCode
}}
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
</el-button>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"1"
>
SMS
</el-dropdown-item>
<el-dropdown-item
command=
"2"
>
WhatsApp
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-col>
</el-row>
...
...
@@ -140,12 +141,16 @@ export default {
// window.removeEventListener('storage', this.afterQRScan)
},
methods
:
{
getValidaCode
()
{
getValidaCode
(
messageType
)
{
var
data
=
{
mobile
:
this
.
loginForm
.
mobile
,
scene
:
1
,
nodeValue
:
'
user-sms-reg
'
,
areaCode
:
this
.
loginForm
.
areaCode
,
};
isTransport
:
0
,
transportId
:
0
,
isOrders
:
0
,
messageType
:
messageType
}
getCode
(
data
).
then
(()
=>
{
var
countDown
=
window
.
setInterval
(()
=>
{
if
(
this
.
count
<
1
)
{
...
...
src/views/registered/index.vue
View file @
07da486f
...
...
@@ -202,13 +202,15 @@
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-button
:loading=
"loading"
type=
"primary"
style=
"width: 100%; margin-bottom: 30px"
:disabled=
"disabled"
@
click.native.prevent=
"getValidaCode"
>
{{
getCode
}}
</el-button>
<el-dropdown
@
command=
"getValidaCode"
:disabled=
"disabled"
>
<el-button
type=
"primary"
>
{{
getCode
}}
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
</el-button>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"1"
>
SMS
</el-dropdown-item>
<el-dropdown-item
command=
"2"
>
WhatsApp
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-col>
</el-row>
<el-form-item
prop=
"password"
:label=
"$t('registered.password')"
>
...
...
@@ -384,11 +386,15 @@ export default {
this
.
$i18n
.
locale
=
lang
this
.
$store
.
dispatch
(
'
app/setLanguage
'
,
lang
)
},
getValidaCode
()
{
getValidaCode
(
messageType
)
{
var
data
=
{
mobile
:
this
.
registeredForm
.
mobile
,
scene
:
0
,
areaCode
:
this
.
registeredForm
.
areaCode
nodeValue
:
'
user-sms-reg
'
,
areaCode
:
this
.
registeredForm
.
areaCode
,
isTransport
:
0
,
transportId
:
0
,
isOrders
:
0
,
messageType
:
messageType
}
getCode
(
data
).
then
(()
=>
{
var
countDown
=
window
.
setInterval
(()
=>
{
...
...
src/views/registered/resetpwd.vue
View file @
07da486f
...
...
@@ -110,13 +110,15 @@
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-button
:loading=
"loading"
type=
"primary"
style=
"width:100%;margin-bottom:30px;"
:disabled=
"disabled"
@
click.native.prevent=
"getValidaCode"
>
{{
getCode
}}
</el-button>
<el-dropdown
@
command=
"getValidaCode"
:disabled=
"disabled"
>
<el-button
type=
"primary"
>
{{
getCode
}}
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
</el-button>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"1"
>
SMS
</el-dropdown-item>
<el-dropdown-item
command=
"2"
>
WhatsApp
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-col>
</el-row>
<el-form-item
prop=
"password"
:label=
"$t('registered.password')"
>
...
...
@@ -228,8 +230,16 @@ export default {
this
.
$i18n
.
locale
=
lang
this
.
$store
.
dispatch
(
'
app/setLanguage
'
,
lang
)
},
getValidaCode
()
{
var
data
=
{
mobile
:
this
.
registeredForm
.
mobile
,
scene
:
3
,
areaCode
:
this
.
registeredForm
.
areaCode
}
getValidaCode
(
messageType
)
{
var
data
=
{
mobile
:
this
.
registeredForm
.
mobile
,
nodeValue
:
'
user-sms-reset-password
'
,
areaCode
:
this
.
registeredForm
.
areaCode
,
isTransport
:
0
,
transportId
:
0
,
isOrders
:
0
,
messageType
:
messageType
}
getCode
(
data
).
then
(()
=>
{
var
countDown
=
window
.
setInterval
(()
=>
{
if
(
this
.
count
<
1
)
{
...
...
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