【类 型】:feat

【原  因】:徽标组件  用于标识选项内列表记录总数
【过  程】:
【影  响】:

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
sszdot 2024-12-20 17:06:09 +08:00
parent 0f1b65a384
commit 65d8ebad40
4 changed files with 62 additions and 10 deletions

View File

@ -55,6 +55,10 @@
float: right;
}
.pr{
position: relative;
}
.fc {
text-align: center;
}

View File

@ -0,0 +1,38 @@
<template>
<view v-if="cou!==0" class="badge bg-m fci flex mac mc rad-c" :style="{ right: offset[0] + 'rpx', top: offset[1] + 'rpx' }">
{{cou>99?99:cou}}
</view>
</template>
<script>
export default {
name: "badge",
data() {
return {};
},
computed: {
},
props: {
offset: {
type: Array,
default () {
return [-16, -10] // [-16, -10]
}
},
cou: {
type: Number,
require: true
}
}
}
</script>
<style lang="scss" scoped>
.badge {
position: absolute;
width: 24rpx;
height: 24rpx;
font-size: 14rpx;
font-weight: normal;
}
</style>

View File

@ -23,7 +23,9 @@
<view class="numberBut bg-m fci rad8 fz28 fb flex mac mc" :key="foodSn">
{{ foodSn }}
</view>
<view class="nullBut border fcb rad8 fz28 flex mac mc m-l-24">申请售后</view>
<view class="nullBut border fcb rad8 fz28 flex mac mc m-l-24" style="">
申请售后
</view>
</view>
</view>
</template>

View File

@ -7,12 +7,15 @@
</view>
</u-navbar>
<!-- tab -->
<view class="tabListBox m-l-24 m-r-24 m-t-24 flex msb">
<view class="tabListBox m-l-24 m-r-24 m-t-24 flex msb pr">
<view class="tabBox flex mac mc fz32" v-for="(tab,index) in tabList" :key="index" @click="handlerTab(index)"
:class="current===index?'fb':''">
<view class="pr">
<badge :cou="orderCouArr[index]"></badge>
{{tab}}
</view>
</view>
</view>
<!-- tabLine -->
<view class="tabLineBox flex mac mc z-top" :style="{ left: tabLineLeft + 'rpx' }">
<view class="tabLine rad8 bg-m"></view>
@ -70,11 +73,16 @@
},
// 退
orderList_paid() {
return this.$store.state.orderList.filter(item => item.main_status === '已付款' && item.refund_status === '未申请')
return this.$store.state.orderList.filter(item => item.main_status === '已付款' && item.refund_status ===
'未申请')
},
//退
// 退 退
orderList_refund() {
return this.$store.state.orderList.filter(item => item.refund_status !== '未申请')
},
// [,退, 退 退]
orderCouArr() {
return [this.orderList_unpaid.length, this.orderList_paid.length, this.orderList_refund.length]
}
},
methods: {