一、效果图
二、实现原理
代码:
<table style="margin-top:20px;">
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
<th>Month</th>
<th>Savings</th>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tbody>
<br />
<tr>
<td colspan="" rowspan="" headers="">1</td>
<td colspan="" rowspan="" headers="">11</td>
<td colspan="" rowspan="2" headers="">2</td>
<td colspan="" rowspan="2" headers="">3</td>
<td colspan="" rowspan="2" headers="">4</td>
<td colspan="" rowspan="2" headers="">5</td>
</tr>
<tr>
<td colspan="" rowspan="" headers="">1</td>
<td colspan="" rowspan="" headers="">11</td>
</tr>
</tbody>
<tbody>
<br />
<tr>
<td colspan="" rowspan="" headers="">1</td>
<td colspan="" rowspan="" headers="">11</td>
<td colspan="" rowspan="2" headers="">2</td>
<td colspan="" rowspan="2" headers="">3</td>
<td colspan="" rowspan="2" headers="">4</td>
<td colspan="" rowspan="2" headers="">5</td>
</tr>
<tr>
<td colspan="" rowspan="" headers="">1</td>
<td colspan="" rowspan="" headers="">11</td>
</tr>
</tbody>
</table>
td,
th {
padding: 10px 0;
border: 1px solid #e5e5e5;
vertical-align: top;
}
三、效果图实现代码
<template>
<div class="orderList">
<div class="page-wrap w">
<div class="orderList-table">
<table class="order-head">
<tbody>
<tr>
<th class="order_info">商品信息</th>
<th class="order_price">单价</th>
<th class="order_num">数量</th>
<th class="goods_handle">商品操作</th>
<th class="real_pay">实付款</th>
<th class="order_status">订单状态</th>
<th class="order_handle">交易操作</th>
</tr>
</tbody>
</table>
<div v-for="(item, index) in list" :key="index" class="order-body">
<table class="body_top">
<tbody>
<br />
<div class="body_top_con">
<div class="top_con_shop">
<span class="top_con_time">{{ item.create_time }}</span>
<span class="top_con_num">订单号:{{ item.id }}</span>
<span>店铺:{{ item.shop_name }}</span>
</div>
<div class="top_con_del">
<i class="el-icon-delete"></i>
</div>
</div>
</tbody>
</table>
<table>
<tbody>
<tr class="body_content">
<div v-for="(work, ind) in item.goods" :key="ind">
<td colspan="" rowspan="" headers="" class="body_content_info">
<div class="info_box">
<div class="info_box_img" @click="viewGood(work)">
<img :src="work.img" alt="" />
</div>
<div class="info_describe">
<p class="text" @click="viewGood(work)">
<span>{{ work.text }}</span>
</p>
<p class="attr">
<span v-for="(itm, iid) in work.goodsAttr" :key="iid">
<span>{{ itm.attrName }}:{{ itm.attrValue }}</span>
</span>
</p>
</div>
</div>
</td>
<td colspan="" rowspan="" headers="" class="order_price body_content_price">
<p>¥{{ work.price }}</p>
</td>
<td colspan="" rowspan="" headers="" class="order_num body_content_num">
<p>{{ work.num }}</p>
</td>
</div>
<td colspan="" :rowspan="item.goods.length" headers="" class="goods_handle body_content_handle">
<p>申请售后</p>
<p>投诉卖家</p>
</td>
<td colspan="" :rowspan="item.goods.length" headers="" class="real_pay body_content_pay">
<p class="price">¥{{ item.total_payment }}</p>
<p class="postage">(含运费:¥{{ item.postage }})</p>
</td>
<td colspan="" :rowspan="item.goods.length" headers="" class="order_status body_content_status">
<p>
<span v-if="item.status === 0">订单已取消</span>
<span v-if="item.status === 1">等待买家付款</span>
<span v-if="item.status === 2">待发货</span>
<span v-if="item.status === 3">待确认</span>
<span v-if="item.status === 4">退货</span>
<span v-if="item.status === 5">退货邮寄</span>
<span v-if="item.status === 6">退货完成</span>
<span v-if="item.status === 7">订单完成</span>
</p>
<p class="detail">
<span>订单详情</span>
</p>
</td>
<td colspan="" :rowspan="item.goods.length" headers="" class="order_handle body_content_ohandle">
<p v-if="item.status === 1">
<el-button size="mini" type="danger">立即付款</el-button>
</p>
<p v-if="item.status === 1" class="order_cancel">
<span>取消订单</span>
</p>
<p class="order_cancel">
<!-- <span>再次购买</span> -->
</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'orderList',
components: {},
data() {
return {
list: [
{
create_time: '2021-01-27 14:17:06',
id: 16117282260421,
postage: '0.00',
shop_name: '手机专卖店',
status: 1,
total_payment: '444.00',
goods: [
{
goodsAttr: [
{
attrName: '1',
attrValue: '1'
},
{
attrName: '2',
attrValue: '2'
}
],
goods_id: 1609983892472866,
img: 'http://120.76.98.119:1224/upload/shop/9438863192/20210107/160998902823.jpg',
num: 1,
price: '444.00',
text: '小米 11 xiaomi'
}
]
},
{
create_time: '2021-01-22 16:27:36',
id: 16113040562157,
postage: '0.00',
shop_name: '梅友人',
status: 1,
total_payment: '283666.00',
goods: [
{
goodsAttr: [
{
attrName: '选择颜色',
attrValue: '亮黑色'
},
{
attrName: '运行内存',
attrValue: '8GB'
},
{
attrName: '机身存储',
attrValue: '512GB'
}
],
goods_id: 1609914198055593,
img: 'http://120.76.98.119:1224/upload/shop/8936718382/20210106/16099141986.jpg',
num: 5,
price: '39995.00',
text: '华为mate40pro 5G手机 亮黑色 8+256G全网通(碎屏险套餐)'
},
{
goodsAttr: [
{
attrName: '选择颜色',
attrValue: '迷雾金'
},
{
attrName: '运行内存',
attrValue: '12GB'
},
{
attrName: '机身存储',
attrValue: '512GB'
}
],
goods_id: 1609984862086794,
img: 'http://120.76.98.119:1224/upload/shop/8936718382/20210107/160998486230.jpg',
num: 3,
price: '27897.00',
text: '三星Galaxy Note20 Ultra 5G(SM-N9860)S Pen&三星笔记 120Hz自适应屏幕 5G手机游戏手机 12GB+256GB 初露白'
}
]
}
]
}
},
methods: {},
created() {}
}
</script>
<style lang="scss" scoped>
.orderList-table {
margin-top: 20px;
.order_info {
width: 460px;
}
.order_price {
width: 107px;
}
.order_num {
width: 55px;
}
.goods_handle {
width: 110px;
}
.real_pay {
width: 128px;
}
.order_status {
width: 110px;
}
.order_handle {
width: 110px;
}
// 表格数据
.order-body {
.body_top {
.body_top_con {
background: #f5f5f5;
border: 1px solid #e5e5e5;
width: 1080px;
padding: 10px;
display: flex;
justify-content: space-between;
.top_con_shop {
.top_con_time {
color: #3c3c3c;
font-weight: bold;
margin: 0 10px 0 0;
}
.top_con_num {
margin: 0 50px 0 0;
}
}
.top_con_del {
cursor: pointer;
.el-icon-delete:before {
content: '\e6d7';
font-size: 15px;
}
}
}
}
.body_content {
p {
margin: 4px 0;
}
}
// 商品信息
.body_content_info {
width: 460px;
border-top: unset;
.info_box {
display: flex;
align-items: center;
margin: 0 10px;
.info_box_img {
cursor: pointer;
width: 80px;
flex: 0 0 80px;
margin-right: 10px;
img {
width: 80px;
height: 80px;
}
}
.info_describe {
.text {
margin-bottom: 6px;
cursor: pointer;
:hover {
color: red;
}
}
.attr {
color: #9e9e9e;
span {
margin-right: 6px;
}
}
}
}
}
// 单价
.body_content_price {
text-align: center;
border-top: unset;
}
// 数量
.body_content_num {
text-align: center;
border-top: unset;
border-right: unset;
}
//商品操作
.body_content_handle {
text-align: center;
border-top: unset;
}
// 实际付款
.body_content_pay {
text-align: center;
border-top: unset;
.price {
color: #3c3c3c;
font-weight: bold;
}
.postage {
color: #6c6c6c;
}
}
.body_content_status {
text-align: center;
border-top: unset;
.detail {
cursor: pointer;
:hover {
color: red;
}
}
}
.body_content_ohandle {
text-align: center;
border-top: unset;
.order_cancel {
cursor: pointer;
:hover {
color: red;
}
}
}
}
}
</style>
<style lang="scss">
.orderList {
.order-body {
td,
th {
padding: 10px 0;
border: 1px solid #e5e5e5;
vertical-align: top;
}
}
}
</style>