<template>
	<ax-body>
		<view class="page-background"><image src="@/static/img/my-bg.svg" mode="widthFix"></image></view>
		<view class="body app-hide-scrollbar root">
			<view v-if="list.data.length" class="list">
				<view v-for="(item,index) in list.data" :key="index" class="item">
					<view class="mask"></view>
					<view class="mask-box">
						<view>{{item.createTime}}</view>
						<view>{{typesLable(item.problemType)}}</view>
					</view>
					<view class="card">
						<view>
							<text>{{item.problemDescribe}}</text>
							<text v-if="item.filesUrl" @click="previewImage(item.filesUrl.split(','))" class="item-pic">查看附件</text>
						</view>
						<view v-if="item.reply" class="reply">
							<text class="start-label">答复:</text>
							<text>{{item.reply}}</text>
						</view>
					</view>
				</view>
			</view>
			<view v-else class="nothing-wrap">
				<view class="ax ax-iconblock i-kongshuju icon"></view>
				<view>暂无数据</view>
			</view>
		</view>
	</ax-body>
</template>

<script>
	export default {
		data() {
			return {
				list:{
					data: [],
					total: 10
				},
				types:[{name:'投诉吐槽',value:1},{name:'功能异常',value:2},{name:'体验问题',value:3},{name:'功能建议',value:3},{name:'其他',value:9}]
			}
		},
		onShow() {
			this.loadListData();
		},
		methods: {
			loadListData(){
				
				this.$api.base("post","/userApi/getMyFeekBack",{},{}).then(res=>{
					this.list.data = res.list
				})
				
			},
			typesLable(val){
				if(!this.types.length) return '';
				var item = this.types.find(i=>i.value==val);
				return item.name || '';
			},
			previewImage(url){
				if(!url) return;
				console.log(this.$config.url.request)
				var newUrl = new Array()
				url.forEach(i=>{
					newUrl.push(this.$config.url.request+i)
				})
				console.log(newUrl)
				
				uni.previewImage({urls:newUrl, indicator:'none'});
			},
		}
	}
</script>

<style>
/* @import url("../../components/ax/ax.css"); */
@import url("feedback-reply.css");
</style>
