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
>
<
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
>
</
template
>
<
script
>
<
script
>
import
{
getCode
}
from
'
@/api/user
'
import
{
getCode
}
from
'
@/api/user
'
...
@@ -29,9 +37,10 @@ export default {
...
@@ -29,9 +37,10 @@ export default {
if
(
this
.
timeout
)
clearTimeout
(
this
.
timeout
)
if
(
this
.
timeout
)
clearTimeout
(
this
.
timeout
)
},
},
methods
:
{
methods
:
{
send
()
{
send
(
messageType
)
{
if
(
this
.
loading
||
(
this
.
leftTime
>
0
&&
this
.
leftTime
<
60
))
return
false
if
(
this
.
loading
||
(
this
.
leftTime
>
0
&&
this
.
leftTime
<
60
))
return
false
this
.
loading
=
true
this
.
loading
=
true
this
.
form
[
'
messageType
'
]
=
messageType
getCode
(
this
.
form
).
then
(()
=>
{
getCode
(
this
.
form
).
then
(()
=>
{
this
.
$message
({
this
.
$message
({
message
:
this
.
$t
(
'
common.success
'
),
message
:
this
.
$t
(
'
common.success
'
),
...
...
src/views/jiedao/profile/components/Release.vue
View file @
07da486f
...
@@ -120,7 +120,14 @@
...
@@ -120,7 +120,14 @@
auto-complete=
"new-password"
auto-complete=
"new-password"
/>
/>
<!-- <el-button type="success">获取验证码</el-button> -->
<!-- <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>
<el-form-item
v-if=
"!isSuccess&&radio==1"
:label=
"$t('setting.controlPassword')"
prop=
"controlPassword"
>
<el-form-item
v-if=
"!isSuccess&&radio==1"
:label=
"$t('setting.controlPassword')"
prop=
"controlPassword"
>
<el-input
<el-input
...
...
src/views/jiedao/profile/components/SendSmsCode.vue
View file @
07da486f
<
template
>
<
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
>
</
template
>
<
script
>
<
script
>
import
{
sendSmsCode
}
from
'
@/api/order
'
import
{
sendSmsCode
}
from
'
@/api/order
'
export
default
{
export
default
{
props
:
{
props
:
{
orderId
:
[
String
,
Number
],
form
:
Object
scene
:
[
String
,
Number
]
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -30,13 +37,11 @@ export default {
...
@@ -30,13 +37,11 @@ export default {
if
(
this
.
timeout
)
clearTimeout
(
this
.
timeout
)
if
(
this
.
timeout
)
clearTimeout
(
this
.
timeout
)
},
},
methods
:
{
methods
:
{
send
()
{
send
(
messageType
)
{
if
(
this
.
loading
||
(
this
.
leftTime
>
0
&&
this
.
leftTime
<
60
))
return
false
if
(
this
.
loading
||
(
this
.
leftTime
>
0
&&
this
.
leftTime
<
60
))
return
false
this
.
loading
=
true
this
.
loading
=
true
sendSmsCode
({
this
.
form
[
'
messageType
'
]
=
messageType
orderId
:
this
.
orderId
,
sendSmsCode
(
this
.
form
).
then
(
res
=>
{
scene
:
this
.
scene
}).
then
(
res
=>
{
this
.
$message
.
success
(
this
.
$t
(
'
sendSmsCode.success
'
))
this
.
$message
.
success
(
this
.
$t
(
'
sendSmsCode.success
'
))
this
.
countDown
()
this
.
countDown
()
}).
finally
(
res
=>
{
}).
finally
(
res
=>
{
...
...
src/views/jiedao/profile/components/SetControlPassword.vue
View file @
07da486f
<
template
>
<
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-form
ref=
"changePhoneForm"
:model=
"form"
label-width=
"120px"
>
<el-row
:gutter=
"20"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"24"
>
<el-col
:span=
"24"
>
...
@@ -23,7 +23,14 @@
...
@@ -23,7 +23,14 @@
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"6"
>
<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-col>
</el-row>
</el-row>
</el-form>
</el-form>
...
...
src/views/jiedao/profile/components/Transfer.vue
View file @
07da486f
...
@@ -31,7 +31,14 @@
...
@@ -31,7 +31,14 @@
</el-form-item>
</el-form-item>
<el-form-item
v-if=
"radio==0"
:label=
"$t('release.code')"
prop=
"code"
>
<el-form-item
v-if=
"radio==0"
:label=
"$t('release.code')"
prop=
"code"
>
<el-input
v-model.number=
"form.code"
type=
"number"
>
<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-input></el-form-item>
<el-form-item
v-if=
"radio==1"
:label=
"$t('setting.controlPassword')"
prop=
"controlPassword"
>
<el-form-item
v-if=
"radio==1"
:label=
"$t('setting.controlPassword')"
prop=
"controlPassword"
>
<el-input
<el-input
...
...
src/views/jiedao/profile/setting.vue
View file @
07da486f
...
@@ -1245,13 +1245,14 @@
...
@@ -1245,13 +1245,14 @@
</el-col>
</el-col>
<el-col
:span=
"6"
>
<el-col
:span=
"6"
>
<!--
<el-button
type=
"primary"
@
click=
"changePhoneCode"
>
{{
$t
(
'
setting.getCode
'
)
}}
</el-button>
-->
<!--
<el-button
type=
"primary"
@
click=
"changePhoneCode"
>
{{
$t
(
'
setting.getCode
'
)
}}
</el-button>
-->
<jd-send-code
<jd-send-code
:form=
"
{
:form=
"
{
mobile: changePhoneForm.mobile,
mobile: changePhoneForm.mobile,
scene: 2,
nodeValue: 'user-sms-update-mobile',
areaCode: changePhoneForm.areaCode,
isTransport: 0,
}"
transportId: 0,
/>
isOrders: 0,
areaCode: changePhoneForm.areaCode
}" />
</el-col>
</el-col>
</el-row>
</el-row>
</el-form>
</el-form>
...
...
src/views/login/components/mobileLogin.vue
View file @
07da486f
...
@@ -49,14 +49,15 @@
...
@@ -49,14 +49,15 @@
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"8"
>
<el-col
:span=
"8"
>
<el-button
<el-dropdown
@
command=
"getValidaCode"
:disabled=
"disabled"
>
:loading=
"loading"
<el-button
type=
"primary"
>
type=
"primary"
{{
getCode
}}
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
:disabled=
"disabled"
</el-button>
round
<el-dropdown-menu
slot=
"dropdown"
>
@
click.native.prevent=
"getValidaCode"
<el-dropdown-item
command=
"1"
>
SMS
</el-dropdown-item>
>
{{
getCode
}}
</el-button
<el-dropdown-item
command=
"2"
>
WhatsApp
</el-dropdown-item>
>
</el-dropdown-menu>
</el-dropdown>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -140,12 +141,16 @@ export default {
...
@@ -140,12 +141,16 @@ export default {
// window.removeEventListener('storage', this.afterQRScan)
// window.removeEventListener('storage', this.afterQRScan)
},
},
methods
:
{
methods
:
{
getValidaCode
()
{
getValidaCode
(
messageType
)
{
var
data
=
{
var
data
=
{
mobile
:
this
.
loginForm
.
mobile
,
mobile
:
this
.
loginForm
.
mobile
,
scene
:
1
,
nodeValue
:
'
user-sms-reg
'
,
areaCode
:
this
.
loginForm
.
areaCode
,
areaCode
:
this
.
loginForm
.
areaCode
,
};
isTransport
:
0
,
transportId
:
0
,
isOrders
:
0
,
messageType
:
messageType
}
getCode
(
data
).
then
(()
=>
{
getCode
(
data
).
then
(()
=>
{
var
countDown
=
window
.
setInterval
(()
=>
{
var
countDown
=
window
.
setInterval
(()
=>
{
if
(
this
.
count
<
1
)
{
if
(
this
.
count
<
1
)
{
...
...
src/views/registered/index.vue
View file @
07da486f
...
@@ -202,13 +202,15 @@
...
@@ -202,13 +202,15 @@
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"8"
>
<el-col
:span=
"8"
>
<el-button
<el-dropdown
@
command=
"getValidaCode"
:disabled=
"disabled"
>
:loading=
"loading"
<el-button
type=
"primary"
>
type=
"primary"
{{
getCode
}}
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
style=
"width: 100%; margin-bottom: 30px"
</el-button>
:disabled=
"disabled"
<el-dropdown-menu
slot=
"dropdown"
>
@
click.native.prevent=
"getValidaCode"
<el-dropdown-item
command=
"1"
>
SMS
</el-dropdown-item>
>
{{
getCode
}}
</el-button>
<el-dropdown-item
command=
"2"
>
WhatsApp
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-col>
</el-col>
</el-row>
</el-row>
<el-form-item
prop=
"password"
:label=
"$t('registered.password')"
>
<el-form-item
prop=
"password"
:label=
"$t('registered.password')"
>
...
@@ -384,11 +386,15 @@ export default {
...
@@ -384,11 +386,15 @@ export default {
this
.
$i18n
.
locale
=
lang
this
.
$i18n
.
locale
=
lang
this
.
$store
.
dispatch
(
'
app/setLanguage
'
,
lang
)
this
.
$store
.
dispatch
(
'
app/setLanguage
'
,
lang
)
},
},
getValidaCode
()
{
getValidaCode
(
messageType
)
{
var
data
=
{
var
data
=
{
mobile
:
this
.
registeredForm
.
mobile
,
mobile
:
this
.
registeredForm
.
mobile
,
scene
:
0
,
nodeValue
:
'
user-sms-reg
'
,
areaCode
:
this
.
registeredForm
.
areaCode
areaCode
:
this
.
registeredForm
.
areaCode
,
isTransport
:
0
,
transportId
:
0
,
isOrders
:
0
,
messageType
:
messageType
}
}
getCode
(
data
).
then
(()
=>
{
getCode
(
data
).
then
(()
=>
{
var
countDown
=
window
.
setInterval
(()
=>
{
var
countDown
=
window
.
setInterval
(()
=>
{
...
...
src/views/registered/resetpwd.vue
View file @
07da486f
...
@@ -110,13 +110,15 @@
...
@@ -110,13 +110,15 @@
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"8"
>
<el-col
:span=
"8"
>
<el-button
<el-dropdown
@
command=
"getValidaCode"
:disabled=
"disabled"
>
:loading=
"loading"
<el-button
type=
"primary"
>
type=
"primary"
{{
getCode
}}
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
style=
"width:100%;margin-bottom:30px;"
</el-button>
:disabled=
"disabled"
<el-dropdown-menu
slot=
"dropdown"
>
@
click.native.prevent=
"getValidaCode"
<el-dropdown-item
command=
"1"
>
SMS
</el-dropdown-item>
>
{{
getCode
}}
</el-button>
<el-dropdown-item
command=
"2"
>
WhatsApp
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-col>
</el-col>
</el-row>
</el-row>
<el-form-item
prop=
"password"
:label=
"$t('registered.password')"
>
<el-form-item
prop=
"password"
:label=
"$t('registered.password')"
>
...
@@ -228,8 +230,16 @@ export default {
...
@@ -228,8 +230,16 @@ export default {
this
.
$i18n
.
locale
=
lang
this
.
$i18n
.
locale
=
lang
this
.
$store
.
dispatch
(
'
app/setLanguage
'
,
lang
)
this
.
$store
.
dispatch
(
'
app/setLanguage
'
,
lang
)
},
},
getValidaCode
()
{
getValidaCode
(
messageType
)
{
var
data
=
{
mobile
:
this
.
registeredForm
.
mobile
,
scene
:
3
,
areaCode
:
this
.
registeredForm
.
areaCode
}
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
(()
=>
{
getCode
(
data
).
then
(()
=>
{
var
countDown
=
window
.
setInterval
(()
=>
{
var
countDown
=
window
.
setInterval
(()
=>
{
if
(
this
.
count
<
1
)
{
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