diff --git a/api/tort.js b/api/tort.js index 934496e..60a4e54 100644 --- a/api/tort.js +++ b/api/tort.js @@ -8,6 +8,8 @@ // const OTHER_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' // const SPECIAL_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' const GET_CODE_URL = BASE_URL + '/webserver/captchaController/generateVerifyCodeOfReport.do' +const REPORT_LIST = BASE_URL + '/webserver/reportInfo/queryPersonReportedInfo.do' +const REPORT_DETAIL = BASE_URL + '/webserver/reportInfos/shortcutQueryReportInfo.do' /** * 生成网址、网址转换 * @param {*} // url: '' @@ -40,5 +42,13 @@ } return fetch.get(GET_CODE_URL, data).then(res => res); } +// 举报列表 +export function getReportList(data) { + return fetch.post(REPORT_LIST, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 举报详情 +export function getReportDetail(data) { + return fetch.post(REPORT_DETAIL, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} diff --git a/api/tort.js b/api/tort.js index 934496e..60a4e54 100644 --- a/api/tort.js +++ b/api/tort.js @@ -8,6 +8,8 @@ // const OTHER_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' // const SPECIAL_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' const GET_CODE_URL = BASE_URL + '/webserver/captchaController/generateVerifyCodeOfReport.do' +const REPORT_LIST = BASE_URL + '/webserver/reportInfo/queryPersonReportedInfo.do' +const REPORT_DETAIL = BASE_URL + '/webserver/reportInfos/shortcutQueryReportInfo.do' /** * 生成网址、网址转换 * @param {*} // url: '' @@ -40,5 +42,13 @@ } return fetch.get(GET_CODE_URL, data).then(res => res); } +// 举报列表 +export function getReportList(data) { + return fetch.post(REPORT_LIST, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 举报详情 +export function getReportDetail(data) { + return fetch.post(REPORT_DETAIL, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} diff --git a/common/fetch.js b/common/fetch.js index 0747653..ba307c4 100644 --- a/common/fetch.js +++ b/common/fetch.js @@ -16,7 +16,7 @@ '103':'验证码超时', } function fetch(method) { - return function (url, data, otherParams = {}) { + return function (url, data, otherParams = {}, headers = {}) { // if (method === 'POST' || method === 'PUT') { // data = { // param: data, @@ -31,14 +31,19 @@ data, header: { token: sessionId, + ...headers, }, success(data) { if (data.statusCode === 200) { - if (data.data.status === 1 || data.data.code === 200) { + if (data.data.status === 1 || data.data.code === 200 || data.data.status ==='1') { if(data.data.message === '网址未重复') { wx.setStorageSync('isRepeat', 'false') } - resolve(data.data.data); + if (data.data.status === 1) { + resolve(data.data.data ? data.data.data : data.data); + } else { + resolve(data.data.data); + } } else if( data.data.status === 103 || data.data.status === 3 || data.data.status === 2 ||data.data.status === 4 || diff --git a/api/tort.js b/api/tort.js index 934496e..60a4e54 100644 --- a/api/tort.js +++ b/api/tort.js @@ -8,6 +8,8 @@ // const OTHER_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' // const SPECIAL_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' const GET_CODE_URL = BASE_URL + '/webserver/captchaController/generateVerifyCodeOfReport.do' +const REPORT_LIST = BASE_URL + '/webserver/reportInfo/queryPersonReportedInfo.do' +const REPORT_DETAIL = BASE_URL + '/webserver/reportInfos/shortcutQueryReportInfo.do' /** * 生成网址、网址转换 * @param {*} // url: '' @@ -40,5 +42,13 @@ } return fetch.get(GET_CODE_URL, data).then(res => res); } +// 举报列表 +export function getReportList(data) { + return fetch.post(REPORT_LIST, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 举报详情 +export function getReportDetail(data) { + return fetch.post(REPORT_DETAIL, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} diff --git a/common/fetch.js b/common/fetch.js index 0747653..ba307c4 100644 --- a/common/fetch.js +++ b/common/fetch.js @@ -16,7 +16,7 @@ '103':'验证码超时', } function fetch(method) { - return function (url, data, otherParams = {}) { + return function (url, data, otherParams = {}, headers = {}) { // if (method === 'POST' || method === 'PUT') { // data = { // param: data, @@ -31,14 +31,19 @@ data, header: { token: sessionId, + ...headers, }, success(data) { if (data.statusCode === 200) { - if (data.data.status === 1 || data.data.code === 200) { + if (data.data.status === 1 || data.data.code === 200 || data.data.status ==='1') { if(data.data.message === '网址未重复') { wx.setStorageSync('isRepeat', 'false') } - resolve(data.data.data); + if (data.data.status === 1) { + resolve(data.data.data ? data.data.data : data.data); + } else { + resolve(data.data.data); + } } else if( data.data.status === 103 || data.data.status === 3 || data.data.status === 2 ||data.data.status === 4 || diff --git a/packageA/accountInfo/accountInfo.vue b/packageA/accountInfo/accountInfo.vue index 6a7048c..259c178 100644 --- a/packageA/accountInfo/accountInfo.vue +++ b/packageA/accountInfo/accountInfo.vue @@ -101,6 +101,8 @@ value: '12345678978', icon: '../../static/mine/phone.png' },); + // 本地存储手机号,作为用户唯一标识 + localStorage.setItem('userIdentifying','12345678978') this.$set(this.list, 4, { id: 'email', name: '电子邮箱:', diff --git a/api/tort.js b/api/tort.js index 934496e..60a4e54 100644 --- a/api/tort.js +++ b/api/tort.js @@ -8,6 +8,8 @@ // const OTHER_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' // const SPECIAL_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' const GET_CODE_URL = BASE_URL + '/webserver/captchaController/generateVerifyCodeOfReport.do' +const REPORT_LIST = BASE_URL + '/webserver/reportInfo/queryPersonReportedInfo.do' +const REPORT_DETAIL = BASE_URL + '/webserver/reportInfos/shortcutQueryReportInfo.do' /** * 生成网址、网址转换 * @param {*} // url: '' @@ -40,5 +42,13 @@ } return fetch.get(GET_CODE_URL, data).then(res => res); } +// 举报列表 +export function getReportList(data) { + return fetch.post(REPORT_LIST, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 举报详情 +export function getReportDetail(data) { + return fetch.post(REPORT_DETAIL, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} diff --git a/common/fetch.js b/common/fetch.js index 0747653..ba307c4 100644 --- a/common/fetch.js +++ b/common/fetch.js @@ -16,7 +16,7 @@ '103':'验证码超时', } function fetch(method) { - return function (url, data, otherParams = {}) { + return function (url, data, otherParams = {}, headers = {}) { // if (method === 'POST' || method === 'PUT') { // data = { // param: data, @@ -31,14 +31,19 @@ data, header: { token: sessionId, + ...headers, }, success(data) { if (data.statusCode === 200) { - if (data.data.status === 1 || data.data.code === 200) { + if (data.data.status === 1 || data.data.code === 200 || data.data.status ==='1') { if(data.data.message === '网址未重复') { wx.setStorageSync('isRepeat', 'false') } - resolve(data.data.data); + if (data.data.status === 1) { + resolve(data.data.data ? data.data.data : data.data); + } else { + resolve(data.data.data); + } } else if( data.data.status === 103 || data.data.status === 3 || data.data.status === 2 ||data.data.status === 4 || diff --git a/packageA/accountInfo/accountInfo.vue b/packageA/accountInfo/accountInfo.vue index 6a7048c..259c178 100644 --- a/packageA/accountInfo/accountInfo.vue +++ b/packageA/accountInfo/accountInfo.vue @@ -101,6 +101,8 @@ value: '12345678978', icon: '../../static/mine/phone.png' },); + // 本地存储手机号,作为用户唯一标识 + localStorage.setItem('userIdentifying','12345678978') this.$set(this.list, 4, { id: 'email', name: '电子邮箱:', diff --git a/packageA/components/record.vue b/packageA/components/record.vue index 4777006..34a6d66 100644 --- a/packageA/components/record.vue +++ b/packageA/components/record.vue @@ -1,21 +1,22 @@ diff --git a/api/tort.js b/api/tort.js index 934496e..60a4e54 100644 --- a/api/tort.js +++ b/api/tort.js @@ -8,6 +8,8 @@ // const OTHER_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' // const SPECIAL_REPORT = BASE_URL + '/webserver/reportInfos/submitReportInfos.do' const GET_CODE_URL = BASE_URL + '/webserver/captchaController/generateVerifyCodeOfReport.do' +const REPORT_LIST = BASE_URL + '/webserver/reportInfo/queryPersonReportedInfo.do' +const REPORT_DETAIL = BASE_URL + '/webserver/reportInfos/shortcutQueryReportInfo.do' /** * 生成网址、网址转换 * @param {*} // url: '' @@ -40,5 +42,13 @@ } return fetch.get(GET_CODE_URL, data).then(res => res); } +// 举报列表 +export function getReportList(data) { + return fetch.post(REPORT_LIST, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} +// 举报详情 +export function getReportDetail(data) { + return fetch.post(REPORT_DETAIL, data, {}, {'content-type': 'application/x-www-form-urlencoded'}).then(res => res); +} diff --git a/common/fetch.js b/common/fetch.js index 0747653..ba307c4 100644 --- a/common/fetch.js +++ b/common/fetch.js @@ -16,7 +16,7 @@ '103':'验证码超时', } function fetch(method) { - return function (url, data, otherParams = {}) { + return function (url, data, otherParams = {}, headers = {}) { // if (method === 'POST' || method === 'PUT') { // data = { // param: data, @@ -31,14 +31,19 @@ data, header: { token: sessionId, + ...headers, }, success(data) { if (data.statusCode === 200) { - if (data.data.status === 1 || data.data.code === 200) { + if (data.data.status === 1 || data.data.code === 200 || data.data.status ==='1') { if(data.data.message === '网址未重复') { wx.setStorageSync('isRepeat', 'false') } - resolve(data.data.data); + if (data.data.status === 1) { + resolve(data.data.data ? data.data.data : data.data); + } else { + resolve(data.data.data); + } } else if( data.data.status === 103 || data.data.status === 3 || data.data.status === 2 ||data.data.status === 4 || diff --git a/packageA/accountInfo/accountInfo.vue b/packageA/accountInfo/accountInfo.vue index 6a7048c..259c178 100644 --- a/packageA/accountInfo/accountInfo.vue +++ b/packageA/accountInfo/accountInfo.vue @@ -101,6 +101,8 @@ value: '12345678978', icon: '../../static/mine/phone.png' },); + // 本地存储手机号,作为用户唯一标识 + localStorage.setItem('userIdentifying','12345678978') this.$set(this.list, 4, { id: 'email', name: '电子邮箱:', diff --git a/packageA/components/record.vue b/packageA/components/record.vue index 4777006..34a6d66 100644 --- a/packageA/components/record.vue +++ b/packageA/components/record.vue @@ -1,21 +1,22 @@ diff --git a/packageA/myReport/myReport.vue b/packageA/myReport/myReport.vue index c0795a1..fded6fb 100644 --- a/packageA/myReport/myReport.vue +++ b/packageA/myReport/myReport.vue @@ -21,11 +21,11 @@ - + - + - + import Record from '../components/record.vue' - import { getLocationParams } from '../../common/utils.js'; + import { getLocationParams, stamp2Time } from '../../common/utils.js'; + import { getReportList } from '../../api/tort.js'; export default { components: { Record }, data() { return { + loading:true, isEmpty: false, //数据是否为空 scrollTop: 0, status: 'loadmore', //上滑加载状态 loading加载中,nomore没有更多了 @@ -77,6 +79,7 @@ }, ], reportList: [], // 列表数据 + dataList:[], //初始数据列表 } }, watch: { @@ -92,14 +95,15 @@ // immediate: true, } }, - mounted() { + async mounted() { + this.loading = true uni.showShareMenu({ withShareTicket: true, menus: ["shareAppMessage", "shareTimeline"] }); - this.currentTab = getLocationParams('tabType'); // 当前tab this.clickTab(null, this.currentTab); + this.fetchReportData() }, //分享好友 onShareAppMessage() { @@ -124,91 +128,30 @@ }, methods: { + // 获取举报列表数据 + async fetchReportData() { + const data = { + 'userInfoVo.id':'', //用户id + 'userInfoVo.beginTime':'2020-01-01 00:00:00', //开始时间(Date) + 'userInfoVo.endTime':stamp2Time(new Date().getTime()), //结束时间 (Date) + 'userInfoVo.pageIndex':'1', //页码 + 'userInfoVo.count':'50', //页数 + 'userInfoVo.attributeTable': '', //用户为监督员传“jdy” + 'token':'', + } + getReportList(data).then(res => { + this.dataList = res.reportInfoVOs + this.reportList = this.dataList + this.loading = false + }) + }, clickTab(val, currentTab) { if((val && val.index === 0) || currentTab === '0') { // 全部 - this.reportList = [ - { - code: '1111', - status: '待评估', - time: '2022-12-12' - }, - { - code: '222', - status: '已评估', - time: '2022-12-12' - }, - { - code: '333', - status: '待评估', - time: '2022-12-12' - }, - { - code: '1111', - status: '待评估', - time: '2022-12-12' - }, - { - code: '222', - status: '已评估', - time: '2022-12-12' - }, - { - code: '333', - status: '待评估', - time: '2022-12-12' - }, - { - code: '1111', - status: '待评估', - time: '2022-12-12' - }, - { - code: '222', - status: '已评估', - time: '2022-12-12' - }, - { - code: '333', - status: '待评估', - time: '2022-12-12' - }, - { - code: '1111', - status: '待评估', - time: '2022-12-12' - }, - { - code: '222', - status: '已评估', - time: '2022-12-12' - }, - { - code: '333', - status: '待评估', - time: '2022-12-12' - }, - ] + this.reportList = this.dataList } else if((val && val.index === 1) || currentTab === '1') { // 待评估 - this.reportList = [ - { - code: '1111', - status: '待评估', - time: '2022-12-12' - }, - { - code: '333', - status: '待评估', - time: '2022-12-12' - }, - ] - } else if((val && val.index === 1) || currentTab === '2') { // 已评估 - this.reportList = [ - { - code: '222', - status: '已评估', - time: '2022-12-12' - }, - ] + this.reportList = this.dataList.filter(item => item.status !== 2 ) + } else if((val && val.index === 2) || currentTab === '2') { // 已评估 + this.reportList = this.dataList.filter(item => item.status === 2 ) } else { this.reportList = [] } @@ -220,17 +163,30 @@