<template>
	<view class="layout">
	
		 <TextArea :tips="tips" @submitValue="submitValue"/>	
		 <view>
			<view>添加图片(最多3张)</view>
			<uploadImage @getImg="getImg" />	
				
		</view>
		<view class="submitRemin" @click="submitRemin">提交</view>
	</view>
</template>

<script>
	import TextArea from '@/component/textarea.vue'
	import uploadImage from '@/component/uploadImage.vue'
	export default {
		components: {
			TextArea,
			uploadImage
		},
		data() {
			return{
				tips:'您有什么意见或反馈，请告诉我们',
				valueNumber: 0,
				imageList:[],
				size: 25,
				goodComment:'',
				
			}
		},
		onUnload() {
			   
		},
		methods: {
			getImg(e) {
				console.log(e);
				this.imageList = e;
			},
			submitValue(e) {
				this.goodComment = e.detail.value;
			},
			
			submitRemin() {
					
				if(this.goodComment == '') {
					this.$msg("请输入意见反馈");
					return;
				}
				let images = this.imageList.join(',');
				this.request({
					url: '/v2/member/feedback',
					method: 'post',
					data: {
						content: this.goodComment,
						images:　images
					},
					success: (res) => {
						if(res.data.code == 1000) {
							this.$msg("感谢您的反馈");
							setTimeout(() => {
							      uni.navigateBack();
							    }, 1000);
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.layout {
		padding: 0 32upx;
		.assessHead {
			padding: 20upx 0;
		}
		.deepHeight {
			height: 108upx;
			width: 108upx;
		}
	}
</style>
