Browse Source

Merge remote-tracking branch 'origin/feature-201825-wangcz' into dev

# Conflicts:
#	components/mobile/common/StatisticsMobile.vue
wangcz 7 years ago
parent
commit
bf83ba05fc

+ 1 - 1
app.html

@@ -6,7 +6,7 @@
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" />
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/element-ui/1.3.7/theme-default/index.css" />
   <!--<link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_0d1jjt5tukcblnmi.css"/>-->
-  <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_452262_218u5ghbpzt.css">
+  <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_452262_7ji4kygow4.css">
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/Swiper/3.4.2/css/swiper.css" />
   <!--<script src="https://wechatfe.github.io/vconsole/lib/vconsole.min.js?v=3.2.0"></script>-->
   {{ HEAD }}

+ 22 - 14
components/home/displayCard.vue

@@ -4,8 +4,8 @@
      <div class="content" v-if="cardShow">
        <div>
          <ul class="list-unstyled">
-           <li ref="pingdanListWrapper" v-for="item in counts"  :style="'top: -' + 30 * timerIndex + 'px'" :class="{'top': isTop}">
-             <span>{{item.item}}</span>
+           <li ref="pingdanListWrapper" v-for="item in title"  :style="'top: -' + 30 * timerIndex + 'px'" :class="{'top': isTop}">
+             <span>{{item}}</span>
            </li>
          </ul>
          <ul class="list-unstyled">
@@ -32,7 +32,8 @@
         cardShow: true,
         timerIndex: 0,
         isTop: false, // 判断是否滚动至顶,
