文件
xionggeshop/xgsc.gynhc.com_wx/pages/index/components/sh-order-card.vue
2026-09-14 17:24:53 +08:00

156 行
2.8 KiB
Vue

<template>
<view class="sh-order-card brand-card">
<view class="card-head u-flex u-row-between u-col-center" @tap="jump('/pages/order/list', { type: 'all' })">
<text class="card-title">商城订单</text>
<view class="card-more u-flex u-col-center">
<text>全部订单</text>
<text class="u-iconfont uicon-arrow-right"></text>
</view>
</view>
<view class="order-grid u-flex">
<view
class="order-item u-flex-col u-col-center"
v-for="order in orderNav"
:key="order.id"
@tap="jump(order.path, order.query)"
>
<view class="order-icon-box u-flex u-row-center u-col-center">
<text class="u-iconfont" :class="order.icon"></text>
<view class="badge" v-if="order.type && orderNum && orderNum[order.type]">{{ orderNum[order.type] }}</view>
</view>
<text class="order-label">{{ order.title }}</text>
</view>
</view>
</view>
</template>
<script>
import { mapGetters } from 'vuex';
export default {
data() {
return {
orderNav: [{
id: 1,
title: '待付款',
icon: 'uicon-rmb-circle',
type: 'nopay',
path: '/pages/order/list',
query: { type: 'nopay' }
}, {
id: 2,
title: '待发货',
icon: 'uicon-bag',
type: 'nosend',
path: '/pages/order/list',
query: { type: 'nosend' }
}, {
id: 3,
title: '待收货',
icon: 'uicon-car',
type: 'noget',
path: '/pages/order/list',
query: { type: 'noget' }
}, {
id: 4,
title: '待评价',
icon: 'uicon-chat',
type: 'nocomment',
path: '/pages/order/list',
query: { type: 'nocomment' }
}, {
id: 5,
title: '售后',
icon: 'uicon-reload',
type: '',
path: '/pages/order/after-sale/list',
query: {}
}]
};
},
computed: {
...mapGetters(['userOtherData']),
orderNum() {
return this.userOtherData.order_num || 0;
}
},
methods: {
jump(path, query) {
this.$Router.push({ path, query });
}
}
};
</script>
<style lang="scss">
.sh-order-card {
padding: 24rpx 24rpx 28rpx;
}
.card-head {
margin-bottom: 20rpx;
}
.card-title {
font-size: 28rpx;
font-weight: 600;
color: $brand-text;
}
.card-more {
font-size: 24rpx;
color: $brand-text-muted;
.uicon-arrow-right {
font-size: 22rpx;
margin-left: 4rpx;
}
}
.order-grid {
width: 100%;
}
.order-item {
flex: 1;
min-width: 0;
}
.order-icon-box {
position: relative;
width: 88rpx;
height: 88rpx;
border-radius: 50%;
background: $brand-primary-light;
margin-bottom: 12rpx;
.u-iconfont {
font-size: 40rpx;
color: $brand-primary;
}
}
.order-label {
font-size: 22rpx;
color: $brand-text-muted;
line-height: 1.3;
text-align: center;
}
.badge {
position: absolute;
top: -6rpx;
right: -6rpx;
min-width: 32rpx;
height: 32rpx;
padding: 0 8rpx;
border-radius: 100rpx;
background: $brand-price;
color: #fff;
font-size: 20rpx;
line-height: 32rpx;
text-align: center;
z-index: 2;
}
</style>