|
@@ -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}
|