Commit d02e6d9c by 李君

11

1 parent 5b854a8f
......@@ -51,7 +51,7 @@ Component({
switchTab(e) {
const data = e.currentTarget.dataset
const url = data.path
wx.reLaunch({
wx.switchTab({
url
})
// this.setData({
......
......@@ -12,11 +12,15 @@ Component({
this.getTabBar().setData({
// 当前页面的 tabBar 索引
curClick:1
},()=>{
setTimeout(()=>{
this.loadData()
},1000)
})
}
}
},
ready(){
attached(){
this.loadData()
},
data: {
......@@ -41,7 +45,7 @@ Component({
name: '进店客流',
val: 'PassengerFlow'
}, {
name: '过店人次',
name: '过店客流',
val: 'Exposure'
}, {
name: '进店率',
......@@ -64,8 +68,15 @@ Component({
}],
},
methods: {
switchTab(){
this.loadData()
toThousands(num) {
var result = [ ], counter = 0;
num = (num || 0).toString().split('');
for (var i = num.length - 1; i >= 0; i--) {
counter++;
result.unshift(num[i]);
if (!(counter % 3) && i != 0) { result.unshift(','); }
}
return result.join('');
},
// 关闭自定义日期选择
onClose() {
......@@ -154,9 +165,9 @@ Component({
this.setData({
selectName:res.data.name,
openMllNum:res.data.openMllNum,
exposure:res.data.exposure,
traffic:res.data.traffic,
customer:res.data.customer,
exposure:this.toThousands(res.data.exposure),
traffic:this.toThousands(res.data.traffic),
customer:this.toThousands(res.data.customer),
entryRate:res.data.entryRate,
})
})
......@@ -207,6 +218,7 @@ Component({
return o.value
}))
rankData.forEach(item=>{
item.value = this.toThousands(item.value)
item.percentage = parseInt(item.value*100/maxVal);
})
this.setData({
......
......@@ -54,7 +54,7 @@
<text class="text_tltle {{trendtypes=='CustomerNum'?'actives':'defaults'}}" bindtap="ClickPassageFlow" data-type='CustomerNum'>顾客人数</text>
<text class="text_tltle {{trendtypes=='IntoStoreRate'?'actives':'defaults'}}" bindtap="ClickPassageFlow" data-type='IntoStoreRate'>进店率</text>
</view>
<basic chartId='chartDatatrend' chartData="{{chartData}}" height="500rpx"></basic>
<basic chartId='chartTrend' chartData="{{chartData}}" height="500rpx"></basic>
</view>
<!-- 停留时长统计 -->
<!-- <view class="keliuliang">
......
......@@ -25,6 +25,10 @@
color: #FFFFFF;
line-height: 56rpx;
position: absolute;
max-width: 90%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.shop_time {
position: absolute;
......
......@@ -74,7 +74,7 @@ Component({
entryRate: 0,
info: {}
},
ready(){
attached(){
getMalls({
url: '/report/malls',
accountId: wx.getStorageSync('accountId')
......@@ -175,6 +175,16 @@ Component({
}
},
toThousands(num) {
var result = [ ], counter = 0;
num = (num || 0).toString().split('');
for (var i = num.length - 1; i >= 0; i--) {
counter++;
result.unshift(num[i]);
if (!(counter % 3) && i != 0) { result.unshift(','); }
}
return result.join('');
},
// 获取卡片数据
getCardList() {
// console.log(this.data.currentTime,this.data.selectId,this.data.selectName)
......@@ -194,9 +204,9 @@ Component({
if (res.code == 200) {
let data = res.data
this.setData({
exposure: data.exposure,
traffic: data.traffic,
customer: data.customer,
exposure: this.toThousands(data.exposure),
traffic: this.toThousands(data.traffic),
customer: this.toThousands(data.customer),
entryRate: data.entryRate && data.entryRate.toFixed(2)
})
}
......
......@@ -5,7 +5,9 @@
<!-- 名称 -->
<view class="contianer_shop">
<image src="../images/back.svg" class='images'></image>
<view class="shop_name" bindtap="selectContent">{{selectName}}</view>
<view class="shop_name" bindtap="selectContent">
<text class="nameContent">{{selectName}}</text>
</view>
<view class="shop_time">
<text>营业时间:{{info.startTime}}-{{info.endTime}}</text>
<text style="margin:0 10rpx"> 面积:{{info.area}}㎡ </text>
......
......@@ -46,8 +46,17 @@
color: #FFFFFF;
line-height: 56rpx;
position: absolute;
width: auto;
max-width: 90%;
}
.nameContent{
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: auto;
max-width: 90%;
}
.shop_name::after {
content: '';
display: inline-block;
......@@ -57,8 +66,7 @@
border: 20rpx solid #fff;
border-color: transparent;
border-top-color: #fff;
position: absolute;
bottom: 0;
vertical-align: middle;
}
.shop_time {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!