<template>
	<view class="channel-header" @tap="handlerClick">
		<image class="channel-avatar" :src="$util.img(value.avatarUrl)" mode="aspectFill"></image>
		<view class="channel-info">
			<view class="channel-name">{{ value.channelName }}</view>
			<view class="channel-follow" v-if="value.showFollow">关注</view>
		</view>
		<image class="channel-arrow" v-if="arrowIcon" :src="$util.img(arrowIcon)" mode="aspectFill"></image>
	</view>
</template>

<script>
import DiyMinx from './minx.js'

// #ifdef MP-WEIXIN
import { wechatChannelConfig } from './js/wechat-channel.js'
// #endif
export default {
	name: 'diy-channel-header',
	props: {
		value: {
			type: Object,
			required: true
		}
	},
	mixins: [DiyMinx],
	computed: {
		arrowIcon() {
			// #ifdef MP-WEIXIN
			return wechatChannelConfig.icon.channelArrow
			// #endif
			return ''
		}
	},
	methods: {
		handlerClick() {
			this.$emit('header-tap', this.value);
		}
	}
};
</script>

<style scoped lang="scss">
@import './css/common-channel.scss';
</style>