diff --git a/pages/index/components/statistics.vue b/pages/index/components/statistics.vue index fefcd0e..b5f9076 100644 --- a/pages/index/components/statistics.vue +++ b/pages/index/components/statistics.vue @@ -10,16 +10,25 @@ - + + + + + + {{!showAll?'展开全部':'收起全部' }} + + + + + @@ -39,6 +48,15 @@ onShow } from '@dcloudio/uni-app'; let selected = ref('today') + let showAll = ref(false); + let $list=[] + function toggleShowAll() { + showAll.value = !showAll.value + setList() + } + function setList(){ + list.value=showAll.value?$list:$list.slice(0,4) + } let list = ref() const emit = defineEmits(['totalRevenue']) const timeList = [{ @@ -63,15 +81,15 @@ ] const currentInstance = getCurrentInstance() onShow((options) => { - let iToken = uni.getStorageSync('iToken') - console.log(iToken,'调试123') - if(iToken){ + let iToken = uni.getStorageSync('iToken') + if (iToken) { getlist() - }else{ - uni.redirectTo({url: '/pages/login/index'}) + } else { + uni.redirectTo({ + url: '/pages/login/index' + }) } }); - function getlist(start, end) { let startTime, endTime; if (selected.value == 'today') { @@ -103,7 +121,8 @@ startTime, endTime, }).then((res) => { - list.value = res.sale.payCount.slice(0, 4) + $list=res.sale.payCount + setList() emit('totalRevenue', res.sale.incomeAmountAll) }) } @@ -150,22 +169,25 @@ padding: 0; } + .rotate { + transform: rotate(180deg); + } + .statistics { padding: 0 28rpx; .statisticsBox { width: 694rpx; - height: 260rpx; background: #FFFFFF; box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16); border-radius: 16rpx 16rpx 16rpx 16rpx; + padding: 32rpx 22rpx; + box-sizing: border-box; + margin-top: 54rpx; .time-wrapper { display: flex; justify-content: space-around; - padding-bottom: 16rpx; - padding-top: 16rpx; - margin-top: 54rpx; .timelistbox { position: relative; @@ -192,22 +214,24 @@ .time-selected { color: #318afe; font-size: 32rpx !important; + font-weight: bold; } } .payList { display: flex; - justify-content: space-around; align-items: center; flex-wrap: wrap; margin-top: 32rpx; - >li { + .li { font-family: Source Han Sans CN, Source Han Sans CN; font-weight: 400; font-size: 28rpx; color: #666666; - width: 170rpx; + width: 25%; + white-space: nowrap; + margin-bottom: 24rpx; >view { text-align: center; diff --git a/pages/index/index.vue b/pages/index/index.vue index 3d64aab..7aee554 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -4,13 +4,26 @@ - 总收入 - ¥{{totalRevenuedata}} + + + 总收入 + + + + + 总收入为除会员余额 + 支付外所有收入 + + + + ¥{{totalRevenuedata}} + {{shopName}} @@ -22,7 +35,6 @@