|
@@ -28,6 +28,7 @@ import {
|
|
|
import ColSearch from '@/components/col-search'
|
|
|
import { browser, setAuth } from '@/helpers/utils'
|
|
|
import { cartCount, getCartCount } from './shop-mall'
|
|
|
+import TheHomeHeader from './components/TheHomeHeader'
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'shop-mall',
|
|
@@ -122,69 +123,46 @@ export default defineComponent({
|
|
|
},
|
|
|
render() {
|
|
|
return (
|
|
|
- <div>
|
|
|
- <div ref="headers">
|
|
|
- <ColHeader
|
|
|
- border={false}
|
|
|
- background="linear-gradient(#59e5d5, 30%, #f6f8f9)"
|
|
|
- onClickRight={() => this.openWebView('/cart')}
|
|
|
- v-slots={{
|
|
|
- right: () => (
|
|
|
- <div class={styles['icon-shop-cart']}>
|
|
|
- <Badge
|
|
|
- class={styles.iconBadge}
|
|
|
- showZero={false}
|
|
|
- offset={[-8, 8]}
|
|
|
- color="rgba(236,92,50,1)"
|
|
|
- content={cartCount.value}
|
|
|
- >
|
|
|
- <Icon name={iconShopCart} size={30} />
|
|
|
- </Badge>
|
|
|
- </div>
|
|
|
- )
|
|
|
- }}
|
|
|
- onHeaderBack={() => {
|
|
|
- this.$nextTick(() => {
|
|
|
- const { height } = useRect((this as any).$refs.headers)
|
|
|
- this.height = height - 1
|
|
|
+ <div class={styles.shopMall}>
|
|
|
+ <TheHomeHeader
|
|
|
+ onCart={() => this.openWebView('/cart')}
|
|
|
+ onSearch={() => this.openWebView('/goodsList?input=focus')}
|
|
|
+ onMore={action => {
|
|
|
+ if(!action) return
|
|
|
+ if (action.text == '我的地址'){
|
|
|
+ postMessage({
|
|
|
+ api: 'setAddress',
|
|
|
+ content: {}
|
|
|
})
|
|
|
- }}
|
|
|
- />
|
|
|
- </div>
|
|
|
+ } else {
|
|
|
+ this.openWebView(action.url)
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
<PullRefresh
|
|
|
v-model={this.loading}
|
|
|
loading-text="正在刷新..."
|
|
|
success-text="刷新完成"
|
|
|
onRefresh={() => this.onRefresh()}
|
|
|
>
|
|
|
- <div
|
|
|
- onClick={() => {
|
|
|
- this.openWebView('/goodsList?input=focus')
|
|
|
- }}
|
|
|
- >
|
|
|
- <ColSearch
|
|
|
- disabled
|
|
|
- class={styles.searchBox}
|
|
|
- background="transparent"
|
|
|
+ <div class={styles.hotContent}>
|
|
|
+ <Swipe class={styles.swipe} autoplay={3000}>
|
|
|
+ {this.advertiseList.map((item: any) => (
|
|
|
+ <SwipeItem onClick={() => this.openWebView(item.url)}>
|
|
|
+ <Image
|
|
|
+ class={styles.swipeItemImg}
|
|
|
+ src={item.pic}
|
|
|
+ fit="fill"
|
|
|
+ />
|
|
|
+ </SwipeItem>
|
|
|
+ ))}
|
|
|
+ </Swipe>
|
|
|
+
|
|
|
+ <MenuList
|
|
|
+ productList={this.productList}
|
|
|
+ onOpenWebView={this.openWebView}
|
|
|
/>
|
|
|
</div>
|
|
|
- <Swipe
|
|
|
- class={styles.swipe}
|
|
|
- autoplay={3000}
|
|
|
- showIndicators={false}
|
|
|
- lazyRender
|
|
|
- >
|
|
|
- {this.advertiseList.map((item: any) => (
|
|
|
- <SwipeItem onClick={() => this.openWebView(item.url)}>
|
|
|
- <Image class={styles.swipeItemImg} src={item.pic} fit="fill" />
|
|
|
- </SwipeItem>
|
|
|
- ))}
|
|
|
- </Swipe>
|
|
|
-
|
|
|
- <MenuList
|
|
|
- productList={this.productList}
|
|
|
- onOpenWebView={this.openWebView}
|
|
|
- />
|
|
|
|
|
|
{this.hotProductList.length === 3 && (
|
|
|
<HotGoods
|
|
@@ -209,12 +187,14 @@ export default defineComponent({
|
|
|
isTab={true}
|
|
|
productAttributeCategoryId={0}
|
|
|
onOpenWebView={this.openWebView}
|
|
|
+ showAdd={false}
|
|
|
/>
|
|
|
</Tab>
|
|
|
{this.productCategoryList.map((item: any) => (
|
|
|
<Tab title={item.name} name={item.id}>
|
|
|
<TabList
|
|
|
isTab={true}
|
|
|
+ showAdd={false}
|
|
|
productAttributeCategoryId={item.id}
|
|
|
onOpenWebView={this.openWebView}
|
|
|
/>
|