【类 型】:feat
【原 因】:徽标组件 用于标识选项内列表记录总数 【过 程】: 【影 响】: # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
0f1b65a384
commit
65d8ebad40
4
App.vue
4
App.vue
@ -55,6 +55,10 @@
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pr{
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
.fc {
|
.fc {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
38
components/badge/badge.vue
Normal file
38
components/badge/badge.vue
Normal 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>
|
@ -23,7 +23,9 @@
|
|||||||
<view class="numberBut bg-m fci rad8 fz28 fb flex mac mc" :key="foodSn">
|
<view class="numberBut bg-m fci rad8 fz28 fb flex mac mc" :key="foodSn">
|
||||||
{{ foodSn }}
|
{{ foodSn }}
|
||||||
</view>
|
</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>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -7,12 +7,15 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
<!-- tab -->
|
<!-- 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)"
|
<view class="tabBox flex mac mc fz32" v-for="(tab,index) in tabList" :key="index" @click="handlerTab(index)"
|
||||||
:class="current===index?'fb':''">
|
:class="current===index?'fb':''">
|
||||||
|
<view class="pr">
|
||||||
|
<badge :cou="orderCouArr[index]"></badge>
|
||||||
{{tab}}
|
{{tab}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
<!-- tabLine -->
|
<!-- tabLine -->
|
||||||
<view class="tabLineBox flex mac mc z-top" :style="{ left: tabLineLeft + 'rpx' }">
|
<view class="tabLineBox flex mac mc z-top" :style="{ left: tabLineLeft + 'rpx' }">
|
||||||
<view class="tabLine rad8 bg-m"></view>
|
<view class="tabLine rad8 bg-m"></view>
|
||||||
@ -70,11 +73,16 @@
|
|||||||
},
|
},
|
||||||
//已付款 并且没有申请退款的订单
|
//已付款 并且没有申请退款的订单
|
||||||
orderList_paid() {
|
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() {
|
orderList_refund() {
|
||||||
return this.$store.state.orderList.filter(item => item.refund_status !== '未申请')
|
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: {
|
methods: {
|
||||||
|
Loading…
Reference in New Issue
Block a user