-        timer: {} // 定时器实体
+        timer: {}, // 定时器实体
+        title: ['品  牌', '现  货', '规格书', '店  铺']
       }
     },
     mounted () {
@@ -52,7 +53,9 @@
               _transitionEvent && this.$refs.pingdanListWrapper[0].addEventListener(
                 _transitionEvent, () => {
                   if (isChange) {
+                    let title = this.title.shift()
                     let count = this.counts.shift()
+                    this.title.push(title)
                     this.counts.push(count)
                     this.timerIndex = 0
                     isChange = false
@@ -171,15 +174,16 @@
         let count = this.baseUtils.deepCopy(this.counter)
         if(count.length){
           count.forEach((value) => {
-            if (value.usedFor === 'mall_home_banner') {
-              value.type = value.detno === 2 ? 3: 1
-              value.count = this.formatNumber(value.count)
-              arr.push(value)
+            if (value.item === '供应商') {
+              arr[0] = {id: value.item, count: this.formatNumber(value.count), type: 3}
+            } else if (value.item === '本年交易金额') {
+              arr[1] = {id: value.item, count: this.formatNumber(value.count), type: 1}
+            } else if (value.item === '上年交易金额') {
+              arr[2] = {id: value.item, count: this.formatNumber(value.count), type: 1}
             }
           })
-          arr = arr.sort((a,b) => {return a.detno - b.detno})
-          arr.push({count: this.inquirySheet ? this.inquirySheet : 0, type: 2},
-            {count: this.inquirySheetLast ? this.inquirySheetLast : 0, type: 2})
+          arr[3] = {id: '本月求购数', count: this.inquirySheet ? this.inquirySheet : 0, type: 2}
+          arr[4] = {id: '上月求购数', count: this.inquirySheetLast ? this.inquirySheetLast : 0, type: 2}
         }
         return arr
       },
@@ -188,12 +192,16 @@
         let count = this.baseUtils.deepCopy(this.counter)
         if(count.length) {
           count.forEach((value) => {
-            if (value.usedFor === 'b2c_index') {
-              value.logo = value.detno === 4 ? 0: 1
-              arr.push(value)
+            if (value.item === '品牌') {
+              arr[0] = {id: value.item, count: value.count, logo: 1}
+            } else if (value.item === '现货') {
+              arr[1] = {id: value.item, count: value.count, logo: 1}
+            } else if (value.item === '规格书') {
+              arr[2] = {id: value.item, count: value.count, logo: 1}
+            } else if (value.item === '店铺') {
+              arr[3] = {id: value.item, count: value.count, logo: 0}
             }
           })
-          arr = arr.sort((a,b) => {return a.detno - b.detno})
         }
         return arr
       }

+ 28 - 4
components/main/Header.vue

@@ -22,12 +22,12 @@
         <!--立即入驻 新手指南-->
         <div class="header-count pull-right">
           <!--新手指南-->
-          <a class="enter" href="/help/home" target="_blank">
-            <img src="/images/all/newPointer.jpg"/>
+          <a class="enter enter01" href="/help/home" target="_blank">
+            <img src="/images/all/newPointer.png"/>
           </a>
           <!--立即入驻-->
-          <a class="enter" @click="goStoreApply()">
-            <img src="/images/all/goInto.jpg"/>
+          <a class="enter enter02" @click="goStoreApply()">
+            <img src="/images/all/goInto.png"/>
           </a>
         </div>
       </div>
@@ -98,4 +98,28 @@
       margin-left: 75px;
     }
   }
+  .header-count a.enter:hover img{
+    transform: scale(1.06);
+  }
+  .header-count a.enter span{
+    display: inline-block;
+    width: 104px;
+    height: 79px;
+  }
+  .header-count a.enter:hover span{
+    width: 110px;
+    height: 84px;
+  }
+  .header-count a.enter01 span{
+    background: url('/images/all/newPointer.png')
+  }
+  .header-count a.enter01:hover span{
+    background: url('/images/all/newPointer01.png')
+  }
+  .header-count a.enter02 span{
+    background: url('/images/all/goInto.png')
+  }
+  .header-count a.enter02:hover span{
+    background: url('/images/all/goInto01.png')
+  }
 </style>

+ 1 - 1
components/main/Nav.vue

@@ -11,7 +11,7 @@
       </nuxt-link>
       <nuxt-link to="/applyPurchase" class="item">
         <span>询价求购</span>
-        <img class="new-animate" src="/images/all/banner-cuxiao03.png" alt="">
+        <img class="new-animate" src="/images/all/bussiness.png" alt="">
       </nuxt-link>
       <!--<nuxt-link to="/supplier" class="item" v-if="!isInFrame">-->
         <!--<span>供应商</span>-->

+ 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>

+ 28 - 12
components/mobile/brand/ComponentDetail.vue

@@ -24,7 +24,10 @@
         <img src="/images/mobile/@2x/brand/nostate-img.png"/>
         暂无描述
       </div>
-      <i class="iconfont icon-shoucang" :style="isCollect?'color:#ff7800':'color: #ddd'" @click="collectComponent"></i>
+      <span class="focus" @click="collectComponent">
+        <i class="iconfont icon-shoucang1" :class="isCollect ? 'icon-shoucang1' : 'icon-shoucang2'"></i>
+        <span v-text="isCollect ? '已收藏' : '收藏'" :class="isCollect ? '' : 'right01'">已收藏</span>
+      </span>
     </div>
     <div class="product-switch-item">
       <span :class="activeType=='store'?'mobile-switch-btn active':'mobile-switch-btn'" @click="activeType='store'">商家</span>
@@ -405,18 +408,31 @@
           color: #999;
         }
       }
