|
|
@@ -4,7 +4,9 @@
|
|
|
<el-input
|
|
|
prefix-icon="el-icon-search"
|
|
|
placeholder="输入产品名称"
|
|
|
- v-model="input1"
|
|
|
+ v-model="formData.goodsName"
|
|
|
+ @keyup.enter.native="getGoodsList"
|
|
|
+ @blur="getGoodsList"
|
|
|
>
|
|
|
</el-input>
|
|
|
</div>
|
|
|
@@ -14,22 +16,33 @@
|
|
|
:treeList="categoryList"
|
|
|
:defaultId="0"
|
|
|
@more="handelShowMore"
|
|
|
+ @nodeClick="handelCategory"
|
|
|
></category-tree>
|
|
|
</div>
|
|
|
- <div class="good-list scrollbar">
|
|
|
+ <div class="good-list scrollbar" v-loading="loading">
|
|
|
<div
|
|
|
class="good-list-item"
|
|
|
- :class="{ actived: activeIds.includes(item) }"
|
|
|
+ :class="{ actived: activeIds.includes(item.goodsId) }"
|
|
|
@click="select(item)"
|
|
|
- v-for="item in 10"
|
|
|
- :key="item"
|
|
|
+ v-for="item in goodsList"
|
|
|
+ :key="item.id"
|
|
|
>
|
|
|
- <p class="item-title line2">
|
|
|
- 鲁花花生油鲁花花生油最多两行鲁花花生油鲁花花生油最多两行
|
|
|
+ <p class="item-title line1">
|
|
|
+ {{ item.goodsName }}
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <div class="cb22 item-money">
|
|
|
+ ¥{{ item.specialPrice | formatPrice }}
|
|
|
+ +
|
|
|
+ {{ backIntegral(item) }}
|
|
|
+ <span> 积分 </span>
|
|
|
+ </div>
|
|
|
+ <p class="c99">
|
|
|
+ 原价:<span class="text-line">{{
|
|
|
+ item.standPrice | formatPrice
|
|
|
+ }}</span
|
|
|
+ >元
|
|
|
</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>
|
|
|
@@ -37,7 +50,8 @@
|
|
|
title="筛选分类"
|
|
|
:isShow.sync="isShow"
|
|
|
@open="open"
|
|
|
- @submit="submitForm"
|
|
|
+ @submit="handelCategory(dislogCategoryId)"
|
|
|
+ confirmName="确 认"
|
|
|
width="850px"
|
|
|
>
|
|
|
<div class="treeBox">
|
|
|
@@ -48,6 +62,7 @@
|
|
|
:defaultId="item.pId"
|
|
|
:treeList="item.list"
|
|
|
@more="handelShowMore"
|
|
|
+ @nodeClick="dialogHandelCategory"
|
|
|
width="185px"
|
|
|
></category-tree>
|
|
|
</div>
|
|
|
@@ -58,6 +73,7 @@
|
|
|
<script>
|
|
|
import { mapGetters } from "vuex";
|
|
|
import CategoryTree from "./tree.vue";
|
|
|
+import { goodslistPoints } from "../../../api/goods/index";
|
|
|
export default {
|
|
|
name: "SaasMemberGoodsList",
|
|
|
props: {
|
|
|
@@ -143,20 +159,33 @@ export default {
|
|
|
ids: [1],
|
|
|
isShow: false,
|
|
|
treeArr: [],
|
|
|
+ formData: {
|
|
|
+ pageSize: 10,
|
|
|
+ pageNum: 1,
|
|
|
+ categoryId: 0,
|
|
|
+ goodsName: undefined,
|
|
|
+ },
|
|
|
+ goodsList: [],
|
|
|
+ loading: false,
|
|
|
+ dislogCategoryId: "",
|
|
|
};
|
|
|
},
|
|
|
|
|
|
- mounted() {},
|
|
|
+ mounted() {
|
|
|
+ this.getGoodsList();
|
|
|
+ },
|
|
|
|
|
|
methods: {
|
|
|
open() {},
|
|
|
submitForm() {},
|
|
|
select(item) {
|
|
|
- const index = this.selectedList.findIndex((e) => e.id == item);
|
|
|
+ const index = this.selectedList.findIndex(
|
|
|
+ (e) => e.goodsId == item.goodsId
|
|
|
+ );
|
|
|
if (index != -1) {
|
|
|
this.selectedList.splice(index, 1);
|
|
|
} else {
|
|
|
- this.selectedList.push({ id: item });
|
|
|
+ this.selectedList.push(item);
|
|
|
}
|
|
|
},
|
|
|
handelShowMore(data, index) {
|
|
|
@@ -175,12 +204,38 @@ export default {
|
|
|
}
|
|
|
this.isShow = true;
|
|
|
},
|
|
|
+ getGoodsList() {
|
|
|
+ this.loading = true;
|
|
|
+ goodslistPoints(this.formData)
|
|
|
+ .then((res) => {
|
|
|
+ this.goodsList = res.rows;
|
|
|
+ this.total = res.total;
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ dialogHandelCategory(categoryId) {
|
|
|
+ this.dislogCategoryId = categoryId;
|
|
|
+ },
|
|
|
+ handelCategory(categoryId) {
|
|
|
+ if (this.formData.categoryId == categoryId) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.formData.categoryId = categoryId;
|
|
|
+ this.getGoodsList();
|
|
|
+ },
|
|
|
+ backIntegral(item) {
|
|
|
+ return (item._integral = parseInt(
|
|
|
+ (item.standPrice - item.specialPrice) * this.getRules
|
|
|
+ ));
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
activeIds() {
|
|
|
- return this.selectedList.map((e) => e.id);
|
|
|
+ return this.selectedList.map((e) => e.goodsId);
|
|
|
},
|
|
|
- ...mapGetters(["categoryList"]),
|
|
|
+ ...mapGetters(["categoryList", "getRules"]),
|
|
|
},
|
|
|
components: {
|
|
|
CategoryTree,
|
|
|
@@ -194,12 +249,8 @@ export default {
|
|
|
margin-top: 16px;
|
|
|
height: 100%;
|
|
|
.good-list {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
flex: 1;
|
|
|
margin-left: 20px;
|
|
|
- flex-wrap: wrap;
|
|
|
- align-content: flex-start;
|
|
|
height: calc(100vh - 230px);
|
|
|
overflow-x: auto;
|
|
|
p {
|
|
|
@@ -208,9 +259,7 @@ export default {
|
|
|
}
|
|
|
.good-list-item {
|
|
|
cursor: pointer;
|
|
|
- float: left;
|
|
|
- width: 48%;
|
|
|
- height: 182px;
|
|
|
+ height: 118px;
|
|
|
background: #f6f7f9;
|
|
|
border-radius: 12px;
|
|
|
padding: 16px;
|
|
|
@@ -220,11 +269,16 @@ export default {
|
|
|
.item-title {
|
|
|
color: #4a4a4b;
|
|
|
font-size: 18px;
|
|
|
- margin-bottom: 8px;
|
|
|
}
|
|
|
.item-money {
|
|
|
font-size: 20px;
|
|
|
- margin: 14px 0 6px;
|
|
|
+ margin: 10px 0 4px -3px;
|
|
|
+ color: #eb5757;
|
|
|
+ font-weight: bold;
|
|
|
+ span {
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|