Browse Source

开店代码新需求修改之前版本+店铺分页+店铺筛选条件移除寄售

yangc 7 years ago
parent
commit
2796a8b5ca

+ 4 - 0
assets/scss/common.scss

@@ -611,6 +611,10 @@ div.el-tree-node__content{
   position: relative;
   z-index: 10;
 }
+.select-adder {
+  background:url("/images/all/xiala.png") right no-repeat #fff !important;
+  background-position-x: 100% !important;
+}
 .componentDetail .el-dialog--tiny{
   width: 320px !important;
 }

+ 37 - 12
components/common/upload/upload.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div class="preview">
-      <img :src="qualifications.url==''?'images/all/upload-apply.png':qualifications.url" class="previewImage"/>
+      <img :src="qualifications.url==''?'images/all/upload-apply.png': isPdf?'/images/all/timg.png':qualifications.url" class="previewImage"/>
       <input type="file" v-if="!qualifications.url" class="com-input" @change="update" accept="image/jpeg,image/jpg,image/gif,image/bmp,image/png,.pdf" />
     </div>
     <div class="hover-show" v-if="qualifications.url">
@@ -21,12 +21,15 @@
 </template>
 <script>
   export default {
+    props: ['typeData'],
     data () {
       return {
         qualifications: {
-          url: ''
+          url: '',
+          type: ''
         },
-        isShow: false
+        isShow: false,
+        isPdf: false
       }
     },
     methods: {
@@ -35,21 +38,43 @@
         let param = new FormData()
         param.append('file', file, file.name)
         param.append('chunk', '0')
-        let config = {
-          headers: {'Content-Type': 'multipart/form-data'}
+        if (file.type !== 'application/pdf') {
+          let config = {
+            headers: {'Content-Type': 'multipart/form-data'}
+          }
+          this.$http.post('/api/images', param, config)
+            .then(response => {
+              this.isPdf = false
+              this.qualifications.url = response.data[0].path
+              this.qualifications.type = typeof this.typeData === 'undefined' ? '' : this.typeData
+              this.$emit('uploadAction', this.qualifications)
+            })
+        } else {
+          let config = {
+            headers: {'Content-Type': file.type}
+          }
+          this.$http.post('/file', param, config)
+            .then(response => {
+              this.isPdf = true
+              this.qualifications.url = response.data[0].path
+              this.qualifications.type = typeof this.typeData === 'undefined' ? '' : this.typeData
+              this.$emit('uploadAction', this.qualifications)
+            }, err => {
+              console.log(err)
+            })
         }
-        this.$http.post('/api/images', param, config)
-          .then(response => {
-            this.qualifications.url = response.data[0].path
-            this.$emit('uploadAction', response.data[0].path)
-          })
       },
       showImg (imgUrl) {
-        this.qualifications.url = imgUrl
-        this.isShow = true
+        if (!this.isPdf) {
+          this.qualifications.url = imgUrl
+          this.isShow = true
+        } else {
+          window.open(imgUrl)
+        }
       },
       deleteImg () {
         this.qualifications.url = ''
+        this.$emit('uploadAction', this.qualifications)
       }
     }
   }

+ 26 - 4
components/default/Header.vue

@@ -26,6 +26,9 @@
                     v-if="showEnterprises && en.enName!=enterprise.enName">
                   <a @click="switchEnterprise(en)">{{ en.enName }}</a>
                 </li>
+                <li class="menu-item"  v-if="showEnterprises">
+                  <a @click="switchEnterprise({uu: 0})">(<span v-text="user.data.userName"></span>)个人</a>
+                </li>
               </ul>
             </div>
             <nuxt-link class="item" :to="'/'">商城首页</nuxt-link>
@@ -34,7 +37,7 @@
             <!--<a class="item" :href="url + '/user'">买家中心</a>
             <a class="item" :href="url + '/vendor'">卖家中心</a>-->
             <a class="item" href="/user#/index">买家中心</a>
-            <a class="item" href="/vendor#/index">卖家中心</a>
+            <a class="item" @click="toVendor">卖家中心</a>
           </template>
           <template v-else>
             <a class="item" @click="onLoginClick()">登录</a>
@@ -63,9 +66,10 @@
       enterprise () {
         let ens = this.user.data.enterprises
         if (ens && ens.length) {
-          return ens.find(item => item.current) || ens[0]
+          return ens.find(item => item.current) || {enName: '(' + this.user.data.userName + ')' + '个人'}
+        } else {
+          return {enName: '(' + this.user.data.userName + ')' + '个人'}
         }
-        return {}
       },
       url () {
         return this.$store.state.option.url
@@ -79,7 +83,7 @@
         this.$http.get('/login/page').then(response => {
           if (response.data) {
             this.$router.push('/auth/login')
-     //       window.location.href = response.data.content
+            window.location.href = response.data.content
           }
         })
         // TODO 待Account Center改版
@@ -102,6 +106,24 @@
           this.$store.dispatch('loadUserInfo')
           window.location.reload()
         })
