征信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zhengxinApplets/pages/user/feedList.vue

136 lines
2.6 KiB

3 months ago
<template>
<view class="site">
<view class="site-bd">
3 months ago
<view class="item" v-for="(a,i) in list" :key="i" @click="openPage(a)">
<view class="a">{{a.type_item}}<text>{{a.createtime}}</text></view>
3 months ago
<view class="b">
3 months ago
<image src="https://zhengxin.njrenzhou.cn/static/icon-arrow.png"></image>
3 months ago
</view>
</view>
</view>
3 months ago
<view class="empty" v-if="total == 0">
<image src="https://zhengxin.njrenzhou.cn/static/empty.png"></image>
<view class="txt">暂无数据 ~</view>
</view>
3 months ago
</view>
</template>
<script>
export default {
data() {
return {
3 months ago
offset: 1,
list: [],
total: 1
3 months ago
};
},
3 months ago
mounted() {
this.systemfankuiGetList();
},
onReachBottom() {
const that = this;
uni.showLoading({
title: "加载中"
})
if(this.list.length <= this.total){
that.offset ++;
setTimeout(function() {
that.systemfankuiGetList(1);
}, 1000);
}
},
3 months ago
methods: {
3 months ago
//数组对象去重
arrayUnique (arr, name) {
var hash = {};
return arr.reduce(function (item, next) {
hash[next[name]]
? ""
: (hash[next[name]] = true && item.push(next));
return item;
}, []);
},
//获取反馈类型
async systemfankuiGetList(type) {
const { code, data } = await this.$api.systemfankuiGetList({
offset: this.offset,
limit: 20,
token: uni.getStorageSync("token")
})
if(type==1){
uni.hideLoading();
}
if(code == 1){
this.list = this.arrayUnique([...this.list,...data.rows],'id');
this.total = data.total;
}
},
openPage(obj){
uni.setStorageSync("feedInfo", obj);
3 months ago
uni.navigateTo({
3 months ago
url: "/pages/user/feedDetails"
3 months ago
})
},
3 months ago
},
destroyed() {
uni.removeStorageSync("feedInfo")
},
3 months ago
}
</script>
<style lang="scss" scoped>
.site{
padding: 0 25rpx 25rpx;
overflow: hidden;
3 months ago
.empty{
padding: 150rpx 0;
text-align: center;
font-size: 26rpx;
color: #666;
image{
width: 460rpx;
height: 400rpx;
margin-bottom: 30rpx;
}
}
3 months ago
&-bd{
width: 100%;
margin: 0 auto;
position: relative;
.item{
background: #FFFFFF;
box-shadow: 0px 3rpx 10rpx 0px rgba(9,44,39,0.05);
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
overflow: hidden;
margin-top: 20rpx;
.a{
flex: 1;
font-weight: 500;
font-size: 30rpx;
color: #333333;
max-width: 500rpx;
text{
display: block;
font-size: 24rpx;
color: #999999;
margin-top: 20rpx;
}
}
.b{
margin-left: 20rpx;
image{
width: 50rpx;
height: 50rpx;
}
}
}
}
}
</style>