Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
gl_tape
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
3
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 40a184bf
authored
Jun 25, 2024
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit 接待记录区分延保、轻改样式
1 parent
27caa73f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
316 additions
and
122 deletions
components/HomeFrame/components/RecordList.vue
components/HomeFrame/index.vue
components/HomeFrame/components/RecordList.vue
View file @
40a184b
<
template
>
<view
class=
"record-box"
>
<view
class=
"record-content"
>
<view
class=
"data-box"
>
<template
v-for=
"(i, index) in dataList"
>
<view
:class=
"['data-item', i.type]"
:key=
"index"
>
<image
:src=
"i.icon"
class=
"data-item-bg"
/>
<view
class=
"title"
>
{{
dateList
[
index
].
text
}}
</view>
<view
class=
"content"
>
<view
class=
"total"
>
<view
class=
"label"
>
{{
i
.
label
}}
</view>
<view
class=
"num-box"
>
<view
class=
"num"
>
{{
i
.
count
==
null
?
"-"
:
i
.
count
}}
</view>
</view>
</view>
<view
class=
"duration"
>
<view
class=
"label"
>
平均接待时长
</view>
<view
class=
"num-box"
>
<view
class=
"num"
>
{{
i
.
minutes
||
"-"
}}
</view>
<view
class=
"unit"
>
分
</view>
<view
class=
"num"
>
{{
i
.
seconds
||
"-"
}}
</view>
<view
class=
"unit"
>
秒
</view>
</view>
</view>
</view>
</view>
</
template
>
</view>
<view
class=
"data-container"
>
<view
:class=
"['type-box']"
>
<view
class=
"tab-item"
v-for=
"(i, index) in typeList"
:key=
"index"
@
click=
"changeType(index, 'firstIndex')"
>
<view
class=
"sprite-icon"
:class=
"[
firstIndex == index ? `icon-${firstClass[index]} active` : '',
]"
:style=
"{ left: firstLeft[index] }"
></view>
<view
class=
"text"
:class=
"[firstIndex == index ? `active` : '']"
>
{{ i.tabName
}}{{
i.num
&&
recordFailList.length > 0
? `(${recordFailList.length})`
: ""
}}
</view
>
</view>
</view>
<view
class=
"tabs-bottom"
></view>
<view
v-if=
"firstIndex == 0"
class=
"data-tabs-box"
>
<view
class=
"data-tabs"
>
<
template
v-for=
"(i, index) in dateList"
>
<view>
<!-- sceneType 1 轻改 0 延保 -->
<template
v-if=
"userInfo.sceneType == 1"
>
<scroll-view
class=
"record-box boutique"
scroll-y
@
scrolltolower=
"pageonReachBottom"
@
scroll=
"scroll"
>
<view
class=
"record-content"
>
<view
class=
"data-box"
>
<template
v-for=
"(i, index) in dataList"
>
<view
:class=
"['
tab flex',
{ active: dateIndex == index }
]"
:class=
"['
data-item', i.type
]"
:key=
"index"
@click="changeIndex(index)"
>
{{
i
.
text
}}
</view
>
<image
:src=
"i.icon"
class=
"data-item-bg"
/>
<view
class=
"title"
>
{{
dateList
[
index
].
text
}}
</view>
<view
class=
"content"
>
<view
class=
"total"
>
<view
class=
"label"
>
{{
i
.
label
}}
</view>
<view
class=
"num-box"
>
<view
class=
"num"
>
{{
i
.
count
==
null
?
"-"
:
i
.
count
}}
</view>
</view>
</view>
<view
class=
"duration"
>
<view
class=
"label"
>
平均接待时长
</view>
<view
class=
"num-box"
>
<view
class=
"num"
>
{{
i
.
minutes
||
"-"
}}
</view>
<view
class=
"unit"
>
分
</view>
<view
class=
"num"
>
{{
i
.
seconds
||
"-"
}}
</view>
<view
class=
"unit"
>
秒
</view>
</view>
</view>
</view>
</view>
</
template
>
<view
:class=
"['active-btn', `active-btn-${dateIndex}`]"
></view>
</view>
</view>
<scroll-view
class=
"record-list"
:style=
"{
height:
firstIndex == 0 ? 'calc(100% - 300rpx)' : 'calc(100% - 180rpx)',
}"
scroll-y
@
scrolltolower=
"pageonReachBottom"
@
scroll=
"scroll"
>
<view
:class=
"['data-tabs-box', { sticky: sticky }]"
>
<view
class=
"data-tabs"
>
<
template
v-for=
"(i, index) in dateList"
>
<view
:class=
"['tab flex',
{ active: dateIndex == index }]"
:key="index"
@click="changeIndex(index)"
>
{{
i
.
text
}}
</view>
</
template
>
<view
:class=
"['active-btn', `active-btn-${dateIndex}`]"
></view>
</view>
</view>
<view
class=
"list"
>
<
template
v-if=
"flag"
>
<template
v-if=
"list.length && list[0] && list[0].length"
>
<template
v-for=
"i in list"
>
<template
v-for=
"item in i"
>
<view
class=
"item"
:key=
"item.id"
>
<view
:class=
"[
'status flex',
{ deal: item.receptionStatus == 1 },
]"
>
{{
{
1
:
"成交"
,
0
:
"战败
"
,
}
[
item
.
receptionStatus
]
}}
<
/vie
w
>
<view
class=
"item"
:key=
"item.id"
>
<view
:class=
"[
'status flex',
{ deal: item.receptionStatus == 1 },
]">
{
{
{
1
:
"成交
"
,
0
:
"战败"
,
}
[
item
.
receptionStatus
]
}}
<
/view
>
<
view
class
=
"name"
>
{{
item
.
customerName
}}
<
/view
>
<
view
class
=
"goods-name"
>
{{
item
.
carModel
}}
<
/view
>
<
template
v
-
for
=
"(k, ind) in itemObject"
>
<
view
class
=
"info flex"
:
key
=
"ind"
>
<
view
class
=
"info flex"
:
key
=
"ind"
>
<
view
class
=
"label"
>
{{
k
.
label
}}
<
/view
>
<
view
class
=
"value"
>
{{
item
[
k
.
key
]
||
"-"
}}
<
/view
>
<
/view
>
...
...
@@ -121,10 +101,151 @@
<
template
v
-
if
=
"nothing"
>
<
view
class
=
"end-text"
>
到底了!
<
/view
>
<
/template
>
<
/scroll-view
>
<
/view
>
<
view
class
=
"bottom-mask"
><
/view
>
<
/scroll-view
>
<
/template
>
<
template
v
-
else
>
<
view
class
=
"record-box"
>
<
view
class
=
"record-content"
>
<
view
class
=
"data-box"
>
<
template
v
-
for
=
"(i, index) in dataList"
>
<
view
:
class
=
"['data-item', i.type]"
:
key
=
"index"
>
<
image
:
src
=
"i.icon"
class
=
"data-item-bg"
/>
<
view
class
=
"title"
>
{{
dateList
[
index
].
text
}}
<
/view
>
<
view
class
=
"content"
>
<
view
class
=
"total"
>
<
view
class
=
"label"
>
{{
i
.
label
}}
<
/view
>
<
view
class
=
"num-box"
>
<
view
class
=
"num"
>
{{
i
.
count
==
null
?
"-"
:
i
.
count
}}
<
/view
>
<
/view
>
<
/view
>
<
view
class
=
"duration"
>
<
view
class
=
"label"
>
平均接待时长
<
/view
>
<
view
class
=
"num-box"
>
<
view
class
=
"num"
>
{{
i
.
minutes
||
"-"
}}
<
/view
>
<
view
class
=
"unit"
>
分
<
/view
>
<
view
class
=
"num"
>
{{
i
.
seconds
||
"-"
}}
<
/view
>
<
view
class
=
"unit"
>
秒
<
/view
>
<
/view
>
<
/view
>
<
/view
>
<
/view
>
<
/template
>
<
/view
>
<
view
class
=
"data-container"
>
<
view
:
class
=
"['type-box']"
>
<
view
class
=
"tab-item"
v
-
for
=
"(i, index) in typeList"
:
key
=
"index"
@
click
=
"changeType(index, 'firstIndex')"
>
<
view
class
=
"sprite-icon"
:
class
=
"
[
firstIndex
==
index
?
`icon-${firstClass[index]
}
active`
:
''
,
]
"
:style="
{
left
:
firstLeft
[
index
]
}
"
></view>
<view
class="
text
"
:class="
[
firstIndex
==
index
?
`active`
:
''
]
"
>
{{
i
.
tabName
}}
{{
i
.
num
&&
recordFailList
.
length
>
0
?
`(${recordFailList.length
}
)`
:
""
}}
<
/view
>
<
/view
>
<
/view
>
<
view
class
=
"tabs-bottom"
><
/view
>
<
view
v
-
if
=
"firstIndex == 0"
class
=
"data-tabs-box"
>
<
view
class
=
"data-tabs"
>
<
template
v
-
for
=
"(i, index) in dateList"
>
<
view
:
class
=
"
[
'tab flex'
,
{
active
:
dateIndex
==
index
}
]
"
:key="
index
"
@click="
changeIndex
(
index
)
"
>
{{
i
.
text
}}
<
/view
>
<
/template
>
<
view
:
class
=
"
[
'active-btn'
,
`active-btn-${dateIndex
}
`
]
"></view>
</view>
</view>
<scroll-view
class="
record
-
list
"
:style="
{
height
:
firstIndex
==
0
?
'calc(100% - 300rpx)'
:
'calc(100% - 180rpx)'
,
}
"
scroll-y
@scrolltolower="
pageonReachBottom
"
@scroll="
scroll
"
>
<view class="
list
">
<template v-if="
flag
">
<template v-if="
list
.
length
&&
list
[
0
]
&&
list
[
0
].
length
">
<template v-for="
i
in
list
">
<template v-for="
item
in
i
">
<view
class="
item
"
:key="
item
.
id
"
>
<view :class="
[
'status flex'
,
{
deal
:
item
.
receptionStatus
==
1
}
,
]
"
>
{{
{
1
:
"成交"
,
0
:
"战败"
,
}
[
item
.
receptionStatus
]
}}
<
/view
>
<
view
class
=
"name"
>
{{
item
.
customerName
}}
<
/view
>
<
view
class
=
"goods-name"
>
{{
item
.
carModel
}}
<
/view
>
<
template
v
-
for
=
"(k, ind) in itemObject"
>
<
view
class
=
"info flex"
:
key
=
"ind"
>
<
view
class
=
"label"
>
{{
k
.
label
}}
<
/view
>
<
view
class
=
"value"
>
{{
item
[
k
.
key
]
||
"-"
}}
<
/view
>
<
/view
>
<
/template
>
<
/view
>
<
/template
>
<
/template
>
<
/template
>
<
template
v
-
else
>
<
view
class
=
"nothing flex"
>
<
image
class
=
"icon"
src
=
"../../../assets/images/home/nothing.webp"
/>
暂无接待记录
<
/view
>
<
/template
>
<
/template
>
<
/view
>
<
template
v
-
if
=
"nothing"
>
<
view
class
=
"end-text"
>
到底了!
<
/view
>
<
/template
>
<
/scroll-view
>
<
/view
>
<
view
class
=
"bottom-mask"
><
/view
>
<
/view
>
<
/view
>
<
view
class
=
"bottom-mask"
><
/view
>
<
/view
>
<
/template
>
<
/view
>
<
/template
>
<
script
type
=
"text/ecmascript-6"
>
...
...
@@ -132,15 +253,16 @@ import dayjs from 'dayjs'
const
dayImgUrl
=
require
(
'@/assets/images/common/day.webp'
)
const
weekImgUrl
=
require
(
'@/assets/images/common/week.webp'
)
const
monthImgUrl
=
require
(
'@/assets/images/common/month.webp'
)
import
utils
from
"@/utils/utils.js"
;
export
default
{
name
:
''
,
props
:{
userInfo
:
{
type
:
Object
,
default
:
()
=>
({
}
)
}
,
}
,
data
()
{
return
{
sexType
:
{
'男'
:
'icon-male'
,
'女'
:
'icon-female'
}
,
dataList
:
[
{
label
:
'客户接待数'
,
...
...
@@ -160,7 +282,7 @@ export default {
],
typeList
:
[
{
tabName
:
'已上传'
}
,
{
tabName
:
'待上传'
,
num
:
true
}
,
{
tabName
:
'待上传'
,
num
:
true
}
,
],
firstIndex
:
0
,
firstLeft
:
[
'0rpx'
,
'352rpx'
,
'756rpx'
],
...
...
@@ -177,7 +299,7 @@ export default {
{
label
:
'开始接待'
,
key
:
'startTime'
}
,
{
label
:
'结束接待'
,
key
:
'endTime'
}
,
],
recordFailList
:[],
recordFailList
:
[],
dateIndex
:
0
,
pageNum
:
1
,
total
:
0
,
...
...
@@ -203,38 +325,38 @@ export default {
this
.
direction
=
'left'
}
this
[
name
]
=
index
this
.
list
=
[]
this
.
list
=
[]
this
.
pageNum
=
1
;
if
(
index
==
0
)
{
this
.
changeIndex
(
this
.
dateIndex
,
true
)
}
else
{
if
(
index
==
0
)
{
this
.
changeIndex
(
this
.
dateIndex
,
true
)
}
else
{
this
.
getRecordFail
()
}
}
,
scroll
(
e
)
{
this
.
sticky
=
e
.
detail
.
scrollTop
>=
148
}
,
getRecordNum
()
{
getRecordNum
()
{
let
recordFailListAll
=
JSON
.
parse
(
uni
.
$storage
.
get
(
"recordList"
)
||
"[]"
);
const
{
shopMerchantId
,
sceneType
}
=
uni
.
$storage
.
get
(
"userInfo"
);
let
recordFailList
=
recordFailListAll
.
filter
(
i
=>
{
console
.
log
(
i
.
bussinessType
,
sceneType
)
const
{
shopMerchantId
,
sceneType
}
=
this
.
userInfo
let
recordFailList
=
recordFailListAll
.
filter
(
i
=>
{
console
.
log
(
i
.
bussinessType
,
sceneType
)
return
i
.
merchantId
==
shopMerchantId
&&
i
.
bussinessType
==
(
sceneType
==
0
?
1
:
2
)
}
)
this
.
recordFailList
=
recordFailList
}
,
getRecordFail
()
{
getRecordFail
()
{
this
.
getRecordNum
()
this
.
list
[
0
]
=
this
.
recordFailList
.
map
(
i
=>
{
this
.
list
[
0
]
=
this
.
recordFailList
.
map
(
i
=>
{
return
{
receptionStatus
:
i
.
receptionStatus
,
phoneNumber
:
i
.
phoneNumber
,
salesName
:
i
.
salesName
,
customerName
:
i
.
customerName
,
carModel
:
i
.
carModel
,
duration
:
this
.
formatSeconds
(
new
Date
(
i
.
receptionEndTime
).
getTime
()
-
new
Date
(
i
.
receptionStartTime
).
getTime
()),
startTime
:
i
.
receptionStartTime
.
replace
(
/
\/
/g
,
'.'
),
endTime
:
i
.
receptionEndTime
.
replace
(
/
\/
/g
,
'.'
)
receptionStatus
:
i
.
receptionStatus
,
phoneNumber
:
i
.
phoneNumber
,
salesName
:
i
.
salesName
,
customerName
:
i
.
customerName
,
carModel
:
i
.
carModel
,
duration
:
this
.
formatSeconds
(
new
Date
(
i
.
receptionEndTime
).
getTime
()
-
new
Date
(
i
.
receptionStartTime
).
getTime
()),
startTime
:
i
.
receptionStartTime
.
replace
(
/
\/
/g
,
'.'
),
endTime
:
i
.
receptionEndTime
.
replace
(
/
\/
/g
,
'.'
)
}
}
)
}
,
...
...
@@ -256,8 +378,7 @@ export default {
try
{
const
{
dateList
}
=
this
,
{
startTime
,
endTime
}
=
dateList
[
index
],
userInfo
=
uni
.
$storage
.
get
(
"userInfo"
),
{
shopMerchantId
,
sceneType
}
=
userInfo
,
{
shopMerchantId
,
sceneType
}
=
this
.
userInfo
,
data
=
await
uni
.
$api
.
commonApi
.
getReceptionStatistics
({
merchantId
:
shopMerchantId
,
startTime
,
...
...
@@ -281,8 +402,7 @@ export default {
}
)
const
{
dateList
,
dateIndex
,
pageNum
,
pageSize
}
=
this
,
{
startTime
,
endTime
}
=
dateList
[
dateIndex
],
userInfo
=
uni
.
$storage
.
get
(
"userInfo"
),
{
shopMerchantId
,
sceneType
}
=
userInfo
,
{
shopMerchantId
,
sceneType
}
=
this
.
userInfo
,
{
list
,
total
}
=
await
uni
.
$api
.
commonApi
.
getReceptionList
({
merchantId
:
shopMerchantId
,
pageNum
,
...
...
@@ -299,7 +419,7 @@ export default {
e
.
endTime
=
dayjs
(
e
.
receptionEndTime
).
format
(
"YYYY.MM.DD HH:mm:ss"
)
e
.
phoneNumber
=
phoneNumber
.
slice
(
0
,
3
)
+
" "
+
phoneNumber
.
slice
(
3
,
7
)
+
" "
+
phoneNumber
.
slice
(
7
)
}
)
this
.
$set
(
this
.
list
,
pageNum
-
1
,
list
)
this
.
$set
(
this
.
list
,
pageNum
-
1
,
list
)
// this.list[pageNum - 1] = list
console
.
log
(
this
.
list
)
this
.
flag
=
true
...
...
@@ -331,7 +451,7 @@ export default {
return
formattedTime
}
}
,
changeIndex
(
index
,
isType
=
false
)
{
changeIndex
(
index
,
isType
=
false
)
{
if
(
this
.
dateIndex
==
index
&&
!
isType
)
return
this
.
flag
=
false
this
.
nothing
=
false
...
...
@@ -391,6 +511,7 @@ export default {
border
-
radius
:
48
rpx
;
margin
-
top
:
48
rpx
;
height
:
calc
(
100
vh
-
440
rpx
);
margin
-
right
:
66
rpx
;
.
type
-
box
{
position
:
relative
;
display
:
flex
;
...
...
@@ -441,8 +562,8 @@ export default {
.
list
{
display
:
flex
;
flex
-
wrap
:
wrap
;
gap
:
4
8
rpx
60
rpx
;
padding
:
0
rpx
64
rpx
20
rpx
;
gap
:
4
0
rpx
44
rpx
;
padding
:
0
rpx
0
20
rpx
64
rpx
;
.
item
{
width
:
608
rpx
;
background
:
#
ffffff
;
...
...
@@ -688,4 +809,77 @@ export default {
#
e9f1fe
100
%
);
}
.
boutique
{
height
:
100
vh
;
.
list
{
display
:
flex
;
flex
-
wrap
:
wrap
;
gap
:
48
rpx
60
rpx
;
padding
:
48
rpx
0
0
0
;
.
item
{
width
:
640
rpx
;
background
:
#
ffffff
;
border
-
radius
:
16
rpx
;
box
-
sizing
:
border
-
box
;
padding
:
24
rpx
32
rpx
;
position
:
relative
;
}
}
.
data
-
tabs
-
box
{
width
:
calc
(
100
%
+
120
rpx
);
transform
:
translateX
(
-
60
rpx
);
padding
-
top
:
80
rpx
;
.
data
-
tabs
{
display
:
flex
;
justify
-
content
:
space
-
between
;
width
:
784
rpx
;
height
:
70
rpx
;
border
-
radius
:
370
rpx
;
margin
:
0
auto
;
position
:
relative
;
background
:
transparent
;
&
::
after
{
position
:
absolute
;
z
-
index
:
-
2
;
background
:
#
ffffffb3
;
width
:
100
%
;
height
:
100
%
;
border
-
radius
:
370
rpx
;
left
:
0
;
top
:
0
;
content
:
""
;
}
.
tab
{
width
:
240
rpx
;
height
:
70
rpx
;
justify
-
content
:
center
;
font
-
weight
:
500
;
font
-
size
:
32
rpx
;
color
:
#
333333
;
}
.
active
{
color
:
#
ffffff
;
}
.
active
-
btn
{
position
:
absolute
;
width
:
240
rpx
;
height
:
70
rpx
;
background
:
#
3
b73ff
;
border
-
radius
:
360
rpx
;
top
:
0
;
z
-
index
:
-
1
;
transition
:
all
0.15
s
;
}
.
active
-
btn
-
0
{
left
:
0
;
}
.
active
-
btn
-
1
{
left
:
272
rpx
;
}
.
active
-
btn
-
2
{
left
:
544
rpx
;
}
}
}
}
<
/style
>
components/HomeFrame/index.vue
View file @
40a184b
...
...
@@ -85,7 +85,7 @@
</view>
</
template
>
<
template
v-else
>
<record-list
/>
<record-list
:userInfo=
"userInfo"
/>
</
template
>
<view
class=
"store-addr"
>
<view
class=
"icon-addr sprite-icon icon-addr"
></view>
...
...
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