Browse Source

供应商、店铺搜索、商机

yangc 7 năm trước cách đây
mục cha
commit
d24e97dd9c

+ 1 - 0
assets/scss/mobileCommon.scss

@@ -312,6 +312,7 @@ html {
   text-align: center;
   position: relative;
   border-bottom: .02rem solid rgb(219, 219, 219);
+  background: #fff;
   > img {
     width: .36rem;
     height: .38rem;

+ 10 - 15
components/mobile/Home.vue

@@ -23,10 +23,10 @@
       </div>
       <ul class="link-list">
         <li>
-          <a @click="goSupplier">
+          <nuxt-link to="/mobile/supplier">
             <img src="/images/mobile/@2x/home/supplier.png" alt="">
             <span>供应商</span>
-          </a>
+          </nuxt-link>
         </li>
         <li>
           <a @click="goOpportunity">
@@ -129,13 +129,6 @@
           this.showLoginBox = true
         }
       },
-      goSupplier () {
-        if (this.user.logged) {
-          this.$router.push('/mobile/supplier')
-        } else {
-          this.showLoginBox = true
-        }
-      },
       onRemind: function (str) {
         this.remindText = str
         this.timeoutCount ++
@@ -146,6 +139,7 @@
 <style lang="scss">
   .home {
     padding-bottom: 1rem;
+    background: #f3f3f7;
     .header {
       height: 3.26rem;
       position: relative;
@@ -175,22 +169,23 @@
       }
     }
     .link-list {
-      background: #f3f3f7;
-      height: 1.36rem;
+      background: #fff;
+      height: 1.56rem;
+      margin-bottom: .2rem;
       li {
         position: relative;
         display: inline-block;
         width: 25%;
         text-align: center;
         float: left;
-        height: 1.36rem;
+        height: 1.56rem;
         img {
-          width: .63rem;
-          height: .63rem;
+          width: .7rem;
+          height: .7rem;
           margin-top: .2rem;
         }
         span {
-          font-size: .22rem;
+          font-size: .26rem;
           color: #666;
           display: block;
           margin-top: .15rem;

+ 1 - 1
components/mobile/applyPurchase/PublishSupplierSeek.vue

@@ -69,7 +69,7 @@
             this.applyObj.code = val.cmpCode
             this.applyObj.brand = isStandard ? val.pbranden : val.brand
             this.applyObj.spec = val.spec
-            this.applyObj.unit = val.unit
+            this.applyObj.unit = val.unit || 'PCS'
             this.applyObj.prodTitle = isStandard ? val.kind : val.prodName
           }
         },

+ 2 - 2
components/mobile/applyPurchase/SeekList.vue

@@ -198,8 +198,8 @@ export default {
 </script>
 <style lang="scss" scoped>
   .seek-list {
-    width: 7.26rem;
-    margin: .13rem auto 0;
+    padding: .13rem .12rem 0;
+    background: #fff;
 
     li {
       border: 1px solid #e0e0e4;

+ 3 - 3
components/mobile/search/MainSearch.vue

@@ -244,14 +244,14 @@
         ul {
           position: absolute;
           li {
-            width: .82rem;
-            height: .59rem;
+            width: 1rem;
+            height: .7rem;
             border-radius: .02rem;
             background: rgba(0, 0, 0, .6);
             font-size: .26rem;
             color: rgba(255, 255, 255, .89);
             text-align: center;
-            line-height: .59rem;
+            line-height: .7rem;
           }
         }
       }

+ 14 - 6
components/mobile/supplier/SupplierDetail.vue

@@ -60,7 +60,7 @@
           </div>
           <div class="prop">
             <span class="head">单位:</span>
-            <span class="item">{{product.unit || ''}}</span>
+            <span class="item">{{product.unit || 'PCS'}}</span>
           </div>
           <a class="seek-btn" @click="publish(product)">立即询价</a>
         </li>
@@ -68,11 +68,12 @@
     </div>
     <publish-supplier-seek :product="currentProduct" :showPublishBox="showPublishBox" @cancelAction="showPublishBox = false" @remindAction="onRemind"></publish-supplier-seek>
     <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
+    <login-box @onLoginBoxClose="showLoginBox = false" v-if="showLoginBox"></login-box>
   </div>
 </template>
 <script>
   import { PublishSupplierSeek } from '~components/mobile/applyPurchase'
-  import { RemindBox } from '~components/mobile/common'
+  import { RemindBox, LoginBox } from '~components/mobile/common'
   export default {
     data () {
       return {
@@ -86,12 +87,14 @@
         showPublishBox: false,
         remindText: '',
         timeoutCount: 0,
-        currentProduct: {}
+        currentProduct: {},
+        showLoginBox: false
       }
     },
     components: {
       PublishSupplierSeek,
-      RemindBox
+      RemindBox,
+      LoginBox
     },
     mounted: function () {
       this.$nextTick(() => {
@@ -150,8 +153,12 @@
         this.reloadData()
       },
       publish: function (product) {
-        this.currentProduct = product
-        this.showPublishBox = true
+        if (this.user.logged) {
+          this.currentProduct = product
+          this.showPublishBox = true
+        } else {
+          this.showLoginBox = true
+        }
       },
       onRemind: function (str) {
         this.remindText = str
@@ -168,6 +175,7 @@
     background: #29a9f9;
     padding: .38rem .19rem;
     position: relative;
+    margin-bottom: 1rem;
     .open {
       position: absolute;
       height: .58rem;

+ 1 - 1
layouts/error.vue

@@ -15,7 +15,7 @@
   export default {
     props: ['error'],
     layout (context) {
-      return context.store.state.option.isMobile ? 'login' : 'default'
+      return context.store.state.option.isMobile ? 'none' : 'default'
     },
     computed: {
       isMobile () {

+ 9 - 7
pages/mobile/search/_keycode.vue

@@ -30,13 +30,15 @@
       </div>
     </div>
 
-    <div class="detail-brand" v-for="(item, index) in searchLists" :style="index == 0 ? 'padding-top: .2rem;' : ''" v-if="searchLists.length > 0">
-      <div class="brand-item" @click="goComponent(item.uuid)">
-        <p>店铺:<span>{{item.storeName || '-'}}</span></p>
-        <p>型号:<span>{{item.code || '-'}}</span></p>
-        <p>品牌:<span>{{item.brandEn || item.brand.nameCn || '-'}}</span></p>
-        <p>产品描述:<span>{{item.description || '-'}}</span></p>
-        <i class="iconfont icon-shoucang" :style="(item.isFocus)?'color:#ff7800':'color:#bbb'" @click="collect(item, $event)"></i>
+    <div v-if="searchLists && searchLists.length > 0" >
+      <div class="detail-brand" v-for="(item, index) in searchLists" :style="index == 0 ? 'padding-top: .2rem;' : ''" v-if="item">
+        <div class="brand-item" @click="goComponent(item.uuid)">
+          <p>店铺:<span>{{item.storeName || '-'}}</span></p>
+          <p>型号:<span>{{item.code || '-'}}</span></p>
+          <p>品牌:<span>{{item.brandEn || item.brand.nameCn || '-'}}</span></p>
+          <p>产品描述:<span>{{item.description || '-'}}</span></p>
+          <i class="iconfont icon-shoucang" :style="(item.isFocus)?'color:#ff7800':'color:#bbb'" @click="collect(item, $event)"></i>
+        </div>
       </div>
     </div>
 

+ 20 - 13
pages/mobile/shop/index.vue

@@ -11,22 +11,29 @@
         <li @click="onDown('CONSIGNMENT')" v-show="downName !== '寄售'">寄售</li>
       </ul>
     </div>
-    <div class="shop-list" v-for="item in searchLists" @click="goStoreDetail(item.uuid)" v-if="item">
-      <h3>{{item.storeName}}</h3>
-      <div class="list-item">
-        <div class="item-img">
-          <i :style="'background:url(' + isType(item.type) + ')no-repeat 0 0/.65rem .33rem;'"></i>
-          <img :src="item.logoUrl || '/images/component/default.png'">
-        </div>
-        <div class="list-item-phone">
-          <p>电话:<span>{{item.enterprise.enTel}}</span></p>
-          <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>
+    <div v-if="searchLists && searchLists.length">
+      <div class="shop-list" v-for="item in searchLists" @click="goStoreDetail(item.uuid)">
+        <h3>{{item.storeName}}</h3>
+        <div class="list-item">
+          <div class="item-img">
+            <i :style="'background:url(' + isType(item.type) + ')no-repeat 0 0/.65rem .33rem;'"></i>
+            <img :src="item.logoUrl || '/images/component/default.png'">
+          </div>
+          <div class="list-item-phone">
+            <p>电话:<span>{{item.enterprise.enTel}}</span></p>
+            <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>
+          </div>
         </div>
       </div>
     </div>
+    <div class="com-none-state" v-else>
+      <img src="/images/mobile/@2x/search-empty.png">
+      <p>抱歉,暂无搜索结果</p>
+      <nuxt-link to="/">返回首页</nuxt-link>
+    </div>
     <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
     <loading v-show="isSearchingMore"></loading>
     <div class="mobile-modal" v-if="showStoreInfo">