wzj-boot/mini-app/src/pages/winery/winery-detail.wpy

136 lines
2.6 KiB
Plaintext
Raw Normal View History

2021-01-15 22:56:32 +08:00
<style lang="less">
.bg {
z-index: -1;
height: 100%;
position: fixed;
width: 200rpx;
background-color: #AC1630;
}
.winery-item {
width: 400rpx;
height: 60px;
margin-bottom: 20px;
box-shadow: 4px 4px 10px #cccccc;
border: #ffffff 1px solid;
border-radius: 20px;
background-color: white;
padding: 15px 70rpx;
}
.winery-item-icon {
position: absolute;
width: 60px;
height: 60px;
display: flex;
align-items: center;
justify-items: center;
justify-content: center;
text-align: center;
background-color: white;
box-shadow: 4px 4px 10px #cccccc;
margin-top: 10px;
margin-left: -40rpx;
border: #ffffff 1px solid;
border-radius: 50%;
}
.winery-item-arrow {
position: absolute;
width: 45px;
height: 45px;
display: flex;
align-items: center;
justify-items: center;
justify-content: center;
background-color: white;
box-shadow: 4px 4px 10px #cccccc;
margin-top: 18.5px;
margin-left: 500rpx;
border: #ffffff 1px solid;
border-radius: 50%;
}
</style>
<wxs module="filters" lang="babel">
const parseImage = (imageKey) => {
return 'https://winery-1257413599.cos.ap-beijing.myqcloud.com/' + imageKey
}
module.exports.parseImage = parseImage;
</wxs>
<template>
2021-01-20 10:39:13 +08:00
<nav-bar title="酒庄信息" />
<van-loading v-if="!wineryItem" style="margin-top: 20px;" />
<div v-else style="margin-bottom: 80px;">
<image :src="filters.parseImage(wineryItem.avatar)" style="width: 100%;height: 750rpx;" mode="aspectFit" />
<div style="margin: 10px 15px;display: flex;flex-direction: column;">
<div style="font-size: 20px;font-weight: bold;">{{wineryItem.mchName}}</div>
<div style="font-size: 14px;color: #999999;">{{wineryItem.subtitle}}</div>
<span style="margin-top: 20px;font-weight: bold;">酒庄简介</span>
<div style="margin-top: 10px;width:100%;">
<rich-text :nodes="wineryItem.mchDesc" />
2021-01-15 22:56:32 +08:00
</div>
</div>
</div>
</template>
<script>
import wepy from '@wepy/core'
import store from '@/store'
import { mapActions, mapState } from '@wepy/x'
import defaultMix from '../../mixins/defaultMix'
2021-01-20 10:39:13 +08:00
import merchanApis from '../../apis/merchanApis'
2021-01-15 22:56:32 +08:00
wepy.page({
store,
hooks: {},
mixins: [defaultMix],
data: {
2021-01-20 10:39:13 +08:00
wineryItem: null
2021-01-15 22:56:32 +08:00
},
computed: {
...mapState({
2021-01-20 10:39:13 +08:00
'imageDefine': state => state.imageDefine
2021-01-15 22:56:32 +08:00
})
},
methods: {
2021-01-20 10:39:13 +08:00
...mapActions([]),
2021-01-15 22:56:32 +08:00
async init(id) {
2021-01-20 10:39:13 +08:00
merchanApis.getMerchantInfo(id).then(r => {
this.wineryItem = r.data
})
2021-01-15 22:56:32 +08:00
}
},
onLoad(options) {
this.init(options.id)
}
})
</script>
<config>
{
navigationBarTitleText: '',
usingComponents: {
}
}
</config>