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 cf860148
authored
Jun 29, 2022
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:验证码组件开发
1 parent
5e662259
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
151 additions
and
6 deletions
package.json
src/api/finance.js
src/views/financeManage/components/captchaInput.vue
src/views/financeManage/financeList.vue
src/views/financeManage/serviceFinanceList.vue
yarn.lock
package.json
View file @
cf86014
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
"js-md5"
:
"^0.7.3"
,
"js-md5"
:
"^0.7.3"
,
"lodash"
:
"^4.17.11"
,
"lodash"
:
"^4.17.11"
,
"lowdb"
:
"^1.0.0"
,
"lowdb"
:
"^1.0.0"
,
"moment"
:
"^2.29.
1
"
,
"moment"
:
"^2.29.
3
"
,
"nprogress"
:
"^0.2.0"
,
"nprogress"
:
"^0.2.0"
,
"qs"
:
"^6.8.0"
,
"qs"
:
"^6.8.0"
,
"screenfull"
:
"^4.2.0"
,
"screenfull"
:
"^4.2.0"
,
...
...
src/api/finance.js
View file @
cf86014
...
@@ -37,6 +37,7 @@ export function getServicerefApi(data) {
...
@@ -37,6 +37,7 @@ export function getServicerefApi(data) {
return
request
(
data
)
return
request
(
data
)
}
}
/** 服务商查询 */
export
function
getServiceListApi
(
data
)
{
export
function
getServiceListApi
(
data
)
{
data
.
method
=
`
${
path2
}
goodsOrderProfitAllocation.page.bySubOrder`
data
.
method
=
`
${
path2
}
goodsOrderProfitAllocation.page.bySubOrder`
return
request
(
data
)
return
request
(
data
)
...
...
src/views/financeManage/components/captchaInput.vue
0 → 100644
View file @
cf86014
<
template
>
<div
class=
"row-center captcha_input_wrapper"
>
<input
v-for=
"(item,index) in captchas"
:key=
"index"
v-model=
"item.num"
:id=
"'captcha'+index"
@
input=
"inputFinash(index)"
@
focus=
"adjust(index)"
@
keydown=
"inputDirection(index)"
class=
"captcha_input_box row-center"
:style=
"customStyle"
type=
"tel"
maxlength=
"1"
/>
</div>
</
template
>
<
script
>
export
default
{
props
:
{
customStyle
:
{
type
:
String
,
required
:
false
,
default
:
''
},
Number
:
{
type
:
Number
,
required
:
false
,
default
:
4
},
captchaList
:
{
type
:
Object
,
required
:
true
}
},
data
()
{
return
{
// 当前输入框
activeInput
:
0
,
item
:
{
num
:
''
},
captchas
:
[
{
num
:
''
},
{
num
:
''
},
{
num
:
''
},
{
num
:
''
},
{
num
:
''
},
{
num
:
''
}
]
}
},
watch
:
{
'captchas'
:
{
handler
:
function
(
value
)
{
console
.
log
(
value
)
this
.
$emit
(
'update:captchaList'
,
value
)
},
deep
:
true
}
},
computed
:
{
test
()
{
return
new
Array
(
this
.
Number
)
// return list.map((item) => {
// item = this.item
// return item
// })
}
},
methods
:
{
// 自动校准输入顺序
adjust
(
index
)
{
const
dom
=
document
.
getElementById
(
'captcha'
+
this
.
activeInput
)
if
(
index
!==
this
.
activeInput
&&
dom
)
{
dom
.
focus
()
}
},
// 控制前后方向
inputDirection
(
index
)
{
const
val
=
this
.
captchas
[
index
].
num
// debugger
console
.
log
(
event
.
keyCode
)
// 回退键处理
if
(
event
.
keyCode
==
8
&&
val
==
''
)
{
console
.
log
(
index
)
// 重新校准
const
dom
=
document
.
getElementById
(
'captcha'
+
(
index
-
1
))
this
.
activeInput
=
index
==
0
?
0
:
index
-
1
if
(
dom
)
dom
.
focus
()
}
if
(
event
.
keyCode
!=
8
&&
val
!=
''
)
{
const
dom
=
document
.
getElementById
(
'captcha'
+
(
index
+
1
))
this
.
activeInput
=
index
+
1
if
(
dom
)
dom
.
focus
()
}
},
// 输入框相互联动
inputFinash
(
index
)
{
const
val
=
this
.
captchas
[
index
].
num
this
.
activeInput
=
val
?
index
+
1
:
index
-
1
const
dom
=
document
.
getElementById
(
'captcha'
+
this
.
activeInput
)
if
(
dom
)
dom
.
focus
()
if
(
index
==
this
.
captchas
.
length
-
1
)
{
const
code
=
this
.
captchas
.
map
((
x
)
=>
x
.
num
).
join
(
''
)
if
(
code
.
length
==
6
)
{
this
.
$emit
(
'finish'
,
code
)
}
}
}
}
}
</
script
>
<
style
lang=
'scss'
>
.row-center
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
center
;
align-items
:
center
;
}
.captcha_input_wrapper
{
width
:
100%
;
}
.captcha_input_box
{
width
:
48px
;
height
:
60px
;
margin-right
:
12px
;
background
:
rgba
(
255
,
255
,
255
,
1
);
border-radius
:
6px
;
border
:
1px
solid
#dddddd
;
font-size
:
40px
;
text-align
:
center
;
color
:
#1e243a
;
}
</
style
>
src/views/financeManage/financeList.vue
View file @
cf86014
...
@@ -406,6 +406,13 @@
...
@@ -406,6 +406,13 @@
<download-account-dialog
:accountVisible=
"accountVisible"
<download-account-dialog
:accountVisible=
"accountVisible"
v-if=
"accountVisible"
v-if=
"accountVisible"
@
accountClose=
"accountClose"
></download-account-dialog>
@
accountClose=
"accountClose"
></download-account-dialog>
<!-- <el-drawer
title="我是标题"
:visible.sync="drawer"
:direction="direction"
:before-close="handleClose">
<span>我来啦!</span>
</el-drawer> -->
</div>
</div>
</template>
</template>
...
...
src/views/financeManage/serviceFinanceList.vue
View file @
cf86014
<!-- 服务商 = 财务列表 -->
<!-- 服务商 = 财务列表 -->
<
template
>
<
template
>
<div
class=
"service_finance_list"
>
<div
class=
"service_finance_list"
>
<captchaInput
captchaList
.
sync=
"captchaList"
></captchaInput>
<div
v-show=
"!isSingle"
<div
v-show=
"!isSingle"
class=
"header"
class=
"header"
slot=
"header"
slot=
"header"
...
@@ -261,6 +262,7 @@
...
@@ -261,6 +262,7 @@
<
script
>
<
script
>
import
moment
from
'moment'
import
moment
from
'moment'
import
serviceDetailDialog
from
'./serviceDetailDialog'
import
serviceDetailDialog
from
'./serviceDetailDialog'
import
captchaInput
from
'./components/captchaInput'
import
{
getServiceListApi
,
exportFile
,
getListTotal
,
getServicerefApi
,
getServiceSummaryApi
}
from
'@api/finance'
import
{
getServiceListApi
,
exportFile
,
getListTotal
,
getServicerefApi
,
getServiceSummaryApi
}
from
'@api/finance'
import
{
getPartnerYqListApi
}
from
'@/api/account'
import
{
getPartnerYqListApi
}
from
'@/api/account'
import
{
getServiceStore
}
from
'@api/editCustomer'
import
{
getServiceStore
}
from
'@api/editCustomer'
...
@@ -271,6 +273,7 @@ export default {
...
@@ -271,6 +273,7 @@ export default {
name
:
'serviceFinanceList'
,
name
:
'serviceFinanceList'
,
data
()
{
data
()
{
return
{
return
{
captchaList
:
[{
num
:
''
},
{
num
:
''
},
{
num
:
''
},
{
num
:
''
}],
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
// 单店或多店
// 单店或多店
isSingle
:
true
,
isSingle
:
true
,
...
@@ -429,7 +432,8 @@ export default {
...
@@ -429,7 +432,8 @@ export default {
},
},
components
:
{
components
:
{
serviceDetailDialog
serviceDetailDialog
,
captchaInput
},
},
mounted
()
{
mounted
()
{
...
...
yarn.lock
View file @
cf86014
...
@@ -6657,10 +6657,10 @@ mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1:
...
@@ -6657,10 +6657,10 @@ mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1:
dependencies:
dependencies:
minimist "0.0.8"
minimist "0.0.8"
moment@^2.29.
1
:
moment@^2.29.
3
:
version "2.29.
1
"
version "2.29.
3
"
resolved "https://registry.npm
js.org/moment/-/moment-2.29.1.tgz
"
resolved "https://registry.npm
mirror.com/moment/-/moment-2.29.3.tgz#edd47411c322413999f7a5940d526de183c031f3
"
integrity sha512-
kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ
==
integrity sha512-
c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw
==
move-concurrently@^1.0.1:
move-concurrently@^1.0.1:
version "1.0.1"
version "1.0.1"
...
...
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