瀏覽代碼

修改商品评价组件

YY 2 年之前
父節點
當前提交
69cd6b5433

src/views/selfShop/goodsRate/detail.vue → src/components/rateParts/detail.vue


src/views/platmanag/goodsRate/parts/search-1.vue → src/components/rateParts/parts/search-1.vue


+ 0 - 7
src/router/module/platmanag.js

@@ -35,13 +35,6 @@ export default [
     meta: { title: '平台管理-商品评价' },
     component: () => import('@/views/platmanag/goodsRate/index.vue'),
   },
-  {
-    path: '/platmanag/goodsRate/detail',
-    name: 'platmanag_goodsRate_details',
-    meta: { title: '平台管理-商品评价' },
-    component: () => import('@/views/platmanag/goodsRate/detail.vue'),
-  },
-
   {
     path: '/platmanag/storeAcc',
     name: 'platmanag_storeAcc',

+ 0 - 6
src/router/module/selfShop.js

@@ -35,12 +35,6 @@ export default [
     meta: { title: '自营店铺-商品评价' },
     component: () => import('@/views/selfShop/goodsRate/index.vue'),
   },
-  {
-    path: '/selfShop/goodsRate/detail',
-    name: 'selfShop_goodsRate_details',
-    meta: { title: '自营店铺-商品评价' },
-    component: () => import('@/views/selfShop/goodsRate/detail.vue'),
-  },
   {
     path: '/selfShop/bill',
     name: 'selfShop_bill',

+ 0 - 207
src/views/platmanag/goodsRate/detail.vue

@@ -1,207 +0,0 @@
-<template>
-  <div id="form-1">
-    <el-row>
-      <el-col
-        :span="24"
-        class="main animate__animated animate__backInRight"
-        v-loading="loadings"
-        element-loading-text="拼命加载中"
-        element-loading-spinner="el-icon-loading"
-      >
-        <el-col class="top-btn">
-          <el-button type="primary" size="mini" @click="toBack()">返回</el-button>
-        </el-col>
-        <el-col :span="24" v-if="total == 0">
-          <el-empty description="该商品暂无评价"></el-empty>
-        </el-col>
-        <el-col :span="24" class="one" v-else-if="!total == 0">
-          <el-col :span="24" class="one_2">
-            <el-col :span="24" class="cont" v-for="(item, index) in list" :key="index">
-              <el-col :span="3" class="name">
-                <el-image class="icon" :src="getCheck()"></el-image>
-                <el-col>{{ getName() }}</el-col>
-              </el-col>
-              <el-col :span="21">
-                <el-col :span="24">
-                  <el-col :span="5">
-                    <el-col :span="8">商品评分:</el-col>
-                    <el-col :span="15"><el-rate v-model="item.goods_score" disabled score-template="{item.goods_score}" :colors="colors"> </el-rate></el-col>
-                  </el-col>
-                  <el-col :span="5">
-                    <el-col :span="8">店铺评分:</el-col>
-                    <el-col :span="15"><el-rate v-model="item.shop_score" disabled score-template="{item.shop_score}" :colors="colors"> </el-rate></el-col>
-                  </el-col>
-                  <el-col :span="5">
-                    <el-col :span="8">快递评分:</el-col>
-                    <el-col :span="15">
-                      <el-rate v-model="item.transport_score" disabled score-template="{item.transport_score}" :colors="colors"> </el-rate>
-                    </el-col>
-                  </el-col>
-                </el-col>
-                <el-col>已购规格:{{ item.goodsSpec.name }}</el-col>
-                <el-col v-for="(replys, index) in item.reply" :key="index">
-                  <el-col :span="22" class="rate">买家评价: {{ replys.content }}</el-col>
-                  <el-col v-for="(file, index) in replys.file" :key="index" :span="3">
-                    <el-image :src="file.url" class="image" :preview-src-list="replys.url"></el-image>
-                  </el-col>
-                  <el-col :span="22" class="rates">商家回复:{{ replys.reply }}</el-col>
-                  <el-col style="color: #999">{{ replys.time }}</el-col>
-                </el-col>
-              </el-col>
-            </el-col>
-          </el-col>
-          <el-col :span="24" class="pag">
-            <el-pagination
-              background
-              @size-change="handleCurrentChange"
-              @current-change="currentChange"
-              :current-page.sync="skip"
-              :page-sizes="[10, 50, 100, 150, 200]"
-              :page-size="limit"
-              layout="sizes,total, prev, pager, next"
-              :total="total"
-            >
-            </el-pagination>
-          </el-col>
-        </el-col>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-const _ = require('lodash');
-const moment = require('moment');
-import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
-const { mapActions } = createNamespacedHelpers('goodsRate');
-
-export default {
-  name: 'form-1',
-  props: { id: { type: String } },
-  components: {},
-  data: function () {
-    return {
-      loadings: true,
-      list: [],
-      goods: {},
-      skip: 1,
-      total: 0,
-      limit: 50,
-      // 评分颜色
-      colors: ['#99A9BF', '#F7BA2A', '#FF0000'],
-    };
-  },
-  async created() {
-    await this.search();
-  },
-  methods: {
-    ...mapActions(['query', 'fetch', 'create', 'update']),
-    // 查询
-    async search({ skip = 0, limit = this.limit, ...info } = {}) {
-      info.goods = this.id;
-      let res;
-      res = await this.query({ skip, limit, ...info });
-      if (this.$checkRes(res)) {
-        for (const p1 of res.data) {
-          for (const p2 of p1.reply) {
-            let url = [];
-            if (p2.file) {
-              for (const p3 of p2.file) {
-                url.push(p3.url);
-              }
-              p2.url = url;
-            }
-          }
-        }
-        this.$set(this, 'list', res.data);
-        this.$set(this, 'total', res.total);
-      }
-      this.loadings = false;
-    },
-    getCheck() {
-      for (const p1 of this.list) {
-        return _.get(p1.customer, 'icon[0].url');
-      }
-    },
-    getName() {
-      for (const p1 of this.list) {
-        return _.get(p1.customer, 'name');
-      }
-    },
-    // 分页
-    currentChange(val) {
-      this.search({ skip: (val - 1) * this.limit });
-    },
-    handleCurrentChange(val) {
-      this.$set(this, 'limit', val);
-      this.search();
-    },
-    // 返回
-    toBack() {
-      this.$emit('toBack');
-    },
-  },
-  computed: {},
-  metaInfo() {
-    return { title: this.$route.meta.title };
-  },
-  watch: {
-    test: {
-      deep: true,
-      immediate: true,
-      handler(val) {},
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped>
-.el-col {
-  margin: 2px 0;
-}
-.one {
-  margin: 20px 0 0 0;
-  .one_1 {
-    margin: 15px 0;
-    padding: 10px;
-  }
-  .one_2 {
-    border: 1px solid #ccc;
-    padding: 10px;
-    .cont {
-      border-bottom: 1px solid rgb(238, 237, 237);
-      margin: 10px 0;
-      padding: 0 10px 10px 10px;
-      .name {
-        text-align: center;
-        .icon {
-          border-radius: 50%;
-          width: 100px;
-          height: 100px;
-        }
-      }
-      .image {
-        width: 100px;
-        height: 100px;
-        border: 1px solid #ccc;
-      }
-      .rate {
-        width: 91%;
-        color: red;
-        word-break: break-all;
-      }
-      .rates {
-        width: 91%;
-        word-break: break-all;
-      }
-      .btn {
-        margin: 8px 15px;
-      }
-    }
-  }
-  .pag {
-    text-align: right;
-    margin: 10px 0;
-  }
-}
-</style>

+ 3 - 3
src/views/platmanag/goodsRate/index.vue

@@ -32,8 +32,8 @@ export default {
   name: 'index',
   props: {},
   components: {
-    search1: () => import('./parts/search-1.vue'),
-    detail: () => import('./detail.vue'),
+    search1: () => import('@/components/rateParts/parts/search-1.vue'),
+    detail: () => import('@/components/rateParts/detail.vue'),
   },
   data: function () {
     const that = this;
@@ -44,7 +44,7 @@ export default {
       opera: [{ label: '查看评价', method: 'edit' }],
       fields: [
         { label: '商品名称', model: 'name', showTip: false },
-        { label: '店铺名称', model: 'shop.name' },
+        // { label: '店铺名称', model: 'shop.name' },
       ],
       list: [],
       total: 0,

+ 3 - 3
src/views/selfShop/goodsRate/index.vue

@@ -32,8 +32,8 @@ export default {
   name: 'index',
   props: {},
   components: {
-    search1: () => import('./parts/search-1.vue'),
-    detail: () => import('./detail.vue'),
+    search1: () => import('@/components/rateParts/parts/search-1.vue'),
+    detail: () => import('@/components/rateParts/detail.vue'),
   },
   data: function () {
     const that = this;
@@ -44,7 +44,7 @@ export default {
       opera: [{ label: '查看评价', method: 'edit' }],
       fields: [
         { label: '商品名称', model: 'name', showTip: false },
-        { label: '店铺名称', model: 'shop.name' },
+        // { label: '店铺名称', model: 'shop.name' },
       ],
       list: [],
       total: 0,

+ 0 - 65
src/views/selfShop/goodsRate/parts/search-1.vue

@@ -1,65 +0,0 @@
-<template>
-  <div id="search-1">
-    <el-row>
-      <el-col :span="24" class="main">
-        <el-form :model="form" ref="form" label-width="130px">
-          <el-col :span="6">
-            <el-form-item label="名称" prop="name">
-              <el-input v-model="form.name" placeholder="请输入名称" size="small"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24" class="btn">
-            <el-button type="primary" icon="el-icon-search" size="mini" @click="onSubmit('form')">搜索</el-button>
-            <el-button icon="el-icon-refresh" size="mini" @click="toReset('form')">重置</el-button>
-          </el-col>
-        </el-form>
-      </el-col>
-    </el-row>
-  </div>
-</template>
-
-<script>
-import { mapState, createNamespacedHelpers } from 'vuex';
-export default {
-  name: 'search-1',
-  props: { form: { type: Object }, typeList: { type: Array } },
-  components: {},
-  data: function () {
-    return {};
-  },
-  created() {},
-  methods: {
-    onSubmit() {
-      this.$emit('onSubmit');
-    },
-    toReset(formName) {
-      this.$refs[formName].resetFields();
-      this.$emit('toReset');
-    },
-  },
-  computed: {},
-  metaInfo() {
-    return { title: this.$route.meta.title };
-  },
-  watch: {
-    test: {
-      deep: true,
-      immediate: true,
-      handler(val) {},
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped>
-.main {
-  .btn {
-    text-align: right;
-  }
-  /deep/.el-form-item {
-    float: left;
-    width: 100%;
-    margin: 0 0 10px 0;
-  }
-}
-</style>