Browse Source

Merge remote-tracking branch 'origin/release-wangcz-201814' into release-wangcz-201814

Administrator 7 years ago
parent
commit
d0e4a2d3c9

+ 56 - 4
components/brandCenter/BrandIndex.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="brand-center-index" id="index">
+  <div class="brand-center-index" id="index" @click="showSimilarWord = false">
     <img src="/images/brandCenter/brand-index-title1.png" alt="">
     <div class="brand-index-tab">
       <div class="brand-index-group" v-for="(indexGroup, index) in indexGroups">
@@ -11,12 +11,15 @@
     <div class="brand-center-index-list">
       <div class="brand-list-nav">
         <div class="filter-area">
-          <input type="text" placeholder="请输入您要搜索的品牌" v-model="keyword" @keyup.13="searchBrands()">
+          <input type="text" placeholder="请输入您要搜索的品牌" @input="onKeywordInput()" v-model="keyword" @keyup.13="searchBrands()">
           <img src="/images/brandCenter/search-btn.png" alt="" @click="searchBrands()">
           <span v-if="brandList.totalElements > 0">{{nowPage}}/{{brandList.totalPages}}
             <a href="javascript:void(0)" class="icon-xiangzuo iconfont" @click="changePage('pre')" :class="{'is-border': nowPage==1}"></a>
             <a href="javascript:void(0)" @click="changePage('next')" class="icon-xiangyou iconfont" :class="{'is-border': nowPage>=brandList.totalPages}"></a>
           </span>
+          <ul class="similar-list" v-show="showSimilarWord && keyword && keyword.length">
+            <li class="text-ellipse" v-for="similar in similarList" @click.stop="setSimilar(similar.nameCn)">{{similar.nameCn}}</li>
+          </ul>
         </div>
       </div>
       <div class="brand-list-items">
@@ -56,6 +59,7 @@
 </template>
 <script>
     import Page from '~components/common/page/pageComponent.vue'
+    import PcSearchHeader from '~components/common/PcSearchHeader.vue'
     export default {
       data () {
         return {
@@ -73,7 +77,10 @@
           isSearch: false,
           brands: {},
           showKeyword: '',
-          showSearchModal: false
+          showSearchModal: false,
+          clickCount: 0,
+          showSimilarWord: false,
+          similarList: []
         }
       },
       filters: {
@@ -105,7 +112,8 @@
         }
       },
       components: {
-        Page
+        Page,
+        PcSearchHeader
       },
       mounted () {
         if (this.$route.path !== '/product/brand/brandList/A') {
@@ -131,6 +139,29 @@
         }
       },
       methods: {
+        onKeywordInput: function () {
+          this.clickCount ++
+          let count = this.clickCount
+          let timer = setTimeout(() => {
+            this.getSimilarList(count, timer)
+          }, 300)
+        },
+        getSimilarList: function (clickCount, timer) {
+          clearTimeout(timer)
+          if (this.keyword && this.keyword !== '' && clickCount === this.clickCount) {
+            this.$http.get('/search/similarKeywords', {params: {keyword: this.keyword}}).then(
+              res => {
+                this.similarList = res.data.brand
+                this.showSimilarWord = true
+              }
+            )
+          }
+        },
+        setSimilar: function (key) {
+          this.showSimilarWord = false
+          this.keyword = key
+          this.searchBrands()
+        },
         initParams: function () {
           this.nowPage = 1
           this.isSearch = false
@@ -414,6 +445,27 @@
               }
             }
           }
