<template>
	<view class="wrap">
		<u-navbar :autoBack="true" title="答题" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#000000"></u-navbar>
		<view class="b-image" v-if="activityImage" @click="onPreview">
			<image :src="activityImage || '/static/imgs/activity_loading.jpg'" mode="widthFix"></image>
		</view>
		<view class="b-rich" v-else>
			<rich-text :nodes="activityRich"></rich-text>
		</view>
	</view>
</template>

<script>
import mixinsCommon from '@/mixins/common.js';
import mixinsAuth from '../../mixins/auth.js';
import { formatRichText } from '@/common/util.js';
export default {
	mixins: [mixinsCommon, mixinsAuth],
	data() {
		return {};
	},
	onLoad() {},
	computed: {
		activityRich() {
			return formatRichText(this.$store.getters.globalConfig.activity_rich);
		},
		activityImage() {
			return this.$store.getters.globalConfig.activity_img;
		}
	},
	methods: {
		onPreview() {
			uni.previewImage({
				current: 0,
				urls: [this.activityImage]
			});
		}
	}
};
</script>

<style>
.b-rich {
	background: #fff;
	font-size: 28upx;
}

.b-image image {
	width: 100%;
	height: 460upx;
}
</style>
