123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <template>
- <view class="commonproblem">
- <navbar ref="navbar" :config="config" backColor="#fff"></navbar>
- <view v-if="problemList.length>=0">
- <view class="item" v-for="(item,index) in problemList">
- <view class="top">
- <view class="left">
- </view>
- <view class="right" >
- {{item.title}}
- </view>
- </view>
- <view class="content">
- {{item.content}}
- </view>
- </view>
- <loadMore v-if="problemList.length>0" :status="status"></loadMore>
- </view>
-
- <nodata v-else :config="{ top: 15, content: '暂无数据~' }"></nodata>
- </view>
- </template>
- <script>
- export default{
- data(){
- return{
- config: {
- back: true, //false是tolbar页面 是则不写
- title: '常见问题',
- color: '#fff',
- //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
- backgroundColor: [1, "#3775F6"],
- statusBarFontColor: '#1A1A1A',
- },
- params:{
- page:1,
- limit:10,
- },
- problemList:[],
- status:'more',
- noData:false
-
- }
- },
- //下拉刷新
- onPullDownRefresh() {
- this.params.page= 1,
- this.problemList = []
- this.getMsg()
- },
- //上拉加载
- onReachBottom(e){
- this.status='loading'
- this.params.page++
- this.getMsg()
- },
- onLoad() {
- this.getMsg()
- },
- methods:{
- getMsg(){
- this.$http.get("/sys/faq/pages",this.params).then(res=>{
- if(res&&res.code==200){
- uni.stopPullDownRefresh()
- // this.problemList = res.page.list
- this.problemList = this.problemList.concat(res.page.list)
- if(res.page.totalPage<=res.page.currPage){
- this.status = 'noMore'
- }else{
- this.status = "more"
- }
- }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .bottom{
- padding: 28rpx 40rpx 28rpx 40rpx;
- .top{
- display: flex;
- align-items: center;
- .left{
-
- width: 8rpx;
- height: 8rpx;
- background-color: #050505;
- border-radius: 50%;
- }
-
- .right{
- flex: 1;
- margin-left: 14rpx;
- font-size: 28rpx;
- font-weight: Regular;
- line-height: 40rpx;
- color: #050505;
- }
- }
- .content{
- margin-left: 14rpx;
- font-size: 22rpx;
- font-weight: Regular;
- color: #8C888C;
- line-height: 40rpx;
- }
- }
- .item{
- padding: 28rpx 40rpx 28rpx 40rpx;
- .top{
- display: flex;
- align-items: center;
- }
- .content{
- width: 100%;
- margin-left: 14rpx;
- font-size: 22rpx;
- font-weight: Regular;
- color: #8C888C;
- line-height: 40rpx;
- word-break: break-all;
- white-space: pre-wrap;
- }
- .left{
- width: 8rpx;
- height: 8rpx;
- background-color: #050505;
- border-radius: 50%;
- }
- .right{
- flex: 1;
- margin-left: 14rpx;
- font-size: 28rpx;
- font-weight: Regular;
- line-height: 40rpx;
- color: #050505;
- }
- }
- </style>
|