guhongwei 5 年之前
父节点
当前提交
5a7b8c5215

+ 42 - 4
src/views/userCenter/eventInfo/index.vue

@@ -2,7 +2,23 @@
   <div id="index">
     <el-row>
       <el-col :span="24">
-        事项管理
+        <el-col :span="24" class="leftTop"> <span>|</span> <span>事项管理</span> </el-col>
+        <el-col :span="24" class="info">
+          <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+            <el-tab-pane label="我的全部" name="first">
+              我的全部
+            </el-tab-pane>
+            <el-tab-pane label="我的洽谈" name="second">
+              我的洽谈
+            </el-tab-pane>
+            <el-tab-pane label="我的意向" name="third">
+              我的意向
+            </el-tab-pane>
+            <el-tab-pane label="我的交易" name="fourth">
+              我的交易
+            </el-tab-pane>
+          </el-tabs>
+        </el-col>
       </el-col>
     </el-row>
   </div>
@@ -15,10 +31,16 @@ export default {
   props: {},
   components: {},
   data: function() {
-    return {};
+    return {
+      activeName: 'first',
+    };
   },
   created() {},
-  methods: {},
+  methods: {
+    handleClick(tab, event) {
+      console.log(tab, event);
+    },
+  },
   computed: {
     ...mapState(['user']),
     pageTitle() {
@@ -31,4 +53,20 @@ export default {
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.leftTop {
+  font-size: 18px;
+  width: 96%;
+  height: 41px;
+  line-height: 35px;
+  border-bottom: 1px solid #e5e5e5;
+  position: relative;
+  bottom: 1px;
+  margin: 10px;
+  font-weight: 600;
+  color: #22529a;
+}
+.info {
+  padding: 0 40px 0 10px;
+}
+</style>

+ 138 - 5
src/views/userCenter/productInfo/index.vue

@@ -2,23 +2,132 @@
   <div id="index">
     <el-row>
       <el-col :span="24">
-        我的发布
+        <el-col :span="24" class="leftTop"> <span>|</span> <span>我的发布</span> </el-col>
+        <el-col :span="24" class="info">
+          <el-col :span="24" class="infoOne" v-if="display">
+            <el-tabs v-model="activeName" type="card">
+              <el-tab-pane label="待发布" name="first">
+                <stay @editBtn="editBtn"></stay>
+              </el-tab-pane>
+              <el-tab-pane label="审核中" name="second">
+                <statusIn></statusIn>
+              </el-tab-pane>
+              <el-tab-pane label="已发布" name="third">
+                <already></already>
+              </el-tab-pane>
+            </el-tabs>
+            <el-button type="primary" size="mini" class="add" @click="add">信息发布</el-button>
+          </el-col>
+          <el-col :span="24" class="infoTwo" v-else>
+            <infoRelease @back="back" :form="form" :product_args="product_args" @draftBtn="draftBtn" @submitBtn="submitBtn"></infoRelease>
+          </el-col>
+        </el-col>
       </el-col>
     </el-row>
   </div>
 </template>
 
 <script>
+import stay from './part/stay.vue';
+import statusIn from './part/statusIn.vue';
+import already from './part/already.vue';
+import infoRelease from './part/infoRelease.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: mapMarketproduct } = createNamespacedHelpers('marketproduct');
 export default {
   name: 'index',
   props: {},
-  components: {},
+  components: {
+    stay, //待发布
+    statusIn, //审核中
+    already, //已发布
+    infoRelease, //信息发布
+  },
   data: function() {
-    return {};
+    return {
+      activeName: 'first',
+      // 发布信息
+      display: true,
+      form: {},
+      product_args: [],
+    };
   },
   created() {},
-  methods: {},
+  methods: {
+    ...mapMarketproduct({ productFetch: 'fetch', productCreate: 'create', productUpdate: 'update' }),
+    // 保存草稿
+    async draftBtn({ data }) {
+      data.product_args = this.product_args;
+      data.userid = this.user.uid;
+      if (data.id) {
+        let res = await this.productUpdate(data);
+        if (this.$checkRes(res)) {
+          this.$message({
+            message: '草稿修改成功',
+            type: 'success',
+          });
+          window.location.reload();
+        } else {
+          this.$message.error('草稿保存失败');
+        }
+      } else {
+        let res = await this.productCreate(data);
+        if (this.$checkRes(res)) {
+          this.$message({
+            message: '草稿创建成功',
+            type: 'success',
+          });
+          window.location.reload();
+        } else {
+          this.$message.error('草稿创建失败');
+        }
+      }
+    },
+    // 信息发布
+    async submitBtn({ data }) {
+      if (data.id) {
+        data.status = '0';
+        data.userid = this.user.uid;
+        let res = await this.productUpdate(data);
+        if (this.$checkRes(res)) {
+          this.$message({
+            message: '信息发布成功',
+            type: 'success',
+          });
+          window.location.reload();
+        } else {
+          this.$message.error('信息发布失败');
+        }
+      } else {
+        data.status = '0';
+        data.userid = this.user.uid;
+        let res = await this.productCreate(data);
+        if (this.$checkRes(res)) {
+          this.$message({
+            message: '信息发布成功',
+            type: 'success',
+          });
+          window.location.reload();
+        } else {
+          this.$message.error('信息发布失败');
+        }
+      }
+    },
+    // 信息发布
+    add() {
+      this.display = false;
+    },
+    // 返回
+    back() {
+      this.display = true;
+    },
+    // 修改信息
+    editBtn(data) {
+      this.$set(this, `form`, data);
+      this.$set(this, `product_args`, data.product_args);
+      this.display = false;
+    },
+  },
   computed: {
     ...mapState(['user']),
     pageTitle() {
@@ -31,4 +140,28 @@ export default {
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.leftTop {
+  font-size: 18px;
+  width: 96%;
+  height: 41px;
+  line-height: 35px;
+  border-bottom: 1px solid #e5e5e5;
+  position: relative;
+  bottom: 1px;
+  margin: 10px;
+  font-weight: 600;
+  color: #22529a;
+}
+.info {
+  padding: 0 40px 0 10px;
+  .infoOne {
+    position: relative;
+    .add {
+      position: absolute;
+      top: 0;
+      right: 0;
+    }
+  }
+}
+</style>

+ 189 - 0
src/views/userCenter/productInfo/part/already.vue

@@ -0,0 +1,189 @@
+<template>
+  <div id="already">
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
+          <el-col :span="24" class="top">
+            <span class="textOver">{{ item.name }}</span>
+            <span>{{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}</span>
+          </el-col>
+          <el-col :span="24" class="down">
+            <el-col :span="3" class="image">
+              <el-col :span="24" v-for="(acm, index) in item.image" :key="index">
+                <template v-if="index === 0">
+                  <el-image style="width:100%;height:100px" :src="acm.url"></el-image>
+                </template>
+              </el-col>
+            </el-col>
+            <el-col :span="6" class="product">
+              <p>类别:{{ item.totaltype === '0' ? '技术' : item.totaltype === '1' ? '产品' : item.totaltype === '2' ? '服务' : 'underdind' }}</p>
+              <p class="textOver">交易方式{{ item.business == '0' ? '公用' : item.business == '1' ? '竞用' : item.business == '2' ? '转让' : '未识别' }}</p>
+              <p>{{ item.price }}/{{ item.priceunit }}</p>
+            </el-col>
+            <el-col :span="9" class="intro">
+              <p>产品简介:</p>
+              <p>{{ item.introduction }}</p>
+            </el-col>
+            <el-col :span="6" class="status">
+              <p>状态:{{ item.status === '1' ? '审核成功' : '未识别' }}</p>
+              <el-button type="danger" size="mini" @click="deleteBtn(item.id)">删除</el-button>
+            </el-col>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="page">
+          <el-pagination
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            layout="total,  prev, pager, next, jumper"
+            :total="pastTotal"
+            :page-size="pageSize"
+          >
+          </el-pagination>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: marketproduct } = createNamespacedHelpers('marketproduct');
+export default {
+  name: 'already',
+  props: {},
+  components: {},
+  data: function() {
+    return {
+      list: [],
+      pastTotal: 0,
+      currentPage: 0,
+      pageSize: 6,
+      skip: '',
+    };
+  },
+  created() {
+    this.searchInfo();
+  },
+  methods: {
+    ...marketproduct({ productList: 'query', columnInfo: 'fetch', marketcerate: 'create', productdeltet: 'delete', upup: 'update' }),
+    // 查询列表
+    async searchInfo({ skip = 0, limit = 6, ...info } = {}) {
+      skip = this.skip;
+      let userid = this.user.uid;
+      const res = await this.productList({ skip, limit, status: 1, userid, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `pastTotal`, res.total);
+      }
+    },
+    // 删除信息
+    async deleteBtn(id) {
+      let res = await this.productdeltet(id);
+      if (this.$checkRes(res)) {
+        this.$message({
+          message: '信息删除成功',
+          type: 'success',
+        });
+        this.searchInfo();
+      } else {
+        this.$message.error('信息删除失败');
+      }
+    },
+    handleCurrentChange(currentPage) {
+      this.$set(this, `skip`, (currentPage - 1) * this.pageSize);
+      this.searchInfo();
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.textOver {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.info {
+  padding: 0 0 15px 0;
+}
+.list {
+  height: 185px;
+  border: 1px solid #ccc;
+  margin: 0 0 15px 0;
+  .top {
+    height: 45px;
+    line-height: 45px;
+    background-color: #fafafa;
+    span:first-child {
+      float: left;
+      width: 74%;
+      font-size: 16px;
+      color: #888;
+      padding: 0 15px;
+    }
+    span:last-child {
+      float: right;
+      width: 20%;
+      font-size: 16px;
+      color: #888;
+      padding: 0 15px;
+      text-align: right;
+    }
+  }
+  .down {
+    padding: 18px;
+    .product {
+      height: 100px;
+      overflow: hidden;
+      padding: 0 15px;
+      border-right: 1px dashed #ccc;
+      p {
+        padding: 8px 0;
+        font-size: 14px;
+      }
+      p:last-child {
+        color: #ff0000;
+        font-weight: bold;
+      }
+    }
+    .intro {
+      height: 100px;
+      overflow: hidden;
+      font-size: 14px;
+      padding: 0 10px;
+      border-right: 1px dashed #ccc;
+      p:last-child {
+        overflow: hidden;
+        text-overflow: ellipsis;
+        -webkit-line-clamp: 4;
+        word-break: break-all;
+        display: -webkit-box;
+        -webkit-box-orient: vertical;
+      }
+    }
+    .status {
+      height: 100px;
+      text-align: center;
+      p {
+        height: 50px;
+        line-height: 50px;
+        font-size: 14px;
+        font-weight: bold;
+        color: #2d64b3;
+      }
+    }
+  }
+}
+.page {
+  text-align: center;
+}
+</style>

+ 437 - 0
src/views/userCenter/productInfo/part/infoRelease.vue

@@ -0,0 +1,437 @@
+<template>
+  <div id="infoRelease">
+    <el-row>
+      <el-col :span="24">
+        <el-col :span="24" class="back">
+          <el-button type="primary" size="mini" @click="back()">返回</el-button>
+        </el-col>
+        <el-col :span="24" class="form">
+          <el-form ref="form" :model="form" label-width="130px" :rules="rules">
+            <el-form-item label="产品类型" prop="totaltype">
+              <el-select v-model="form.totaltype" placeholder="请选择产品类型">
+                <el-option v-for="(item, index) in totaltype_list" :key="index" :value="item.value" :label="item.name"></el-option>
+              </el-select>
+            </el-form-item>
+            <span v-if="form.totaltype == 0">
+              <el-form-item label="选择不显示的信息">
+                <el-select v-model="form.is_display" multiple placeholder="请选择" style="width:100%">
+                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" :disabled="item.disabled"> </el-option>
+                </el-select>
+              </el-form-item>
+            </span>
+            <span v-if="form.totaltype == 1">
+              <el-form-item label="选择不显示的信息">
+                <el-select v-model="form.is_display" multiple placeholder="请选择" style="width:100%">
+                  <el-option v-for="item in option2" :key="item.value" :label="item.label" :value="item.value" :disabled="item.disabled"> </el-option>
+                </el-select>
+              </el-form-item>
+            </span>
+            <span v-if="form.totaltype == 2">
+              <el-form-item label="选择不显示的信息">
+                <el-select v-model="form.is_display" multiple placeholder="请选择" style="width:100%">
+                  <el-option v-for="item in option3" :key="item.value" :label="item.label" :value="item.value" :disabled="item.disabled"> </el-option>
+                </el-select>
+              </el-form-item>
+            </span>
+            <el-form-item label="产品名称" prop="name">
+              <el-input v-model="form.name" placeholder="请输入产品名称"></el-input>
+            </el-form-item>
+            <el-form-item label="类型">
+              <el-select v-model="form.product_type_id" filterable @change="selectChild">
+                <el-option v-for="(item, index) in columnList" :key="index" :value="item.id" :label="item.name"></el-option>
+              </el-select>
+            </el-form-item>
+            <span v-if="form.totaltype == 0">
+              <el-form-item label="研发阶段">
+                <el-select v-model="form.phase" placeholder="请选择研发阶段">
+                  <el-option label="阶段成果" value="1"></el-option>
+                  <el-option label="最终成果" value="2"></el-option>
+                </el-select>
+              </el-form-item>
+            </span>
+            <el-form-item label="产品简介">
+              <el-input v-model="form.introduction" placeholder="请输入产品简介"></el-input>
+            </el-form-item>
+            <el-row>
+              <el-col :span="12">
+                <el-form-item label="产品单价">
+                  <el-input v-model="form.price" placeholder="请输入产品单价"></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="产品单位">
+                  <el-select v-model="form.priceunit" placeholder="请选择产品单位">
+                    <el-option v-for="(item, index) in priceunit_list" :key="index" :label="item.name" :value="item.name"></el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+            </el-row>
+            <el-form-item label="产品图片" prop="image">
+              <!-- <upload :limit="1" :data="acc.url" type="url" :url="'/files/image/upload'" @upload="uploadSuccess"></upload> -->
+              <upload
+                :limit="6"
+                :data="form.image"
+                :uploadBtn="true"
+                type="image"
+                :url="`/files/image/upload`"
+                @upload="uploadSuccess"
+                @delete="uploadDelete"
+              ></upload>
+            </el-form-item>
+            <span v-if="form.totaltype == 0 || form.totaltype == 1">
+              <el-form-item label="产品参数">
+                <template>
+                  <el-col :span="12">
+                    <el-table :data="product_args" ref="table" tooltip-effect="dark" border stripe @selection-change="selectRow">
+                      <el-table-column label="参数名称">
+                        <template slot-scope="scope">
+                          <el-input v-model="scope.row.arg_name"></el-input>
+                        </template>
+                      </el-table-column>
+                      <el-table-column label="参数内容">
+                        <template slot-scope="scope">
+                          <el-input v-model="scope.row.memo"></el-input>
+                        </template>
+                      </el-table-column>
+                    </el-table>
+                  </el-col>
+                  <el-col :span="12">
+                    <el-button type="primary" @click.prevent="addRow()">添加参数</el-button>
+                  </el-col>
+                </template>
+              </el-form-item>
+            </span>
+            <span v-if="form.totaltype == 0 || form.totaltype == 2">
+              <el-form-item label="应用领域">
+                <el-input v-model="form.field" placeholder="请输入应用领域"></el-input>
+              </el-form-item>
+            </span>
+            <el-form-item label="服务范围">
+              <el-input type="textarea" v-model="form.scope" placeholder="请输入产品名称"></el-input>
+            </el-form-item>
+            <el-form-item label="交易方式">
+              <el-select v-model="form.business" placeholder="请选择交易方式">
+                <el-option label="公用" value="0"></el-option>
+                <el-option label="竞价" value="1"></el-option>
+                <el-option label="转让" value="2"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="联系人" prop="contact_user">
+              <el-input v-model="form.contact_user" placeholder="请输入联系人"></el-input>
+            </el-form-item>
+            <el-form-item label="联系电话" prop="contact_tel">
+              <el-input v-model="form.contact_tel" placeholder="请输入联系电话"></el-input>
+            </el-form-item>
+            <el-form-item>
+              <el-button @click="draftBtn('form')">保存草稿</el-button>
+              <el-button type="primary" @click="submitBtn('form')">信息发布</el-button>
+            </el-form-item>
+          </el-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import _ from 'lodash';
+import upload from '@/components/upload.vue';
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: mapMarkettype } = createNamespacedHelpers('markettype');
+export default {
+  name: 'infoRelease',
+  props: {
+    form: null,
+    product_args: null,
+  },
+  components: {
+    upload,
+  },
+  data: function() {
+    return {
+      // 产品类型
+      totaltype_list: [
+        { name: '技术', value: '0' },
+        { name: '产品', value: '1' },
+        { name: '服务', value: '2' },
+      ],
+      // 类型
+      columnList: [],
+      // 单位
+      priceunit_list: [
+        {
+          name: '公斤',
+        },
+        {
+          name: '套',
+        },
+        {
+          name: '件',
+        },
+      ],
+      // 不显示的信息
+      // 技术
+      options: [
+        {
+          value: 'totaltype',
+          label: '产品类型',
+          disabled: true,
+        },
+        {
+          value: 'name',
+          label: '产品名称',
+          disabled: true,
+        },
+        {
+          value: 'contact_user',
+          label: '联系人',
+          disabled: true,
+        },
+        {
+          value: 'contact_tel',
+          label: '联系人电话',
+          disabled: true,
+        },
+        {
+          value: 'product_type_id',
+          label: '类型',
+        },
+        {
+          value: 'phase',
+          label: '研发阶段',
+        },
+        {
+          value: 'introduction',
+          label: '产品简介',
+          disabled: true,
+        },
+        {
+          value: 'price',
+          label: '产品单价',
+        },
+        {
+          value: 'priceunit',
+          label: '产品单位',
+        },
+        {
+          value: 'image',
+          label: '产品图片',
+        },
+        {
+          value: 'product_args',
+          label: '产品参数',
+        },
+        {
+          value: 'field',
+          label: '应用领域',
+        },
+        {
+          value: 'scope',
+          label: '服务范围',
+        },
+        {
+          value: 'business',
+          label: '交易方式',
+        },
+      ],
+      // 产品
+      option2: [
+        {
+          value: 'totaltype',
+          label: '产品类型',
+          disabled: true,
+        },
+        {
+          value: 'name',
+          label: '产品名称',
+          disabled: true,
+        },
+        {
+          value: 'contact_user',
+          label: '联系人',
+          disabled: true,
+        },
+        {
+          value: 'contact_tel',
+          label: '联系人电话',
+          disabled: true,
+        },
+        {
+          value: 'product_type_id',
+          label: '类型',
+        },
+        {
+          value: 'introduction',
+          label: '产品简介',
+          disabled: true,
+        },
+        {
+          value: 'price',
+          label: '产品单价',
+        },
+        {
+          value: 'priceunit',
+          label: '产品单位',
+        },
+        {
+          value: 'image',
+          label: '产品图片',
+        },
+        {
+          value: 'product_args',
+          label: '产品参数',
+        },
+        {
+          value: 'scope',
+          label: '服务范围',
+        },
+        {
+          value: 'business',
+          label: '交易方式',
+        },
+      ],
+      // 服务
+      option3: [
+        {
+          value: 'totaltype',
+          label: '产品类型',
+          disabled: true,
+        },
+        {
+          value: 'name',
+          label: '产品名称',
+          disabled: true,
+        },
+        {
+          value: 'contact_user',
+          label: '联系人',
+          disabled: true,
+        },
+
+        {
+          value: 'contact_tel',
+          label: '联系人电话',
+          disabled: true,
+        },
+        {
+          value: 'product_type_id',
+          label: '类型',
+        },
+        {
+          value: 'introduction',
+          label: '产品简介',
+          disabled: true,
+        },
+        {
+          value: 'price',
+          label: '产品单价',
+        },
+        {
+          value: 'priceunit',
+          label: '产品单位',
+        },
+
+        {
+          value: 'image',
+          label: '产品图片',
+        },
+        {
+          value: 'field',
+          label: '应用领域',
+        },
+        {
+          value: 'scope',
+          label: '服务范围',
+        },
+        {
+          value: 'business',
+          label: '交易方式',
+        },
+      ],
+      // 验证
+      rules: {
+        name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
+        totaltype: [{ required: true, message: '请选择类型', trigger: 'change' }],
+        image: [{ type: 'array', required: true, message: '请上传图片', trigger: 'blur' }],
+        contact_tel: [{ required: true, message: '请输入联系电话', trigger: 'blur' }],
+        contact_user: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
+      },
+    };
+  },
+  created() {
+    // 查询类型
+    this.maarkettype();
+  },
+  methods: {
+    ...mapMarkettype({ markettypeList: 'query' }),
+    // 草稿
+    draftBtn() {
+      this.$emit('draftBtn', { data: this.form });
+    },
+    // 信息发布
+    submitBtn() {
+      this.$emit('submitBtn', { data: this.form });
+    },
+    // 查询类型
+    async maarkettype({ category = 54, ...info } = {}) {
+      const res = await this.markettypeList({ category, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `columnList`, res.data);
+      }
+    },
+    // 类型选择
+    selectChild(product_type_id) {
+      let res = this.columnList.filter(fil => fil.id === product_type_id);
+      if (res.length > 0) {
+        this.$set(this.form, `product_type_name`, res[0].name);
+      }
+      this.$forceUpdate();
+    },
+    // 图片
+    uploadSuccess({ type, data }) {
+      let arr = _.get(this.form, type);
+      if (_.isArray(arr)) {
+        let datas = { name: data.name, url: data.uri };
+        this.form[type].push({ name: data.name, url: data.uri });
+      } else {
+        let newArr = [{ name: data.name, url: data.uri }];
+        this.$set(this.form, `${type}`, newArr);
+      }
+    },
+    // 删除图片
+    uploadDelete(index) {
+      this.form.image.splice(index, 1);
+    },
+    // 获取表格选中时的数据
+    selectRow(val) {
+      this.selectlistRow = val;
+    },
+    addRow() {
+      var list = {
+        rowNum: this.rowNum,
+      };
+      // let tableData = this.emandForm.product_args;
+      this.product_args.unshift(list);
+      this.rowNum += 1;
+    },
+    back() {
+      this.$emit('back');
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.back {
+  text-align: right;
+}
+</style>

+ 189 - 0
src/views/userCenter/productInfo/part/statusIn.vue

@@ -0,0 +1,189 @@
+<template>
+  <div id="statusIn">
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
+          <el-col :span="24" class="top">
+            <span class="textOver">{{ item.name }}</span>
+            <span>{{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}</span>
+          </el-col>
+          <el-col :span="24" class="down">
+            <el-col :span="3" class="image">
+              <el-col :span="24" v-for="(acm, index) in item.image" :key="index">
+                <template v-if="index === 0">
+                  <el-image style="width:100%;height:100px" :src="acm.url"></el-image>
+                </template>
+              </el-col>
+            </el-col>
+            <el-col :span="6" class="product">
+              <p>类别:{{ item.totaltype === '0' ? '技术' : item.totaltype === '1' ? '产品' : item.totaltype === '2' ? '服务' : 'underdind' }}</p>
+              <p class="textOver">交易方式{{ item.business == '0' ? '公用' : item.business == '1' ? '竞用' : item.business == '2' ? '转让' : '未识别' }}</p>
+              <p>{{ item.price }}/{{ item.priceunit }}</p>
+            </el-col>
+            <el-col :span="9" class="intro">
+              <p>产品简介:</p>
+              <p>{{ item.introduction }}</p>
+            </el-col>
+            <el-col :span="6" class="status">
+              <p>状态:{{ item.status === '0' ? '审核中' : '未识别' }}</p>
+              <el-button type="danger" size="mini" @click="deleteBtn(item.id)">删除</el-button>
+            </el-col>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="page">
+          <el-pagination
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            layout="total,  prev, pager, next, jumper"
+            :total="pastTotal"
+            :page-size="pageSize"
+          >
+          </el-pagination>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: marketproduct } = createNamespacedHelpers('marketproduct');
+export default {
+  name: 'statusIn',
+  props: {},
+  components: {},
+  data: function() {
+    return {
+      list: [],
+      pastTotal: 0,
+      currentPage: 0,
+      pageSize: 6,
+      skip: '',
+    };
+  },
+  created() {
+    this.searchInfo();
+  },
+  methods: {
+    ...marketproduct({ productList: 'query', columnInfo: 'fetch', marketcerate: 'create', productdeltet: 'delete', upup: 'update' }),
+    // 查询列表
+    async searchInfo({ skip = 0, limit = 6, ...info } = {}) {
+      skip = this.skip;
+      let userid = this.user.uid;
+      const res = await this.productList({ skip, limit, status: 0, userid, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `pastTotal`, res.total);
+      }
+    },
+    // 删除信息
+    async deleteBtn(id) {
+      let res = await this.productdeltet(id);
+      if (this.$checkRes(res)) {
+        this.$message({
+          message: '信息删除成功',
+          type: 'success',
+        });
+        this.searchInfo();
+      } else {
+        this.$message.error('信息删除失败');
+      }
+    },
+    handleCurrentChange(currentPage) {
+      this.$set(this, `skip`, (currentPage - 1) * this.pageSize);
+      this.searchInfo();
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.textOver {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.info {
+  padding: 0 0 15px 0;
+}
+.list {
+  height: 185px;
+  border: 1px solid #ccc;
+  margin: 0 0 15px 0;
+  .top {
+    height: 45px;
+    line-height: 45px;
+    background-color: #fafafa;
+    span:first-child {
+      float: left;
+      width: 74%;
+      font-size: 16px;
+      color: #888;
+      padding: 0 15px;
+    }
+    span:last-child {
+      float: right;
+      width: 20%;
+      font-size: 16px;
+      color: #888;
+      padding: 0 15px;
+      text-align: right;
+    }
+  }
+  .down {
+    padding: 18px;
+    .product {
+      height: 100px;
+      overflow: hidden;
+      padding: 0 15px;
+      border-right: 1px dashed #ccc;
+      p {
+        padding: 8px 0;
+        font-size: 14px;
+      }
+      p:last-child {
+        color: #ff0000;
+        font-weight: bold;
+      }
+    }
+    .intro {
+      height: 100px;
+      overflow: hidden;
+      font-size: 14px;
+      padding: 0 10px;
+      border-right: 1px dashed #ccc;
+      p:last-child {
+        overflow: hidden;
+        text-overflow: ellipsis;
+        -webkit-line-clamp: 4;
+        word-break: break-all;
+        display: -webkit-box;
+        -webkit-box-orient: vertical;
+      }
+    }
+    .status {
+      height: 100px;
+      text-align: center;
+      p {
+        height: 50px;
+        line-height: 50px;
+        font-size: 14px;
+        font-weight: bold;
+        color: #2d64b3;
+      }
+    }
+  }
+}
+.page {
+  text-align: center;
+}
+</style>

+ 211 - 0
src/views/userCenter/productInfo/part/stay.vue

@@ -0,0 +1,211 @@
+<template>
+  <div id="stay">
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="list" v-for="(item, index) in list" :key="index">
+          <el-col :span="24" class="top">
+            <span class="textOver">{{ item.name }}</span>
+            <span>{{ item.meta && item.meta.createdAt ? new Date(item.meta.createdAt).toLocaleDateString() : '' || '' }}</span>
+          </el-col>
+          <el-col :span="24" class="down">
+            <el-col :span="3" class="image">
+              <el-col :span="24" v-for="(acm, index) in item.image" :key="index">
+                <template v-if="index === 0">
+                  <el-image style="width:100%;height:100px" :src="acm.url"></el-image>
+                </template>
+              </el-col>
+            </el-col>
+            <el-col :span="6" class="product">
+              <p>类别:{{ item.totaltype === '0' ? '技术' : item.totaltype === '1' ? '产品' : item.totaltype === '2' ? '服务' : 'underdind' }}</p>
+              <p class="textOver">交易方式{{ item.business == '0' ? '公用' : item.business == '1' ? '竞用' : item.business == '2' ? '转让' : '未识别' }}</p>
+              <p>{{ item.price }}/{{ item.priceunit }}</p>
+            </el-col>
+            <el-col :span="9" class="intro">
+              <p>产品简介:</p>
+              <p>{{ item.introduction }}</p>
+            </el-col>
+            <el-col :span="6" class="status">
+              <p>状态:{{ item.status === '2' ? '审核拒绝' : item.status === '3' ? '草稿' : '未识别' }}</p>
+              <el-button type="primary" size="mini" @click="editBtn(item)" v-if="item.status == '3'">编辑</el-button>
+              <el-button type="success" size="mini" @click="releaseBtn(item)" v-if="item.status == '3'">发布</el-button>
+              <el-button type="danger" size="mini" @click="deleteBtn(item.id)">删除</el-button>
+            </el-col>
+          </el-col>
+        </el-col>
+        <el-col :span="24" class="page">
+          <el-pagination
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            layout="total,  prev, pager, next, jumper"
+            :total="pastTotal"
+            :page-size="pageSize"
+          >
+          </el-pagination>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions: marketproduct } = createNamespacedHelpers('marketproduct');
+export default {
+  name: 'stay',
+  props: {},
+  components: {},
+  data: function() {
+    return {
+      list: [],
+      pastTotal: 0,
+      currentPage: 0,
+      pageSize: 6,
+      skip: '',
+    };
+  },
+  created() {
+    this.searchInfo();
+  },
+  methods: {
+    ...marketproduct({ productList: 'query', columnInfo: 'fetch', marketcerate: 'create', productdeltet: 'delete', upup: 'update' }),
+    // 查询列表
+    async searchInfo({ skip = 0, limit = 6, ...info } = {}) {
+      skip = this.skip;
+      let userid = this.user.uid;
+      const res = await this.productList({ skip, limit, status: 2, userid, ...info });
+      const resTwo = await this.productList({ skip, limit, status: 3, userid, ...info });
+      var newData = res.data.concat(resTwo.data);
+      if (newData.length != 0) {
+        this.$set(this, `list`, newData);
+        this.$set(this, `pastTotal`, newData.length);
+      }
+    },
+    // 修改
+    editBtn(item) {
+      this.$emit('editBtn', item);
+    },
+    // 信息发布
+    async releaseBtn(data) {
+      data.status = '0';
+      let res = await this.upup(data);
+      if (this.$checkRes(res)) {
+        this.$message({
+          message: '信息发布成功',
+          type: 'success',
+        });
+        this.searchInfo();
+      } else {
+        this.$message.error('信息发布失败');
+      }
+    },
+    // 删除信息
+    async deleteBtn(id) {
+      let res = await this.productdeltet(id);
+      if (this.$checkRes(res)) {
+        this.$message({
+          message: '信息删除成功',
+          type: 'success',
+        });
+        this.searchInfo();
+      } else {
+        this.$message.error('信息删除失败');
+      }
+    },
+    handleCurrentChange(currentPage) {
+      this.$set(this, `skip`, (currentPage - 1) * this.pageSize);
+      this.searchInfo();
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    pageTitle() {
+      return `${this.$route.meta.title}`;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.textOver {
+  overflow: hidden;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+.info {
+  padding: 0 0 15px 0;
+}
+.list {
+  height: 185px;
+  border: 1px solid #ccc;
+  margin: 0 0 15px 0;
+  .top {
+    height: 45px;
+    line-height: 45px;
+    background-color: #fafafa;
+    span:first-child {
+      float: left;
+      width: 74%;
+      font-size: 16px;
+      color: #888;
+      padding: 0 15px;
+    }
+    span:last-child {
+      float: right;
+      width: 20%;
+      font-size: 16px;
+      color: #888;
+      padding: 0 15px;
+      text-align: right;
+    }
+  }
+  .down {
+    padding: 18px;
+    .product {
+      height: 100px;
+      overflow: hidden;
+      padding: 0 15px;
+      border-right: 1px dashed #ccc;
+      p {
+        padding: 8px 0;
+        font-size: 14px;
+      }
+      p:last-child {
+        color: #ff0000;
+        font-weight: bold;
+      }
+    }
+    .intro {
+      height: 100px;
+      overflow: hidden;
+      font-size: 14px;
+      padding: 0 10px;
+      border-right: 1px dashed #ccc;
+      p:last-child {
+        overflow: hidden;
+        text-overflow: ellipsis;
+        -webkit-line-clamp: 4;
+        word-break: break-all;
+        display: -webkit-box;
+        -webkit-box-orient: vertical;
+      }
+    }
+    .status {
+      height: 100px;
+      text-align: center;
+      p {
+        height: 50px;
+        line-height: 50px;
+        font-size: 14px;
+        font-weight: bold;
+        color: #2d64b3;
+      }
+    }
+  }
+}
+.page {
+  text-align: center;
+}
+</style>