Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f8723115
authored
Mar 06, 2023
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复重复点击的问题
1 parent
7ebee955
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
src/components/baseDialog/index.vue
src/views/purchase/components/shoppingCartCom.vue
src/components/baseDialog/index.vue
View file @
f872311
...
@@ -16,6 +16,26 @@
...
@@ -16,6 +16,26 @@
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'BaseDialog'
,
name
:
'BaseDialog'
,
directives
:
{
// 函数节流 监控输入框 提高性能
throttle
:
{
// 指令的定义
inserted
:
function
(
el
,
obj
)
{
let
timerId
=
null
let
flag
=
true
el
.
addEventListener
(
'click'
,
function
()
{
if
(
!
flag
)
return
flag
=
false
timerId
&&
clearTimeout
(
timerId
)
timerId
=
setTimeout
(
function
()
{
flag
=
true
// 调用绑定在v-throttle上的方法search
obj
.
value
()
},
1000
)
})
}
}
},
props
:
{
props
:
{
dialogConfig
:
{
dialogConfig
:
{
required
:
false
,
required
:
false
,
...
...
src/views/purchase/components/shoppingCartCom.vue
View file @
f872311
...
@@ -92,6 +92,7 @@ export default {
...
@@ -92,6 +92,7 @@ export default {
data
()
{
data
()
{
return
{
return
{
// addressInfo:
{
}
,
// addressInfo:
{
}
,
throttleSubmit
:
false
,
membraneTypeList
,
membraneTypeList
,
drawer
:
false
,
drawer
:
false
,
dialogShow
:
false
,
dialogShow
:
false
,
...
@@ -192,9 +193,13 @@ export default {
...
@@ -192,9 +193,13 @@ export default {
}
else
{
}
else
{
this
.
selectList
=
selectList
this
.
selectList
=
selectList
this
.
dialogShow
=
true
this
.
dialogShow
=
true
this
.
throttleSubmit
=
false
}
}
}
,
}
,
handleSubmit
()
{
handleSubmit
()
{
if
(
this
.
throttleSubmit
)
return
console
.
log
(
this
.
throttleSubmit
)
console
.
log
(
'submit'
)
const
{
contactAddress
,
contactName
,
contactPhone
}
=
this
.
addressInfo
const
{
contactAddress
,
contactName
,
contactPhone
}
=
this
.
addressInfo
const
params
=
{
const
params
=
{
orderDelivery
:
{
orderDelivery
:
{
...
@@ -204,11 +209,15 @@ export default {
...
@@ -204,11 +209,15 @@ export default {
}
}
// console.log(params)
// console.log(params)
// return
// return
this
.
throttleSubmit
=
true
purchaseOrderAdd
(
params
).
then
((
result
)
=>
{
purchaseOrderAdd
(
params
).
then
((
result
)
=>
{
this
.
$message
.
success
(
'提交成功'
)
this
.
getGoodsList
()
this
.
drawer
=
false
this
.
drawer
=
false
this
.
dialogShow
=
false
this
.
dialogShow
=
false
this
.
$message
.
success
(
'提交成功'
)
this
.
getGoodsList
()
// this.$nextTick(() =>
{
// this.throttleSubmit = false
//
}
,
1000
)
}
)
}
)
// purchaseOrderAdd
// purchaseOrderAdd
// this.getGoodsList()
// this.getGoodsList()
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment