Commit ee489088 by tianlonglong

样式修改

2 parents 00072c7c 2edcfb76
......@@ -4,7 +4,6 @@
"index/index2",
"index/me",
"pages/login/index",
"pages/homes/index",
"pages/editPwd/editPwd",
"pages/shopSelect/index"
],
......
Component({
data: {
show:true,
curClick: 1,
color: "#7A7E83",
selectedColor: "#3cc51f",
......
<!--miniprogram/custom-tab-bar/index.wxml-->
<view class="tab-bar">
<view class="tab-bar" wx:if="{{show}}">
<view class="tab-bar-border"></view>
<view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" bindtap="switchTab">
<image src="{{curClick === item.curr ? item.selectedIconPath : item.iconPath}}"></image>
......
module.exports = {
"title": "集团近期趋势",
"series": [{
"name": "Passenger flow",
"data": [
1748,
1715,
2563,
2305,
1848,
1783,
1454
],
"type": "line"
}],
"xaxis": {
"data": [
"02-24(Thu)",
"02-25(Fri)",
"02-26(Sat)",
"02-27(Sun)",
"02-28(Mon)",
"03-01(Tue)",
"03-02(Wed)"
]
}
}
\ No newline at end of file

954 Bytes | W: | H:

1.55 KB | W: | H:

miniProject/images/cong-b.png
miniProject/images/cong-b.png
miniProject/images/cong-b.png
miniProject/images/cong-b.png
  • 2-up
  • Swipe
  • Onion skin

549 Bytes | W: | H:

1.12 KB | W: | H:

miniProject/images/cong.png
miniProject/images/cong.png
miniProject/images/cong.png
miniProject/images/cong.png
  • 2-up
  • Swipe
  • Onion skin
{"_id":"17e3426e621d96b01143206170173ff0","region":"华东","city":"上海","sales":11}
{"_id":"bf4a0bf2621d96b01210a164583fc1ae","region":"华东","city":"南京","sales":11}
{"_id":"17e3426e621d96b0114320640f4572a9","region":"华南","city":"广州","sales":22}
{"_id":"bf4a0bf2621d96b01210a1664cd6018a","region":"华南","city":"深圳","sales":22}

1.63 KB | W: | H:

1.24 KB | W: | H:

miniProject/images/home-b.png
miniProject/images/home-b.png
miniProject/images/home-b.png
miniProject/images/home-b.png
  • 2-up
  • Swipe
  • Onion skin

1.1 KB | W: | H:

897 Bytes | W: | H:

miniProject/images/home.png
miniProject/images/home.png
miniProject/images/home.png
miniProject/images/home.png
  • 2-up
  • Swipe
  • Onion skin

1.87 KB | W: | H:

1.94 KB | W: | H:

miniProject/images/me-b.png
miniProject/images/me-b.png
miniProject/images/me-b.png
miniProject/images/me-b.png
  • 2-up
  • Swipe
  • Onion skin

1.36 KB | W: | H:

1.42 KB | W: | H:

miniProject/images/me.png
miniProject/images/me.png
miniProject/images/me.png
miniProject/images/me.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -28,8 +28,8 @@ Component({
trendtypes: 'PassengerFlow', //选中的客流趋势类型
chartData: {}, //客流趋势分析数据
show: false, //显示日期自定义选择
minDate: new Date(2022, 0, 1).getTime(), //自定义时间的开始日期
maxDate: new Date(2022, 11, 31).getTime(), //自定义时间的结束日期
minDate: new Date(2020, 0, 1).getTime(), //自定义时间的开始日期
// maxDate: new Date(2222, 0, 31).getTime(), //自定义时间的结束日期
rankData: [],
indexVal: 'PassengerFlow',
indexList: [{
......@@ -61,6 +61,9 @@ Component({
methods: {
// 关闭自定义日期选择
onClose() {
this.getTabBar().setData({
show: true
});
this.setData({
show: false
});
......@@ -75,6 +78,9 @@ Component({
},
// 点击自定义日期选择器的确定
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")
......@@ -108,6 +114,9 @@ Component({
show: true,
types: e.target.dataset.type,
})
this.getTabBar().setData({
show: false,
});
break;
}
if (dateType != 5) {
......@@ -214,8 +223,15 @@ Component({
// 返回趋势图配置项
getLineConfig(res) {
let xasix = res.xaxis.data || []
let seriesList = res.series || []
if (seriesList.length < 1) {
let seriesList = res.series || [];
let data = seriesList[0].data;
let isData = false;
for (let index = 0; index < data.length; index++) {
if(data[index] != null){
isData = true;
}
}
if (!isData) {
return {
title: {
text: '暂无数据',
......
......@@ -88,6 +88,6 @@
</view>
<!-- 自定义时间选择器 -->
<van-calendar show="{{ show }}" min-date="{{ minDate }}" max-date="{{ maxDate }}" 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
......@@ -77,6 +77,6 @@
<text class="title_chart">客群年龄占比</text>
<basic chartId='chartDataAge' chartData="{{chartDataAge}}" height="500rpx"></basic>
</view>
<!-- 自定义时间选择器 -->
<van-calendar show="{{ show }}" min-date="{{ minDate }}" max-date="{{ maxDate }}" 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>
\ No newline at end of file
// pages/zong/index.js
import {
getPatrolRecordList
} from "../../api/tour.js";
const App = getApp();
import _ from 'underscore';
Page({
/**
* 页面的初始数据
*/
data: {
navHeight: App.globalData.navHeight,
windowHeight: App.globalData.windowHeight,
windowWidth: App.globalData.windowWidth,
menuItems: [{
name: '基础客流',
icon: '1',
path: '/pages/zong/basic/index'
},
{
name: '进出客流',
icon: '2',
path: '/pages/zong/contrast/index'
},
// {
// name: '排行榜',
// icon: '3',
// path: '/pages/zong/ranking/index'
// },
// {
// name: '同环比',
// icon: '4',
// path: '/pages/zong/sequential/index'
// },
// {
// name: '时段客流',
// icon: '5',
// path: '/pages/zong/timeTravel/index'
// },
{
name: '节假日客流',
icon: '6',
path: '/pages/zong/holiday-comparison/index'
},
{
name: '进店率',
icon: '7',
path: '/pages/zong/entry-rate/index'
}
],
tourItems:[{
id:1,
name: '实时监控',
icon: '8',
path: '/pages/tour/gate/index?type=view'
},{
id:2,
name: '远程巡店',
icon: '9',
path: '/pages/tour/gate/index?type=tour'
},{
id:3,
name: '点检巡店',
icon: '10',
path: '/pages/tour/point/index'
},{
id:4,
name: '我发起的',
icon: '11',
path: '/pages/tour/list/index?type=create'
},{
id:5,
name: '待我处理',
icon: '12',
path: '/pages/tour/list/index?type=handle'
}]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
const deploymentType = wx.getStorageSync('deploymentType');
const { menuItems } = this.data
if (deploymentType === 'store') {
// this.setData({ menuItems })
}
},
onShow:function(){
let name = wx.getStorageSync('name');
Promise.all([getPatrolRecordList({status:2,createBy:name}),getPatrolRecordList({status:1,handler:name})]).then(res=>{
let total1 = res[0].data.total;
let total2 = res[1].data.total;
let tourItems = this.data.tourItems;
let titem1 = _.findWhere(tourItems,{id:4});
titem1.dot = total1;
let titem2 = _.findWhere(tourItems,{id:5});
titem2.dot = total2;
this.setData({
tourItems
})
})
this.activeTabBar(2)
},
activeTabBar(currentMenu) {
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().setData({
// 当前页面的 tabBar 索引
curClick: currentMenu
})
}
},
goOtherPage: function(e) {
const { path } = e.currentTarget.dataset.value
wx.navigateTo({ url: path })
}
})
\ No newline at end of file
{
"usingComponents": {
"navbar": "/components/navbar/index"
}
}
\ No newline at end of file
<view class="container" style="padding-top: {{navHeight}}px;height:{{windowHeight-navHeight}}px;">
<navbar page-name="综合分析" bg-color="#fff" navbar-color="rgba(0, 0, 0, .85)" />
<view class="part-list" scroll-y>
<!-- 我的 S -->
<!-- <view class="my part">
</view> -->
<!-- 我的 E -->
<!-- 客流统计 S -->
<view class="static part">
<view class="title">客流统计</view>
<view class="list">
<view wx:for="{{menuItems}}" wx:for-index="index" wx:for-item="n" wx:key="index" class="item" bindtap="goOtherPage" data-value="{{n}}">
<image src="{{ '../../images/icon/' + n.icon + '.png' }}" class="img" />
<view class="tit">{{n.name}}</view>
</view>
</view>
</view>
<!-- 客流统计 E -->
<!-- 店内分析 S -->
<!-- <view class="analysis part">
</view> -->
<!-- 店内分析 E -->
<!-- 巡店管理 S -->
<!-- <view class="watch part">
<view class="title">巡店管理</view>
<view class="list">
<view wx:for="{{tourItems}}" wx:for-index="index" wx:for-item="n" wx:key="index" class="item" bindtap="goOtherPage" data-value="{{n}}">
<image src="{{ '../../images/icon/' + n.icon + '.png' }}" class="img" />
<view class="tit">{{n.name}}</view>
<view class="dot" wx:if="{{n.dot}}"></view>
</view>
</view>
</view> -->
<!-- 巡店管理 E
<!-- 员工管理 S -->
<!-- <view class="worker part">
</view> -->
<!-- 员工管理 E -->
</view>
<!-- <view class="zong-content">
<view wx:for="{{menuItems}}" wx:for-index="index" wx:for-item="n" wx:key="index" class="item" bindtap="goOtherPage" data-value="{{n}}">
<image src="{{ '../../images/icon/' + n.icon + '.png' }}" class="img" />
<view class="line"></view>
<view>{{n.name}}</view>
<image src="../../images/arrow-r.png" class="arrow" />
</view>
</view> -->
</view>
\ No newline at end of file
/* pages/zong/index.wxss */
.part-list{
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 0rpx 0rpx;
}
.part-list .part{
position: relative;
width: 710rpx;
background-color: #fff;
border-radius: 10rpx;
padding:25rpx;
margin:25rpx auto 0;
}
.scroll-view .part .title{
color:#525252;
font-size:36rpx;
}
.part-list .part .list{
position: relative;
display: flex;
flex-wrap: wrap;
justify-content:start;
margin-top:30rpx;
}
.part-list .part .list .item{
position: relative;
width:165rpx;
padding:12rpx 0;
}
.part-list .part .list .item .img{
height: 100rpx;
width:100rpx;
display: block;
margin: 0 auto 0;
}
.part-list .part .list .item .tit{
font-size: 24rpx;
text-align: center;
margin-top: 10rpx;
}
.part-list .part .list .item .dot{
position: absolute;
width: 20rpx;
height: 20rpx;
border-radius: 50%;
background-color: #f00;
top:2px;
right: 24rpx;
}
.zong-content {
width: 100%;
height: 100%;
overflow-y: scroll;
box-sizing: border-box;
padding: 18rpx 28rpx;
}
.zong-content .item {
width: 100%;
height: 118rpx;
background-color: #fff;
border-radius: 18rpx;
display: flex;
align-items: center;
margin-bottom: 16rpx;
color: rgba(0, 0, 0, .85);
font-size: 28rpx;
box-sizing: border-box;
padding: 0 38rpx 0 32rpx;
position: relative;
}
.zong-content .item .img {
width: 57rpx;
height: 57rpx;
border-radius: 10rpx;
}
.zong-content .item .line {
width: 3.5rpx;
height: 68rpx;
background-color: rgba(0, 0, 0, .1);
margin: 0 34rpx 0 24rpx;
}
.zong-content .item .arrow {
position: absolute;
right: 38rpx;
top: 50rpx;
color: rgba(0, 0, 0, .1);
width: 24rpx;
height: 24rpx;
}
\ No newline at end of file
// pages/homes/index.js
import moment from 'moment'
import {
getMalls,
} from "../../api/login";
import {
getCardData,
getTrendData,
getStopTimeData,
getAgeSexData,
getShopDetailData
} from '../../api/shop'
Page({
/**
* 页面的初始数据
*/
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: [], //店铺的名字下拉列表
},
// 关闭自定义日期选择
onClose() {
this.setData({
show: false
});
},
// 跳转到店铺选择
selectContent() {
wx.navigateTo({
url: '/pages/shopSelect/index?current=' + JSON.stringify(this.data.columnsListName),
})
},
// 点击自定义日期选择器的确定
onConfirm(event) {
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,
})
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]
}
console.log(startTime,endTime)
getCardData().then(res => {})
},
// 获取业态客流趋势
getTrendList() {
getTrendData().then(res => {})
},
// 获取停留时长统计
getStopTimeList() {
getStopTimeData().then(res => {})
},
// 获取性别和年龄
getAgeSexList() {
getAgeSexData().then(res => {})
},
// 获取性别和年龄
getShopDetailList() {
getShopDetailData().then(res => {})
},
// 获取所有数据
loadData() {
this.getCardList()
this.getTrendList()
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.length < 1) {
// 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',
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: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
},
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: {
show: false,
},
splitLine: {
show: false
}
},
color: ['#FD8C5E', '#6FD3FF', '#BC7FF8', '#4F75FF', '#FF9AC1'],
// series:seriesList.map(item=>({...item,symbol: 'none',smooth: true,}))
series: [{
name: '客流量',
smooth: true,
lineStyle: {
color: '#34BFFF'
},
areaStyle: {
// 区域颜色
color: {
type: 'linear',
x: 0, //右
y: 0, //下
x2: 0, //左
y2: 1, //上
colorStops: [{
offset: 0.1,
color: '#EAF3FF' // 0% 处的颜色
},
{
offset: 1,
color: '#FFFFFF' // 100% 处的颜色
}
]
},
},
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: "line",
symbol: "none",
showSymbol: false,
symbolSize: 20,
}]
}
},
// 返回停留时长配置
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]
];
// let data_sample = [];
// confingData.xaxis.data.forEach((item, i) => {
// let arr = [];
// arr[0] = item;
// arr[1] = confingData.series[0].data[i];
// arr[2] = 100;
// data_sample.push(arr);
// });
// data_sample.unshift(["type", confingData.title, ""]);
return {
color: ["#33CCFF", "#CCEEFF"],
legend: {
show: false
},
grid: {
left: "3%",
right: "4%",
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(confingData) {
let faceGender = {
"title": "人脸性别统计",
"series": [{
"name": "人脸性别统计",
"data": [{
"name": "男",
"value": 85
},
{
"name": "女",
"value": 262
}
],
"type": "pie"
}]
}
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",
top: "center",
icon: "circle",
right: 10,
textStyle: {
color: "#000",
fontSize: 14
},
data: sexLabel,
formatter: function (name) {
for (var i = 0; i < sexLabel.length; i++) {
if (sexLabel[i] == name) {
return name + " " + " " + rate[i] + "%";
}
}
}
}],
series: [{
name: "需求类型占比",
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
}]
};
},
// 返回客群年龄占比
getAgeConfig(configData) {
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": [
"男",
"女"
]
}
}
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: "10%",
right: "5%",
left: "10%",
bottom: "15%"
},
xAxis: [{
type: "category",
axisLabel: {
color: "#8C8D95",
},
axisLine: {
show: true,
lineStyle: {
color: "#0a3e98"
}
},
axisTick: {
show: true
},
splitLine: {
show: false,
lineStyle: {
color: "#195384",
type: "dotted"
}
},
// data: ["小西关村", "谢家井社区", "石家庄村", "大东关社区"],
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;
// }
}]
};
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
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()
})
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
setTimeout(() => {
// console.log(8888)
this.setData({
chartData:this.getLineConfig() , //客流趋势分析数据
chartDatastop: this.getStopTimeConfig(),
chartDataSex: this.getGroupSexConfig(),
chartDataAge: this.getAgeConfig()
})
}, 2000)
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()
})
}
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {
"basic":"/components/echart/basic/index",
"van-calendar": "@vant/weapp/calendar/index"
}
}
\ No newline at end of file
<!--pages/homes/index.wxml-->
<view class="title">店铺首页</view>
<view class="container">
<!-- 名称 -->
<view class="contianer_shop">
<image src="../../images/back.svg" class='images'></image>
<view class="shop_name" bindtap="selectContent">{{selectName}}</view>
<view class="shop_time">
<text>营业时间:09:00-23:00</text>
<text style="margin:0 10rpx"> 面积:2000㎡ </text>
<text> 晴 10℃-17℃</text>
</view>
</view>
<!-- 选择时间 -->
<view class="tab_tll">
<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==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==5?'actives':'defaults'}}" bindtap="ClickTab" data-type='5'>自定义</text>
</view>
<view class="time_input">
<image src="../../images/rili.png" style="width:20px;height:20px;margin-right:20rpx"></image>
<text>{{currentTime}}</text>
</view>
<!-- 卡片 -->
<view class="card">
<view class="card_passage">
<image src="../../images/keliulaing.png" class="card_image"></image>
<view> 路过客流量</view>
<view> 35480</view>
</view>
<view class="card_passage">
<image src="../../images/keliuliangyellow.png" class="card_image"></image>
<view> 客流量</view>
<view> 35480</view>
</view>
<view class="card_passage">
<image src="../../images/customer.png" class="card_image"></image>
<view> 顾客人数</view>
<view> 35480</view>
</view>
<view class="card_passage">
<image src="../../images/jindianlv.png" class="card_image"></image>
<view> 进店率</view>
<view> 35480</view>
</view>
</view>
<!-- 客流趋势分析 -->
<view class="keliuliang" style="margin-top:30rpx">
<text class="title_chart">业态客流TOP5走势</text>
<view class="tab_tll">
<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==3?'actives':'defaults'}}" bindtap="ClickPassageFlow" data-type='3'>顾客人数</text>
<text class="text_tltle {{trendtypes==4?'actives':'defaults'}}" bindtap="ClickPassageFlow" data-type='4'>进店率</text>
</view>
<basic chartId='chartDatatrend' chartData="{{chartData}}" height="500rpx"></basic>
</view>
<!-- 停留时长统计 -->
<view class="keliuliang" style="margin-top:30rpx">
<text class="title_chart">停留时长统计</text>
<view class="stome_time">
人均停留时长 <text>31</text> 分
</view>
<basic chartId='chartDatastop' chartData="{{chartDatastop}}" height="500rpx"></basic>
</view>
<!-- 客群性别占比 -->
<view class="keliuliang" style="margin-top:30rpx">
<text class="title_chart">客群性别占比</text>
<basic chartId='chartDataSex' chartData="{{chartDataSex}}" height="500rpx"></basic>
</view>
<!--客群年龄占比 -->
<view class="keliuliang" style="margin-top:30rpx">
<text class="title_chart">客群年龄占比</text>
<basic chartId='chartDataAge' chartData="{{chartDataAge}}" height="500rpx"></basic>
</view>
<!-- 自定义时间选择器 -->
<van-calendar show="{{ show }}" min-date="{{ minDate }}" max-date="{{ maxDate }}" bind:close="onClose" color="#447bff" bind:confirm="onConfirm" type='range' />
</view>
\ No newline at end of file
/* pages/homes/index.wxss */
.title {
box-sizing: border-box;
position: fixed;
left: 0;
top: 0;
width: 100%;
z-index: 99;
display: flex;
align-items: center;
justify-content: center;
background-color: #D5E2FF;
height: 160rpx;
font-size: 34rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
padding-top: 40rpx;
color: #000000;
}
.container {
margin-top: 160rpx;
padding: 10rpx 20rpx;
}
.contianer_shop {
width: 100%;
height: 168rpx;
position: relative;
}
.images {
position: absolute;
left: 0;
top: 0;
z-index: -1;
width: 100%;
height: 100%;
}
.shop_name {
margin: 20rpx 0 10rpx 20rpx;
font-size: 34rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
display: flex;
align-items: flex-end;
}
.shop_name::after {
content: '';
width: 0;
height: 0;
margin-left: 10rpx;
border: 20rpx solid #fff;
border-color: transparent;
border-top-color: #fff;
}
.shop_time {
margin-left: 20rpx;
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(255, 255, 255, 0.65);
}
.tab_tll {
padding: 0 10rpx;
width: 100%;
margin-top: 30rpx;
position: relative;
display: flex;
justify-content: space-between;
}
.tab_tll .text_tltle {
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
}
.actives {
color: #000000;
border-bottom: 4px solid #447BFF;
}
.defaults {
color: rgba(0, 0, 0, 0.65);
}
.time_input {
margin-top: 30rpx;
width: 100%;
height: 80rpx;
background-color: #D0E0FF;
border-radius: 40rpx;
display: flex;
align-items: center;
padding: 0 0 0 50rpx;
}
.card {
width: 100%;
margin-top: 30rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.card>view {
width: 48%;
height: 148rpx;
/* background-color: red; */
position: relative;
padding: 10rpx 20rpx;
}
.card>view:nth-child(n+3) {
margin-top: 30rpx;
}
.card_image {
position: absolute;
left: 0;
top: 0;
z-index: -1;
width: 100%;
height: 148rpx;
}
.card_passage {
display: flex;
flex-direction: column;
justify-content: space-between;
font-size: 40rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
}
.keliuliang {
width: 100%;
padding: 20rpx;
border-radius: 20rpx;
background-color: #fff;
}
.keliuliang>text {
height: 44rpx;
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
line-height: 44rpx;
display: flex;
align-items: center;
}
.keliuliang>text::before {
content: '';
width: 6rpx;
height: 30rpx;
margin-right: 10rpx;
background: #5889FF;
border-radius: 3rpx;
}
.title_chart {
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
}
.stome_time {
margin-top: 20rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
}
.stome_time text {
font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #5A95EC;
}
\ No newline at end of file
......@@ -2,18 +2,6 @@
const App = getApp();
const customBehavior = require('../../../extends/custom.behavior.js');
import _ from 'underscore';
import * as echarts from '../../../ec-canvas/echarts';
import {
echartInfo
} from '../../../utils/common';
import chartData from '../../../data';
import {
getReportCharts,
getIndexInfo
} from "../../../api/index.js";
import {
getCharts
} from "../../../api/report.js";
Component({
......
......@@ -2,18 +2,6 @@
const App = getApp();
const customBehavior = require('../../../extends/custom.behavior.js');
import _ from 'underscore';
import * as echarts from '../../../ec-canvas/echarts';
import {
echartInfo
} from '../../../utils/common';
import chartData from '../../../data';
import {
getReportCharts,
getIndexInfo
} from "../../../api/index.js";
import {
getCharts
} from "../../../api/report.js";
import cardConfig from '../../../utils/card'
Component({
......
{
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"packOptions": {
"ignore": [],
"include": []
},
"setting": {
"urlCheck": true,
"es6": true,
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": true,
"autoAudits": true,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": false,
"useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false,
"ignoreDevUnusedFiles": false,
"ignoreUploadUnusedFiles": false,
"useStaticServer": true,
"condition": false
},
"compileType": "miniprogram",
"libVersion": "2.14.4",
"appid": "wx220b5d2dbb82ce64",
"projectname": "miniProject",
"cloudfunctionTemplateRoot": "cloudfunctionTemplate/",
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 4
},
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"miniprogram": {
"list": [
{
"name": "pages/accountHome/index",
"pathName": "pages/accountHome/index",
"query": "",
"scene": null
}
]
}
}
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"packOptions": {
"ignore": [],
"include": []
},
"setting": {
"urlCheck": true,
"es6": true,
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": true,
"autoAudits": true,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": false,
"useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false,
"ignoreDevUnusedFiles": false,
"ignoreUploadUnusedFiles": false,
"useStaticServer": true,
"condition": false
},
"compileType": "miniprogram",
"libVersion": "2.14.4",
"appid": "wx220b5d2dbb82ce64",
"projectname": "miniProject",
"cloudfunctionTemplateRoot": "cloudfunctionTemplate/",
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 4
},
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"miniprogram": {
"list": [
{
"name": "pages/accountHome/index",
"pathName": "pages/accountHome/index",
"query": "",
"scene": null
}
]
}
}
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!