Browse Source

测试修改

yangc 6 years ago
parent
commit
f1e3464108

+ 3 - 1
assets/scss/mobileCommon.scss

@@ -342,10 +342,11 @@ html {
 /*空状态*/
 .com-none-state{
   text-align: center;
-  padding: .6rem 0;
+  padding: 1.5rem .5rem .5rem .5rem;
   background: #fff;
   margin-top:.1rem;
   width:100%;
+  word-break: break-all;
   img{
     margin:0 auto;
     width: 4.08rem;
@@ -354,6 +355,7 @@ html {
   p {
     font-size: .32rem;
     color: #999;
+    margin-top: .3rem;
   }
   a {
     display: block;

+ 3 - 3
components/mobile/MobileFooter.vue

@@ -113,9 +113,8 @@
         } else {
             this.showLoginBox = true
           }
-        }
-      },
-//      onReload: function () {
+        },
+      //      onReload: function () {
 //        const path = this.$route.path
 //        if (path === '/') {
 //          this.$store.dispatch('applyPurchase/loadMobileHomeList', {pageNumber: 1, pageSize: 5, enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null})
@@ -135,6 +134,7 @@
         this.timeoutCount ++
       }
     }
+  }
 
 </script>
 <style scoped lang="scss">

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

@@ -134,6 +134,8 @@
       top: .72rem;
       border: 1px solid #ccc;
       border-radius: .05rem;