+      },
+      toVendor: function () {
+        let isSelf = true
+        let ens = this.user.data.enterprises
+        if (ens && ens.length) {
+          ens.forEach(function (item) {
+            if (item.current) {
+              isSelf = false
+            }
+          })
+        } else {
+          isSelf = true
+        }
+        if (isSelf) {
+          window.location.href = '/register-saler'
+        } else {
+          window.location.href = '/vendor#/index'
+        }
       }
     },
     beforeMount () {

+ 2 - 2
components/main/Search.vue

@@ -167,8 +167,8 @@
     height: 40px;
     position: relative;
     .search-input{
-      float: right;
       width: 364px;
+      float: left;
     }
     .search-input, .search-btn {
       height: 40px;
@@ -203,7 +203,7 @@
 
     .association {
       position: absolute;
-      left: 0;
+      left: 78px;
       top: 100%;
       right: 79px;
       background: $white;

+ 1 - 0
components/news/Right.vue

@@ -108,6 +108,7 @@
     display: table-cell;
     vertical-align: middle;
     border-bottom: 1px dashed #ccc;
+    width: 717px;
   }
   .thumbnail-news {
     width: 160px;

+ 153 - 113
components/register-saler/RegHeader.vue

@@ -1,7 +1,7 @@
-<!--<template>
+<template>
   <div>
     <h3 class="h3">成为优软卖家有什么好处?</h3>
-    <div class="row title">
+    <div class="row header-title">
       <div class="col-md-6">
         <h4>免费开店</h4>
         <p>申请开店完全免费,一个企业只能开一家店,申请到正式开通预计需1-3个工作日。</p>
@@ -13,16 +13,10 @@
     </div>
   </div>
 </template>
-<script>
-
-</script>
-<style>
-
-</style>-->
-<template>
+<!--<template>
   <div class="container vendor_store_apply">
     <div>
-      <!-- Nav tabs -->
+      &lt;!&ndash; Nav tabs &ndash;&gt;
       <ul class="nav nav-tabs">
         <li><div style="height: 39px;line-height: 39px;font-size: 14px;">店铺类型:</div></li>
         <li class="custom_tab" :class="{active: tab == 'ORIGINAL_FACTORY'}" @click="toggleTab('ORIGINAL_FACTORY')">
@@ -35,15 +29,15 @@
           <a href="javascript:void(0)">经销商</a>
         </li>
       </ul>
-      <!-- Tab panes -->
+      &lt;!&ndash; Tab panes &ndash;&gt;
       <div class="tab-content" style="border: 1px #5078CB solid; padding-bottom: 30px;">
-        <!-- 原厂 -->
+        &lt;!&ndash; 原厂 &ndash;&gt;
         <div role="tabpanel" class="tab-pane" v-if="tab == 'ORIGINAL_FACTORY'" :class="{active: tab == 'ORIGINAL_FACTORY'}">
           <div class="row com_row">
             <div class="col-md-4 custom_col">
               <div class="row" style="margin: 0;">
                 <div class="col-md-5 col-md-offset-1 show_image_area show_image">
-                  <upload @uploadAction="onUpload"></upload>
+                  <upload :typeData="'BUSINESS_LICENSE'" @uploadAction="onUpload"></upload>
                 </div>
                 <div class="col-md-5" style="padding: 0;">
                   <span style="margin-top: 50%;padding-right: 20px;">营业执照<em style="color: #FF0000;">*</em></span>
@@ -53,13 +47,7 @@
             <div class="col-md-4 custom_col">
               <div class="row" style="margin: 0;">
                 <div class="col-md-5 col-md-offset-1 show_image_area show_image">
-                  <div class="preview">
-                    <img src="images/all/upload-apply.png" class="previewImage"/>
-                  </div>
-                  <div class="hover-show">
-                    <span class="delete" title="删除"><i class="fa fa-trash"></i></span>
-                    <a><i class="fa fa-search"></i>查看</a>
-                  </div>
+                  <upload  :typeData="'TAX_PAYER'" @uploadAction="onUpload"></upload>
                 </div>
                 <div class="col-md-5" style="padding: 0;">
                   <span style="margin-top: 50%;padding-right: 20px;">纳税人证明</span>
@@ -69,13 +57,7 @@
             <div class="col-md-4 custom_col">
               <div class="row" style="margin: 0;">
                 <div class="col-md-5 col-md-offset-1 show_image_area show_image">
-                  <div class="preview">
-                    <img src="images/all/upload-apply.png" class="previewImage"/>
-                  </div>
-                  <div class="hover-show">
-                    <span class="delete" title="删除"><i class="fa fa-trash"></i></span>
-                    <a><i class="fa fa-search"></i>查看</a>
-                  </div>
+                  <upload :typeData="'TAX_REGISTRATION'" @uploadAction="onUpload"></upload>
                 </div>
                 <div class="col-md-5" style="padding: 0;">
                   <span style="margin-top: 50%;padding-right: 20px;">税务登记证</span>
@@ -84,48 +66,36 @@
             </div>
             <div class="col-md-12"><em>* </em>如已上传最新版营业执照(三证合一),则其他两证无需上传 ; 仅支持JPG、PNG、GIF、PDF格式,每张大小不超过3M</div>
           </div>
-          <!--增加品牌-->
-          <div class="brand-type row">
-            <div class="col-md-1">品牌1<em>*</em></div>
+          &lt;!&ndash;增加品牌&ndash;&gt;
+          <div class="brand-type row" v-for="(brand, index) in brands">
+            <div class="col-md-1">品牌{{index+1}}<em>*</em></div>
             <div class="col-md-7">
-              <input type="text" class="form-control" name="brandName"  autocomplete="off" placeholder="请输入英文品牌或中文品牌,如:松下; panasonic等"/>
+              <input type="text" v-model="brand.name" @change="onBrandChanged(brand)" class="form-control" name="brandName"  autocomplete="off" placeholder="请输入英文品牌或中文品牌,如:松下; panasonic等"/>
             </div>
             <div class="brand-small-upload col-md-4">
               <div class="brand-small-img">
-                <div class="preview ">
-                  <img src="images/all/upload-apply.png"  class="previewImage"/>
-                </div>
-                <div class="hover-show">
-                  <span class="delete" title="删除"><i class="fa fa-trash"></i></span>
-                  <a><i class="fa fa-search"></i>查看</a>
-                </div>
+                <upload :typeData="index" @uploadAction="onUpload"></upload>
               </div>
               <div class="file-text">品牌logo/商标注册原件/授权说明书</div>
-              <div class="delete" title="删除"><i class="fa fa-trash"></i></div>
+              <div v-show="brands.length > 1" @click="deleteBrand(index)" class="delete" title="删除">{{index}}<i class="fa fa-trash"></i></div>
               <div class="col-md-12"> <em>*</em>仅支持JPG、PNG、GIF、PDF格式,大小不超过3M</div>
             </div>
           </div>
           <div class="add-brand row">
-            <a href="javascript:void(0)" title="增加品牌" ng-click="addBrand()"><em><i class="fa fa-plus-circle"></i>增加品牌</em></a>
+            <a href="javascript:void(0)" title="增加品牌" @click="addBrand"><em><i class="fa fa-plus-circle"></i>增加品牌</em></a>
           </div>
           <div class="unpass-reason row" style="display: none">
             原因:<span style="color: #d32526;">原因</span>
           </div>
         </div>
-        <!--原厂end-->
-        <!--代理商 begin-->
+        &lt;!&ndash;原厂end&ndash;&gt;
+        &lt;!&ndash;代理商 begin&ndash;&gt;
         <div role="tabpanel" class="tab-pane" v-if="tab == 'AGENCY'" :class="{active: tab == 'AGENCY'}">
           <div class="row com_row">
             <div class="col-md-4 custom_col">
               <div class="row" style="margin: 0;">
                 <div class="col-md-5 col-md-offset-1 show_image_area show_image">
-                  <div class="preview">
-                    <img src="images/all/upload-apply.png" class="previewImage"/>
-                  </div>
-                  <div class="hover-show">
-                    <span class="delete" title="删除"><i class="fa fa-trash"></i></span>
-                    <a><i class="fa fa-search"></i>查看</a>
-                  </div>
+                  <upload :typeData="'BUSINESS_LICENSE'" @uploadAction="onUpload"></upload>
                 </div>
                 <div class="col-md-5" style="padding: 0;">
                   <span style="margin-top: 50%;padding-right: 20px;">营业执照<em style="color: #FF0000;">*</em></span>
@@ -135,13 +105,7 @@
             <div class="col-md-4 custom_col">
               <div class="row" style="margin: 0;">
                 <div class="col-md-5 col-md-offset-1 show_image_area show_image">
-                  <div class="preview">
-                    <img src="images/all/upload-apply.png" class="previewImage"/>
-                  </div>
-                  <div class="hover-show">
-                    <span class="delete" title="删除"><i class="fa fa-trash"></i></span>
-                    <a><i class="fa fa-search"></i>查看</a>
-                  </div>
+                  <upload  :typeData="'TAX_PAYER'" @uploadAction="onUpload"></upload>
                 </div>
                 <div class="col-md-5" style="padding: 0;">
                   <span style="margin-top: 50%;padding-right: 20px;">纳税人证明</span>
@@ -151,13 +115,7 @@
             <div class="col-md-4 custom_col">
               <div class="row" style="margin: 0;">
                 <div class="col-md-5 col-md-offset-1 show_image_area show_image">
-                  <div class="preview">
-                    <img src="images/all/upload-apply.png" class="previewImage"/>
-                  </div>
-                  <div class="hover-show">
-                    <span class="delete" title="删除"><i class="fa fa-trash"></i></span>
-                    <a><i class="fa fa-search"></i>查看</a>
-                  </div>
+                  <upload :typeData="'TAX_REGISTRATION'" @uploadAction="onUpload"></upload>
                 </div>
                 <div class="col-md-5" style="padding: 0;">
                   <span style="margin-top: 50%;padding-right: 20px;">税务登记证</span>
@@ -166,48 +124,36 @@
             </div>
             <div class="col-md-12"><em>* </em>如已上传最新版营业执照(三证合一),则其他两证无需上传 ; 仅支持JPG、PNG、GIF、PDF格式,每张大小不超过3M</div>
           </div>
-          <!--增加品牌-->
-          <div class="brand-type row">
-            <div class="col-md-1">品牌1<em>*</em></div>
+          &lt;!&ndash;增加品牌&ndash;&gt;
+          <div class="brand-type row" v-for="(brand, index) in brands">
+            <div class="col-md-1">品牌{{index+1}}<em>*</em></div>
             <div class="col-md-7">
-              <input type="text" class="form-control" name="brandName"  autocomplete="off" placeholder="请输入英文品牌或中文品牌,如:松下; panasonic等"/>
+              <input type="text" v-model="brand.name" @change="onBrandChanged(brand)" class="form-control" name="brandName"  autocomplete="off" placeholder="请输入英文品牌或中文品牌,如:松下; panasonic等"/>
             </div>
             <div class="brand-small-upload col-md-4">
               <div class="brand-small-img">
-                <div class="preview ">
-                  <img src="images/all/upload-apply.png"  class="previewImage"/>
-                </div>
-                <div class="hover-show">
-                  <span class="delete" title="删除"><i class="fa fa-trash"></i></span>
-                  <a><i class="fa fa-search"></i>查看</a>
-                </div>
+                <upload :typeData="index" @uploadAction="onUpload"></upload>
               </div>
               <div class="file-text">代理资格证/代理授权书</div>
-              <div class="delete" title="删除"><i class="fa fa-trash"></i></div>
+              <div v-show="brands.length > 1" @click="deleteBrand(index)" class="delete" title="删除">{{index}}<i class="fa fa-trash"></i></div>
               <div class="col-md-12"> <em>*</em>仅支持JPG、PNG、GIF、PDF格式,大小不超过3M</div>
             </div>
           </div>
           <div class="add-brand row">
-            <a href="javascript:void(0)" title="增加品牌" ng-click="addBrand()"><em><i class="fa fa-plus-circle"></i>增加品牌</em></a>
+            <a href="javascript:void(0)" title="增加品牌" @click="addBrand"><em><i class="fa fa-plus-circle"></i>增加品牌</em></a>
           </div>
           <div class="unpass-reason row" style="display: none">
             原因:<span style="color: #d32526;">原因</span>
           </div>
         </div>
-        <!--代理商 end-->
-        <!--经销商 begin-->
+        &lt;!&ndash;代理商 end&ndash;&gt;
+        &lt;!&ndash;经销商 begin&ndash;&gt;
         <div role="tabpanel" class="tab-pane" v-if="tab == 'DISTRIBUTION'" :class="{active: tab == 'DISTRIBUTION'}">
           <div class="row com_row">
             <div class="col-md-4 custom_col">
               <div class="row" style="margin: 0;">
                 <div class="col-md-5 col-md-offset-1 show_image_area show_image">
-                  <div class="preview">
-                    <img src="images/all/upload-apply.png" class="previewImage"/>
-                  </div>
-                  <div class="hover-show">
-                    <span class="delete" title="删除"><i class="fa fa-trash"></i></span>
-                    <a><i class="fa fa-search"></i>查看</a>
-                  </div>
+                  <upload :typeData="'BUSINESS_LICENSE'" @uploadAction="onUpload"></upload>
                 </div>
                 <div class="col-md-5" style="padding: 0;">
                   <span style="margin-top: 50%;padding-right: 20px;">营业执照<em style="color: #FF0000;">*</em></span>
@@ -217,13 +163,7 @@
             <div class="col-md-4 custom_col">
               <div class="row" style="margin: 0;">
                 <div class="col-md-5 col-md-offset-1 show_image_area show_image">
-                  <div class="preview">
-                    <img src="images/all/upload-apply.png" class="previewImage"/>
-                  </div>
-                  <div class="hover-show">
-                    <span class="delete" title="删除"><i class="fa fa-trash"></i></span>
-                    <a><i class="fa fa-search"></i>查看</a>
-                  </div>
+                  <upload  :typeData="'TAX_PAYER'" @uploadAction="onUpload"></upload>
                 </div>
                 <div class="col-md-5" style="padding: 0;">
                   <span style="margin-top: 50%;padding-right: 20px;">纳税人证明</span>
@@ -233,13 +173,7 @@
             <div class="col-md-4 custom_col">
               <div class="row" style="margin: 0;">
                 <div class="col-md-5 col-md-offset-1 show_image_area show_image">
-                  <div class="preview">
-                    <img src="images/all/upload-apply.png" class="previewImage"/>
-                  </div>
-                  <div class="hover-show">
-                    <span class="delete" title="删除"><i class="fa fa-trash"></i></span>
-                    <a><i class="fa fa-search"></i>查看</a>
-                  </div>
+                  <upload :typeData="'TAX_REGISTRATION'" @uploadAction="onUpload"></upload>
                 </div>
                 <div class="col-md-5" style="padding: 0;">
                   <span style="margin-top: 50%;padding-right: 20px;">税务登记证</span>
@@ -249,15 +183,15 @@
             <div class="col-md-12"><em>* </em>如已上传最新版营业执照(三证合一),则其他两证无需上传 ; 仅支持JPG、PNG、GIF、PDF格式,每张大小不超过3M</div>
           </div>
         </div>
-        <!--经销商 end-->
+        &lt;!&ndash;经销商 end&ndash;&gt;
       </div>
-      <!-- Submit button -->
+      &lt;!&ndash; Submit button &ndash;&gt;
       <div style="padding: 28px 40px;">
-        <button type="button" class="btn btn-primary" style="float: right">提交申请</button>
+        <button type="button" class="btn btn-primary" style="float: right" @click="submitApply">提交申请</button>
         <div class="clear-fix"></div>
       </div>
     </div>
-    <!--删除上传图片-->
+    &lt;!&ndash;删除上传图片&ndash;&gt;
     <div class="com-del-box" style="display: none">
       <div class="title">
         <a><i class="fa fa-close fa-lg"></i></a>
@@ -267,7 +201,7 @@
         <div><a>取消</a><a>确认</a></div>
       </div>
     </div>
-    <!--删除品牌图片-->
+    &lt;!&ndash;删除品牌图片&ndash;&gt;
     <div class="com-del-box" style="display: none">
       <div class="title">
         <a><i class="fa fa-close fa-lg"></i></a>
@@ -277,14 +211,14 @@
         <div><a>取消</a><a>确认</a></div>
       </div>
     </div>
-    <!--提示框-->
-    <div class="com-del-box" style="display: none;">
+    &lt;!&ndash;提示框&ndash;&gt;
+    <div class="com-del-box" v-if="showBrandNameInvalid">
       <div class="title">
-        <a><i class="fa fa-close fa-lg"></i></a>
+        <a @click="showBrandNameInvalid = false"><i class="fa fa-close fa-lg"></i></a>
       </div>
       <div class="content">
         <p style="line-height: 20px;margin-top: 10px;">非常抱歉,目前暂无此品牌!您可在<br/>“品牌申请”中,提出申请。</p>
-        <p style="line-height: 20px;">前往<a style="color: #5078CB">品牌申请&nbsp;<i class="fa fa-arrow-right"></i></a></p>
+        <p style="line-height: 20px;">前往<a @click="showBrandNameInvalid = false"  target="_blank" href="/vendor#/brand/apply/" style="color: #5078CB">品牌申请&nbsp;<i class="fa fa-arrow-right"></i></a></p>
       </div>
     </div>
   </div>
@@ -294,7 +228,18 @@
   export default {
     data () {
       return {
-        tab: 'ORIGINAL_FACTORY'
+        tab: 'ORIGINAL_FACTORY',
+        brands: [{
+          type: 'BRAND',
+          name: '',
+          url: '',
+          isPdf: false,
+          brandUuid: ''
+        }],
+        businessLicenseUrl: '',
+        taxPayerUrl: '',
+        taxRegistrationUrl: '',
+        showBrandNameInvalid: false
       }
     },
     components: {
@@ -303,9 +248,104 @@
     methods: {
       toggleTab (t) {
         this.tab = t
+        this.brands = [{
+          type: 'BRAND',
+          name: '',
+          url: '',
+          isPdf: false,
+          brandUuid: ''
+        }]
+      },
+      onUpload: function (obj) {
+        if (obj.type === 'BUSINESS_LICENSE') {
+          this.businessLicenseUrl = obj.url
+        } else if (obj.type === 'TAX_PAYER') {
+          this.taxPayerUrl = obj.url
+        } else if (obj.type === 'TAX_REGISTRATION') {
+          this.taxRegistrationUrl = obj.url
+        } else if (typeof obj.type === 'number') {
+          this.brands[obj.type].url = obj.url
+        }
       },
-      onUpload: function (url) {
-        console.log(url)
+      onBrandChanged: function (item) {
+        this.$http.get('/api/product/brand', {params: {name: item.name, op: 'by_name'}})
+          .then(response => {
+            item.brandUuid = response.data.uuid
+            item.isPdf = item.url.substring(item.url.length - 4, item.url.length) === '.pdf'
+          }, err => {
+            console.log(err)
+            this.showBrandNameInvalid = true
+          })
+      },
+      submitApply: function () {
+        let validCode = 0
+        if (this.businessLicenseUrl === '') {
+          this.$message.error('请上传营业执照')
+        } else {
+          this.brands.forEach(function (item) {
+            if (item.name === '') {
+              validCode = 1
+            } else if (item.url === '') {
+              validCode = 2
+            }
+          })
+          if (validCode === 0) {
+            let qualifications = []
+            qualifications.push({
+              type: 'BUSINESS_LICENSE',
+              resourceUrl: this.businessLicenseUrl,
+              isPdf: this.isPdf(this.businessLicenseUrl)
+            })
+            if (this.taxPayerUrl !== '') {
+              qualifications.push({
+                type: 'TAX_PAYER',
+                resourceUrl: this.taxPayerUrl,
+                isPdf: this.isPdf(this.taxPayerUrl)
+              })
+            }
+            if (this.taxPayerUrl !== '') {
+              qualifications.push({
+                type: 'TAX_REGISTRATION',
+                resourceUrl: this.taxRegistrationUrl,
+                isPdf: this.isPdf(this.taxRegistrationUrl)
+              })
+            }
+//            console.log(qualifications)
+            this.$http.post('/store-service/applications', {
+              brands: this.brands,
+              qualifications: qualifications,
+              type: this.tab
+            }).then(response => {
+              if (response.data.success) {
+                this.$message.success('感谢您对优软商城的支持,我们会尽快对您提交的信息进行审核,预计审核时间为3个工作日,审核结果将以站内消息及邮件形式通知您!')
+                window.setTimeout(function () {
+                  window.location.href = '/vendor#/store-apply/'
+                }, 1000)
+              }
+            })
+          } else {
+            if (validCode === 1) {
+              this.$message.error('请添加品牌信息')
+            } else if (validCode === 2) {
+              this.$message.error('请上传品牌图片')
+            }
+          }
+        }
+      },
+      addBrand: function () {
+        this.brands.push({
+          type: 'BRAND',
+          name: '',
+          url: '',
+          isPdf: false,
+          brandUuid: ''
+        })
+      },
+      deleteBrand: function (index) {
+        this.brands.splice(index, 1)
+      },
+      isPdf: function (url) {
+        return url.substring(url.length - 4, url.length) === '.pdf'
       }
     }
   }
@@ -321,7 +361,7 @@
     opacity: 0;
     display: inline-block !important;
   }
-  .el-upload-list--picture-card .el-upload-list__item{
+  .el-upload-list&#45;&#45;picture-card .el-upload-list__item{
     width: 160px;
     height: 120px;
     top: 69px;
@@ -719,4 +759,4 @@
     color: #fff;
     text-decoration: none;
   }
-</style>
+</style>-->

+ 72 - 23
components/register-saler/register/StepFirst.vue

@@ -10,12 +10,12 @@
         <div class="col-sm-5">
           <input type="text" @change="nameCheck" v-model="data.name" class="form-control" name="name" required="" placeholder="填写营业执照上的企业名称">
         </div>
-        <div class="col-sm-5" v-show="!isValidTypeName">
+        <div class="col-sm-5" v-show="!validName.isValidTypeName && !validName.init">
           <p>
             <i class="fa fa-info-circle"></i>请填写正确的企业名称,2~99个字符
           </p>
         </div>
-        <div class="col-sm-5" v-show="!isValidName">
+        <div class="col-sm-5" v-show="!validName.isValidName && !validName.init">
           <p>
             <i class="fa fa-info-circle"></i>注册的企业名称已存在,请联系管理员
           </p>
@@ -26,7 +26,7 @@
         <div class="col-sm-5">
           <input type="text" @change="simpleNameCheck" v-model="data.simpleName" class="form-control" name="name" required="" placeholder="请填写正确的企业名称,2~40个字符">
         </div>
-        <div class="col-sm-5" v-show="!isValidSimpleName">
+        <div class="col-sm-5" v-show="!validSimpleName.isValidSimpleName && !validSimpleName.init">
           <p>
             <i class="fa fa-info-circle"></i>请填写正确的企业名称,2~40个字符
           </p>
@@ -42,14 +42,14 @@
           </a>
           <img class="previewImg" v-if="data.url != ''" :src="isPdf?'/images/all/timg.png':data.url" alt="">
         </div>
-        <div class="col-sm-5" v-show="!isValidUpload"><p><i class="fa fa-info-circle"></i>请上传营业执照扫描件(≤5M的图片或PDF)</p></div>
+        <div class="col-sm-5" v-show="!validUpload.isValidUpload && !validUpload.init"><p><i class="fa fa-info-circle"></i>请上传营业执照扫描件(≤5M的图片或PDF)</p></div>
       </div>
       <div class="row">
         <label class="col-sm-2 x-required">营业执照号:</label>
         <div class="col-sm-5">
           <input type="text" @change="licenceCheck" v-model="data.licenceId" class="form-control" name="name" required="" placeholder="请填写营业执照上的注册号">
         </div>
-        <div class="col-sm-5" v-show="!isValidLicence"><p><i class="fa fa-info-circle"></i>请填写营业执照上的注册号</p></div>
+        <div class="col-sm-5" v-show="!validLicence.isValidLicence && !validLicence.init"><p><i class="fa fa-info-circle"></i>请填写营业执照上的注册号</p></div>
       </div>
       <div class="row">
         <label class="col-sm-2">企业地址:</label>
@@ -57,12 +57,12 @@
           <input type="text" @change="addressCheck" v-model="data.address" class="form-control" name="name" required="" placeholder="填写总部所在地详细地址" style="padding-left:20px;">
           <span class="fa fa-map-marker"></span>
         </div>
-        <div class="col-sm-5" v-show="!isValidAddress"><p><i class="fa fa-info-circle"></i>填写总部所在地详细地址</p></div>
+        <div class="col-sm-5" v-show="!validAddress.isValidAddress && !validAddress.init"><p><i class="fa fa-info-circle"></i>填写总部所在地详细地址</p></div>
       </div>
       <div class="row">
         <label class="col-sm-2">官网地址:</label>
         <div class="col-sm-5">
-          <input type="url" v-model="data.website" class="form-control" name="name" required="" placeholder="www.example.com" style="padding-left:55px;">
+          <input type="url" @change="websiteCheck" v-model="data.website" class="form-control" name="name" required="" placeholder="www.example.com" style="padding-left:55px;">
           <span class="web">http://</span>
         </div>
         <div class="col-sm-5"></div>
@@ -83,33 +83,65 @@
           address: '',
           website: ''
         },
-        isValid: true,
-        isValidUpload: true,
-        isValidTypeName: true,
-        isValidName: true,
-        isValidLicence: true,
-        isValidSimpleName: true,
-        isValidAddress: true,
+        validName: {
+          isValidTypeName: true,
+          isValidName: true,
+          init: true
+        },
+        validUpload: {
+          isValidUpload: true,
+          init: true
+        },
+        validLicence: {
+          isValidLicence: true,
+          init: true
+        },
+        validSimpleName: {
+          isValidSimpleName: true,
+          init: true
+        },
+        validAddress: {
+          isValidAddress: true,
+          init: true
+        },
+        isValid: false,
         isPdf: false
       }
     },
     methods: {
       sectionChange: function (type) {
-        this.$http.post('/basic/enterprise/register', {enterprise: [], filePath: this.data.url})
+        let enterprise = {
+          enName: this.data.name,
+          enShortName: this.data.simpleName,
+          enBussinessCode: this.data.licenceId,
+          enAddress: this.data.address,
+          enUrl: this.data.website
+        }
+        this.$http.post('/basic/enterprise/register?filePath=' + this.data.url, enterprise)
           .then(response => {
             if (response.data.success) {
               this.$emit('sectionEvent', type)
+              this.$http.get('/user/authentication/reflash')
+                .then(() => {
+                  this.$http.get(`/user/authentication/` + response.data.data.enuu).then(() => {
+                    this.$store.dispatch('loadUserInfo')
+                    //       window.location.reload()
+                  })
+                }
+              )
             } else {
               this.$message.error('注册失败,请重新填写信息')
             }
           })
+//        this.$emit('sectionEvent', type)
       },
       upload: function (e) {
         let file = e.target.files[0]
+        this.validUpload.init = false
         if (file.size > 5 * 1024 * 1024) {
-          this.isValidUpload = false
+          this.validUpload.isValidUpload = false
         } else {
-          this.isValidUpload = true
+          this.validUpload.isValidUpload = true
           if (file.type !== 'application/pdf') {
             this.isPdf = false
             let param = new FormData()
@@ -121,9 +153,11 @@
             this.$http.post('/api/images', param, config)
               .then(response => {
                 this.data.url = response.data[0].path
+              }, err => {
+                console.log(err)
+                this.validUpload.isValidUpload = false
               })
           } else {
-            this.isPdf = true
             let param = new FormData()
             param.append('file', file, file.name)
             let config = {
@@ -131,30 +165,42 @@
             }
             this.$http.post('/file', param, config)
               .then(response => {
+                this.isPdf = true
                 this.data.url = response.data[0].path
+              }, err => {
+                console.log(err)
+                this.validUpload.isValidUpload = false
               })
           }
         }
+        this.validCheck()
       },
       validCheck: function () {
-//        this.isValid = this.isValidUpload && this.isValidTypeName && this.isValidName && this.isValidLicence && this.isValidSimpleName
+        this.isValid =
+          this.validUpload.isValidUpload && !this.validUpload.init &&
+          this.validName.isValidTypeName && !this.validName.init && this.validName.isValidName &&
+          this.validLicence.isValidLicence && !this.validLicence.init &&
+          this.validSimpleName.isValidSimpleName && !this.validSimpleName.init
       },
       nameCheck: function () {
+        this.validName.init = false
         this.$http.post('/basic/enterprise/register/valid/name?name=' + this.data.name)
           .then(response => {
-            this.isValidName = response.data.success
+            this.validName.isValidName = response.data.success
           })
-        this.isValidTypeName = this.data.name && this.data.name.length >= 2 && this.data.name.length <= 99
+        this.validName.isValidTypeName = this.data.name !== '' && this.data.name.length >= 2 && this.data.name.length <= 99 && this.commonValid(this.data.name)
         this.validCheck()
       },
       simpleNameCheck: function () {
-        this.isValidSimpleName = this.data.simpleName && this.data.simpleName.length >= 2 && this.data.simpleName.length <= 40
+        this.validSimpleName.init = false
+        this.validSimpleName.isValidSimpleName = this.data.simpleName !== '' && this.data.simpleName.length >= 2 && this.data.simpleName.length <= 40 && this.commonValid(this.data.simpleName)
         this.validCheck()
       },
       licenceCheck: function () {
+        this.validLicence.init = false
         this.$http.post('/basic/enterprise/register/valid/businessCode?businessCode=' + this.data.licenceId)
           .then(response => {
-            this.isValidLicence = response.data.success
+            this.validLicence.isValidLicence = response.data.success
           })
         this.validCheck()
       },
@@ -163,6 +209,9 @@
       },
       websiteCheck: function () {
      // (/^([\w-]+\.)+[\w-]+(/[\w-./?%&=])?$/).test(this.messageBoard.userTel)
+      },
+      commonValid: function (str) {
+        return str.indexOf(' ') === -1
       }
     }
   }

