Эх сурвалжийг харах

1、优化第二十五期需求

shenjj 7 жил өмнө
parent
commit
07b9a8b268

+ 15 - 0
components/mobile/base/SearchHeader.vue

@@ -223,4 +223,19 @@
       }
     }
   }
+  .outClass {
+    a {
+      display: none;
+    }
+    input{
+      border: 1px solid #376ff3;
+    }
+    ul {
+      left: 0.5rem
+    }
+  }
+  .mobile-search-header.outClass ul {
+    top: 0.8rem;
+    left: 0.5rem;
+  }
 </style>

+ 32 - 23
components/mobile/register-saler/register/StepFirst.vue

@@ -7,11 +7,13 @@
       <!--</div>-->
       <div class="wrap-title"><span class="line"></span>企业基本信息</div>
       <div class="">
-        <label class="col-sm-2 mobile-x-required">企业名称:</label>
-        <div class="col-sm-5 mobile-x-input-kuang">
-          <input :class="!validName.isValidTypeName || !validName.isValidName?'form-control error-box-border':'form-control'" type="text" @input="nameTypeCheck()" @change="nameCheck(3)" :disabled="!loginData.isSelf" v-model="data.name" name="name" required="" placeholder="填写营业执照上的企业名称">
-          <div class="mobile-x-text-help" v-show="validName.isValidTypeName && validName.isValidName && !validName.init">
-            <i class="glyphicon glyphicon-ok x-icon-left"></i>
+        <div class="row clearfix" style="margin: 0 0.25rem;line-height: 0.7rem;padding: 0.2rem 0;border-bottom: 1px solid #dcdcdc">
+          <label class="mobile-x-required pull-left" style="margin-bottom: 0;text-align: right;width: 1.8rem">企业名称:</label>
+          <div class="mobile-x-input-kuang pull-left" style="margin-bottom: 0">
+            <input :class="!validName.isValidTypeName || !validName.isValidName?'form-control error-box-border':'form-control'" type="text" @input="nameTypeCheck()" @change="nameCheck(3)" :disabled="!loginData.isSelf" v-model="data.name" name="name" required="" placeholder="填写营业执照上的企业名称">
+            <div class="mobile-x-text-help" v-show="validName.isValidTypeName && validName.isValidName && !validName.init">
+              <i class="glyphicon glyphicon-ok x-icon-left"></i>
+            </div>
           </div>
         </div>
         <div class="col-sm-5 mobile-x-text-info" v-show="!validName.isValidTypeName && !validName.init">
@@ -26,22 +28,29 @@
         </div>
       </div>
       <div class="">
-        <label class="col-sm-2 mobile-x-required">营业执照号:</label>
-        <div class="col-sm-5 mobile-x-input-kuang">
-          <input type="text" :class="!validLicence.isValidLicence?'form-control error-box-border':'form-control x-input'" :disabled="!loginData.isSelf" @input="validLicence.init=false" @change="licenceCheck(3)" v-model="data.licenceId" name="name" required="" placeholder="请填写营业执照上的注册号">
-          <div class="mobile-x-text-help" v-show="validLicence.isValidLicence && !validLicence.init">
-            <i class="glyphicon glyphicon-ok x-icon-left"></i>
+        <div class="row clearfix" style="margin:0 0.25rem;line-height: 0.7rem;padding: 0.2rem 0;border-bottom: 1px solid #dcdcdc">
+          <label class="mobile-x-required pull-left"  style="margin-bottom: 0;text-align: right;width: 1.8rem">营业执照号:</label>
+          <div class="mobile-x-input-kuang pull-left" style="margin-bottom: 0">
+            <input type="text" :class="!validLicence.isValidLicence?'form-control error-box-border':'form-control x-input'" :disabled="!loginData.isSelf" @input="validLicence.init=false" @change="licenceCheck(3)" v-model="data.licenceId" name="name" required="" placeholder="请填写营业执照上的注册号">
+            <div class="mobile-x-text-help" v-show="validLicence.isValidLicence && !validLicence.init">
+              <i class="glyphicon glyphicon-ok x-icon-left"></i>
+            </div>
           </div>
         </div>
         <div class="col-sm-5 mobile-x-text-info" 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 mobile-x-required">注册地址:</label>
