Commit d02e6d9c by 李君

11

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