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"> <view class="contianer_shop">
<image src="../../images/back.svg" class='images'></image> <image src="../../images/banner.png" class='images'></image>
<view class="shop_name">{{selectName}}</view> <view class="shop_name">{{selectName}}</view>
<view class="shop_time"> <view class="shop_time">
<text>开业门店总数:254个</text> <text>开业门店总数:254个</text>
</view> </view>
</view> </view>
<!-- 选择时间 --> <!-- 选择时间 -->
<view class="tab_tll"> <view class="tab_tll">
...@@ -26,27 +26,27 @@ ...@@ -26,27 +26,27 @@
<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> 路过客流量</view> <view class="cardName"> 路过客流量</view>
<view> 35480</view> <view class="cardNum"> 35480</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> 客流量</view> <view class="cardName"> 客流量</view>
<view> 35480</view> <view class="cardNum"> 35480</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> 顾客人数</view> <view class="cardName"> 顾客人数</view>
<view> 35480</view> <view class="cardNum"> 35480</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> 进店率</view> <view class="cardName"> 进店率</view>
<view> 35480</view> <view class="cardNum"> 35480</view>
</view> </view>
</view> </view>
<!-- 客流趋势分析 --> <!-- 客流趋势分析 -->
<view class="keliuliang" style="margin-top:30rpx"> <view class="keliuliang">
<text class="title_chart">客流趋势分析</text> <text class="title_chart">客流趋势分析</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>
...@@ -57,12 +57,12 @@ ...@@ -57,12 +57,12 @@
<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">
<text class="title_chart">停留时长统计</text> <text class="title_chart">停留时长统计</text>
<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">
<text class="title_chart">门店排行</text> <text class="title_chart">门店排行</text>
<view style="margin-top:20rpx"></view> <view style="margin-top:20rpx"></view>
<van-grid class="indexList" column-num="4" gutter='{{5}}'> <van-grid class="indexList" column-num="4" gutter='{{5}}'>
...@@ -89,4 +89,5 @@ ...@@ -89,4 +89,5 @@
<!-- 自定义时间选择器 --> <!-- 自定义时间选择器 -->
<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 }}" max-date="{{ maxDate }}" bind:close="onClose" color="#447bff" bind:confirm="onConfirm" type='range' />
</view>
</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;
margin-left: 28rpx;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: rgba(255, 255, 255, 0.65); color: rgba(255, 255, 255, 0.65);
...@@ -62,15 +40,13 @@ ...@@ -62,15 +40,13 @@
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 {
...@@ -86,7 +62,7 @@ ...@@ -86,7 +62,7 @@
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;
...@@ -100,51 +76,44 @@ ...@@ -100,51 +76,44 @@
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;
/* background-color: red; */
position: relative; position: relative;
padding: 10rpx 20rpx; padding: 20rpx 20rpx 0;
font-size: 40rpx;
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;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
line-height: 44rpx; line-height: 44rpx;
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -182,11 +151,6 @@ ...@@ -182,11 +151,6 @@
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;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!