|
|
<template> <view class="pageBgImg"> <topNavbar title="咨询投诉"></topNavbar> <view class="pad"> <view class="card"> <view class="tabBox"> <view class="tab" v-for="(item,index) in tabArr" :key="index" @click="$goPage(item.url)"> <view class="icon"> <image :src="item.icon" mode=""></image> </view> <view class="text">{{item.text}}</view> </view> </view> </view> <view class="question"> <view class="h1">常见问题</view> <view class="card que"> <u-collapse :body-style="itemStyle" :border="false"> <u-collapse-item :title="item.question" v-for="(item, index) in itemList" :key="index" style="border-bottom: 1rpx solid #E8E9EC;"> <text style=" color: #999;">{{item.answer}}</text> <!-- {{item.answer}} --> </u-collapse-item> </u-collapse> </view> </view> </view> <view style="padding: 20rpx 0;" v-if="itemList.length"> <u-loadmore :status="status" /> </view> <nodata v-if="!itemList.length&&status=='nomore'"></nodata> </view> </template>
<script> import { askedQuestion } from '@/config/api.js' export default { data() { return { itemStyle: { marginLeft:'20rpx', }, itemList: [], tabArr: [ {text: '我要咨询', icon: require('../../../static/images/index/ic_zixun.png'), url:'/pages/indexEntry/consult/pubConsult/pubConsult', id: 1}, {text: '我要投诉', icon: require('../../../static/images/index/ic_tousu.png'), url: '/pages/indexEntry/consult/pubComplaint/pubComplaint', id: 2,}, {text: '查看记录', icon: require('../../../static/images/index/ic_jilu.png'), url: '/pages/indexEntry/consult/record/record', id: 3}, ], params: { pageNo: 1, pageSize: 20 }, status: 'loading' } }, onLoad() { this.askedQuestionFn() }, onPullDownRefresh() { this.params.pageNo = 1 this.itemList = [] this.askedQuestionFn().then(()=>{ uni.stopPullDownRefresh()}) }, methods: { async askedQuestionFn() { const {data: res} = await askedQuestion(this.params) this.params.pageNo ++ this.itemList.push(...res.list) this.total = res.total if(this.itemList.length>=this.total) { this.status = 'nomore' }else { this.status = 'loadmore' } } } } </script>
<style lang="scss" scoped> .tabBox { display: flex; // margin-top: 20rpx;
height: 192rpx; .tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; .icon { width: 72rpx; height: 72rpx; } .text { font-size: 28rpx; margin-top: 18rpx; } } } .h1 { line-height: 100rpx; } .que { padding: 28rpx; } </style>
|