This commit is contained in:
gyq
2025-12-02 19:13:19 +08:00
98 changed files with 8022 additions and 3322 deletions

View File

@@ -52,7 +52,7 @@ const menuList = ref([
{
title: '超级会员',
icon: '',
pageUrl: 'PAGES_ORDER_INDEX',
pageUrl: 'PAGES_MARKET_SUPER_VIP',
intro: '用户会员管理设置'
},
{

View File

@@ -1,302 +1,294 @@
<template>
<view class="index-header" @tap="go.to('PAGES_STAT')">
<view class="index-selected">
<view class="index-time">
<block v-for="v in timeList" :key="v.value">
<view class="time-item flex-center" :class="{ 'time-active': vdata.timeSelected == v.value }"
@tap.stop="changeTimeFunc(v.value)">
{{ v.title }}
</view>
</block>
</view>
<view class="index-scan flex-center" @click.stop="scanFunc">
<image src="/static/iconImg/icon-scan-index.svg" mode="scaleToFill" />
</view>
</view>
<view class="receipts-money">
<text class="money-title">成交金额 ()</text>
<view class="money-num">{{ list?list.sale.incomeAmountAll:0}}</view>
</view>
<view class="money-list">
<view class="money-item">
<text class="money-title">消费笔数</text>
<view class="money-num">{{ list?list.vip.useNum:0 }}</view>
</view>
<view class="money-item">
<text class="money-title">退款金额 ()</text>
<view class="money-num">{{ list?list.sale.outAmount:0}}</view>
</view>
<view class="money-item">
<text class="money-title">消费金额</text>
<view class="money-num">{{ list?list.vip.useAmount:0 }}</view>
</view>
</view>
<view class="money-list" v-if="vdata.memberIsShow">
<view class="money-item">
<text class="money-title">会员充值()</text>
<view class="money-num">{{ cal.cert2Dollar(memberData.payAmount) }}</view>
</view>
<view class="money-item">
<text class="money-title">会员消费()</text>
<view class="money-num">{{ cal.cert2Dollar(Math.abs(memberData.changeAmount)) }}</view>
</view>
<view class="index-header" @tap="go.to('PAGES_STAT')">
<view class="index-selected">
<view class="index-time">
<block v-for="v in timeList" :key="v.value">
<view
class="time-item flex-center"
:class="{ 'time-active': vdata.timeSelected == v.value }"
@tap.stop="changeTimeFunc(v.value)"
>
{{ v.title }}
</view>
</block>
</view>
<view class="index-scan flex-center" @click.stop="scanFunc">
<image src="/static/iconImg/icon-scan-index.svg" mode="scaleToFill" />
</view>
</view>
<view class="receipts-money">
<text class="money-title">成交金额 ()</text>
<view class="money-num">{{ list ? list.sale.incomeAmountAll : 0 }}</view>
</view>
<view class="money-list">
<view class="money-item">
<text class="money-title">消费笔数</text>
<view class="money-num">{{ list ? list.vip.useNum : 0 }}</view>
</view>
<view class="money-item">
<text class="money-title">退款金额 ()</text>
<view class="money-num">{{ list ? list.sale.outAmount : 0 }}</view>
</view>
<view class="money-item">
<text class="money-title">消费金额</text>
<view class="money-num">{{ list ? list.vip.useAmount : 0 }}</view>
</view>
</view>
<view class="money-list" v-if="vdata.memberIsShow">
<view class="money-item">
<text class="money-title">会员充值()</text>
<view class="money-num">{{
cal.cert2Dollar(memberData.payAmount)
}}</view>
</view>
<view class="money-item">
<text class="money-title">会员消费()</text>
<view class="money-num">{{
cal.cert2Dollar(Math.abs(memberData.changeAmount))
}}</view>
</view>
<view class="money-item">
<text class="money-title">会员消费笔数</text>
<view class="money-num">{{ memberData.changeCount }}</view>
</view>
</view>
<view>
<!-- <text class="money-title">展开全部</text> -->
</view>
</view>
<view class="money-item">
<text class="money-title">会员消费笔数</text>
<view class="money-num">{{ memberData.changeCount }}</view>
</view>
</view>
<view>
<!-- <text class="money-title">展开全部</text> -->
</view>
</view>
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue';
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 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 { timeList } from '@/data/index.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) {
getMemberData();
}
getList()
});
const emits = defineEmits(['click']);
const timeList = [{
title: '今天',
value: 'today'
},
{
title: '昨天',
value: 'yesterday'
},
{
title: '近7天',
value: 'circumference'
},
{
title: '近30天',
value: 'moon'
}
];
let list = ref()
const vdata = reactive({
timeSelected: 'today', // 当前时间选择器的
payAmount: -1, // 实收金额
payCount: -1, // 交易笔数
refundAmount: -1, // 退款金额
refundCount: -1, // 退款笔数
memberIsShow: false //是否开启会员模块
});
const memberData = reactive({});
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) {
getMemberData();
}
getList();
});
const emits = defineEmits(["click"]);
let list = ref();
const vdata = reactive({
timeSelected: "today", // 当前时间选择器的
payAmount: -1, // 实收金额
payCount: -1, // 交易笔数
refundAmount: -1, // 退款金额
refundCount: -1, // 退款笔数
memberIsShow: false, //是否开启会员模块
});
const memberData = reactive({});
function getList() {
let startTime, endTime;
if (vdata.timeSelected == 'today') {
startTime = dayjs().format('YYYY-MM-DD') + ' 00:00:00'
endTime = dayjs().format('YYYY-MM-DD') + ' 23:59:59'
} else if (vdata.timeSelected == 'yesterday') {
startTime = formatTime() + ' 00:00:00'
endTime = formatTime() + ' 23:59:59'
} else if (vdata.timeSelected == 'circumference') {
startTime = dayjs().add(-7, 'day').format('YYYY-MM-DD 00:00:00')
endTime = dayjs().format('YYYY-MM-DD 23:59:59')
} else if (vdata.timeSelected == 'moon') {
startTime = dayjs().add(-30, 'day').format('YYYY-MM-DD 00:00:00')
endTime = dayjs().format('YYYY-MM-DD 23:59:59')
} else if (vdata.timeSelected == 'custom') {
startTime = start
endTime = end
}
getTrade({
shopId: uni.getStorageSync('shopId'),
startTime,
endTime,
}).then((res) => {
list.value = res
})
}
// 切换 时间卡片
function changeTimeFunc(val) {
vdata.timeSelected = val;
getList()
// refData();
// if (vdata.memberIsShow) {
// getMemberData();
// }
}
// 根据选择请求数据
function refData() {
// 获取 统计数据
// $indexStatistics(vdata.timeSelected).then(({
// bizData
// }) => {
// vdata.payAmount = bizData.totalSuccAmt;
// vdata.payCount = bizData.totalSuccNum;
// vdata.refundAmount = bizData.totalRefundAmt;
// vdata.refundCount = bizData.totalRefundNum;
// });
}
function getList() {
let startTime, endTime;
if (vdata.timeSelected == "today") {
startTime = dayjs().format("YYYY-MM-DD") + " 00:00:00";
endTime = dayjs().format("YYYY-MM-DD") + " 23:59:59";
} else if (vdata.timeSelected == "yesterday") {
startTime = formatTime() + " 00:00:00";
endTime = formatTime() + " 23:59:59";
} else if (vdata.timeSelected == "circumference") {
startTime = dayjs().add(-7, "day").format("YYYY-MM-DD 00:00:00");
endTime = dayjs().format("YYYY-MM-DD 23:59:59");
} else if (vdata.timeSelected == "moon") {
startTime = dayjs().add(-30, "day").format("YYYY-MM-DD 00:00:00");
endTime = dayjs().format("YYYY-MM-DD 23:59:59");
} else if (vdata.timeSelected == "custom") {
startTime = start;
endTime = end;
}
getTrade({
shopId: uni.getStorageSync("shopId"),
startTime,
endTime,
}).then((res) => {
list.value = res;
});
}
// 切换 时间卡片
function changeTimeFunc(val) {
vdata.timeSelected = val;
getList();
// refData();
// if (vdata.memberIsShow) {
// getMemberData();
// }
}
// 根据选择请求数据
function refData() {
// 获取 统计数据
// $indexStatistics(vdata.timeSelected).then(({
// bizData
// }) => {
// vdata.payAmount = bizData.totalSuccAmt;
// vdata.payCount = bizData.totalSuccNum;
// vdata.refundAmount = bizData.totalRefundAmt;
// vdata.refundCount = bizData.totalRefundNum;
// });
}
// 扫码动作
function scanFunc() {
unionScan.scan(true).then((res) => {
// 登录类型
if (res.type == unionScan.QR_TYPE_LOGIN) {
return go.to('PAGES_SCAN_LOGIN', {
qrcodeNo: res.originQrVal
});
}
// 扫码动作
function scanFunc() {
unionScan.scan(true).then((res) => {
// 登录类型
if (res.type == unionScan.QR_TYPE_LOGIN) {
return go.to("PAGES_SCAN_LOGIN", {
qrcodeNo: res.originQrVal,
});
}
// 二维码
if (res.type == unionScan.QR_TYPE_QRC) {
return go.to('PAGES_APP_CODE_BIND', {
qrcId: res.bizValue
});
}
});
}
// 获取当前时间
function getdate() {
const dt = new Date();
const y = dt.getFullYear();
const m = (dt.getMonth() + 1 + "").padStart(2, "0");
const d = (dt.getDate() + "").padStart(2, "0");
const hh = (dt.getHours() + "").padStart(2, "0");
const mm = (dt.getMinutes() + "").padStart(2, "0");
const ss = (dt.getSeconds() + "").padStart(2, "0");
return `${y}-${m}-${d}`;
}
// 获取昨天时间
const formatTime = () => {
let strDate = getdate()
let dateFormat = new Date(strDate);
dateFormat = dateFormat.setDate(dateFormat.getDate() - 1);
dateFormat = new Date(dateFormat);
let y = dateFormat.getFullYear()
let m = (dateFormat.getMonth() + 1).toString().padStart(2, '0')
let d = dateFormat.getDate().toString().padStart(2, '0')
return `${y}-${m}-${d}`
}
const getMemberData = () => {
// $memberInfoCount({
// queryDateRange: vdata.timeSelected
// }).then(({
// bizData
// }) => {
// Object.assign(memberData, bizData);
// });
};
defineExpose({
refData
});
// 二维码
if (res.type == unionScan.QR_TYPE_QRC) {
return go.to("PAGES_APP_CODE_BIND", {
qrcId: res.bizValue,
});
}
});
}
// 获取当前时间
function getdate() {
const dt = new Date();
const y = dt.getFullYear();
const m = (dt.getMonth() + 1 + "").padStart(2, "0");
const d = (dt.getDate() + "").padStart(2, "0");
const hh = (dt.getHours() + "").padStart(2, "0");
const mm = (dt.getMinutes() + "").padStart(2, "0");
const ss = (dt.getSeconds() + "").padStart(2, "0");
return `${y}-${m}-${d}`;
}
// 获取昨天时间
const formatTime = () => {
let strDate = getdate();
let dateFormat = new Date(strDate);
dateFormat = dateFormat.setDate(dateFormat.getDate() - 1);
dateFormat = new Date(dateFormat);
let y = dateFormat.getFullYear();
let m = (dateFormat.getMonth() + 1).toString().padStart(2, "0");
let d = dateFormat.getDate().toString().padStart(2, "0");
return `${y}-${m}-${d}`;
};
const getMemberData = () => {
// $memberInfoCount({
// queryDateRange: vdata.timeSelected
// }).then(({
// bizData
// }) => {
// Object.assign(memberData, bizData);
// });
};
defineExpose({
refData,
});
</script>
<style lang="scss" scoped>
.index-header {
width: 680rpx;
margin: 0 auto;
transform: translateY(30rpx);
margin-bottom: 25rpx;
padding: 20rpx;
box-sizing: border-box;
border-radius: $J-b-r32;
background: $jeepay-bg-primary;
backdrop-filter: blur(20rpx);
box-shadow: 0 50rpx 70rpx -60rpx rgba(0, 65, 164, 0.5);
.index-header {
width: 680rpx;
margin: 0 auto;
transform: translateY(30rpx);
margin-bottom: 25rpx;
padding: 20rpx;
box-sizing: border-box;
border-radius: $J-b-r32;
background: $jeepay-bg-primary;
backdrop-filter: blur(20rpx);
box-shadow: 0 50rpx 70rpx -60rpx rgba(0, 65, 164, 0.5);
.index-selected {
display: flex;
justify-content: space-between;
.index-selected {
display: flex;
justify-content: space-between;
.index-time {
display: flex;
justify-content: space-between;
align-items: center;
width: 490rpx;
height: 90rpx;
border-radius: 20rpx;
padding: 10rpx;
background-color: rgba($color: #fff, $alpha: 0.1);
.index-time {
display: flex;
justify-content: space-between;
align-items: center;
width: 490rpx;
height: 90rpx;
border-radius: 20rpx;
padding: 10rpx;
background-color: rgba($color: #fff, $alpha: 0.1);
.time-item {
flex: 1;
// width: 120rpx;
height: 100%;
font-size: 32rpx;
font-weight: 500;
color: rgba(255, 255, 255, 0.75);
}
.time-item {
flex: 1;
// width: 120rpx;
height: 100%;
font-size: 32rpx;
font-weight: 500;
color: rgba(255, 255, 255, 0.75);
}
.time-active {
background-color: $J-bg-ff;
color: $J-color-t21;
border-radius: 12rpx;
}
}
.time-active {
background-color: $J-bg-ff;
color: $J-color-t21;
border-radius: 12rpx;
}
}
.index-scan {
width: 110rpx;
height: 110rpx;
border-radius: 20rpx;
background-color: rgba($color: #fff, $alpha: 0.1);
.index-scan {
width: 110rpx;
height: 110rpx;
border-radius: 20rpx;
background-color: rgba($color: #fff, $alpha: 0.1);
image {
width: 41rpx;
height: 35rpx;
}
}
}
image {
width: 41rpx;
height: 35rpx;
}
}
}
.receipts-money {
display: flex;
flex-direction: column;
align-items: center;
margin: 30rpx 0;
color: $J-color-tff;
.receipts-money {
display: flex;
flex-direction: column;
align-items: center;
margin: 30rpx 0;
color: $J-color-tff;
.money-num {
font-size: 70rpx;
font-weight: 500;
}
}
.money-num {
font-size: 70rpx;
font-weight: 500;
}
}
.money-list {
display: flex;
justify-content: space-between;
padding: 0 72rpx;
margin-bottom: 50rpx;
text-align: center;
color: $J-color-tff;
.money-list {
display: flex;
justify-content: space-between;
padding: 0 72rpx;
margin-bottom: 50rpx;
text-align: center;
color: $J-color-tff;
.money-item {
.money-num {
font-size: 32rpx;
font-weight: 500;
}
}
}
.money-item {
.money-num {
font-size: 32rpx;
font-weight: 500;
}
}
}
.money-title {
margin-bottom: 10rpx;
font-size: 26rpx;
font-weight: 400;
color: $J-color-tSff;
}
.money-title {
margin-bottom: 10rpx;
font-size: 26rpx;
font-weight: 400;
color: $J-color-tSff;
}
.quick-money {
height: 110rpx;
border-radius: 20rpx;
color: $J-color-t29;
}
}
</style>
.quick-money {
height: 110rpx;
border-radius: 20rpx;
color: $J-color-t29;
}
}
</style>

View File

@@ -1,30 +1,40 @@
<template>
<view class="mask" v-if="show" @tap="close">
<view class="box" @tap.stop="nullFunction">
<view class="u-flex u-relative u-row-center u-p-30 top">
<view class="font-bold u-font-32">筛选日期时间</view>
<view class="close" @tap="close">
<uni-icons type="closeempty" size="24"></uni-icons>
</view>
</view>
<!-- <view class="u-p-30 u-flex u-flex-wrap gap-20 fastTime">
<view class="mask" v-if="show" @tap="close">
<view class="box" @tap.stop="nullFunction">
<view class="u-flex u-relative u-row-center u-p-30 top">
<view class="font-bold u-font-32">筛选日期时间</view>
<view class="close" @tap="close">
<uni-icons type="closeempty" size="24"></uni-icons>
</view>
</view>
<!-- <view class="u-p-30 u-flex u-flex-wrap gap-20 fastTime">
<view class="item" v-for="(item,index) in fastTime" :key="index" @tap="changeTime(item.key)">
{{item.title}}
</view>
</view> -->
<picker-view :immediate-change="true" @pickend="pickend" :value="value" @change="bindChange"
class="picker-view">
<picker-view-column>
<view class="item" v-for="(item,index) in years" :key="index">{{item}}</view>
</picker-view-column>
<picker-view-column>
<view class="item" v-for="(item,index) in months" :key="index">{{item}}</view>
</picker-view-column>
<picker-view-column>
<view class="item" v-for="(item,index) in days" :key="index">{{item}}</view>
</picker-view-column>
<!-- <picker-view-column>
<picker-view
:immediate-change="true"
@pickend="pickend"
:value="value"
@change="bindChange"
class="picker-view"
>
<picker-view-column>
<view class="item" v-for="(item, index) in years" :key="index"
>{{ item }}</view
>
</picker-view-column>
<picker-view-column>
<view class="item" v-for="(item, index) in months" :key="index"
>{{ item }}</view
>
</picker-view-column>
<picker-view-column>
<view class="item" v-for="(item, index) in days" :key="index"
>{{ item }}</view
>
</picker-view-column>
<!-- <picker-view-column>
<view class="item" v-for="(item,index) in hours" :key="index">{{item}}</view>
</picker-view-column>
<picker-view-column>
@@ -33,20 +43,31 @@
<picker-view-column>
<view class="item" v-for="(item,index) in seconds" :key="index">{{item}}</view>
</picker-view-column> -->
</picker-view>
<view class="u-text-center color-999"></view>
<picker-view :immediate-change="true" :value="value1" @pickend="pickend1" @change="bindChange1"
class="picker-view">
<picker-view-column>
<view class="item" v-for="(item,index) in years" :key="index">{{item}}</view>
</picker-view-column>
<picker-view-column>
<view class="item" v-for="(item,index) in months" :key="index">{{item}}</view>
</picker-view-column>
<picker-view-column>
<view class="item" v-for="(item,index) in days1" :key="index">{{item}}</view>
</picker-view-column>
<!-- <picker-view-column>
</picker-view>
<view class="u-text-center color-999"></view>
<picker-view
:immediate-change="true"
:value="value1"
@pickend="pickend1"
@change="bindChange1"
class="picker-view"
>
<picker-view-column>
<view class="item" v-for="(item, index) in years" :key="index"
>{{ item }}</view
>
</picker-view-column>
<picker-view-column>
<view class="item" v-for="(item, index) in months" :key="index"
>{{ item }}</view
>
</picker-view-column>
<picker-view-column>
<view class="item" v-for="(item, index) in days1" :key="index"
>{{ item }}</view
>
</picker-view-column>
<!-- <picker-view-column>
<view class="item" v-for="(item,index) in hours" :key="index">{{item}}</view>
</picker-view-column>
<picker-view-column>
@@ -55,394 +76,403 @@
<picker-view-column>
<view class="item" v-for="(item,index) in seconds" :key="index">{{item}}</view>
</picker-view-column> -->
</picker-view>
<!-- 站位 -->
<view style="height: 80px;"></view>
<view class="fixed_b">
<my-button shape="circle" @tap="confirm">确定</my-button>
</view>
</view>
</view>
</picker-view>
<!-- 站位 -->
<view style="height: 80px"></view>
<view class="fixed_b">
<my-button shape="circle" @tap="confirm">确定</my-button>
</view>
</view>
</view>
</template>
<script setup>
import myButton from "@/components/my-components/my-button.vue"
import {
reactive,
ref
} from 'vue';
const $nowDate = new Date()
const nowDate = {
year: $nowDate.getFullYear(),
month: $nowDate.getMonth() + 1,
day: $nowDate.getDate(),
hours: $nowDate.getHours(),
minutes: $nowDate.getMinutes(),
seconds: $nowDate.getSeconds()
}
const yearsLen = 30
const years = new Array(yearsLen).fill(1).map((v, index) => {
return nowDate.year - index
}).reverse()
const months = new Array(12).fill(1).map((v, index) => {
return index + 1
})
const days = ref(new Array(getMonthArea($nowDate, 'end').getDate()).fill(1).map((v, index) => {
return index + 1
}))
const days1 = ref(new Array(getMonthArea($nowDate, 'end').getDate()).fill(1).map((v, index) => {
return index + 1
}))
const hours = new Array(24).fill(1).map((v, index) => {
return index
})
const minutes = new Array(60).fill(1).map((v, index) => {
return index
})
const seconds = new Array(60).fill(1).map((v, index) => {
return index
})
const fastTime = reactive([{
title: '今日',
key: 'now'
},
{
title: '昨日',
key: 'prve'
},
{
title: '本月',
key: 'nowMonth'
},
{
title: '上月',
key: 'prveMonth'
}
])
import myButton from "@/components/my-components/my-button.vue";
import { reactive, ref } from "vue";
const $nowDate = new Date();
const nowDate = {
year: $nowDate.getFullYear(),
month: $nowDate.getMonth() + 1,
day: $nowDate.getDate(),
hours: $nowDate.getHours(),
minutes: $nowDate.getMinutes(),
seconds: $nowDate.getSeconds(),
};
const yearsLen = 30;
const years = new Array(yearsLen)
.fill(1)
.map((v, index) => {
return nowDate.year - index;
})
.reverse();
const months = new Array(12).fill(1).map((v, index) => {
return index + 1;
});
const days = ref(
new Array(getMonthArea($nowDate, "end").getDate()).fill(1).map((v, index) => {
return index + 1;
})
);
const days1 = ref(
new Array(getMonthArea($nowDate, "end").getDate()).fill(1).map((v, index) => {
return index + 1;
})
);
const hours = new Array(24).fill(1).map((v, index) => {
return index;
});
const minutes = new Array(60).fill(1).map((v, index) => {
return index;
});
const seconds = new Array(60).fill(1).map((v, index) => {
return index;
});
const fastTime = reactive([
{
title: "今日",
key: "now",
},
{
title: "昨日",
key: "prve",
},
{
title: "本月",
key: "nowMonth",
},
{
title: "上月",
key: "prveMonth",
},
]);
function setPrveDay() {}
function setNowMoneth() {}
function setPrveDay() {
function setprveMoneth() {}
}
function setDay(start, end) {
value.value = [start.year, start.month, start.day, 0, 0, 0];
value1.value = [end.year, end.month, end.day, 23, 59, 59];
}
function setNowMoneth() {
function changeTime(key) {
const yearIndex = years.findIndex((v) => v == nowDate.year);
const prveyearIndex = years.findIndex((v) => v == nowDate.year) - 1;
const nowMonthIndex = nowDate.month - 1;
const nowDayIndex = nowDate.day - 1;
const dataMap = {
now: function () {
return {
start: {
year: yearIndex,
month: nowMonthIndex,
day: nowDayIndex,
},
end: {
year: yearIndex,
month: nowMonthIndex,
day: nowDayIndex,
},
};
},
prve: function () {
const oneDay = 1000 * 60 * 60 * 24;
const date = new Date(
new Date(nowDate.year, nowDate.month, nowDate.day, 0, 0, 0).getTime() -
oneDay
);
return {
start: {
year: years.findIndex((v) => v == date.getFullYear()),
month: date.getMonth() - 1 < 0 ? 11 : date.getMonth() - 1,
day: date.getDate() - 1,
},
end: {
year: years.findIndex((v) => v == date.getFullYear()),
month: date.getMonth() - 1 < 0 ? 11 : date.getMonth() - 1,
day: date.getDate() - 1,
},
};
},
nowMonth: function () {
return {
start: {
year: yearIndex,
month: nowMonthIndex,
day: 0,
},
end: {
year: yearIndex,
month: nowMonthIndex,
day: new Date(nowDate.year, nowDate.month, 0).getDate() - 1,
},
};
},
prveMonth: function () {
const oneDay = 1000 * 60 * 60 * 24;
const date = new Date(
new Date(nowDate.year, nowDate.month - 1, 0, 0, 0).getTime() - oneDay
);
console.log(date.getMonth());
return {
start: {
year: years.findIndex((v) => v == date.getFullYear()),
month: date.getMonth(),
day: 0,
},
end: {
year: years.findIndex((v) => v == date.getFullYear()),
month: date.getMonth(),
day: date.getDate(),
},
};
},
};
const data = dataMap[key]();
setDay(data.start, data.end);
changeDays(false, value.value);
changeDays(true, value1.value);
}
console.log(value1.value);
const start = returnDateString(value.value);
const end = returnDateString(value1.value);
function setprveMoneth() {
emits("confirm", {
text: `${start}——${end}`,
start,
end,
});
close();
}
let value = ref([
years.length - 1,
nowDate.month - 1,
nowDate.day - 1,
0,
0,
0,
]);
let value1 = ref([
years.length - 1,
nowDate.month - 1,
nowDate.day - 1,
23,
59,
59,
]);
}
let show = ref(false);
const emits = defineEmits("close", "open", "confirm");
function toggle() {
show.value = !show.value;
if (show.value) {
emits("open", true);
} else {
emits("close", false);
}
}
function setDay(start, end) {
value.value = [
start.year,
start.month,
start.day,
0,
0,
0,
]
value1.value = [
end.year,
end.month,
end.day,
23,
59,
59,
]
}
function close() {
show.value = false;
emits("close", false);
}
function changeTime(key) {
const yearIndex = years.findIndex(v => v == nowDate.year)
const prveyearIndex = years.findIndex(v => v == nowDate.year) - 1
const nowMonthIndex = nowDate.month - 1
const nowDayIndex = nowDate.day - 1
const dataMap = {
now: function() {
return {
start: {
year: yearIndex,
month: nowMonthIndex,
day: nowDayIndex
},
end: {
year: yearIndex,
month: nowMonthIndex,
day: nowDayIndex
}
}
},
prve: function() {
const oneDay=1000*60*60*24
const date=new Date(new Date(nowDate.year,nowDate.month,nowDate.day,0,0,0).getTime()-oneDay)
return {
start: {
year:years.findIndex(v=>v==date.getFullYear()),
month:date.getMonth()-1<0?11:date.getMonth()-1,
day: date.getDate()-1
},
end: {
year:years.findIndex(v=>v==date.getFullYear()),
month:date.getMonth()-1<0?11:date.getMonth()-1,
day: date.getDate()-1
}
}
},
nowMonth: function() {
return {
start: {
year:yearIndex,
month:nowMonthIndex,
day: 0
},
end: {
year:yearIndex,
month:nowMonthIndex,
day:new Date(nowDate.year, nowDate.month , 0).getDate() - 1
}
}
},
prveMonth: function() {
const oneDay=1000*60*60*24
const date=new Date(new Date(nowDate.year, nowDate.month-1,0,0,0).getTime()-oneDay)
console.log(date.getMonth());
return {
start: {
year:years.findIndex(v=>v==date.getFullYear()),
month:date.getMonth(),
day: 0
},
end: {
year:years.findIndex(v=>v==date.getFullYear()),
month:date.getMonth(),
day: date.getDate()
}
}
}
}
const data = dataMap[key]()
setDay(data.start, data.end)
changeDays(false,value.value)
changeDays(true,value1.value)
console.log(value1.value);
const start = returnDateString(value.value)
const end = returnDateString(value1.value)
emits('confirm', {
text: `${start}——${end}`,
start,
end
})
close()
}
let value = ref([
years.length - 1,
nowDate.month - 1,
nowDate.day - 1,
0,
0,
0,
])
let value1 = ref([
years.length - 1,
nowDate.month - 1,
nowDate.day - 1,
23,
59,
59,
])
function open() {
show.value = true;
emits("open", true);
}
let show = ref(false)
const emits = defineEmits('close', 'open', 'confirm')
function returnDateString(arr) {
const year = years[arr[0]];
const month = ("0" + (arr[1] + 1)).slice(-2);
const day = ("0" + (arr[2] + 1)).slice(-2);
const hour = ("0" + arr[3]).slice(-2);
const min = ("0" + arr[4]).slice(-2);
const sen = ("0" + arr[5]).slice(-2);
function toggle() {
show.value = !show.value
if (show.value) {
emits('open', true)
} else {
emits('close', false)
}
}
return `${year}-${month}-${day} ${hour}:${min}:${sen}`;
}
function close() {
show.value = false
emits('close', false)
}
function confirm(e) {
const start = returnDateString(value.value);
const end = returnDateString(value1.value);
console.log(start);
console.log(end);
//如果结尾时间小于开始时间
if (new Date(start).getTime() > new Date(end).getTime()) {
return uni.showToast({
title: "结束时间不能小于开始时间",
icon: "none",
});
}
console.log(start);
console.log(end);
emits("confirm", {
text: `${start}——${end}`,
start,
end,
});
close();
}
function open() {
show.value = true
emits('open', true)
}
function returnMonthStart(arr) {
return new Date(years[arr[0]], months[arr[1]] - 1, 1).getDate();
}
function returnDateString(arr) {
const year = years[arr[0]]
const month = arr[1] + 1
const day = arr[2] + 1
const hour = ('0' + arr[3]).slice(-2)
const min = ('0' + arr[4]).slice(-2)
const sen = ('0' + arr[5]).slice(-2)
return `${year}-${month}-${day} ${hour}:${min}:${sen}`
}
function returnMonthEnd(arr) {
return new Date(years[arr[0]], months[arr[1]], 0).getDate();
}
function changeDays(isDays1, arr) {
const end = returnMonthEnd(arr);
if (end) {
if (isDays1) {
days1.value = new Array(end).fill(1).map((v, index) => {
return index + 1;
});
} else {
days.value = new Array(end).fill(1).map((v, index) => {
return index + 1;
});
}
}
}
function confirm(e) {
const start = returnDateString(value.value)
const end = returnDateString(value1.value)
console.log(start);
console.log(end);
emits('confirm', {
text: `${start}——${end}`,
start,
end
})
close()
}
function bindChange(e) {
value.value = e.detail.value;
changeDays(false, e.detail.value);
}
function returnMonthStart(arr) {
return new Date(years[arr[0]], months[arr[1]] - 1, 1).getDate();
}
function bindChange1(e) {
value1.value = e.detail.value;
changeDays(true, e.detail.value);
}
function returnMonthEnd(arr) {
return new Date(years[arr[0]], months[arr[1]], 0).getDate();
}
function changeDays(isDays1,arr){
const end = returnMonthEnd(arr)
if (end) {
if(isDays1){
days1.value= new Array(end).fill(1).map((v,
index) => {
return index + 1
})
}else{
days.value= new Array(end).fill(1).map((v,
index) => {
return index + 1
})
}
}
}
function getDayDate(date = new Date(), type) {
const now = date;
if (type === "start") {
const startOfDay = new Date(
now.getFullYear(),
now.getMonth(),
now.getDate()
);
return startOfDay;
}
if (type === "end") {
const endOfDay = new Date(
now.getFullYear(),
now.getMonth(),
now.getDate(),
23,
59,
59,
999
);
return endOfDay;
}
}
function bindChange(e) {
value.value = e.detail.value
changeDays(false, e.detail.value)
}
function getMonthArea(date = new Date(), type) {
let now = date;
let currentMonthStart = new Date(now.getFullYear(), now.getMonth(), 1);
let currentMonthEnd = new Date(
now.getFullYear(),
now.getMonth() + 1,
0,
23,
59,
59,
999
);
if (type === "start") {
return currentMonthStart;
}
if (type === "end") {
return currentMonthEnd;
}
return {
start: currentMonthStart,
end: currentMonthEnd,
};
}
function bindChange1(e) {
value1.value = e.detail.value
changeDays(true, e.detail.value)
}
function nullFunction() {}
function getDayDate(date = new Date(), type) {
const now = date
if (type === 'start') {
const startOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate());
return startOfDay
}
if (type === 'end') {
const endOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
return endOfDay;
}
}
function pickend(e) {
console.log(e);
}
function getMonthArea(date = new Date(), type) {
let now = date
let currentMonthStart = new Date(now.getFullYear(), now.getMonth(), 1);
let currentMonthEnd = new Date(now.getFullYear(), now.getMonth() + 1, 0, 23, 59, 59, 999);
if (type === 'start') {
return currentMonthStart
}
if (type === 'end') {
return currentMonthEnd;
}
return {
start: currentMonthStart,
end: currentMonthEnd
};
}
function nullFunction() {
}
function pickend(e) {
console.log(e);
}
function pickend1(e) {
console.log(e);
}
defineExpose({
close,
open,
confirm,
toggle
})
function pickend1(e) {
console.log(e);
}
defineExpose({
close,
open,
confirm,
toggle,
});
</script>
<style lang="scss">
.fastTime {
.item {
background-color: rgb(247, 247, 247);
padding: 6rpx 40rpx;
border-radius: 6rpx;
font-size: 32rpx;
}
}
.fastTime {
.item {
background-color: rgb(247, 247, 247);
padding: 6rpx 40rpx;
border-radius: 6rpx;
font-size: 32rpx;
}
}
.top {
border-bottom: 1px solid #eee;
}
.top {
border-bottom: 1px solid #eee;
}
.close {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 30rpx;
}
.close {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 30rpx;
}
.mask {
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
background-color: rgba(0, 0, 0, .7);
z-index: 100;
.box {
position: absolute;
background-color: #fff;
bottom: 0;
left: 0;
right: 0;
border-radius: 16rpx 16rpx 0 0;
}
}
.mask {
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
background-color: rgba(0, 0, 0, 0.7);
z-index: 100;
.box {
position: absolute;
background-color: #fff;
bottom: 0;
left: 0;
right: 0;
border-radius: 16rpx 16rpx 0 0;
}
}
.fixed_b {
position: absolute;
left: 0;
right: 0;
bottom: 0;
padding: 30rpx;
z-index: 100;
background-color: #fff;
}
.fixed_b {
position: absolute;
left: 0;
right: 0;
bottom: 0;
padding: 30rpx;
z-index: 100;
background-color: #fff;
}
.picker-view {
width: 750rpx;
height: 300rpx;
}
.picker-view {
width: 750rpx;
height: 300rpx;
}
.item {
line-height: 34px;
text-align: center;
}
</style>
.item {
line-height: 34px;
text-align: center;
}
</style>

View File

@@ -1,59 +1,82 @@
<template>
<view class="statistics">
<view class="title">
<text>数据统计</text>
</view>
<view class="statisticsBox">
<view class="time-wrapper u-m-l-10 u-m-r-10">
<view v-for="(v, i) in timeList" :key="i" class="timelistbox">
<view class="time-item" @tap="changeTime(v.value,i)" :class="{ 'time-selected':v.value==selected }">
{{v.label}}
</view>
<!-- <view class="xian" v-if="v.value==selected "> </view> -->
</view>
</view>
<view class="time_bootom_line">
<view class="block" :style="{
transform:'translateX('+comBlockX+'rpx) rotate(45deg) '
}"></view>
</view>
<view class="bottom"></view>
<div class="u-flex u-row-between u-font-28 color-333 ">
<div class=" u-flex-1 ">
<view class="statistics">
<view class="title">
<text>数据统计</text>
</view>
<view class="statisticsBox">
<view class="time-wrapper u-m-l-10 u-m-r-10">
<view v-for="(v, i) in timeList" :key="i" class="timelistbox">
<view
class="time-item"
@tap="changeTime(v.value, i)"
:class="[v.value == selected ? 'time-selected' : '']"
>
{{ v.label }}
</view>
<!-- <view class="xian" v-if="v.value==selected "> </view> -->
</view>
</view>
<view class="time_bootom_line">
<view
class="block"
:style="{
transform: 'translateX(' + comBlockX + 'rpx) rotate(45deg) ',
}"
></view>
</view>
<view class="bottom"></view>
<div class="u-flex u-row-between u-font-28 color-333">
<div class="u-flex-1">
<view class="u-m-t-32">
<view class="">营业额</view>
<view class="u-m-t-16">
<up-text
bold
color="#318AFE"
size="20"
mode="price"
:text="yingyeE"
></up-text>
</view>
</view>
<view class="u-m-t-20">
<view class="">退款</view>
<view class="u-m-t-14">
<up-text
color="#333"
size="14"
bold
mode="price"
:text="refundAmount"
></up-text>
</view>
</view>
</div>
<view class="line"></view>
<view class="payList u-flex-1 u-p-l-40">
<view
class="li w-full u-flex u-row-between u-font-24 color-333"
v-for="(item, index) in list"
:key="index"
>
<view class="u-flex">
<view
:style="returnColorStyle(item, index)"
class="circle"
></view>
<view class="u-m-l-8">
{{ item.payType }}
</view>
</view>
<view class="u-m-t-32">
<view class="">营业额</view>
<view class="u-m-t-16">
<up-text bold color="#318AFE" size="20" mode="price" :text="yingyeE"></up-text>
</view>
</view>
<view class="u-m-t-20">
<view class="">退款</view>
<view class="u-m-t-14">
<up-text color="#333" size="14" bold mode="price" :text="refundCount"></up-text>
</view>
</view>
</div>
<view class="line"></view>
<view class="payList u-flex-1 u-p-l-40">
<view class="li w-full u-flex u-row-between u-font-24 color-333" v-for="(item,index) in list"
:key="index">
<view class="u-flex">
<view :style="returnColorStyle(item,index)" class="circle"></view>
<view class="u-m-l-8">
{{item.payType}}
</view>
</view>
<view style="text-align: center" class="u-m-t-6">
{{ item.payAmount }}
</view>
</view>
</view>
</div>
<view style="text-align: center;" class="u-m-t-6">
{{item.payAmount}}
</view>
</view>
</view>
</div>
<!-- <view class="u-m-t-8 u-flex u-row-center u-font-24 u-col-center color-666">
<!-- <view class="u-m-t-8 u-flex u-row-center u-font-24 u-col-center color-666">
<view class="u-flex" @click="toggleShowAll">
<view>{{!showAll?'展开全部':'收起全部' }}</view>
<view class="u-flex u-col-center u-m-t-4 tranistion-2" :class="{rotate:showAll}">
@@ -61,355 +84,316 @@
</view>
</view>
</view> -->
</view>
</view>
<datePickerview @confirm="datePickerConfirm" ref="datePicker" style="z-index: 999;"></datePickerview>
</view>
</view>
<datePickerview
@confirm="datePickerConfirm"
ref="datePicker"
style="z-index: 999"
></datePickerview>
</template>
<script setup>
import {
ref,
reactive,
computed
} from 'vue';
import {
onShow
} from '@dcloudio/uni-app';
import { ref, reactive, computed } from "vue";
import { onShow } from "@dcloudio/uni-app";
import { timeList } from "@/data/index.js";
import dayjs from "dayjs"; //时间格式库
import datePickerview from "./my-date-pickerview.vue";
import dayjs from 'dayjs' //时间格式库
import datePickerview from './my-date-pickerview.vue'
import { getTrade } from "@/http/api/summary.js";
import {
getTrade
} from '@/http/api/summary.js'
let selected = ref("today");
let showAll = ref(false);
let list = ref();
const pageData = reactive({
list: [
{
payType: "微信小程序",
key: "wechatPayAmount",
payAmount: 0,
bgcolor: "#5AA25F",
},
{
payType: "支付宝小程序",
key: "aliPayAmount",
payAmount: 0,
bgcolor: "#31ACFE",
},
{
payType: "主扫收款",
key: "backScanPayAmount",
payAmount: 0,
bgcolor: "#FF5C6D",
},
{
payType: "现金",
key: "cashPayAmount",
payAmount: 0,
bgcolor: "#FC843F",
},
{
payType: "充值",
key: "rechargeAmount",
payAmount: 0,
bgcolor: "#9090FF",
},
{
payType: "挂账",
key: "creditPayAmount",
payAmount: 0,
bgcolor: "#7BA7A4",
},
// {payType: '收款码收款', key:'', payAmount: 0,bgcolor:'#5AA25F'},
],
});
let selected = ref('today')
let showAll = ref(false);
let list = ref()
const pageData = reactive({
list: [{
payType: '微信小程序',
key: 'wechatPayAmount',
payAmount: 0,
bgcolor: '#5AA25F'
},
{
payType: '支付宝小程序',
key: 'aliPayAmount',
payAmount: 0,
bgcolor: '#31ACFE'
},
{
payType: '主扫收款',
key: 'scanPayAmount',
payAmount: 0,
bgcolor: '#FF5C6D'
},
{
payType: '现金',
key: 'cashPayAmount',
payAmount: 0,
bgcolor: '#FC843F'
},
{
payType: '充值',
key: 'rechargeAmount',
payAmount: 0,
bgcolor: '#9090FF'
},
{
payType: '挂账',
key: 'creditPayAmount',
payAmount: 0,
bgcolor: '#7BA7A4'
},
// {payType: '收款码收款', key:'', payAmount: 0,bgcolor:'#5AA25F'},
],
})
function returnColorStyle(item) {
return {
backgroundColor: item.bgcolor,
};
}
function returnColorStyle(item) {
return {
backgroundColor: item.bgcolor
}
}
function toggleShowAll() {
showAll.value = !showAll.value;
setList();
}
function toggleShowAll() {
showAll.value = !showAll.value
setList()
}
function setList() {
// list.value = showAll.value ? pageData.list : pageData.list.slice(0, 4)
list.value = pageData.list;
}
function setList() {
// list.value = showAll.value ? pageData.list : pageData.list.slice(0, 4)
list.value = pageData.list
}
const emit = defineEmits(["totalRevenue"]);
const timeSleIndex = ref(0);
const emit = defineEmits(['totalRevenue'])
const timeList = [{
label: '今天',
value: 'today'
},
{
label: '昨天',
value: 'yesterday'
},
{
label: '本周',
value: 'circumference'
}, {
label: '本月',
value: 'moon'
},
{
label: '自定义',
value: 'custom'
}
]
const datePicker = ref()
onShow((options) => {
let iToken = uni.getStorageSync('iToken').tokenValue
if (iToken) {
getlist()
} else {
uni.redirectTo({
url: '/pages/login/index'
})
}
});
const datePicker = ref();
onShow((options) => {
let iToken = uni.getStorageSync("iToken").tokenValue;
if (iToken) {
getlist();
} else {
uni.redirectTo({
url: "/pages/login/index",
});
}
});
const yingyeE = ref(0)
const refundCount = ref(0)
/**
* 获取统计数据
* @param {Object} start
* @param {Object} end
*/
function getlist(start, end) {
let startTime, endTime;
if (selected.value == 'today') {
startTime = dayjs().format('YYYY-MM-DD') + ' 00:00:00'
endTime = dayjs().format('YYYY-MM-DD') + ' 23:59:59'
} else if (selected.value == 'yesterday') {
startTime = formatTime() + ' 00:00:00'
endTime = formatTime() + ' 23:59:59'
} else if (selected.value == 'circumference') {
var now = new Date();
var nowTime = now.getTime();
var day = now.getDay();
var oneDayTime = 24 * 60 * 60 * 1000;
//显示周一
var MondayTime = nowTime - (day - 1) * oneDayTime;
//显示周日
var SundayTime = nowTime + (7 - day) * oneDayTime;
startTime = dayjs(MondayTime).format('YYYY-MM-DD 00:00:00')
endTime = dayjs(SundayTime).format('YYYY-MM-DD 23:59:59')
} else if (selected.value == 'moon') {
startTime = dayjs().startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
endTime = dayjs().endOf('month').format('YYYY-MM-DD') + ' 23:59:59'
} else if (selected.value == 'custom') {
let s = start.substring(0, start.indexOf(' '))
let e = end.substring(0, end.indexOf(' '))
startTime = s + ' 00:00:00'
endTime = e + ' 23:59:59'
}
getTrade({
beginDate: startTime,
endDate: endTime,
}).then((res) => {
refundCount.value = res.refundCount
for (var key in res) {
pageData.list.map(item => {
if (item.key == key) {
item.payAmount = res[key]
}
})
}
setList()
let incomeAmountAll = 0;
pageData.list.map(item => {
incomeAmountAll += (item.payAmount || 0)
})
const yingyeE = ref(0);
const refundAmount = ref(0);
/**
* 获取统计数据
* @param {Object} start
* @param {Object} end
*/
function getlist(start, end) {
let beginDate, endDate;
const rangeType = timeList[timeSleIndex.value].value;
if(rangeType == "custom"){
beginDate = start.split(" ")[0];
endDate = end.split(" ")[0];
}else{
beginDate = timeList[timeSleIndex.value].beginDate;
endDate = timeList[timeSleIndex.value].endDate;
}
getTrade({
beginDate: beginDate,
endDate: endDate,
shopId: uni.getStorageSync("shopId"),
rangeType: rangeType,
}).then((res) => {
refundAmount.value = res.refundAmount;
for (var key in res) {
pageData.list.map((item) => {
if (item.key == key) {
item.payAmount = res[key];
}
});
}
setList();
let incomeAmountAll = 0;
pageData.list.map((item) => {
incomeAmountAll += item.payAmount || 0;
});
yingyeE.value = incomeAmountAll
emit('totalRevenue', incomeAmountAll)
})
}
yingyeE.value = incomeAmountAll;
emit("totalRevenue", incomeAmountAll);
});
}
/**
* 日期筛选确认
* @param {Object} e
*/
function datePickerConfirm(e) {
getlist(e.start, e.end);
}
/**
* 日期筛选确认
* @param {Object} e
*/
function datePickerConfirm(e) {
getlist(e.start, e.end)
}
// 获取当前时间
function getdate() {
const dt = new Date();
const y = dt.getFullYear();
const m = (dt.getMonth() + 1 + "").padStart(2, "0");
const d = (dt.getDate() + "").padStart(2, "0");
const hh = (dt.getHours() + "").padStart(2, "0");
const mm = (dt.getMinutes() + "").padStart(2, "0");
const ss = (dt.getSeconds() + "").padStart(2, "0");
return `${y}-${m}-${d}`;
}
// 获取当前时间
function getdate() {
const dt = new Date();
const y = dt.getFullYear();
const m = (dt.getMonth() + 1 + "").padStart(2, "0");
const d = (dt.getDate() + "").padStart(2, "0");
const hh = (dt.getHours() + "").padStart(2, "0");
const mm = (dt.getMinutes() + "").padStart(2, "0");
const ss = (dt.getSeconds() + "").padStart(2, "0");
return `${y}-${m}-${d}`;
}
// 获取昨天时间
const formatTime = () => {
let strDate = getdate();
let dateFormat = new Date(strDate);
dateFormat = dateFormat.setDate(dateFormat.getDate() - 1);
dateFormat = new Date(dateFormat);
let y = dateFormat.getFullYear();
let m = (dateFormat.getMonth() + 1).toString().padStart(2, "0");
let d = dateFormat.getDate().toString().padStart(2, "0");
return `${y}-${m}-${d}`;
};
// 获取昨天时间
const formatTime = () => {
let strDate = getdate()
let dateFormat = new Date(strDate);
dateFormat = dateFormat.setDate(dateFormat.getDate() - 1);
dateFormat = new Date(dateFormat);
let y = dateFormat.getFullYear()
let m = (dateFormat.getMonth() + 1).toString().padStart(2, '0')
let d = dateFormat.getDate().toString().padStart(2, '0')
return `${y}-${m}-${d}`
}
function changeTime(e, index) {
selected.value = e;
timeSleIndex.value = index;
if (e == "custom") {
datePicker.value.toggle();
} else {
getlist();
}
}
const timeSleIndex = ref(0)
function changeTime(e, index) {
selected.value = e
timeSleIndex.value = index
if (e == 'custom') {
datePicker.value.toggle()
} else {
getlist()
}
}
const xArr=[0,134,262,390,532]
const comBlockX = computed(() => {
return xArr[ timeSleIndex.value]
})
const xArr = [0, 134, 262, 390, 532];
const comBlockX = computed(() => {
return xArr[timeSleIndex.value];
});
</script>
<style scoped lang="less">
ul,
li {
list-style: none;
padding: 0;
}
ul,
li {
list-style: none;
padding: 0;
}
.rotate {
transform: rotate(180deg);
}
.rotate {
transform: rotate(180deg);
}
.statistics {
padding: 0 28rpx;
margin-top: 50rpx;
position: relative;
.statistics {
padding: 0 28rpx;
margin-top: 50rpx;
position: relative;
.title {
position: absolute;
width: 170rpx;
left: 18rpx;
height: 50rpx;
line-height: 50rpx;
font-weight: 700;
font-size: 26rpx;
color: #fff;
text-align: center;
background: linear-gradient(109deg, #70B9FF 0%, #629FFA 100%);
border-radius: 12rpx 12rpx 12rpx 0rpx;
top: -16px;
}
.title {
position: absolute;
width: 170rpx;
left: 18rpx;
height: 50rpx;
line-height: 50rpx;
font-weight: 700;
font-size: 26rpx;
color: #fff;
text-align: center;
background: linear-gradient(109deg, #70b9ff 0%, #629ffa 100%);
border-radius: 12rpx 12rpx 12rpx 0rpx;
top: -16px;
}
.statisticsBox {
width: 694rpx;
background: #FFFFFF;
border-radius: 16rpx 16rpx 16rpx 16rpx;
padding: 48rpx 32rpx 32rpx;
box-sizing: border-box;
margin-top: 54rpx;
.statisticsBox {
width: 694rpx;
background: #ffffff;
border-radius: 16rpx 16rpx 16rpx 16rpx;
padding: 48rpx 32rpx 32rpx;
box-sizing: border-box;
margin-top: 54rpx;
.bottom {}
.bottom {
}
.time-wrapper {
display: flex;
justify-content: space-between;
.time-wrapper {
display: flex;
justify-content: space-between;
.timelistbox {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
.timelistbox {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
.time-item {
font-size: 28rpx;
text-align: center;
padding-bottom: 10rpx;
}
.time-item {
font-size: 28rpx;
text-align: center;
padding-bottom: 10rpx;
}
.xian {
width: 40rpx;
height: 3rpx;
background-color: #318AFE;
// position: absolute;
// left: 16rpx;
// bottom: 0;
}
}
.xian {
width: 40rpx;
height: 3rpx;
background-color: #318afe;
// position: absolute;
// left: 16rpx;
// bottom: 0;
}
}
.time-selected {
color: #318afe;
font-size: 32rpx !important;
font-weight: bold;
}
}
.time-selected {
color: #318afe;
font-size: 32rpx !important;
font-weight: bold;
}
}
.line {
width: 0rpx;
height: 170rpx;
border: 2rpx solid #EEE8E8;
}
.line {
width: 0rpx;
height: 170rpx;
border: 2rpx solid #eee8e8;
}
.payList {
display: flex;
flex-direction: column;
align-items: center;
flex-wrap: wrap;
.payList {
display: flex;
flex-direction: column;
align-items: center;
flex-wrap: wrap;
.li {
display: flex;
justify-content: space-between;
align-items: center;
white-space: nowrap;
margin-top: 12rpx;
.li {
display: flex;
justify-content: space-between;
align-items: center;
white-space: nowrap;
margin-top: 12rpx;
>view {
text-align: center;
}
}
}
}
}
> view {
text-align: center;
}
}
}
}
}
.circle {
width: 8rpx;
height: 8rpx;
border-radius: 8rpx;
}
.circle {
width: 8rpx;
height: 8rpx;
border-radius: 8rpx;
}
.time_bootom_line {
height: 16rpx;
position: relative;
border-bottom: 1px solid #629FFA;
.time_bootom_line {
height: 16rpx;
position: relative;
border-bottom: 1px solid #629ffa;
.block {
width: 18rpx;
height: 18rpx;
box-sizing: border-box;
background: #fff;
position: absolute;
border-top: 0.5rpx solid #629FFA;
border-left: 0.5rpx solid #629FFA;
left: 30rpx;
top: 6rpx;
transform: rotate(45deg);
transform-origin: center;
transition: all .2s linear;
}
}
</style>
.block {
width: 18rpx;
height: 18rpx;
box-sizing: border-box;
background: #fff;
position: absolute;
border-top: 0.5rpx solid #629ffa;
border-left: 0.5rpx solid #629ffa;
left: 30rpx;
top: 6rpx;
transform: rotate(45deg);
transform-origin: center;
transition: all 0.2s linear;
}
}
</style>

View File

@@ -273,9 +273,11 @@
*/
async function loginFinishFunc(loginBizData) {
// 保存 token
console.log('loginBizData',loginBizData)
storageManage.setLogin(loginBizData)
storageManage.token(loginBizData.tokenInfo)
uni.setStorageSync("promission",loginBizData.promissionList)
uni.setStorageSync("shopId",loginBizData.shopInfo.id)
// var time1 = new Date();
// var time2 = new Date(loginBizData.expireDate);

View File

@@ -241,7 +241,7 @@
}
.u-tab-view {
width: 200rpx;
width: 240rpx;
height: 100%;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff