Browse Source

店铺类型标签样式修改

yangc 8 years ago
parent
commit
4844dbc515
1 changed files with 16 additions and 19 deletions
  1. 16 19
      pages/mobile/user/index.vue

+ 16 - 19
pages/mobile/user/index.vue

@@ -20,7 +20,7 @@
       <h3>{{item.storeName}}</h3>
       <div class="list-item">
         <div class="item-img">
-          <i :style="getBackground(item.storeInfo.type)"></i>
+          <img :src="getBackground(item.storeInfo.type)" />
           <img :src="item.storeInfo.logoUrl || '/images/component/default.png'">
         </div>
         <div class="list-item-phone">
@@ -90,7 +90,6 @@
     fetch ({ store }) {
       return Promise.all([
         store.dispatch('product/saveStores', { count: 100, page: 1, type: 'component' }),
-        store.dispatch('loadUserInfo'),
         store.dispatch('shop/StoreFocusPage', { count: 100, page: 1 })
       ])
     },
@@ -136,16 +135,15 @@
         }
       },
       getBackground: function (type) {
-        let style = 'background: url('
+        let url = ''
         if (type === 'AGENCY') {
-          style += '/images/mobile/@2x/shop/daili@2x.png'
+          url += '/images/mobile/@2x/shop/daili@2x.png'
         } else if (type === 'DISTRIBUTION') {
-          style += '/images/mobile/@2x/shop/jingxiao@2x.png'
+          url += '/images/mobile/@2x/shop/jingxiao@2x.png'
         } else if (type === 'ORIGINAL_FACTORY') {
-          style += '/images/mobile/@2x/shop/yuanchang@2x.png'
+          url += '/images/mobile/@2x/shop/yuanchang@2x.png'
         }
-        style += ')no-repeat; background-size: .65rem .33rem;'
-        return style
+        return url
       },
       goStoreDetail: function (uuid) {
         this.$router.push('/mobile/shop/' + uuid)
@@ -309,18 +307,17 @@
           width:2.4rem;
           vertical-align: middle;
           display: inline-block;
-          i{
-            display:block;
-            position:absolute;
-            width:.65rem;
-            height:.33rem;
-            background: url(/images/mobile/@2x/shop/daili@2x.png)no-repeat;
-            background-size: .65rem .33rem;
-          }
           img{
-            width:2.4rem;
-            height:1.69rem;
-            border: .04rem solid #eee;
+            &:nth-child(2) {
+              width:2.4rem;
+              height:1.69rem;
+              border: .04rem solid #eee;
+            }
+            &:nth-child(1) {
+              position:absolute;
+              width:.65rem;
+              height:.33rem;
+            }
           }
         }
         .list-item-phone{