反馈接口对接
This commit is contained in:
@@ -6,10 +6,17 @@ import config from '../js/config';
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function addFeedBack(params) {
|
export function addFeedBack(params) {
|
||||||
return request({
|
let files = params.files;
|
||||||
url: '/feedback/addFeedBack',
|
console.log(files);
|
||||||
method: 'post',
|
let data = JSON.parse(JSON.stringify(params));
|
||||||
data: params,
|
delete data.files
|
||||||
|
return uni.uploadFile({
|
||||||
|
url: config.domain + '/feedback/addFeedBack', //仅为示例,非真实的接口地址
|
||||||
|
files: files,
|
||||||
|
header: {
|
||||||
|
Authorization: '12',
|
||||||
|
},
|
||||||
|
formData: data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,7 +35,6 @@ export function queryFeedBackDetail(id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 问题列表
|
// 问题列表
|
||||||
export function queryFeedBackPage(params) {
|
export function queryFeedBackPage(params) {
|
||||||
return request({
|
return request({
|
||||||
@@ -47,7 +53,7 @@ export function queryFeedBackPage(params) {
|
|||||||
/**
|
/**
|
||||||
* 添加反馈聊天
|
* 添加反馈聊天
|
||||||
*
|
*
|
||||||
* @param {*} params {chatContent: '', id: 12, user_id: 1}
|
* @param {*} params {chatContent: '', id: 12, userId: 1}
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function AddFeedbackChat(params) {
|
export function AddFeedbackChat(params) {
|
||||||
@@ -55,10 +61,12 @@ export function AddFeedbackChat(params) {
|
|||||||
url: '/feedbackChat/AddFeedbackChat',
|
url: '/feedbackChat/AddFeedbackChat',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params,
|
data: params,
|
||||||
|
header: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新反馈聊天状态
|
* 更新反馈聊天状态
|
||||||
* @param {*} params {
|
* @param {*} params {
|
||||||
@@ -72,5 +80,8 @@ export function updateChatStatus(params) {
|
|||||||
url: '/feedbackChat/updateChatStatus',
|
url: '/feedbackChat/updateChatStatus',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params,
|
data: params,
|
||||||
|
header: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ export default (options = {}) => {
|
|||||||
: options.url,
|
: options.url,
|
||||||
data: {
|
data: {
|
||||||
...options.data,
|
...options.data,
|
||||||
|
userId: uni.getStorageSync('userInfo').id,
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
// 'Content-Type': 'application/json;charset=UTF-8',
|
// 'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
|||||||
@@ -11,10 +11,10 @@
|
|||||||
<uni-easyinput type="text" v-model="formData.title" placeholder="请输入问题简要" />
|
<uni-easyinput type="text" v-model="formData.title" placeholder="请输入问题简要" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="描述">
|
<uni-forms-item label="描述">
|
||||||
<uni-easyinput type="textarea" v-model="formData.des" placeholder="请输入详细描述" />
|
<uni-easyinput type="textarea" v-model="formData.description" placeholder="请输入详细描述" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="图片">
|
<uni-forms-item label="图片">
|
||||||
<uni-file-picker :auto-upload="false" :fileList="formData.fileList" @change="fileChange" />
|
<uni-file-picker :auto-upload="false" @select="fileChange" @delete="delImg" />
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
</uni-forms>
|
</uni-forms>
|
||||||
</view>
|
</view>
|
||||||
@@ -29,14 +29,17 @@
|
|||||||
</Cn-page>
|
</Cn-page>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import { addFeedBack } from '../../common/api/feedback'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
formData: {
|
formData: {
|
||||||
title: '',
|
title: '',
|
||||||
des: '',
|
description: '',
|
||||||
fileList: []
|
type: 1,
|
||||||
|
userId: '',
|
||||||
|
files: []
|
||||||
},
|
},
|
||||||
range: [
|
range: [
|
||||||
{ value: 0, text: "DVR" },
|
{ value: 0, text: "DVR" },
|
||||||
@@ -46,6 +49,20 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
delImg(e) {
|
||||||
|
console.log(e);
|
||||||
|
this.formData.files = this.formData.files.filter(item => item.url !== e.tempFilePath)
|
||||||
|
},
|
||||||
|
fileChange(e) {
|
||||||
|
console.log(e);
|
||||||
|
e.tempFilePaths.forEach(item => {
|
||||||
|
this.formData.files.push({
|
||||||
|
url: item,
|
||||||
|
name: 'files'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
console.log(this.formData.files);
|
||||||
|
},
|
||||||
add() {
|
add() {
|
||||||
this.formData.push({
|
this.formData.push({
|
||||||
type: '',
|
type: '',
|
||||||
@@ -53,9 +70,34 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
console.log(this.formData)
|
if (!this.formData.title) {
|
||||||
uni.navigateBack({ delta: 1 })
|
uni.showToast({
|
||||||
|
title: '请输入标题',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
addFeedBack(this.formData).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
res = res[1]
|
||||||
|
res = JSON.parse(res.data)
|
||||||
|
console.log(res);
|
||||||
|
if (res.code = 'A0000') {
|
||||||
|
this.$util.toast(res.message)
|
||||||
|
setTimeout(() => {
|
||||||
|
// uni.redirectTo({ url: '/pages/message/feedback' })
|
||||||
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
this.$util.toast(res.message)
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch(err => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
this.formData.userId = uni.getStorageSync('userInfo').id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -221,7 +221,8 @@ export default {
|
|||||||
role: 4
|
role: 4
|
||||||
}
|
}
|
||||||
uni.setStorageSync('userInfo', {
|
uni.setStorageSync('userInfo', {
|
||||||
role: 4
|
role: 4,
|
||||||
|
id: 1
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (this.userInfo.role == 4 || this.userInfo.role == 5 || this.userInfo.role == 6) {
|
if (this.userInfo.role == 4 || this.userInfo.role == 5 || this.userInfo.role == 6) {
|
||||||
|
|||||||
@@ -1,26 +1,36 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<uni-list :border="false">
|
<uni-list :border="false">
|
||||||
<uni-list-item show-badge badgeType="error" isDot badge-text="新消息" title="机器死机" note="2023-02-03" clickable @click="jump" />
|
<uni-list-item :show-badge="item.chatCount > 0" badgeType="error" isDot badge-text="新消息" :title="item.title"
|
||||||
<uni-list-item title="机器开不了机" note="2023-01-31" clickable @click="jump" />
|
:note="item.createTime" clickable v-for="(item, index) in store.data" :key="index" @click="jump(item)" />
|
||||||
</uni-list>
|
</uni-list>
|
||||||
<uni-load-more status="nomore"></uni-load-more>
|
<Cn-empty v-if="store.empty"></Cn-empty>
|
||||||
|
<uni-load-more v-if="store.data && store.data.length > 0" :status="store.status"></uni-load-more>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { queryFeedBackPage } from '../../common/api/feedback'
|
||||||
|
import list from '../../common/js/list'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [list],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: '灿能'
|
title: '灿能'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad () {
|
onShow() {
|
||||||
|
this.init()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
jump(){
|
init() {
|
||||||
uni.navigateTo({ url: '/pages/message/feedbackDetail' })
|
this.store = this.DataSource('/feedback/queryFeedBackPage')
|
||||||
|
this.store.params.userId = uni.getStorageSync('userInfo').id
|
||||||
|
this.store.reload()
|
||||||
|
},
|
||||||
|
jump(item) {
|
||||||
|
uni.navigateTo({ url: '/pages/message/feedbackDetail?id=' + item.id +'&chatCount=' + item.chatCount })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
<view slot='body'>
|
<view slot='body'>
|
||||||
<view class='detail'>
|
<view class='detail'>
|
||||||
<view class="detail-content ">
|
<view class="detail-content ">
|
||||||
<view class="detail-content-title mb20">机器不稳定</view>
|
<view class="detail-content-title mb20">{{ pageData.title }}</view>
|
||||||
<view> 2023-02-14</view>
|
<view> {{ pageData.createTime }}</view>
|
||||||
<view class="mt10 mb10">机器不稳定机器不稳定机器不稳定机器不稳定机器不稳定</view>
|
<view class="mt10 mb10">{{ pageData.description }}</view>
|
||||||
<uni-file-picker readonly v-model="imageValue" mode="grid" />
|
<uni-file-picker readonly v-model="imageValue" mode="grid" />
|
||||||
</view>
|
</view>
|
||||||
<view class="detail-content " style="margin-bottom:0">
|
<view class="detail-content " style="margin-bottom:0">
|
||||||
@@ -15,15 +15,15 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<uni-list>
|
<uni-list>
|
||||||
<uni-list-item title="客服" note="已经安排专员处理,请保持电话畅通" rightText="09-13 10:52" />
|
<uni-list-item :title="item.createBy" :note="item.chatContent" :rightText="item.createTime"
|
||||||
<uni-list-item title="用户名" note="重启还是不行" rightText="09-13 10:50" />
|
v-for="(item, index) in pageData.csFeedbackChatPOList" :key="index" />
|
||||||
<uni-list-item title="客服" note="重启试试" rightText="09-13 09:50" />
|
|
||||||
</uni-list>
|
</uni-list>
|
||||||
<!-- 输入框示例 -->
|
<!-- 输入框示例 -->
|
||||||
<uni-popup ref="inputDialog" type="dialog">
|
<uni-popup ref="inputDialog" type="dialog">
|
||||||
<uni-popup-dialog ref="inputClose" type="info" mode="input" title="输入内容" value="对话框预置提示内容!"
|
<uni-popup-dialog ref="inputClose" type="info" mode="input" title="输入内容" value="对话框预置提示内容!"
|
||||||
placeholder="请输入内容" @confirm="dialogInputConfirm">
|
placeholder="请输入内容" @confirm="dialogInputConfirm">
|
||||||
<uni-easyinput type="textarea" :maxlength="250" autoHeight v-model="value" placeholder="请输入内容"></uni-easyinput>
|
<uni-easyinput type="textarea" :maxlength="250" autoHeight v-model="chatContent"
|
||||||
|
placeholder="请输入内容"></uni-easyinput>
|
||||||
</uni-popup-dialog>
|
</uni-popup-dialog>
|
||||||
</uni-popup>
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
@@ -31,22 +31,52 @@
|
|||||||
</Cn-page>
|
</Cn-page>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import { queryFeedBackDetail, AddFeedbackChat, updateChatStatus } from '../../common/api/feedback'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
value: "",
|
chatContent: "",
|
||||||
imageValue: [
|
imageValue: [
|
||||||
{
|
{
|
||||||
"name": "file.png",
|
"name": "file.png",
|
||||||
"extname": "png",
|
"extname": "png",
|
||||||
"url": "/static/logo.png",
|
"url": "/static/logo.png",
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
pageData: {
|
||||||
|
},
|
||||||
|
pageOption: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(o) {
|
||||||
|
this.pageOption = o
|
||||||
|
this.init()
|
||||||
|
if (o.chatCount > 0) {
|
||||||
|
updateChatStatus({
|
||||||
|
id: o.id,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
init() {
|
||||||
|
this.loading = true
|
||||||
|
queryFeedBackDetail(this.pageOption.id).then(res => {
|
||||||
|
// 反转数组
|
||||||
|
res.data.csFeedbackChatPOList.reverse()
|
||||||
|
this.pageData = res.data
|
||||||
|
this.loading = false
|
||||||
|
console.log(res);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
dialogInputConfirm() {
|
||||||
|
AddFeedbackChat({ chatContent: this.chatContent, id: this.pageOption.id }).then(res => {
|
||||||
|
console.log(res);
|
||||||
|
this.$util.toast('回复成功')
|
||||||
|
this.init()
|
||||||
|
this.chatContent = ''
|
||||||
|
})
|
||||||
|
},
|
||||||
open() {
|
open() {
|
||||||
this.$refs.inputDialog.open()
|
this.$refs.inputDialog.open()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user