mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-11-09 02:18:55 +08:00
refactor(buyer): 优化组件结构并提升用户体验
- Main.vue 路由逻辑改为使用当前路由信息 - 简化 Header.vue 中的购物车展示,优化布局与可访问性 - GoodsClassNav.vue 改为按条件渲染分类信息 - 完善 MyOrder.vue 的订单展示与交互,优化样式与结构 - 调整 message.js,更稳妥地处理 Promise 拒绝 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -65,9 +65,9 @@ export default {
|
|||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/login',
|
path: '/login',
|
||||||
query: {
|
query: {
|
||||||
rePath: this.$router.history.current.path,
|
rePath: this.$route.path,
|
||||||
query: JSON.stringify(this.$router.history.current.query)
|
query: JSON.stringify(this.$route.query || {}),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
购物车({{ cartNum < 100 ? cartNum : '99' }})
|
购物车({{ cartNum < 100 ? cartNum : '99' }})
|
||||||
</span>
|
</span>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<div class="shopping-cart-null" style="width:200px" v-show="shoppingCart.length <= 0">
|
<div class="shopping-cart-null" v-show="shoppingCart.length <= 0">
|
||||||
<el-icon class="cart-null-icon"><ShoppingCart /></el-icon>
|
<el-icon class="cart-null-icon"><ShoppingCart /></el-icon>
|
||||||
<span>你的购物车没有宝贝哦</span>
|
<span>你的购物车没有宝贝哦</span>
|
||||||
<span>赶快去添加商品吧~</span>
|
<span>赶快去添加商品吧~</span>
|
||||||
@@ -60,20 +60,13 @@
|
|||||||
<div class="shopping-cart-list" v-show="shoppingCart.length > 0">
|
<div class="shopping-cart-list" v-show="shoppingCart.length > 0">
|
||||||
<div class="shopping-cart-box" v-for="(item, index) in shoppingCart" @click="goToPay" :key="index">
|
<div class="shopping-cart-box" v-for="(item, index) in shoppingCart" @click="goToPay" :key="index">
|
||||||
<div class="shopping-cart-img">
|
<div class="shopping-cart-img">
|
||||||
<img :src="item.goodsSku.thumbnail" class="hover-pointer"/>
|
<img :src="item.goodsSku.thumbnail" alt="" />
|
||||||
</div>
|
</div>
|
||||||
<div class="shopping-cart-info">
|
<div class="shopping-cart-info">
|
||||||
<div class="shopping-cart-title ">
|
<p class="goods-title">{{ item.goodsSku.goodsName }}</p>
|
||||||
<p class="hover-pointer goods-title ellipsis">{{ item.goodsSku.goodsName }}</p>
|
|
||||||
</div>
|
|
||||||
<div class="shopping-cart-detail">
|
<div class="shopping-cart-detail">
|
||||||
<div>
|
<span>数量 {{ item.num }}</span>
|
||||||
数量:
|
<span class="shopping-price">{{ $filters.unitPrice(item.purchasePrice, '¥') }}</span>
|
||||||
<span class="shopping-cart-text">{{ item.num }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="shopping-price">
|
|
||||||
{{ $filters.unitPrice(item.purchasePrice, '¥') }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -178,9 +171,9 @@ export default {
|
|||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/login',
|
path: '/login',
|
||||||
query: {
|
query: {
|
||||||
rePath: this.$router.history.current.path,
|
rePath: this.$route.path,
|
||||||
query: JSON.stringify(this.$router.history.current.query)
|
query: JSON.stringify(this.$route.query || {}),
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -346,30 +339,10 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.shopping-cart-img {
|
|
||||||
margin-right: 15px;
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.shopping-cart-img img {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.shopping-cart-info {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-content: space-between;
|
|
||||||
width: 200px;
|
|
||||||
overflow: hidden;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.shopping-cart-null {
|
.shopping-cart-null {
|
||||||
padding: 15px;
|
width: 320px;
|
||||||
|
padding: 28px 16px;
|
||||||
|
box-sizing: border-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -377,13 +350,92 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.cart-null-icon {
|
.cart-null-icon {
|
||||||
font-size: 38px;
|
font-size: 36px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 12px;
|
||||||
|
color: #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.shopping-cart-null span {
|
.shopping-cart-null span {
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shopping-cart-list {
|
||||||
|
width: 320px;
|
||||||
|
max-height: 320px;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 4px 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shopping-cart-box {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 12px 16px;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #fafafa;
|
||||||
|
}
|
||||||
|
|
||||||
|
& + .shopping-cart-box {
|
||||||
|
border-top: 1px solid #f2f2f2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.shopping-cart-img {
|
||||||
|
width: 64px;
|
||||||
|
height: 64px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
border-radius: 6px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #f5f5f5;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.shopping-cart-info {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
min-height: 64px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shopping-cart-info .goods-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.4;
|
||||||
|
color: #333;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.shopping-cart-detail {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-top: 8px;
|
||||||
|
color: #999;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 16px;
|
}
|
||||||
|
|
||||||
|
.shopping-price {
|
||||||
|
color: $theme_color;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.username-p {
|
.username-p {
|
||||||
@@ -546,34 +598,4 @@ export default {
|
|||||||
z-index: 3;
|
z-index: 3;
|
||||||
top: 3px;
|
top: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.shopping-cart-box {
|
|
||||||
padding: 8px 0;
|
|
||||||
cursor: pointer;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
border-bottom: 1px #ccc dotted;
|
|
||||||
}
|
|
||||||
|
|
||||||
.shopping-cart-list {
|
|
||||||
padding: 10px 10px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
max-height: 300px;
|
|
||||||
overflow-y: scroll;
|
|
||||||
color: #333;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.shopping-cart-detail {
|
|
||||||
color: #999;
|
|
||||||
font-size: 12px;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.shopping-price {
|
|
||||||
color: $theme_color;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -3,29 +3,29 @@
|
|||||||
<div class="head-bar">
|
<div class="head-bar">
|
||||||
<!-- 有商品分类展示商品分类 -->
|
<!-- 有商品分类展示商品分类 -->
|
||||||
<template v-if="$route.query.categoryId">
|
<template v-if="$route.query.categoryId">
|
||||||
<!-- 头部展示筛选信息 -->
|
<div @click="cateClick(tabBar, 1)">{{ tabBar.name }}</div>
|
||||||
<div @click="cateClick(tabBar,1)">{{ tabBar.name }}</div>
|
<template v-if="tabBar.first && tabBar.first.name">
|
||||||
<el-icon><ArrowRight /></el-icon>
|
<el-icon><ArrowRight /></el-icon>
|
||||||
|
<div class="bar">
|
||||||
<div class="bar" v-if="tabBar.first">
|
{{ tabBar.first.name }} <el-icon><ArrowDown /></el-icon>
|
||||||
{{ tabBar.first.name }} <el-icon><ArrowDown /></el-icon>
|
<ul>
|
||||||
<ul>
|
<li v-for="item in tabBar.children" :key="item.id" @click="cateClick(item, 2)">
|
||||||
<li v-for="item in tabBar.children" :key="item.id" @click="cateClick(item,2)">
|
{{ item.name }}
|
||||||
{{ item.name }}
|
</li>
|
||||||
</li>
|
</ul>
|
||||||
</ul>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
<el-icon :v-if="tabBar.first"><ArrowRight /></el-icon>
|
<template v-if="tabBar.second && tabBar.second.name">
|
||||||
|
<el-icon><ArrowRight /></el-icon>
|
||||||
<div class="bar" v-if="tabBar.second">
|
<div class="bar">
|
||||||
{{ tabBar.second.name }} <el-icon><ArrowDown /></el-icon>
|
{{ tabBar.second.name }} <el-icon><ArrowDown /></el-icon>
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="item in tabBar.first.children" :key="item.id" @click="cateClick(item,3)">
|
<li v-for="item in tabBar.first.children" :key="item.id" @click="cateClick(item, 3)">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<el-icon :v-if="tabBar.second"><ArrowRight /></el-icon>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<!-- 无商品分类,展示搜索结果 -->
|
<!-- 无商品分类,展示搜索结果 -->
|
||||||
<template v-else>
|
<template v-else>
|
||||||
@@ -164,10 +164,11 @@ export default {
|
|||||||
name: 'GoodsClassNav',
|
name: 'GoodsClassNav',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
tabBar: { // 分类数据
|
tabBar: {
|
||||||
name: '',
|
name: '',
|
||||||
first: {},
|
children: [],
|
||||||
second: {}
|
first: null,
|
||||||
|
second: null
|
||||||
},
|
},
|
||||||
showTagCount: 5, // 展示的搜索项数量
|
showTagCount: 5, // 展示的搜索项数量
|
||||||
multiple: false, // 多选
|
multiple: false, // 多选
|
||||||
@@ -239,23 +240,23 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
const arr = this.$route.query.categoryId.split(',')
|
const arr = this.$route.query.categoryId.split(',')
|
||||||
if (arr.length > 0) {
|
const source = this.cateList.find((e) => e.id === arr[0])
|
||||||
this.tabBar = this.cateList.filter(e => {
|
if (!source) return
|
||||||
return e.id === arr[0]
|
const tabBar = {
|
||||||
})[0]
|
id: source.id,
|
||||||
|
name: source.name,
|
||||||
|
parentId: source.parentId,
|
||||||
|
children: source.children || [],
|
||||||
|
first: null,
|
||||||
|
second: null,
|
||||||
}
|
}
|
||||||
if (arr.length > 1) {
|
if (arr.length > 1) {
|
||||||
const first = this.tabBar.children.filter(e => {
|
tabBar.first = tabBar.children.find((e) => e.id === arr[1]) || null
|
||||||
return e.id === arr[1]
|
|
||||||
})[0]
|
|
||||||
this.tabBar['first'] = first
|
|
||||||
}
|
}
|
||||||
if (arr.length > 2) {
|
if (arr.length > 2 && tabBar.first && tabBar.first.children) {
|
||||||
const second = this.tabBar.first.children.filter(e => {
|
tabBar.second = tabBar.first.children.find((e) => e.id === arr[2]) || null
|
||||||
return e.id === arr[2]
|
|
||||||
})[0]
|
|
||||||
this.tabBar['second'] = second
|
|
||||||
}
|
}
|
||||||
|
this.tabBar = tabBar
|
||||||
},
|
},
|
||||||
cateClick (item, index) { // 点选分类
|
cateClick (item, index) { // 点选分类
|
||||||
switch (index) {
|
switch (index) {
|
||||||
|
|||||||
@@ -29,18 +29,20 @@
|
|||||||
:key="onderIndex"
|
:key="onderIndex"
|
||||||
>
|
>
|
||||||
<div class="order-header">
|
<div class="order-header">
|
||||||
<div>
|
<div class="order-header-main">
|
||||||
<div>{{ order.isAfterSale ? filterAfterSaleStatus(order.serviceStatus) : filterOrderStatus(order.orderStatus) }}</div>
|
<div class="order-status">{{ order.isAfterSale ? filterAfterSaleStatus(order.serviceStatus) : filterOrderStatus(order.orderStatus) }}</div>
|
||||||
<div v-if="order.isAfterSale">
|
<div class="order-sn" v-if="order.isAfterSale">
|
||||||
售后单号:{{ order.serviceSn }} {{ order.createTime }}
|
售后单号:{{ order.serviceSn }}<span>{{ order.createTime }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div class="order-sn" v-else>
|
||||||
订单号:{{ order.sn }} {{order.createTime}}
|
订单号:{{ order.sn }}<span>{{ order.createTime }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="order-header-side">
|
||||||
<el-button v-if="!order.isAfterSale && order.orderStatus === 'COMPLETED'" @click="delOrder(order.sn)" class="del-btn mr_10 fontsize_16" style="margin-top:-5px;" type="text" icon="ios-trash-outline" size="small"></el-button>
|
<el-button v-if="!order.isAfterSale && order.orderStatus === 'COMPLETED'" class="del-btn" link @click="delOrder(order.sn)">
|
||||||
<span>{{ $filters.unitPrice(order.flowPrice, "¥") }}</span>
|
<el-icon><Delete /></el-icon>
|
||||||
|
</el-button>
|
||||||
|
<span class="order-amount">{{ $filters.unitPrice(order.flowPrice, "¥") }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="order-body">
|
<div class="order-body">
|
||||||
@@ -48,6 +50,7 @@
|
|||||||
<div
|
<div
|
||||||
v-for="(goods, goodsIndex) in order.orderItems"
|
v-for="(goods, goodsIndex) in order.orderItems"
|
||||||
:key="goodsIndex"
|
:key="goodsIndex"
|
||||||
|
class="goods-item"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
@click="goodsDetail(goods.skuId, goods.goodsId)"
|
@click="goodsDetail(goods.skuId, goods.goodsId)"
|
||||||
@@ -55,30 +58,31 @@
|
|||||||
:src="goods.image"
|
:src="goods.image"
|
||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
<div>
|
<div class="goods-info">
|
||||||
<div class="hover-color" @click="goodsDetail(goods.skuId, goods.goodsId)">{{ goods.name }}</div>
|
<div class="goods-name hover-color" @click="goodsDetail(goods.skuId, goods.goodsId)">{{ goods.name }}</div>
|
||||||
<div class="mt_10">
|
<div class="goods-meta">
|
||||||
<span class="global_color">{{ $filters.unitPrice(goods.goodsPrice, "¥") }} </span> x {{ goods.num }}
|
<span class="global_color">{{ $filters.unitPrice(goods.goodsPrice, "¥") }}</span>
|
||||||
<span style="margin-left: 10px;color: #ff9900;">{{refundPriceList(goods.isRefund)}}</span>
|
<span class="goods-num">x {{ goods.num }}</span>
|
||||||
|
<span v-if="refundPriceList(goods.isRefund)" class="refund-tag">{{ refundPriceList(goods.isRefund) }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="goods-ops" v-if="goods.commentStatus == 'UNFINISHED' || goods.complainStatus == 'NO_APPLY'">
|
||||||
|
<el-button v-if="goods.commentStatus == 'UNFINISHED'" @click="comment(order.sn, goodsIndex)" size="small" type="success">评价</el-button>
|
||||||
|
<el-button v-if="goods.complainStatus == 'NO_APPLY'" @click="complain(order.sn, goodsIndex)" type="danger" size="small">投诉</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-button v-if="goods.commentStatus == 'UNFINISHED'" @click="comment(order.sn, goodsIndex)" size="small" type="success" class="fontsize_12" style="position:relative;top:-22px;left:190px;margin-right:10px">评价</el-button>
|
|
||||||
<el-button v-if="goods.complainStatus == 'NO_APPLY'" @click="complain(order.sn, goodsIndex)" type="danger" class="fontsize_12" size="small" style="position:relative;top:-22px;left:190px">投诉</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="store-name">
|
||||||
<span @click="shopPage(order.storeId)">{{ order.storeName }}</span>
|
<span @click="shopPage(order.storeId)">{{ order.storeName }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="order-actions" v-if="order.isAfterSale">
|
<div class="order-actions" v-if="order.isAfterSale">
|
||||||
<el-button @click="goAfterSaleDetail(order.serviceSn)" type="warning" size="small">售后详情</el-button>
|
<el-button @click="goAfterSaleDetail(order.serviceSn)" type="warning" size="small">售后详情</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="order-actions" v-else>
|
<div class="order-actions" v-else>
|
||||||
<!-- 订单基础操作 -->
|
|
||||||
<el-button @click="orderDetail(order.sn)" type="warning" size="small">订单详情</el-button>
|
<el-button @click="orderDetail(order.sn)" type="warning" size="small">订单详情</el-button>
|
||||||
<el-button @click="handleCancelOrder(order.sn)" type="danger" v-if="order.allowOperationVO.cancel" size="small">取消订单</el-button>
|
<el-button @click="handleCancelOrder(order.sn)" type="danger" v-if="order.allowOperationVO.cancel" size="small">取消订单</el-button>
|
||||||
<el-button @click="goPay(order.sn)" size="small" type="success" v-if="order.allowOperationVO.pay">去支付</el-button>
|
<el-button @click="goPay(order.sn)" size="small" type="success" v-if="order.allowOperationVO.pay">去支付</el-button>
|
||||||
<el-button @click="received(order.sn)" size="small" type="primary" v-if="order.allowOperationVO.rog">确认收货</el-button>
|
<el-button @click="received(order.sn)" size="small" type="primary" v-if="order.allowOperationVO.rog">确认收货</el-button>
|
||||||
<!-- 售后(E_COUPON 卡密已交付不支持售后 FR-B-04) -->
|
|
||||||
<el-button v-if="order.orderType !== 'E_COUPON' && order.groupAfterSaleStatus && (order.groupAfterSaleStatus.includes('NOT_APPLIED')|| order.groupAfterSaleStatus.includes('PART_AFTER_SALE'))"
|
<el-button v-if="order.orderType !== 'E_COUPON' && order.groupAfterSaleStatus && (order.groupAfterSaleStatus.includes('NOT_APPLIED')|| order.groupAfterSaleStatus.includes('PART_AFTER_SALE'))"
|
||||||
@click="applyAfterSale(order.orderItems)" size="small">申请售后</el-button>
|
@click="applyAfterSale(order.orderItems)" size="small">申请售后</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -104,18 +108,20 @@
|
|||||||
:key="onderIndex"
|
:key="onderIndex"
|
||||||
>
|
>
|
||||||
<div class="order-header">
|
<div class="order-header">
|
||||||
<div>
|
<div class="order-header-main">
|
||||||
<div>{{ order.isAfterSale ? filterAfterSaleStatus(order.serviceStatus) : filterOrderStatus(order.orderStatus) }}</div>
|
<div class="order-status">{{ order.isAfterSale ? filterAfterSaleStatus(order.serviceStatus) : filterOrderStatus(order.orderStatus) }}</div>
|
||||||
<div v-if="order.isAfterSale">
|
<div class="order-sn" v-if="order.isAfterSale">
|
||||||
售后单号:{{ order.serviceSn }} {{ order.createTime }}
|
售后单号:{{ order.serviceSn }}<span>{{ order.createTime }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div class="order-sn" v-else>
|
||||||
订单号:{{ order.sn }} {{order.createTime}}
|
订单号:{{ order.sn }}<span>{{ order.createTime }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="order-header-side">
|
||||||
<el-button v-if="!order.isAfterSale && order.orderStatus === 'COMPLETED'" @click="delOrder(order.sn)" class="del-btn mr_10 fontsize_16" style="margin-top:-5px;" type="text" icon="ios-trash-outline" size="small"></el-button>
|
<el-button v-if="!order.isAfterSale && order.orderStatus === 'COMPLETED'" class="del-btn" link @click="delOrder(order.sn)">
|
||||||
<span>{{ $filters.unitPrice(order.flowPrice, "¥") }}</span>
|
<el-icon><Delete /></el-icon>
|
||||||
|
</el-button>
|
||||||
|
<span class="order-amount">{{ $filters.unitPrice(order.flowPrice, "¥") }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="order-body">
|
<div class="order-body">
|
||||||
@@ -123,6 +129,7 @@
|
|||||||
<div
|
<div
|
||||||
v-for="(goods, goodsIndex) in order.orderItems"
|
v-for="(goods, goodsIndex) in order.orderItems"
|
||||||
:key="goodsIndex"
|
:key="goodsIndex"
|
||||||
|
class="goods-item"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
@click="goodsDetail(goods.skuId, goods.goodsId)"
|
@click="goodsDetail(goods.skuId, goods.goodsId)"
|
||||||
@@ -130,30 +137,31 @@
|
|||||||
:src="goods.image"
|
:src="goods.image"
|
||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
<div>
|
<div class="goods-info">
|
||||||
<div class="hover-color" @click="goodsDetail(goods.skuId, goods.goodsId)">{{ goods.name }}</div>
|
<div class="goods-name hover-color" @click="goodsDetail(goods.skuId, goods.goodsId)">{{ goods.name }}</div>
|
||||||
<div class="mt_10">
|
<div class="goods-meta">
|
||||||
<span class="global_color">{{ $filters.unitPrice(goods.goodsPrice, "¥") }} </span>x {{ goods.num }}
|
<span class="global_color">{{ $filters.unitPrice(goods.goodsPrice, "¥") }}</span>
|
||||||
<span style="margin-left: 10px;color: #ff9900;">{{refundPriceList(goods.isRefund)}}</span>
|
<span class="goods-num">x {{ goods.num }}</span>
|
||||||
|
<span v-if="refundPriceList(goods.isRefund)" class="refund-tag">{{ refundPriceList(goods.isRefund) }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="goods-ops" v-if="goods.commentStatus == 'UNFINISHED' || goods.complainStatus == 'NO_APPLY'">
|
||||||
|
<el-button v-if="goods.commentStatus == 'UNFINISHED'" @click="comment(order.sn, goodsIndex)" size="small" type="success">评价</el-button>
|
||||||
|
<el-button v-if="goods.complainStatus == 'NO_APPLY'" @click="complain(order.sn, goodsIndex)" type="danger" size="small">投诉</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-button v-if="goods.commentStatus == 'UNFINISHED'" @click="comment(order.sn, goodsIndex)" size="small" type="success" class="fontsize_12" style="position:relative;top:-22px;left:190px;margin-right:10px">评价</el-button>
|
|
||||||
<el-button v-if="goods.complainStatus == 'NO_APPLY'" @click="complain(order.sn, goodsIndex)" type="danger" class="fontsize_12" size="small" style="position:relative;top:-22px;left:190px">投诉</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="store-name">
|
||||||
<span @click="shopPage(order.storeId)">{{ order.storeName }}</span>
|
<span @click="shopPage(order.storeId)">{{ order.storeName }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="order-actions" v-if="order.isAfterSale">
|
<div class="order-actions" v-if="order.isAfterSale">
|
||||||
<el-button @click="goAfterSaleDetail(order.serviceSn)" type="warning" size="small">售后详情</el-button>
|
<el-button @click="goAfterSaleDetail(order.serviceSn)" type="warning" size="small">售后详情</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="order-actions" v-else>
|
<div class="order-actions" v-else>
|
||||||
<!-- 订单基础操作 -->
|
|
||||||
<el-button @click="orderDetail(order.sn)" type="warning" size="small">订单详情</el-button>
|
<el-button @click="orderDetail(order.sn)" type="warning" size="small">订单详情</el-button>
|
||||||
<el-button @click="handleCancelOrder(order.sn)" type="danger" v-if="order.allowOperationVO.cancel" size="small">取消订单</el-button>
|
<el-button @click="handleCancelOrder(order.sn)" type="danger" v-if="order.allowOperationVO.cancel" size="small">取消订单</el-button>
|
||||||
<el-button @click="goPay(order.sn)" size="small" type="success" v-if="order.allowOperationVO.pay">去支付</el-button>
|
<el-button @click="goPay(order.sn)" size="small" type="success" v-if="order.allowOperationVO.pay">去支付</el-button>
|
||||||
<el-button @click="received(order.sn)" size="small" type="primary" v-if="order.allowOperationVO.rog">确认收货</el-button>
|
<el-button @click="received(order.sn)" size="small" type="primary" v-if="order.allowOperationVO.rog">确认收货</el-button>
|
||||||
<!-- 售后(E_COUPON 不支持买家售后 FR-B-04) -->
|
|
||||||
<el-button v-if="order.orderType !== 'E_COUPON' && order.groupAfterSaleStatus && (order.groupAfterSaleStatus.includes('NOT_APPLIED')|| order.groupAfterSaleStatus.includes('PART_AFTER_SALE'))"
|
<el-button v-if="order.orderType !== 'E_COUPON' && order.groupAfterSaleStatus && (order.groupAfterSaleStatus.includes('NOT_APPLIED')|| order.groupAfterSaleStatus.includes('PART_AFTER_SALE'))"
|
||||||
@click="applyAfterSale(order.orderItems)" size="small">申请售后</el-button>
|
@click="applyAfterSale(order.orderItems)" size="small">申请售后</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -192,8 +200,10 @@ import { Message, Modal } from "@/utils/message";
|
|||||||
import { getOrderList, sureReceived, cancelOrder, delOrder } from '@/api/order';
|
import { getOrderList, sureReceived, cancelOrder, delOrder } from '@/api/order';
|
||||||
import { afterSaleReason, afterSaleList } from '@/api/member';
|
import { afterSaleReason, afterSaleList } from '@/api/member';
|
||||||
import { orderStatusList, afterSaleStatusList } from '../enumeration.js'
|
import { orderStatusList, afterSaleStatusList } from '../enumeration.js'
|
||||||
|
import { Delete } from '@element-plus/icons-vue'
|
||||||
export default {
|
export default {
|
||||||
name: 'MyOrder',
|
name: 'MyOrder',
|
||||||
|
components: { Delete },
|
||||||
props: {
|
props: {
|
||||||
homePage: { // 判断是否个人中心首页展示内容
|
homePage: { // 判断是否个人中心首页展示内容
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -457,80 +467,174 @@ export default {
|
|||||||
}
|
}
|
||||||
/** 订单列表 */
|
/** 订单列表 */
|
||||||
.order-list {
|
.order-list {
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #eee;
|
||||||
border-radius: 3px;
|
border-radius: 8px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 12px;
|
||||||
|
background: #fff;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
&:hover{
|
&:hover {
|
||||||
.del-btn{visibility: visible;}
|
.del-btn { visibility: visible; }
|
||||||
}
|
}
|
||||||
.del-btn{
|
|
||||||
|
.del-btn {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
|
padding: 0;
|
||||||
|
height: auto;
|
||||||
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-header {
|
.order-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 10px;
|
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
border-bottom: 1px solid #ddd;
|
gap: 16px;
|
||||||
> div:nth-child(1) > div:nth-child(2) {
|
padding: 12px 16px;
|
||||||
font-size: 12px;
|
background: #fafafa;
|
||||||
color: #999;
|
border-bottom: 1px solid #f0f0f0;
|
||||||
margin-top: 3px;
|
}
|
||||||
|
|
||||||
|
.order-header-main {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-status {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-sn {
|
||||||
|
margin-top: 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #999;
|
||||||
|
line-height: 1.4;
|
||||||
|
|
||||||
|
span {
|
||||||
|
margin-left: 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.order-body {
|
|
||||||
|
.order-header-side {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
align-items: center;
|
||||||
|
flex-shrink: 0;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-amount {
|
||||||
|
min-width: 88px;
|
||||||
|
text-align: right;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: $theme_color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-body {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: minmax(0, 1fr) 120px 100px;
|
||||||
|
gap: 12px;
|
||||||
|
align-items: start;
|
||||||
|
padding: 14px 16px;
|
||||||
color: #999;
|
color: #999;
|
||||||
padding: 10px;
|
}
|
||||||
|
|
||||||
.goods-list > div {
|
.goods-item {
|
||||||
width: 500px;
|
display: flex;
|
||||||
display: flex;
|
align-items: flex-start;
|
||||||
margin-bottom: 10px;
|
min-width: 0;
|
||||||
img {
|
|
||||||
width: 60px;
|
& + .goods-item {
|
||||||
height: 60px;
|
margin-top: 12px;
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
> div {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
> div:nth-child(2) {
|
img {
|
||||||
width: 150px;
|
width: 72px;
|
||||||
text-align: center;
|
height: 72px;
|
||||||
span {
|
margin-right: 12px;
|
||||||
color: #438cde;
|
border-radius: 6px;
|
||||||
cursor: pointer;
|
object-fit: cover;
|
||||||
&:hover {
|
flex-shrink: 0;
|
||||||
color: $theme_color;
|
background: #f5f5f5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.el-icon {
|
|
||||||
color: #ff8f23;
|
.goods-info {
|
||||||
cursor: pointer;
|
flex: 1;
|
||||||
&:hover {
|
min-width: 0;
|
||||||
color: $theme_color;
|
}
|
||||||
}
|
|
||||||
|
.goods-name {
|
||||||
|
color: #333;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.4;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-meta {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 8px;
|
||||||
|
margin-top: 8px;
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-num {
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.refund-tag {
|
||||||
|
padding: 0 6px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: #fff7e8;
|
||||||
|
color: #ff9900;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-ops {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 8px;
|
||||||
|
margin-top: 8px;
|
||||||
|
|
||||||
|
.el-button {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.store-name {
|
||||||
|
padding-top: 4px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.4;
|
||||||
|
word-break: break-all;
|
||||||
|
|
||||||
|
span {
|
||||||
|
color: #438cde;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: $theme_color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.order-actions {
|
.order-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: stretch;
|
||||||
justify-content: center;
|
gap: 8px;
|
||||||
gap: 8px;
|
|
||||||
min-width: 100px;
|
|
||||||
|
|
||||||
.el-button {
|
.el-button {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
min-width: 88px;
|
width: 100%;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,7 +104,10 @@ export const Modal = {
|
|||||||
return options.onOk();
|
return options.onOk();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch((reason) => {
|
||||||
|
if (reason !== "cancel" && reason !== "close") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (typeof options.onCancel === "function") {
|
if (typeof options.onCancel === "function") {
|
||||||
options.onCancel();
|
options.onCancel();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user