+ 814 - 4
components/register-saler/register/StepThird.vue

@@ -6,22 +6,832 @@
       <p class="title">申请开店完全免费,一个企业只能开一家店,申请到正式开通预计需1-3个工作日。了解更多请看《开店规则》</p>
     </div>
     <!--导入店铺模板-->
-    <div class="apply-include">
-      导入模板
-    </div>
+    <div class="container vendor_store_apply">
+        <div>
+          <!-- Nav tabs -->
+          <ul class="nav nav-tabs">
+            <li><div style="height: 39px;line-height: 39px;font-size: 14px;">店铺类型:</div></li>
+            <li class="custom_tab" :class="{active: tab == 'ORIGINAL_FACTORY'}" @click="toggleTab('ORIGINAL_FACTORY')">
+              <a href="javascript:void(0)">原厂</a>
+            </li>
+            <li class="custom_tab" :class="{active: tab == 'AGENCY'}" @click="toggleTab('AGENCY')">
+              <a href="javascript:void(0)">代理商</a>
+            </li>
+            <li class="custom_tab" :class="{active: tab == 'DISTRIBUTION'}" @click="toggleTab('DISTRIBUTION')">
+              <a href="javascript:void(0)">经销商</a>
+            </li>
+          </ul>
+          <!-- Tab panes -->
+          <div class="tab-content" style="border: 1px #5078CB solid; padding-bottom: 30px;">
+            <!-- 原厂 -->
+            <div role="tabpanel" class="tab-pane" v-if="tab == 'ORIGINAL_FACTORY'" :class="{active: tab == 'ORIGINAL_FACTORY'}">
+              <div class="row com_row">
+                <div class="col-md-4 custom_col">
+                  <div class="row" style="margin: 0;">
+                    <div class="col-md-5 col-md-offset-1 show_image_area show_image">
+                      <upload :typeData="'BUSINESS_LICENSE'" @uploadAction="onUpload"></upload>
+                    </div>
+                    <div class="col-md-5" style="padding: 0;">
+                      <span style="margin-top: 50%;padding-right: 20px;">营业执照<em style="color: #FF0000;">*</em></span>
+                    </div>
+                  </div>
+                </div>
+                <div class="col-md-4 custom_col">
+                  <div class="row" style="margin: 0;">
+                    <div class="col-md-5 col-md-offset-1 show_image_area show_image">
+                      <upload  :typeData="'TAX_PAYER'" @uploadAction="onUpload"></upload>
+                    </div>
+                    <div class="col-md-5" style="padding: 0;">
+                      <span style="margin-top: 50%;padding-right: 20px;">纳税人证明</span>
+                    </div>
+                  </div>
+                </div>
+                <div class="col-md-4 custom_col">
+                  <div class="row" style="margin: 0;">
+                    <div class="col-md-5 col-md-offset-1 show_image_area show_image">
+                      <upload :typeData="'TAX_REGISTRATION'" @uploadAction="onUpload"></upload>
+                    </div>
+                    <div class="col-md-5" style="padding: 0;">
+                      <span style="margin-top: 50%;padding-right: 20px;">税务登记证</span>
+                    </div>
+                  </div>
+                </div>
+                <div class="col-md-12"><em>* </em>如已上传最新版营业执照(三证合一),则其他两证无需上传 ; 仅支持JPG、PNG、GIF、PDF格式,每张大小不超过3M</div>
+              </div>
+              <!--增加品牌-->
+              <div class="brand-type row" v-for="(brand, index) in brands">
+                <div class="col-md-1">品牌{{index+1}}<em>*</em></div>
+                <div class="col-md-7">
+                  <input type="text" v-model="brand.name"
+                         @input="onBrandInput(brand, index)"
+                         @change="onBrandChanged(brand, index)"
+                         @blur.stop.prevent="showSimilarKey.flag = showFlag"
+                         class="form-control" name="brandName"  autocomplete="off" placeholder="请输入英文品牌或中文品牌,如:松下; panasonic等"/>
+                  <ul class="dropdown-menu"
+                      v-show="showSimilarKey.flag && showSimilarKey.index == index"
+                      @mouseenter="showFlag = true"
+                      @mouseleave="showFlag = false">
+                    <li @mouseenter="setKeyActive"
+                        @mouseleave="setKeyDefault"
+                        v-for="(key, key_index) in similarKeys[index]">
+                      <a v-text="key.nameCn"  @click.stop.prevent="changedName(brand, index, key_index)">
+                        <!--<strong>C</strong>apital Advan<strong>c</strong>ed-->
+                      </a>
+                    </li>
+                  </ul>
+                </div>
+                <div class="brand-small-upload col-md-4">
+                  <div class="brand-small-img">
+                    <upload :typeData="index" @uploadAction="onUpload"></upload>
+                  </div>
+                  <div class="file-text">品牌logo/商标注册原件/授权说明书</div>
+                  <div v-show="brands.length > 1" @click="deleteBrand(index)" class="delete" title="删除"><i class="fa fa-trash"></i></div>
+                  <div class="col-md-12"> <em>*</em>仅支持JPG、PNG、GIF、PDF格式,大小不超过3M</div>
+                </div>
+              </div>
+              <div class="add-brand row">
+                <a href="javascript:void(0)" title="增加品牌" @click="addBrand"><em><i class="fa fa-plus-circle"></i>增加品牌</em></a>
+              </div>
+              <div class="unpass-reason row" style="display: none">
+                原因:<span style="color: #d32526;">原因</span>
+              </div>
+            </div>
+            <!--原厂end-->
+            <!--代理商 begin-->
+            <div role="tabpanel" class="tab-pane" v-if="tab == 'AGENCY'" :class="{active: tab == 'AGENCY'}">
+              <div class="row com_row">
+                <div class="col-md-4 custom_col">
+                  <div class="row" style="margin: 0;">
+                    <div class="col-md-5 col-md-offset-1 show_image_area show_image">
+                      <upload :typeData="'BUSINESS_LICENSE'" @uploadAction="onUpload"></upload>
+                    </div>
+                    <div class="col-md-5" style="padding: 0;">
+                      <span style="margin-top: 50%;padding-right: 20px;">营业执照<em style="color: #FF0000;">*</em></span>
+                    </div>
+                  </div>
+                </div>
+                <div class="col-md-4 custom_col">
+                  <div class="row" style="margin: 0;">
+                    <div class="col-md-5 col-md-offset-1 show_image_area show_image">
+                      <upload  :typeData="'TAX_PAYER'" @uploadAction="onUpload"></upload>
+                    </div>
+                    <div class="col-md-5" style="padding: 0;">
+                      <span style="margin-top: 50%;padding-right: 20px;">纳税人证明</span>
+                    </div>
+                  </div>
+                </div>
+                <div class="col-md-4 custom_col">
+                  <div class="row" style="margin: 0;">
+                    <div class="col-md-5 col-md-offset-1 show_image_area show_image">
+                      <upload :typeData="'TAX_REGISTRATION'" @uploadAction="onUpload"></upload>
+                    </div>
+                    <div class="col-md-5" style="padding: 0;">
+                      <span style="margin-top: 50%;padding-right: 20px;">税务登记证</span>
+                    </div>
+                  </div>
+                </div>
+                <div class="col-md-12"><em>* </em>如已上传最新版营业执照(三证合一),则其他两证无需上传 ; 仅支持JPG、PNG、GIF、PDF格式,每张大小不超过3M</div>
+              </div>
+              <!--增加品牌-->
+              <div class="brand-type row" v-for="(brand, index) in brands">
+                <div class="col-md-1">品牌{{index+1}}<em>*</em></div>
+                <div class="col-md-7">
+                  <input type="text" v-model="brand.name"
+                         @input="onBrandInput(brand, index)"
+                         @change="onBrandChanged(brand, index)"
+                         @blur.stop.prevent="showSimilarKey.flag = showFlag"
+                         class="form-control" name="brandName"  autocomplete="off" placeholder="请输入英文品牌或中文品牌,如:松下; panasonic等"/>
+                  <ul class="dropdown-menu"
+                      v-show="showSimilarKey.flag && showSimilarKey.index == index"
+                      @mouseenter="showFlag = true"
+                      @mouseleave="showFlag = false">
+                    <li @mouseenter="setKeyActive"
+                        @mouseleave="setKeyDefault"
+                        v-for="(key, key_index) in similarKeys[index]">
+                      <a v-text="key.nameCn"  @click.stop.prevent="changedName(brand, index, key_index)">
+                        <!--<strong>C</strong>apital Advan<strong>c</strong>ed-->
+                      </a>
+                    </li>
+                  </ul>
+                </div>
+                <div class="brand-small-upload col-md-4">
+                  <div class="brand-small-img">
+                    <upload :typeData="index" @uploadAction="onUpload"></upload>
+                  </div>
+                  <div class="file-text">代理资格证/代理授权书</div>
+                  <div v-show="brands.length > 1" @click="deleteBrand(index)" class="delete" title="删除"><i class="fa fa-trash"></i></div>
+                  <div class="col-md-12"> <em>*</em>仅支持JPG、PNG、GIF、PDF格式,大小不超过3M</div>
+                </div>
+              </div>
+              <div class="add-brand row">
+                <a href="javascript:void(0)" title="增加品牌" @click="addBrand"><em><i class="fa fa-plus-circle"></i>增加品牌</em></a>
+              </div>
+              <div class="unpass-reason row" style="display: none">
+                原因:<span style="color: #d32526;">原因</span>
+              </div>
+            </div>
+            <!--代理商 end-->
+            <!--经销商 begin-->
+            <div role="tabpanel" class="tab-pane" v-if="tab == 'DISTRIBUTION'" :class="{active: tab == 'DISTRIBUTION'}">
+              <div class="row com_row">
+                <div class="col-md-4 custom_col">
+                  <div class="row" style="margin: 0;">
+                    <div class="col-md-5 col-md-offset-1 show_image_area show_image">
+                      <upload :typeData="'BUSINESS_LICENSE'" @uploadAction="onUpload"></upload>
+                    </div>
+                    <div class="col-md-5" style="padding: 0;">
+                      <span style="margin-top: 50%;padding-right: 20px;">营业执照<em style="color: #FF0000;">*</em></span>
+                    </div>
+                  </div>
+                </div>
+                <div class="col-md-4 custom_col">
+                  <div class="row" style="margin: 0;">
+                    <div class="col-md-5 col-md-offset-1 show_image_area show_image">
+                      <upload  :typeData="'TAX_PAYER'" @uploadAction="onUpload"></upload>
+                    </div>
+                    <div class="col-md-5" style="padding: 0;">
+                      <span style="margin-top: 50%;padding-right: 20px;">纳税人证明</span>
+                    </div>
+                  </div>
+                </div>
+                <div class="col-md-4 custom_col">
+                  <div class="row" style="margin: 0;">
+                    <div class="col-md-5 col-md-offset-1 show_image_area show_image">
+                      <upload :typeData="'TAX_REGISTRATION'" @uploadAction="onUpload"></upload>
+                    </div>
+                    <div class="col-md-5" style="padding: 0;">
+                      <span style="margin-top: 50%;padding-right: 20px;">税务登记证</span>
+                    </div>
+                  </div>
+                </div>
+                <div class="col-md-12"><em>* </em>如已上传最新版营业执照(三证合一),则其他两证无需上传 ; 仅支持JPG、PNG、GIF、PDF格式,每张大小不超过3M</div>
+              </div>
+            </div>
+            <!--经销商 end-->
+          </div>
+          <!-- Submit button -->
+          <div style="padding: 28px 40px;">
+            <button type="button" class="btn btn-primary" style="float: right" @click="submitApply">提交申请</button>
+            <div class="clear-fix"></div>
+          </div>
+        </div>
+        <!--删除上传图片-->
+        <div class="com-del-box" style="display: none">
+          <div class="title">
+            <a><i class="fa fa-close fa-lg"></i></a>
+          </div>
+          <div class="content">
+            <p><i class="fa fa-exclamation-circle"></i>是否删除选中信息</p>
+            <div><a>取消</a><a>确认</a></div>
+          </div>
+        </div>
+        <!--删除品牌图片-->
+        <div class="com-del-box" style="display: none">
+          <div class="title">
+            <a><i class="fa fa-close fa-lg"></i></a>
+          </div>
+          <div class="content">
+            <p><i class="fa fa-exclamation-circle"></i>品牌信息为重要信息,确定删除吗?</p>
+            <div><a>取消</a><a>确认</a></div>
+          </div>
+        </div>
+        <!--提示框-->
+        <div class="com-del-box" v-if="showBrandNameInvalid">
+          <div class="title">
+            <a @click="showBrandNameInvalid = false"><i class="fa fa-close fa-lg"></i></a>
+          </div>
+          <div class="content">
+            <p style="line-height: 20px;margin-top: 10px;">非常抱歉,目前暂无此品牌!您可在<br/>“品牌申请”中,提出申请。</p>
+            <p style="line-height: 20px;">前往<a @click="showBrandNameInvalid = false"  target="_blank" href="/vendor#/brand/apply/" style="color: #5078CB">品牌申请&nbsp;<i class="fa fa-arrow-right"></i></a></p>
+          </div>
+        </div>
+      </div>
     <div class="step-last">
       <h4 class="h4">库存寄售</h4>
