代码优化
This commit is contained in:
@@ -53,24 +53,16 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
onMounted
|
||||
} from 'vue';
|
||||
import {
|
||||
$indexStatistics,
|
||||
$memberInfoCount
|
||||
} from '@/http/apiManager.js';
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
|
||||
import cal from '@/commons/utils/cal.js';
|
||||
import go from '@/commons/utils/go.js';
|
||||
import ent from '@/commons/utils/ent.js';
|
||||
import unionScan from '@/commons/utils/unionScan.js';
|
||||
import storageManage from '@/commons/utils/storageManage.js';
|
||||
import dayjs from 'dayjs' //时间格式库
|
||||
import {
|
||||
summaryTrade,
|
||||
} from '@/http/yskApi/requestAll.js';
|
||||
|
||||
import { getTrade } from '@/http/api/summary.js'
|
||||
onMounted(() => {
|
||||
vdata.memberIsShow = ent.has('ENT_MCH_MEMBER') && storageManage.userInfo().isHasMemberEnt;
|
||||
if (ent.has('ENT_MCH_MEMBER') && storageManage.userInfo().isHasMemberEnt) {
|
||||
@@ -125,7 +117,7 @@
|
||||
startTime = start
|
||||
endTime = end
|
||||
}
|
||||
summaryTrade({
|
||||
getTrade({
|
||||
shopId: uni.getStorageSync('shopId'),
|
||||
startTime,
|
||||
endTime,
|
||||
@@ -145,14 +137,14 @@
|
||||
// 根据选择请求数据
|
||||
function refData() {
|
||||
// 获取 统计数据
|
||||
$indexStatistics(vdata.timeSelected).then(({
|
||||
bizData
|
||||
}) => {
|
||||
vdata.payAmount = bizData.totalSuccAmt;
|
||||
vdata.payCount = bizData.totalSuccNum;
|
||||
vdata.refundAmount = bizData.totalRefundAmt;
|
||||
vdata.refundCount = bizData.totalRefundNum;
|
||||
});
|
||||
// $indexStatistics(vdata.timeSelected).then(({
|
||||
// bizData
|
||||
// }) => {
|
||||
// vdata.payAmount = bizData.totalSuccAmt;
|
||||
// vdata.payCount = bizData.totalSuccNum;
|
||||
// vdata.refundAmount = bizData.totalRefundAmt;
|
||||
// vdata.refundCount = bizData.totalRefundNum;
|
||||
// });
|
||||
}
|
||||
|
||||
// 扫码动作
|
||||
@@ -196,13 +188,13 @@
|
||||
return `${y}-${m}-${d}`
|
||||
}
|
||||
const getMemberData = () => {
|
||||
$memberInfoCount({
|
||||
queryDateRange: vdata.timeSelected
|
||||
}).then(({
|
||||
bizData
|
||||
}) => {
|
||||
Object.assign(memberData, bizData);
|
||||
});
|
||||
// $memberInfoCount({
|
||||
// queryDateRange: vdata.timeSelected
|
||||
// }).then(({
|
||||
// bizData
|
||||
// }) => {
|
||||
// Object.assign(memberData, bizData);
|
||||
// });
|
||||
};
|
||||
defineExpose({
|
||||
refData
|
||||
|
||||
Reference in New Issue
Block a user