This commit is contained in:
weiwei committed 2025-08-13 20:41:50 +08:00
1 parent 8351f9e72d
commit 0c03c7715a
2 files changed
+10 -10

No files matched your search

+1 -1
View File
@@ -135,7 +135,7 @@ const cfu = {
},
// 食堂喜好分析饼图提示格式化
canteenPieTooltip: function (item, category, index, opts) {
return `分类:${item.classifyName}/br/购买总人数:${item.payUserCount}/br/购买总金额:${
return `分类:${item.classifyName || ""}/br/购买总人数:${item.payUserCount}/br/购买总金额:${
Number(item.totalPrice) / 100.0
}元/br/购买总次数:${item.timeCount}`
},
+9 -9
View File
@@ -17,8 +17,8 @@
<tm-sheet :margin="[0, 20]">
<view class="prefix_title mb-15rpx">个人菜品喜好排行</view>
<view v-if="productLikeTopList.length > 0" class="bg-white rounded-16rpx overflow-hidden shadow-sm">
<view class="bg-gradient-to-r from-blue-50 to-blue-100 px-20rpx py-16rpx flex items-center border-b border-gray-100">
<view v-if="productLikeTopList.length > 0" class="rounded-16rpx bg-white overflow-hidden card">
<view class="bg-gradient-to-r from-blue-100 to-blue-100 px-20rpx py-16rpx flex items-center border-b border-gray-100">
<view class="w-80rpx text-center text-24rpx font-bold text-gray-600">排名</view>
<view class="flex-1 px-16rpx text-24rpx font-bold text-gray-600">菜品名称</view>
<view class="w-120rpx text-center text-24rpx font-bold text-gray-600">分类</view>
@@ -38,7 +38,7 @@
<view class="w-80rpx flex justify-center items-center">
<view
v-if="index < 3"
class="w-40rpx h-40rpx rounded-full flex items-center justify-center text-20rpx font-bold text-white"
class="w-40rpx h-40rpx rounded-1 flex items-center justify-center text-20rpx font-bold text-white"
:class="{
'bg-gradient-to-r from-yellow-400 to-yellow-500': index === 0,
'bg-gradient-to-r from-gray-400 to-gray-500': index === 1,
@@ -59,7 +59,7 @@
</view>
<view class="w-100rpx text-center">
<view class="inline-block px-12rpx py-6rpx bg-blue-100 text-blue-600 text-22rpx font-medium rounded-full">
<view class="inline-block px-12rpx py-6rpx bg-blue-100 text-blue-600 text-22rpx font-medium rounded-1">
{{ item.payCount }}次
</view>
</view>
@@ -96,7 +96,7 @@ const pieChartOpts = {
margin: 2,
fontSize: 14,
lineHeight: 14,
itemGap: 10,
itemGap: 4,
},
extra: {
pie: {
@@ -170,10 +170,10 @@ const getPieChartData = async () => {
if (code != 0) return uni.showToast({ title: msg || "数据获取失败", icon: "none" })
const seriesData = data.map((item: any, index: number) => {
return {
index: index,
name: item.classifyName,
value: Number(item.payUserCount),
labelText: `${item.classifyName} ${item.payUserCount}次`,
index,
name: item.classifyName || "",
value: Number(item.payCount),
labelText: `${item.classifyName || ""} ${item.payUserCount}次`,
...item,
}
})