-      <p class="title">无需开店,即可发布贵司仓库里的滞销产品,优软商城代为销售,匿名清仓无压力<button class="no-apply">暂不开店,直接寄售</button></p>
+      <p class="title">无需开店,即可发布贵司仓库里的滞销产品,优软商城代为销售,匿名清仓无压力<button class="no-apply" @click="goProduct">暂不开店,直接寄售</button></p>
     </div>
     <div class="row next-btn" style="margin-top: 20px"><button @click="sectionChange('prev')">上一步</button></div>
   </div>
 </template>
 <script>
+  import Upload from '~components/common/upload/upload.vue'
   export default {
+    data () {
+      return {
+        tab: 'ORIGINAL_FACTORY',
+        brands: [{
+          type: 'BRAND',
+          name: '',
+          url: '',
+          isPdf: false,
+          brandUuid: ''
+        }],
+        businessLicenseUrl: '',
+        taxPayerUrl: '',
+        taxRegistrationUrl: '',
+        showBrandNameInvalid: false,
+        similarKeys: [[]],
+        showSimilarKey: {
+          flag: false,
+          index: 0
+        },
+        showFlag: false
+      }
+    },
+    components: {
+      Upload
+    },
     methods: {
       sectionChange: function (type) {
         this.$emit('sectionEvent', type)
+      },
+      toggleTab (t) {
+        this.tab = t
+        this.brands = [{
+          type: 'BRAND',
+          name: '',
+          url: '',
+          isPdf: false,
+          brandUuid: ''
+        }]
+      },
+      onUpload: function (obj) {
+        if (obj.type === 'BUSINESS_LICENSE') {
+          this.businessLicenseUrl = obj.url
+        } else if (obj.type === 'TAX_PAYER') {
+          this.taxPayerUrl = obj.url
+        } else if (obj.type === 'TAX_REGISTRATION') {
+          this.taxRegistrationUrl = obj.url
+        } else if (typeof obj.type === 'number') {
+          this.brands[obj.type].url = obj.url
+        }
+      },
+      onBrandChanged: function (item, index) {
+//        this.showSimilarKey = false
+        this.$http.get('/api/product/brand', {params: {name: item.name, op: 'by_name'}})
+          .then(response => {
+            item.brandUuid = response.data.uuid
+            item.isPdf = item.url.substring(item.url.length - 4, item.url.length) === '.pdf'
+          }, err => {
+            console.log(err)
+            this.showBrandNameInvalid = true
+          })
+      },
+      onBrandInput: function (brand, index) {
+        this.showSimilarKey.flag = false
+        this.$http.get('/search/similarBrands?keyword=' + brand.name)
+          .then(response => {
+            this.similarKeys[index] = response.data
+            if (response.data.length > 0) {
+              this.showSimilarKey.flag = true
+              this.showSimilarKey.index = index
+            }
+          })
+      },
+      changedName: function (brand, index, keyIndex) {
+        brand.name = this.similarKeys[index][keyIndex].nameCn
+        this.showSimilarKey.flag = false
+      },
+      setKeyActive: function (e) {
+        e.target.setAttribute('class', 'active')
+      },
+      setKeyDefault: function (e) {
+        e.target.setAttribute('class', '')
+      },
+      submitApply: function () {
+        let validCode = 0
+        if (this.businessLicenseUrl === '') {
+          this.$message.error('请上传营业执照')
+        } else {
+          this.brands.forEach(function (item) {
+            if (item.name === '') {
+              validCode = 1
+            } else if (item.url === '') {
+              validCode = 2
+            }
+          })
+          if (validCode === 0 || this.tab === 'DISTRIBUTION') {
+            let qualifications = []
+            qualifications.push({
+              type: 'BUSINESS_LICENSE',
+              resourceUrl: this.businessLicenseUrl,
+              isPdf: this.isPdf(this.businessLicenseUrl)
+            })
+            if (this.taxPayerUrl !== '') {
+              qualifications.push({
+                type: 'TAX_PAYER',
+                resourceUrl: this.taxPayerUrl,
+                isPdf: this.isPdf(this.taxPayerUrl)
+              })
+            }
+            if (this.taxPayerUrl !== '') {
+              qualifications.push({
+                type: 'TAX_REGISTRATION',
+                resourceUrl: this.taxRegistrationUrl,
+                isPdf: this.isPdf(this.taxRegistrationUrl)
+              })
+            }
+//            console.log(qualifications)
+            this.$http.post('/store-service/applications', {
+              brands: this.brands,
+              qualifications: qualifications,
+              type: this.tab
+            }).then(response => {
+              if (response.data.success) {
+                this.$message.success('感谢您对优软商城的支持,我们会尽快对您提交的信息进行审核,预计审核时间为3个工作日,审核结果将以站内消息及邮件形式通知您!')
+                window.setTimeout(function () {
+                  window.location.href = '/vendor#/store-apply/'
+                }, 1000)
+              } else {
+                this.$message.error('注册失败')
+              }
+            })
+          } else {
+            if (validCode === 1) {
+              this.$message.error('请添加品牌信息')
+            } else if (validCode === 2) {
+              this.$message.error('请上传品牌图片')
+            }
+          }
+        }
+      },
+      addBrand: function () {
+        this.brands.push({
+          type: 'BRAND',
+          name: '',
+          url: '',
+          isPdf: false,
+          brandUuid: ''
+        })
+        this.similarKeys.push([])
+      },
+      deleteBrand: function (index) {
+        this.brands.splice(index, 1)
+        this.similarKeys.splice(index, 1)
+      },
+      isPdf: function (url) {
+        return url.substring(url.length - 4, url.length) === '.pdf'
+      },
+      goProduct: function () {
+        window.location.href = '/vendor#/vendor_productOn'
       }
     }
   }
 </script>
