yangc 8 лет назад
Родитель
Сommit
ee14e181ba
2 измененных файлов с 45 добавлено и 38 удалено
  1. 44 37
      components/provider/SalesRank.vue
  2. 1 1
      store/option.js

+ 44 - 37
components/provider/SalesRank.vue

@@ -26,44 +26,14 @@
         <span>手慢无!</span>
       </div>
       <ul>
-        <li>
-          <a class="img-wrap">
+        <li v-for="item in originalRank">
+          <a class="img-wrap" :href="item.codeUrl" target="_blank">
             <i></i>
-            <img src="/images/original/pro01.jpg" alt="">
+            <img :src="item.imgUrl" alt="">
           </a>
           <div class="text-wrap">
-            <a>panasonic</a>
-            <a>houass30</a>
-          </div>
-        </li>
-        <li>
-          <a class="img-wrap">
-            <i></i>
-            <img src="/images/original/pro01.jpg" alt="">
-          </a>
-          <div class="text-wrap">
-            <a>panasonic</a>
-            <a>houass30</a>
-          </div>
-        </li>
-        <li>
-          <a class="img-wrap">
-            <i></i>
-            <img src="/images/original/pro01.jpg" alt="">
-          </a>
-          <div class="text-wrap">
-            <a>panasonic</a>
-            <a>houass30</a>
-          </div>
-        </li>
-        <li>
-          <a class="img-wrap">
-            <i></i>
-            <img src="/images/original/pro01.jpg" alt="">
-          </a>
-          <div class="text-wrap">
-            <a>panasonic</a>
-            <a>houass30</a>
+            <a v-text="item.brand" :href="item.brandUrl" target="_blank"></a>
+            <a v-text="item.code" :href="item.codeUrl" target="_blank"></a>
           </div>
         </li>
       </ul>
@@ -73,6 +43,40 @@
 <script>
 export default {
   name: 'sales-rank',
+  data () {
+    return {
+      originalRank: [
+        {
+          code: 'ME4-SO2-E4',
+          brand: 'winsen',
+          imgUrl: 'https://dfs.ubtob.com/group1/M00/57/B7/CgpkyFoDzIyAa9DDAAHns28rA88537.jpg',
+          codeUrl: 'https://www.usoftmall.com/product/component/0501400000000181',
+          brandUrl: 'https://www.usoftmall.com/product/brand/c62a154dcbe94070828b84dc0ea42dba'
+        },
+        {
+          code: 'WTL3M20512',
+          brand: 'WTL',
+          imgUrl: 'https://dfs.ubtob.com/group1/M00/61/D1/CgpkyFpTQreAJZCaAABpVPt31iY540.jpg',
+          codeUrl: 'https://www.usoftmall.com/product/component/1000100400044153',
+          brandUrl: 'https://www.usoftmall.com/product/brand/771c32b029b0415b97009f9490ade671'
+        },
+        {
+          code: 'ME3-PH3',
+          brand: 'winsen',
+          imgUrl: 'https://dfs.ubtob.com/group1/M00/57/B8/CgpkyFoDzJ-AUmSxAAINqd_smDQ340.jpg',
+          codeUrl: 'https://www.usoftmall.com/product/component/0501400000000175',
+          brandUrl: 'https://www.usoftmall.com/product/brand/c62a154dcbe94070828b84dc0ea42dba'
+        },
+        {
+          code: 'RJMU101EHV',
+          brand: 'runjet',
+          imgUrl: 'https://dfs.ubtob.com/group1/M00/61/C6/CgpkyFpDNPOASwwtAAGUrmgl2vc212.jpg',
+          codeUrl: 'https://www.usoftmall.com/product/component/0100800400000219',
+          brandUrl: 'https://www.usoftmall.com/product/brand/de02a6a065c34f28ae682622f9f2821a'
+        }
+      ]
+    }
+  },
   computed: {
     stores () {
       return this.$store.state.provider.storeCms.salesStores.data
@@ -261,12 +265,15 @@ export default {
               a {
                 display: block;
                 color: #666;
-                width: 104px;
+                width: fit-content;
+                max-width: 104px;
                 overflow: hidden;
                 text-overflow: ellipsis;
                 white-space: nowrap;
+                font-weight: bold;
                 &:last-child {
                   font-size: 12px;
+                  font-weight: normal;
                 }
                 &:hover {
                   color: #5078cb;
@@ -282,7 +289,7 @@ export default {
             height: 62px;
             border: 1px solid #d9d9d9;
             margin-left: 9px;
-            line-height: 62px;
+            line-height: 56px;
             text-align: center;
             img {
               max-width: 60px;

+ 1 - 1
store/option.js

@@ -50,7 +50,7 @@ export const mutations = {
   REQUEST_USER_INFO_SUCCESS (state, result) {
     state.user.fetching = false
     state.user.data = result || {}
-    state.user.logged = !!(result && result.userName)
+    state.user.logged = result && result.userName
   },
   REQUEST_USER_INFO_FAILURE (state) {
     state.user.fetching = false