Browse Source

fix: 商品图与检索

Sun 3 năm trước cách đây
mục cha
commit
192df5b2b1
1 tập tin đã thay đổi với 18 bổ sung3 xóa
  1. 18 3
      src/views/business/goods/index.vue

+ 18 - 3
src/views/business/goods/index.vue

@@ -52,9 +52,15 @@
     </el-row>
     <el-table v-loading="loading" :data="tableData">
       <el-table-column label="商品ID" prop="goodsId" width="60" />
-      <el-table-column label="商品图片" prop="picUrl" align="center" width="80">
+      <el-table-column label="商品图片" prop="picUrl" align="center">
         <template slot-scope="{row}">
-          <a target="_black" v-if="row.picUrl && row.picUrl.split(',').length > 0" :href="`${IMG_URL + row.picUrl}`"><img :src="`${IMG_URL + row.picUrl.split(',')[0]}`" style="max-height: 37px;max-width: 54px"></a>
+          <div v-if="row.picUrl">
+            <el-image
+              style="width: 100px; height: 100px"
+              :src="IMG_URL + row.picUrl.split(',')[0]"
+              :preview-src-list="row.picUrl.split(',').map(item => { return IMG_URL + item })"
+            />
+          </div>
           <span v-else>-</span>
         </template>
       </el-table-column>
@@ -98,6 +104,7 @@
 <script>
 import { publicFileGetUrl } from "@/api/common"
 import { getGoodsList, delGoods, setGoodsStatus } from '@/api/business/goods'
+import { accMul } from '@/utils/util'
 export default {
   name: 'GoodsList',
   data() {
@@ -122,7 +129,15 @@ export default {
       if (reset) {
         this.queryParams = { pageNum: 1, pageSize: 20 }
       }
-      getGoodsList('pageNum='+this.queryParams.pageNum + '&pageSize='+this.queryParams.pageSize+'&', this.queryParams).then(res => {
+      getGoodsList('pageNum='+this.queryParams.pageNum + '&pageSize='+this.queryParams.pageSize+'&', {
+        title: this.queryParams.title,
+        goodsId: this.queryParams.goodsId,
+        status: this.queryParams.status,
+        minCost: accMul(this.queryParams.minCost, 100),
+        maxCost: accMul(this.queryParams.maxCost, 100),
+        minValue: accMul(this.queryParams.minValue, 100),
+        maxValue: accMul(this.queryParams.maxValue, 100)
+      }).then(res => {
         this.loading = false
         if (res.code === 0) {
           this.tableData = res.rows