problems.vue 1.5 KB
<template>
	<view>
		<view class="topLine"></view>
		<view class="problemWrap">
			<view class="problemItem" v-for="(item,index) in list" :key="index">
				<view class="problem" @click="item.status = !item.status">
					<text>{{index+1}}:{{item.title}}</text>
					<image v-if="!item.status" src="../../../static/image/wallet/zhankai.png" mode=""></image>
					<image v-if="item.status" src="../../../static/image/wallet/shouqi.png" mode=""></image>
				</view>
				<view class="answer" v-if="item.status">
					{{item.content}}
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				list:[]
			}
		},
		onLoad() {
			uni.request({
				url:this.apiUrl + '/faq/lis',
				method:'POST',
				data:{
					faq_cate_id:'1'
				},
				success: (res) => {
					console.log('常见问题列表',res)
					let list = []
					res.data.data.forEach((item)=>{
						item.status = false
						list.push(item)
					})
					this.list = list
				}
			})
		}
	}
</script>

<style lang="scss" scoped>
	.topLine{height: 2rpx;background: rgba(25,24,51,0.06);}
	.problemWrap{
		padding: 0 32rpx;
		.problemItem{
			
			.problem{
				text{font-size: 28rpx;}
				height: 88rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				image{width: 32rpx;height: 32rpx;}
				border-bottom: 2rpx solid #ebedf0;
			}
			.answer{
				padding: 24rpx 0;
				color: #969799;
				font-size: 24rpx;
				border-bottom: 2rpx solid #ebedf0;
			}
		}
		
	}
</style>