Commit 5251f39d by 李君

优化

1 parent ddbfeaaf
<!--components/echart/trend/index.wxml-->
<view class="cwrap">
<view class="stay" wx:if="{{avgVal}}">人均停留时长<text>{{avgVal}}</text>分</view>
<!-- <view class="stay" wx:if="{{avgVal}}">人均停留时长<text>{{avgVal}}</text>分</view> -->
<basic chartId="{{chartId}}" chartData="{{chartData}}" height="{{height}}"></basic>
</view>
......@@ -122,6 +122,14 @@ Component({
//optionFormat.xAxis.axisLabel.interval = optionFormat.series[0].length>30?'auto':0;
optionFormat.legend.bottom = legendBottom || 0;
let option = Object.assign({}, optionFormat, coverTemp);
option.yAxis.axisLabel.formatter= function (value, index) {
if (value >= 10000 && value < 10000000) {
value = value / 10000 + "万";
} else if (value >= 10000000) {
value = value / 10000000 + "千万";
}
return value;
}
return option;
}
}
......
......@@ -38,7 +38,7 @@ Component({
deploymentType:wx.getStorageSync('deploymentType'),
trendVal: 'account_passenger_flow',
trendName:'客流量',
rankVal: 'total_passenger',
rankVal: 'outside_traffic',
rankData: {},
belongTo: 'NewAccount',
params: {
......
......@@ -13,9 +13,11 @@
</view>
</view>
<view class="sitem">
<view class="snum color2">--</view>
<view class="sname">销售额(元)</view>
<view class="spercent">较{{dateStr}}:--% <image src="/images/ico.png" mode="aspecFill"/></view>
<view class="snum color2">{{cardData.account_passenger_flow.value || '--'}}</view>
<view class="sname">客流量(人次)</view>
<view class="spercent">较{{dateStr}}:{{cardData.account_passenger_flow.ratio}}
<image src="/images/ico{{cardData.account_passenger_flow.rstatus}}.png" mode="aspecFill"/>
</view>
</view>
</view>
</view>
......@@ -23,7 +25,7 @@
<view class="mcards ~acea-row">
<view class="card">
<view class="mnum">{{ cardData.account_passenger_flow.value||'--' }}</view>
<view class="mname">客流量(人次)</view>
<view class="mname">过店客流(人次)</view>
</view>
<view class="card">
<view class="mnum">{{ cardData.account_entry_rate_average.value||'--' }}</view>
......@@ -35,7 +37,7 @@
</view>
<view class="card">
<view class="mnum">{{ '--' }}</view>
<view class="mname">客单价(元)</view>
<view class="mname">深逛率(%)</view>
</view>
</view>
<view class="~echart-item">
......@@ -61,10 +63,10 @@
</view>
<view class="~tablist" style="width:73%;margin-top:10rpx;">
<van-tabs bindclick="changeRank" active="{{rankVal}}">
<van-tab title="客流量" name="total_passenger"></van-tab>
<van-tab title="进店率" name="avg_entry_rate"></van-tab>
<van-tab title="停留时长" name="custom_residence_time"></van-tab>
<van-tab title="销售额" disabled name="4"></van-tab>
<van-tab title="过店客流" name="outside_traffic"></van-tab>
<van-tab title="进店客流" name="total_passenger"></van-tab>
<van-tab title="顾客人数" name="total_traffic"></van-tab>
<van-tab title="深逛率" name="deep_shopping_rate"></van-tab>
</van-tabs>
</view>
<view class="~echart-item-content">
......
......@@ -51,9 +51,9 @@ Page({
},
mallLoad(data){
let list = data.detail;
if(list.length==1){
if(list.length>1){
this.setData({
isMall:true,
isMall:false,
indexType:'mall'
});
this.onZonePickerCallback({detail:list[0]});
......@@ -68,7 +68,7 @@ Page({
accountBtn(){
const orgName = wx.getStorageSync('accountName')
const accountId = wx.getStorageSync('accountId')
const indexType = 'account';
const indexType = 'mall';
this.setData({
accountId:accountId,
orgName: orgName,
......
<view class="container" style="padding-top: {{navHeight}}px">
<navbar2 bg-color="#001C90" navbar-color="#fff">
<view class="navtitle">
<van-icon bindtap="accountBtn" size="22" name="arrow-left" custom-class="back {{indexType!='mall'||isMall?'hide':''}}"/>
<!-- <van-icon bindtap="accountBtn" size="22" name="arrow-left" custom-class="back {{indexType!='mall'||isMall?'hide':''}}"/> -->
<time-picker class="picker" placeholder="请选择时间"
initDate="{{date}}"
dateType="{{dateType}}"
......
......@@ -14,7 +14,7 @@ import {
import {
getCharts
} from "../../../api/report.js";
import cardConfig from '../../../utils/card'
Component({
behaviors: [customBehavior],
......@@ -37,8 +37,8 @@ Component({
windowWidth: App.globalData.windowWidth,
navHeight: getApp().globalData.navHeight,
deploymentType: wx.getStorageSync('deploymentType'),
trendVal: 'mall_passenger_flow',
trendName: '客流量',
trendVal: '',
trendName: '',
rankVal: 'total_passenger',
rankData: {},
belongTo: 'NewMall',
......@@ -52,14 +52,20 @@ Component({
dateStr: '昨日',
trendData: {},
hbarData: {},
cardData: {}
cardData: {},
isOnce:true,
cardsList:[],
showTab:true
/********************************************/
},
lifetimes: {
attached: function () {
this.data.isOnce = false
this.getCharts().then(res => {
this.data.cardsList = res.data.cards
this.data.isOnce = true
this.changeTimerFn({
...this.data.time,
dateType: this.data.timeType
......@@ -78,15 +84,14 @@ Component({
}
},
// 获取报表chartIds
getReportCharts: function () {
getReportCharts: function (res) {
if (this.data.chartList.length == 0) return;
wx.showLoading({
title: '数据加载中',
mask: true
});
this.loadHeadData();
this.loaTrendData();
this.loadBarData();
this.loaRankData();
},
......@@ -97,7 +102,7 @@ Component({
chartIds,
orgIds
}).then(res => {
let cardData = {};
let cardData = [];
Object.keys(res.data).forEach(key => {
let item = res.data[key];
if (this.data.params.dateType == 'day') {
......@@ -113,10 +118,41 @@ Component({
item.value = String(item.value && this.toThousands(item.value)).replace('分','');
item.rstatus = (item.ratio && item.ratio.includes('-')) ? 1 : 2;
item.name = this.getChartName(key);
cardData[key] = item;
item.key = key;
item.dateType = this.data.params.dateType
cardData.push(item)
});
let newData = []
this.data.cardsList.forEach(item=>{
cardData.forEach(card=>{
if(item.chartKey==card.key){
newData.push(card)
}
})
})
let name = '',title = ''
this.data.trendVal = ''
Object.keys(cardConfig).forEach(key=>{
newData.forEach(card=>{
if(key==card.key){
card.unit = cardConfig[key].unit;
card.hasTrend = cardConfig[key][card.dateType].level && cardConfig[key][card.dateType].level.length>0
if(!name && card.hasTrend){
name = key
title = card.name
}
}
})
})
this.data.showTab = true
this.setData({
trendVal: name,
trendName: title
}, () => {
this.loaTrendData();
})
this.setData({
cardData
cardData:newData
})
})
},
......@@ -195,10 +231,12 @@ Component({
});
},
changeAccountFn: function (value) {
this.getReportCharts();
// this.getCharts({accountId:value}).then(res=>{
// this.getReportCharts();
// })
if(!this.data.isOnce) return
this.getCharts({mallId:value}).then(res=>{
this.data.cardsList = res.data.cards
this.getReportCharts();
})
},
changeTimerFn: async function (value) {
let {
......
......@@ -5,49 +5,48 @@
<view class="mallselect" bindtap="mallBtn">{{orgName}} <van-icon name="play" custom-class="drop {{isMall?'hide':''}}"/></view>
<view class="slist ~acea-row ~row-around">
<view class="sitem">
<view class="snum color1">{{cardData.mall_passenger_number.value}}</view>
<view class="sname">顾客数(人)</view>
<view class="snum color1">{{cardData[0].value|| '--'}}</view>
<view class="sname">{{cardData[0].name|| '--'}}{{cardData[0].unit?'('+cardData[0].unit+')':''}}</view>
<view class="spercent">
较{{dateStr}}:{{cardData.mall_passenger_number.ratio}}
<image src="/images/ico{{cardData.mall_passenger_number.rstatus}}.png" mode="aspecFill"/>
较{{dateStr}}:{{cardData[0].ratio|| '--'}}
<image src="/images/ico{{cardData[0].rstatus}}.png" mode="aspecFill"/>
</view>
</view>
<view class="sitem">
<view class="snum color2">--</view>
<view class="sname">销售额(元)</view>
<view class="spercent">较{{dateStr}}:--% <image src="/images/ico.png" mode="aspecFill"/></view>
<view class="sitem" wx:if="{{cardData.length>1}}">
<view class="snum color2">{{cardData[1].value || '--'}}</view>
<view class="sname">{{cardData[1].name|| '--'}}{{cardData[1].unit?'('+cardData[1].unit+')':''}}</view>
<view class="spercent">较{{dateStr}}:{{cardData[1].ratio|| '--'}}
<image src="/images/ico{{cardData[1].rstatus}}.png" mode="aspecFill"/>
</view>
</view>
</view>
<view class="mcards ~acea-row">
<view class="card">
<view class="mnum">{{ cardData.mall_passenger_flow.value||'--' }}</view>
<view class="mname">客流量(人次)</view>
</view>
<view class="card">
<view class="mnum">{{ cardData.mall_entry_rate.value||'--' }}</view>
<view class="mname">进店率(%)</view>
<view class="mcards ~acea-row" wx:if="{{cardData.length>2}}">
<view class="card" wx:for="{{cardData}}" wx:for-index="index" wx:for-item="item" wx:if="{{index>1}}" wx:key='index'>
<view class="mnum">{{index}}{{ item.value||'--' }}</view>
<view class="mname">{{ item.name||'--' }}{{item.unit?'('+item.unit+')':''}}</view>
</view>
<view class="card">
<view class="mnum">{{ cardData.custom_residence_time.value||'--' }}</view>
<view class="mname">停留时长(分)</view>
<!-- <view class="card" wx:if="{{cardData.length>3}}">
<view class="mnum">{{ cardData[3].value||'--' }}</view>
<view class="mname">{{ cardData[3].name||'--' }}</view>
</view>
<view class="card">
<view class="mnum">{{ '--' }}</view>
<view class="mname">客单价(元)</view>
<view class="card" wx:if="{{cardData.length>4}}">
<view class="mnum">{{ cardData[4].value||'--' }}</view>
<view class="mname">{{ cardData[4].name||'--' }}</view>
</view>
<view class="card" wx:if="{{cardData.length>5}}">
<view class="mnum">{{ cardData[5].value||'--' }}</view>
<view class="mname">{{ cardData[5].name||'--' }}</view>
</view> -->
</view>
<view class="~echart-item">
<view class="~echart-item-title">
<view>趋势分析</view>
</view>
<view class="~tablist" style="width:73%;margin-top:10rpx;">
<van-tabs bindclick="changeTrend" active="{{trendVal}}">
<van-tab title="客流量" name="mall_passenger_flow"></van-tab>
<van-tab title="进店率" name="mall_entry_rate"></van-tab>
<van-tab title="停留时长" name="custom_residence_time"></van-tab>
<van-tab title="销售额" disabled name="4"></van-tab>
<view class="~tablist" style="margin-top:10rpx;padding: 0 15rpx;">
<van-tabs ref="tabs" tab-class='tab-box' bindclick="changeTrend" active="{{trendVal}}">
<van-tab wx:for="{{cardData}}" wx:for-index="index" wx:for-item="item" wx:if="{{item.hasTrend}}" wx:key='index' title="{{item.name}}" name="{{item.key}}"></van-tab>
</van-tabs>
</view>
<view class="~echart-item-content">
......@@ -74,7 +73,7 @@
<van-tab title="客流量" name="total_passenger"></van-tab>
<van-tab title="进店率" name="avg_entry_rate"></van-tab>
<van-tab title="停留时长" name="custom_residence_time"></van-tab>
<van-tab title="销售额" disabled name="4"></van-tab>
<!-- <van-tab title="销售额" disabled name="4"></van-tab> -->
</van-tabs>
</view>
<view class="~echart-item-content">
......
......@@ -13,7 +13,12 @@
justify-content: space-between;
position: relative;
}
.tab-box{
flex: none !important;
}
.tab-box .tabItem{
width: 80rpx;
}
.top .time {
position: relative;
width: 100%;
......
{
"description": "项目配置文件",
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"packOptions": {
"ignore": [],
"include": []
......@@ -40,32 +40,17 @@
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false,
"ignoreUploadUnusedFiles": true
"ignoreUploadUnusedFiles": true,
"useStaticServer": true
},
"compileType": "miniprogram",
"libVersion": "2.14.4",
"appid": "wx220b5d2dbb82ce64",
"projectname": "miniProject",
"cloudfunctionTemplateRoot": "cloudfunctionTemplate",
"watchOptions": {
"ignore": []
},
"debugOptions": {
"hidedInDevtools": []
},
"scripts": {},
"condition": {
"plugin": {
"list": []
},
"game": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": []
}
"cloudfunctionTemplateRoot": "cloudfunctionTemplate/",
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 4
}
}
\ No newline at end of file
export default {
floor_passenger_flow: {
name: "楼层客流人次",
unit: "人次",
info: "楼层客流人次",
day: {
level: ["HOUR", "MINUTE"],
},
month: {
level: ["WEEK", "DAY", "HOUR"],
},
year: {
level: ["MONTH", "WEEK", "DAY"],
},
},
floor_passenger_number: {
name: "楼层客流人数",
unit: "人",
info: "楼层客流人数",
day: {
level: ["HOUR"]
},
month: {
level: ["WEEK", "DAY", "HOUR"],
},
year: {
level: ["MONTH", "WEEK", "DAY"],
},
},
mall_passenger_flow: {
name: "客流量",
unit: "人次",
info: "客流量",
month: {
level: ["WEEK", "DAY", "HOUR"],
},
day: {
level: ["HOUR", "MINUTE"],
},
year: {
level: ["MONTH", "WEEK", "DAY"],
},
},
mall_passenger_number: {
name: "顾客人数",
unit: "人",
info: "顾客人数",
month: {
level: ["WEEK", "DAY", "HOUR"],
},
day: {
level: ["HOUR"],
},
year: {
level: ["MONTH", "WEEK", "DAY"],
},
},
zone_total_passenger_flow: {
name: "店铺总客流人次",
unit: "人次",
info: "店铺总客流人次",
month: {
level: ["HOUR"],
},
day: {
level: [],
},
},
zone_total_passenger_number: {
name: "店铺总客流人数",
unit: "人",
info: "店铺总客流人数",
month: {
level: ["HOUR"],
},
day: {
level: [],
},
},
zone_passenger_flow: {
name: "店铺总客流",
unit: "人次",
info: "店铺总客流",
month: {
level: ["WEEK", "DAY", "HOUR"],
},
day: {
level: ["HOUR", "MINUTE"],
},
year: {
level: ["MONTH", "WEEK", "DAY"],
},
},
zone_passenger_number: {
name: "店铺客流人数",
unit: "人",
info: "店铺客流人数",
month: {
level: ["WEEK", "DAY"],
},
day: {
level: ["HOUR"],
},
year: {
level: ["MONTH", "WEEK", "DAY"],
},
},
zone_passenger_flow_passing_by: {
name: "路过店铺客流人次",
unit: "人次",
info: "路过店铺客流人次",
month: {
level: ["WEEK", "DAY", "HOUR"],
},
day: {
level: ["HOUR", "MINUTE"],
},
year: {
level: ["MONTH", "WEEK", "DAY"],
},
},
format_passenger_flow_average: {
name: "业态平均客流",
unit: "人次",
info: "业态平均客流",
month: {
level: [],
},
day: {
level: [],
},
year: {
level: [],
},
},
// 业态客流人次
format_passenger_flow: {
name: "业态客流人次",
unit: "人次",
info: "业态客流人次",
day: {
level: ["HOUR", "MINUTE"],
},
month: {
level: ["WEEK", "DAY", "HOUR"],
},
year: {
level: ["MONTH", "WEEK", "DAY"],
},
},
// 业态主力店客流人次
main_format_passenger_flow: {
name: "主力店总客流",
unit: "人次",
info: "主力店总客流",
day: {
level: ["HOUR", "MINUTE"],
},
month: {
level: ["WEEK", "DAY", "HOUR"],
},
year: {
level: ["MONTH", "WEEK", "DAY"],
},
},
// 滞留时间
format_residence_time: {
name: "滞留时间",
unit: '分',
unit2: '分',
info: "业态总滞留时长/业态总客流人数",
month: {
level: ["DAY"],
},
day: {
level: [],
},
year: {
level: ["DAY"],
},
},
// 周末集客效应
format_weekend_effect: {
name: "周末集客效应",
unit: "%",
info: "周六周日/周一至周五*100%",
month: {
level: ["WEEK"],
},
year: {
level: ["WEEK"],
},
day: {
level: [],
},
},
format_passenger_ranking: {
name: "业态客流排行",
unit: '名',
info: "业态客流排行",
month: {
level: [],
},
day: {
level: [],
},
year: {
level: [],
},
},
main_zone_passenger_flow: {
name: "主力店总客流",
unit: "人次",
info: "主力店总客流",
month: {
level: ["WEEK", "DAY", "HOUR"],
},
day: {
level: ["HOUR", "MINUTE"],
},
year: {
level: ["MONTH", "WEEK", "DAY"],
},
},
main_zone_entry_rate_average: {
name: "主力店平均进店率",
unit: "%",
info: "主力店所有店铺,进店人次/过店人次+进店人次*100%",
month: {
level: ["DAY", "HOUR"],
},
day: {
level: ["HOUR", "MINUTE"],
},
year: {
level: ["MONTH", "WEEK", "DAY"],
},
},
mall_weekend_effect: {
name: "周末集客效应",
unit: "%",
info: "周六周日/周一至周五*100%",
month: {
level: ["WEEK"],
},
year: {
level: ["WEEK"],
},
day: {
level: [],
},
},
floor_weekend_effect: {
name: "周末集客效应",
unit: "%",
info: "周六周日/周一至周五*100%",
month: {
level: ["WEEK"],
},
year: {
level: ["WEEK"],
},
day: {
level: [],
},
},
zone_weekend_effect: {
name: "周末集客效应",
unit: "%",
info: "周六周日/周一至周五*100%",
month: {
level: ["WEEK"],
},
year: {
level: ["WEEK"],
},
day: {
level: [],
},
},
store_exposure: {
name: "店铺曝光率",
unit: "%",
unit2: "%",
info: "店铺过店人次+进店人次/商场总客流",
day: {
level: ["HOUR", "MINUTE"],
},
month: {
level: ["DAY", "HOUR", "MINUTE"],
},
year: {
level: ["MONTH", "DAY"],
},
},
entry_rate: {
name: "进店率",
unit: "%",
info: "主力店所有店铺,进店人次/过店人次*100%",
day: {
level: ["HOUR", "MINUTE"],
},
month: {
level: ["DAY", "HOUR"],
},
year: {
level: ["MONTH", "DAY"],
},
},
mall_residence_time: {
name: "顾客停留时间",
unit: '分',
unit2: '分',
info: "广场总滞留时长/广场总客流人数",
month: {
level: ["DAY"],
},
day: {
level: [],
},
year: {
level: ["DAY"],
},
},
/*Reid滞留时间*/
custom_residence_time: {
name: "滞留时间",
unit: '分',
unit2: '分',
info: "门店总滞留时长/门店总客流人数",
month: {
level: ["DAY"],
},
day: {
level: [],
},
year: {
level: ["DAY"],
},
},
mall_flow_evaluation: {
name: "客流坪效",
unit: '人次/天/㎡',
info: "总客流/面积",
month: {
level: [],
},
day: {
level: [],
},
year: {
level: [],
},
},
mall_entry_rate: {
name: "进店率",
unit: "%",
info: "进店人次/(进店人次+过店人次)*100%",
day: {
level: [],
},
month: {
level: ["DAY"],
},
year: {
level: ["DAY"],
},
},
floor_residence_time: {
name: "滞留时间",
unit: '分',
unit2: '分',
info: "楼层总滞留时长/楼层总客流人数",
month: {
level: ["DAY"]
},
day: {
level: [],
},
year: {
level: ["DAY"],
},
},
zone_residence_time: {
name: "滞留时间",
unit: '分',
unit2: '分',
info: "店铺总滞留时长/店铺总客流人数",
month: {
level: ["DAY"],
},
day: {
level: [],
},
year: {
level: ["DAY"],
},
},
zone_flow_evaluation: {
name: "店铺客流坪效",
unit: '人次/天/㎡',
info: "店铺总客流/店铺面积",
month: {
level: [],
},
day: {
level: [],
},
year: {
level: [],
},
},
zone_average_visited: {
name: "平均游逛店铺个数",
unit: '个',
info: "店铺总进店人数/总进场人数",
month: {
level: ["DAY"],
},
day: {
level: [],
},
year: {
level: ["DAY"],
},
},
floor_average_visited: {
name: "平均游逛楼层个数",
unit: '个',
info: "楼层总人数/总进场人数",
month: {
level: ["DAY"],
},
day: {
level: []
},
year: {
level: ["DAY"],
},
},
format_average_visited: {
name: "平均游逛业态个数",
unit: '个',
info: "业态总进店人数/总进场人数",
month: {
level: ["DAY"],
},
day: {
level: [],
},
year: {
level: ["DAY"],
},
},
zone_number: {
name: "店铺个数",
unit: '个',
info: "截止当前时间最新的门店数量",
month: {
level: [],
},
day: {
level: [],
},
},
account_passenger_flow: {
name: "集团总客流",
unit: "人次",
info: "集团总客流",
day: {
level: [],
},
},
account_median: {
name: "集团客流中位数",
unit: "人次",
info: "所有店铺累计客流量排序,中间的那位(若偶数算平均,若单数直接取)",
day: {
level: [],
},
},
account_passenger_flow_average: {
name: "集团平均客流量",
unit: "人次",
info: "集团累计客流量/广场个数",
day: {
level: []
},
},
mall_number: {
name: "已开业商场",
unit: '个',
info: "截止当前最新的门店数量",
day: {
level: []
},
},
mall_outside_number:{
name: "过店人次",
unit: '人次',
info: "路过人次",
day: {
level: ["HOUR", "MINUTE"],
},
month: {
level: ["WEEK", "DAY", "HOUR"],
},
year: {
level: ["MONTH", "WEEK", "DAY"],
},
}
};
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!