| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- <template>
- <view style="padding: 24rpx;">
- <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
- <view class="list x-f" v-for="(item,index) in dataList" :key="index">
- <view class="image">
- <image :src="item.images?item.images.split(',')[0]:''" mode="aspectFill" style="width: 100%;height: 100%;"></image>
- <view class="tag" :style="{backgroundColor: item.isProcessCompleted==1? '#eee': item.isHandlePlatform==0&&item.isHandleStore==0 ? 'red':'#2583EB', color: item.isProcessCompleted==1? '#666':'#fff'}">
- {{item.isProcessCompleted==1? '已结束':item.isHandlePlatform==0&&item.isHandleStore==0 ? '待处理':'已处理'}}
- </view>
- </view>
- <view style="flex: 1;overflow: hidden;" @click="showDetail(item)">
- <view class="ellipsis2">{{item.title}}</view>
- <view class="x-bc">
- <view class="time">{{item.createTime}}</view>
- <view class="btn">查看</view>
- </view>
- </view>
- </view>
- </mescroll-body>
- </view>
- </template>
- <script>
- import {storeComplaintList} from "@/api/user.js"
- export default {
- data() {
- return {
- mescroll:null,
- // 上拉加载的配置
- downOption: { //下拉刷新
- use:true,
- auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
- },
- upOption: {
- onScroll:true,
- use: true, // 是否启用上拉加载; 默认true
- page: {
- num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
- size: 10 // 每页数据的数量,默认10
- },
- noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
- textNoMore: '没有更多了',
- empty: {
- icon:'/static/images/no_data.png',
- tip: '暂无数据'
- }
- },
- // 列表数据
- dataList: []
- }
- },
- onShow() {
- this.mescroll.resetUpScroll()
- },
- methods: {
- showDetail(item) {
- uni.navigateTo({
- url:'/pages_user/complaintListDetail?id='+item.id
- })
- },
- mescrollInit(mescroll) {
- this.mescroll = mescroll;
- },
- /*下拉刷新的回调 */
- downCallback(mescroll) {
- mescroll.resetUpScroll()
- },
- upCallback(page) {
- //联网加载数据
- var that = this;
- var data = {
- status:this.status,
- page: page.num,
- pageSize: page.size
- };
- storeComplaintList(data).then(res => {
- if(res.code==200){
- //设置列表数据
- if (page.num == 1) {
- that.dataList = res.rows;
-
- } else {
- that.dataList = that.dataList.concat(res.rows);
-
- }
- that.mescroll.endBySize(res.rows.length, res.total);
-
- }else{
- uni.showToast({
- icon:'none',
- title: "请求失败",
- });
- that.dataList = null;
- that.mescroll.endErr();
- }
- });
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .time {
- font-size: 28rpx;
- color: #888;
- }
- .btn{
- margin-top: 16rpx;
- padding: 8rpx 20rpx;
- font-size: 26upx;
- font-family: PingFang SC;
- font-weight: 500;
- text-align: center;
- border-radius: 32upx;
- border: 1rpx solid #2583EB;
- color: #2583EB;
- }
- .list {
- background: #FFFFFF;
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- padding: 24rpx;
- overflow: hidden;
- font-size: 30rpx;
- margin-bottom: 24rpx;
- .image {
- flex-shrink: 0;
- width: 150rpx;
- height: 150rpx;
- background-color: #eee;
- position: relative;
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- overflow: hidden;
- margin-right: 24rpx;
- }
- .tag {
- position: absolute;
- top: 0;
- left: 0;
- padding: 5rpx 6rpx;
- font-size: 20rpx;
- color: #FFFFFF;
- background-color: red;
- border-radius: 16rpx 0 16rpx 0;
- }
- }
- </style>
|