Commit d104f1c572aa5ba5c93594745911162e17930a24

Authored by franky
1 parent abbfbd5f

spu 页面优化

yudao-ui-admin/src/views/mall/product/spu/index.vue
@@ -55,15 +55,19 @@ @@ -55,15 +55,19 @@
55 <el-table v-loading="loading" :data="list"> 55 <el-table v-loading="loading" :data="list">
56 <el-table-column label="主键" align="center" prop="id"/> 56 <el-table-column label="主键" align="center" prop="id"/>
57 <el-table-column label="商品名称" align="center" prop="name"/> 57 <el-table-column label="商品名称" align="center" prop="name"/>
58 - <el-table-column label="卖点" align="center" prop="sellPoint"/>  
59 - <el-table-column label="描述" align="center" prop="description"/> 58 +<!-- <el-table-column label="卖点" align="center" prop="sellPoint"/>-->
  59 +<!-- <el-table-column label="描述" align="center" prop="description"/>-->
60 <el-table-column label="分类id" align="center" prop="categoryId"/> 60 <el-table-column label="分类id" align="center" prop="categoryId"/>
61 - <el-table-column label="商品主图地址" align="center" prop="picUrls"/> 61 + <el-table-column label="商品主图地址" align="center" prop="picUrls">
  62 + <template slot-scope="scope">
  63 + <img v-if="scope.row.picUrls" :src="scope.row.picUrls[0]" alt="分类图片" class="img-height"/>
  64 + </template>
  65 + </el-table-column>
62 <el-table-column label="排序字段" align="center" prop="sort"/> 66 <el-table-column label="排序字段" align="center" prop="sort"/>
63 <el-table-column label="点赞初始人数" align="center" prop="likeCount"/> 67 <el-table-column label="点赞初始人数" align="center" prop="likeCount"/>
64 <el-table-column label="价格 (分)" align="center" prop="price"/> 68 <el-table-column label="价格 (分)" align="center" prop="price"/>
65 <el-table-column label="库存数量" align="center" prop="quantity"/> 69 <el-table-column label="库存数量" align="center" prop="quantity"/>
66 - <el-table-column label="状态" align="center" prop="status"/> 70 +<!-- <el-table-column label="状态" align="center" prop="status"/>-->
67 <el-table-column label="创建时间" align="center" prop="createTime" width="180"> 71 <el-table-column label="创建时间" align="center" prop="createTime" width="180">
68 <template slot-scope="scope"> 72 <template slot-scope="scope">
69 <span>{{ parseTime(scope.row.createTime) }}</span> 73 <span>{{ parseTime(scope.row.createTime) }}</span>
@@ -85,7 +89,7 @@ @@ -85,7 +89,7 @@
85 @pagination="getList"/> 89 @pagination="getList"/>
86 90
87 <!-- 对话框(添加 / 修改) --> 91 <!-- 对话框(添加 / 修改) -->
88 - <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body> 92 + <el-dialog :title="title" :visible.sync="open" width="1500px" append-to-body>
89 <el-form ref="form" :model="form" :rules="rules" label-width="80px"> 93 <el-form ref="form" :model="form" :rules="rules" label-width="80px">
90 <el-form-item label="商品名称" prop="name"> 94 <el-form-item label="商品名称" prop="name">
91 <el-input v-model="form.name" placeholder="请输入商品名称"/> 95 <el-input v-model="form.name" placeholder="请输入商品名称"/>
@@ -240,7 +244,7 @@ @@ -240,7 +244,7 @@
240 <el-table-column 244 <el-table-column
241 label="操作"> 245 label="操作">
242 <template slot-scope="scope"> 246 <template slot-scope="scope">
243 - <el-button type="text" size="small" @click="changeSkuStatus(`${scope.$index}`)" v-if="scope.row.status==0"> 247 + <el-button type="text" size="small" @click="changeSkuStatus(`${scope.$index}`)" v-if="scope.row.status===0">
244 正常 248 正常
245 </el-button> 249 </el-button>
246 <el-button type="text" size="small" @click="changeSkuStatus(`${scope.$index}`)" v-else>已禁用</el-button> 250 <el-button type="text" size="small" @click="changeSkuStatus(`${scope.$index}`)" v-else>已禁用</el-button>
@@ -438,7 +442,7 @@ @@ -438,7 +442,7 @@
438 this.addTagInput.propertyId = this.unUseTags[index].id; 442 this.addTagInput.propertyId = this.unUseTags[index].id;
439 for (let i = 0; i < this.addTagInput.selectValues.length; i++) { 443 for (let i = 0; i < this.addTagInput.selectValues.length; i++) {
440 for (let j = 0; j < this.unUseTags[index].propertyValueList.length; j++) { 444 for (let j = 0; j < this.unUseTags[index].propertyValueList.length; j++) {
441 - if (this.addTagInput.selectValues[i] == this.unUseTags[index].propertyValueList[j].name) { 445 + if (this.addTagInput.selectValues[i] === this.unUseTags[index].propertyValueList[j].name) {
442 this.addTagInput.selectValueIds.push(this.unUseTags[index].propertyValueList[j].id) 446 this.addTagInput.selectValueIds.push(this.unUseTags[index].propertyValueList[j].id)
443 } 447 }
444 } 448 }
@@ -629,6 +633,7 @@ @@ -629,6 +633,7 @@
629 this.reset(); 633 this.reset();
630 const id = row.id; 634 const id = row.id;
631 getSpu(id).then(response => { 635 getSpu(id).then(response => {
  636 + console.log(">>>>>> response.data:" + JSON.stringify(response.data))
632 let dataSpu = response.data; 637 let dataSpu = response.data;
633 this.form = { 638 this.form = {
634 id: dataSpu.id, 639 id: dataSpu.id,
@@ -642,9 +647,9 @@ @@ -642,9 +647,9 @@
642 likeCount: dataSpu.likeCount, 647 likeCount: dataSpu.likeCount,
643 price: dataSpu.price, 648 price: dataSpu.price,
644 quantity: dataSpu.quantity, 649 quantity: dataSpu.quantity,
645 - status: dataSpu.status, 650 + // status: dataSpu.status,
646 isShowTagInput:undefined, 651 isShowTagInput:undefined,
647 - skus:dataSpu.productSkuRespVOS, 652 + // skus:dataSpu.productSkuRespVOS,
648 }; 653 };
649 this.open = true; 654 this.open = true;
650 this.title = "修改商品spu"; 655 this.title = "修改商品spu";
@@ -728,5 +733,9 @@ @@ -728,5 +733,9 @@
728 margin-left: 10px; 733 margin-left: 10px;
729 vertical-align: bottom; 734 vertical-align: bottom;
730 } 735 }
  736 +
  737 + .img-height {
  738 + height: 65px;
  739 + }
731 } 740 }
732 </style> 741 </style>