Commit 3cc0ae48 authored by 李智书's avatar 李智书

1.修改商家查询数据H5;

parent c7d629f2
......@@ -80,6 +80,8 @@
{{item.dealTime||''}}
</view>
</view>
<div class="van-list__finished-text" v-if="totalCnt==flowsList.length">没有更多了</div>
<div class="van-list__error-text" v-if="totalCnt!=flowsList.length" @tap="Loadmore">点击加载更多...</div>
<!-- 无数据 -->
<view class="nodata" v-if="flowsList.length==0" style="margin-top: 0;">
<image :src="ImgUrl+'xzf/h5/nodata.png'" style="width: 399rpx;height: 211rpx;" mode="aspectFit">
......@@ -109,6 +111,10 @@
export default {
name: "Store",
props: {
totalCnt: {
type: Number,
default: 0
},
isperiod: {
type: Boolean,
default: false
......@@ -163,6 +169,9 @@
},
methods: {
Loadmore() {
this.$emit("Loadmore", true)
},
onConfirmStore(value, index) {
console.warn(`当前值:${value}, 当前索引:${index}`);
this.selectStore()
......
......@@ -9,10 +9,10 @@
</template>
<!-- 内容 -->
<template #default>
<Store v-if="active!=1" :isperiod="isperiod" :StoreInfo_="StoreInfo_" :flowsList="flowsList"
:storeInfo="storeInfo" @selectTime="selectTime" @selectStore="selectStore"
:starttime="starttime" :endtime="endtime" :calendar="calendar" :ImgUrl="ImgUrl"
:ImgUrl2="ImgUrl2"></Store>
<Store v-if="active!=1" :totalCnt="totalCnt" :isperiod="isperiod" :StoreInfo_="StoreInfo_"
:flowsList="flowsList" :storeInfo="storeInfo" @selectTime="selectTime"
@selectStore="selectStore" @Loadmore="Loadmore" :starttime="starttime" :endtime="endtime"
:calendar="calendar" :ImgUrl="ImgUrl" :ImgUrl2="ImgUrl2"></Store>
</template>
</van-tab>
<van-tab title="设备">
......@@ -113,12 +113,19 @@
deviceList_: [],
pageIndex: 1,
pageSize: 20,
// 数据总条数
totalCnt: 0
}
},
onLoad: function(options) {
},
methods: {
// 加载更多
Loadmore() {
this.pageIndex += 1
this.StoreFlows(this.StoreInfo_['id'])
},
//门店设备
async DeviceList(storeId) {
// 高峰期禁止请求接口
......@@ -169,11 +176,19 @@
}
let jsonData = JSON.parse(JSON.stringify(data || {}))
const backData = jsonData.data.backData || []
const totalCnt = jsonData.data.totalCnt || 0
this.flowsList = backData.map((v, index) => {
v['amount'] = parseFloat(v.amount / 100).toFixed(2)
return v
})
this.totalCnt = jsonData.data.totalCnt || 0
if (this.pageIndex == 1) {
this.flowsList = backData.map((v, index) => {
v['amount'] = parseFloat(v.amount / 100).toFixed(2)
return v
})
} else {
const arr = backData.map((v, index) => {
v['amount'] = parseFloat(v.amount / 100).toFixed(2)
return v
})
this.flowsList.push(...arr)
}
},
// 设备查看明细
async transactionDetails(item, index) {
......@@ -231,6 +246,8 @@
async changeTabs(e) {
// 清空选择的门店信息
this.StoreInfo_ = {}
this.pageIndex = 1;
this.pageSize = 20;
if (e === 0) {
this.StoreFlows()
} else {
......
......@@ -55,6 +55,9 @@
</image>
<view class="text1">暂无数据</view>
</view>
<div class="van-list__finished-text" v-if="dataList.length>0&&totalCnt==dataList.length">没有更多了</div>
<div class="van-list__error-text" v-if="dataList.length>0&&totalCnt!=dataList.length" @tap="Loadmore">
点击加载更多...</div>
</view>
</view>
<!-- 高峰期文案 无数据 -->
......@@ -72,8 +75,8 @@
</view> -->
</view>
<!-- 选择日期组件 -->
<van-calendar v-model="calendar" :max-range="93" :min-date="minDate" :show-confirm="true" position="bottom" color="#01CB88"
type="range" @confirm="onConfirm" />
<van-calendar v-model="calendar" :max-range="93" :min-date="minDate" :show-confirm="true" position="bottom"
color="#01CB88" type="range" @confirm="onConfirm" />
</view>
</template>
......@@ -118,6 +121,10 @@
this.DeviceFlows()
},
methods: {
Loadmore() {
this.pageIndex += 1
this.DeviceFlows()
},
//设备流水
async DeviceFlows() {
const loading = Toast.loading('数据加载中...');
......@@ -142,10 +149,18 @@
const backData = jsonData.data.backData || []
this.totalAmount = parseFloat(jsonData.data.totalAmount / 100).toFixed(2)
this.totalCnt = jsonData.data.totalCnt || 0
this.dataList = backData.map((v, index) => {
v['amount'] = parseFloat(v.amount / 100).toFixed(2)
return v
})
if (this.pageIndex == 1) {
this.dataList = backData.map((v, index) => {
v['amount'] = parseFloat(v.amount / 100).toFixed(2)
return v
})
} else {
const arr = backData.map((v, index) => {
v['amount'] = parseFloat(v.amount / 100).toFixed(2)
return v
})
this.dataList.push(...arr)
}
},
// 组件提交时间
onConfirm(date) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment