Commit 070a35b4 by 李君

1

1 parent 63e1b20c
// 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
{
"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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!