问题修改

This commit is contained in:
zzyuan 2025-08-29 18:03:12 +08:00
parent dcfd0056ef
commit a44594df00
8 changed files with 532 additions and 217 deletions

View File

@ -20,6 +20,7 @@
</view> </view>
</view> </view>
<view class="time">{{ item.crtime }}</view> <view class="time">{{ item.crtime }}</view>
<view v-if="item.replyContent&&item.replyContent!=''">回复内容{{item.replyContent}}</view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
@ -76,7 +77,7 @@ export default {
// "custId": uni.getStorageSync('custId'), // "custId": uni.getStorageSync('custId'),
} }
const res = await getqueryPlaintApi(param) const res = await getqueryPlaintApi(param)
console.log(res) // console.log(res)
this.messageList = res this.messageList = res
// this.total = res.total; // this.total = res.total;
// if(this.pageNum==1){ // if(this.pageNum==1){

View File

@ -0,0 +1,372 @@
<template>
<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
<view class="feedback-page">
<view class="content-box">
<view class="border-box">
<view style="font-size: 32rpx;margin-bottom: 5px;"><span style="color: red;">*</span>食堂 </view>
<view @click="showCarteen=true" style="width: 100%;height: auto;">
<view style="border: 1px solid #dadbde;padding: 12rpx;height: 30px;">
{{canteenName}}
</view>
</view>
<u-action-sheet
:show="showCarteen"
:actions="actions"
title="请选择食堂"
@close="showCarteen=false"
@select="carteenSelect"
></u-action-sheet>
</view>
<view class="border-box">
<view style="font-size: 32rpx;margin-bottom: 5px;"><span style="color: red;">*</span>投诉建议 </view>
<u--textarea
v-model="content"
placeholder="请详细补充您的问题或建议"
:maxlength="300"
height="200"
count
>
<text slot="count" class="word-count">{{ content.length }}/300</text>
</u--textarea>
</view>
<!-- 图片上传 -->
<view class="upload-box">
<view style="font-size: 32rpx;margin-bottom: 5px;">图片(选填) </view>
<u-upload
:fileList="fileList"
@afterRead="afterRead"
@delete="deletePic"
:maxCount="5"
multiple
>
<view class="upload-btn">
<u-icon name="camera" size="44" color="#666666"></u-icon>
<text class="upload-text">添加图片</text>
</view>
</u-upload>
</view>
<!-- 联系方式 -->
<view class="contact-box">
<text class="contact-title">请留下您的联系方式</text>
<u--input
v-model="contactInfo"
placeholder="电话号码/电子邮箱(仅工作人员可见)"
border="bottom" maxlength="11"
></u--input>
</view>
</view>
<!-- 提交按钮 -->
<view class="submit-btn">
<u-button
shape="squrd"
@click="submitFeedback"
style="margin-bottom: 10px;font-size: 28rpx;"
:customStyle="{
width: '100%',
height: '88rpx',
background: '#ff6633',
color: '#ffffff',
border: 'none'
}"
>提交</u-button>
<u-button
shape="squrd"
@click="goHistory"
:customStyle="{
width: '100%',
height: '88rpx',
background: '#fff',
color: '#000',
border: '1px solid #000'
}" style="font-size: 28rpx;"
>历史记录</u-button>
</view>
</view>
</view>
</template>
<script>
import { getAllCanteenStallApi,postCanteenPlaintApi } from "@/api/mine/index.js"
import { pathToBase64, base64ToPath } from 'image-tools';
import { uploadBase64 } from "@/api/upload"
export default {
data() {
return {
fontValue:uni.getStorageSync('fontSize') || 8,
carteenName:"",
showCarteen:false,
actions:[],
canteenId:"",
canteenName:"",
currentTab: 0,
content: '',
fileList: [],
contactInfo: ''
}
},
onLoad() {
this.getAllCanteenStall()
},
methods: {
//
async getAllCanteenStall() {
const res = await getAllCanteenStallApi({})
let arr=[]
if(res.length>0){
res.forEach(item=>{
let obj={
id:item.canteenId,
name:item.canteenName
}
arr.push(obj)
})
}
this.actions = arr
},
carteenSelect(e){
console.log(e)
this.canteenId = e.id
this.canteenName = e.name
},
//
async submitFeedback() {
console.log(this.fileList)
if(this.canteenId==""){
uni.$u.toast('请选择食堂')
return
}
if(this.content==""){
uni.$u.toast('请认真填写建议')
return
}
let arr = []
this.fileList.forEach(item=>{
arr.push(item.url)
})
let param = {
"canteenId": this.canteenId,
"canteenName": this.canteenName,
"complaintPictureList": arr,
"content": this.content,
"mobile": this.contactInfo,
// "starLevel": 6,
"custId": uni.getStorageSync('custId')
}
console.log(param)
const res = await postCanteenPlaintApi(param)
if(res.code==200){
uni.showToast({
title: '提交成功',
icon: 'none'
});
setTimeout(()=>{
uni.navigateBack()
},800)
}
},
//
goHistory(){
uni.navigateTo({
url: `/pages/feedback/history`
})
},
//
async afterRead(event) {
// console.log(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: "上传中",
});
});
console.log(lists)
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url);
console.log(result)
let item = this[`fileList${event.name}`][fileListLen];
this[`fileList${event.name}`].splice(
fileListLen,
1,
Object.assign(item, {
status: "success",
message: "",
url: result.fileNameUrl,
})
);
fileListLen++;
}
},
//
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
this.imgToBase64(url).then(base64 => {
let param = {
"MERCHANT-ID":"378915229716713472",
"uploadKey":'system',
"base64File":base64
}
uploadBase64(param).then(res => {
if(res.code==200){
resolve(res.data)
}
})
})
});
},
imgToBase64(data) {
return new Promise((resolve, reject) => {
pathToBase64(data).then(base64 => {
resolve(base64)
}).catch(error => {
console.error(error)
reject(error)
})
})
},
deletePic(event) {
this.fileList.splice(event.index, 1);
},
}
}
</script>
<style lang="scss" scoped>
/deep/.u-action-sheet__item-wrap {
overflow: auto;
max-height: 50vh;
}
.feedback-page {
height:96vh;
overflow-y: auto;
background-color: #FFF;
.type-section {
background-color: #ffffff;
padding: 30rpx 30rpx 20rpx;
.section-title {
font-size: 28rpx;
color: #333333;
margin-bottom: 20rpx;
font-weight: 550;
display: block;
}
}
.tab-box {
display: flex;
.tab-item {
flex: 1;
text-align: center;
font-size: 28rpx;
color: #666666;
padding: 16rpx 0;
position: relative;
border: 1px solid rgba(15,39,75,0.4);;
margin-right: 20rpx;
border-radius: 2px;
&.active {
color: #333333;
background-color: #fff2ef;
border: 1px solid #FF6816;
}
}
}
.content-box {
margin-top: 20rpx;
padding: 20rpx;
.border-box{
background-color: #ffffff;
padding: 16rpx;
border-radius: 8px;
}
.word-count {
position: absolute;
right: 20rpx;
bottom: 20rpx;
font-size: 24rpx;
color: #999999;
}
}
.upload-box {
margin-top: 30rpx;
.upload-btn {
width: 160rpx;
height: 160rpx;
background-color: #f7f8fa;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border-radius: 8rpx;
.upload-text {
font-size: 24rpx;
color: #666666;
margin-top: 10rpx;
}
}
}
.contact-box {
margin-top: 40rpx;
background-color: #ffffff;
padding: 20rpx 16rpx 16rpx 16rpx;
border-radius: 8px;
.contact-title {
font-size: 28rpx;
color: #333333;
margin-bottom: 20rpx;
}
}
.submit-btn {
padding: 20rpx 30rpx;
margin-top: 20px;
}
}
::v-deep .u-textarea {
padding: 20rpx;
background-color: #f7f8fa;
border-radius: 8rpx;
}
::v-deep .u-input {
&__content {
&__field-wrapper {
&__field {
font-size: 28rpx;
}
}
}
}
::v-deep .u-upload {
&__wrap {
display: flex;
flex-wrap: wrap;
gap: 20rpx;
}
}
.u-textarea {
background-color: #ffffff;
}
.upload-btn {
background-color: #ffffff !important;
border: 1px solid #dadbde;
}
</style>