-        <div class="col-sm-5 mobile-x-input-kuang">
-          <input type="text" readonly aria-haspopup="true" aria-expanded="false" @click="onShowAddress" v-model="data.address" class="form-control" name="name" required="" placeholder="填写总部所在地详细地址" style="padding-left:0.4rem;background-color: transparent;">
-          <span class="fa fa-map-marker mobile-fa-map-marker"></span>
-          <div class="mobile-x-text-help" v-show="validAddress.isValidAddress && !validAddress.init">
-            <i class="glyphicon glyphicon-ok x-icon-left"></i>
+        <div class="row clearfix" style="margin:0 0.25rem;line-height: 0.7rem;padding: 0.2rem 0;">
+          <label class="mobile-x-required pull-left" style="margin-bottom: 0;text-align: right;width: 1.8rem">注册地址:</label>
+          <div class="mobile-x-input-kuang pull-left"  style="margin-bottom: 0">
+            <input type="text" readonly aria-haspopup="true" aria-expanded="false" @click="onShowAddress" v-model="data.address" class="form-control" name="name" required="" placeholder="填写总部所在地详细地址" style="background-color: transparent;">
+            <!--<span class="fa fa-map-marker mobile-fa-map-marker"></span>-->
+            <div class="mobile-x-text-help" v-show="validAddress.isValidAddress && !validAddress.init">
+              <i class="glyphicon glyphicon-ok x-icon-left"></i>
+            </div>
+            <div class="mobile-x-text-help" v-show="!validAddress.isValidAddress && validAddress.init" >
+              <i class="glyphicon glyphicon-chevron-right x-icon-left" style="color: #999"></i>
+            </div>
           </div>
         </div>
         <div class="mobile-modal mobile-fiexd-modal" v-show="showAddressBox" @click.stop="">
@@ -91,7 +100,7 @@
         <div class="col-sm-5" v-show="!validAddress.isValidAddress && !validAddress.init"><p><i class="fa fa-info-circle"></i>填写总部所在地详细地址</p></div>
       </div>
     </div>
-    <div class="row next-btn"><button class="btn" style="background: rgb(63, 132, 246);width: 90%; color: #fff;" :style="loginData.isSelf && !isValid ? 'opacity: .65;':''" @click="sectionChange(2)">下一步</button></div>
+    <div class="row next-btn"><button class="btn" style="background: rgb(63, 132, 246);width: 90%; color: #fff;border-radius: 4px" :style="loginData.isSelf && !isValid ? 'opacity: .65;':''" @click="sectionChange(2)">下一步</button></div>
     <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
     <div class="mobile-modal" v-if="showBangdingPage">
       <div class="BangdingPageAlert">
@@ -680,7 +689,7 @@
     margin: 0.2rem 0.2rem;
     border-radius: 5px;
     background: #fff;
