|
|
@@ -1,32 +1,63 @@
|
|
|
<template>
|
|
|
<div class="container">
|
|
|
+ <div class="top">
|
|
|
+ <div class="text1">已保存3条了条地址,还能保存7条地址</div>
|
|
|
+ <div class="text2" @click="add">新增地址</div>
|
|
|
+ </div>
|
|
|
+ <div class="border"></div>
|
|
|
<template>
|
|
|
- <el-table :data="tableData" :border="false" :highlight-current-row="false" style="width: 100%">
|
|
|
+ <el-table
|
|
|
+ class="customer-table"
|
|
|
+ :header-cell-style="{ background: '#1c1e26' }"
|
|
|
+ :data="tableData"
|
|
|
+ :border="false"
|
|
|
+ :highlight-current-row="false"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
<el-table-column prop="name" label="收货人" width="180"> </el-table-column>
|
|
|
<el-table-column prop="phone" label="联系电话" width="180"> </el-table-column>
|
|
|
- <el-table-column prop="address" label="所在地区" width="220"> </el-table-column>
|
|
|
+ <el-table-column prop="region" label="所在地区" width="220"> </el-table-column>
|
|
|
<el-table-column prop="address" label="详情地址" width="220"> </el-table-column>
|
|
|
- <el-table-column prop="address" label="操作"> </el-table-column>
|
|
|
+ <el-table-column fixed="right" label="操作" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button @click="handleClick(scope.row)" type="text" size="small">修改</el-button>
|
|
|
+ <el-button type="text" size="small">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</template>
|
|
|
+ <address-info :show="show" @close="show = false" ref="address"></address-info>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import AddressInfo from '../../components/AddressInfo.vue';
|
|
|
export default {
|
|
|
+ components: { AddressInfo },
|
|
|
data() {
|
|
|
return {
|
|
|
+ show: false,
|
|
|
tableData: [
|
|
|
{
|
|
|
name: '王小虎',
|
|
|
phone: '1774639714',
|
|
|
+ region: '江苏省南京市建邺区',
|
|
|
address: '上海市普陀区金沙江路 1518 弄'
|
|
|
}
|
|
|
]
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
|
- methods: {}
|
|
|
+ methods: {
|
|
|
+ handleClick(row) {
|
|
|
+ this.show = true;
|
|
|
+ this.$refs.address.init(row);
|
|
|
+ },
|
|
|
+ add() {
|
|
|
+ this.show = true;
|
|
|
+ this.$forceUpdate();
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
@@ -40,6 +71,75 @@ export default {
|
|
|
color: #ffffff;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.container {
|
|
|
+ padding: 45px 16px 0;
|
|
|
+
|
|
|
+ .top {
|
|
|
+ .flex();
|
|
|
+ justify-content: space-between;
|
|
|
+ .text1 {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #ffffff;
|
|
|
+ line-height: 25px;
|
|
|
+ }
|
|
|
+ .text2 {
|
|
|
+ width: 106px;
|
|
|
+ height: 42px;
|
|
|
+ border-radius: 8px;
|
|
|
+ border: 1px solid #939599;
|
|
|
+ line-height: 42px;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #939599;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .border {
|
|
|
+ height: 1px;
|
|
|
+ background: #494a4d;
|
|
|
+ border-radius: 1px;
|
|
|
+ margin: 24px 0 34px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style lang="less">
|
|
|
+.customer-table th {
|
|
|
+ border: none !important;
|
|
|
+}
|
|
|
+.customer-table td,
|
|
|
+.customer-table th.is-leaf {
|
|
|
+ border: none;
|
|
|
+}
|
|
|
+// 表格最外边框
|
|
|
+// .el-table--border,
|
|
|
+// .el-table--group {
|
|
|
+// border: none;
|
|
|
+// }
|
|
|
+// 头部边框
|
|
|
+.customer-table thead tr th.is-leaf {
|
|
|
+ border: 1px solid #ebeef5;
|
|
|
+ border-right: none;
|
|
|
+}
|
|
|
+.customer-table thead tr th:nth-last-of-type(2) {
|
|
|
+ border-right: 1px solid #ebeef5;
|
|
|
+}
|
|
|
+// 表格最外层边框-底部边框
|
|
|
+.el-table--border::after,
|
|
|
+.el-table--group::after {
|
|
|
+ width: 0;
|
|
|
+}
|
|
|
+.customer-table::before {
|
|
|
+ width: 0;
|
|
|
+}
|
|
|
+.customer-table .el-table__fixed-right::before,
|
|
|
+.el-table__fixed::before {
|
|
|
+ width: 0;
|
|
|
}
|
|
|
+// 表格有滚动时表格头边框
|
|
|
+// .el-table--border th.gutter:last-of-type {
|
|
|
+// border: 1px solid #ebeef5;
|
|
|
+// border-left: none;
|
|
|
+// }
|
|
|
</style>
|