View File

@ -1,9 +1,7 @@
<template> <template><page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta> <view class="rating-page">
<view class="feedback-page">
<view class="content-box">
<view class="border-box"> <view class="border-box">
<view style="font-size: 32rpx;margin-bottom: 5px;"><span style="color: red;">*</span>食堂 </view> <view style="font-size: 32rpx;margin-bottom: 10px;"><span style="color: red;">*</span>食堂 </view>
<view @click="showCarteen=true" style="width: 100%;height: auto;"> <view @click="showCarteen=true" style="width: 100%;height: auto;">
<view style="border: 1px solid #dadbde;padding: 12rpx;height: 30px;"> <view style="border: 1px solid #dadbde;padding: 12rpx;height: 30px;">
{{canteenName}} {{canteenName}}
@ -17,25 +15,23 @@
@select="carteenSelect" @select="carteenSelect"
></u-action-sheet> ></u-action-sheet>
</view> </view>
<view class="border-box"> <view style="font-size: 32rpx;margin-bottom: 5px;margin-left: 10rpx;"><span style="color: red;">*</span>投诉建议</view>
<view style="font-size: 32rpx;margin-bottom: 5px;"><span style="color: red;">*</span>投诉建议 </view> <!-- 评价输入 -->
<view class="comment-box">
<view>
<u--textarea <u--textarea
v-model="content" v-model="description" maxlength="200"
placeholder="请详细补充您的问题或建议" placeholder="请详细补充您的问题或建议"
:maxlength="300" height="120" style="font-size: 24rpx;background: transparent;"
height="200" ></u--textarea>
count
>
<text slot="count" class="word-count">{{ content.length }}/300</text>
</u--textarea>
</view> </view>
<view style="font-size: 32rpx;margin-bottom: 5px;margin-top: 20rpx;margin-left: 10rpx;">图片(选填) </view>
<!-- 图片上传 --> <!-- 图片上传 -->
<view class="upload-box"> <view class="upload-box">
<view style="font-size: 32rpx;margin-bottom: 5px;">图片(选填) </view> <!-- <view style="font-size: 32rpx;margin-bottom: 5px;">图片(选填) </view> -->
<u-upload <u-upload
:fileList="fileList" :fileList="fileList"
@afterRead="afterRead" @afterRead="afterRead"
@beforeRead="beforeRead"
@delete="deletePic" @delete="deletePic"
:maxCount="5" :maxCount="5"
multiple multiple
@ -46,8 +42,7 @@
</view> </view>
</u-upload> </u-upload>
</view> </view>
</view>
<!-- 联系方式 -->
<view class="contact-box"> <view class="contact-box">
<text class="contact-title">请留下您的联系方式</text> <text class="contact-title">请留下您的联系方式</text>
<u--input <u--input
@ -56,7 +51,7 @@
border="bottom" maxlength="11" border="bottom" maxlength="11"
></u--input> ></u--input>
</view> </view>
</view>
<!-- 提交按钮 --> <!-- 提交按钮 -->
<view class="submit-btn"> <view class="submit-btn">
<u-button <u-button
@ -84,19 +79,17 @@
>历史记录</u-button> >历史记录</u-button>
</view> </view>
</view> </view>
</view>
</template> </template>
<script> <script>
import { getAllCanteenStallApi,postCanteenPlaintApi } from "@/api/mine/index.js" import { getAllCanteenStallApi,postCanteenPlaintApi } from "@/api/mine/index.js"
import { pathToBase64, base64ToPath } from 'image-tools'; import { pathToBase64, base64ToPath } from 'image-tools';
import { uploadBase64 } from "@/api/upload" import { uploadBase64 } from "@/api/upload"
export default { export default {
data() { data() {
return { return {
fontValue:uni.getStorageSync('fontSize') || 8, fontValue:uni.getStorageSync('fontSize') || 8,
tabList: ['优化建议', '功能问题', '其他'],
carteenName:"", carteenName:"",
showCarteen:false, showCarteen:false,
actions:[], actions:[],
@ -110,9 +103,6 @@ export default {
}, },
onLoad() { onLoad() {
this.getAllCanteenStall() this.getAllCanteenStall()
},
onShow() {
}, },
methods: { methods: {
// //
@ -177,19 +167,9 @@ export default {
url: `/pages/feedback/history` url: `/pages/feedback/history`
}) })
}, },
beforeRead(){
uni.setStorageSync('content',this.content)
uni.setStorageSync('canteenId',this.canteenId)
uni.setStorageSync('canteenName',this.canteenName)
uni.setStorageSync('contactInfo',this.contactInfo)
},
// //
async afterRead(event) { async afterRead(event) {
this.content = uni.getStorageSync('content') // console.log(event)
this.canteenId = uni.getStorageSync('canteenId')
this.canteenName = uni.getStorageSync('canteenName')
this.contactInfo = uni.getStorageSync('contactInfo')
console.log(event)
// multiple true , file // multiple true , file
let lists = [].concat(event.file); let lists = [].concat(event.file);
let fileListLen = this[`fileList${event.name}`].length; let fileListLen = this[`fileList${event.name}`].length;
@ -256,86 +236,19 @@ export default {
overflow: auto; overflow: auto;
max-height: 50vh; max-height: 50vh;
} }
.feedback-page { .rating-page {
height:96vh; height: 94vh;
overflow-y: auto; overflow-y: auto;
background-color: #FFF;
.type-section {
background-color: #ffffff; background-color: #ffffff;
padding: 30rpx 30rpx 20rpx; padding: 40rpx;
padding-bottom: 100rpx;
.section-title {
font-size: 28rpx;
color: #333333;
margin-bottom: 20rpx;
font-weight: 550;
display: block;
}
}
.tab-box {
display: flex;
.tab-item {
flex: 1;
text-align: center;
font-size: 28rpx;
color: #666666;
padding: 16rpx 0;
position: relative;
border: 1px solid rgba(15,39,75,0.4);;
margin-right: 20rpx;
border-radius: 2px;
&.active {
color: #333333;
background-color: #fff2ef;
border: 1px solid #FF6816;
}
}
}
.content-box {
margin-top: 20rpx;
padding: 20rpx;
.border-box{ .border-box{
background-color: #ffffff; background-color: #ffffff;
padding: 16rpx; // padding: 16rpx;
border-radius: 8px; border-radius: 8px;
margin-bottom: 20rpx;
} }
.word-count {
position: absolute;
right: 20rpx;
bottom: 20rpx;
font-size: 24rpx;
color: #999999;
}
}
.upload-box {
margin-top: 30rpx;
.upload-btn {
width: 160rpx;
height: 160rpx;
background-color: #f7f8fa;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border-radius: 8rpx;
.upload-text {
font-size: 24rpx;
color: #666666;
margin-top: 10rpx;
}
}
}
.contact-box { .contact-box {
margin-top: 40rpx; margin-top: 40rpx;
background-color: #ffffff; background-color: #ffffff;
@ -348,41 +261,66 @@ export default {
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
} }
.detail-rating {
margin-top: 40rpx;
.rating-item {
display: flex;
align-items: center;
margin-bottom: 30rpx;
.item-label {
width: 200rpx;
font-size: 28rpx;
color: #333333;
}
.hearts-row {
display: flex;
gap: 0rpx;
}
}
}
.comment-box {
margin-top: 20rpx;
height: auto;
background: #fff;
padding-bottom: 10px;
}
.submit-btn { .submit-btn {
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
margin-top: 20px; margin-top: 20px;
} }
} }
.upload-box {
margin-top: 30rpx;
margin-left: 10px;
.upload-btn {
width: 160rpx;
height: 160rpx;
// background-color: #f7f8fa;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border: 1px dashed #000;
border-radius: 8rpx;
.upload-text {
font-size: 24rpx;
color: #666666;
margin-top: 10rpx;
}
}
}
::v-deep .u-textarea { ::v-deep .u-textarea {
padding: 20rpx;
background-color: #f7f8fa; background-color: #f7f8fa;
border-radius: 8rpx; border-radius: 8rpx;
} padding: 20rpx;
::v-deep .u-input {
&__content {
&__field-wrapper {
&__field {
font-size: 28rpx;
}
}
}
}
::v-deep .u-upload {
&__wrap {
display: flex;
flex-wrap: wrap;
gap: 20rpx;
}
}
.u-textarea {
background-color: #ffffff;
}
.upload-btn {
background-color: #ffffff !important;
border: 1px solid #dadbde;
} }
</style> </style>

View File

@ -272,15 +272,16 @@ export default {
}else{ }else{
this.showYJ=false this.showYJ=false
} }
this.$set(this.userInfo,'mobile',decryptWithSM4(this.userInfo.mobile)) uni.setStorageSync('orgFullName',this.userInfo.orgFullName)
this.$set(this.userInfo,'idCard',decryptWithSM4(this.userInfo.idCard)) uni.setStorageSync('openId',this.userInfo.openid)
this.$set(this.userInfo,'email',decryptWithSM4(this.userInfo.email)) uni.setStorageSync('placeId',this.userInfo.placeId)
//sm4 //sm4
// let jsonStr = decryptWithSM4(result.data.data) // let jsonStr = decryptWithSM4(result.data.data)
// this.userInfo = JSON.parse(jsonStr) // this.userInfo = JSON.parse(jsonStr)
// console.log(this.userInfo) // console.log(this.userInfo)
uni.setStorageSync('openId', this.userInfo.openid,{expires:90}) this.$set(this.userInfo,'mobile',decryptWithSM4(this.userInfo.mobile))
uni.setStorageSync('placeId', this.userInfo.placeId,{expires:90}) this.$set(this.userInfo,'idCard',decryptWithSM4(this.userInfo.idCard))
this.$set(this.userInfo,'email',decryptWithSM4(this.userInfo.email))
}) })
}, },
changeSwiper(e) { changeSwiper(e) {

View File

@ -88,7 +88,7 @@ export default {
} }
}, },
onShow() { onShow() {
// uni.reLaunch({ url: '/pages/advanceOrder/index' }) uni.reLaunch({ url: '/pages/feedback/index' })
// setTimeout(()=>{ // setTimeout(()=>{
if(Cookies.get('remember')){ if(Cookies.get('remember')){
this.remember = [Cookies.get('remember')] || []; this.remember = [Cookies.get('remember')] || [];

View File

@ -13,6 +13,7 @@
</view> </view>
<view class="user-detail"> <view class="user-detail">
<text class="username">{{custName}}</text> <text class="username">{{custName}}</text>
<view style="color: #666;font-size: 12px;padding: 4px 10px;">{{orgFullName}}</view>
</view> </view>
<view class="star-icon" @click="goCollectPage"> <view class="star-icon" @click="goCollectPage">
<uni-icons type="star" size="24" color="#ff9900"></uni-icons> <uni-icons type="star" size="24" color="#ff9900"></uni-icons>
@ -92,7 +93,8 @@
data() { data() {
return { return {
fontValue:uni.getStorageSync('fontSize') || 8, fontValue:uni.getStorageSync('fontSize') || 8,
custName: "", orgFullName:uni.getStorageSync('orgFullName') || '',
custName: "zzz",
headPortraitUrl:"", headPortraitUrl:"",
defaultFace: '/static/images/my/face.png', defaultFace: '/static/images/my/face.png',
avatarShow: false, avatarShow: false,

View File

@ -158,15 +158,17 @@
getUserInfo() { getUserInfo() {
getInfoNewAPI({'custId':uni.getStorageSync('custId'),"sourceType":7}).then(res => { getInfoNewAPI({'custId':uni.getStorageSync('custId'),"sourceType":7}).then(res => {
this.userInfo = res.data; this.userInfo = res.data;
this.$set(this.userInfo,'mobile',decryptWithSM4(res.data.mobile))
this.$set(this.userInfo,'idCard',decryptWithSM4(res.data.idCard))
this.$set(this.userInfo,'email',decryptWithSM4(res.data.email))
//sm4
// let jsonStr = decryptWithSM4(res.data.data)
// this.userInfo = JSON.parse(jsonStr)
this.userInfo.sex = this.userInfo.sex-1 this.userInfo.sex = this.userInfo.sex-1
this.userInfo.sexStr = this.columns[0][this.userInfo.sex] this.userInfo.sexStr = this.columns[0][this.userInfo.sex]
console.log('this.userInfo',this.userInfo) console.log('this.userInfo',this.userInfo)
//sm4
// let jsonStr = decryptWithSM4(res.data.data)
// this.userInfo = JSON.parse(jsonStr)
this.$set(this.userInfo,'mobile',decryptWithSM4(res.data.mobile))
this.$set(this.userInfo,'idCard',decryptWithSM4(res.data.idCard))
this.$set(this.userInfo,'email',decryptWithSM4(res.data.email))
}) })
}, },
getUserHeaderImg() { getUserHeaderImg() {

View File

@ -2,7 +2,6 @@
<view class="rating-page"> <view class="rating-page">
<view> <view>
<text style="font-size: 30rpx;font-weight: bold;">{{dishesData.stallName}}</text> <text style="font-size: 30rpx;font-weight: bold;">{{dishesData.stallName}}</text>
</view> </view>
<!-- 评价输入 --> <!-- 评价输入 -->
<view class="comment-box"> <view class="comment-box">