Browse Source

阿里图标库引入

yangc 8 years ago
parent
commit
8fdcd155ec
2 changed files with 45 additions and 7 deletions
  1. 1 0
      app.html
  2. 44 7
      components/mobile/brand/ComponentDetail.vue

+ 1 - 0
app.html

@@ -6,6 +6,7 @@
   <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://cdn.bootcss.com/Swiper/3.4.2/css/swiper.css"/>
+  <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_452262_zbrx1cqxr8pycik9.css">
   {{ HEAD }}
   <script>
     (function (w, d) {

+ 44 - 7
components/mobile/brand/ComponentDetail.vue

@@ -52,18 +52,30 @@
               <div v-for="price in store.prices">{{price.start}}+</div>
             </td>
             <td>
-              <div>盒装</div>
-              <div>可拆卖</div>
-              <div>2016+</div>
+              <div v-if="!store.prices || store.prices.length == 0">
+                <span>—</span>
+              </div>
+              <div v-for="price in store.prices">
+                <span v-if="store.currencyName.indexOf('RMB')!==-1">¥{{price.rMBPrice | currency}}</span>
+                <span v-if="store.currencyName.indexOf('USD')!==-1">${{price.uSDPrice | currency}}</span>
+              </div>
             </td>
             <td>
-              <div>1-2</div>
-              <div>1200起订</div>
+              <div v-if="store.b2cMinDelivery">
+                <span>交期:</span>
+                <span>{{store.b2cMinDelivery}}</span>
+                <span v-if="store.b2cMaxDelivery && store.b2cMaxDelivery !== store.b2cMinDelivery">-</span>
+                <span v-if="store.b2cMaxDelivery && store.b2cMaxDelivery !== store.b2cMinDelivery">{{store.b2cMaxDelivery}}</span>
+              </div>
+              <div v-if="store.minBuyQty">{{store.minBuyQty}}起订</div>
+              <div v-if="!store.b2cMinDelivery">
+                <span>—</span>
+              </div>
             </td>
           </tr>
         </tbody>
       </table>
-    </div>{{storeList}}
+    </div>
   </div>
 </template>
 <script>
@@ -114,9 +126,34 @@
             this.UmallExist = true
           }
         }
-        console.log(storeList)
         return storeList
       }
+    },
+    filters: {
+      currency: function (num) {
+        if (typeof num === 'number') {
+          if (num <= 0.000001) {
+            num = 0.000001
+          } else {
+            if (num.toString().indexOf('.') === -1) {
+              num += '.00'
+            } else {
+              let inputStr = num.toString()
+              let arr = inputStr.split('.')
+              let floatNum = arr[1]
+              if (floatNum.length > 6) {
+                num = inputStr.substring(0, arr[0].length + 7)
+                if (Number(floatNum.charAt(6)) > 4) {
+                  num = (Number(num) * 1000000 + 1) / 1000000
+                }
+              } else if (floatNum.length === 1) {
+                num = num + '0'
+              }
+            }
+          }
+        }
+        return num
+      }
     }
   }
 </script>