+<style scoped>
+  .com-input{
+    width: 100%;
+    height: 100%;
+    text-align: center;
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    opacity: 0;
+    display: inline-block !important;
+  }
+  .el-upload-list--picture-card .el-upload-list__item{
+    width: 160px;
+    height: 120px;
+    top: 69px;
+  }
+  div.vendor_store_apply {
+    margin: 0 auto;
+    width: 1026px;
+    background-color: #FFFFFF;
+    margin-bottom: 20px;
+    margin-top: 20px;
+  }
+
+  div.vendor_store_apply .com_row {
+    padding: 0 40px;
+    min-height: 40px;
+  }
+
+  div.vendor_store_apply .title_row {
+    margin-bottom: 20px;
+    border-bottom: #e8e8e8 1px solid;
+  }
+
+  div.vendor_store_apply .custom_col {
+    margin: 0;
+    padding: 0;
+  }
+
+  div.vendor_store_apply .custom_col img.previewImage {
+    max-width: 160px;
+    max-height: 120px;
+    cursor: pointer;
+    /*padding: 0 30px;*/
+  }
+
+  div.vendor_store_apply .row h2 {
+    padding: 10px 0;
+    font-size: 16px;
+    font-weight: 500;
+    color: #000000;
+  }
+
+  div.vendor_store_apply .row span {
+    display: block;
+    padding: 10px 0;
+    font-size: 14px;
+    color: #000000;
+  }
+
+  div.vendor_store_apply #file_upload {
+    width: 100px;
+    height: 100px;
+    border:1px solid #CDCDCD;
+    /*background: url("static/img/vendor/images/upload.png");*/
+  }
+
+  div.vendor_store_apply #upload_qualification {
+    width: 100px;
+    height: 100px;
+    opacity: 0;
+  }
+
+  div.vendor_store_apply .custom_tab {
+    margin: 0 15px;
+    width: 90px;
+    text-align: center;
+  }
+
+  div.vendor_store_apply .nav li.custom_tab.active>a,
+  div.vendor_store_apply .nav li.custom_tab.active>a:focus,
+  div.vendor_store_apply .nav li.custom_tab.active>a:hover {
+    border: 1px solid #5078CB;
+    border-bottom-color: transparent;
+    color: #5078cb;
+  }
+
+  div.vendor_store_apply .uploadify-button {
+    display: block;
+  }
+
+  div.vendor_store_apply .custom_col .show_image_area {
+    height: 120px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+  }
+  .nav-tabs{
+    height: 41px;
+    background: none;
+    padding: 0 40px;
+  }
+  .nav-tabs>li>a{
+    border-radius: 0;
+    color: #333;
+  }
+  div.vendor_store_apply .btn-primary{
+    background: #5078cb;
+    border-radius: 0;
+  }
+  div.vendor_store_apply .btn-primary:hover{
+    background: #3f7ae3;
+  }
+  div.vendor_store_apply .com_row .col-md-2{
+    width: 120px;
+  }
+  div.vendor_store_apply .com_row .col-md-10 span{
+    color: #666;
+  }
+
+  /*修改的样式*/
+  div.vendor_store_apply .custom_col .show_image_area{
+    position: relative;
+    overflow: hidden;
+  }
+  .hover-show{
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    top: 120px;
+    left: 0;
+    background: rgba(0,0,0,.5);
+  }
+  div.vendor_store_apply .custom_col .show_image_area .hover-show{
+    top: 0;
+  }
+  .hover-show .delete{
+    padding: 0;
+    width: 30px;
+    height: 30px;
+    float: right;
+    text-align: center;
+  }
+  .hover-show .delete:hover{
+    cursor: pointer;
+  }
+  .hover-show .delete i{
+    color: #fff;
+    font-size: 18px;
+  }
+  .hover-show a{
+    display: inline-block;
+    width: 100%;
+    height: 60px;
+    font-size: 14px;
+    color: #fff;
+    text-align: center;
+    line-height: 60px;
+  }
+  .hover-show a i{
+    margin-right: 5px;
+    font-size: 16px;
+  }
+  .brand-type{
+    line-height: 34px;
+    font-size: 14px;
+    margin: 20px 20px 5px 20px;
+  }
+  .brand-type .brand-small-img{
+    position: relative;
+    width: 84px;
+    height: 84px;
+    overflow: hidden;
+    text-align: center;
+    border: #e8e8e8 1px solid;
+  }
+  .brand-type .brand-small-img .preview img{
+    max-width: 84px;
+    max-height: 84px;
+  }
+  .brand-type em{
+    color: #ff0000;
+  }
+  .brand-type .col-md-7,.brand-type .col-md-1{
+    margin-top: 25px;
+  }
+  .brand-small-upload .file-text,.brand-type .brand-small-img{
+    float: left;
+  }
+  .brand-small-upload .file-text{
+    width: 120px;
+    margin-left: 10px;
+    line-height: 20px;
+    margin-top: 6%;
+  }
+  .brand-small-upload .delete{
+    float: right;
+    text-align: center;
+    line-height: 84px;
+  }
+  .brand-small-upload .delete i{
+    font-size: 18px;
+    color: #5078cb;
+  }
+  .brand-small-upload .delete:hover{
+    cursor: pointer;
+  }
+  .brand-small-upload .delete:hover i{
+    color: #f00;
+  }
+  .brand-small-upload .brand-small-img .hover-show{
+    top: 0;
+  }
+  .brand-small-upload .brand-small-img .hover-show{
+  }
+  .brand-small-upload .brand-small-img .hover-show span i{
+    color: #fff;
+  }
+  .brand-small-upload .brand-small-img .hover-show span.delete{
+    line-height: 30px;
+    padding: 0;
+  }
+  .brand-small-upload .brand-small-img .hover-show a{
+    line-height: 30px;
+    height: 30px;
+  }
+  .tab-content .com_row{
+    margin:40px 0 0;
+    border-bottom: #ccc 1px dashed;
+    padding-bottom: 40px !important;
+  }
+  .tab-content .com_row .col-md-12{
+    color: #999;
+    margin-top: 20px;
+    font-size: 12px;
+    padding-left: 50px;
+  }
+  .brand-small-upload .col-md-12{
+    color: #999;
+    font-size: 12px;
+    padding-left: 0;
+  }
+  .tab-content .com_row .col-md-12 em,.brand-small-upload .col-md-12 em{
+    color: #f00;
+  }
+  .add-brand{
+    text-align: center;
+    border-bottom: #ccc 1px dashed;
+    margin: 0 0 20px 0;
+    height: 34px;
+  }
+  .add-brand a{
+    font-size: 14px;
+    color: #5078cb;
+    width: 200px;
+    height: 15px;
+    display: inline-block;
+    border: #ccc 1px dashed;
+    border-top: 0;
+    border-bottom-left-radius: 50px;
+    border-bottom-right-radius: 50px;
+    margin-top: 31px;
+    background: #fff;
+    line-height: 15px;
+    text-decoration: none;
+  }
+  .add-brand a i{
+    margin-right: 5px;
+    font-size: 20px;
+    vertical-align: middle;
+  }
+  .add-brand a em{
+    position: relative;
+    top: -10px;
+    font-weight: bold;
+    font-style: inherit;
+  }
+  .add-brand a:hover em, .add-brand a:active em, .add-brand a:focus em{
+    color: #d32526;
+    text-decoration: none;
+  }
+  .unpass-reason {
+    margin: 0 40px;
+    line-height: 34px;
+  }
+
+  /* 预览框 end */
+
+  .brand-type .dropdown-menu {
+    width: 95%;
+  }
+  .brand-type .dropdown-menu li {
+    font-size: 14px;
+  }
+  .com-del-box{
+    position: fixed;
+    z-index: 2;
+    height: 152px;
+    opacity: 1;
+    background-color: white;
+    width: 310px;
+    -webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
+    box-shadow: 0 5px 15px rgba(0,0,0,.5);
+    margin: -155px 0 0 -75px;
+    top: 55%;
+    left: 50%;
+  }
+  .com-del-box .title{
+    height: 30px;
+    background-color: #5078cb;
+    text-align: right;
+    padding-right: 15px;
+    line-height: 30px;
+  }
+  .com-del-box .title a{
+    color: white;
+    font-size: 16px;
+  }
+  .com-del-box .content{
+    width: 100%;
+    text-align: center;
+    margin: 0 auto;
+  }
+  .com-del-box .content p{
+    line-height: 50px;
+    font-size: 14px;
+    padding-top: 10px;
+  }
+  .com-del-box .content p i{
+    color: #5078cb;
+    font-size: 16px;
+    margin-right: 10px;
+  }
+  .com-del-box .content div{
+    width: 100%;
+    text-align: center;
+    margin: 0 auto;
+  }
+  .com-del-box .content div a{
+    width: 55px;
+    height: 26px;
+    line-height: 26px;
+    display: inline-block;
+    text-align: center;
+    font-size: 14px;
+  }
+  .com-del-box .content div a:first-child{
+    background: #b4b5b9;
+    color: #333;
+    margin-right: 10px;
+  }
+  .com-del-box .content div a:last-child{
+    background: #5078cb;
+    color: #fff;
+  }
+  .com-del-box .content div a:hover{
+    background: #3f7ae3;
+    color: #fff;
+  }
+  div.vendor_store_apply .custom_col .show_image_area{
+    width: 160px;
+    border: #dcdcdc 1px solid;
+    margin: 0 10px 0 0;
+    padding: 0;
+  }
+  div.vendor_store_apply .tab-content .custom_col{
+    width: 280px;
+  }
+  div.vendor_store_apply .tab-content .custom_col:first-child{
+    margin-left: 50px;
+  }
+  div.vendor_store_apply .custom_col .row .col-md-5:last-child{
+    width: 110px;
+  }
+  div.vendor_store_apply .custom_col .row .col-md-5:last-child span{
+    margin-top: 85% !important;
+    padding-bottom: 0 !important;
+  }
+  .hoverShow{
+    position: absolute;
+    width: 30px;
+    height: 30px;
+    top: 0px;
+    right: 0;
+    background: rgba(0,0,0,.4);
+    display: none;
+  }
+
+  div.vendor_store_apply .custom_col .show_image_area:hover .hoverShow{
+    display: block;
+  }
+  div.vendor_store_apply .custom_col .show_image_area .deleteImg{
+    position: absolute;
+    right: 7px;
+    top: 0;
+    display: inline-block;
+    padding: 0;
+    margin-top: 6px;
+    font-size: 18px;
+    color: #fff;
+  }
+  .hover-show a{
+    color: #fff;
+    text-decoration: none;
+  }
+  .hover-show a:hover, .hover-show a:active, .hover-show a:focus{
+    color: #fff;
+    text-decoration: none;
+  }
+ /* .dropdown-menu>.active>a, .dropdown-menu>.active>a:focus, .dropdown-menu>.active>a:hover {
+    color: #fff;
+  }*/
+  .dropdown-menu {
+    display: block;
+    left: 14px;
+  }
+</style>