-      >i {
-        position: absolute;
-        font-size: .4rem;
-        background: #fff;
-        width: .6rem;
-        height: .6rem;
-        line-height: .6rem;
-        border-radius: 100%;
-        box-shadow: 0 0 .05rem #aaa;
-        right: .28rem;
-        top: .55rem;
+      span.focus{
+        margin: 0 auto;
         text-align: center;
+        i {
+          position: absolute;
+          font-size: .4rem;
+          width: .6rem;
+          height: .6rem;
+          line-height: .6rem;
+          border-radius: 100%;
+          right: .28rem;
+          top: .45rem;
+          color: #fff;
+          text-align: center;
+        }
+        span{
+          position: absolute;
+          right: .19rem;
+          top: .95rem;
+          font-size: .28rem;
+          color: #fff;
+          &.right01 {
+            right: .3rem;
+          }
+        }
       }
     }
     .product-switch-item {

+ 17 - 10
components/mobile/common/StatisticsMobile.vue

@@ -169,20 +169,27 @@
       },
       itemData () {
         let str = []
-        if (this.counter) {
+        if (this.counter.length) {
           this.counter.forEach((value, key, $data) => {
-            if($data[key].item === '店铺' || $data[key].item ==='供应商') {
-              str.push({id: $data[key].item, count: $data[key].count, type: 3})
-            } else if($data[key].item === '本年交易金额' || $data[key].item ==='上年交易金额') {
-              str.push({id: $data[key].item, count: $data[key].count, type: 4})
-            } else {
-              str.push({id: $data[key].item, count: $data[key].count, type: 1})
+            if($data[key].item === '店铺') {
+              str[4] = {id: $data[key].item, count: $data[key].count, type: 3}
+            } else if($data[key].item === '供应商') {
+              str[3] = {id: $data[key].item, count: $data[key].count, type: 3}
+            } else if($data[key].item === '本年交易金额') {
+              str[8] = {id: $data[key].item, count: $data[key].count, type: 4}
+            } else if($data[key].item ==='上年交易金额') {
+              str[7] = {id: $data[key].item, count: $data[key].count, type: 4}
+            } else if($data[key].item === '品牌') {
+              str[1] = {id: $data[key].item, count: $data[key].count, type: 1}
+            } else if($data[key].item === '现货') {
+              str[0] = {id: $data[key].item, count: $data[key].count, type: 1}
+            } else if($data[key].item === '规格书') {
+              str[2] = {id: $data[key].item, count: $data[key].count, type: 1}
             }
           })
         }
-        str.push({id: '本月询价单', count: this.$store.state.count.inquirySheet.data ? this.$store.state.count.inquirySheet.data.count : 0, type: 2})
-        str.push({id: '上月询价单', count: this.$store.state.count.inquirySheetLast.data ? this.$store.state.count.inquirySheetLast.data.count : 0, type: 2})
-        str = [str[1], str[0], str[2], str[4], str[3], str[8], str[7], str[6], str[5]]
+        str[6] = {id: '本月询价单', count: this.$store.state.count.inquirySheet.data ? this.$store.state.count.inquirySheet.data.count : 0, type: 2}
+        str[5] ={id: '上月询价单', count: this.$store.state.count.inquirySheetLast.data ? this.$store.state.count.inquirySheetLast.data.count : 0, type: 2}
         return str
       },
       itemLeft () {

+ 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 {

+ 1 - 1
components/mobile/staffManagement/StaffList.vue

@@ -38,7 +38,7 @@
                 <div class="list-item"><span>角色:</span><span class="role" v-for="role in item.roles" v-text="role.desc ? role.desc.slice(0,2) : ''" v-bind:class="'bg' + role.color">普通</span></div>
               </div>
               <div class="list-footer">
-                <div @click="goEdit(item)" class="edit handle"><i class="iconfont icon-edit"></i><span>编辑</span></div>
+                <div @click="goEdit(item)" class="edit handle"><i class="iconfont icon-edit"></i><span>维护角色</span></div>
                 <div @click="openDelete(item)" class="delete handle"><i class="iconfont icon-lajitong"></i><span>删除</span></div>
               </div>
             </div>

+ 3 - 2
components/provider/ToggleStore.vue

@@ -96,13 +96,14 @@ export default {
       return this.$store.state.provider.stores.originalCount.data
     },
     count () {
+      console.log(this.$store.state.option.counter.data)
       let allCount =  this.$store.state.option.counter.data ? this.$store.state.option.counter.data : []
       if (allCount) {
         allCount.forEach((value) => {
-          if (value.item === '供应商') {
+          if (value.detno === 2 && value.usedFor === 'mall_home_banner') {
             this.supplierArr.push(value.count)
           }
-          if (value.item === '品   牌') {
+          if (value.detno === 1 && value.usedFor === 'b2c_index') {
             this.brandArr.push(value.count)
           }
         })

+ 12 - 4
pages/mobile/center/user/collect/component/_key.vue

@@ -30,7 +30,10 @@
             </div>
             <div class="vir"></div>
             <div class="fr">
-              <i class="iconfont icon-shoucang" :style="comp.isFocus?'color:#ff7800':'color: #ddd'" @click="cancelFocus(comp, $event)"></i>
+              <span class="focus" @click="cancelFocus(comp, $event)">
+                <i class="iconfont icon-shoucang1" :class="comp.isFocus ? 'icon-shoucang1' : 'icon-shoucang2'"></i>
+                {{comp.isFocus ? '已收藏' : '收藏'}}
+              </span>
               <a class="sa-pub" @click="compInquiry(comp, $event)">立即询价</a>
             </div>
           </li>
@@ -304,13 +307,17 @@
           margin-top: .3rem;
           i {
             display: block;
-            color: #ff7800;
+            color: #008bf7;
             font-size: .5rem;
             width: .6rem;
-            height: .6rem;
+            height: .5rem;
             line-height: .6rem;
             text-align: center;
-            margin: .29rem auto .1rem;
+            margin: .15rem auto .1rem
+          }
+          span.focus{
+            font-size: .28rem;
+            color: #008bf7;
           }
           .sa-pub {
             display: block;
@@ -322,6 +329,7 @@
             color: #fff;
             background: #008bf7;
             margin: 0 auto;
+            margin-top: .1rem;
             border-radius: .05rem;
           }
         }

+ 11 - 3
pages/mobile/center/user/collect/component/index.vue

@@ -26,7 +26,10 @@
           </div>
           <div class="vir"></div>
           <div class="fr">
-            <i class="iconfont icon-shoucang" @click="cancelFocus(comp, $event)"></i>
+            <span @click="cancelFocus(comp, $event)">
+              <i class="iconfont icon-shoucang1"></i>
+              <span class="focus">已收藏</span>
+            </span>
             <a class="sa-pub" @click="compInquiry(comp, $event)">立即询价</a>
           </div>
         </li>
@@ -264,13 +267,17 @@
           margin-top: .3rem;
           i {
             display: block;
-            color: #ff7800;
+            color: #008bf7;
             font-size: .5rem;
             width: .6rem;
             height: .6rem;
             line-height: .6rem;
             text-align: center;
-            margin: .29rem auto .1rem;
+            margin: .15rem auto .1rem;
+          }
+          span.focus {
+            font-size: .28rem;
+            color: #008bf7;
           }
           .sa-pub {
             display: block;
@@ -282,6 +289,7 @@
             color: #fff;
             background: #008bf7;
             margin: 0 auto;
+            margin-top: .1rem;
             border-radius: .05rem;
           }
         }

+ 147 - 42
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,11 +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>-->
-            <i class="iconfont icon-shoucang" @click="cancelFocus(item, $event)"></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">
@@ -44,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',
@@ -57,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++
@@ -145,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;
@@ -210,12 +309,18 @@
           top: -.06rem;
           right: -.18rem;
           font-size:.5rem;
-          color:#ff7800;
           width: .6rem;
           height: .6rem;
           text-align: center;
           line-height: .6rem;
         }
+        span.focus{
+          position: absolute;
+          top: .55rem;
+          right: -.28rem;
+          font-size: .28rem;
+          color: #008bf7;
+        }
       }
     }
     &:active {

+ 28 - 25
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" >
@@ -18,9 +18,8 @@
                 {{ item.nameCn | filterStr}}
               </div>
               <div class="attention-button" @click="attentionFn(item, index)">
-                <i class="iconfont icon-shoucang" :class="{'active': item.status}"></i>
-                <p v-if="item.status === 1">取消关注</p>
-                <p v-else>关注</p>
+                <i class="iconfont icon-shoucang1" :class="item.status ? 'icon-shoucang1' : 'icon-shoucang2'"></i>
+                <p v-text="item.status === 1 ? '已关注' : '关注'">已关注</p>
               </div>
             </div>
           </li>
@@ -47,7 +46,7 @@
       middleware: 'authenticated',
       fetch({store}) {
         return Promise.all([
-          store.dispatch('product/getUserCollectCode', {keyword: '', count: 10, page: 1, type: 'yes', enUU: store.state.option.user.data.enterprise.uu})
+          store.dispatch('product/getUserCollectCode', {keyword: '', count: 20, page: 1, type: 'yes', enUU: store.state.option.user.data.enterprise.uu})
         ])
       },
       data() {
@@ -110,30 +109,33 @@
             this.$http.post('/produce/kindConcern/modify', param).then(res => {
               this.collectResult = '取消成功'
               this.timeoutCount++
-              this.attentionList.splice(index, 1)
-              if (this.attentionList.length <= 15 && this.page < this.allPage) {
-                this.page++
-                this.getAttentionListArray(this.page)
-              }
+              // kindConcern.status = 0
+              this.$store.dispatch('product/UpdateCollectCode', { key: index, status: 0 })
+              // this.attentionList.splice(index, 1)
+              // if (this.attentionList.length <= 15 && this.page < this.allPage) {
+              //   this.page++
+              //   this.getAttentionListArray(this.page)
+              // }
             })
           } else {
             this.$http.post('/produce/kindConcern/modify', param).then(res => {
               this.collectResult = '关注成功'
               this.timeoutCount++
-              this.attentionList.splice(index, 1)
-              if (this.attentionList.length <= 15 && this.page < this.allPage) {
-                this.page++
-                this.getAttentionListArray(this.page)
-              }
+              this.$store.dispatch('product/UpdateCollectCode', {key: index, status: 1})
+              // this.attentionList.splice(index, 1)
+              // if (this.attentionList.length <= 15 && this.page < this.allPage) {
+              //   this.page++
+              //   this.getAttentionListArray(this.page)
+              // }
             })
           }
         },
         getAttentionListArray(page) {
           this.isSearchSearchingMore = true
           if (this.activeType === 'attention') {
-            this.$store.dispatch('product/getUserCollectCode', {keyword: this.keyword, count: 20, page: page, type: 'yes', enUU: this.$store.state.option.user.data.enterprise.uu})
+            this.$store.dispatch('product/getUserCollectCode', {keyword: this.keyword, count: 20, page: page, enUU: this.$store.state.option.user.data.enterprise.uu})
           } else {
-            this.$store.dispatch('product/getUserCollectCode', {keyword: this.keyword, count: 20, page: page, type: 'no', enUU: this.$store.state.option.user.data.enterprise.uu})
+            this.$store.dispatch('product/getUserCollectCode', {keyword: this.keyword, count: 20, page: page, enUU: this.$store.state.option.user.data.enterprise.uu})
           }
         },
         getMoreSearch() {
@@ -226,13 +228,14 @@
               font-size: 0.24rem;
               color: #666;
               text-align: center;
-              .icon-shoucang {
-                &.active {
-                  color: #ff7800
-                }
-                color: #dadada;
+              i{
+                color: #008bf7;
                 font-size: 0.5rem;
               }
+              p{
+                font-size: .26rem;
+                color: #008bf7;
+              }
             }
           }
         }

+ 1 - 1
pages/mobile/center/vendor/seek.vue

@@ -60,7 +60,7 @@
         } else {
           params._state = 'done'
           params.filter = {
-            useruu: activeType === 'self' ? user.userUU : null,
+            userUU: activeType === 'self' ? user.userUU : null,
             vendUU: user.enterprise.uu,
             fromDate: null,
             endDate: null,

+ 5 - 1
pages/mobile/shop/index.vue

@@ -37,7 +37,11 @@
               <p>传真:<span>{{item.enterprise.enFax}}</span></p>
               <!--<p>商家介绍: <nuxt-link :to="'/mobile/merchantDescription/'+item.uuid">点击查看</nuxt-link></p>-->
               <!--<p>联系商家:<a @click="selectStoreInfo(item, $event)">点击查看</a></p>-->
-              <i class="iconfont icon-shoucang" :style="item.isFocus=='true'?'color:#ff7800':'color:#bbb'" @click="focusStore(item, $event)"></i>
+              <!--<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>
             </div>
           </div>
         </div>

BIN
static/images/all/bussiness.png


BIN
static/images/all/goInto.png


BIN
static/images/all/goInto01.png


BIN
static/images/all/newPointer.jpg


BIN
static/images/all/newPointer.png


BIN
static/images/all/newPointer01.png


+ 6 - 1
store/product.js

@@ -223,11 +223,16 @@ export const actions = {
   // 获取用户收藏类目数据
   getUserCollectCode({ commit }, params = {}) {
     commit('component/REQUEST_COLLECTCODE')
-    return axios.get('/produce/kindConcern/list', { params: params })
+    return axios.get('/produce/kindConcern/kindList', { params: params })
       .then(response => {
         commit('component/REQUEST_COLLECTCODE_SUCCESS', response.data)
       }, err => {
         commit('component/REQUEST_COLLECTCODE_FAILURE', err)
       })
+  },
+  // 修改当前选择的对象,是否已关注
+  UpdateCollectCode({commit}, params = {}) {
+    commit('component/UpdateOne_PRODUCTINFO', {key: params.key, status: params.status})
   }
 }
+

+ 4 - 0
store/product/component.js

@@ -60,5 +60,9 @@ export const mutations = {
   },
   REQUEST_NOWPRODUCTINFO_FAILURE (state) {
     state.nowProductInfo = false
+  },
+
+  UpdateOne_PRODUCTINFO(state, resulut) {
+    state.collectCode.data.content[resulut.key].status = resulut.status
   }
 }