|
|
@ -27,6 +27,9 @@
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<img :src="item.icon" />
|
|
|
|
<img :src="item.icon" />
|
|
|
|
<span>{{ item.label }}</span>
|
|
|
|
<span>{{ item.label }}</span>
|
|
|
|
|
|
|
|
<div v-if="item.count > 0" class="account-home-content__item--count">
|
|
|
|
|
|
|
|
{{ item.count }}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -39,6 +42,10 @@
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { mapState } from "vuex";
|
|
|
|
import { mapState } from "vuex";
|
|
|
|
import { ORDER_STATUS } from "@/constants";
|
|
|
|
import { ORDER_STATUS } from "@/constants";
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
|
|
|
ApiGetOrderStatistics,
|
|
|
|
|
|
|
|
ApiGetRefundStatistisc,
|
|
|
|
|
|
|
|
} from "@/plugins/api/order";
|
|
|
|
import LogisitcsInfo from "./module/LogisitcsInfo.vue";
|
|
|
|
import LogisitcsInfo from "./module/LogisitcsInfo.vue";
|
|
|
|
import Message from "./module/Message.vue";
|
|
|
|
import Message from "./module/Message.vue";
|
|
|
|
|
|
|
|
|
|
|
@ -53,26 +60,35 @@ export default {
|
|
|
|
userInfoBkg: require("~/assets/img/account/home/bkg-user-info.png"),
|
|
|
|
userInfoBkg: require("~/assets/img/account/home/bkg-user-info.png"),
|
|
|
|
orderTypes: [
|
|
|
|
orderTypes: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
key: "unpaidCount",
|
|
|
|
label: "待付款",
|
|
|
|
label: "待付款",
|
|
|
|
icon: getOrderTypeIcon("icon-order1"),
|
|
|
|
icon: getOrderTypeIcon("icon-order1"),
|
|
|
|
path: `/account/order/list?type=${ORDER_STATUS.WAIT_PAY}`,
|
|
|
|
path: `/account/order/list?type=${ORDER_STATUS.WAIT_PAY}`,
|
|
|
|
|
|
|
|
count: 0,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
key: "waitDeliveryCount",
|
|
|
|
label: "待发货",
|
|
|
|
label: "待发货",
|
|
|
|
icon: getOrderTypeIcon("icon-order2"),
|
|
|
|
icon: getOrderTypeIcon("icon-order2"),
|
|
|
|
path: `/account/order/list?type=${ORDER_STATUS.WAIT_SEND}`,
|
|
|
|
path: `/account/order/list?type=${ORDER_STATUS.WAIT_SEND}`,
|
|
|
|
|
|
|
|
count: 0,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
key: "deliveredCount",
|
|
|
|
label: "待收货",
|
|
|
|
label: "待收货",
|
|
|
|
icon: getOrderTypeIcon("icon-order3"),
|
|
|
|
icon: getOrderTypeIcon("icon-order3"),
|
|
|
|
path: `/account/order/list?type=${ORDER_STATUS.WAIT_RECEIVE}`,
|
|
|
|
path: `/account/order/list?type=${ORDER_STATUS.WAIT_RECEIVE}`,
|
|
|
|
|
|
|
|
count: 0,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
key: "progressCount",
|
|
|
|
label: "退款/售后",
|
|
|
|
label: "退款/售后",
|
|
|
|
icon: getOrderTypeIcon("icon-order4"),
|
|
|
|
icon: getOrderTypeIcon("icon-order4"),
|
|
|
|
path: "/account/order/saleAfter",
|
|
|
|
path: "/account/order/saleAfter",
|
|
|
|
|
|
|
|
count: 0,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
key: "",
|
|
|
|
label: "全部订单",
|
|
|
|
label: "全部订单",
|
|
|
|
icon: getOrderTypeIcon("icon-order5"),
|
|
|
|
icon: getOrderTypeIcon("icon-order5"),
|
|
|
|
path: "/account/order/list",
|
|
|
|
path: "/account/order/list",
|
|
|
@ -83,6 +99,24 @@ export default {
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
...mapState(["userInfo"]),
|
|
|
|
...mapState(["userInfo"]),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
created() {
|
|
|
|
|
|
|
|
this.getOrderStatisticsData();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
// 获取订单统计数据
|
|
|
|
|
|
|
|
async getOrderStatisticsData() {
|
|
|
|
|
|
|
|
const [{ result }, { result: resultRefund }] = await Promise.all([
|
|
|
|
|
|
|
|
ApiGetOrderStatistics(),
|
|
|
|
|
|
|
|
ApiGetRefundStatistisc(),
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
const resultData = Object.assign({}, result, resultRefund);
|
|
|
|
|
|
|
|
this.orderTypes.forEach((item) => {
|
|
|
|
|
|
|
|
if (resultData[item.key] > 0) {
|
|
|
|
|
|
|
|
Object.assign(item, { count: resultData[item.key] });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
<style lang="scss" scoped>
|
|
|
@ -122,9 +156,22 @@ export default {
|
|
|
|
border-radius: 4px;
|
|
|
|
border-radius: 4px;
|
|
|
|
box-shadow: 0px 4px 10px 1px rgba(0, 0, 0, 0.1);
|
|
|
|
box-shadow: 0px 4px 10px 1px rgba(0, 0, 0, 0.1);
|
|
|
|
.account-home-content__item {
|
|
|
|
.account-home-content__item {
|
|
|
|
|
|
|
|
position: relative;
|
|
|
|
font-size: 14px;
|
|
|
|
font-size: 14px;
|
|
|
|
color: #333333;
|
|
|
|
color: #333333;
|
|
|
|
text-align: center;
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
.account-home-content__item--count {
|
|
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
|
|
top: -3px;
|
|
|
|
|
|
|
|
right: -3px;
|
|
|
|
|
|
|
|
width: 24px;
|
|
|
|
|
|
|
|
height: 24px;
|
|
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
|
|
background: #ff512b;
|
|
|
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
|
|
|
border-radius: 14px 14px 14px 14px;
|
|
|
|
|
|
|
|
border: 2px solid #ffffff;
|
|
|
|
|
|
|
|
}
|
|
|
|
img {
|
|
|
|
img {
|
|
|
|
width: 54px;
|
|
|
|
width: 54px;
|
|
|
|
height: 54px;
|
|
|
|
height: 54px;
|
|
|
|