update about api
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="complaint">
|
||||
<view class="complaint-item" v-for="(item, index) in 4" :key="index" @click="toDetailsPage">
|
||||
<ComplaintItem></ComplaintItem>
|
||||
<view class="complaint-item" v-for="(item, index) in list" :key="index" @click="toDetailsPage(item.complain_id)">
|
||||
<ComplaintItem :info="item"></ComplaintItem>
|
||||
</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
@@ -10,15 +10,38 @@
|
||||
import ComplaintItem from '@/components/complaint-item/index'
|
||||
export default {
|
||||
data() {
|
||||
return {}
|
||||
return {
|
||||
list:[]
|
||||
}
|
||||
},
|
||||
components: {
|
||||
ComplaintItem
|
||||
},
|
||||
onLoad() {
|
||||
this.getlist()
|
||||
},
|
||||
methods: {
|
||||
toDetailsPage() {
|
||||
// 获取投诉列表
|
||||
getlist(){
|
||||
this.$u.api.reportlist({}).then(res => {
|
||||
console.log(res)
|
||||
if (res.errCode != 0) {
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
type: 'error'
|
||||
});
|
||||
} else {
|
||||
let arr = res.data.dataList
|
||||
for(let index in arr){
|
||||
this.list.push(arr[index])
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
toDetailsPage(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/user/complaintDetails'
|
||||
url: '/pages/user/complaintDetails?id='+id
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user