This commit is contained in:
PQZ 2025-04-14 17:03:54 +08:00
parent 569a62b530
commit 849675a408
7 changed files with 182 additions and 22 deletions

View File

@ -43,3 +43,12 @@ export function initCouponList() {
method: 'get'
})
}
//------------------通用查询分类树方法-----------------------
export function categoryTreeData(params) {
return request({
url: '/base/category/treeData',
method: 'get',
params: params
})
}

View File

@ -54,3 +54,29 @@ export function closeNotice(params) {
params: params
})
}
// 博主举报通告主
export function saveReport(data) {
return request({
url: '/busi/report/saveReport',
method: 'post',
data: data
})
}
//平台意见反馈
export function uniAddFeedBack(data) {
return request({
url: '/busi/feedback/uniAddFeedBack',
method: 'post',
data: data
})
}
// 查询意见反馈列表
export function feedbackList(params) {
return request({
url: '/busi/feedback/list',
method: 'get',
params: params
})
}

View File

@ -267,7 +267,7 @@
* 跳转建议列表
*/
goSuggest() {
this.$tab.navigateTo('/pages/mine/set/suggest')
this.$tab.navigateTo('/pages/mine/set/suggest?userType='+this.localUserType)
},
/**
* 跳转地址列表

View File

@ -27,12 +27,18 @@
<script>
import navigationBarVue from '@/components/navigation/navigationBar.vue';
import {toast} from '@/utils/common.js'
import config from '@/config';
import {feedbackList} from '@/api/business/notice.js'
import constant from '@/utils/constant';
import {getJSONData} from '@/utils/auth.js'
export default {
components: {
navigationBarVue
},
data() {
return {
uploadUrl: config.baseUrl,
dataList: [{
createTime: "2024-02-10 12:22:44",
content: "我的意见我的意见我的意见我的意见我的意见我的意见我的意见我的意见我的意见我的意见我的意见我的意见我的意见",
@ -48,13 +54,42 @@
queryParams: {
pageNum: 1,
pageSize: 10,
userId:null
},
total: 0,
//
isTriggered: false
}
},
onShow(){
this.initData();
},
methods: {
/**初始化数据*/
initData(){
this.queryParams.userId = getJSONData(constant.userInfo).userId
feedbackList(this.queryParams).then(res=>{
this.isTriggered = false
if (res.code == 200) {
if (this.queryParams.pageNum == 1) {
this.dataList = res.data.records
this.dataList = this.dataList.map(item => {
item.imagesList = item.images.split(',').map(image => this.uploadUrl + image.trim());
return item;
});
} else {
this.dataList = this.dataList.concat(res.data.records)
this.dataList = this.dataList.map(item => {
item.imagesList = item.images.split(',').map(image => this.uploadUrl + image.trim());
return item;
});
}
console.log(this.dataList)
this.total = res.data.data.total
}
})
},
/**
* 上滑加载数据
*/
@ -66,6 +101,7 @@
}
//+1,
this.queryParams.pageNum++
this.initData()
},
/**
* 下拉刷新数据
@ -74,6 +110,7 @@
this.isTriggered = true
this.queryParams.pageNum = 1
this.total = 0
this.initData()
},
}
}

View File

@ -8,9 +8,10 @@
举报类型
</view>
<view class="item-value">
<uni-data-select v-model="firstCode" :localdata="firstList" @change="change"></uni-data-select>
<uni-data-select v-if="ifShowSecond" v-model="secondCode" :localdata="secondList"
@change="changeSecond"></uni-data-select>
<uni-data-picker placeholder="请选择" popup-title="请选择" :localdata="dataTree"
v-model="dataObj.reportType" @change="onchange" @nodeclick="onnodeclick"
@popupopened="onpopupopened" @popupclosed="onpopupclosed">
</uni-data-picker>
</view>
</view>
<view class="item-field">
@ -48,16 +49,23 @@
<script>
import navigationBarVue from '@/components/navigation/navigationBar.vue';
import {categoryTreeData} from '@/api/business/base.js';
import {saveReport} from '@/api/business/notice.js';
import upload from '@/utils/upload'
import {toast} from '@/utils/common.js'
import config from '@/config';
export default {
components: {
navigationBarVue
},
data() {
return {
uploadUrl: config.baseUrl,
dataObj: {
content: ""
},
sizeType: ['compressed'],
dataTree:[],
firstList: [{
value: 0,
text: "篮球"
@ -92,9 +100,46 @@
secondCode: "",
//
ifShowSecond: false,
//id
reportUserId:'',
//id
reportNoticeId:''
}
},
onLoad(option){
this.reportUserId = option.userId
this.reportNoticeId = option.noticeId
},
onShow(){
//
this.getCategory()
},
methods: {
onnodeclick(e) {
console.log(e, 135);
},
onpopupopened(e) {
console.log('popupopened');
},
onpopupclosed(e) {
console.log('popupclosed');
},
onchange(e) {
console.log('onchange:', e);
},
/**获取分类树*/
getCategory(){
categoryTreeData({code:'report_type'}).then(res => {
if (res.code == 200) {
this.dataTree = res.data
}
})
},
switch1Change: function(e) {
console.log('switch1 发生 change 事件,携带值为', e.detail.value)
},
@ -106,18 +151,40 @@
}).then((res) => {
console.log(res, '215')
this.fileList.push({
url: config.baseUrl + res.data
url: res.url
})
console.log(this.fileList, 'fileList')
})
}
},
deleteFile(file, index) {
console.log('删除文件');
this.fileList.splice(index, 1);
},
/**提交*/
submitForm() {},
submitForm() {
//
if (this.fileList.length > 0) {
this.dataObj.images = this.fileList
.map(item => item.url.replace(this.uploadUrl, ''))
.join(',');
}
this.dataObj.userType = '02'
this.dataObj.reportUserId = this.reportUserId
this.dataObj.reportUserType = '01'
this.dataObj.reportNoticeId = this.reportNoticeId
saveReport(this.dataObj).then(res=>{
if (res.code ==200) {
uni.showToast({
icon: 'success',
duration: 2000,
title: '举报成功'
});
uni.navigateBack()
}
}).catch((e)=>{
toast(e)
})
},
/**
* 去我的建议列表
*/

