下单退款相关更新

This commit is contained in:
GaoHao
2025-03-15 18:30:27 +08:00
parent c2135c6119
commit 994cf8bf2b
54 changed files with 682 additions and 2408 deletions

View File

@@ -35,11 +35,9 @@
</template>
<script setup>
import { getCurrentInstance, ref } from 'vue';
import { getCurrentInstance, ref, reactive } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import {
summaryTrade,
} from '@/http/yskApi/requestAll.js';
import dayjs from 'dayjs' //时间格式库
import datePickerview from './my-date-pickerview.vue'
@@ -47,17 +45,25 @@
let selected = ref('today')
let showAll = ref(false);
let $list = []
let list = ref()
const pageData = reactive({
list: [
{payType: '微信小程序', key:'wechatPayAmount', payAmount: 0},
{payType: '支付宝小程序', key:'aliPayAmount', payAmount: 0},
{payType: '主扫收款', key:'scanPayAmount', payAmount: 0},
{payType: '收款码收款', key:'', payAmount: 0},
{payType: '现金收款', key:'cashPayAmount', payAmount: 0},
{payType: '充值收款', key:'rechargeAmount', payAmount: 0},
],
})
function toggleShowAll() {
showAll.value = !showAll.value
setList()
}
function setList() {
list.value = showAll.value ? $list : $list.slice(0, 4)
list.value = showAll.value ? pageData.list : pageData.list.slice(0, 4)
}
let list = ref()
const emit = defineEmits(['totalRevenue'])
const timeList = [{
label: '今天',
@@ -90,7 +96,12 @@
})
}
});
/**
* 获取统计数据
* @param {Object} start
* @param {Object} end
*/
function getlist(start, end) {
let startTime, endTime;
if (selected.value == 'today') {
@@ -123,15 +134,30 @@
beginDate: startTime,
endDate: endTime,
}).then((res) => {
$list = res.sale.payCount
for (var key in res) {
pageData.list.map(item=>{
if(item.key == key) {
item.payAmount = res[key]
}
})
}
setList()
emit('totalRevenue', res.sale.incomeAmountAll)
let incomeAmountAll = 0;
pageData.list.map(item=>{
incomeAmountAll += (item.payAmount||0)
})
emit('totalRevenue', incomeAmountAll)
})
}
/**
* 日期筛选确认
* @param {Object} e
*/
function datePickerConfirm(e) {
getlist(e.start, e.end)
}
// 获取当前时间
function getdate() {
const dt = new Date();
@@ -143,6 +169,7 @@
const ss = (dt.getSeconds() + "").padStart(2, "0");
return `${y}-${m}-${d}`;
}
// 获取昨天时间
const formatTime = () => {
let strDate = getdate()