-    padding-bottom: 0.3rem;
+    /*padding-bottom: 0.3rem;*/
   }
   .mobile-register input[type="file"] {
     display: block;
@@ -713,16 +722,16 @@
     position: relative;
     input {
       font-size: 0.24rem;
-      padding-right: 0.5rem;
-      padding-left: 0.15rem;
+      padding-right: 0rem;
+      padding-left: 0rem;
       height: 0.7rem;
       line-height: 0.7rem;
-      border: 1px solid #dcdcdc;
+      width: 4.5rem
     }
     .mobile-x-text-help {
       position: absolute;
-      right: 0.5rem;
-      top: 0.2rem;
+      right: 0rem;
+      top: 0rem;
     }
   }
   .mobile-x-text-info {

+ 138 - 43
pages/mobile/center/user/collect/store.vue

@@ -6,14 +6,19 @@
       <p class="en-name"><img :src="`/images/mobile/center/${user.data.enterprise.uu ? 'en' : 'self'}.png`" alt="">{{currentEnName}}</p>
     </div>
     <div class="mobile-content">
-      <div v-if="storeList.length" class="shop-list" v-bind:key="item.id" v-for="item in storeList" @click="goStoreDetail(item.storeInfo.uuid)">
+      <search-header :expandClass="'outClass'" @searchAction="onSearch" :useMatchRule="false" :outerKeyword="keyword" :placeholder="'店铺名/品牌/物料名称/型号'"></search-header>
+      <div v-if="storeList.content.length" class="shop-list" v-bind:key="item.id" v-for="item in storeList.content" @click.prevent="goStoreDetail(item.uuid || item.storeInfo.uuid)">
         <h3>{{item.storeName}}</h3>
         <div class="list-item">
-          <div class="item-img">
-            <img :src="getBackground(item.storeInfo.type)" />
+          <div class="item-img" v-if="item.storeInfo">
+            <img :src="getBackground(item.storeInfo && item.storeInfo.type)" />
             <img :src="item.storeInfo.logoUrl || '/images/component/default.png'">
           </div>
-          <div class="list-item-phone">
+          <div class="item-img" v-else>
+            <img :src="getBackground(item.item)" />
+            <img :src="item.logoUrl || '/images/component/default.png'">
+          </div>
+          <div class="list-item-phone" v-if="item.storeInfo">
             <!--电话:<a :href="'tel:' + item.enterprise.enTel" >{{item.enterprise.enTel}}</a>-->
             <p @click.stop="" v-if="item.storeInfo.enterprise.enTel">电话:<a :href="'tel:' + item.storeInfo.enterprise.enTel" >{{item.storeInfo.enterprise.enTel}}</a></p>
             <p v-else>电话:<span>{{item.storeInfo.enterprise.enTel || '-'}}</span></p>
@@ -21,14 +26,30 @@
             <p v-else>手机:<span>{{item.storeInfo.enterprise.enPhone || '-'}}</span></p>
             <p>传真:<span>{{item.storeInfo.enterprise.enFax || '-'}}</span></p>
             <!--<p>联系商家:<a @click="selectStoreInfo(item, $event)">点击查看</a></p>-->
-            <span @click="cancelFocus(item, $event)">
-               <i class="iconfont icon-shoucang1"></i>
+            <!--<i class="iconfont icon-shoucang" @click.stop="cancelFocus(item, $event)" style="color:#2d8cf0">-->
+            <span @click.stop="cancelFocus(item, $event)">
+               <i class="iconfont icon-shoucang1" style="color:#2d8cf0"></i>
               <span class="focus">已关注</span>
             </span>
+            <!--</i>-->
+          </div>
+          <div class="list-item-phone" v-else>
+            <!--电话:<a :href="'tel:' + item.enterprise.enTel" >{{item.enterprise.enTel}}</a>-->
+            <p @click.stop="" v-if="item.enterprise.enTel">电话:<a :href="'tel:' + item.enterprise.enTel" >{{item.enterprise.enTel}}</a></p>
+            <p v-else>电话:<span>{{item.enterprise.enTel || '-'}}</span></p>
+            <p @click.stop="" v-if="item.enterprise.enPhone">手机:<a :href="'tel:' + item.enterprise.enPhone" >{{item.enterprise.enPhone}}</a></p>
+            <p v-else>手机:<span>{{item.enterprise.enPhone || '-'}}</span></p>
+            <p>传真:<span>{{item.enterprise.enFax || '-'}}</span></p>
+            <!--<p>联系商家:<a @click="selectStoreInfo(item, $event)">点击查看</a></p>-->
+            <span @click.stop="cancelFocus(item, $event, 'choose')">
+              <i class="iconfont icon-shoucang1" :class="item.isFocus == 'true' ? 'icon-shoucang1' : 'icon-shoucang2'" :style="item.isFocus === 'true'?'color:#2d8cf0':''"></i>
+              <span  class="focus" v-text="item.isFocus == 'true' ? '已关注' : '未关注'" :class="item.isFocus == 'true' ? '' : 'right01'" >已关注</span>
+            </span>
+            <!--<i class="iconfont icon-shoucang"  :style="item.isFocus === 'true'?'color:#2d8cf0':'color:#bbb'"></i>-->
           </div>
         </div>
       </div>
-      <empty-status v-if="!storeList.length" :type="'collect'" :showLink="true" :text="'抱歉,暂无店铺关注'"></empty-status>
+      <empty-status v-if="!storeList.content.length" :type="'collect'" :showLink="true" :text="'抱歉,暂无店铺关注'"></empty-status>
     </div>
     <div class="mobile-modal" v-if="showStoreInfo" @touchmove="preventTouchMove($event)">
       <div class="mobile-modal-box mobile-link-en">
@@ -47,7 +68,9 @@
   </div>
 </template>
 <script>
+  import {SearchHeader} from '~components/mobile/base'
   import { RemindBox, PullUp, EmptyStatus } from '~components/mobile/common'
+  import axios from '~plugins/axios'
   export default {
     middleware: 'authenticated',
     layout: 'mobileNoHeader',
@@ -60,63 +83,124 @@
         isChange: false,
         storeList: [],
         showStoreInfo: false,
-        storeInfo: {}
-      }
-    },
-    watch: {
-      'storeCollectList.data': {
-        handler: function (val) {
-          if (this.isChange) {
-            this.storeList = val.content
-            this.isChange = false
-          } else {
-            this.storeList = [...this.storeList, ...val.content]
-          }
-        },
-        immediate: true
+        storeInfo: {},
+        keyword: '',
+        field: '',
+        searchShow: false
       }
     },
