Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
蒋秀川
/
miniProject
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 54a2adcf
authored
Jun 14, 2023
by
李君
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化
1 parent
40d0d38f
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
1127 additions
and
1046 deletions
miniProject/app.json
miniProject/custom-tab-bar/index.js
miniProject/index/index.js
miniProject/index/index2.js
miniProject/index/index2.wxml
miniProject/index/index2.wxss
miniProject/pages/homes/index.js
miniProject/pages/homes/index.wxml
miniProject/pages/login/index.wxml
miniProject/pages/login/index.wxss
miniProject/pages/shopSelect/index.wxml
miniProject/pages/shopSelect/index.wxss
miniProject/app.json
View file @
54a2adc
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
"index/index2"
,
"index/index2"
,
"index/me"
,
"index/me"
,
"pages/login/index"
,
"pages/login/index"
,
"pages/homes/index"
,
"pages/editPwd/editPwd"
,
"pages/editPwd/editPwd"
,
"pages/shopSelect/index"
"pages/shopSelect/index"
],
],
...
...
miniProject/custom-tab-bar/index.js
View file @
54a2adc
...
@@ -34,7 +34,7 @@ Component({
...
@@ -34,7 +34,7 @@ Component({
"pagePath"
:
"/index/index2"
,
"pagePath"
:
"/index/index2"
,
"iconPath"
:
"../images/cong.png"
,
"iconPath"
:
"../images/cong.png"
,
"selectedIconPath"
:
"../images/cong-b.png"
,
"selectedIconPath"
:
"../images/cong-b.png"
,
"text"
:
"
工作台
"
,
"text"
:
"
店铺首页
"
,
"curr"
:
2
"curr"
:
2
},
},
{
{
...
...
miniProject/index/index.js
View file @
54a2adc
...
@@ -7,7 +7,6 @@ import moment from 'moment'
...
@@ -7,7 +7,6 @@ import moment from 'moment'
Component
({
Component
({
pageLifetimes
:
{
pageLifetimes
:
{
show
()
{
show
()
{
this
.
loadData
()
if
(
typeof
this
.
getTabBar
===
'function'
&&
this
.
getTabBar
())
{
if
(
typeof
this
.
getTabBar
===
'function'
&&
this
.
getTabBar
())
{
this
.
getTabBar
().
setData
({
this
.
getTabBar
().
setData
({
// 当前页面的 tabBar 索引
// 当前页面的 tabBar 索引
...
@@ -16,6 +15,9 @@ Component({
...
@@ -16,6 +15,9 @@ Component({
}
}
}
}
},
},
ready
(){
this
.
loadData
()
},
data
:
{
data
:
{
selectName
:
''
,
//集团名称
selectName
:
''
,
//集团名称
openMllNum
:
0
,
//开业门店数
openMllNum
:
0
,
//开业门店数
...
@@ -176,7 +178,7 @@ Component({
...
@@ -176,7 +178,7 @@ Component({
},()
=>
{
},()
=>
{
// wx.hideLoading();
// wx.hideLoading();
})
})
},
10
00
)
},
5
00
)
})
})
},
},
// 获取门店排行
// 获取门店排行
...
...
miniProject/index/index2.js
View file @
54a2adc
import
moment
from
'moment'
import
moment
from
'moment'
import
{
import
{
getMalls
,
getMalls
,
}
from
"../api/login"
;
}
from
"../api/login"
;
import
{
import
{
getCardData
,
getCardData
,
getShopDetailData
,
getShopDetailData
,
getStopTimeData
,
getStopTimeData
,
getTrendData
,
getTrendData
,
getAgeSexData
,
getAgeSexData
,
getAgeData
getAgeData
}
from
"../api/shop"
;
}
from
"../api/shop"
;
Component
({
Component
({
pageLifetimes
:
{
pageLifetimes
:
{
show
()
{
show
()
{
if
(
typeof
this
.
getTabBar
===
'function'
&&
this
.
getTabBar
())
{
if
(
typeof
this
.
getTabBar
===
'function'
&&
this
.
getTabBar
())
{
this
.
getTabBar
().
setData
({
this
.
getTabBar
().
setData
({
// 当前页面的 tabBar 索引
// 当前页面的 tabBar 索引
curClick
:
2
curClick
:
2
})
}
if
(
wx
.
getStorageSync
(
'shopName'
)
&&
this
.
data
.
shopList
.
length
>
0
)
{
let
selectId
=
this
.
data
.
shopList
.
find
(
item
=>
item
.
name
==
wx
.
getStorageSync
(
'shopName'
)).
id
this
.
setData
({
selectName
:
wx
.
getStorageSync
(
'shopName'
),
selectId
},
()
=>
{
this
.
loadData
()
getShopDetailData
({
id
:
this
.
data
.
selectId
}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
let
startTime
=
res
.
data
.
startTime
.
split
(
' '
)[
1
].
slice
(
0
,
5
)
let
endTime
=
res
.
data
.
endTime
.
split
(
' '
)[
1
].
slice
(
0
,
5
)
this
.
setData
({
info
:
{
...
res
.
data
,
startTime
,
endTime
}
})
}
})
})
}
else
{
getMalls
({
url
:
'/report/malls'
,
accountId
:
wx
.
getStorageSync
(
'accountId'
)
}).
then
((
res
)
=>
{
this
.
setData
({
shopList
:
res
.
data
,
selectName
:
res
.
data
[
0
]
&&
res
.
data
[
0
].
name
,
selectId
:
res
.
data
[
0
]
&&
res
.
data
[
0
].
id
,
columnsListName
:
res
.
data
&&
res
.
data
.
map
(
item
=>
item
.
name
)
},
()
=>
{
wx
.
setStorageSync
(
'shopName'
,
res
.
data
[
0
]
&&
res
.
data
[
0
].
name
)
this
.
loadData
()
// let params={id:this.selectId}
getShopDetailData
({
id
:
this
.
data
.
selectId
}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
let
startTime
=
res
.
data
.
startTime
.
split
(
' '
)[
1
].
slice
(
0
,
5
)
let
endTime
=
res
.
data
.
endTime
.
split
(
' '
)[
1
].
slice
(
0
,
5
)
this
.
setData
({
info
:
{
...
res
.
data
,
startTime
,
endTime
}
})
})
}
}
})
})
})
}
}
},
/**
* 组件的初始数据
*/
data
:
{
currentTime
:
moment
().
format
(
"YYYY-MM-DD"
),
types
:
1
,
//选中的时间类型
trendtypes
:
1
,
//选中的业态趋势类型
chartData
:
{},
//客流趋势分析数据
chartDatastop
:
{},
//停留时长统计
chartDataSex
:
{},
//客群性别占比
chartDataAge
:
{},
//客群年龄占比
show
:
false
,
//显示日期自定义选择
minDate
:
new
Date
(
2022
,
0
,
1
).
getTime
(),
//自定义时间的开始日期
// maxDate: new Date(2022, 11, 31).getTime(), //自定义时间的结束日期
maxDate
:
new
Date
(
2025
,
11
,
31
).
getTime
(),
//自定义时间的结束日期
shopList
:
[
// {
// id: 1,
// name: '小米'
// }, {
// id: 2,
// name: '华为'
// }
],
//店铺列表数据
selectId
:
''
,
//选中的店铺id
selectName
:
''
,
//选中店铺名字
columnsListName
:
[],
//店铺的名字下拉列表
exposure
:
0
,
traffic
:
0
,
customer
:
0
,
entryRate
:
0
,
info
:
{}
},
methods
:
{
// 关闭自定义日期选择
onClose
()
{
this
.
getTabBar
().
setData
({
show
:
true
});
this
.
setData
({
show
:
false
});
},
// 跳转到店铺选择
selectContent
()
{
wx
.
navigateTo
({
url
:
'/pages/shopSelect/index?current='
+
JSON
.
stringify
(
this
.
data
.
columnsListName
),
})
},
// 点击自定义日期选择器的确定
onConfirm
(
event
)
{
this
.
getTabBar
().
setData
({
show
:
true
});
const
[
start
,
end
]
=
event
.
detail
;
let
startDate
=
moment
(
start
).
format
(
"YYYY-MM-DD"
)
let
endDate
=
moment
(
end
).
format
(
"YYYY-MM-DD"
)
this
.
setData
({
show
:
false
,
currentTime
:
startDate
+
'至'
+
endDate
},
()
=>
{
this
.
loadData
()
});
},
// 点击时间选择类型触发
ClickTab
(
e
)
{
let
dateType
=
e
.
target
.
dataset
.
type
,
time
switch
(
dateType
)
{
case
'1'
:
time
=
moment
().
format
(
"YYYY-MM-DD"
)
break
;
case
'2'
:
time
=
moment
().
subtract
(
1
,
"days"
).
format
(
"YYYY-MM-DD"
)
break
;
case
'3'
:
time
=
moment
().
subtract
(
6
,
"days"
).
format
(
"YYYY-MM-DD"
)
+
'至'
+
moment
().
format
(
"YYYY-MM-DD"
)
break
;
case
'4'
:
time
=
moment
().
subtract
(
29
,
"days"
).
format
(
"YYYY-MM-DD"
)
+
'至'
+
moment
().
format
(
"YYYY-MM-DD"
)
break
;
default
:
this
.
setData
({
show
:
true
,
types
:
e
.
target
.
dataset
.
type
,
})
this
.
getTabBar
().
setData
({
show
:
false
,
});
break
;
}
if
(
dateType
!=
5
)
{
this
.
setData
({
types
:
e
.
target
.
dataset
.
type
,
currentTime
:
time
},
()
=>
{
this
.
loadData
()
})
}
},
// 获取卡片数据
getCardList
()
{
// console.log(this.data.currentTime,this.data.selectId,this.data.selectName)
let
startTime
=
this
.
data
.
currentTime
,
endTime
=
this
.
data
.
currentTime
if
(
this
.
data
.
currentTime
.
includes
(
'至'
))
{
let
timeArr
=
this
.
data
.
currentTime
.
split
(
'至'
)
startTime
=
timeArr
[
0
]
endTime
=
timeArr
[
1
]
}
getCardData
({
mallId
:
this
.
data
.
selectId
,
// mallId: 9300,
startDate
:
startTime
,
endDate
:
endTime
}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
let
data
=
res
.
data
this
.
setData
({
exposure
:
data
.
exposure
,
traffic
:
data
.
traffic
,
customer
:
data
.
customer
,
entryRate
:
data
.
entryRate
&&
data
.
entryRate
.
toFixed
(
2
)
})
}
})
},
// 获取业态客流趋势
getTrendList
()
{
let
startTime
=
this
.
data
.
currentTime
,
endTime
=
this
.
data
.
currentTime
if
(
this
.
data
.
currentTime
.
includes
(
'至'
))
{
let
timeArr
=
this
.
data
.
currentTime
.
split
(
'至'
)
startTime
=
timeArr
[
0
]
endTime
=
timeArr
[
1
]
}
let
dataIndex
,
dataLevel
=
'day'
if
(
this
.
data
.
trendtypes
==
1
)
{
dataIndex
=
'Exposure'
}
else
if
(
this
.
data
.
trendtypes
==
2
)
{
dataIndex
=
'PassengerFlow'
}
else
if
(
this
.
data
.
trendtypes
==
3
)
{
dataIndex
=
'CustomerNum'
}
else
if
(
this
.
data
.
trendtypes
==
4
)
{
dataIndex
=
'IntoStoreRate'
}
if
(
startTime
==
endTime
)
{
dataLevel
=
'hour'
}
getTrendData
({
// mallId: 9300,
mallId
:
this
.
data
.
selectId
,
startDate
:
startTime
,
endDate
:
endTime
,
dataIndex
,
dataLevel
}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
setData
({
chartData
:
this
.
getLineConfig
(
res
.
data
),
//客流趋势分析数据
})
}
}
})
},
},
// 获取停留时长统计
/**
getStopTimeList
()
{
* 组件的初始数据
let
startTime
=
this
.
data
.
currentTime
,
*/
endTime
=
this
.
data
.
currentTime
data
:
{
if
(
this
.
data
.
currentTime
.
includes
(
'至'
))
{
currentTime
:
moment
().
format
(
"YYYY-MM-DD"
),
let
timeArr
=
this
.
data
.
currentTime
.
split
(
'至'
)
types
:
1
,
//选中的时间类型
startTime
=
timeArr
[
0
]
trendtypes
:
1
,
//选中的业态趋势类型
endTime
=
timeArr
[
1
]
chartData
:
{},
//客流趋势分析数据
}
chartDatastop
:
{},
//停留时长统计
getStopTimeData
({
chartDataSex
:
{},
//客群性别占比
mallId
:
this
.
data
.
selectId
,
chartDataAge
:
{},
//客群年龄占比
// mallId: 9300,
show
:
false
,
//显示日期自定义选择
startDate
:
startTime
,
minDate
:
new
Date
(
2022
,
0
,
1
).
getTime
(),
//自定义时间的开始日期
endDate
:
endTime
// maxDate: new Date(2022, 11, 31).getTime(), //自定义时间的结束日期
}).
then
(
res
=>
{
maxDate
:
new
Date
(
2025
,
11
,
31
).
getTime
(),
//自定义时间的结束日期
if
(
res
.
code
==
200
)
{
shopList
:
[
this
.
setData
({
// {
chartDatastop
:
this
.
getStopTimeConfig
(
res
.
data
),
// id: 1,
})
// name: '小米'
}
// }, {
})
// id: 2,
// name: '华为'
// }
],
//店铺列表数据
selectId
:
''
,
//选中的店铺id
selectName
:
''
,
//选中店铺名字
columnsListName
:
[],
//店铺的名字下拉列表
exposure
:
0
,
traffic
:
0
,
customer
:
0
,
entryRate
:
0
,
info
:
{}
},
},
// 获取性别和年龄
ready
(){
getAgeSexList
()
{
if
(
wx
.
getStorageSync
(
'shopName'
)
&&
this
.
data
.
shopList
.
length
>
0
)
{
let
startTime
=
this
.
data
.
currentTime
,
let
selectId
=
this
.
data
.
shopList
.
find
(
item
=>
item
.
name
==
wx
.
getStorageSync
(
'shopName'
)).
id
endTime
=
this
.
data
.
currentTime
this
.
setData
({
if
(
this
.
data
.
currentTime
.
includes
(
'至'
))
{
selectName
:
wx
.
getStorageSync
(
'shopName'
),
let
timeArr
=
this
.
data
.
currentTime
.
split
(
'至'
)
selectId
startTime
=
timeArr
[
0
]
},
()
=>
{
endTime
=
timeArr
[
1
]
this
.
loadData
()
}
getShopDetailData
({
getAgeSexData
({
id
:
this
.
data
.
selectId
mallId
:
this
.
data
.
selectId
,
}).
then
(
res
=>
{
// mallId: 9300,
if
(
res
.
code
==
200
)
{
startDate
:
startTime
,
let
startTime
=
res
.
data
.
startTime
.
split
(
' '
)[
1
].
slice
(
0
,
5
)
endDate
:
endTime
let
endTime
=
res
.
data
.
endTime
.
split
(
' '
)[
1
].
slice
(
0
,
5
)
}).
then
(
res
=>
{
this
.
setData
({
if
(
res
.
code
==
200
)
{
info
:
{
this
.
setData
({
...
res
.
data
,
chartDataSex
:
this
.
getGroupSexConfig
(
res
.
data
),
startTime
,
})
endTime
}
}
})
})
getAgeData
({
}
mallId
:
this
.
data
.
selectId
,
})
// mallId: 9300,
})
startDate
:
startTime
,
endDate
:
endTime
}
else
{
}).
then
(
res
=>
{
getMalls
({
if
(
res
.
code
==
200
)
{
url
:
'/report/malls'
,
this
.
setData
({
accountId
:
wx
.
getStorageSync
(
'accountId'
)
chartDataAge
:
this
.
getAgeConfig
(
res
.
data
)
}).
then
((
res
)
=>
{
})
this
.
setData
({
shopList
:
res
.
data
,
selectName
:
res
.
data
[
0
]
&&
res
.
data
[
0
].
name
,
selectId
:
res
.
data
[
0
]
&&
res
.
data
[
0
].
id
,
columnsListName
:
res
.
data
&&
res
.
data
.
map
(
item
=>
item
.
name
)
},
()
=>
{
wx
.
setStorageSync
(
'shopName'
,
res
.
data
[
0
]
&&
res
.
data
[
0
].
name
)
this
.
loadData
()
// let params={id:this.selectId}
getShopDetailData
({
id
:
this
.
data
.
selectId
}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
let
startTime
=
res
.
data
.
startTime
.
split
(
' '
)[
1
].
slice
(
0
,
5
)
let
endTime
=
res
.
data
.
endTime
.
split
(
' '
)[
1
].
slice
(
0
,
5
)
this
.
setData
({
info
:
{
...
res
.
data
,
startTime
,
endTime
}
})
}
})
})
})
}
}
})
},
},
// 获取性别和年龄
methods
:
{
getShopDetailList
()
{
// 关闭自定义日期选择
// getShopDetailData().then(res => {})
onClose
()
{
},
this
.
getTabBar
().
setData
({
// 获取所有数据
show
:
true
loadData
()
{
});
this
.
getCardList
()
this
.
setData
({
this
.
getTrendList
()
show
:
false
this
.
getStopTimeList
()
});
this
.
getAgeSexList
()
this
.
getShopDetailList
()
},
//点击业态客流趋势top5中的tab触发
ClickPassageFlow
(
e
)
{
this
.
setData
({
trendtypes
:
e
.
target
.
dataset
.
type
},
()
=>
{
this
.
getTrendList
()
})
},
// 返回趋势图配置项
getLineConfig
(
res
)
{
let
xasix
=
res
.
xaxis
.
data
// let legendList = res.series.map(item => item.name)
let
seriesList
=
res
.
series
||
[]
if
(
seriesList
[
0
].
data
.
every
(
item
=>
!
item
))
{
return
{
title
:
{
text
:
'暂无数据'
,
x
:
'center'
,
y
:
'center'
,
textStyle
:
{
fontSize
:
16
,
fontWeight
:
'normal'
,
}
}
}
}
return
{
grid
:
{
top
:
30
,
right
:
20
,
bottom
:
20
,
left
:
5
,
containLabel
:
true
},
},
tooltip
:
{
// 跳转到店铺选择
trigger
:
'axis'
,
selectContent
()
{
axisPointer
:
{
wx
.
navigateTo
({
type
:
"line"
,
url
:
'/pages/shopSelect/index?current='
+
JSON
.
stringify
(
this
.
data
.
columnsListName
),
lineStyle
:
{
color
:
"#444"
,
},
},
formatter
:
function
(
params
)
{
let
html
=
''
params
.
forEach
(
item
=>
{
html
+=
item
.
axisValue
+
'\n'
+
item
.
seriesName
+
': '
+
item
.
value
})
})
return
html
}
},
},
xAxis
:
{
// 点击自定义日期选择器的确定
axisLabel
:
{
onConfirm
(
event
)
{
color
:
'#8C8D95'
this
.
getTabBar
().
setData
({
},
show
:
true
boundaryGap
:
false
,
});
axisTick
:
{
const
[
start
,
end
]
=
event
.
detail
;
show
:
true
let
startDate
=
moment
(
start
).
format
(
"YYYY-MM-DD"
)
},
let
endDate
=
moment
(
end
).
format
(
"YYYY-MM-DD"
)
axisLine
:
{
this
.
setData
({
lineStyle
:
{
show
:
false
,
color
:
'rgba(140,141,149,0.35)'
,
currentTime
:
startDate
+
'至'
+
endDate
width
:
1
},
()
=>
{
}
this
.
loadData
()
},
});
data
:
xasix
},
},
yAxis
:
{
// 点击时间选择类型触发
type
:
'value'
,
ClickTab
(
e
)
{
axisLabel
:
{
let
dateType
=
e
.
target
.
dataset
.
type
,
color
:
'#8C8D95'
,
time
formatter
:
function
(
value
,
index
)
{
switch
(
dateType
)
{
if
(
value
>=
10000
&&
value
<
1000000
)
{
case
'1'
:
value
=
value
/
10000
+
"万"
;
time
=
moment
().
format
(
"YYYY-MM-DD"
)
}
else
if
(
value
>=
1000000
)
{
break
;
value
=
value
/
1000000
+
"百万"
;
case
'2'
:
}
time
=
moment
().
subtract
(
1
,
"days"
).
format
(
"YYYY-MM-DD"
)
return
value
;
break
;
},
case
'3'
:
},
time
=
moment
().
subtract
(
6
,
"days"
).
format
(
"YYYY-MM-DD"
)
+
'至'
+
moment
().
format
(
"YYYY-MM-DD"
)
axisTick
:
{
break
;
show
:
true
,
case
'4'
:
time
=
moment
().
subtract
(
29
,
"days"
).
format
(
"YYYY-MM-DD"
)
+
'至'
+
moment
().
format
(
"YYYY-MM-DD"
)
break
;
},
default
:
axisLine
:
{
this
.
setData
({
show
:
false
,
show
:
true
,
types
:
e
.
target
.
dataset
.
type
,
})
this
.
getTabBar
().
setData
({
show
:
false
,
});
break
;
}
if
(
dateType
!=
5
)
{
this
.
setData
({
types
:
e
.
target
.
dataset
.
type
,
currentTime
:
time
},
()
=>
{
this
.
loadData
()
})
}
},
splitLine
:
{
show
:
false
}
},
},
color
:
[
'#FD8C5E'
,
'#6FD3FF'
,
'#BC7FF8'
,
'#4F75FF'
,
'#FF9AC1'
],
// 获取卡片数据
// series:seriesList.map(item=>({...item,symbol: 'none',smooth: true,}))
getCardList
()
{
series
:
[{
// console.log(this.data.currentTime,this.data.selectId,this.data.selectName)
name
:
res
.
series
[
0
]
&&
res
.
series
[
0
].
name
,
let
startTime
=
this
.
data
.
currentTime
,
smooth
:
true
,
endTime
=
this
.
data
.
currentTime
lineStyle
:
{
if
(
this
.
data
.
currentTime
.
includes
(
'至'
))
{
color
:
'#34BFFF'
let
timeArr
=
this
.
data
.
currentTime
.
split
(
'至'
)
},
startTime
=
timeArr
[
0
]
areaStyle
:
{
endTime
=
timeArr
[
1
]
// 区域颜色
}
color
:
{
getCardData
({
type
:
'linear'
,
mallId
:
this
.
data
.
selectId
,
x
:
0
,
//右
// mallId: 9300,
y
:
0
,
//下
startDate
:
startTime
,
x2
:
0
,
//左
endDate
:
endTime
y2
:
1
,
//上
}).
then
(
res
=>
{
colorStops
:
[{
if
(
res
.
code
==
200
)
{
offset
:
0.1
,
let
data
=
res
.
data
color
:
'#EAF3FF'
// 0% 处的颜色
this
.
setData
({
},
exposure
:
data
.
exposure
,
{
traffic
:
data
.
traffic
,
offset
:
1
,
customer
:
data
.
customer
,
color
:
'#FFFFFF'
// 100% 处的颜色
entryRate
:
data
.
entryRate
&&
data
.
entryRate
.
toFixed
(
2
)
})
}
}
]
})
},
},
},
// 获取业态客流趋势
data
:
res
.
series
[
0
]
&&
res
.
series
[
0
].
data
,
getTrendList
()
{
type
:
"line"
,
let
startTime
=
this
.
data
.
currentTime
,
symbol
:
"none"
,
endTime
=
this
.
data
.
currentTime
showSymbol
:
false
,
if
(
this
.
data
.
currentTime
.
includes
(
'至'
))
{
symbolSize
:
20
,
let
timeArr
=
this
.
data
.
currentTime
.
split
(
'至'
)
}]
startTime
=
timeArr
[
0
]
}
endTime
=
timeArr
[
1
]
},
// 返回停留时长配置
getStopTimeConfig
(
confingData
)
{
// let data_sample = [
// ["type", "停留时长", ''],
// ["进样", 50, 200],
// ["离心", 10, 200],
// ["去盖", 30, 200],
// ["侧轨", 15, 200],
// ["侧轨1", 15, 200],
// ["侧轨2", 15, 200],
// ["侧轨3", 15, 200],
// ["出样", 18, 200]
// ];
if
(
confingData
.
series
.
length
<=
0
)
{
return
{
title
:
{
text
:
'暂无数据'
,
x
:
'center'
,
y
:
'center'
,
textStyle
:
{
fontSize
:
16
,
fontWeight
:
'normal'
,
}
}
}
let
dataIndex
,
dataLevel
=
'day'
}
if
(
this
.
data
.
trendtypes
==
1
)
{
}
dataIndex
=
'Exposure'
let
data_sample
=
[];
}
else
if
(
this
.
data
.
trendtypes
==
2
)
{
confingData
.
xaxis
.
data
.
forEach
((
item
,
i
)
=>
{
dataIndex
=
'PassengerFlow'
let
arr
=
[];
}
else
if
(
this
.
data
.
trendtypes
==
3
)
{
arr
[
0
]
=
item
;
dataIndex
=
'CustomerNum'
arr
[
1
]
=
confingData
.
series
[
0
].
data
[
i
];
}
else
if
(
this
.
data
.
trendtypes
==
4
)
{
arr
[
2
]
=
100
;
dataIndex
=
'IntoStoreRate'
data_sample
.
push
(
arr
);
}
});
if
(
startTime
==
endTime
)
{
data_sample
.
reverse
()
dataLevel
=
'hour'
data_sample
.
unshift
([
"type"
,
confingData
.
title
,
""
]);
}
return
{
getTrendData
({
color
:
[
"#33CCFF"
,
"#CCEEFF"
],
// mallId: 9300,
legend
:
{
mallId
:
this
.
data
.
selectId
,
show
:
false
startDate
:
startTime
,
endDate
:
endTime
,
dataIndex
,
dataLevel
}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
setData
({
chartData
:
this
.
getLineConfig
(
res
.
data
),
//客流趋势分析数据
})
}
})
},
},
grid
:
{
// 获取停留时长统计
left
:
"0"
,
getStopTimeList
()
{
right
:
"2%"
,
let
startTime
=
this
.
data
.
currentTime
,
bottom
:
"3%"
,
endTime
=
this
.
data
.
currentTime
top
:
"10px"
,
if
(
this
.
data
.
currentTime
.
includes
(
'至'
))
{
containLabel
:
true
let
timeArr
=
this
.
data
.
currentTime
.
split
(
'至'
)
startTime
=
timeArr
[
0
]
endTime
=
timeArr
[
1
]
}
getStopTimeData
({
mallId
:
this
.
data
.
selectId
,
// mallId: 9300,
startDate
:
startTime
,
endDate
:
endTime
}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
setData
({
chartDatastop
:
this
.
getStopTimeConfig
(
res
.
data
),
})
}
})
},
// 获取性别和年龄
getAgeSexList
()
{
let
startTime
=
this
.
data
.
currentTime
,
endTime
=
this
.
data
.
currentTime
if
(
this
.
data
.
currentTime
.
includes
(
'至'
))
{
let
timeArr
=
this
.
data
.
currentTime
.
split
(
'至'
)
startTime
=
timeArr
[
0
]
endTime
=
timeArr
[
1
]
}
getAgeSexData
({
mallId
:
this
.
data
.
selectId
,
// mallId: 9300,
startDate
:
startTime
,
endDate
:
endTime
}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
setData
({
chartDataSex
:
this
.
getGroupSexConfig
(
res
.
data
),
})
}
})
getAgeData
({
mallId
:
this
.
data
.
selectId
,
// mallId: 9300,
startDate
:
startTime
,
endDate
:
endTime
}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
this
.
setData
({
chartDataAge
:
this
.
getAgeConfig
(
res
.
data
)
})
}
})
},
},
xAxis
:
{
// 获取性别和年龄
type
:
"value"
,
getShopDetailList
()
{
// boundaryGap: [0, 0.01],
// getShopDetailData().then(res => {})
axisLine
:
{
show
:
false
},
splitLine
:
{
show
:
false
},
axisTick
:
{
show
:
false
},
axisLabel
:
{
show
:
false
}
},
},
yAxis
:
{
// 获取所有数据
type
:
"category"
,
loadData
()
{
inverse
:
true
,
this
.
getCardList
()
axisLine
:
{
this
.
getTrendList
()
show
:
false
this
.
getStopTimeList
()
},
this
.
getAgeSexList
()
splitLine
:
{
this
.
getShopDetailList
()
show
:
false
},
axisTick
:
{
show
:
false
}
},
},
dataset
:
{
//点击业态客流趋势top5中的tab触发
source
:
data_sample
ClickPassageFlow
(
e
)
{
this
.
setData
({
trendtypes
:
e
.
target
.
dataset
.
type
},
()
=>
{
this
.
getTrendList
()
})
},
},
series
:
[{
// 返回趋势图配置项
name
:
"停留时长"
,
getLineConfig
(
res
)
{
type
:
"bar"
,
let
xasix
=
res
.
xaxis
.
data
barWidth
:
"40%"
,
// let legendList = res.series.map(item => item.name)
label
:
{
let
seriesList
=
res
.
series
||
[]
show
:
true
,
if
(
seriesList
[
0
].
data
.
every
(
item
=>
!
item
))
{
formatter
:
function
(
params
)
{
return
{
return
params
.
data
[
1
]
+
"%"
;
title
:
{
},
text
:
'暂无数据'
,
position
:
[
"102%"
,
"0%"
]
x
:
'center'
,
},
y
:
'center'
,
itemStyle
:
{
textStyle
:
{
color
:
"#679BFF"
fontSize
:
16
,
},
fontWeight
:
'normal'
,
z
:
3
//让实时在总计上面
}
},
}
{
}
name
:
""
,
}
type
:
"bar"
,
return
{
barWidth
:
"40%"
,
grid
:
{
itemStyle
:
{
top
:
30
,
color
:
"#F5F7F9"
right
:
20
,
},
bottom
:
20
,
barGap
:
"-100%"
left
:
5
,
}
containLabel
:
true
]
},
};
tooltip
:
{
trigger
:
'axis'
,
axisPointer
:
{
type
:
"line"
,
lineStyle
:
{
color
:
"#444"
,
},
},
formatter
:
function
(
params
)
{
let
html
=
''
params
.
forEach
(
item
=>
{
html
+=
item
.
axisValue
+
'\n'
+
item
.
seriesName
+
': '
+
item
.
value
})
return
html
}
},
xAxis
:
{
axisLabel
:
{
color
:
'#8C8D95'
},
boundaryGap
:
false
,
axisTick
:
{
show
:
true
},
axisLine
:
{
lineStyle
:
{
color
:
'rgba(140,141,149,0.35)'
,
width
:
1
}
},
data
:
xasix
},
yAxis
:
{
type
:
'value'
,
axisLabel
:
{
color
:
'#8C8D95'
,
formatter
:
function
(
value
,
index
)
{
if
(
value
>=
10000
&&
value
<
1000000
)
{
value
=
value
/
10000
+
"万"
;
}
else
if
(
value
>=
1000000
)
{
value
=
value
/
1000000
+
"百万"
;
}
return
value
;
},
},
axisTick
:
{
show
:
true
,
},
},
// 返回客群性别占比配置
axisLine
:
{
getGroupSexConfig
(
faceGender
)
{
show
:
false
,
// let faceGender = {
// "title": "人脸性别统计",
},
// "series": [{
splitLine
:
{
// "name": "人脸性别统计",
show
:
false
// "data": [{
}
// "name": "男",
},
// "value": 85
color
:
[
'#FD8C5E'
,
'#6FD3FF'
,
'#BC7FF8'
,
'#4F75FF'
,
'#FF9AC1'
],
// },
// series:seriesList.map(item=>({...item,symbol: 'none',smooth: true,}))
// {
series
:
[{
// "name": "女",
name
:
res
.
series
[
0
]
&&
res
.
series
[
0
].
name
,
// "value": 262
smooth
:
true
,
// }
lineStyle
:
{
// ],
color
:
'#34BFFF'
// "type": "pie"
},
// }]
areaStyle
:
{
// }
// 区域颜色
if
(
faceGender
.
series
[
0
]
&&
faceGender
.
series
[
0
].
data
.
every
(
item
=>
item
))
{
color
:
{
return
{
type
:
'linear'
,
title
:
{
x
:
0
,
//右
text
:
'暂无数据'
,
y
:
0
,
//下
x
:
'center'
,
x2
:
0
,
//左
y
:
'center'
,
y2
:
1
,
//上
textStyle
:
{
colorStops
:
[{
fontSize
:
16
,
offset
:
0.1
,
fontWeight
:
'normal'
,
color
:
'#EAF3FF'
// 0% 处的颜色
},
{
offset
:
1
,
color
:
'#FFFFFF'
// 100% 处的颜色
}
]
},
},
data
:
res
.
series
[
0
]
&&
res
.
series
[
0
].
data
,
type
:
"line"
,
symbol
:
"none"
,
showSymbol
:
false
,
symbolSize
:
20
,
}]
}
}
}
}
}
let
seriesData
=
faceGender
.
series
[
0
].
data
;
let
sexLabel
=
faceGender
.
series
[
0
].
data
.
map
(
item
=>
item
.
name
);
let
number
=
faceGender
.
series
[
0
].
data
.
map
(
item
=>
item
.
value
);
let
sum
=
number
[
0
]
*
1
+
number
[
1
]
*
1
;
let
rate
=
faceGender
.
series
[
0
].
data
.
map
(
item
=>
((
item
.
value
/
sum
)
*
100
).
toFixed
(
2
)
);
if
(
rate
[
0
]
==
"NaN"
||
rate
[
1
]
==
"NaN"
)
{
rate
=
[
0
,
0
];
}
return
{
color
:
[
"#FF8383"
,
"#70AAFB"
],
grid
:
{
top
:
"15%"
,
left
:
20
,
right
:
"1%"
,
bottom
:
5
},
},
legend
:
[{
// 返回停留时长配置
orient
:
"vertical"
,
getStopTimeConfig
(
confingData
)
{
top
:
"center"
,
// let data_sample = [
icon
:
"circle"
,
// ["type", "停留时长", ''],
right
:
10
,
// ["进样", 50, 200],
textStyle
:
{
// ["离心", 10, 200],
color
:
"#000"
,
// ["去盖", 30, 200],
fontSize
:
14
// ["侧轨", 15, 200],
},
// ["侧轨1", 15, 200],
data
:
sexLabel
,
// ["侧轨2", 15, 200],
formatter
:
function
(
name
)
{
// ["侧轨3", 15, 200],
for
(
var
i
=
0
;
i
<
sexLabel
.
length
;
i
++
)
{
// ["出样", 18, 200]
if
(
sexLabel
[
i
]
==
name
)
{
// ];
return
name
+
" "
+
" "
+
rate
[
i
]
+
"%"
;
if
(
confingData
.
series
.
length
<=
0
)
{
}
return
{
title
:
{
text
:
'暂无数据'
,
x
:
'center'
,
y
:
'center'
,
textStyle
:
{
fontSize
:
16
,
fontWeight
:
'normal'
,
}
}
}
}
}
}
let
data_sample
=
[];
}],
confingData
.
xaxis
.
data
.
forEach
((
item
,
i
)
=>
{
series
:
[{
let
arr
=
[];
name
:
"需求类型占比"
,
arr
[
0
]
=
item
;
type
:
"pie"
,
arr
[
1
]
=
confingData
.
series
[
0
].
data
[
i
];
center
:
[
"30%"
,
"50%"
],
arr
[
2
]
=
100
;
radius
:
[
"36%"
,
"70%"
],
data_sample
.
push
(
arr
);
showEmptyCircle
:
true
,
});
itemStyle
:
{
data_sample
.
reverse
()
// normal: {
data_sample
.
unshift
([
"type"
,
confingData
.
title
,
""
]);
// borderColor: "#050e31",
return
{
// borderWidth: 2
color
:
[
"#33CCFF"
,
"#CCEEFF"
],
legend
:
{
show
:
false
},
grid
:
{
left
:
"0"
,
right
:
"2%"
,
bottom
:
"3%"
,
top
:
"10px"
,
containLabel
:
true
},
xAxis
:
{
type
:
"value"
,
// boundaryGap: [0, 0.01],
axisLine
:
{
show
:
false
},
splitLine
:
{
show
:
false
},
axisTick
:
{
show
:
false
},
axisLabel
:
{
show
:
false
}
},
yAxis
:
{
type
:
"category"
,
inverse
:
true
,
axisLine
:
{
show
:
false
},
splitLine
:
{
show
:
false
},
axisTick
:
{
show
:
false
}
},
dataset
:
{
source
:
data_sample
},
series
:
[{
name
:
"停留时长"
,
type
:
"bar"
,
barWidth
:
"40%"
,
label
:
{
show
:
true
,
formatter
:
function
(
params
)
{
return
params
.
data
[
1
]
+
"%"
;
},
position
:
[
"102%"
,
"0%"
]
},
itemStyle
:
{
color
:
"#679BFF"
},
z
:
3
//让实时在总计上面
},
{
name
:
""
,
type
:
"bar"
,
barWidth
:
"40%"
,
itemStyle
:
{
color
:
"#F5F7F9"
},
barGap
:
"-100%"
}
]
};
},
// 返回客群性别占比配置
getGroupSexConfig
(
faceGender
)
{
// let faceGender = {
// "title": "人脸性别统计",
// "series": [{
// "name": "人脸性别统计",
// "data": [{
// "name": "男",
// "value": 85
// },
// {
// "name": "女",
// "value": 262
// }
// ],
// "type": "pie"
// }]
// }
// }
},
if
(
faceGender
.
series
[
0
]
&&
faceGender
.
series
[
0
].
data
.
every
(
item
=>
item
))
{
label
:
{
return
{
normal
:
{
title
:
{
show
:
false
,
text
:
'暂无数据'
,
position
:
"inside"
,
x
:
'center'
,
// color: "rgba(255, 255, 255, 0.8)",
y
:
'center'
,
color
:
"#000"
,
textStyle
:
{
// formatter: "{value|{c}}",
fontSize
:
16
,
formatter
:
function
(
params
)
{
fontWeight
:
'normal'
,
return
params
.
name
+
"\n"
+
params
.
percent
+
"%"
;
}
}
}
// rich: {
}
// value: {
// fontSize: 20,
// color: "#000",
// },
// },
}
}
},
let
seriesData
=
faceGender
.
series
[
0
].
data
;
labelLine
:
{
let
sexLabel
=
faceGender
.
series
[
0
].
data
.
map
(
item
=>
item
.
name
);
show
:
false
,
let
number
=
faceGender
.
series
[
0
].
data
.
map
(
item
=>
item
.
value
);
length
:
0
,
let
sum
=
number
[
0
]
*
1
+
number
[
1
]
*
1
;
length2
:
0
let
rate
=
faceGender
.
series
[
0
].
data
.
map
(
item
=>
},
((
item
.
value
/
sum
)
*
100
).
toFixed
(
2
)
data
:
seriesData
);
}]
if
(
rate
[
0
]
==
"NaN"
||
rate
[
1
]
==
"NaN"
)
{
};
rate
=
[
0
,
0
];
},
// 返回客群年龄占比
getAgeConfig
(
faceAge
)
{
// let faceAge = {
// "title": "人脸年龄统计",
// "series": [{
// "name": "少年(18岁以内)",
// "data": [
// 7,
// 21
// ],
// "type": "bar"
// },
// {
// "name": "青年(19-35岁)",
// "data": [
// 54,
// 193
// ],
// "type": "bar"
// },
// {
// "name": "中年(36-55岁)",
// "data": [
// 20,
// 45
// ],
// "type": "bar"
// },
// {
// "name": "老年(55岁以上)",
// "data": [
// 4,
// 3
// ],
// "type": "bar"
// }
// ],
// "xaxis": {
// "data": [
// "男",
// "女"
// ]
// }
// }
if
(
faceAge
.
series
.
length
<=
0
)
{
return
{
title
:
{
text
:
'暂无数据'
,
x
:
'center'
,
y
:
'center'
,
textStyle
:
{
fontSize
:
16
,
fontWeight
:
'normal'
,
}
}
}
return
{
}
color
:
[
"#FF8383"
,
"#70AAFB"
],
}
grid
:
{
let
xdata
=
faceAge
.
series
.
map
(
item
=>
item
.
name
);
top
:
"15%"
,
let
ydatas
=
faceAge
.
series
.
map
(
item
=>
{
left
:
20
,
return
item
.
data
[
0
]
*
1
+
item
.
data
[
1
]
*
1
;
right
:
"1%"
,
});
bottom
:
5
let
sums
=
ydatas
.
reduce
((
pre
,
item
)
=>
pre
+
item
,
0
);
},
let
ydata
=
ydatas
.
map
(
item
=>
((
item
/
sums
)
*
100
).
toFixed
(
2
));
legend
:
[{
return
{
orient
:
"vertical"
,
tooltip
:
{
top
:
"center"
,
trigger
:
"axis"
,
icon
:
"circle"
,
axisPointer
:
{
right
:
10
,
type
:
"shadow"
textStyle
:
{
},
color
:
"#000"
,
formatter
:
function
(
params
)
{
fontSize
:
14
let
html
=
''
},
params
.
forEach
(
item
=>
{
data
:
sexLabel
,
html
+=
item
.
axisValue
+
'\n'
+
' '
+
item
.
value
formatter
:
function
(
name
)
{
})
for
(
var
i
=
0
;
i
<
sexLabel
.
length
;
i
++
)
{
return
html
if
(
sexLabel
[
i
]
==
name
)
{
},
return
name
+
" "
+
" "
+
rate
[
i
]
+
"%"
;
transitionDuration
:
0
}
},
}
grid
:
{
}
top
:
"5%"
,
}],
right
:
"5%"
,
series
:
[{
left
:
"10%"
,
name
:
"需求类型占比"
,
bottom
:
"15%"
type
:
"pie"
,
center
:
[
"30%"
,
"50%"
],
radius
:
[
"36%"
,
"70%"
],
showEmptyCircle
:
true
,
itemStyle
:
{
// normal: {
// borderColor: "#050e31",
// borderWidth: 2
// }
},
label
:
{
normal
:
{
show
:
false
,
position
:
"inside"
,
// color: "rgba(255, 255, 255, 0.8)",
color
:
"#000"
,
// formatter: "{value|{c}}",
formatter
:
function
(
params
)
{
return
params
.
name
+
"\n"
+
params
.
percent
+
"%"
;
}
// rich: {
// value: {
// fontSize: 20,
// color: "#000",
// },
// },
}
},
labelLine
:
{
show
:
false
,
length
:
0
,
length2
:
0
},
data
:
seriesData
}]
};
},
},
// 返回客群年龄占比
xAxis
:
[{
getAgeConfig
(
faceAge
)
{
type
:
"category"
,
// let faceAge = {
axisLabel
:
{
// "title": "人脸年龄统计",
color
:
"#8C8D95"
,
// "series": [{
},
// "name": "少年(18岁以内)",
axisLine
:
{
// "data": [
show
:
true
,
// 7,
lineStyle
:
{
// 21
color
:
"#0a3e98"
// ],
}
// "type": "bar"
},
// },
axisTick
:
{
// {
show
:
true
// "name": "青年(19-35岁)",
},
// "data": [
splitLine
:
{
// 54,
show
:
false
,
// 193
lineStyle
:
{
// ],
color
:
"#195384"
,
// "type": "bar"
type
:
"dotted"
// },
}
// {
},
// "name": "中年(36-55岁)",
// data: ["小西关村", "谢家井社区", "石家庄村", "大东关社区"],
// "data": [
data
:
xdata
// 20,
}],
// 45
yAxis
:
[{
// ],
type
:
"value"
,
// "type": "bar"
name
:
""
,
// },
min
:
0
,
// {
position
:
"left"
,
// "name": "老年(55岁以上)",
nameTextStyle
:
{
// "data": [
color
:
"#fff"
,
// 4,
fontSize
:
11
// 3
},
// ],
axisLine
:
{
// "type": "bar"
show
:
false
,
// }
lineStyle
:
{
// ],
color
:
"#0a3e98"
// "xaxis": {
}
// "data": [
},
// "男",
axisTick
:
{
// "女"
show
:
true
// ]
},
// }
splitLine
:
{
// }
show
:
false
,
if
(
faceAge
.
series
.
length
<=
0
)
{
lineStyle
:
{
return
{
color
:
"#0a3e98"
,
title
:
{
type
:
"dotted"
text
:
'暂无数据'
,
}
x
:
'center'
,
},
y
:
'center'
,
axisLabel
:
{
textStyle
:
{
formatter
:
"{value}"
,
fontSize
:
16
,
textStyle
:
{
fontWeight
:
'normal'
,
color
:
"#8C8D95"
}
}
}
}
}
}
let
xdata
=
faceAge
.
series
.
map
(
item
=>
item
.
name
);
}],
let
ydatas
=
faceAge
.
series
.
map
(
item
=>
{
return
item
.
data
[
0
]
*
1
+
item
.
data
[
1
]
*
1
;
});
let
sums
=
ydatas
.
reduce
((
pre
,
item
)
=>
pre
+
item
,
0
);
let
ydata
=
ydatas
.
map
(
item
=>
((
item
/
sums
)
*
100
).
toFixed
(
2
));
return
{
tooltip
:
{
trigger
:
"axis"
,
axisPointer
:
{
type
:
"shadow"
},
formatter
:
function
(
params
)
{
let
html
=
''
params
.
forEach
(
item
=>
{
html
+=
item
.
axisValue
+
'\n'
+
' '
+
item
.
value
})
return
html
},
transitionDuration
:
0
},
grid
:
{
top
:
"5%"
,
right
:
"5%"
,
left
:
"10%"
,
bottom
:
"15%"
},
series
:
[{
xAxis
:
[{
name
:
""
,
type
:
"category"
,
type
:
"bar"
,
axisLabel
:
{
barWidth
:
25
,
//柱子宽度
color
:
"#8C8D95"
,
barGap
:
0.3
,
//柱子之间间距
},
itemStyle
:
{
axisLine
:
{
normal
:
{
show
:
true
,
color
:
'#70AAFB'
,
lineStyle
:
{
opacity
:
1
,
color
:
"#0a3e98"
},
}
},
},
label
:
{
axisTick
:
{
normal
:
{
show
:
true
show
:
true
,
},
position
:
"top"
,
splitLine
:
{
formatter
:
"{c}%"
,
show
:
false
,
color
:
"#8C8D95"
lineStyle
:
{
}
color
:
"#195384"
,
},
type
:
"dotted"
// data: ["104", "60", "145", "328"],
}
data
:
ydata
},
// animationDuration: function (idx) {
// data: ["小西关村", "谢家井社区", "石家庄村", "大东关社区"],
// return idx * 1500 + 1000;
data
:
xdata
// }
}],
}]
yAxis
:
[{
};
type
:
"value"
,
},
name
:
""
,
}
min
:
0
,
position
:
"left"
,
nameTextStyle
:
{
color
:
"#fff"
,
fontSize
:
11
},
axisLine
:
{
show
:
false
,
lineStyle
:
{
color
:
"#0a3e98"
}
},
axisTick
:
{
show
:
true
},
splitLine
:
{
show
:
false
,
lineStyle
:
{
color
:
"#0a3e98"
,
type
:
"dotted"
}
},
axisLabel
:
{
formatter
:
"{value}"
,
textStyle
:
{
color
:
"#8C8D95"
}
}
}],
series
:
[{
name
:
""
,
type
:
"bar"
,
barWidth
:
25
,
//柱子宽度
barGap
:
0.3
,
//柱子之间间距
itemStyle
:
{
normal
:
{
color
:
'#70AAFB'
,
opacity
:
1
,
},
},
label
:
{
normal
:
{
show
:
true
,
position
:
"top"
,
formatter
:
"{c}%"
,
color
:
"#8C8D95"
}
},
// data: ["104", "60", "145", "328"],
data
:
ydata
// animationDuration: function (idx) {
// return idx * 1500 + 1000;
// }
}]
};
},
}
})
})
\ No newline at end of file
\ No newline at end of file
miniProject/index/index2.wxml
View file @
54a2adc
<!--pages/homes/index.wxml-->
<!--pages/homes/index.wxml-->
<view class="title">店铺首页</view>
<view class="container" style="padding-bottom: 80px;">
<view class="container">
<navbar page-name="店铺首页" bg-color="RGBA(213, 227, 255, 1)" navbar-color="#000"></navbar>
<!-- 名称 -->
<view class="~backgroundColor">
<view class="contianer_shop">
<!-- 名称 -->
<image src="../images/back.svg" class='images'></image>
<view class="contianer_shop">
<view class="shop_name" bindtap="selectContent">{{selectName}}</view>
<image src="../images/back.svg" class='images'></image>
<view class="shop_time">
<view class="shop_name" bindtap="selectContent">{{selectName}}</view>
<text>营业时间:{{info.startTime}}-{{info.endTime}}</text>
<view class="shop_time">
<text style="margin:0 10rpx"> 面积:{{info.area}}㎡ </text>
<text>营业时间:{{info.startTime}}-{{info.endTime}}</text>
<text> {{info.weather}}</text>
<text style="margin:0 10rpx"> 面积:{{info.area}}㎡ </text>
</view>
<text> {{info.weather}}</text>
</view>
</view>
</view>
<!-- 选择时间 -->
<!-- 选择时间 -->
<view class="tab_tll">
<view class="tab_tll">
<text class="text_tltle {{types==1?'actives':'defaults'}}" bindtap="ClickTab" data-type='1'>当日</text>
<text class="text_tltle {{types==1?'actives':'defaults'}}" bindtap="ClickTab" data-type='1'>当日</text>
<text class="text_tltle {{types==2?'actives':'defaults'}}" bindtap="ClickTab" data-type='2'>昨日</text>
<text class="text_tltle {{types==2?'actives':'defaults'}}" bindtap="ClickTab" data-type='2'>昨日</text>
<text class="text_tltle {{types==3?'actives':'defaults'}}" bindtap="ClickTab" data-type='3'>近7日</text>
<text class="text_tltle {{types==3?'actives':'defaults'}}" bindtap="ClickTab" data-type='3'>近7日</text>
<text class="text_tltle {{types==4?'actives':'defaults'}}" bindtap="ClickTab" data-type='4'>近30日</text>
<text class="text_tltle {{types==4?'actives':'defaults'}}" bindtap="ClickTab" data-type='4'>近30日</text>
<text class="text_tltle {{types==5?'actives':'defaults'}}" bindtap="ClickTab" data-type='5'>自定义</text>
<text class="text_tltle {{types==5?'actives':'defaults'}}" bindtap="ClickTab" data-type='5'>自定义</text>
</view>
</view>
<view class="time_input">
<view class="time_input">
<image src="../images/rili.png" style="width:20px;height:20px;margin-right:20rpx"></image>
<image src="../images/rili.png" style="width:20px;height:20px;margin-right:20rpx"></image>
<text class="text_input">{{currentTime}}</text>
<text class="text_input">{{currentTime}}</text>
</view>
</view>
<!-- 卡片 -->
<!-- 卡片 -->
<view class="card">
<view class="card">
<view class="card_passage">
<view class="card_passage">
<image src="../images/keliulaing.png" class="card_image"></image>
<image src="../images/keliulaing.png" class="card_image"></image>
<view class="er"> 客流量</view>
<view class="er"> 客流量</view>
<view class="er" style="font-size:48rpx
"> {{traffic}}</view>
<view class="er cardNum
"> {{traffic}}</view>
</view>
</view>
<view class="card_passage">
<view class="card_passage">
<image src="../images/keliuliangyellow.png" class="card_image"></image>
<image src="../images/keliuliangyellow.png" class="card_image"></image>
<view class="er"> 曝光量</view>
<view class="er"> 曝光量</view>
<view class="er" style="font-size:48rpx
"> {{exposure}}</view>
<view class="er cardNum
"> {{exposure}}</view>
</view>
</view>
<view class="card_passage">
<view class="card_passage">
<image src="../images/customer.png" class="card_image"></image>
<image src="../images/customer.png" class="card_image"></image>
<view class="er"> 顾客人数</view>
<view class="er"> 顾客人数</view>
<view class="er" style="font-size:48rpx
"> {{customer}}</view>
<view class="er cardNum
"> {{customer}}</view>
</view>
</view>
<view class="card_passage">
<view class="card_passage">
<image src="../images/jindianlv.png" class="card_image"></image>
<image src="../images/jindianlv.png" class="card_image"></image>
<view class="er"> 进店率</view>
<view class="er"> 进店率</view>
<view class="er" style="font-size:48rpx
"> {{entryRate}}%</view>
<view class="er cardNum
"> {{entryRate}}%</view>
</view>
</view>
</view>
</view>
<!-- 客流趋势分析 -->
<!-- 客流趋势分析 -->
<view class="keliuliang" style="margin-top:30rpx">
<view class="keliuliang" style="margin-top:30rpx">
<text class="title_chart">业态客流TOP5走势</text>
<text class="title_chart">业态客流TOP5走势</text>
<view class="tab_tll">
<view class="tab_tll">
<text class="text_tltle {{trendtypes==1?'actives':'defaults'}}" bindtap="ClickPassageFlow" data-type='1'>过店客流</text>
<text class="text_tltle {{trendtypes==1?'actives':'defaults'}}" bindtap="ClickPassageFlow" data-type='1'>过店客流</text>
<text class="text_tltle {{trendtypes==2?'actives':'defaults'}}" bindtap="ClickPassageFlow" data-type='2'>进店客流</text>
<text class="text_tltle {{trendtypes==2?'actives':'defaults'}}" bindtap="ClickPassageFlow" data-type='2'>进店客流</text>
<text class="text_tltle {{trendtypes==3?'actives':'defaults'}}" bindtap="ClickPassageFlow" data-type='3'>顾客人数</text>
<text class="text_tltle {{trendtypes==3?'actives':'defaults'}}" bindtap="ClickPassageFlow" data-type='3'>顾客人数</text>
<text class="text_tltle {{trendtypes==4?'actives':'defaults'}}" bindtap="ClickPassageFlow" data-type='4'>进店率</text>
<text class="text_tltle {{trendtypes==4?'actives':'defaults'}}" bindtap="ClickPassageFlow" data-type='4'>进店率</text>
</view>
</view>
<basic chartId='chartDatatrend' chartData="{{chartData}}" height="500rpx"></basic>
<basic chartId='chartDatatrend' chartData="{{chartData}}" height="500rpx"></basic>
</view>
</view>
<!-- 停留时长统计 -->
<!-- 停留时长统计 -->
<view class="keliuliang" style="margin-top:30rpx">
<view class="keliuliang" style="margin-top:30rpx">
<text class="title_chart">停留时长统计</text>
<text class="title_chart">停留时长统计</text>
<!-- <view class="stome_time">
<!-- <view class="stome_time">
人均停留时长 <text>31</text> 分
人均停留时长 <text>31</text> 分
</view> -->
</view> -->
<basic chartId='chartDatastop' chartData="{{chartDatastop}}" height="500rpx"></basic>
<basic chartId='chartDatastop' chartData="{{chartDatastop}}" height="500rpx"></basic>
</view>
</view>
<!-- 客群性别占比 -->
<!-- 客群性别占比 -->
<view class="keliuliang" style="margin-top:30rpx">
<view class="keliuliang" style="margin-top:30rpx">
<text class="title_chart">客群性别占比</text>
<text class="title_chart">客群性别占比</text>
<basic chartId='chartDataSex' chartData="{{chartDataSex}}" height="500rpx"></basic>
<basic chartId='chartDataSex' chartData="{{chartDataSex}}" height="500rpx"></basic>
</view>
</view>
<!--客群年龄占比 -->
<!--客群年龄占比 -->
<view class="keliuliang" style="margin-top:30rpx">
<view class="keliuliang" style="margin-top:30rpx">
<text class="title_chart">客群年龄占比</text>
<text class="title_chart">客群年龄占比</text>
<basic chartId='chartDataAge' chartData="{{chartDataAge}}" height="500rpx"></basic>
<basic chartId='chartDataAge' chartData="{{chartDataAge}}" height="500rpx"></basic>
</view>
</view>
<!-- 自定义时间选择器 -->
</view>
<van-calendar show="{{ show }}" min-date="{{ minDate }}" bind:close="onClose" color="#447bff" bind:confirm="onConfirm" type='range' />
<!-- 自定义时间选择器 -->
<van-calendar show="{{ show }}" min-date="{{ minDate }}" bind:close="onClose" color="#447bff" bind:confirm="onConfirm" type='range' />
</view>
</view>
\ No newline at end of file
\ No newline at end of file
miniProject/index/index2.wxss
View file @
54a2adc
/* pages/homes/index.wxss */
/* pages/homes/index.wxss */
.title {
.title {
box-sizing: border-box;
box-sizing: border-box;
position: fixed;
position: fixed;
left: 0;
left: 0;
top: 0;
top: 0;
width: 100%;
width: 100%;
z-index: 99;
z-index: 99;
display: flex;
display: flex;
align-items: center;
align-items: center;
justify-content: center;
justify-content: center;
background-color: #D5E2FF;
background-color: #D5E2FF;
height: 140rpx;
height: 140rpx;
font-size: 34rpx;
font-size: 34rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
font-weight: 500;
padding-top: 40rpx;
padding-top: 40rpx;
color: #000000;
color: #000000;
}
}
.container {
.container {
margin-top: 140rpx;
height: 100%;
padding: 10rpx 20rpx 60px;
background: linear-gradient(154deg, #C7D3FF 0%, #E9F9FF 48%, #FFFFFF 100%);
}
}
.contianer_shop {
.contianer_shop {
width: 100%;
width: 100%;
height: 168rpx;
height: 168rpx;
position: relative;
position: relative;
margin-top: 20rpx;
}
}
.images {
.images {
position: absolute;
position: absolute;
left: 0;
left: 0;
top: 0;
top: 0;
z-index: 0;
width: 100%;
width: 100%;
height: 100%;
height: 100%;
}
}
.shop_name {
.shop_name {
margin: 20rpx 0 10rpx 20rpx;
padding: 30rpx 0 10rpx 28rpx;
font-size: 34rpx;
font-size: 40rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
font-weight: 500;
color: #FFFFFF;
color: #FFFFFF;
display: flex;
line-height: 56rpx;
align-items: flex-end;
position: absolute;
position: relative;
z-index: 1;
}
.fonts{
font-size: 48rpx;
}
}
.shop_name::after {
.shop_name::after {
content: '';
content: '';
width: 0;
display: inline-block;
height: 0;
width: 0;
margin-left: 10rpx;
height: 0;
border: 20rpx solid #fff;
margin-left: 20rpx;
border-color: transparent;
border: 20rpx solid #fff;
border-top-color: #fff;
border-color: transparent;
border-top-color: #fff;
position: absolute;
bottom: 0;
}
}
.shop_time {
.shop_time {
margin-left: 20rpx;
position: absolute;
font-size: 26rpx;
top: 90rpx;
font-family: PingFangSC-Regular, PingFang SC;
margin-left: 28rpx;
font-weight: 400;
font-size: 28rpx;
color: rgba(255, 255, 255, 0.65);
font-family: PingFangSC-Regular, PingFang SC;
position: relative;
font-weight: 400;
color: rgba(255, 255, 255, 0.65);
}
}
.tab_tll {
.tab_tll {
padding: 0 10rpx;
padding: 0 10rpx;
width: 100%;
width: 100%;
margin-top: 30rpx;
margin-top: 30rpx;
position: relative;
position: relative;
display: flex;
/* justify-content: space-between; */
}
}
.tab_tll .text_tltle {
.tab_tll .text_tltle {
font-size: 28rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
font-weight: 400;
margin-right: 30rpx;
margin-right: 30rpx;
}
}
.actives {
.actives {
font-weight: 500;
font-weight: 500;
color: #000000;
color: #000000;
border-bottom: 4px solid #447BFF;
border-bottom: 4px solid #447BFF;
}
}
.defaults {
.defaults {
color: rgba(0, 0, 0, 0.6);
color: rgba(0, 0, 0, 0.6);
}
}
.time_input {
.time_input {
margin-top: 30rpx;
margin-top: 30rpx;
width: 100%;
width: 100%;
height: 80rpx;
height: 80rpx;
background-color: rgba(131, 164, 255, 0.39);
background-color: rgba(131, 164, 255, 0.39);
border-radius: 40rpx;
border-radius: 40rpx;
display: flex;
display: flex;
align-items: center;
align-items: center;
padding: 0 0 0 50rpx;
padding: 0 0 0 50rpx;
}
}
.text_input{
font-size: 28rpx;
.text_input {
font-family: PingFangSC-Regular, PingFang SC;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
font-weight: 400;
color: rgba(0,0,0,
0.9);
color: rgba(0, 0, 0,
0.9);
}
}
.card {
.card {
width: 100%;
width: 100%;
margin-top: 30rpx;
margin-top: 30rpx;
display: flex;
display: flex;
flex-wrap: wrap;
flex-wrap: wrap;
justify-content: space-between;
justify-content: space-between;
}
}
.card>view {
.card>view {
width: 48%;
width: 48%;
height: 148rpx;
height: 148rpx;
/* background-color: red; */
/* background-color: red; */
position: relative;
position: relative;
padding: 20rpx 20rpx;
padding: 20rpx 20rpx;
}
}
.card>view:nth-child(n+3) {
.card>view:nth-child(n+3) {
margin-top: 30rpx;
margin-top: 30rpx;
}
}
.card_image {
.card_image {
position: absolute;
position: absolute;
left: 0;
left: 0;
top: 0;
top: 0;
z-index: 0;
z-index: 0;
width: 100%;
width: 100%;
height: 148rpx;
height: 148rpx;
}
}
.er{
position: relative;
.er {
z-index: 1;
position: relative;
font-size: 28rpx;
z-index: 1;
font-size: 28rpx;
}
}
.er.cardNum {
font-size: 40rpx;
}
.card_passage {
.card_passage {
display: flex;
display: flex;
flex-direction: column;
flex-direction: column;
justify-content: space-between;
justify-content: space-between;
font-size: 24rpx;
font-size: 24rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
font-weight: 500;
color: #FFFFFF;
color: #FFFFFF;
}
}
.keliuliang {
.keliuliang {
width: 100%;
width: 100%;
padding: 20rpx;
padding: 20rpx;
border-radius: 20rpx;
border-radius: 20rpx;
background-color: #fff;
background-color: #fff;
}
}
.keliuliang>text {
.keliuliang>text {
height: 44rpx;
height: 44rpx;
font-size: 32rpx;
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
font-weight: 500;
color: #333333;
color: #333333;
line-height: 44rpx;
line-height: 44rpx;
display: flex;
display: flex;
align-items: center;
align-items: center;
}
}
.keliuliang>text::before {
.keliuliang>text::before {
content: '';
content: '';
width: 6rpx;
width: 6rpx;
height: 30rpx;
height: 30rpx;
margin-right: 10rpx;
margin-right: 10rpx;
background: #5889FF;
background: #5889FF;
border-radius: 3rpx;
border-radius: 3rpx;
}
}
.title_chart {
.title_chart {
font-size: 32rpx;
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
color: rgba(0, 0, 0, 0.85);
}
}
.stome_time {
.stome_time {
margin-top: 20rpx;
margin-top: 20rpx;
font-size: 28rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
color: rgba(0, 0, 0, 0.65);
}
}
.stome_time text {
.stome_time text {
font-size: 30rpx;
font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
font-weight: 400;
color: #5A95EC;
color: #5A95EC;
}
}
\ No newline at end of file
\ No newline at end of file
miniProject/pages/homes/index.js
0 → 100644
View file @
54a2adc
// pages/homes/index.js
Page
({
/**
* 页面的初始数据
*/
data
:
{
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
()
{
},
/**
* 生命周期函数--监听页面显示
*/
onShow
()
{
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
()
{
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
()
{
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh
()
{
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
()
{
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
()
{
}
})
\ No newline at end of file
\ No newline at end of file
miniProject/pages/homes/index.wxml
0 → 100644
View file @
54a2adc
<!--pages/homes/index.wxml-->
<text>pages/homes/index.wxml</text>
miniProject/pages/login/index.wxml
View file @
54a2adc
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
<input class="userInput" placeholder="请输入密码" password bindinput="changePassword" value="{{ password }}" cursor-spacing="{{40}}" />
<input class="userInput" placeholder="请输入密码" password bindinput="changePassword" value="{{ password }}" cursor-spacing="{{40}}" />
</view>
</view>
<view class="login-btn">
<view class="login-btn">
<
view style="opacity:0;pointer-events: none;" class="login-btn-text" bindtap="changeBaseUrl">切换地址</view
>
<
!-- <view style="opacity:0;pointer-events: none;" class="login-btn-text" bindtap="changeBaseUrl">切换地址</view> --
>
<button class="btn" bindtap="login">登录</button>
<button class="btn" bindtap="login">登录</button>
</view>
</view>
</view>
</view>
...
...
miniProject/pages/login/index.wxss
View file @
54a2adc
...
@@ -110,7 +110,7 @@
...
@@ -110,7 +110,7 @@
}
}
.login-btn .btn {
.login-btn .btn {
width:
316rpx
;
width:
100%
;
height: 84rpx;
height: 84rpx;
background:rgba(0,105,255,1);
background:rgba(0,105,255,1);
border-radius: 16rpx;
border-radius: 16rpx;
...
...
miniProject/pages/shopSelect/index.wxml
View file @
54a2adc
<!--pages/sameProportion/sameProportion.wxml-->
<!--pages/sameProportion/sameProportion.wxml-->
<import src="../../components/wxSortPickerView/wxSortPickerView.wxml" />
<view class="">
<import src="../../components/wxSortPickerView/wxSortPickerView.wxml" />
<!-- <view class="containers">
<!-- <view class="containers">
<navbar page-name="店铺选择" bg-color="#3A63FF" navbar-color="#fff" nav='back' bindonGoBack='goBacks' />
<navbar page-name="店铺选择" bg-color="#3A63FF" navbar-color="#fff" nav='back' bindonGoBack='goBacks' />
<view class="part-list">
<view class="part-list">
<view>搜索</view> -->
<view>搜索</view> -->
<view class="titles">请选择
<navbar page-name="请选择" bindonGoBack='goBacks' nav='back' bg-color="RGBA(213, 227, 255, 1)" navbar-color="#000"></navbar>
<!-- <view class="titles">请选择
<view class="befores" bindtap='goBacks'></view>
<view class="befores" bindtap='goBacks'></view>
</view>
</view>
-->
<view class="search">
<view class="search">
<van-field value="{{ value }}" placeholder="请输入要搜索的内容" border="{{ true }}" bind:change="onChange" />
<van-field value="{{ value }}" placeholder="请输入要搜索的内容" border="{{ true }}" bind:change="onChange" />
</view>
</view>
<!-- 模板 -->
<!-- 模板 -->
<view class="tesl">
<view class="tesl">
<template is="wxSortPickerView" data="{{wxSortPickerData}}"></template>
<template is="wxSortPickerView" data="{{wxSortPickerData}}"></template>
</view>
</view>
</view>
\ No newline at end of file
\ No newline at end of file
miniProject/pages/shopSelect/index.wxss
View file @
54a2adc
/* pages/sameProportion/sameProportion.wxss */
/* pages/sameProportion/sameProportion.wxss */
@import '../../components/wxSortPickerView/wxSortPickerView.wxss';
@import '../../components/wxSortPickerView/wxSortPickerView.wxss';
.titles {
.titles {
height: 160rpx;
height: 160rpx;
width: 100%;
width: 100%;
box-sizing: border-box;
box-sizing: border-box;
text-align: center;
text-align: center;
padding-top: 90rpx;
padding-top: 90rpx;
background-color: #3A63FF;
background-color: #3A63FF;
font-size: 34rpx;
font-size: 34rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
font-weight: 500;
color: #fff;
color: #fff;
position: relative;
position: relative;
}
}
.befores{
position: absolute;
width: 30rpx;
height: 30rpx;
border: 1px solid #fff;
border-bottom-color: transparent;
border-right-color: transparent;
transform: rotate(315deg);
left: 40rpx;
top: 100rpx;
.befores {
position: absolute;
width: 30rpx;
height: 30rpx;
border: 1px solid #fff;
border-bottom-color: transparent;
border-right-color: transparent;
transform: rotate(315deg);
left: 40rpx;
top: 100rpx;
}
}
.search{
height: 80rpx;
.search {
box-sizing: border-box;
height: 80rpx;
background: red;
box-sizing: border-box;
/* background: red; */
margin-top: 110rpx;
}
}
.tesl{
height: calc(100% - 240rpx);
.tesl {
overflow: auto;
height: auto;
padding: 0 20rpx;
overflow: auto;
padding: 0 20rpx;
}
}
\ No newline at end of file
\ No newline at end of file
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