Files
MP_XOIL_company_new/components/three-item.vue
2022-08-15 17:55:10 +08:00

85 lines
1.8 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view class="cu-item cur padding site-item margin-tb-sm my-shadow">
<view class="cu-avatar radius lg" v-if="siteItem.siteImages"
:style="'background-image:url('+siteItem.siteImages+');'">
</view>
<view class="cu-avatar round lg" v-else>
<text class="text-df">{{siteItem.channelCode|channelCodeFamt}}</text>
</view>
<view class="content">
<view>
<view class="text-cut text-black text-bold text-lg padding-right-sm">{{siteItem.siteName}}</view>
</view>
<view class="text-left">
<view class="text-cut color-666 text-sm">
{{siteItem.address}}
</view>
</view>
</view>
<view class="action">
<view class="text-grey text-xs oil-main-color">
<my-icon iconName="sy-der-icon.png" class="padding-right-xs text-sm"></my-icon>
{{siteItem.juli|distanceFilter}}
</view>
</view>
</view>
</template>
<script>
export default {
props: {
siteItem: {
type: Object,
default () {}
},
first: {
type: Boolean,
default: false
}
},
data() {
return {
starUrl: this.global.starUrl,
}
},
methods: {
},
filters: {
channelCodeFamt(value) {
if (value) {
// 渠道编码 ( XOIL星油 WJY万金油 LV老吕找油网 TY团油 YDJY一点加油壳牌
switch (value) {
case 'XOIL':
return '星油'
case 'WJY':
return '万金油'
case 'LV':
return '其他'
case 'TY':
return '团油'
case 'YDJY':
return '一点加油(壳牌)'
}
}
},
distanceFilter(value) {
if (value) {
return value > 1000 ? ((value / 1000).toFixed(2) + 'km') : (value + 'm')
}
}
}
}
</script>
<style scoped>
.site-item {
margin-top: 0.5rem;
}
.cu-avatar{
background-color: transparent !important;
}
</style>