+ 18 - 13
components/search/GoodList.vue

@@ -46,14 +46,16 @@
             <th width="110">店铺名称</th>
             <th width="110">库存</th>
             <th width="90">阶梯</th>
-            <th width="90" v-if="!crname_click_flag.rmb_click_flag">香港交货</th>
-            <th width="110" v-if="!crname_click_flag.usd_click_flag">大陆交货<span style="font-size: 12px;">(含税)</span></th>
+         <!--   <th width="90" v-if="!crname_click_flag.rmb_click_flag">香港交货</th>
+            <th width="110" v-if="!crname_click_flag.usd_click_flag">大陆交货<span style="font-size: 12px;">(含税)</span></th>-->
+            <th width="110">单价</th>
             <th width="110">交期<span style="font-size: 12px;">(天)</span></th>
             <th width="100">操作</th>
           </tr>
           </thead>
           <tbody id="productList-content">
-          <tr v-for="item in good_list.components">
+          <tr v-for="item in good_list.components"
+              v-show="!(crname_click_flag.usd_click_flag && item.currencyName != 'USD') || !(crname_click_flag.rmb_click_flag && item.currencyName != 'RMB')">
             <td>
               <nuxt-link :to="`/product/component/${item.uuid}`">
                 <img width="80px" height="80px" :src="item.img?item.img:'/images/component/default.png'">