+          .similar-list {
+            position: absolute;
+            z-index: 1;
+            right: 150px;
+            top: 41px;
+            border: 1px solid #c9c9c9;
+            text-align: left;
+            width: 318px;
+            background: #fff;
+            /*max-height: 150px;*/
+            /*overflow-y: auto;*/
+            li {
+              padding: 0 11px;
+              height: 30px;
+              line-height: 30px;
+              cursor: pointer;
+              &:hover {
+                background: #f7f7f7;
+              }
+            }
+          }
         }
       }
       .brand-list-items {

+ 1 - 1
components/mobile/MobileHeader.vue

@@ -196,7 +196,7 @@
           title = '产品详情'
         } else if (val === '/mobile/user/bindEnterprise') {
           this.showSearchIcon = false
-          title = '绑定企业'
+          title = '信息确认'
         } else if (this.startWith(val, '/mobile/center/vendor/attentionBus')) {
           this.showSearchIcon = false
           title = '优软商城'

+ 13 - 1
components/mobile/register-saler/register/StepFirst.vue

@@ -98,7 +98,8 @@
         <div class="BangdingPageAlertTitle">该企业<span>已注册优软账号</span>,如希望使用当前企业进行开店申请,请先申请<span>企业绑定</span>!</div>
         <div class="BangdingPageAlertBtn">
           <span @click="resetOnkeyDown()">重新输入</span>
-          <nuxt-link tag="span" to="/mobile/user/bindEnterprise">立即绑定</nuxt-link>
+          <span @click="toBindenterprise()">立即绑定</span>
+          <!--<nuxt-link tag="span" to="/mobile/user/bindEnterprise">立即绑定</nuxt-link>-->
         </div>
       </div>
     </div>
@@ -256,6 +257,17 @@
 //      })
     },
     methods: {
+      toBindenterprise() {
+        this.$http.get('/basic/enterprise/findByName/' + encodeURIComponent(this.data.name)).then(response => {
+          let status
+          if (response.data) {
+            status = 1
+          } else {
+            status = 2
+          }
+          this.$router.push(`/mobile/user/bindEnterprise?name=${response.data.name}&businessCode=${response.data.businessCode}&showStatus=${status}`)
+        })
+      },
       resetOnkeyDown: function() {
         this.showBangdingPage = false
         this.data.name = ''

+ 1 - 1
components/mobile/register-saler/register/StepSecond.vue

@@ -20,7 +20,7 @@
           </div>
         </div>
         <div class="row next-btn step-two-btn" style="padding-top: 0px;">
-          <button @click="sectionChange(1)" class="btn">不同意</button>
+          <button @click="sectionChange(1)" class="btn">上一步</button>
           <button @click="sectionChange(3)" class="btn" :style="!checkData.checked ? 'opacity: 1;':''">同意</button>
         </div>
       </div>

+ 3 - 0
components/mobile/register-saler/register/chooseStoretype.vue

@@ -23,6 +23,9 @@
       <i class="iconfont icon-xiangyou"></i>
       <div class="border-line"></div>
     </div>
+    <!--<div class="btn-area">-->
+      <!--<span @click="go(2)" style="background: #c1c1c1;border:#c1c1c1">上一步</span>-->
+    <!--</div>-->
   </div>
 </template>
 

+ 1 - 1
components/mobile/user/Admin.vue

@@ -53,7 +53,7 @@
   span {
     margin-left: .56rem;
     display: inline-block;
-    width: .92rem;
+    width: 1.2rem;
     text-align: right;
   }
   }

+ 2 - 2
components/mobile/user/Info.vue

@@ -75,9 +75,9 @@
       },
       jumpSet (info) {
         if (info === 'email') {
-          window.open(this.getEmail, '_blank')
+          window.location.herf = decodeURIComponent(this.getEmail)
         } else if (info === 'mobile') {
-          window.open(this.getMobile, '_blank')
+          window.location.herf = decodeURIComponent(this.getMobile)
         }
       }
     }

+ 4 - 4
pages/mobile/center/vendor/index.vue

@@ -43,18 +43,18 @@
           </nuxt-link>
         </ul>
       </div>
-      <!--<div class="block-wrap collect-block">
-       <div class="content-line" @click="goStore">
+      <div class="block-wrap collect-block">
+       <!--<div class="content-line" @click="goStore">
           <img src="/images/mobile/center/vendor/shop.png" alt="">
           <span>我的店铺</span>
           <i class="iconfont icon-xiangyou"></i>
-        </div>
+        </div>-->
         <nuxt-link tag="div" to="/mobile/center/vendor/message"  class="content-line" v-if="user.data.enterprise.uu">
           <img src="/images/mobile/center/user/message.png" alt="">
           <span>消息<span class="text">({{messageCount.count || 0}})</span></span>
           <i class="iconfont icon-xiangyou"></i>
         </nuxt-link>
-      </div>-->
+      </div>
     </div>
     <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
   </div>

+ 28 - 0
pages/mobile/store/register.vue

