274 lines
7.4 KiB
Plaintext
Raw Normal View History

2021-01-15 12:00:20 +08:00
<style lang="less">
.header-image {
width: 100%;
2021-01-17 02:43:05 +08:00
height: 210px;
2021-01-15 12:00:20 +08:00
z-index: -1;
position: absolute;
top: 0;
}
.user-banner {
2021-01-17 02:43:05 +08:00
margin-top: 190px;
border-top: 1px solid #F5F6F7;
2021-01-15 12:00:20 +08:00
border-top-right-radius: 20px;
border-top-left-radius: 20px;
text-align: left;
background-color: #F5F6F7;
2021-01-15 12:00:20 +08:00
height: 20px;
width: 100%;
z-index: 1;
}
.menu-desc {
2021-01-15 23:31:44 +08:00
border: #fff 1px solid;
2021-01-15 12:00:20 +08:00
border-radius: 20px;
2021-01-15 23:31:44 +08:00
width: 270rpx;
2021-01-17 02:43:05 +08:00
height: 42px;
2021-01-15 12:00:20 +08:00
box-shadow: 4px 4px 10px #cccccc;
2021-01-15 23:31:44 +08:00
background-color: #ffffff;
2021-01-17 02:43:05 +08:00
padding: 16px;
2021-01-15 12:00:20 +08:00
display: flex;
2021-01-15 23:31:44 +08:00
2021-01-15 12:00:20 +08:00
font-weight: bold;
}
2021-01-15 23:31:44 +08:00
.grid-body {
border: #fff 1px solid;
border-radius: 20px;
width: 100%;
2021-01-15 23:31:44 +08:00
margin-top: 20px;
background-color: white;
box-shadow: 4px 4px 10px #eeeeee;
}
2021-01-15 12:00:20 +08:00
.menu-desc-text {
margin-top: 5px;
2021-01-15 23:31:44 +08:00
font-size: 12px;
color: #999;
display: flex;
2021-01-15 12:00:20 +08:00
}
.grid-item {
background-color: #eeeeee;
}
.column-record-item {
border: transparent 1px solid;
border-radius: 20px;
box-shadow: 4px 4px 10px #cccccc;
display: flex;
flex-direction: column;
font-weight: bold;
}
.column-record-item-text {
font-size: 20px;
margin: 10px;
display: flex;
flex-direction: column;
}
</style>
2021-01-20 19:08:32 +08:00
<wxs module="filters" lang="babel">
const parseImage = (imageKey) => {
return 'https://winery-1257413599.cos.ap-beijing.myqcloud.com/' + imageKey
}
module.exports.parseImage = parseImage;
</wxs>
2021-01-15 12:00:20 +08:00
<template>
2021-01-20 17:25:41 +08:00
<div class="container">
<image class="header-image" :src="navDefine.HOME_HEADER.image" />
2021-01-15 12:00:20 +08:00
<div class="user-banner" />
2021-01-17 02:43:05 +08:00
<view style="margin: 0px 16px;display: flex;flex-direction: column;">
2021-01-15 12:00:20 +08:00
<van-row>
<van-col offset="1" span="4">
<van-image round width="96rpx" height="96rpx" :src="user.userInfo.avatarUrl" />
2021-01-15 12:00:20 +08:00
</van-col>
<van-col offset="1" span="10">
<div class="fxc" style="display: flex;flex-direction: column;">
2021-01-20 19:08:32 +08:00
<span style="font-size: 19px;font-weight: bold;">{{user.userInfo.nickName}}</span>
<span style="font-size: 11px;color: #999999;">{{user.mobile}}</span>
2021-01-15 12:00:20 +08:00
</div>
</van-col>
2021-01-15 23:31:44 +08:00
<van-col offset="1" span="7">
<van-button round style="height: 25px;" size="small" plain color="#AC1630" @tap="onShoppingCar">
2021-01-15 23:31:44 +08:00
<van-icon name="shopping-cart-o" color="#AC1630" />
<span style="margin-left: 5px;color: #333333;">购物车</span>
</van-button>
2021-01-15 12:00:20 +08:00
</van-col>
</van-row>
<van-notice-bar
text="在代码阅读过程中人们说脏话的频率是衡量代码质量的唯一标准。"
mode="link"
background="#ddd"
color="#333"
style="margin-top: 16px;"
>
2021-01-17 02:43:05 +08:00
<van-image slot="left-icon" :src="imageDefine.HOME_NOTICE_ICON" width="18px" height="19px"
style="margin-top: 5px;margin-left: 5px" />
</van-notice-bar>
2021-01-15 12:00:20 +08:00
<van-row style="margin-top: 20px;">
<van-col span="11">
2021-01-15 23:31:44 +08:00
<div class="menu-desc" @tap="onNavItem(navDefine.HOME_MENU1)">
<div class="fxc">
2021-01-17 02:43:05 +08:00
<span style="font-size: 16px;">酒庄介绍</span>
2021-01-15 23:31:44 +08:00
<span class="menu-desc-text">完美酿造工艺</span>
</div>
<van-image style="margin-left: 10px;" width="40px" height="40px" :src="navDefine.HOME_MENU1.image" />
2021-01-15 12:00:20 +08:00
</div>
</van-col>
2021-01-15 23:31:44 +08:00
<van-col offset="1" span="11">
2021-01-20 17:25:41 +08:00
<div class="menu-desc" @tap="onBuy()">
2021-01-15 23:31:44 +08:00
<div class="fxc">
2021-01-17 02:43:05 +08:00
<span style="font-size: 16px;">购买庄酒</span>
2021-01-15 23:31:44 +08:00
<span class="menu-desc-text">限量年份套装</span>
</div>
<van-image style="margin-left: 10px;" width="40px" height="40px" :src="navDefine.HOME_MENU2.image" />
2021-01-15 12:00:20 +08:00
</div>
2021-01-15 23:31:44 +08:00
2021-01-15 12:00:20 +08:00
</van-col>
2021-01-15 23:31:44 +08:00
2021-01-15 12:00:20 +08:00
</van-row>
2021-01-15 23:31:44 +08:00
<div class="grid-body">
<van-grid column-num="3" border="{{ false }}" style="margin-top: 15px;">
<van-grid-item use-slot v-for=" (item, index) in navDefine.HOME_MENU_LIST" @tap="onNavItem(item)">
2021-01-17 02:43:05 +08:00
<van-image width="68rpx" height="68rpx" :src="item.icon" />
<span style="font-size: 12px;font-weight: bold;">{{item.name}} </span>
2021-01-15 23:31:44 +08:00
</van-grid-item>
</van-grid>
</div>
2021-01-15 12:00:20 +08:00
2021-01-20 19:08:32 +08:00
<!-- <div style="margin: 22px 2px 12px 2px; display: flex; align-items: center;">-->
<!-- <van-image :src="imageDefine.HOME_WINE_LAB" height="16px" width="5px" />-->
<!-- <span style="margin:0px 5px;font-weight: bold;">热门活动</span>-->
<!-- </div>-->
2021-01-15 12:00:20 +08:00
2021-01-20 19:08:32 +08:00
<!-- <van-image width="100%" height="96px" :src="navDefine.HOME_BANNER1.image"-->
<!-- @tap="onNavItem(navDefine.HOME_BANNER1)" />-->
<!-- <div style="margin: 22px 2px 12px 2px; display: flex; align-items: center;">-->
<!-- <van-image :src="imageDefine.HOME_WINE_LAB" height="16px" width="5px" />-->
<!-- <span style="margin:0px 5px;font-weight: bold;">每日精选</span>-->
<!-- </div>-->
<!-- <van-image width="100%" height="128px" :src="navDefine.HOME_BANNER2.image"-->
<!-- @tap="onNavItem(navDefine.HOME_BANNER2)" />-->
2021-01-17 02:43:05 +08:00
2021-01-21 10:10:44 +08:00
<div v-for="(item, index) in records" style="margin: 22px 2px 0px 2px; ">
2021-01-21 11:29:21 +08:00
<div v-if="item.type !== 0" style="display: flex; align-items: center;margin-bottom: 5px;">
2021-01-20 19:08:32 +08:00
<van-image :src="imageDefine.HOME_WINE_LAB" height="16px" width="5px" />
<span style="margin:0px 5px;font-weight: bold;"> {{item.type === 1 ? '每日精选' : '热门活动'}}</span>
</div>
<van-image width="100%" :height="item.imageHeight + 'px'" :src="filters.parseImage(item.image)"
2021-01-21 10:10:44 +08:00
@tap="onWebItem(item)" />
2021-01-20 19:08:32 +08:00
</div>
2021-01-15 12:00:20 +08:00
2021-01-17 02:43:05 +08:00
<!-- <div class="column-record-item" v-for="(item, index) in columnRecord" @tap="onNavItem(navDefine.HOME_BANNER2)">-->
<!-- <van-image width="100%" height="128px" :src="navDefine.HOME_BANNER2.image" />-->
<!-- <div class="column-record-item-text">-->
<!-- <span>{{item.title}} </span>-->
<!-- <span style="font-size: 12px;font-weight: normal;">{{item.createTime}} </span>-->
<!-- </div>-->
2021-01-15 12:00:20 +08:00
2021-01-17 02:43:05 +08:00
<!-- </div>-->
2021-01-15 12:00:20 +08:00
2021-01-17 02:43:05 +08:00
<div style="margin-top: 100px;" />
2021-01-15 12:00:20 +08:00
</view>
</div>
</template>
<script>
import wepy from '@wepy/core'
import store from '@/store'
import { mapActions, mapState } from '@wepy/x'
2021-01-15 23:31:44 +08:00
import defaultMix from '../../../mixins/defaultMix'
import orderApis from '../../../apis/orderApis'
2021-01-18 09:01:56 +08:00
import appManager from '../../../appManager'
import { navDefine } from '../../../store/constant/navDefine'
2021-01-18 16:10:59 +08:00
import xiao4rApis from '../../../apis/xiao4rApis'
2021-01-20 17:25:41 +08:00
import { webViewPage } from '../../../store/constant/nav/pages'
2021-01-20 19:08:32 +08:00
import mallApis from '../../../apis/mallApis'
2021-01-15 12:00:20 +08:00
wepy.component({
store,
hooks: {},
2021-01-15 12:00:20 +08:00
data: {
columnRecord: [
{
title: '标题标题标题标题标题',
createTime: '2000-11-11',
image: 'https://www.xiao4r.com/xiao4rstatic/img/doctor.png'
}
2021-01-20 19:08:32 +08:00
],
records: []
2021-01-15 12:00:20 +08:00
},
mixins: [defaultMix],
2021-01-15 12:00:20 +08:00
computed: {
...mapState({
'imageDefine': state => state.imageDefine,
'user': state => state.user,
'navDefine': state => state.navDefine
})
},
methods: {
2021-01-20 17:25:41 +08:00
onBuy() {
this.$emit('changeTab', 1)
},
2021-01-20 17:25:41 +08:00
onShoppingCar() {
appManager.navigateTo(navDefine.SHOPPING_CAR_LIST)
2021-01-20 19:08:32 +08:00
},
onWebItem(item) {
appManager.navWeb(item.url)
}
2021-01-20 19:08:32 +08:00
},
2021-01-15 12:00:20 +08:00
ready() {
2021-01-20 19:08:32 +08:00
mallApis.getActivityList().then(r => {
this.records = r.rows
})
2021-01-15 12:00:20 +08:00
}
})
</script>
<config>
{
navigationBarTitleText: ''
}
</config>