|
@@ -1,10 +1,22 @@
|
|
<template>
|
|
<template>
|
|
<div id="form-1">
|
|
<div id="form-1">
|
|
<el-row>
|
|
<el-row>
|
|
- <el-col :span="24" class="main animate__animated animate__backInRight">
|
|
|
|
|
|
+ <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-col class="top-btn">
|
|
<el-button type="primary" size="mini" @click="toBack()">返回</el-button>
|
|
<el-button type="primary" size="mini" @click="toBack()">返回</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+ <el-col :span="24" class="goods">
|
|
|
|
+ <el-col :span="24" class="goods_name">{{ goods.name }}</el-col>
|
|
|
|
+ <el-col v-for="(item, index) in goods.file" :key="index" :span="2">
|
|
|
|
+ <el-image :src="item.url" class="image" :preview-src-list="getUrl()"></el-image>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-col>
|
|
<el-col :span="24" v-if="total == 0">
|
|
<el-col :span="24" v-if="total == 0">
|
|
<el-empty description="该商品暂无评价"></el-empty>
|
|
<el-empty description="该商品暂无评价"></el-empty>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -59,7 +71,7 @@
|
|
@size-change="handleCurrentChange"
|
|
@size-change="handleCurrentChange"
|
|
@current-change="currentChange"
|
|
@current-change="currentChange"
|
|
:current-page.sync="skip"
|
|
:current-page.sync="skip"
|
|
- :page-sizes="[10, 50, 100, 150, 200]"
|
|
|
|
|
|
+ :page-sizes="[1, 10, 50, 100, 150, 200]"
|
|
:page-size="limit"
|
|
:page-size="limit"
|
|
layout="sizes,total, prev, pager, next"
|
|
layout="sizes,total, prev, pager, next"
|
|
:total="total"
|
|
:total="total"
|
|
@@ -77,6 +89,7 @@ const _ = require('lodash');
|
|
const moment = require('moment');
|
|
const moment = require('moment');
|
|
import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
|
|
const { mapActions } = createNamespacedHelpers('goodsRate');
|
|
const { mapActions } = createNamespacedHelpers('goodsRate');
|
|
|
|
+const { mapActions: goods } = createNamespacedHelpers('goods');
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'form-1',
|
|
name: 'form-1',
|
|
@@ -84,6 +97,7 @@ export default {
|
|
components: {},
|
|
components: {},
|
|
data: function () {
|
|
data: function () {
|
|
return {
|
|
return {
|
|
|
|
+ loadings: true,
|
|
list: [],
|
|
list: [],
|
|
goods: {},
|
|
goods: {},
|
|
skip: 1,
|
|
skip: 1,
|
|
@@ -98,19 +112,22 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
|
|
+ ...goods({ goodsFetch: 'fetch' }),
|
|
// 查询
|
|
// 查询
|
|
async search({ skip = 0, limit = this.limit, ...info } = {}) {
|
|
async search({ skip = 0, limit = this.limit, ...info } = {}) {
|
|
info.goods = this.id;
|
|
info.goods = this.id;
|
|
let res;
|
|
let res;
|
|
|
|
+ res = await this.goodsFetch(this.id);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, 'goods', res.data);
|
|
|
|
+ }
|
|
res = await this.query({ skip, limit, ...info });
|
|
res = await this.query({ skip, limit, ...info });
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
for (const p1 of res.data) {
|
|
for (const p1 of res.data) {
|
|
for (const p2 of p1.reply) {
|
|
for (const p2 of p1.reply) {
|
|
let url = [];
|
|
let url = [];
|
|
if (p2.file) {
|
|
if (p2.file) {
|
|
- for (const p3 of p2.file) {
|
|
|
|
- url.push(p3.url);
|
|
|
|
- }
|
|
|
|
|
|
+ for (const p3 of p2.file) url.push(p3.url);
|
|
p2.url = url;
|
|
p2.url = url;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -118,12 +135,21 @@ export default {
|
|
this.$set(this, 'list', res.data);
|
|
this.$set(this, 'list', res.data);
|
|
this.$set(this, 'total', res.total);
|
|
this.$set(this, 'total', res.total);
|
|
}
|
|
}
|
|
|
|
+ this.loadings = false;
|
|
},
|
|
},
|
|
getCheck() {
|
|
getCheck() {
|
|
for (const p1 of this.list) {
|
|
for (const p1 of this.list) {
|
|
return _.get(p1.customer, 'icon[0].url');
|
|
return _.get(p1.customer, 'icon[0].url');
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ getUrl() {
|
|
|
|
+ let goods = this.goods;
|
|
|
|
+ let list = [];
|
|
|
|
+ for (const p1 of goods.file) {
|
|
|
|
+ list.push(p1.url);
|
|
|
|
+ }
|
|
|
|
+ return list;
|
|
|
|
+ },
|
|
getName() {
|
|
getName() {
|
|
for (const p1 of this.list) {
|
|
for (const p1 of this.list) {
|
|
return _.get(p1.customer, 'name');
|
|
return _.get(p1.customer, 'name');
|
|
@@ -192,6 +218,23 @@ export default {
|
|
.el-col {
|
|
.el-col {
|
|
margin: 2px 0;
|
|
margin: 2px 0;
|
|
}
|
|
}
|
|
|
|
+.goods {
|
|
|
|
+ border: 1px solid rgb(255, 181, 181);
|
|
|
|
+ margin: 10px 0;
|
|
|
|
+ padding: 0 10px 10px 10px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ .goods_name {
|
|
|
|
+ margin: 10px;
|
|
|
|
+ font-size: 20px;
|
|
|
|
+ color: rgb(210, 69, 30);
|
|
|
|
+ }
|
|
|
|
+ .image {
|
|
|
|
+ width: 100px;
|
|
|
|
+ height: 100px;
|
|
|
|
+ border: 1px solid #ccc;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
.one {
|
|
.one {
|
|
margin: 20px 0 0 0;
|
|
margin: 20px 0 0 0;
|
|
.one_1 {
|
|
.one_1 {
|