|
@@ -40,7 +40,7 @@
|
|
|
|
|
|
<!-- 输入框 -->
|
|
|
<view class="input-code" :animation="animationData">
|
|
|
- <input type="text" v-model="ordernum" maxlength="-1" placeholder-style="color:#b8bbbb;font-size:28upx;" class="code" placeholder="请输入验证码核验">
|
|
|
+ <input type="text" v-model="ordernum" maxlength="-1" placeholder-style="color:#b8bbbb;font-size:28upx;" class="code" placeholder="请输入兑换码或者订单号">
|
|
|
<view class="search" @tap="searchOrder">搜索</view>
|
|
|
</view>
|
|
|
<view class="index-content">
|
|
@@ -353,7 +353,7 @@ export default {
|
|
|
shopsellimg: '',
|
|
|
shopmoneyimg: '',
|
|
|
futureimg: '',
|
|
|
- shopimg: ''
|
|
|
+ shopimg: '',
|
|
|
};
|
|
|
},
|
|
|
// 此处定义传入的数据
|
|
@@ -364,9 +364,7 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
// 监听也面滚动
|
|
|
- onPageScroll (e) {
|
|
|
-
|
|
|
- },
|
|
|
+ onPageScroll(e) {},
|
|
|
// 页面生命周期 监听页面加载
|
|
|
onLoad() {
|
|
|
_self = this;
|
|
@@ -390,6 +388,11 @@ export default {
|
|
|
// 允许从相机和相册扫码
|
|
|
uni.scanCode({
|
|
|
success: function (res) {
|
|
|
+ console.log(res);
|
|
|
+ if (res.result.indexOf('XDY_') !== 0 ) {
|
|
|
+ _self.$mHelper.toast('您扫描的不是兑换码!');
|
|
|
+ return
|
|
|
+ }
|
|
|
_self.ordernum = res.result;
|
|
|
_self.searchOrder();
|
|
|
},
|
|
@@ -397,9 +400,10 @@ export default {
|
|
|
},
|
|
|
// 搜索框根据订单号查询订单
|
|
|
searchOrder() {
|
|
|
- this.loading = true
|
|
|
- if (this.ordernum === '') {
|
|
|
- this.$mHelper.toast('请输入正确的订单号进行查询,不能为空!');
|
|
|
+ this.loading = true;
|
|
|
+ if (this.ordernum.length === 0) {
|
|
|
+ this.$mHelper.toast('请输入正确的兑换码或者订单号进行兑换,不能为空!');
|
|
|
+ this.loading = false;
|
|
|
return;
|
|
|
}
|
|
|
this.$http
|
|
@@ -410,18 +414,18 @@ export default {
|
|
|
uni.setStorageSync('orderDetail', res.data);
|
|
|
this.$mRouter.push({ route: '/pages/index/conversion' });
|
|
|
this.orderMessage = res.data;
|
|
|
- this.loading = false
|
|
|
+ this.loading = false;
|
|
|
}
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
this.ordernum = '';
|
|
|
- this.loading = false
|
|
|
+ this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
|
|
|
// 选择商铺
|
|
|
bindPickerChange(e) {
|
|
|
- this.loading = true
|
|
|
+ this.loading = true;
|
|
|
this.shopID = null;
|
|
|
this.index = e.detail.value;
|
|
|
this.shopID = this.shopArray[this.index].id;
|
|
@@ -431,7 +435,7 @@ export default {
|
|
|
this.shopSellData();
|
|
|
this.shopSellTrend();
|
|
|
this.shopSellMoneyTrend();
|
|
|
- this.loading = false
|
|
|
+ this.loading = false;
|
|
|
},
|
|
|
|
|
|
// 跳转设置页
|
|
@@ -470,11 +474,11 @@ export default {
|
|
|
// 销售总额
|
|
|
this.dataDo(res.data.xsze, this.sellSun);
|
|
|
// 今日销售总额
|
|
|
- this.dataDo(res.data.jrxxe, this.todaysellSun);
|
|
|
+ this.dataDODO(res.data.jrxxe, this.todaysellSun);
|
|
|
// 订单总量
|
|
|
this.dataDo(res.data.ddzl, this.orderSun);
|
|
|
// 今日订单总量
|
|
|
- this.dataDo(res.data.jrdds, this.todayorderSun);
|
|
|
+ this.dataDODO(res.data.jrdds, this.todayorderSun);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -495,16 +499,36 @@ export default {
|
|
|
if (yesnum === 0) {
|
|
|
itemEle.percent = 100;
|
|
|
} else {
|
|
|
- itemEle.percent = ((todaynum - yesnum) / yesnum).toFixed(2);
|
|
|
+ itemEle.percent = (((todaynum - yesnum) / yesnum) * 100).toFixed(2);
|
|
|
}
|
|
|
-
|
|
|
if (yesnum === todaynum) {
|
|
|
itemEle.percent = 0;
|
|
|
itemEle.status = true;
|
|
|
} else {
|
|
|
itemEle.status = false;
|
|
|
}
|
|
|
+ return itemEle;
|
|
|
+ },
|
|
|
+
|
|
|
+ dataDODO(data, itemEle) {
|
|
|
+ let todaynum = 0;
|
|
|
+ let yesnum = 0;
|
|
|
+ data.forEach((element) => {
|
|
|
+ if (element.time === 'jr') {
|
|
|
+ itemEle.num = (element.num / 100).toFixed(2);
|
|
|
+ todaynum = element.num;
|
|
|
+ } else if (element.time === 'zr') {
|
|
|
+ yesnum = element.num;
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
+ itemEle.percent = (((todaynum - yesnum) / yesnum) * 100).toFixed(2);
|
|
|
+ if (yesnum === todaynum) {
|
|
|
+ itemEle.percent = 0;
|
|
|
+ itemEle.status = true;
|
|
|
+ } else {
|
|
|
+ itemEle.status = false;
|
|
|
+ }
|
|
|
return itemEle;
|
|
|
},
|
|
|
|
|
@@ -531,7 +555,7 @@ export default {
|
|
|
|
|
|
// 商品销售数量走势
|
|
|
async shopSellTrend() {
|
|
|
- this.loadingMore1 = true
|
|
|
+ this.loadingMore1 = true;
|
|
|
if (this.shopID === 0) {
|
|
|
this.shopI = '';
|
|
|
}
|
|
@@ -633,7 +657,7 @@ export default {
|
|
|
fileType: 'png',
|
|
|
canvasId: id,
|
|
|
success: function (res) {
|
|
|
- _self.loadingMore1 = false
|
|
|
+ _self.loadingMore1 = false;
|
|
|
_self.shopsellimg = res.tempFilePath;
|
|
|
},
|
|
|
fail: function (res) {},
|
|
@@ -652,7 +676,7 @@ export default {
|
|
|
|
|
|
// 商品销售金额走势
|
|
|
async shopSellMoneyTrend() {
|
|
|
- this.loadingMore2 = true
|
|
|
+ this.loadingMore2 = true;
|
|
|
if (this.shopID === 0) {
|
|
|
this.shopI = '';
|
|
|
}
|
|
@@ -753,7 +777,7 @@ export default {
|
|
|
fileType: 'png',
|
|
|
canvasId: id,
|
|
|
success: function (res) {
|
|
|
- _self.loadingMore2 = false
|
|
|
+ _self.loadingMore2 = false;
|
|
|
_self.shopmoneyimg = res.tempFilePath;
|
|
|
},
|
|
|
fail: function (res) {},
|
|
@@ -772,7 +796,7 @@ export default {
|
|
|
|
|
|
// 未来七天
|
|
|
async futureDayData() {
|
|
|
- this.loadingMore3 = true
|
|
|
+ this.loadingMore3 = true;
|
|
|
if (this.shopID === 0) {
|
|
|
this.shopID = '';
|
|
|
}
|
|
@@ -859,7 +883,7 @@ export default {
|
|
|
fileType: 'png',
|
|
|
canvasId: canvasId,
|
|
|
success: function (res) {
|
|
|
- _self.loadingMore3 = false
|
|
|
+ _self.loadingMore3 = false;
|
|
|
_self.futureimg = res.tempFilePath;
|
|
|
},
|
|
|
fail: function (res) {},
|
|
@@ -878,7 +902,7 @@ export default {
|
|
|
|
|
|
// 商品销售占比
|
|
|
async shopSellData() {
|
|
|
- this.loadingMore4 = true
|
|
|
+ this.loadingMore4 = true;
|
|
|
await this.$http
|
|
|
.get('/homePage/getData1', {
|
|
|
date: this.today,
|
|
@@ -942,7 +966,7 @@ export default {
|
|
|
fileType: 'png',
|
|
|
canvasId: canvasId,
|
|
|
success: function (res) {
|
|
|
- _self.loadingMore4 = false
|
|
|
+ _self.loadingMore4 = false;
|
|
|
_self.shopimg = res.tempFilePath;
|
|
|
},
|
|
|
fail: function (res) {},
|
|
@@ -1149,12 +1173,13 @@ canvas {
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
.item {
|
|
|
+ position: relative;
|
|
|
width: 320rpx;
|
|
|
border-radius: 10rpx;
|
|
|
color: #ffffff;
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
+ // display: flex;
|
|
|
+ // justify-content: space-between;
|
|
|
+ // align-items: center;
|
|
|
padding: 25rpx;
|
|
|
box-sizing: border-box;
|
|
|
margin-bottom: 32rpx;
|
|
@@ -1185,7 +1210,6 @@ canvas {
|
|
|
|
|
|
.detail {
|
|
|
display: flex;
|
|
|
- justify-content: center;
|
|
|
align-items: center;
|
|
|
|
|
|
.icon {
|
|
@@ -1203,6 +1227,9 @@ canvas {
|
|
|
}
|
|
|
|
|
|
.right {
|
|
|
+ position: absolute;
|
|
|
+ right: 32upx;
|
|
|
+ top: 29upx;
|
|
|
width: 90rpx;
|
|
|
height: 90rpx;
|
|
|
border-radius: 50%;
|