Commit 81e10957 by 李君

优化

1 parent 170141d4
// pages/homes/index.js // pages/homes/index.js
const App = getApp();
import moment from 'moment' import moment from 'moment'
import { import {
getMalls, getMalls,
...@@ -16,6 +17,8 @@ Page({ ...@@ -16,6 +17,8 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
navHeight: App.globalData.navHeight,
windowHeight: App.globalData.windowHeight,
currentTime: moment().format("YYYY-MM-DD"), currentTime: moment().format("YYYY-MM-DD"),
types: 1, //选中的时间类型 types: 1, //选中的时间类型
trendtypes: 1, //选中的业态趋势类型 trendtypes: 1, //选中的业态趋势类型
...@@ -53,6 +56,17 @@ Page({ ...@@ -53,6 +56,17 @@ Page({
val: 'PerAreaValue' val: 'PerAreaValue'
}], }],
}, },
onShow:function(){
this.activeTabBar(1)
},
activeTabBar(currentMenu) {
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
this.getTabBar().setData({
// 当前页面的 tabBar 索引
curClick: currentMenu
})
}
},
// 关闭自定义日期选择 // 关闭自定义日期选择
onClose() { onClose() {
this.setData({ this.setData({
......
{ {
"usingComponents": { "usingComponents": {
"navbar": "/components/navbar/index",
"basic":"/components/echart/basic/index", "basic":"/components/echart/basic/index",
"van-calendar": "@vant/weapp/calendar/index", "van-calendar": "@vant/weapp/calendar/index",
"van-progress": "@vant/weapp/progress/index", "van-progress": "@vant/weapp/progress/index",
"van-button": "@vant/weapp/button/index", "van-button": "@vant/weapp/button/index",
"van-grid": "@vant/weapp/grid/index", "van-grid": "@vant/weapp/grid/index",
"van-grid-item": "@vant/weapp/grid-item/index" "van-grid-item": "@vant/weapp/grid-item/index"
} },
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#0268FF",
"navigationBarTextStyle": "white"
} }
\ No newline at end of file \ No newline at end of file
<!--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">{{selectName}}</view> <image src="../../images/banner.png" class='images'></image>
<view class="shop_time"> <view class="shop_name">{{selectName}}</view>
<text>开业门店总数:254个</text> <view class="shop_time">
</view> <text>开业门店总数:254个</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 class="cardName"> 路过客流量</view>
<view class="cardNum"> 35480</view>
</view>
<view class="card_passage">
<image src="../../images/keliuliangyellow.png" class="card_image"></image>
<view class="cardName"> 客流量</view>
<view class="cardNum"> 35480</view>
</view>
<view class="card_passage">
<image src="../../images/customer.png" class="card_image"></image>
<view class="cardName"> 顾客人数</view>
<view class="cardNum"> 35480</view>
</view>
<view class="card_passage">
<image src="../../images/jindianlv.png" class="card_image"></image>
<view class="cardName"> 进店率</view>
<view class="cardNum"> 35480</view>
</view>
</view>
<!-- 客流趋势分析 -->
<view class="keliuliang">
<text class="title_chart">客流趋势分析</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">
<text class="title_chart">停留时长统计</text>
<basic chartId='chartDatastop' chartData="{{chartDatastop}}" height="500rpx"></basic>
</view>
<!-- 门店排行 -->
<view class="keliuliang">
<text class="title_chart">门店排行</text>
<view style="margin-top:20rpx"></view>
<van-grid class="indexList" column-num="4" gutter='{{5}}'>
<van-grid-item bindtap="clickIndex" data-val="{{item.val}}" custom-class="desc_info" content-class="{{indexVal==item.val?'desc_content_active':'desc_content'}}" text-class="{{indexVal==item.val?'desc_text_active':'desc_text'}}" text="{{item.name}}" wx:for="{{ indexList }}" wx:for-item="item" wx:key="{{item.val}}" />
</van-grid>
<view class="list">
<view class="item" wx:for="{{rankData}}" wx:for-item="item" wx:key="index">
<view class="info">
<view class="shopName ~ellipsis">
<text class="idx color">{{index*1+1+','+item.name}}</text>
</view>
<view class="num color">
{{item.value}}
</view>
</view>
<view class="progress progressCustom">
<view class="bar">
<van-progress show-pivot="{{false}}" percentage="{{item.percentage}}" stroke-width="10" />
</view>
</view>
</view>
</view>
</view>
</view> <!-- 自定义时间选择器 -->
<!-- 选择时间 --> <van-calendar show="{{ show }}" min-date="{{ minDate }}" max-date="{{ maxDate }}" bind:close="onClose" color="#447bff" bind:confirm="onConfirm" type='range' />
<view class="tab_tll"> </view>
<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">客流趋势分析</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>
<basic chartId='chartDatastop' chartData="{{chartDatastop}}" height="500rpx"></basic>
</view>
<!-- 门店排行 -->
<view class="keliuliang" style="margin-top:30rpx;">
<text class="title_chart">门店排行</text>
<view style="margin-top:20rpx"></view>
<van-grid class="indexList" column-num="4" gutter='{{5}}'>
<van-grid-item bindtap="clickIndex" data-val="{{item.val}}" custom-class="desc_info" content-class="{{indexVal==item.val?'desc_content_active':'desc_content'}}" text-class="{{indexVal==item.val?'desc_text_active':'desc_text'}}" text="{{item.name}}" wx:for="{{ indexList }}" wx:for-item="item" wx:key="{{item.val}}" />
</van-grid>
<view class="list">
<view class="item" wx:for="{{rankData}}" wx:for-item="item" wx:key="index">
<view class="info">
<view class="shopName ~ellipsis">
<text class="idx color">{{index*1+1+','+item.name}}</text>
</view>
<view class="num color">
{{item.value}}
</view>
</view>
<view class="progress progressCustom">
<view class="bar">
<van-progress show-pivot="{{false}}" percentage="{{item.percentage}}" stroke-width="10" />
</view>
</view>
</view>
</view>
</view>
<!-- 自定义时间选择器 -->
<van-calendar show="{{ show }}" min-date="{{ minDate }}" max-date="{{ maxDate }}" bind:close="onClose" color="#447bff" bind:confirm="onConfirm" type='range' />
</view> </view>
\ No newline at end of file \ No newline at end of file
/* pages/homes/index.wxss */ /* pages/homes/index.wxss */
.title { .container{
box-sizing: border-box; height: 100%;
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 { .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: -1; 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;
line-height: 56rpx;
position: absolute;
} }
.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;
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;
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;
} }
.actives { .actives {
color: #000000; color: #000000;
border-bottom: 4px solid #447BFF; border-bottom: 4px solid #447BFF;
} }
.defaults { .defaults {
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
} }
.time_input { .time_input {
margin-top: 30rpx; margin-top: 30rpx;
width: 100%; width: 100%;
height: 80rpx; height: 80rpx;
background-color: #D0E0FF; 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;
} }
.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_passage {
.card>view { width: 48%;
width: 48%; height: 148rpx;
height: 148rpx; position: relative;
/* background-color: red; */ padding: 20rpx 20rpx 0;
position: relative; font-size: 40rpx;
padding: 10rpx 20rpx; font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
}
.cardName{
position: absolute;
font-size: 28rpx;
}
.cardNum{
position: absolute;
top: 65rpx;
} }
.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: -1; width: 100%;
width: 100%; height: 148rpx;
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 { .keliuliang {
width: 100%; width: 100%;
padding: 20rpx; padding: 20rpx;
border-radius: 20rpx; border-radius: 20rpx;
background-color: #fff; background-color: #fff;
margin-top: 30rpx;
} }
.keliuliang>text { .keliuliang>text {
height: 44rpx; height: 44rpx;
font-size: 32rpx; line-height: 44rpx;
font-family: PingFangSC-Medium, PingFang SC; display: flex;
font-weight: 500; align-items: center;
color: #333333;
line-height: 44rpx;
display: flex;
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;
}
.indexList {
/* margin-bottom: 20rpx;
margin-top: 20rpx; */
} }
.indexList .desc_content { .indexList .desc_content {
padding: 0 !important; padding: 0 !important;
border: 2rpx solid #DCDFE6; border: 2rpx solid #DCDFE6;
border-radius: 100rpx; border-radius: 100rpx;
} }
.indexList .desc_info { .indexList .desc_info {
height: 50rpx; height: 50rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
border-radius: 100rpx; border-radius: 100rpx;
} }
.indexList .desc_info:nth-child(4) { .indexList .desc_info:nth-child(4) {
margin-right: 0 !important; margin-right: 0 !important;
} }
.indexList .desc_text { .indexList .desc_text {
margin-bottom: 8px; margin-bottom: 8px;
font-size: 24rpx; font-size: 24rpx;
} }
.indexList .desc_content_active { .indexList .desc_content_active {
padding: 0 !important; padding: 0 !important;
/* border: 2rpx solid#447BFF; */ /* border: 2rpx solid#447BFF; */
background-color: #447BFF; background-color: #447BFF;
border-radius: 100rpx; border-radius: 100rpx;
} }
.indexList .desc_text_active { .indexList .desc_text_active {
margin-bottom: 8px; margin-bottom: 8px;
font-size: 25rpx; font-size: 25rpx;
color: #fff; color: #fff;
} }
.van-hairline--surround::after { .van-hairline--surround::after {
border: none border: none
} }
.van-hairline--bottom::after, .van-hairline--bottom::after,
...@@ -233,49 +197,49 @@ ...@@ -233,49 +197,49 @@
.van-hairline--top-bottom::after, .van-hairline--top-bottom::after,
.van-hairline--top::after, .van-hairline--top::after,
.van-hairline::after { .van-hairline::after {
border: none !important border: none !important
} }
.list { .list {
position: relative; position: relative;
padding-top: 20rpx; padding-top: 20rpx;
} }
.list .item { .list .item {
position: relative; position: relative;
padding: 10rpx 0; padding: 10rpx 0;
border-bottom: 1rpx solid #fafafa; border-bottom: 1rpx solid #fafafa;
} }
.list .item .info { .list .item .info {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-size: 24rpx; font-size: 24rpx;
} }
.list .item .shopName { .list .item .shopName {
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
} }
.list .item .shopName .idx { .list .item .shopName .idx {
margin-right: 5rpx; margin-right: 5rpx;
} }
.list .item .progress { .list .item .progress {
padding: 10rpx 0rpx; padding: 10rpx 0rpx;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.list .item .progress .bar { .list .item .progress .bar {
width: 100%; width: 100%;
position: relative; position: relative;
} }
.list .item .num { .list .item .num {
color: #4C83FF; color: #4C83FF;
/* width:100rpx; */ /* width:100rpx; */
text-align: right; text-align: right;
font-size: 28rpx; font-size: 28rpx;
font-weight: 900; font-weight: 900;
} }
\ No newline at end of file \ 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!