+      max-height: 4.5rem;
+      overflow-y: auto;
       li {
         height: .6rem;
         line-height: .6rem;

+ 11 - 4
components/mobile/brand/BrandCenter.vue

@@ -28,12 +28,17 @@
               {{activeIndex}}开头共<span>{{brandList.totalElements || 0}}</span>个品牌
             </span>
             </div>
-            <div class="brand-items">
+            <div class="brand-items" v-if="brandListTemplate.length">
               <nuxt-link :to="`/mobile/brand/${brand.uuid}/`" :key="brand.uuid" v-for="brand in brandListTemplate">
                 <div>{{brand.nameEn}}</div>
                 <div v-if="brand.nameCn != brand.nameEn">{{brand.nameCn}}</div>
               </nuxt-link>
             </div>
+            <empty-status :type="'search'"
+                          :text="`抱歉,暂无与“${pageParams.keyword}”匹配的品牌信息`"
+                          :showLink="false"
+                          v-else
+            ></empty-status>
           </div>
         </div>
       </div>
@@ -43,7 +48,7 @@
 </template>
 <script>
   import {SearchHeader} from '~components/mobile/base'
-  import { PullUp } from '~components/mobile/common'
+  import { PullUp, EmptyStatus } from '~components/mobile/common'
   import { startWith } from '~utils/baseUtils'
   export default {
     name: 'brandList',
@@ -64,7 +69,8 @@
     },
     components: {
       SearchHeader,
-      PullUp
+      PullUp,
+      EmptyStatus
     },
     mounted: function () {
       let _this = this
@@ -106,7 +112,7 @@
       onScroll () {
         if (startWith(this.$route.path, '/mobile/brand/brandCenter')) {
           let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
-          this.isScrolled = scrolled > 0
+          this.isScrolled = scrolled > 200
         }
       },
       reloadData: function () {
@@ -139,6 +145,7 @@
       border-radius: .1rem;
       .mobile-brand-header {
         text-align: center;
+        height: 4.32rem;
         >img {
           margin: .24rem auto .19rem;
           width: 6.09rem;

+ 3 - 0
components/mobile/common/EmptyStatus.vue

@@ -40,5 +40,8 @@
     background: transparent;
     padding: 1.5rem .5rem;
     word-break: break-all;
+    p {
+      margin-top: .3rem;
+    }
   }
 </style>

+ 3 - 0
components/mobile/supplier/List.vue

@@ -190,4 +190,7 @@
         }
       }
     }
+  .com-none-state {
+    padding: 1.5rem .5rem .5rem .5rem;
+  }
 </style>

+ 0 - 5
components/supplier/merchant.vue

@@ -84,11 +84,6 @@
       Page
     },
     computed: {
-      isInFrame () {
-        if (this.$route.query.type === 'erp') {
-          return true
-        }
-      },
       list () {
         return this.$store.state.supplier.merchant.merchant.data
       },

+ 0 - 12
layouts/default.vue

@@ -22,18 +22,6 @@
       }
     },
     computed: {
-      isInFrame () {
-        let cookies = this.$store.state.option.cookies
-        let cookieArr = cookies.split(';')
-        let cookieObj = {}
-        for (let i = 0; i < cookieArr.length; i++) {
-          if (cookieArr[i].indexOf('=') > -1) {
-            let tmpArr = cookieArr[i].split('=')
-            cookieObj[tmpArr[0].trim()] = tmpArr[1].trim()
-          }
-        }
-        return cookieObj.type === 'erp'
-      },
       title () {
         let path = this.$route.path
         if (path.startsWith('/help/helpList/')) {

+ 0 - 17
layouts/main.vue

@@ -33,23 +33,6 @@
       isMobile: function () {
         return this.$store.state.option.isMobile
       },
-      isInFrame () {
-        if (this.$route.query.type === 'erp') {
-          this.$store.commit('option/ADD_COOKIES', 'type=erp;')
-          return true
-        } else {
-          let cookies = this.$store.state.option.cookies
-          let cookieArr = cookies.split(';')
-          let cookieObj = {}
-          for (let i = 0; i < cookieArr.length; i++) {
-            let tmpArr = cookieArr[i].split('=') || []
-            if (tmpArr.length === 2) {
-              cookieObj[tmpArr[0].trim()] = tmpArr[1].trim()
-            }
-          }
-          return cookieObj.type === 'erp'
-        }
-      },
       title () {
         let path = this.$route.path
         if (path === '/product/kind/home') {

+ 0 - 17
layouts/shop.vue

@@ -46,23 +46,6 @@
       }
     },
     computed: {
-      isInFrame () {
-        if (this.$route.query.type === 'erp') {
-          this.$store.commit('option/ADD_COOKIES', 'type=erp;')
-          return true
-        } else {
-          let cookies = this.$store.state.option.cookies
-          let cookieArr = cookies.split(';')
-          let cookieObj = {}
-          for (let i = 0; i < cookieArr.length; i++) {
-            if (cookieArr[i].indexOf('=') > -1) {
-              let tmpArr = cookieArr[i].split('=')
-              cookieObj[tmpArr[0].trim()] = tmpArr[1].trim()
-            }
-          }
-          return cookieObj.type === 'erp'
-        }
-      },
       title () {
         let path = this.$route.path
         if ((path.startsWith('/store/') && getCount(path, '/') === 2) || path.endsWith('/description')) {

+ 0 - 20
layouts/uservendor.vue

@@ -28,26 +28,6 @@
       }
     },
     computed: {
-      isMobile: function () {
-        return this.$store.state.option.isMobile
-      },
-      isInFrame () {
-        if (this.$route.query.type === 'erp') {
-          this.$store.commit('option/ADD_COOKIES', 'type=erp;')
-          return true
-        } else {
-          let cookies = this.$store.state.option.cookies
-          let cookieArr = cookies.split(';')
-          let cookieObj = {}
-          for (let i = 0; i < cookieArr.length; i++) {
-            let tmpArr = cookieArr[i].split('=') || []
-            if (tmpArr.length === 2) {
-              cookieObj[tmpArr[0].trim()] = tmpArr[1].trim()
-            }
-          }
-          return cookieObj.type === 'erp'
-        }
-      },
       title () {
         return '卖家中心-优软商城'
       },

+ 1 - 1
pages/mobile/user/storeinfo.vue

@@ -176,7 +176,7 @@
         }
       },
       dealWithText(_T) {
-        if (_T && _T !== '') {
+        if (_T !== undefined) {
           // 文本处理
           this.normalText = _T
           if (_T.length < 140) {

+ 18 - 0
plugins/mixin.js

@@ -23,6 +23,24 @@ Vue.mixin({
       } else {
         return ''
       }
+    },
+    // 判断是否erp嵌入
+    isInFrame () {
+      if (this.$route.query.type === 'erp') {
+        this.$store.commit('option/ADD_COOKIES', 'type=erp;')
+        return true
+      } else {
+        let cookies = this.$store.state.option.cookies
+        let cookieArr = cookies.split(';')
+        let cookieObj = {}
+        for (let i = 0; i < cookieArr.length; i++) {
+          if (cookieArr[i].indexOf('=') > -1) {
+            let tmpArr = cookieArr[i].split('=')
+            cookieObj[tmpArr[0].trim()] = tmpArr[1].trim()
+          }
+        }
+        return cookieObj.type === 'erp'
+      }
     }
   },
   methods: {

+ 7 - 7
store/product.js

@@ -47,14 +47,14 @@ export const actions = {
   },
   // 品牌列表分页查询
   loadBrandsPager ({ commit }, params = {}) {
-    let initial = params.initial
-    let param = {
-      page: params.page || 1,
-      count: params.count || 30,
-      keyword: params.keyword
-    }
+    // let initial = params.initial
+    // let param = {
+    //   page: params.page || 1,
+    //   count: params.count || 30,
+    //   keyword: params.keyword
+    // }
     commit('brand/REQUEST_BRANDS_PAGER', params)
-    return axios.get(`/api/product/brand/initial/first/${initial}`, {params: param})
+    return axios.get(`/api/product/brand/page/initial`, {params: params})
       .then(response => {
         commit('brand/GET_BRANDS_PAGER_SUCCESS', response.data)
       }, err => {