投诉模块页面页面优化

version/0412
mujinxia 1 year ago
parent 7aba6f7a9e
commit 0a9e89da83
  1. 830
      pages/news1/feedback.vue
  2. 4
      pages/news1/setting.vue

@ -1,61 +1,59 @@
<template> <template>
<view> <view>
<view class="order-tab"> <view class="order-tab">
<view :class="OrderType==0?'tab action':'tab'" @click="onOrderTab(0)"> <view :class="OrderType == 0 ? 'tab action' : 'tab'" @click="onOrderTab(0)">
<text>我要反馈</text> <text>我要反馈</text>
<text class="line"></text> <text class="line"></text>
</view> </view>
<view :class="OrderType==1?'tab action':'tab'" @click="onOrderTab(1)"> <view :class="OrderType == 1 ? 'tab action' : 'tab'" @click="onOrderTab(1)">
<text>反馈公示</text> <text>反馈公示</text>
<text class="line"></text> <text class="line"></text>
</view> </view>
<view :class="OrderType==2?'tab action':'tab'" @click="onOrderTab(2)"> <view :class="OrderType == 2 ? 'tab action' : 'tab'" @click="onOrderTab(2)">
<text>我的反馈</text> <text>我的反馈</text>
<text class="line"></text> <text class="line"></text>
</view> </view>
</view> </view>
<view class="section1" v-if="OrderType==0"> <view class="section1" v-if="OrderType == 0">
<u-form :model="form" ref="uForm"> <u-form :model="form" ref="uForm">
<view class="section1Item"> <view class="section1Item">
<u-form-item label="反馈类型" label-width="150"> <u-form-item label="反馈类型" label-width="170">
<u-radio-group v-model="form.type"> <u-radio-group v-model="form.type">
<u-radio active-color="#FF4434" v-for="(item, index) in checkboxList1" :key="index" <u-radio active-color="#FF4434" v-for="(item, index) in checkboxList1" :key="index"
:name="item.name"> :name="item.name">
{{item.name}} {{ item.name }}
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item label="反馈类型" label-width="150"> <u-form-item label="反馈类型" label-width="170">
<u-radio-group v-model="form.shop"> <u-radio-group v-model="form.shop">
<u-radio active-color="#FF4434" v-for="(item, index) in checkboxList2" :key="index" <u-radio active-color="#FF4434" v-for="(item, index) in checkboxList2" :key="index"
:name="item.name"> :name="item.name">
{{item.name}} {{ item.name }}
</u-radio> </u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item label="门店" label-width="150" @click="typeShow = true"> <u-form-item label="反馈类型" label-width="170" @click="typeShow = true">
<u-input v-model="form.shopText" placeholder="请选择门店" type="select" @click="typeShow = true" /> <u-input v-model="form.shopText" placeholder="请选择门店" type="select" @click="typeShow = true" />
<u-action-sheet :list="shopList" :cancel-btn="false" v-model="typeShow" <u-action-sheet :list="shopList" :cancel-btn="false" v-model="typeShow"
@click="actionSheetCallback"></u-action-sheet> @click="actionSheetCallback"></u-action-sheet>
</u-form-item> </u-form-item>
<u-form-item label="投诉内容" label-width="150" label-position="top"> <u-form-item label="投诉内容" required label-width="150" label-position="top">
<u-input v-model="form.comment" class="textarea" placeholder="请填写投诉内容" type="textarea" /> <u-input v-model="form.comment" class="textarea" placeholder="请填写投诉内容" type="textarea" />
</u-form-item> </u-form-item>
<u-upload :fileList="finishImageList" :previewFullImage="true" @afterRead="afterRead" :maxCount="8" <u-upload :fileList="finishImageList" :previewFullImage="true" @afterRead="afterRead" :maxCount="8"
width="180" height="180" upload-text="上传照片" @delete="deletePic" name="1" multiple></u-upload> width="180" height="180" upload-text="上传照片" @delete="deletePic" name="1" multiple></u-upload>
</view> </view>
<view class="section1Item" style="margin-top:20rpx;"> <view class="section1Item" style="margin-top:20rpx;">
<u-form-item label="您的称呼" label-width="150"> <u-form-item label="您的称呼" label-width="170">
<u-input placeholder="请填写" v-model="form.name" /> <u-input placeholder="请输入您的称呼" v-model="form.name" />
</u-form-item> </u-form-item>
<u-form-item label="手机号码" label-width="150"> <u-form-item label="手机号码" label-width="170">
<u-input placeholder="请填写" v-model="form.phone" /> <u-input placeholder="请输入手机号" v-model="form.phone" />
</u-form-item> </u-form-item>
</view> </view>
</u-form> </u-form>
@ -68,71 +66,88 @@
提交 提交
</view> </view>
</view> </view>
<view class="section2" v-if="OrderType==1"> <view class="section2" v-if="OrderType == 1">
<view class="feedShow" v-for="(item,index) in feedBackList" :key="index"> <view class="feedShow" v-for="(item, index) in feedBackList" :key="index">
<view class="feedbackItem"> <view class="feedbackItem">
<view class="statusfb">
<text v-if="item.status==0">待处理</text>
<text v-if="item.status==1">已完成</text>
</view>
<view class="feedbackContent"> <view class="feedbackContent">
<view class="fbTitle"> <view class="fbTitle">
<view class="fbFlag"> <view class="fbFlag">
<text v-if="item.type==1">投诉</text> <text v-if="item.type == 1">投诉</text>
<text v-if="item.type==2">建议</text> <text v-if="item.type == 2">建议</text>
<text v-if="item.type==3">表扬</text> <text v-if="item.type == 3">表扬</text>
</view> </view>
<view class="fbTitleText"> <view class="fbTitleText">
{{item.store_name}} {{ item.shop_name }}
</view>
<view class="statusfb">
<text v-if="item.status == 0">待处理</text>
<text v-if="item.status == 1">已完成</text>
</view> </view>
</view> </view>
<u-read-more show-height="150" color="#9E9E9E" :toggle="true" close-text="展开"> <u-read-more showHeight="160" textIndent="0" fontSize="26rpx" color="#9E9E9E" :toggle="true"
<rich-text :nodes="item.content"></rich-text> close-text="展开">
<rich-text v-if="index != 0" :nodes="item.content"></rich-text>
<rich-text v-else
nodes="投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容投诉内容"></rich-text>
</u-read-more> </u-read-more>
<view class="timefb"> <view class="timefb">
{{item.created_at}} {{ item.created_at }}
</view> </view>
</view> </view>
<view class="feedbackResult"> <view class="feedbackResult">
<u-collapse> <u-collapse>
<u-collapse-item title="处理结果"> <u-collapse-item :open="true" title="处理结果">
<u-form :model="item" ref="item"> <u-form :model="item" ref="item" class="selfForm">
<u-form-item label="处理时间" label-width="150" prop="time"> <u-form-item label="处理时间:" label-width="150" prop="time">
{{item.replay_at}} {{ item.replay_at }}
</u-form-item> </u-form-item>
<u-form-item label="反馈内容" label-width="150" prop="feedback"> <u-form-item label="反馈内容:" label-width="150" prop="feedback">
{{item.content}} {{ item.content }}
</u-form-item> </u-form-item>
</u-form> </u-form>
</u-collapse-item> </u-collapse-item>
</u-collapse> </u-collapse>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="section2" v-if="OrderType==2"> <view class="section2" v-if="OrderType == 2">
<view class="feedShow" v-for="(item,index) in feedBackList" :key="index"> <view class="feedShow" style="padding: 0;" v-for="(item, index) in feedBackList" :key="index">
<view class="feedbackItem"> <view class="feedbackResult">
<u-collapse>
<u-collapse-item :open="true" title="处理结果">
<u-form :model="item" ref="item" class="selfForm">
<u-form-item label="处理时间:" label-width="150" prop="time">
{{ item.replay_at }}
</u-form-item>
<u-form-item label="反馈内容:" label-width="150" prop="feedback">
{{ item.content }}
</u-form-item>
</u-form>
</u-collapse-item>
</u-collapse>
</view>
<!-- <view class="feedbackItem">
<view class="feedbackResult"> <view class="feedbackResult">
<u-collapse> <u-collapse>
<u-collapse-item :open="true" title="处理结果"> <u-collapse-item :open="false" title="处理结果">
<u-form :model="item" ref="item"> <u-form :model="item" ref="item">
<u-form-item label="处理时间" label-width="150" prop="time"> <u-form-item label="处理时间" label-width="150" prop="time">
{{item.replay_at}} {{ item.replay_at }}
</u-form-item> </u-form-item>
<u-form-item label="反馈内容" label-width="150" prop="feedback"> <u-form-item label="反馈内容" label-width="150" prop="feedback">
{{item.content}} {{ item.content }}
</u-form-item> </u-form-item>
</u-form> </u-form>
</u-collapse-item> </u-collapse-item>
</u-collapse> </u-collapse>
</view> </view> -->
</view> <!-- </view> -->
</view> </view>
<!-- <view class="empty"> <!-- <view class="empty">
@ -146,426 +161,437 @@
</template> </template>
<script> <script>
import * as feedback from '@/api/feedback' import * as feedback from '@/api/feedback'
export default { export default {
data() { data() {
return { return {
OrderType: 0, OrderType: 0,
shop_id: '', shop_id: '',
form: { form: {
type: '', type: '',
shop: '', shop: '',
shopText: '', shopText: '',
comment: '', comment: '',
name: '', name: '',
phone: '' phone: ''
},
feedBackList: [],
page: 1,
checkboxList1: [{
name: '投诉',
val: 1
},
{
name: '建议',
val: 2
},
{
name: '表扬',
val: 3
}
],
checkboxList2: [{
name: '门店'
},
{
name: '其他'
},
],
typeShow: false,
shopList: [],
//
finishImageList: [],
result: {}
};
},
onShow() {
this.getShopList()
},
onLoad(params) {
},
methods: {
getShopList() {
const that = this
that.shopList = []
return new Promise((resolve, reject) => {
feedback.shopList()
.then(res => {
if (res.data.length > 0) {
for (var i = 0; i < res.data.length; i++) {
let obj = {
text: res.data[i].shop_name,
id: res.data[i].shop_id
}
that.shopList.push(obj)
}
}
})
.catch(reject)
})
}, },
submit() { feedBackList: [],
const that = this page: 1,
let params = { checkboxList1: [{
shop_id: that.shop_id, name: '投诉',
type: that.form.type, val: 1
object_type: that.form.shop,
content: that.form.comment
}
return new Promise((resolve, reject) => {
feedback.add(params)
.then(res => {
that.$toast(res.message)
})
.catch(reject)
})
}, },
{
/** name: '建议',
* 订单tab点击 val: 2
*/
onOrderTab(type) {
this.OrderType = type;
if (type != 0) {
this.getFeedBack(type)
}
}, },
getFeedBack(type) { {
// name: '表扬',
const that = this val: 3
let params = { }
is_my: '', ],
page: that.page checkboxList2: [{
} name: '门店'
params.is_my = type == 1 ? 0 : 1
return new Promise((resolve, reject) => {
feedback.list(params)
.then(res => {
if (res.status == 200) {
that.feedBackList = res.data.list.data
}
})
.catch(reject)
})
}, },
actionSheetCallback(index) { {
console.log(index,this.shopList) name: '其他'
this.form.shopText = this.shopList[index].text;
this.shop_id = this.shopList[index].id
}, },
// ],
async afterRead(event) { typeShow: false,
shopList: [],
let lists = [].concat(event.file) //
let fileListLen = this[`fileList${event.name}`].length finishImageList: [],
lists.map((item) => { result: {}
this[`fileList${event.name}`].push({ };
...item, },
status: 'uploading', onShow() {
message: '上传中' this.getShopList()
},
onLoad(params) {
},
methods: {
getShopList() {
const that = this
that.shopList = []
return new Promise((resolve, reject) => {
feedback.shopList()
.then(res => {
if (res.data.length > 0) {
for (var i = 0; i < res.data.length; i++) {
let obj = {
text: res.data[i].shop_name,
id: res.data[i].shop_id
}
that.shopList.push(obj)
}
}
}) })
}) .catch(reject)
for (let i = 0; i < lists.length; i++) { })
const result = await this.uploadFilePromise(lists[i].url) },
submit() {
if (JSON.parse(result).code == 1) { const that = this
let item = this[`fileList${event.name}`][fileListLen] let params = {
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, { shop_id: that.shop_id,
status: 'success', type: that.form.type,
message: '', object_type: that.form.shop,
url: result content: that.form.comment
})) }
fileListLen++ return new Promise((resolve, reject) => {
} else { feedback.add(params)
this[`fileList${event.name}`].splice(fileListLen, 1) .then(res => {
} that.$toast(res.message)
})
.catch(reject)
})
},
/**
* 订单tab点击
*/
onOrderTab(type) {
this.OrderType = type;
if (type != 0) {
this.getFeedBack(type)
}
},
getFeedBack(type) {
//
const that = this
let params = {
is_my: 0,
page: that.page
}
// params.is_my = type == 1 ? 0 : 1
return new Promise((resolve, reject) => {
feedback.list(params)
.then(res => {
if (res.status == 200) {
that.feedBackList = res.data.list.data
}
})
.catch(reject)
})
},
actionSheetCallback(index) {
console.log(index, this.shopList)
this.form.shopText = this.shopList[index].text;
this.shop_id = this.shopList[index].id
},
//
async afterRead(event) {
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)
if (JSON.parse(result).code == 1) {
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
} else {
this[`fileList${event.name}`].splice(fileListLen, 1)
} }
}, }
//
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: this.baseUrl+'/api/common/upload', //
filePath: url,
name: 'file',
formData: {
user: 'test',
token:getToken()
},
success: (res) => {
if(JSON.parse(res.data).code==1){
setTimeout(() => {
this.finishImageList.push({url:JSON.parse(res.data).data.fullurl,path:JSON.parse(res.data).data.url})
resolve(res.data)
}, 1000)
}else{
uni.$u.toast(JSON.parse(res.data).msg)
},
//
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: this.baseUrl + '/api/common/upload', //
filePath: url,
name: 'file',
formData: {
user: 'test',
token: getToken()
},
success: (res) => {
if (JSON.parse(res.data).code == 1) {
setTimeout(() => {
this.finishImageList.push({ url: JSON.parse(res.data).data.fullurl, path: JSON.parse(res.data).data.url })
resolve(res.data) resolve(res.data)
} }, 1000)
}, } else {
fail: (res) => { uni.$u.toast(JSON.parse(res.data).msg)
console.log(res,"rrr")
resolve(res.data)
} }
}); },
}) fail: (res) => {
}, console.log(res, "rrr")
// }
deletePic(event) { });
})
},
//
deletePic(event) {
this.finishImageList.splice(event.index, 1) this.finishImageList.splice(event.index, 1)
}, },
}
} }
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
page { page {
min-height: 100%; min-height: 100%;
width: 100%; width: 100%;
background-color: #F7F8FA; background-color: #F7F8FA;
} }
/* 订单tab */ /* 订单tab */
.order-tab { .order-tab {
position: fixed; position: fixed;
left: 0; left: 0;
top: 0; top: 0;
z-index: 10; z-index: 10;
display: flex;
align-items: center;
width: 100%;
height: 100rpx;
background-color: #FFFFFF;
.tab {
position: relative;
display: flex; display: flex;
align-items: center; align-items: center;
width: 100%; justify-content: center;
height: 100rpx; flex: 1;
background-color: #FFFFFF; height: 80%;
.tab { text {
position: relative; font-size: 32rpx;
display: flex; font-family: PingFang SC, PingFang SC;
align-items: center; font-weight: 500;
justify-content: center;
flex: 1;
height: 80%;
text {
font-size: 32rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
}
} }
}
.action { .action {
text { text {
color: #FF4D4D; color: #FF4D4D;
line-height: 19px; line-height: 19px;
} }
.line { .line {
position: absolute; position: absolute;
left: 50%; left: 50%;
bottom: 0; bottom: 0;
width: 32rpx; width: 32rpx;
height: 6rpx; height: 6rpx;
background: #FF4D4D; background: #FF4D4D;
transform: translate(-50%, 0); transform: translate(-50%, 0);
border-radius: 32px 32px 32px 32px; border-radius: 32px 32px 32px 32px;
}
} }
} }
}
.section1 { .selfForm {
border: 1px solid transparent; ::v-deep .u-form-item {
padding: 0;
}
}
.section1Item { .section1 {
background-color: #fff; border: 1px solid transparent;
border-radius: 4px 4px 4px 4px;
margin: 120rpx 30rpx 30rpx 30rpx;
padding: 10rpx 40rpx;
}
::v-deep .u-form-item--left__content__label { .section1Item {
font-size: 32rpx; background-color: #fff;
font-family: PingFang SC, PingFang SC; border-radius: 4px 4px 4px 4px;
font-weight: bold; margin: 120rpx 30rpx 30rpx 30rpx;
color: #373737; padding: 20rpx 46rpx;
} }
::v-deep .u-border-bottom:after { ::v-deep .u-form-item--left__content__label {
border: none; font-size: 32rpx;
} font-family: PingFang SC, PingFang SC;
font-weight: bold;
color: #373737;
}
.textarea { ::v-deep .u-border-bottom:after {
height: 250rpx; border: none;
background: #F7F8FA; }
border-radius: 3px 3px 3px 3px;
opacity: 1;
} // .textarea {
// height: 258rpx;
// border-radius: 3px;
// border: solid 1upx #F7F8FA;
::v-deep .u-input__textarea { // }
padding: 26rpx;
}
.introContent { ::v-deep .u-input__textarea {
margin-top: 16rpx; padding: 26rpx;
margin: 16rpx 30rpx 30rpx 30rpx; }
.introText { .introContent {
font-size: 24rpx; margin-top: 16rpx;
color: #C5C6C8; margin: 16rpx 30rpx 30rpx 30rpx;
margin-top: 16rpx;
line-height: 40rpx;
}
.introText {
font-size: 26rpx;
color: #C5C6C8;
margin-top: 16rpx;
line-height: 40rpx;
} }
.submitBtn {
height: 100rpx;
background: linear-gradient(180deg, #FE7E71 0%, #FF4434 100%);
border-radius: 52px 52px 52px 52px;
opacity: 1;
font-size: 32rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #FFFFFF;
margin: 32rpx 30rpx 30rpx 30rpx;
text-align: center;
line-height: 100rpx;
}
} }
.section2 { .submitBtn {
min-height: 100%; height: 100rpx;
padding: 120rpx 30rpx 30rpx 30rpx; background: linear-gradient(180deg, #FE7E71 0%, #FF4434 100%);
border-radius: 52px 52px 52px 52px;
opacity: 1;
font-size: 32rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #FFFFFF;
margin: 32rpx 30rpx 30rpx 30rpx;
text-align: center;
line-height: 100rpx;
}
}
.feedShow { .section2 {
padding: 30rpx; min-height: 100%;
border-radius: 4px 4px 4px 4px; padding: 120rpx 30rpx 30rpx 30rpx;
background-color: #fff;
margin-bottom: 16rpx;
}
.feedbackItem { .feedShow {
position: relative; padding: 30rpx 0;
margin-bottom: 30rpx; border-radius: 4px;
// border:1px solid yellow; background-color: #fff;
margin-bottom: 16rpx;
.statusfb { }
position: absolute;
right: 0;
width: 92rpx;
height: 44rpx;
line-height: 44rpx;
text-align: center;
background-color: #EEFAF6;
font-size: 26rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #2DC37F;
top: 40rpx;
}
.feedbackContent {
padding-bottom: 30rpx;
border-bottom: 1px solid #A0A0A0;
.fbTitle {
display: flex;
align-items: center;
width: calc(100% - 100rpx);
.fbFlag {
// width: 54rpx;
// height: 44rpx;
// line-height: 44rpx;
background: #FFFFFF;
border-radius: 3px;
opacity: 1;
padding: 5rpx;
border: 1px solid #FF4D4D;
font-size: 26rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #FF4D4D;
flex-shrink: 1;
}
.fbTitleText { .feedbackItem {
flex: 1; position: relative;
white-space: nowrap; margin-bottom: 30rpx;
overflow: hidden;
text-overflow: ellipsis; .statusfb {
color: #000; position: absolute;
font-size: 500; top: 4rpx;
margin-left: 20rpx; right: -30rpx;
} width: 100rpx;
height: 44rpx;
line-height: 44rpx;
text-align: center;
border-radius: 22rpx 0 0 22rpx;
background-color: #EEFAF6;
font-size: 26rpx;
font-family: PingFang SC, PingFang SC;
font-weight: bold;
color: #2DC37F;
}
.feedbackContent {
padding: 0 30rpx 30rpx;
border-bottom: 1px solid #A0A0A0;
.fbTitle {
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20rpx;
// width: calc(100% - 100rpx);
.fbFlag {
background: #FFFFFF;
border-radius: 3px;
opacity: 1;
padding: 5rpx;
border: 1px solid #FF4D4D;
font-size: 26rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #FF4D4D;
flex-shrink: 1;
} }
.timefb { .fbTitleText {
color: #A0A0A0; flex: 1;
font-size: 28rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #000;
font-weight: bold;
margin-left: 20rpx;
} }
} }
.feedbackResult { .timefb {
::v-deep .u-form-item--left__content__label { margin-top: 20rpx;
color: #A6A6A6; font-size: 24rpx;
} color: #A0A0A0;
}
}
::v-deep .u-border-bottom:after {
border: none;
}
::v-deep .u-form-item__body {
align-items: baseline;
}
::v-deep .u-form-item--right__content__slot {
line-height: 36rpx;
}
} }
.feedbackResult {
padding: 0 30rpx;
::v-deep .u-form-item--left__content__label {
color: #A6A6A6;
} }
.empty { ::v-deep .u-border-bottom:after {
text-align: center; border: none;
position: relative; }
top: 150rpx;
image { ::v-deep .u-form-item__body {
width: 210rpx; align-items: baseline;
height: auto; }
}
.emptytext { ::v-deep .u-form-item--right__content__slot {
font-size: 32rpx; line-height: 36rpx;
font-family: PingFang SC, PingFang SC; }
font-weight: 500;
color: #717171;
} }
.empty {
text-align: center;
position: relative;
top: 150rpx;
image {
width: 210rpx;
height: auto;
} }
.emptytext {
font-size: 32rpx;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #717171;
}
} }
}
</style> </style>

@ -172,8 +172,8 @@ export default {
}, },
onOut() { onOut() {
uni.showModal({ uni.showModal({
title: '友情提示', title: '您是否要注销账号?',
content: '确认要注销吗?', content: '',
success(o) { success(o) {
if (o.confirm) { if (o.confirm) {
uni.removeStorage('token'); uni.removeStorage('token');

Loading…
Cancel
Save