|
|
@@ -1,18 +1,40 @@
|
|
|
<template>
|
|
|
<container title="商品列表">
|
|
|
- <div class="input-box">
|
|
|
- <el-input
|
|
|
- prefix-icon="el-icon-search"
|
|
|
- placeholder="输入产品名称"
|
|
|
- v-model="input1"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </div>
|
|
|
- <div class="good-main">
|
|
|
- <div class="good-category">
|
|
|
- <el-tree highlight-current :data="data" :props="defaultProps"></el-tree>
|
|
|
+ <div class="goods-ward">
|
|
|
+ <div class="input-box">
|
|
|
+ <el-input
|
|
|
+ prefix-icon="el-icon-search"
|
|
|
+ placeholder="输入产品名称"
|
|
|
+ v-model="input1"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ <div class="good-main">
|
|
|
+ <div class="good-category">
|
|
|
+ <el-tree
|
|
|
+ highlight-current
|
|
|
+ :data="data"
|
|
|
+ :props="defaultProps"
|
|
|
+ :render-content="renderContent"
|
|
|
+ ></el-tree>
|
|
|
+ </div>
|
|
|
+ <div class="good-list scrollbar">
|
|
|
+ <div
|
|
|
+ class="good-list-item"
|
|
|
+ :class="{ actived: activeIds.includes(item) }"
|
|
|
+ @click="select(item)"
|
|
|
+ v-for="item in 10"
|
|
|
+ :key="item"
|
|
|
+ >
|
|
|
+ <p class="item-title line2">
|
|
|
+ 鲁花花生油鲁花花生油最多两行鲁花花生油鲁花花生油最多两行
|
|
|
+ </p>
|
|
|
+ <span class="text-21f">2000积分</span>
|
|
|
+ <div class="cb22 item-money">¥2243.00</div>
|
|
|
+ <p class="c99">原价:<span class="text-line">3223.00</span>元</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="good-list">123</div>
|
|
|
</div>
|
|
|
</container>
|
|
|
</template>
|
|
|
@@ -20,19 +42,31 @@
|
|
|
<script>
|
|
|
export default {
|
|
|
name: "SaasMemberGoodsList",
|
|
|
-
|
|
|
+ props: {
|
|
|
+ selectedList: {
|
|
|
+ type: Array,
|
|
|
+ default: () => {
|
|
|
+ return [];
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
input1: 23,
|
|
|
data: [
|
|
|
{
|
|
|
- label: "一级 1",
|
|
|
+ label: "一级 112333333333333",
|
|
|
children: [
|
|
|
{
|
|
|
label: "二级 1-1",
|
|
|
children: [
|
|
|
{
|
|
|
label: "三级 1-1-1",
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ label: "三级 1-1-1",
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
@@ -88,12 +122,43 @@ export default {
|
|
|
children: "children",
|
|
|
label: "label",
|
|
|
},
|
|
|
+ ids: [1],
|
|
|
};
|
|
|
},
|
|
|
|
|
|
mounted() {},
|
|
|
|
|
|
- methods: {},
|
|
|
+ methods: {
|
|
|
+ select(item) {
|
|
|
+ const index = this.selectedList.findIndex((e) => e.id == item);
|
|
|
+ if (index != -1) {
|
|
|
+ this.selectedList.splice(index, 1);
|
|
|
+ } else {
|
|
|
+ this.selectedList.push({ id: item });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ aaa(node, data, store) {
|
|
|
+ console.log(node, data, store, 789);
|
|
|
+ },
|
|
|
+ renderContent(h, { node, data, store }) {
|
|
|
+ this.aaa(node, data, store);
|
|
|
+ let rgba = "rgba(0, 0, 0, " + (node.level - 1) * 0.08 + ")";
|
|
|
+ return (
|
|
|
+ <span class="custom-tree-node fl_b" style={{ background: rgba }}>
|
|
|
+ <span class="custom-tree-text line1">{node.label}</span>
|
|
|
+ <span
|
|
|
+ class="el-icon-caret-right"
|
|
|
+ style={{ display: node.childNodes.length ? "block" : "none" }}
|
|
|
+ ></span>
|
|
|
+ </span>
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ activeIds() {
|
|
|
+ return this.selectedList.map((e) => e.id);
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
@@ -101,23 +166,97 @@ export default {
|
|
|
.input-box {
|
|
|
margin: 18px 0 16px;
|
|
|
}
|
|
|
+.goods-ward {
|
|
|
+ height: calc(100vh - 180px);
|
|
|
+}
|
|
|
.good-main {
|
|
|
- height: 500px;
|
|
|
+ height: 100%;
|
|
|
display: flex;
|
|
|
.good-category {
|
|
|
+ height: calc(100% - 50px);
|
|
|
background: #f6f7f9;
|
|
|
+ border-radius: 8px;
|
|
|
+ width: 120px;
|
|
|
/deep/ {
|
|
|
.el-tree-node__expand-icon {
|
|
|
display: none;
|
|
|
}
|
|
|
.el-tree {
|
|
|
background: #f6f7f9;
|
|
|
+ border-radius: 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-tree-node__label {
|
|
|
+ // padding-right: 16px;
|
|
|
+ }
|
|
|
+ .el-tree-node__content {
|
|
|
+ height: 48px;
|
|
|
+ color: #4a4a4b;
|
|
|
+ padding-left: 0 !important;
|
|
|
}
|
|
|
.el-tree--highlight-current
|
|
|
.el-tree-node.is-current
|
|
|
> .el-tree-node__content {
|
|
|
- background: #ffffff;
|
|
|
- color: #fa821f;
|
|
|
+ background: #fa821f;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ .custom-tree-node {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ height: 48px;
|
|
|
+ padding: 0 12px;
|
|
|
+ .custom-tree-text {
|
|
|
+ width: 86px;
|
|
|
+ }
|
|
|
+ .el-icon-caret-right {
|
|
|
+ cursor: pointer;
|
|
|
+ color: #c0c4cc !important;
|
|
|
+ font-size: 12px;
|
|
|
+ transform: rotate(90deg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .is-expanded {
|
|
|
+ & .custom-tree-node > .el-icon-caret-right {
|
|
|
+ transform: rotate(0) !important;
|
|
|
+ transition: transform 0.3s ease-in-out !important,
|
|
|
+ -webkit-transform 0.3s ease-in-out !important;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .good-list {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ flex: 1;
|
|
|
+ margin-left: 20px;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ align-content: flex-start;
|
|
|
+ height: calc(100% - 50px);
|
|
|
+ overflow-x: auto;
|
|
|
+ p {
|
|
|
+ padding: 0;
|
|
|
+ margin: 0;
|
|
|
+ }
|
|
|
+ .good-list-item {
|
|
|
+ cursor: pointer;
|
|
|
+ float: left;
|
|
|
+ width: 48%;
|
|
|
+ height: 182px;
|
|
|
+ background: #f6f7f9;
|
|
|
+ border-radius: 12px;
|
|
|
+ padding: 16px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ overflow: hidden;
|
|
|
+ border: 2px solid #ffffff;
|
|
|
+ .item-title {
|
|
|
+ color: #4a4a4b;
|
|
|
+ font-size: 18px;
|
|
|
+ margin-bottom: 8px;
|
|
|
+ }
|
|
|
+ .item-money {
|
|
|
+ font-size: 20px;
|
|
|
+ margin: 14px 0 6px;
|
|
|
}
|
|
|
}
|
|
|
}
|