@@ -0,0 +1,28 @@
+<template>
+  <div>
+    <bind-enterprise :showInfo="showInfo"></bind-enterprise>
+  </div>
+</template>
+
+<script>
+  import bindEnterprise from '../user/bindEnterprise.vue'
+  export  default {
+    data() {
+      return {
+        showInfo: false
+      }
+    },
+    layout: 'mobile',
+    middleware: 'authenticated',
+    components: {
+      bindEnterprise
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  .seek-operation {
+    height: auto;
+    padding-bottom: .59rem;
+  }
+</style>

+ 203 - 2
pages/mobile/user/bindEnterprise.vue

@@ -1,5 +1,9 @@
 <template>
-  <div class="mobile-fix-content mobile-center">
+  <div class="mobile-fix-content mobile-center" v-if="!showInfo">
+    <div class="block-wrap seek-operation">
+      <div class="block-wrap_moreinfo">抱歉,您的账户未绑定企业,暂无卖家权限</div>
+      <div class="block-wrap_morelist" @click="setShowApplyRecord(true)">查看申请记录</div>
+    </div>
     <div class="block-wrap seek-operation">
       <p><i></i>所属企业已开店</p>
       <div class="search-wrap">
@@ -19,23 +23,69 @@
     </div>
     <div class="operation" v-show="showSearchResultStatus !== 0">
       <template v-if="showSearchResultStatus === 1">
-        <a @click="bindEnterprise">申请绑定</a>
+        <a @click="bindEnterprise">提交申请</a>
         <p>管理员审核通过后成功绑定</p>
       </template>
       <template v-if="showSearchResultStatus === 2">
         <a>开设新店铺</a>
       </template>
     </div>
+    <div class="block-wrap seek-operation" v-if="!showInfo">
+      <p><i></i>所属企业未开店</p>
+      <div class="clearfix block-storeinfo">
+        <div class="pull-left">
+          <img src="/images/material/house.png"/>
+        </div>
+        <div class="pull-right">
+          <div class="pull-left-info">请点击下方按钮开设新的店铺</div>
+          <nuxt-link class="pull-left-btn" tag="div" to="/mobile/store">开设新店铺</nuxt-link>
+        </div>
+      </div>
+    </div>
+
     <remind-box :title="remindText" :timeoutCount="remindTimerCount"></remind-box>
+    <div class="mobile-modal" v-show="showApplyRecord">
+      <div class="mobile-modal-box">
+        <div class="mobile-modal-header">申请记录<i class="icon-guanbi iconfont" @click="setShowApplyRecord(false)"></i></div>
+        <div class="mobile-modal-headerjilu" ref="mobileModalBox">
+          <div>
+            <div class="record-wrap">
+              <div class="record-title">
+                <span>企业名称</span>
+                <span>管理员</span>
+                <span>申请时间</span>
+                <span>状态</span>
+              </div>
+              <ul>
+                <li v-for="item in applyList">
+                  <span>{{item.enName}}</span>
+                  <span>{{item.adminName}}</span>
+                  <span>{{item.date | date}}</span>
+                  <span :class="{'green-text': item.status === 311, 'red-text': item.status === 317}">{{item.status | status}}</span>
+                </li>
+              </ul>
+             <div style="position: relative;height: 1rem;"></div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
   </div>
 </template>
 <script>
   import { RemindBox } from '~components/mobile/common'
   export default {
     layout: 'mobile',
+    props: {
+      showInfo: {
+        default: true
+      }
+    },
     middleware: 'authenticated',
     data () {
       return {
+        applyList: [],
+        showApplyRecord: false,
         keyword: '',
         enInfo: {},
         remindText: '',
@@ -47,7 +97,35 @@
     components: {
       RemindBox
     },
+    mounted() {
+      let keyword = this.$route.query.name || ''
+      let businessCode = this.$route.query.businessCode || ''
+      let showStatus = parseInt(this.$route.query.showStatus) || ''
+      this.keyword = keyword
+      this.enInfo.name = keyword
+      this.enInfo.businessCode = businessCode
+      this.showSearchResultStatus = showStatus
+      this.$nextTick(() => {
+        // document.addEventListener('click', this.checkCurrencySelect)
+        this._initscroll()
+      })
+    },
     methods: {
+      setShowApplyRecord: function (flag) {
+        if (flag) {
+          this.$http.get('/basic/enterprise/findApplyInfo', {params: {phone: this.user.data.userTel}})
+            .then(responses => {
+              this.applyList = responses.data
+              this.showApplyRecord = flag
+              this._initscroll()
+            }, err => {
+              console.log(err)
+              this.$message.error('系统错误')
+            })
+        } else {
+          this.showApplyRecord = flag
+        }
+      },
       onSearchEnterprise: function () {
         if (this.keyword) {
           this.$http.get('/basic/enterprise/findByName/' + encodeURIComponent(this.keyword)).then(response => {
@@ -83,6 +161,20 @@
         this.remindText = str
         this.remindTimerCount++
       }
+    },
+    filters: {
+      status: function (status) {
+        switch (status) {
+          case 311:
+            return '待审核'
+          case 316:
+            return '已通过'
+          case 317:
+            return '未通过'
+          default:
+            break
+        }
+      }
     }
   }
 </script>
@@ -171,5 +263,114 @@
         color: rgba(51, 51, 51, .89);
       }
     }
+    .block-storeinfo {
+      margin: 0.48rem 0.2rem 0;
+      padding-bottom: 0.2rem;
+      img {
+        width: 2.18rem;
+        height: 1.73rem;
+      }
+      .pull-left-info {
+        font-size: 0.28rem;
+        color: #3f84f6;
+      }
+      .pull-left-btn {
+        color: #fff;
+        font-size: 0.32rem;
+        width: 3.1rem;
+        height: 0.58rem;
+        text-align: center;
+        line-height: 0.58rem;
+        border-radius: 5px;
+        background: #3f84f6;
+        margin-top: 0.3rem;
+      }
+    }
+    .block-wrap_moreinfo {
+      font-size: 0.34rem;
+      color: #333;
+      text-align: center;
+      padding-top: 0.4rem;
+      margin-bottom: 0.2rem;
+    }
+    .block-wrap_morelist {
+      color: #3f84f6;
+      font-size: 0.32rem;
+      border: 0.01rem solid #3f84f6;
+      text-align: center;
+      width: 3.1rem;
+      height: 0.58rem;
+      line-height: 0.58rem;
+      border-radius: 5px;
+      margin: 0 auto;
+    }
+    .mobile-modal-box {
+      top: 1.66rem;
+      left: 3%;
+      right: 3%;
+      width: 7rem;
+      bottom: 1.66rem;
+      margin: 0 auto;
+    }
+    .mobile-modal-headerjilu {
+      background: #f3f3f3;
+      padding: .18rem 0;
+      width: 100%;
+      overflow: hidden;
+      height: 90%;
+      .record-wrap {
+        font-size: 0.28rem;
+        padding: 0 .18rem;
+        .record-title {
+          height: 28px;
+          line-height: 28px;
+          background: #8eb0f5;
+          border: 1px solid #e8e8e8;
+          color: #fff;
+        }
+        ul {
+          li {
+            border-bottom: 1px solid #e8e8e8;
+            height: 30px;
+            &:nth-child(even) {
+              background: #edf2fd;
+            }
+            &:nth-child(odd) {
+              background: #f7f9fe;
+            }
+            span {
+              line-height: 26px;
+              position: relative;
+              top: 2px;
+              &.green-text {
+                color: #379b1d;
+              }
+              &.red-text {
+                color: #f51c24;
+              }
+            }
+          }
+        }
+        span {
+          overflow: hidden;
+          text-overflow: ellipsis;
+          white-space: nowrap;
+          display: inline-block;
+          text-align: center;
+          &:nth-child(1) {
+            width: 2.6rem;
+          }
+          &:nth-child(2) {
+            width: 1.1rem;
+          }
+          &:nth-child(3) {
+            width: 1.84rem;
+          }
+          &:nth-child(4) {
+            width: 1.04rem;
+          }
+        }
+      }
+    }
   }
 </style>

+ 6 - 4
pages/mobile/user/index.vue

@@ -155,14 +155,16 @@
           if (this.storeStatus.uuid) {
             this.$router.push(url)
           } else {
-            console.log(this.applyStatus)
             if (this.applyStatus === 'PREPARE') {
               this.setRemindText('您的申请已提交,请耐心工作人员审核(2-3个工作日)')
             } else {
-              // 您的申请已提交,请耐心工作人员审核(2-3个工作日)
-              this.$router.push('/mobile/store')
+              if (!this.$store.state.option.user.data.enterprise.uu) {
+                // 进入个人绑定企业页面
+                this.$router.push('/mobile/store/register')
+              } else {
+                this.$router.push('/mobile/store')
+              }
             }
-            // this.setRemindText('请先前往pc端申请开店')
           }
         } else if (!this.user.data.enterprise.uu || this.user.data.enterprise.isVendor !== 313) {
           this.setRemindText('请先前往pc端完善企业信息')

+ 1 - 1
pages/product/brand/brandList/_initial.vue

@@ -17,7 +17,7 @@
         store.dispatch('loadBrandCarousel'),
         store.dispatch('loadBrandBanner'),
         store.dispatch('product/loadRecommends'),
-        store.dispatch('product/loadBrandsPager', {'key': route.params.initial, 'page': 1, 'count': 60, 'keyword': ''})
+        store.dispatch('product/loadBrandsPager', {'initial': route.params.initial, 'page': 1, 'count': 60, 'keyword': ''})
       ])
     },
     components: {