<template>
	<div>
		<common ref="common" @asynCallBack="asynCallBack"></common>
		<top-header :pageTitle="pageTitle" :rightLink="rightLink" :doRightLink="doRightLink"></top-header>

		<div class="mui-content">
			<div class="vongi-edit">
				<textarea v-model="detail" placeholder="请输入正文" class="flew"></textarea>
				<!-- <div class="vongi-edit-footer">
					<div class="vongi-edit-bl flew-sp flew-items">
						<span class="iconfont icon-bold"></span>
						<span class="iconfont icon-italic"></span>
						<span class="iconfont icon-underline"></span>
						<span class="iconfont icon-707bianjiqi_shanchuxian"></span>
						<span class="vongi-edit-line"></span>
						<span class="iconfont icon-a"></span>
						<span class="vongi-edit-line"></span>
						<span class="iconfont icon-718bianjiqi_youxuliebiao"></span>
						<span class="iconfont icon-719bianjiqi_wuxuliebiao"></span>
						<span class="iconfont icon-fuwenbenbianjiqi_suojin"></span>
						<span class="iconfont icon-fuwenbenbianjiqi_suojin"></span>
						<span class="vongi-edit-line"></span>
						<span class="iconfont icon-fengexian"></span>
						<span class="iconfont icon-quotation_marks"></span>
					</div>
				</div> -->
			</div>
		</div>
	</div>
</template>

<script>
	import * as API_Activity from '@/apis/Master/activity'
	import Common from '$project/components/Common.vue'
	import Loading from '$project/components/Loading.vue'
	import TopHeader from '$project/components/TopHeader.vue'
	import {
		mapGetters,
		mapMutations
	} from 'vuex'
	import * as types from '$project/store/mutation-types'
	export default {
		name: 'MasterActivityAddText',
		components: {
			Common,
			Loading,
			TopHeader,
		},
		data() {
			return {
				isLoading: false,

				pageTitle: '编辑文字',

				index: this.$route.query.index,
				subForm: {
					title: '',
					content: '',
					contentList: [],
				},

				detail: '',

				rightLink: {
					show: true,
					icon: 'mui-btn mui-btn-primary',
					style: 'width: 55px;height: 25px;margin-top:5px;margin-right: 0px;line-height: 5px;color: #fff;font-size:16px;',
					title: '完成'
				},
			}
		},
		created() {
			if (this.activity_form_data) {
				this.subForm = this.activity_form_data;
				this.detail = this.subForm.contentList[this.index]['detail'];
			}
		},
		methods: {

			//完成
			doRightLink() {
				if (!this.detail) {
					mui.toast('请输入内容');
				} else {
					var item = this.subForm.contentList[this.index];
					item.detail = this.detail;
					this.$set(this.subForm.contentList, this.index, item);
					this.set_activity_form_data(this.subForm);
					this.$router.go(-1);
				}
			},
			asynCallBack() {

			},
			...mapMutations({
				set_activity_form_data: types.SET_ACTIVITY_FORM_DATA,
			})
		},
		mounted() {},
		destroyed() {},
		computed: {
			...mapGetters({
				openId: 'wx_openid',
				token: 'token',
				person_data: 'person_data',
				person_popedom: 'person_popedom',
				activity_form_data: 'activity_form_data',
			})
		}
	}
</script>


<style scoped src="$project/assets/css/xpwyfyy.css"></style>
<style src="$project/assets/css/iconfont.css"></style>
<style>
</style>
