|
@@ -80,8 +80,8 @@
|
|
|
</view>
|
|
|
<view class="ratio">
|
|
|
<view class="detail">
|
|
|
- <image src="../../static/images/down.png" class="icon" v-if="sellSun.num < 0">
|
|
|
- <image src="../../static/images/up.png" class="icon" v-if="sellSun.num>0"> {{ sellSun.percent }}% <text class="compare">{{ sellSun.status ? '无增长' :'同比上月' }}</text>
|
|
|
+ <image src="../../static/images/down.png" class="icon" v-if="sellSun.yesnum >= sellSun.todaynum">
|
|
|
+ <image src="../../static/images/up.png" class="icon" v-if="sellSun.yesnum < sellSun.todaynum"> {{ sellSun.percent }}% <text class="compare">{{ sellSun.status ? '无增长' :'同比上月' }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -95,12 +95,12 @@
|
|
|
订单总量
|
|
|
</view>
|
|
|
<view class="num">
|
|
|
- {{orderSun.num}}
|
|
|
+ {{orderSun.num *100}}
|
|
|
</view>
|
|
|
<view class="ratio">
|
|
|
<view class="detail">
|
|
|
- <image src="../../static/images/down.png" class="icon" v-if="orderSun.num < 0">
|
|
|
- <image src="../../static/images/up.png" class="icon" v-if="orderSun.num>0"> {{ orderSun.percent }}% <text class="compare">{{ orderSun.status ? '无增长' :'同比上月' }}</text>
|
|
|
+ <image src="../../static/images/down.png" class="icon" v-if="orderSun.yesnum >=orderSun.todaynum">
|
|
|
+ <image src="../../static/images/up.png" class="icon" v-if="orderSun.yesnum < orderSun.todaynum"> {{ orderSun.percent }}% <text class="compare">{{ orderSun.status ? '无增长' :'同比上月' }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -118,8 +118,8 @@
|
|
|
</view>
|
|
|
<view class="ratio">
|
|
|
<view class="detail">
|
|
|
- <image src="../../static/images/down.png" class="icon" v-if="todaysellSun.num < 0">
|
|
|
- <image src="../../static/images/up.png" class="icon" v-if="todaysellSun.num>0"> {{ todaysellSun.percent }}% <text class="compare">{{ todaysellSun.status ? '无增长' :'同比上月' }}</text>
|
|
|
+ <image src="../../static/images/down.png" class="icon" v-if="todaysellSun.yesnum >= todaysellSun.todaynum">
|
|
|
+ <image src="../../static/images/up.png" class="icon" v-if="todaysellSun.yesnum < todaysellSun.todaynum"> {{ todaysellSun.percent }}% <text class="compare">{{ todaysellSun.status ? '无增长' :'同比上月' }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -133,12 +133,12 @@
|
|
|
今日订单量
|
|
|
</view>
|
|
|
<view class="num">
|
|
|
- {{todayorderSun.num}}
|
|
|
+ {{todayorderSun.num*100}}
|
|
|
</view>
|
|
|
<view class="ratio">
|
|
|
<view class="detail">
|
|
|
- <image src="../../static/images/down.png" class="icon" v-if="todayorderSun.num < 0">
|
|
|
- <image src="../../static/images/up.png" class="icon" v-if="todayorderSun.num>0"> {{ todayorderSun.percent }}% <text class="compare">{{ todayorderSun.status ? '无增长' :'同比上月' }}</text>
|
|
|
+ <image src="../../static/images/down.png" class="icon" v-if="todayorderSun.yesnum >=todayorderSun.todaynum">
|
|
|
+ <image src="../../static/images/up.png" class="icon" v-if="todayorderSun.yesnum < todayorderSun.todaynum"> {{ todayorderSun.percent }}% <text class="compare">{{ todayorderSun.status ? '无增长' :'同比上月' }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -287,6 +287,7 @@ let canvaLineA = null;
|
|
|
let canvaPie = null;
|
|
|
let shopSellLine = null;
|
|
|
let shopMoneyLine = null;
|
|
|
+let getDataBuyTime = null;
|
|
|
export default {
|
|
|
name: 'Header',
|
|
|
components: {
|
|
@@ -339,21 +340,29 @@ export default {
|
|
|
num: 0,
|
|
|
percent: 0,
|
|
|
status: null,
|
|
|
+ yesnum: 0,
|
|
|
+ todaynum: 0,
|
|
|
},
|
|
|
todaysellSun: {
|
|
|
num: 0,
|
|
|
percent: 0,
|
|
|
status: null,
|
|
|
+ yesnum: 0,
|
|
|
+ todaynum: 0,
|
|
|
},
|
|
|
orderSun: {
|
|
|
num: 0,
|
|
|
percent: 0,
|
|
|
status: null,
|
|
|
+ yesnum: 0,
|
|
|
+ todaynum: 0,
|
|
|
},
|
|
|
todayorderSun: {
|
|
|
num: 0,
|
|
|
percent: 0,
|
|
|
status: null,
|
|
|
+ yesnum: 0,
|
|
|
+ todaynum: 0,
|
|
|
},
|
|
|
|
|
|
// 待处理事物
|
|
@@ -378,7 +387,7 @@ export default {
|
|
|
value: null,
|
|
|
},
|
|
|
},
|
|
|
- onShow () {
|
|
|
+ onShow() {
|
|
|
_self = this;
|
|
|
this.cWidth = uni.upx2px(690); // upx2px 转换为px
|
|
|
this.cHeight = uni.upx2px(300);
|
|
@@ -387,19 +396,19 @@ export default {
|
|
|
|
|
|
this.getShopList();
|
|
|
this.loading = false;
|
|
|
- },
|
|
|
- // 页面生命周期 监听页面加载
|
|
|
- // onLoad() {
|
|
|
- // _self = this;
|
|
|
- // this.cWidth = uni.upx2px(690); // upx2px 转换为px
|
|
|
- // this.cHeight = uni.upx2px(300);
|
|
|
- // this.bWidth = uni.upx2px(690);
|
|
|
- // this.bHeight = uni.upx2px(300);
|
|
|
-
|
|
|
- // this.getShopList();
|
|
|
- // this.loading = false;
|
|
|
- // },
|
|
|
|
|
|
+ getDataBuyTime = setInterval(() => {
|
|
|
+ this.loading = false;
|
|
|
+ this.getShopList();
|
|
|
+ this.$mHelper.toast(`自动更新数据${moment().format('h:mm:ss')}`);
|
|
|
+ }, 1000 * 60 * 5);
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+
|
|
|
+ },
|
|
|
+ onHide() {
|
|
|
+ clearInterval(getDataBuyTime);
|
|
|
+ },
|
|
|
methods: {
|
|
|
// 监听遮罩层行为
|
|
|
isSureConver(e) {
|
|
@@ -411,9 +420,9 @@ export default {
|
|
|
// 允许从相机和相册扫码
|
|
|
uni.scanCode({
|
|
|
success: function (res) {
|
|
|
- if (res.result.indexOf('XDY_') !== 0 ) {
|
|
|
+ if (res.result.indexOf('XDY_') !== 0) {
|
|
|
_self.$mHelper.toast('您扫描的不是兑换码!');
|
|
|
- return
|
|
|
+ return;
|
|
|
}
|
|
|
_self.ordernum = res.result;
|
|
|
_self.searchOrder();
|
|
@@ -492,6 +501,7 @@ export default {
|
|
|
shopId: this.shopID,
|
|
|
})
|
|
|
.then(async (res) => {
|
|
|
+ console.log(res);
|
|
|
if (res.code === 200 && res.data) {
|
|
|
// 销售总额
|
|
|
this.dataDo(res.data.xsze, this.sellSun);
|
|
@@ -514,8 +524,10 @@ export default {
|
|
|
itemEle.num = (element.num / 100).toFixed(2);
|
|
|
} else if (element.time === 'dy') {
|
|
|
todaynum = element.num;
|
|
|
+ itemEle.todaynum = element.num;
|
|
|
} else if (element.time === 'sy') {
|
|
|
yesnum = element.num;
|
|
|
+ itemEle.yesnum = element.num;
|
|
|
}
|
|
|
});
|
|
|
if (yesnum === 0) {
|
|
@@ -531,7 +543,6 @@ export default {
|
|
|
}
|
|
|
return itemEle;
|
|
|
},
|
|
|
-
|
|
|
dataDODO(data, itemEle) {
|
|
|
let todaynum = 0;
|
|
|
let yesnum = 0;
|
|
@@ -539,12 +550,16 @@ export default {
|
|
|
if (element.time === 'jr') {
|
|
|
itemEle.num = (element.num / 100).toFixed(2);
|
|
|
todaynum = element.num;
|
|
|
+ itemEle.todaynum = element.num;
|
|
|
} else if (element.time === 'zr') {
|
|
|
yesnum = element.num;
|
|
|
+ itemEle.yesnum = element.num;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- itemEle.percent = (((todaynum - yesnum) / yesnum) * 100).toFixed(2);
|
|
|
+ let per = (((todaynum - yesnum) / yesnum) * 100).toFixed(2);
|
|
|
+
|
|
|
+ itemEle.percent = per.split('-')[1];
|
|
|
if (yesnum === todaynum) {
|
|
|
itemEle.percent = 0;
|
|
|
itemEle.status = true;
|
|
@@ -553,7 +568,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
if (yesnum === 0) {
|
|
|
- itemEle.percent = 100
|
|
|
+ itemEle.percent = 100;
|
|
|
}
|
|
|
return itemEle;
|
|
|
},
|