@@ -83,9 +85,9 @@
               <div class="from" v-if="item.reserve > 0">
                 起拍:<span v-text="item.minBuyQty"></span>
               </div>
-              <div class="multiple" v-if="item.reserve > 0">
+          <!--    <div class="multiple" v-if="item.reserve > 0">
                 倍数:<span v-text="item.minPackQty"></span>
-              </div>
+              </div>-->
             </td>
             <td>
               <div v-show="!item.prices">
@@ -95,22 +97,24 @@
                 <span v-text="price.start"></span> +
               </div>
             </td>
-            <td v-if="!crname_click_flag.rmb_click_flag">
-              <div v-show="!(item.currencyName == 'USD') || !item.prices">
-                <span>—</span>
-              </div>
+            <td>
               <div v-for="price in item.prices">
-                <span>{{price.uSDPrice | currency}}</span>
+                <span v-show="item.currencyName == 'USD'">$</span>
+                <span v-show="item.currencyName == 'RMB'">¥</span>
+                <span>{{price.uSDPrice || price.rMBPrice | currency}}</span>
+              </div>
+              <div v-show="!item.currencyName">
+                <span>—</span>
               </div>
             </td>
-            <td v-if="!crname_click_flag.usd_click_flag">
+           <!-- <td v-if="!crname_click_flag.usd_click_flag">
               <div v-show="!(item.currencyName == 'RMB') || !item.prices">
                 <span>—</span>
               </div>
               <div v-for="price in item.prices">
                 <span>{{price.rMBPrice | currency}}</span>
               </div>
-            </td>
+            </td>-->
             <td>
               <div v-show="!item.b2cMinDelivery">
                 <span>—</span>
@@ -130,7 +134,7 @@
               </div>
             </td>
           </tr>
-          <tr v-if="good_list.components.length == 'undefined' ||good_list.components.length == 0">
+          <tr v-if="!good_list.components || good_list.components.length == 'undefined' ||good_list.components.length == 0">
             <td colspan="10" class="text-center" style="line-height: 40px; font-size: 20px;">
               <i class="fa fa-smile-o fa-lg"></i> 暂无产品信息
             </td>
@@ -181,6 +185,7 @@
         return this.$store.state.searchData.searchList.lists
       },
       good_list () {
+        console.log(this.good_lists.data)
         return this.good_lists.data
       },
       total_count () {

+ 6 - 6
components/search/Kind.vue

@@ -366,7 +366,7 @@
           this.or_click_flag = false
         }
         let idx = this.getIndex(this.type_arr, type)
-        this.type_arr.splice(idx, idx + 1)
+        this.type_arr.splice(idx, 1)
         this.$emit('typeFilterEvent', this.type_arr)
       },
       click_crname: function (name) {
@@ -384,7 +384,7 @@
       },
       cancel_crname: function (name) {
         let idx = this.getIndex(this.crname_arr, name)
-        this.crname_arr.splice(idx, idx + 1)
+        this.crname_arr.splice(idx, 1)
         if (this.crname_arr.length === 1) {
           this.crname_arr = []
         }
@@ -399,16 +399,16 @@
       click_kind_exp: function (id, index) {
         let idx = this.getIndex(this.kind_arr, id)
         this.list_kind[this.kind_exp_arr[index].index] = this.kind_exp_arr[index]
-        this.kind_arr.splice(idx, idx + 1)
+        this.kind_arr.splice(idx, 1)
         this.$emit('kindFilterEvent', this.kind_arr)
-        this.kind_exp_arr.splice(index, index + 1)
+        this.kind_exp_arr.splice(index, 1)
       },
       click_brand_exp: function (id, index) {
         let idx = this.getIndex(this.brand_arr, id)
         this.list_brand[this.brand_exp_arr[index].index] = this.brand_exp_arr[index]
-        this.brand_arr.splice(idx, idx + 1)
+        this.brand_arr.splice(idx, 1)
         this.$emit('brandFilterEvent', this.brand_arr)
-        this.brand_exp_arr.splice(index, index + 1)
+        this.brand_exp_arr.splice(index, 1)
       },
       restore: function (name) {
         if (name === 'kind') {

+ 48 - 20
components/searchStore/SearchTitle.vue

@@ -9,26 +9,26 @@
     </span>
     <div class="tab-filter" >
       <div class="fr">
-        <div class="active"><a >综合排序</a></div>
-        <div class=""><a >库存</a></div>
-        <div class=""><a >销量</a></div>
-        <div class=""><a >信用</a></div>
-        <div class="">
+        <div :class="activeType == 0?'active':''" @click="defaultSearch"><a >综合排序</a></div>
+        <div :class="activeType == 1?'active':''"><a >库存</a></div>
+        <div :class="activeType == 2?'active':''"><a >销量</a></div>
+        <div :class="activeType == 3?'active':''"><a >信用</a></div>
+        <div :class="activeType == 4?'active':''">
           <select @change="onSelectTypeChange" class="form-control select-type select-adder">
             <option value="">店铺类型</option>
             <option value="">原厂</option>
             <option value="">代理</option>
             <option value="">经销</option>
-            <option value="">寄售</option>
+            <!--<option value="">寄售</option>-->
           </select>
         </div>
         <div class=""><a >所在地</a></div>
     </div>
       <div class="off">
-        <a>
-          <span>收起</span>
-          <!-- <i class="fa fa-angle-down"></i>-->
-          <i class="fa fa-angle-up"></i>
+        <a @click="showClick">
+          <span v-text="show?'收起':'展开'"></span>
+          <i v-show="!show" class="fa fa-angle-down"></i>
+          <i v-show="show" class="fa fa-angle-up"></i>
         </a>
       </div>
   </div>
@@ -37,33 +37,58 @@
 <script>
   export default {
     props: ['keyword'],
+    data () {
+      return {
+        activeType: 0,
+        paramType: 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY-CONSIGNMENT',
+        show: true
+      }
+    },
     computed: {
       goodsCount () {
-        return this.$store.state.searchStore.searchStoreDetail.detail.data[0].stores.numberOfElements || 0
+        if (this.$store.state.searchStore.searchStoreDetail.detail.data[0].stores) {
+          return this.$store.state.searchStore.searchStoreDetail.detail.data[0].stores.totalElements || 0
+        } else {
+          return 0
+        }
       }
     },
     methods: {
+      defaultSearch: function () {
+        this.activeType = 0
+        this.paramType = 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY'
+        this.$store.dispatch('searchStore/searchStoreDetail',
+          {
+            page: 1,
+            count: 4,
+            keyword: this.$route.query.w,
+            types: this.paramType,
+            op: 'pageByType'})
+      },
       onSelectTypeChange: function (e) {
         let type = e.target[e.target.selectedIndex].innerHTML
-        let paramType = ''
         if (type === '原厂') {
-          paramType = 'ORIGINAL_FACTORY'
+          this.paramType = 'ORIGINAL_FACTORY'
         } else if (type === '代理') {
-          paramType = 'AGENCY'
+          this.paramType = 'AGENCY'
         } else if (type === '经销') {
-          paramType = 'DISTRIBUTION'
-        } else if (type === '寄售') {
-          paramType = 'CONSIGNMENT'
+          this.paramType = 'DISTRIBUTION'
         } else if (type === '店铺类型') {
-          paramType = 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY-CONSIGNMENT'
+          this.paramType = 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY'
         }
+        this.$emit('typeAction', this.paramType)
         this.$store.dispatch('searchStore/searchStoreDetail',
           {
             page: 1,
             count: 4,
             keyword: this.$route.query.w,
-            types: paramType,
+            types: this.paramType,
             op: 'pageByType'})
+        this.activeType = 4
+      },
+      showClick: function () {
+        this.show = !this.show
+        this.$emit('showAction', this.show)
       }
     }
   }
@@ -99,10 +124,13 @@
     float: left;
     margin: 0 5px;
   }
-  .tab-filter .fr div.active a{
+  .tab-filter .fr div.active a, .tab-filter .fr div.active select{
     border: #5078cb 1px solid;
     color: #5078cb;
   }
+  .tab-filter .fr div.active select option {
+    color: #000;
+  }
   .tab-filter .fr a{
     display: inline-block;
     padding: 1px 10px;

+ 28 - 6
components/searchStore/StoreContent.vue

@@ -8,6 +8,9 @@
         </a>
         <div class="store-detail">
           <a :href="'/store/' + store.uuid">{{store.storeName}}</a>
+          <span href="">电话:{{store.enterprise.enTel}}</span>
+          <span href="">传真:{{store.enterprise.enFax}}</span>
+          <span href="">地址:{{store.enterprise.enAddress}}</span>
         </div>
         <div class="btn-content">
           <span style="position: relative;" class="call-seller">
@@ -28,6 +31,8 @@
       </ul>
     </li>
   </ul>
+    <page :total="storeData.totalElements" :page-size="pageSize"
+          :current="nowPage" v-on:childEvent="listenPage"></page>
     <el-dialog
       :visible.sync="dialogVisible"
       size="tiny"
@@ -43,12 +48,18 @@
   </div>
 </template>
 <script>
+  import Page from '~components/common/page/pageComponent.vue'
   export default {
     data () {
       return {
-        dialogVisible: false
+        dialogVisible: false,
+        pageSize: 8,
+        nowPage: 1
       }
     },
+    components: {
+      Page
+    },
     computed: {
       user () {
         return this.$store.state.option.user
@@ -57,7 +68,6 @@
         return this.$store.state.searchStore.searchStoreDetail.detail.data
       },
       storeData () {
-        console.log(this.storeDetail[0].stores)
         return this.storeDetail[0].stores
       },
       focusData () {
@@ -94,6 +104,9 @@
               })
           }
         }
+      },
+      listenPage: function (page) {
+        this.$emit('pageAction', page)
       }
     }
   }
