skyblued 2 年之前
父節點
當前提交
0665af03b9

+ 4 - 3
src/views/shop-mall/components/TheHomeHeader/index.module.less

@@ -16,13 +16,14 @@
       width: 20px;
       height: 20px;
       flex-shrink: 0;
-      margin-right: 26px;
+      
     }
     .more {
-      width: 4px;
+      width: 20px;
       height: 16px;
       flex-shrink: 0;
-      margin-right: 6px;
+      margin-left: 16px;
+      object-fit: contain;
     }
   }
   .searchBox {

+ 13 - 7
src/views/shop-mall/components/TheHomeHeader/index.tsx

@@ -7,8 +7,9 @@ import IconCart from '../../images/icon-cart.png'
 import IconMore from '../../images/icon-more.png'
 import IconLocation from '../../images/icon-location.png'
 import IconOrder from '../../images/icon-order.png'
-import { Popover } from 'vant'
+import { Badge, Popover } from 'vant'
 import { postMessage } from '@/helpers/native-message'
+import { cartCount } from '../../shop-mall'
 
 export default defineComponent({
   name: 'TheHomeHeader',
@@ -43,18 +44,23 @@ export default defineComponent({
     ]
     return () => (
       <div class={styles.theHomeHeader}>
-        <div style={{ height: navBarHeight.value + 'px', background: '#fff' }}></div>
+        <div
+          style={{ height: navBarHeight.value + 'px', background: '#fff' }}
+        ></div>
         <div class={styles.content}>
           <img class={styles.mall} src={IconMall} />
           <div class={styles.searchBox} onClick={() => emit('search')}>
             <img class={styles.iconSearch} src={IconSearch} />
             <span>搜索你喜欢的内容</span>
           </div>
-          <img
-            class={styles.cart}
-            src={IconCart}
-            onClick={() => emit('cart')}
-          />
+          <Badge content={cartCount.value} showZero={false}>
+            <img
+              class={styles.cart}
+              src={IconCart}
+              onClick={() => emit('cart')}
+            />
+          </Badge>
+
           <Popover
             placement="bottom-end"
             class={styles.popover}

+ 1 - 1
src/views/shop-mall/index.module.less

@@ -83,7 +83,7 @@
       color: var(--van-primary);
     }
     .van-tabs__nav{
-      padding: 0 4px 0 14px;
+      padding: 0 4px 0 14px !important;
     }
     .van-tabs__line{
       display: none;

+ 6 - 2
src/views/shop-mall/index.tsx

@@ -98,8 +98,9 @@ export default defineComponent({
       }, 500)
     },
     openWebView(url: string): void {
-      // console.log(url)
-      let dev = false
+      try {
+        
+      
       let origin = location.origin + location.pathname + '#'
       if (!url) return
 
@@ -119,6 +120,9 @@ export default defineComponent({
           isHideTitle: false
         }
       })
+    } catch (error) {
+        
+    }
     }
   },
   render() {