+    // watch: {
+    //   'storeCollectList.data': {
+    //     handler: function (val) {
+    //       if (this.isChange) {
+    //         this.storeList = val.content
+    //         this.isChange = false
+    //       } else {
+    //         this.storeList = [...this.storeList, ...val.content]
+    //       }
+    //     },
+    //     immediate: true
+    //   }
+    // },
     computed: {
       storeCollectList () {
-        return this.$store.state.shop.storeInfo.focusPage
+        return this.storeList
       },
       fetching () {
         return this.storeCollectList.fetching
       },
       allPage () {
-        return Math.floor(this.storeCollectList.data.totalElements / this.storeCollectList.data.size) + Math.floor(this.storeCollectList.data.totalElements % this.storeCollectList.data.size > 0 ? 1 : 0)
+        return Math.floor(this.storeCollectList.totalElements / this.storeCollectList.size) + Math.floor(this.storeCollectList.totalElements % this.storeCollectList.size > 0 ? 1 : 0)
       }
     },
-    fetch ({ store }) {
-      return Promise.all([
-        // 获取店铺关注列表
-        store.dispatch('shop/StoreFocusPage', { count: 10, page: 1 })
-      ])
+    async asyncData() {
+      let { data } = await axios.get(`/trade/storeFocus/page`, {params: { count: 10, page: 1 }})
+      return {
+        storeList: data
+      }
     },
     components: {
       RemindBox,
       PullUp,
-      EmptyStatus
+      EmptyStatus,
+      SearchHeader
     },
     methods: {
+      onSearch(keyObj) {
+        console.log(keyObj.keyword)
+        if (keyObj.keyword === '') {
+          if (this.searchShow === true) {
+            this.searchShow = false
+            this.page = 1
+            this.reloadList()
+          }
+          return
+        }
+        this.searchShow = true
+        this.keyword = keyObj.keyword
+        this.field = keyObj.type && keyObj.type !== 'store' ? keyObj.type : ''
+        this.isChange = true
+        this.down = false
+        this.page = 1
+        this.reloadData()
+      },
+      async reloadData () {
+        let { data } = await this.$http.get('/api/store-service/stores', {params: { page: this.page, count: this.count, type: 'ORIGINAL_FACTORY-DISTRIBUTION-AGENCY-CONSIGNMENT', keyword: this.keyword || null, field: this.field, op: 'similar' }})
+        let _pull = []
+        for (let i = 0; i < data.content.length; i++) {
+          _pull.push(findStoreFocusInMobil({id: data.content[i].id}))
+        }
+        Promise.all(_pull)
+          .then(result => {
+              if (result) {
+                for (let i = 0; i < result.length; i++) {
+                  this.$set(data.content[i], 'isFocus', result[i] ? result[i].data : 'false')
+                }
+              }
+          })
+        this.storeList = data
+      },
       onRemind: function (str) {
         this.remindText = str
         this.timeoutCount++
       },
-      cancelFocus: function (item, event) {
-        event.stopPropagation()
-        this.$http.post('/trade/storeFocus/delete/storeId', [item.storeid])
-          .then(response => {
-            this.onRemind('取消成功')
-            this.isChange = true
-            this.page = 1
-            this.reloadList()
-          }, err => {
-            this.onRemind(err.response.data || '取消失败')
-          })
+      cancelFocus(item, event, _tp) {
+        if (_tp) {
+          if (item.isFocus === 'false') {
+            this.$http.post('/trade/storeFocus/save', {storeName: item.storeName, storeid: item.id})
+              .then(response => {
+                item.isFocus = 'true'
+                this.onRemind('关注成功')
+              })
+          } else {
+            this.$http.post('/trade/storeFocus/delete/storeId', [item.id])
+              .then(response => {
+                item.isFocus = 'false'
+                this.onRemind('取消成功')
+              })
+          }
+        } else {
+          event.stopPropagation()
+          this.$http.post('/trade/storeFocus/delete/storeId', [item.storeid])
+            .then(response => {
+              this.onRemind('取消成功')
+              this.isChange = true
+              axios.get(`/trade/storeFocus/page`, {params: { count: 10, page: 1 }}).then(res => {
+                this.storeList = res.data
+              })
+            }, err => {
+              this.onRemind(err.response.data || '取消失败')
+            })
+        }
       },
-      reloadList: function () {
-        this.$store.dispatch('shop/StoreFocusPage', { count: this.count, page: this.page })
+      async reloadList() {
+        if (this.searchShow) {
+          let { data } = await this.$http.get('/api/store-service/stores', {params: { page: this.page, count: this.count, type: 'ORIGINAL_FACTORY-DISTRIBUTION-AGENCY-CONSIGNMENT', keyword: this.keyword || null, field: this.field, op: 'similar' }})
+          this.storeList.content = [...this.storeList.content, ...data.content]
+        } else {
+          let { data } = await axios.get(`/trade/storeFocus/page`, {params: {count: 10, page: this.page}})
+          this.storeList.content = [...this.storeList.content, ...data.content]
+        }
       },
       onPullUpAction: function () {
         this.page++
@@ -148,11 +232,23 @@
       }
     }
   }
+  function findStoreFocusInMobil (store) {
+    return axios.get('/trade/storeFocus/ifFocus?storeid=' + store.id)
+  }
 </script>
 <style lang="scss" scoped>
   .mobile-content {
     padding-top: 1.26rem !important;
   }
+  .mobile-content .com-mobile-header {
+    position: relative;
+    background: #fff;
+    border-bottom: .1rem solid #dfe2e4;
+    height: auto;
+    padding: 0.25rem 0;
+    line-height: normal;
+    z-index: 1;
+  }
   .shop-list {
     background:#fff;
     border-bottom: .1rem solid #dfe2e4;
@@ -213,7 +309,6 @@
           top: -.06rem;
           right: -.18rem;
           font-size:.5rem;
-          color:#008bf7;
           width: .6rem;
           height: .6rem;
           text-align: center;

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

@@ -1,9 +1,9 @@
 <template>
     <div class="attention-bus-wrap" id="attention-bus-wrap">
-      <div class="product-switch-item">
-        <span :class="activeType==='attention'?'mobile-switch-btn active':'mobile-switch-btn'" @click="ChangeTab('attention')">已关注</span>
-        <span :class="activeType==='isattention'?'mobile-switch-btn active':'mobile-switch-btn'" @click="ChangeTab('isattention')">未关注</span>
-      </div>
+      <!--<div class="product-switch-item">-->
+        <!--<span :class="activeType==='attention'?'mobile-switch-btn active':'mobile-switch-btn'" @click="ChangeTab('attention')">已关注</span>-->
+        <!--<span :class="activeType==='isattention'?'mobile-switch-btn active':'mobile-switch-btn'" @click="ChangeTab('isattention')">未关注</span>-->
+      <!--</div>-->
       <div class="search-content" style="padding-bottom: 0.25rem">
         <input type="text" placeholder="请输入您要搜索的物料名称" v-model="keyword" @keyup.13="searchSeek">
         <span @click="searchSeek" >

+ 2 - 16
pages/mobile/shop/index.vue

@@ -40,7 +40,7 @@
               <!--<i class="iconfont icon-shoucang" :style="item.isFocus=='true'?'color:#ff7800':'color:#bbb'" @click="focusStore(item, $event)"></i>-->
               <span class="focus" @click="focusStore(item, $event)">
                  <i class="iconfont icon-shoucang1" :class="item.isFocus == 'true' ? 'icon-shoucang1' : 'icon-shoucang2'"></i>
-                <span v-text="item.isFocus == 'true' ? '已关注' : '关注'" :class="item.isFocus == 'true' ? '' : 'right01'">已关注</span>
+                  <span v-text="item.isFocus == 'true' ? '已关注' : '关注'" :class="item.isFocus == 'true' ? '' : 'right01'">已关注</span>
               </span>
             </div>
           </div>
@@ -355,27 +355,13 @@
             white-space: nowrap;
             width: 3.2rem;
           }
-          span.focus{
-            font-size: .28rem;
-            color: #008bf7;
-            span{
-              position: absolute;
-              top: .55rem;
-              right: -.16rem;
-              font-size: .28rem;
-              color: #008bf7;
-              &.right01{
-                right: -0.05rem;
-              }
-            }
-          }
           i{
             display:block;
             position:absolute;
             top: -.06rem;
             right: -.06rem;
             font-size:.5rem;
-            color:#008bf7;
+            color:#ff7800;
             width: .6rem;
             height: .6rem;
             text-align: center;