@@ -138,14 +151,18 @@
     margin-left: 20px;
   }
   .store-detail >a {
+    font-size: 14px;
+    font-weight: 700;
     color: black;
   }
   .store-detail a:hover {
     color: #f39801;
   }
   .store-detail >span{
-    font-size: 14px;
-    font-weight: 700;
+    display: block;
+    margin-top: 10px;
+    font-size: 12px;
+    width: 178px;
   }
   .btn-content .call-seller {
     margin-bottom: 30px;
@@ -188,7 +205,7 @@
     border: 1px solid;
     margin-left: 20px;
     width: 132px;
-    height: 120px;
+    height: 132px;
   }
   .store-component-list >li img {
     width: 100px;
@@ -197,11 +214,16 @@
   .store-component-list >li img:hover {
     cursor: pointer;
   }
-  .store-component-list >li a {
+  .store-component-list >li a:not(:first-child) {
     display: block;
     font-size: 10px;
     color: black;
     margin-top: 3px;
+    max-width: 100px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    height: 16px;
+    line-height: 16px;
   }
   .store-component-list >li a:hover {
     color: #f39801;

+ 2 - 2
components/store/BaseInfo.vue

@@ -5,8 +5,8 @@
         <div class="menu-com row">
           <div class="menu-title col-md-12">
             <a href="/">商城首页</a> >
-            <a href="provider/home" v-if="storeInfo.type == 'AGENCY' || storeInfo.type == 'DISTRIBUTION'" title="代理经销">代理经销</a>
-            <a href="provider/factories" v-if="storeInfo.type == 'ORIGINAL_FACTORY'" title="原厂专区">原厂专区</a>
+            <a href="/provider/home" v-if="storeInfo.type == 'AGENCY' || storeInfo.type == 'DISTRIBUTION'" title="代理经销">代理经销</a>
+            <a href="/provider/factories" v-if="storeInfo.type == 'ORIGINAL_FACTORY'" title="原厂专区">原厂专区</a>
             <a :href="'/store/' + storeInfo.uuid" v-if="storeInfo.type == 'CONSIGNMENT'" title="库存寄售">库存寄售</a>
             >
             <span v-if="storeInfo.type != 'CONSIGNMENT'"><a :href="'/store/' + storeInfo.uuid" :title="storeInfo.storeName" v-text="storeInfo.storeName">店铺名称</a>> </span>

+ 3 - 3
components/store/CommodityInfo.vue

@@ -2,9 +2,9 @@
   <div>
     <div class="menu-com row">
       <div class="menu-title col-md-12">
-        <a href=".">商城首页</a> >
-        <a href="provider/home" v-if="storeInfo.type == 'AGENCY' || storeInfo.type == 'DISTRIBUTION'" title="代理经销">代理经销</a>
-        <a href="provider/factories" v-if="storeInfo.type == 'ORIGINAL_FACTORY'" title="原厂专区">原厂专区</a>
+        <a href="/">商城首页</a> >
+        <a href="/provider/home" v-if="storeInfo.type == 'AGENCY' || storeInfo.type == 'DISTRIBUTION'" title="代理经销">代理经销</a>
+        <a href="/provider/factories" v-if="storeInfo.type == 'ORIGINAL_FACTORY'" title="原厂专区">原厂专区</a>
         <a :href="'/store/' + storeInfo.uuid" v-if="storeInfo.type == 'CONSIGNMENT'" title="库存寄售">库存寄售</a>
         >
         <span v-if="storeInfo.type != 'CONSIGNMENT'"><a :href="'/store/' + storeInfo.uuid" :title="storeInfo.storeName" v-text="storeInfo.storeName">storeInfo.storeName</a>> </span>

+ 2 - 2
components/store/CommodityList.vue

@@ -63,9 +63,9 @@
               <div class="from">
                 起拍:<span v-text="commodity.minBuyQty">300</span>
               </div>
-              <div class="multiple">
+              <!--<div class="multiple">
                 倍数:<span>1</span>
-              </div>
+              </div>-->
             </td>
             <td>
               <div v-for="price in commodity.prices" v-text="price.start + '+'"></div>

+ 2 - 2
nuxt.config.js

@@ -1,6 +1,6 @@
 const path = require('path')
 const isProdMode = Object.is(process.env.NODE_ENV, 'production')
-const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://www.usoftmall.com/' : 'http://192.168.253.60:9090/platform-b2c/')
+const baseUrl = process.env.BASE_URL || (isProdMode ? 'http://www.usoftmall.com/' : 'http://192.168.253.121:8080/platform-b2c/')
 
 module.exports = {
   router: {
@@ -106,5 +106,5 @@ module.exports = {
     ssr: false
   }],
   /* TODO 暂时代理到商城测试版,之后再做出调整 */
-  proxyTable: ['/api/**', '/search/**', '/user/**', '/login/**', '/register/**', '/logout/**', '/static/**', '/vendor**', '/user**', '/trade/**', '/recommendation/**', '/store-service/**', '/basic/**', '/logout**', '/operation/**', '/help**', '/product**', '/store**', '/order/proxy**', '/report/**', '/store/**#/**', '/kdn/**', '/product/**Submit', '/admin**', '/product/**Submit/**']
+  proxyTable: ['/api/**', '/search/**', '/user/**', '/login/**', '/register/**', '/logout/**', '/static/**', '/vendor**', '/user**', '/trade/**', '/recommendation/**', '/store-service/**', '/basic/**', '/logout**', '/operation/**', '/help**', '/product**', '/store**', '/order/proxy**', '/report/**', '/store/**#/**', '/kdn/**', '/product/**Submit', '/admin**', '/product/**Submit/**', '/file**']
 }

+ 4 - 4
pages/register-saler/index.vue

@@ -39,20 +39,20 @@
     text-align: center;
     font-weight: bold;
   }
-  .become-store .content .title{
+  .become-store .content .header-title{
     width: 70%;
     margin: 0 auto;
     margin-bottom: 40px;
   }
-  .become-store .content .title .col-md-6{
+  .become-store .content .header-title .col-md-6{
     padding: 0 45px;
   }
-  .become-store .content .title h4{
+  .become-store .content .header-title h4{
     font-size: 18px;
     line-height: 30px;
     text-align: center;
   }
-  .become-store .content .title p{
+  .become-store .content .header-title p{
     font-size: 14px;
     line-height: 25px;
     color: #666;

+ 17 - 4
pages/searchStore/_keyword.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="container" id="searchResult">
-    <search-title :keyword="key"></search-title>
-    <store-content></store-content>
+    <search-title :keyword="key" @showAction="showAction" @typeAction="onTypeChanged"></search-title>
+    <store-content v-show="show" @pageAction="onPageChanged"></store-content>
   </div>
 </template>
 <script>
@@ -14,13 +14,26 @@
     },
     data () {
       return {
-        key: this.$route.query.w
+        key: this.$route.query.w,
+        show: true,
+        type: 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY'
       }
     },
     fetch ({store, route}) {
       return Promise.all([
-        store.dispatch('searchStore/searchStoreDetail', {page: 1, count: 4, keyword: route.query.w, types: 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY-CONSIGNMENT', op: 'pageByType'})
+        store.dispatch('searchStore/searchStoreDetail', {page: 1, count: 8, keyword: route.query.w, types: 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY', op: 'pageByType'})
       ])
+    },
+    methods: {
+      showAction: function (show) {
+        this.show = show
+      },
+      onPageChanged: function (page) {
+        this.$store.dispatch('searchStore/searchStoreDetail', {page: page, count: 8, keyword: this.$route.query.w, types: this.type, op: 'pageByType'})
+      },
+      onTypeChanged: function (type) {
+        this.type = type
+      }
     }
   }
 </script>