Commit 1c5080e7 authored by 潘永坪's avatar 潘永坪

投诉建议开发

parent 62230994
......@@ -163,7 +163,7 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
/* -webkit-line-clamp: 2; */
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
//设置checkbox背景色
......
......@@ -301,7 +301,14 @@
}
},
{
"path" : "suggestComplaint/commit/commit",
"path" : "suggestComplaint/suggestCommit/suggestCommit",
"style" :
{
"navigationBarTitleText" : "建议投诉"
}
},
{
"path" : "suggestComplaint/complaintCommit/complaintCommit",
"style" :
{
"navigationBarTitleText" : "建议投诉"
......
......@@ -169,14 +169,14 @@
咨询电话
</view>
</view>
<!-- <view class="middle3-list" @click="goSuggest()">
<view class="middle3-list" @click="goSuggest()">
<view>
<image src="@/static/img/my/center/suggest.png"></image>
</view>
<view>
建议投诉
</view>
</view> -->
</view>
</view>
</view>
</view>
......
......@@ -9,7 +9,7 @@
</view>
<view class="choose">
<text v-for="(item,index) in typeList" :key="index" class="choose-list" :class="{on:active==index}" @click="typeChange(index)">
{{item}}
{{item.commentType}}
</text>
</view>
</view>
......@@ -19,7 +19,7 @@
<text class="red">*</text>
</view>
<view style="margin-top: 24rpx;">
<u--textarea v-model="value2" placeholder="请描述您遇到的问题,我们会尽快处理" count maxlength='400' height='200'>
<u--textarea v-model="commentText" placeholder="请描述您遇到的问题,我们会尽快处理" count maxlength='400' height='200'>
</u--textarea>
</view>
......@@ -32,10 +32,10 @@
</view>
<view style="margin-top: 24rpx;">
<u-upload
:fileList="fileList5"
:fileList="fileList1"
@afterRead="afterRead"
@delete="deletePic"
name="5"
name="1"
multiple
:maxCount="3"
width='160'
......@@ -48,13 +48,13 @@
<text>联系手机</text>
</view>
<view class="phone">
<input class="uni-input" type="number" placeholder="请输入您的手机号码" />
<input class="uni-input" type="number" placeholder="请输入您的手机号码" v-model="phone" />
</view>
</view>
</view>
<view class="bottom">
<text class="full-btn">提交</text>
<text class="full-btn" @click="commit()">提交</text>
</view>
</view>
</template>
......@@ -64,14 +64,151 @@ export default{
data(){
return{
active:0,//默认下标
typeList:['服务类','设施类','环境类','票务类','其他类'],
value2:''
merchantId:'z0015605022691a5945bbe463141668c',//商户Id
openid:uni.getStorageSync('openid')||'',//openid
typeList:[],//类型列表
commentText:'',//投诉内容
phone:'',//电话号码
commentType:'',//投诉类别
fileList1: [],//文件列表
imgList:[],//上传的图片列表
}
},
onLoad(option) {
//this.merchantId=option.merchantId||''
this.initType()
},
methods:{
//---投诉类型改变
typeChange(index){
this.active=index
this.commentType=this.typeList[index].commentType
},
//---类型加载
initType(){
let data={
merchantId:this.merchantId,//商户Id
submitType:0,//0-投诉,1-建议
}
this.$request('comment/submitConfig/loadCommentType',data).then((res)=>{
if(res.code=='00'){
this.typeList=res.data||[]
//默认取第一个
if(this.typeList.length>0){
this.commentType=this.typeList[0].commentType
}
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
//---删除图片
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
//---新增图片
async afterRead(event) {
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let baseUrl=''
if(process.env.NODE_ENV === 'development'){//开发环境
baseUrl='http://192.168.0.213:7888/'
}else{
baseUrl= 'https://manager.pangdly.com/'
}
let fun = uni.uploadFile({
url: baseUrl+'upload/file/newUpload', // 仅为示例,非真实的接口地址
filePath:url,
name: 'uploadFile',
success: (res) => {
let res1=JSON.parse(res.data)
if(res1.code == '00'){
resolve(res1.data)
}
}
})
})
},
//---提交
commit(){
this.imgList=this.fileList1.map(item=>{
let baseUrl=''
if(process.env.NODE_ENV === 'development'){//开发环境
baseUrl='http://picture.tuyoyoo.com/'
}else{
baseUrl= 'http://picture.pangdly.com/'
}
return {
imgUrl:baseUrl+item.url,
imgCommentType:0//0游客发起图片 1客服回复图片
}
})
if(!this.commentType){
uni.showToast({
title: '请选择投诉类别',
icon: 'none'
})
return
}
if(!this.commentText){
uni.showToast({
title: '请输入投诉内容',
icon: 'none'
})
return
}
let data={
merchantId:this.merchantId,//商户Id
openid:this.openid,//openid
phone:this.phone,//电话号码
submitType:0,//0-投诉 1-建议
commentText:this.commentText,//投诉内容
commentType:this.commentType,//投诉类别
handleStatus:0,//处理状态 0未处理1已处理(默认填0)
commentImgList:this.imgList,//图片列表
}
this.$request('comment/userComment/save',data).then((res)=>{
if(res.code=='00'){
uni.showToast({
title:'提交成功',
icon: 'none'
})
setTimeout(()=>{
uni.navigateBack({
delta:1
})
},2000)
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
}
}
}
......@@ -135,8 +272,17 @@ export default{
padding: 20rpx 32rpx 32rpx 32rpx;
border-top: 1px solid #E9E9E9;;
}
/*修改上传组件样式*/
.top-list /deep/ .uicon-camera-fill{
font-size: 36px !important;
line-height: 36px !important;
}
.top-list /deep/ .uicon-close{
font-size: 10px !important;
line-height: 10px !important;
}
.top-list /deep/ .uicon-checkmark{
font-size: 12px !important;
line-height: 12px !important;
}
</style>
\ No newline at end of file
......@@ -53,7 +53,33 @@
<script>
export default{
data(){
return {
batchId:'',//批次id
}
},
onLoad(option){
this.batchId=option.batchId
this.initDetail()
},
methods:{
//---详情加载
initDetail(){
let data={
batchId:this.batchId//批次Id
}
this.$request('comment/userComment/loadInfo',data).then((res)=>{
if(res.code=='00'){
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
}
}
}
</script>
......
......@@ -9,30 +9,40 @@
<view class="middle">
<!-- 建议列表 -->
<view class="middle-list" v-for="(item,index) in 10" :key="index" v-if="active==0" @click="goDetail()">
<view class="list-time">
<text>2024-11-16 11:02:31</text>
<text>查看回复</text>
<template v-if="active==0">
<view class="middle-list" v-for="(item,index) in suggestList" :key="index" @click="goDetail(item.batchId)">
<view class="list-time">
<text>{{item.createTime}}</text>
<text>查看回复</text>
</view>
<view class="list-content txt-cut">
{{item.commentText}}
</view>
</view>
<view class="list-content">
第一次来长江索道, 经门口的人介绍扫码买票,以为是买长江素道的门票, 误买了三张缆…
<view class="empty" v-if="suggestList.length==0">
暂无建议记录...
</view>
</view>
</template>
<!-- 投诉列表 -->
<view class="middle-list" v-for="(item,index) in 10" :key="index" v-else @click="goDetail()">
<view class="list-time">
<text>2024-11-16 11:02:31</text>
<text>查看回复</text>
<template v-else>
<view class="middle-list" v-for="(item,index) in complaintList" :key="index" @click="goDetail(item.batchId)">
<view class="list-time">
<text>{{item.createTime}}</text>
<text>查看回复</text>
</view>
<view class="list-content">
{{item.commentText}}
</view>
</view>
<view class="list-content">
第一次来长江索道, 经门口的人介绍扫码买票,以为是买长江素道的门票, 误买了三张缆…
<view class="empty" v-if="complaintList.length==0">
暂无投诉记录...
</view>
</view>
</template>
</view>
<view class="bottom">
<text class="full-btn" v-if="active==0" @click="goCommit()">我要建议</text>
<text class="full-btn" v-else @click="goCommit()">我要投诉</text>
<text class="full-btn" v-if="active==0" @click="goSuggestCommit()">我要建议</text>
<text class="full-btn" v-else @click="goComplaintCommit()">我要投诉</text>
</view>
</view>
</template>
......@@ -42,24 +52,71 @@ export default{
data(){
return{
active:0,//导航下标
tabList:['建议','投诉']//导航列表
tabList:['建议','投诉'],//导航列表
merchantId:'z0015605022691a5945bbe463141668c',//商户Id
openid:uni.getStorageSync('openid')||'',//openid
suggestList:[],//建议列表
complaintList:[],//投诉列表
}
},
onLoad(option) {
// this.merchantId=option.merchantId||''
},
onShow() {
this.initList()
},
methods:{
//---导航切换
tabChange(index){
this.active=index
},
//---跳转提交页面
goCommit(){
//---跳转建议提交页面
goSuggestCommit(){
uni.navigateTo({
url:'/pages/my/suggestComplaint/commit/commit'
url:'/pages/my/suggestComplaint/suggestCommit/suggestCommit?merchantId='+this.merchantId
})
},
//---跳转投诉提交页面
goComplaintCommit(){
uni.navigateTo({
url:'/pages/my/suggestComplaint/complaintCommit/complaintCommit?merchantId='+this.merchantId
})
},
//---跳转详情页面
goDetail(){
goDetail(batchId){
uni.navigateTo({
url:'/pages/my/suggestComplaint/detail/detail'
url:'/pages/my/suggestComplaint/detail/detail?batchId='+batchId
})
},
//---列表加载
initList(){
let data={
merchantId:this.merchantId,//商户Id
openid:this.openid,//openid
pageIndex: 1,
pageSize:9999
}
this.complaintList=[]
this.suggestList=[]
this.$request('comment/userComment/loadPage',data).then((res)=>{
if(res.code=='00'){
let list=res.data.userCommentPageResVo.list||[]
list.forEach(item=>{
if(item.submitType==0){
//投诉
this.complaintList.push(item)
}
if(item.submitType==1){
//建议
this.suggestList.push(item)
}
})
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
}
}
......@@ -78,7 +135,10 @@ export default{
width: 100%;
height: 120rpx;
color: #999;
view.on{
>view{
padding: 20rpx 60rpx;
}
>view.on{
color: #333333;
}
}
......@@ -116,4 +176,8 @@ export default{
background: #ffffff;
padding: 20rpx 32rpx 32rpx 32rpx;
}
.empty{
padding-top: 400rpx;
text-align: center;
}
</style>
\ No newline at end of file
<template>
<view class="wrap">
<view class="top">
<view class="top-list">
<view>
<text class="title">建议描述</text>
<text class="red">*</text>
</view>
<view style="margin-top: 24rpx;">
<u--textarea v-model="commentText" placeholder="请描述您的建议,我们会尽快处理" count maxlength='400' height='200'>
</u--textarea>
</view>
</view>
<view class="top-list">
<view>
<text class="title">相关图片</text>
<text class="grey">(最多二张)</text>
</view>
<view style="margin-top: 24rpx;">
<u-upload
:fileList="fileList1"
@afterRead="afterRead"
@delete="deletePic"
name="1"
multiple
:maxCount="2"
width='160'
height='160'
></u-upload>
</view>
</view>
<view class="top-list" style="border-bottom:none;">
<view class="title">
<text>联系手机</text>
</view>
<view class="phone">
<input class="uni-input" type="number" placeholder="请输入您的手机号码" v-model="phone" />
</view>
</view>
</view>
<view class="bottom">
<text class="full-btn" @click="commit()">提交</text>
</view>
</view>
</template>
<script>
export default{
data(){
return{
active:0,//默认下标
merchantId:'z0015605022691a5945bbe463141668c',//商户Id
openid:uni.getStorageSync('openid')||'',//openid
commentText:'',//建议内容
phone:'',//电话号码
fileList1: [],//文件列表
imgList:[],//上传的图片列表
}
},
onLoad(option) {
// this.merchantId=option.merchantId||''
},
methods:{
//---删除图片
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
//---新增图片
async afterRead(event) {
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let baseUrl=''
if(process.env.NODE_ENV === 'development'){//开发环境
baseUrl='http://192.168.0.213:7888/'
}else{
baseUrl= 'https://manager.pangdly.com/'
}
let fun = uni.uploadFile({
url: baseUrl+'upload/file/newUpload', // 仅为示例,非真实的接口地址
filePath:url,
name: 'uploadFile',
success: (res) => {
let res1=JSON.parse(res.data)
if(res1.code == '00'){
resolve(res1.data)
}
}
})
})
},
//---提交
commit(){
this.imgList=this.fileList1.map(item=>{
let baseUrl=''
if(process.env.NODE_ENV === 'development'){//开发环境
baseUrl='http://picture.tuyoyoo.com/'
}else{
baseUrl= 'http://picture.pangdly.com/'
}
return {
imgUrl:baseUrl+item.url,
imgCommentType:0//0游客发起图片 1客服回复图片
}
})
if(!this.commentText){
uni.showToast({
title: '请输入建议内容',
icon: 'none'
})
return
}
let data={
merchantId:this.merchantId,//商户Id
openid:this.openid,//openid
phone:this.phone,//电话号码
submitType:1,//0-投诉 1-建议
commentText:this.commentText,//建议内容
handleStatus:0,//处理状态 0未处理1已处理(默认填0)
commentImgList:this.imgList,//图片列表
}
this.$request('comment/userComment/save',data).then((res)=>{
if(res.code=='00'){
uni.showToast({
title:'提交成功',
icon: 'none'
})
setTimeout(()=>{
uni.navigateBack({
delta:1
})
},2000)
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.wrap{
background: #ffffff;
min-height: 100%;
}
.top{
padding: 0 40rpx;
}
.top-list{
padding: 40rpx 0;
border-bottom: 1px solid #f5f5f5;
}
.top-list view:first-child{
display: flex;
align-items: center;
}
.title{
color: #000000;
}
.grey{
color: #999999;
}
.red{
color: #F53F3F;
}
.phone{
margin-top: 24rpx;
background: #F7F8FA;
padding:32rpx;
}
.bottom{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background: #ffffff;
padding: 20rpx 32rpx 32rpx 32rpx;
border-top: 1px solid #E9E9E9;;
}
/*修改上传组件样式*/
.top-list /deep/ .uicon-camera-fill{
font-size: 36px !important;
line-height: 36px !important;
}
.top-list /deep/ .uicon-close{
font-size: 10px !important;
line-height: 10px !important;
}
.top-list /deep/ .uicon-checkmark{
font-size: 12px !important;
line-height: 12px !important;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment