This commit is contained in:
GaoHao
2025-03-10 17:26:39 +08:00
parent 490c513f48
commit cc97b6acca
26 changed files with 258 additions and 305 deletions

View File

@@ -35,18 +35,16 @@
</template>
<script setup>
import { getCurrentInstance, ref } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import {
summaryTrade,
} from '@/http/yskApi/requestAll.js';
import dayjs from 'dayjs' //时间格式库
import {
getCurrentInstance,
ref
} from 'vue';
import datePickerview from './my-date-pickerview.vue'
import {
onShow
} from '@dcloudio/uni-app';
import { getTrade } from '@/api/summary.js'
let selected = ref('today')
let showAll = ref(false);
let $list = []
@@ -121,10 +119,9 @@
startTime = s + ' 00:00:00'
endTime = e + ' 23:59:59'
}
summaryTrade({
shopId: uni.getStorageSync('shopId'),
startTime,
endTime,
getTrade({
beginTime: startTime,
endTime: endTime,
}).then((res) => {
$list = res.sale.payCount
setList()

View File

@@ -47,45 +47,27 @@
</template>
<script setup>
import {
reactive,
ref,
onMounted,
nextTick
} from 'vue';
import {
onShareAppMessage,
onShareTimeline
} from '@dcloudio/uni-app';
import {
reqLoad,
API_URL_SYS_ARTICLES,
$indexStatistics,
$getSiteInfos
} from '@/http/apiManager.js';
import { reactive, ref, onMounted, nextTick } from 'vue';
import { onPullDownRefresh, onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app';
import go from '@/commons/utils/go.js';
import Stats from './components/Stats.vue';
import statistics from './components/statistics.vue'
import {
onPullDownRefresh,
onLoad
} from '@dcloudio/uni-app';
import storageManage from '@/commons/utils/storageManage.js';
import {
hasPermission
} from '@/commons/utils/hasPermission.js'
uni.hideTabBar()
let shopName = ref()
onLoad((options) => {
shopName.value = uni.getStorageSync('shopName');
});
let totalRevenuedata = ref()
let totalRevenue = (d) => {
totalRevenuedata.value = d
}
let showTips = ref(false)
function toggleTips() {
showTips.value = !showTips.value
}
@@ -282,6 +264,22 @@
];
const vdata = reactive({
noticeList: [], // 公告列表
adList: [],
shareImgUrl: '' //分享图片
});
onLoad((options) => {
shopName.value = uni.getStorageSync('shopName');
});
// 启动加载
onMounted(() => {
// refData();
});
// 如果不是超管 删除 刷脸广告菜单
if (storageManage.userInfo().userType != 1) {
const index = navList.findIndex((v) => v.entId == 'ENT_ADVERT_CONTROL');
@@ -290,36 +288,17 @@
}
}
const vdata = reactive({
noticeList: [], // 公告列表
adList: [],
shareImgUrl: '' //分享图片
});
// 刷新数据 async 异步函数, 每个查询需要返回promise对象并标识await
async function refData() {
// 查询公告列表
// 调用子组件方法 , 避免组件没有加载完成。
// nextTick(() => statsRef.value.refData());
// 停止刷新
// 停止刷新
uni.stopPullDownRefresh();
}
// 获取 统计数据
const getIndexStat = (time) => {
$indexStatistics(time).then(({
bizData
}) => {
vdata.statInfo = bizData.dayCount;
});
};
// 启动加载
onMounted(() => {
// refData();
});
// 微信分享
/**
* 微信分享
*/
onShareAppMessage((res) => {
if (res.from == 'menu')
return {
@@ -328,7 +307,10 @@
imageUrl: vdata.shareImgUrl
};
});
// 分享到朋友圈
/**
* 分享到朋友圈
*/
onShareTimeline(() => {
return {
title: uni.$appName,