View File

@ -8,7 +8,7 @@
写下你的建议
</view>
<view class="item-value">
<textarea v-model="dataObj.content" placeholder="请输入" />
<uni-easyinput type="textarea" v-model="dataObj.content" placeholder="请输入" />
</view>
</view>
<view class="item-field">
@ -37,20 +37,29 @@
<script>
import navigationBarVue from '@/components/navigation/navigationBar.vue';
import upload from '@/utils/upload'
import {toast} from '@/utils/common.js'
import config from '@/config';
import {uniAddFeedBack} from '@/api/business/notice.js'
export default {
components: {
navigationBarVue
},
data() {
return {
uploadUrl: config.baseUrl,
dataObj: {
content: ""
},
sizeType: ['compressed'],
//
fileList: [],
userType:"",
}
},
onLoad(option){
this.userType = option.userType
},
methods: {
afterRead(file) {
for (let i = 0; i < file.tempFilePaths.length; i++) {
@ -60,9 +69,8 @@
}).then((res) => {
console.log(res, '215')
this.fileList.push({
url: config.baseUrl + res.data
url: res.url
})
console.log(this.fileList, 'fileList')
})
}
},
@ -71,7 +79,27 @@
this.fileList.splice(index, 1);
},
/**提交*/
submitForm() {},
submitForm() {
//
if (this.fileList.length > 0) {
this.dataObj.images = this.fileList
.map(item => item.url.replace(this.uploadUrl, ''))
.join(',');
}
this.dataObj.userType = this.userType
uniAddFeedBack(this.dataObj).then(res => {
if (res.code == 200){
uni.showToast({
icon: 'success',
duration: 2000,
title: '举报成功'
});
uni.navigateBack()
}
}).catch((e)=>{
toast(e)
})
},
/**
* 去我的建议列表
*/
@ -144,14 +172,7 @@
border-radius: 8rpx;
}
textarea {
width: 100%;
height: 150rpx;
color: #686868;
padding: 10rpx 0 10rpx 20rpx;
border: 1rpx solid #dcdfe6;
border-radius: 8rpx;
}
}
.submit-box {

View File

@ -377,7 +377,7 @@
})
},
goReportForm() {
this.$tab.navigateTo('/pages/mine/set/report-form')
this.$tab.navigateTo('/pages/mine/set/report-form?userId='+this.userDetail.userId+'&noticeId='+this.noticeId)
},
/**
* 去报名列表