测试问题修改

This commit is contained in:
zzyuan 2025-09-03 18:14:08 +08:00
parent 6def532efa
commit d9b828c3a8
7 changed files with 120 additions and 102 deletions

View File

@ -111,8 +111,8 @@
</view>
<view style="width: 80%;height: 100rpx;">
<view style="width: 100%;display: flex;align-items: center;justify-content: space-between;margin-bottom: 20rpx;padding-top: 10rpx;">
<text>{{item.userName}}</text>
<text>{{item.evaluaTime}}</text>
<text>{{item.evaluaNickName}}</text>
<text>{{item.createTime}}</text>
</view>
<view style="display: flex;margin-bottom: 10rpx;">
<u-icon v-for="n in 5" :key="n" :name="n <= item.starLevel ? 'star-fill' : 'star-fill'"

View File

@ -16,8 +16,8 @@
</view>
</view>
</view>
<view class="status-box" :class="{ 'status-open': item.businessState==2 }">
{{ item.businessState==2 ? '营业中' : '休息中' }}
<view class="status-box" :class="{ 'status-open': item.isOpen }">
{{ item.isOpen? '营业中' : '休息中' }}
</view>
</view>
</view>
@ -41,11 +41,7 @@ export default {
merchantList: []
}
},
onLoad() {
// options = JSON.parse(options.params)
// console.log(options)
// this.areaId = options.areaId
// this.canteenId = options.canteenId
onLoad() {
this.getAdvanceOrderStallList()
},
methods: {
@ -68,25 +64,28 @@ export default {
// applyDate: '2025-04-18'
// "applyDate":"2024-11-11"
}
const res = await getAdvanceOrderStallApi()
// this.total = res.total;
// if(this.pageNum==1){
// this.merchantList = res.rows
// }else{
// this.merchantList.push(...res.rows)
// }
// console.log('?? ~ getList ~ res:', res)
this.merchantList = res.rows[0].stallList;
this.canteenId = res.rows[0].canteenId
this.canteenName = res.rows[0].canteenName
// this.updateMerchantStatus()
const res = await getAdvanceOrderStallApi()
console.log('?? ~ getList ~ res:', res)
res.rows.forEach(item=>{
if(item.businessState==2){//
item.stallList.forEach(sub=>{
sub.canteenId = item.canteenId
sub.canteenName = item.canteenName
this.merchantList.push(sub)
})
}
})
// this.merchantList = res.rows[0].stallList;
this.updateMerchantStatus()
} catch (error) {
console.log(error)
}
},
updateMerchantStatus() {
this.merchantList.forEach(merchant => {
merchant.isOpen = this.checkIfOpen(merchant.startBusinessTime,merchant.endBusinessTime);
merchant.isOpen = this.checkIfOpen(merchant.startBusinessTime,merchant.endBusinessTime)&&merchant.businessState==2;
console.log(merchant.isOpen)
});
},
checkIfOpen(start,end) {
@ -103,20 +102,28 @@ export default {
return currentTime >= startTime && currentTime <= endTime;
},
//
goToMenu(item) {
if(item.recipeId){
item.canteenId = this.canteenId
item.canteenName = this.canteenName
uni.navigateTo({
url: `/pages/advanceOrder/index?params=${JSON.stringify(item)}`
})
if(item.isOpen){
if(item.recipeId){
uni.navigateTo({
url: `/pages/advanceOrder/index?params=${JSON.stringify(item)}`
})
}else{
uni.showToast({
title: '未配置菜谱',
icon: 'none'
})
}
}else{
uni.showToast({
title: '未配置菜谱',
title: '档口休息中!',
icon: 'none'
})
}
}
},

View File

@ -110,7 +110,8 @@ export default {
currentTab: 0,
content: '',
fileList: [],
contactInfo: ''
contactInfo: '',
isSubmit:false
}
},
onLoad() {
@ -140,41 +141,45 @@ export default {
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=>{
let obj = {
imgUrl:item.url
async submitFeedback() {
if(!this.isSubmit){
this.isSubmit=true
if(this.canteenId==""){
uni.$u.toast('请选择食堂')
return
}
if(this.content==""){
uni.$u.toast('请认真填写建议')
return
}
let arr = []
this.fileList.forEach(item=>{
let obj = {
imgUrl:item.url
}
arr.push(obj)
})
let param = {
"canteenId": this.canteenId,
"canteenName": this.canteenName,
"suggestionPictures": arr,
"content": this.content,
"contactTel": encryptWithSM4(this.contactInfo),
"userId": uni.getStorageSync('userId')
}
console.log(param)
const res = await postCanteenPlaintApi(param)
if(res.code==200){
uni.showToast({
title: '提交成功',
icon: 'none'
});
setTimeout(()=>{
uni.navigateBack()
},800)
}else{
this.isSubmit=false
}
arr.push(obj)
})
let param = {
"canteenId": this.canteenId,
"canteenName": this.canteenName,
"suggestionPictures": arr,
"content": this.content,
"contactTel": encryptWithSM4(this.contactInfo),
"userId": uni.getStorageSync('userId')
}
console.log(param)
const res = await postCanteenPlaintApi(param)
if(res.code==200){
uni.showToast({
title: '提交成功',
icon: 'none'
});
setTimeout(()=>{
uni.navigateBack()
},800)
}
},
//

View File

@ -236,7 +236,7 @@ export default {
//
async getCarouselImageList() {
let param = {
"isEnabled":'0',
"ifEnabled":'1',
"usageType":'2',
"pageNum": 1,
"pageSize": 100,

View File

@ -109,7 +109,8 @@ export default {
{ label: '环境', value: 0 },
{ label: '服务', value: 0 }
],
comment: ''
comment: '',
isSubmit:false
}
},
onLoad() {
@ -122,38 +123,43 @@ export default {
},
//
async sumbitCartennnEvaluate(){
if(this.canteenId==""){
uni.$u.toast('请选择食堂')
return
}
if(this.stallId==""){
uni.$u.toast('请选择档口')
return
}
if(this.comment==""){
uni.$u.toast('请认真填写建议')
return
}
let param = {
"userId": uni.getStorageSync('userId'),
"areaId": this.areaId,
"canteenId": this.canteenId,
"stallId": this.stallId,
"proposal": this.comment
}
this.decorationList.forEach(item=>{
param[item.name]=item.value
})
console.log(param)
const res = await addCartennnEvaluateApi(param)
if(res.code==200){
uni.showToast({
title: '提交成功',
icon: 'none'
});
setTimeout(()=>{
uni.navigateBack()
},800)
if(!this.isSubmit){
this.isSubmit=true
if(this.canteenId==""){
uni.$u.toast('请选择食堂')
return
}
if(this.stallId==""){
uni.$u.toast('请选择档口')
return
}
if(this.comment==""){
uni.$u.toast('请认真填写建议')
return
}
let param = {
"userId": uni.getStorageSync('userId'),
"areaId": this.areaId,
"canteenId": this.canteenId,
"stallId": this.stallId,
"proposal": this.comment
}
this.decorationList.forEach(item=>{
param[item.name]=item.value
})
console.log(param)
const res = await addCartennnEvaluateApi(param)
if(res.code==200){
uni.showToast({
title: '提交成功',
icon: 'none'
});
setTimeout(()=>{
uni.navigateBack()
},800)
}else{
this.isSubmit=false
}
}
},
//

View File

@ -15,8 +15,8 @@
</view>
<view style="width: 80%;height: 100rpx;">
<view style="width: 100%;display: flex;align-items: center;justify-content: space-between;margin-bottom: 20rpx;padding-top: 10rpx;">
<text>{{item.userName}}</text>
<text>{{item.evaluaTime}}</text>
<text>{{item.evaluaNickName}}</text>
<text>{{item.createTime}}</text>
</view>
<view style="display: flex;margin-bottom: 10rpx;">
<u-icon v-for="n in 5" :key="n" :name="n <= item.starLevel ? 'star-fill' : 'star-fill'"

View File

@ -95,8 +95,8 @@
</view>
<view style="width: 80%;height: 100rpx;">
<view style="width: 100%;display: flex;align-items: center;justify-content: space-between;margin-bottom: 20rpx;padding-top: 10rpx;">
<text>{{item.userName}}</text>
<text>{{item.evaluaTime}}</text>
<text>{{item.evaluaNickName}}</text>
<text>{{item.createTime}}</text>
</view>
<view style="display: flex;margin-bottom: 10rpx;">
<u-icon v-for="n in 5" :key="n" :name="n <= item.starLevel ? 'star-fill' : 'star-fill'"