Compare commits

...

2 Commits

Author SHA1 Message Date
zzyuan c75a5314f9 客户问题修改2 2025-08-13 15:49:46 +08:00
zzyuan 0719279d50 客户问题修改1 2025-08-13 15:49:15 +08:00
8 changed files with 153 additions and 89 deletions

View File

@ -9,7 +9,7 @@ module.exports = {
// baseUrl: 'http://192.168.0.244:38380',//测试
// baseUrl: 'http://sgwpdm.ah.sgcc.com.cn/canteen/dev-api',//测试d
// baseUrl: 'http://192.168.0.176:58080',//测试
// baseUrl: 'http://192.168.2.82:58080',//张天强
// baseUrl: 'http://192.168.2.56:58080',//张天强
// baseUrl: 'http://192.168.2.69:58080',//董高文
// baseUrl: 'http://192.168.0.44:58080',//董高文
// baseUrl: 'http://192.168.2.72:58080',//盛旭

View File

@ -10,7 +10,9 @@
"license": "ISC",
"dependencies": {
"base-64": "^1.0.0",
"compressorjs": "^1.2.1",
"crypto-js": "^4.2.0",
"image-compressor.js": "^1.1.4",
"image-tools": "^1.4.0",
"js-cookie": "^3.0.5",
"sm-crypto": "^0.3.13"

View File

@ -11,7 +11,7 @@
{{(menuData.dishesDetailList[0].prefPrice/100).toFixed(2)}}
</view>
<view style="display: flex;align-items: center;" v-if="dashesData.surplusNum>0">
<view style="display: flex;align-items: center;" v-if="dashesData.surplusNum>0&&dashesData.ifReserve">
<u-icon
v-if="dashesData.quantity>0"
name="../../static/images/delete.png"
@ -143,7 +143,7 @@
</span>
</view>
<view>
<view v-if="dashesData.ifReserve">
<u-button shape="circle" color="#FF6816" style="width: 79px; height: 28px" @click="handleOrder">结算</u-button>
</view>
</view>
@ -193,7 +193,7 @@
{{ (food.prefPrice/100).toFixed(2) }}
</view>
</view>
<view class="right-cont">
<view class="right-cont" v-if="dashesData.ifReserve">
<view class="num-wrap" v-if="food.isDfficacy==1">
<view style="width: 40rpx;" @click="handleFoodNum(1, food)">
<u-icon
@ -261,7 +261,7 @@ export default {
}
}],
canteenType: '自取',
isHandle:false
isHandle:false,
}
},
onLoad(options) {
@ -269,10 +269,11 @@ export default {
console.log(options)
this.menuData = options
this.newDate2 = this.menuData.orderDate
this.getMenuListData()
this.getMenudishesDetail()
this.getMenuEvaluaorderList()
this.getMenuEvaluaCount()
this.getMenuListData()
},
methods: {
//
@ -307,6 +308,7 @@ export default {
this.$set(this.dashesData, 'dishesPrice', this.dashesData.dishesDetailList[0].dishesPrice)
this.$set(this.dashesData, 'prefPrice', this.dashesData.dishesDetailList[0].prefPrice)
this.$set(this.dashesData, 'dishesId', this.dashesData.dishesDetailList[0].dishesId)
this.$set(this.dashesData, 'ifReserve', true)
this.$forceUpdate()
}
console.log(res,'获取菜品详情')
@ -366,6 +368,20 @@ export default {
this.$set(food, 'dishesPrice', food.dishesDetailList[0].dishesPrice)
this.$set(food, 'prefPrice', food.dishesDetailList[0].prefPrice)
this.$set(food, 'dishesId', food.dishesDetailList[0].dishesId)
let currentDate = this.formatDate(new Date()); //
if(currentDate!=this.newDate2){
let str = this.formatDate(new Date())+" "+food.reserveEndTime;
// let str = this.formatDate(new Date())+" 14:00:00";
console.log(str)
let currentTime = new Date().getTime();
let inputTime = new Date(str).getTime();
if (currentTime < inputTime) {
console.log("可以预定");
} else {
console.log("不可预定");
this.$set(this.dashesData, 'ifReserve', false)
}
}
})
})
})
@ -446,6 +462,7 @@ export default {
this.$set(cartItem, 'restrictNum', food.dishesDetailList[0].restrictNum)
this.$set(cartItem, 'prefPrice', food.dishesDetailList[0].prefPrice)
if(cartItem.orderDate == this.newDate2){//
// this.$set(food, 'quantity', cartItem.quantity)
this.$set(cartItem,'isDfficacy', 1) //
@ -626,7 +643,15 @@ export default {
url: `/pages/advanceOrder/orderDetails?carList=${JSON.stringify(arr)}&canteenId=${this.menuData.canteenId}&stallId=${this.menuData.stallId}&canteenName=${this.menuData.canteenName}&stallName=${this.menuData.stallName}&totalPrice=${this.totalPrice}&orderDate=${this.newDate2}`
})
},
//
formatDate(date) {
// YYYY-MM-DD
date = new Date(date)
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
}
}
</script>

View File

@ -51,7 +51,7 @@
<span style="font-size: 20rpx;color: #666;font-weight: 400;text-decoration: line-through;margin-left: 10rpx;">{{ (item.dishesDetailList[0].dishesPrice/100).toFixed(2) }}</span>
</view>
</view>
<view class="right-cont" v-if="item.surplusNum!=0">
<view class="right-cont" v-if="item.surplusNum!=0&&item.ifReserve">
<u-icon v-if="item.quantity > 0"
name="../../static/images/delete.png"
size="18"
@ -87,7 +87,7 @@
</span>
</view>
<view>
<view v-if="ifReserve">
<u-button shape="circle" color="#FF6816" style="width: 79px; height: 28px" @click="handleOrder">结算</u-button>
</view>
</view>
@ -136,7 +136,7 @@
{{ (food.prefPrice/100).toFixed(2) }}
</view>
</view>
<view class="right-cont">
<view class="right-cont" v-if="food.ifReserve">
<view class="num-wrap" v-if="food.isDfficacy==1">
<view style="width: 40rpx;" @click="handleFoodNum(1, food)">
<u-icon
@ -217,7 +217,8 @@ export default {
active: 1, // 1 2
// canteenName: '/',
canteenType: '自取', // 1 2
isHandle:false
isHandle:false,//
ifReserve:true//
}
},
onLoad(options) {
@ -262,7 +263,6 @@ export default {
this.newDate2 = this.daysList[index].paramDate
this.getMenuListData()
},
//
getNowFormatDate(data) {
let date = new Date(data)
let year = date.getFullYear()
@ -303,6 +303,22 @@ export default {
this.$set(food, 'monthlySales', food.dishesDetailList[0].monthlySales)
this.$set(food, 'goodProbability', food.dishesDetailList[0].goodProbability)
this.$set(food, 'surplusNum', food.dishesDetailList[0].surplusNum)
this.$set(food, 'ifReserve', true)
let currentDate = this.formatDate(new Date()); //
if(currentDate!=this.newDate2){
let str = this.formatDate(new Date())+" "+food.reserveEndTime;
// let str = this.formatDate(new Date())+" 14:00:00";
console.log(str)
let currentTime = new Date().getTime();
let inputTime = new Date(str).getTime();
if (currentTime < inputTime) {
console.log("可以预定");
} else {
console.log("不可预定");
this.$set(food, 'ifReserve', false)
this.$set(this, 'ifReserve', false)
}
}
this.$set(food, 'restrictNum', food.dishesDetailList[0].restrictNum)
this.$set(food, 'dishesPrice', food.dishesDetailList[0].dishesPrice)
this.$set(food, 'prefPrice', food.dishesDetailList[0].prefPrice)
@ -456,6 +472,17 @@ export default {
this.$set(cartItem, 'surplusNum', food.dishesDetailList[0].surplusNum)
this.$set(cartItem, 'restrictNum', food.dishesDetailList[0].restrictNum)
this.$set(cartItem, 'prefPrice', food.dishesDetailList[0].prefPrice)
this.$set(cartItem, 'ifReserve', true)
let currentDate = this.formatDate(new Date()); //
if(currentDate!=this.newDate2){
let str = this.formatDate(new Date())+" "+food.reserveEndTime;
// let str = this.formatDate(new Date())+" 14:00:00";
let currentTime = new Date().getTime();
let inputTime = new Date(str).getTime();
if (currentTime < inputTime) {} else {
this.$set(cartItem, 'ifReserve', false)
}
}
if(cartItem.orderDate == this.newDate2){//
this.$set(food, 'quantity', cartItem.quantity)
@ -630,7 +657,15 @@ export default {
url: `/pages/advanceOrder/orderDetails?carList=${JSON.stringify(arr)}&canteenId=${this.canteenId}&stallId=${this.stallId}&canteenName=${this.canteenName}&stallName=${this.stallName}&totalPrice=${this.totalPrice}&orderDate=${this.newDate2}`
})
},
//
formatDate(date) {
// YYYY-MM-DD
date = new Date(date)
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 0
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
//
scrollToDetail(index) {
console.log('?? ~ scrollToDetail ~ index', index)

View File

@ -25,7 +25,7 @@
<!-- 提示信息 -->
<view class="tips">
<text class="tip-item">·五官端正面部无遮挡请使用人脸照片</text>
<text class="tip-item">·不要带视频如墨镜等</text>
<text class="tip-item">·不要带饰品如墨镜等</text>
<text class="tip-item">·请在光线明亮的纯色背景下拍照建议背景颜色为白色</text>
<text class="tip-item">·上传照片后需保存保存失败照片将被清除</text>
</view>
@ -55,6 +55,8 @@
import { queryFacePhotoApi,uploadPhotoGenCodeForAppApi } from '@/api/mine/index'
import { uploadBase64 } from "@/api/upload"
import { pathToBase64, base64ToPath } from 'image-tools';
import Compressor from 'compressorjs';
import ImageCompressor from 'image-compressor.js';
import config from '@/config'
import { showConfirm } from '@/utils/common'
export default {
@ -110,20 +112,27 @@
},
handleChooseImage() {
uni.chooseImage({
count: 1,
count: 1,
sizeType:["compressed"],
success: resImage => {
console.log(resImage)
this.facePhotoUrl = resImage.tempFilePaths[0]
this.imageUrl = resImage.tempFilePaths[0]
this.imgToBase64(resImage.tempFilePaths[0]).then(base64 => {
console.log(base64)
this.base64=base64;
this.uploadFaceImg()
const tempFile = resImage.tempFiles[0];
console.log(tempFile)
this.compressFile(tempFile).then(res => {
console.log(res)
const url = URL.createObjectURL(res)
this.imgToBase64(url).then(base64 => {
console.log(base64)
this.base64=base64;
this.uploadFaceImg()
})
})
}
});
},
handleUpload() {
console.log(this.imageUrl)
if (!this.agreed || !this.imageUrl) return
@ -150,72 +159,56 @@
});
}
// if(res)
})
// uni.showToast({
// title: '',
// icon: 'success',
// duration: 2000,
// success: () => {
// setTimeout(() => {
// this.goBack()
// }, 2000)
// }
// })
// uni.uploadFile({
// url: config.baseUrl + '/system/user/profile/avatar',
// filePath: this.imageUrl,
// name: 'avatarfile',
// header: {
// 'Authorization': 'Bearer ' + getToken()
// },
// success: (uploadFileRes) => {
// console.log(uploadFileRes);
// if(uploadFileRes.statusCode == 200) {
// let reslut = JSON.parse(uploadFileRes.data)
// console.log('reslut',reslut)
// if(reslut.code == 200) {
// uni.showToast({
// title: '',
// icon: 'success',
// duration: 2000,
// success: () => {
// setTimeout(() => {
// this.goBack()
// }, 2000)
// }
// })
// }else{
// uni.showToast({ title: reslut.msg,icon: 'none' });
// }
// }else if(uploadFileRes.statusCode == 401) {
// showConfirm("?").then(res => {
// if (res.confirm) {
// uni.reLaunch({ url: '/pages/login/login' })
// }
// })
// }else{
// uni.showToast({ title: uploadFileRes.errMsg,icon: 'none' });
// }
// uni.hideLoading()
// },
// fail: (uploadFileErr) => {
// let { message } = uploadFileErr
// if (message == 'Network Error') {
// message = ''
// } else if (message.includes('timeout')) {
// message = ''
// } else if (message.includes('Request failed with status code')) {
// message = '' + message.substr(message.length - 3) + ''
// }
// uni.showToast({ title: message,icon: 'none' });
// uni.hideLoading()
// }
// });
})
},
compressFile(file) {
return new Promise((resolve, reject) => {
const options = {
success(result) {
// Blob File Blob
const compressedFile = new File([result], file.name, {
type: file.type,
lastModified: Date.now(),
});
return resolve(compressedFile);
},
error(e) {
return reject(e);
},
};
// 1-3MB
if (file.size > 0.5 * 1024 * 1024 && file.size <= 3 * 1024 * 1024) {
options.quality = 0.3; //
options.convertSize = false;//
options.checkOrientation = false; // false
}
// 3-4MB
if (file.size > 3 * 1024 * 1024 && file.size <= 4 * 1024 * 1024) {
options.quality = 0.25; //
options.convertSize = false;//
options.checkOrientation = false; // false
}
// 5-6MB
if (file.size > 5 * 1024 * 1024 && file.size <= 6 * 1024 * 1024) {
options.quality = 0.2; //
options.convertSize = false;//
options.checkOrientation = false; // false
}
// 6-7MB
if (file.size > 6 * 1024 * 1024 && file.size <= 7 * 1024 * 1024) {
options.quality = 0.15; //
options.convertSize = false;//
options.checkOrientation = false; // false
}
// 7-9MB
if (file.size > 7 * 1024 * 1024 && file.size <= 9 * 1024 * 1024) {
options.quality = 0.1; //
options.convertSize = false;//
options.checkOrientation = false; // false
}
new ImageCompressor(file, options);
});
},
showAgreement() {
uni.navigateTo({
url: '/pages/privacy-agreement/index'

View File

@ -277,7 +277,15 @@ export default {
//
onRechargeNow() {
console.log(this.rechargeAmount)
this.chosenShow = true
if(this.balanceInfo.accAllBal>300000){
uni.showToast({
title: "总余额大于3000元无法继续充值",
icon: 'none'
})
}else{
this.chosenShow = true
}
},
goSubPage(){
uni.navigateTo({

View File

@ -3,7 +3,7 @@
<view class="work-container">
<!-- 第一个条目 -->
<view class="item" v-for="item in weekCookList" :key="item.recipeId" @click="goMenuList(item)">
<image class="image" :src="item.canteenImgUrl"></image>
<image class="image" :src="item.stallImgUrl"></image>
<view class="content">
<text class="title">本周菜谱</text>
<text class="sub-title">食堂{{ item.canteenName }}</text>

View File

@ -223,8 +223,9 @@ export default {
//退
refundOrder() {
if(this.detailData.payState==3||this.detailData.payState==6){
let hours = new Date().getHours();//
if(Number(hours)>13){
let orderTime = this.detailData.orderDate+" 14:00:00" //
let nowTime = new Date().getTime();//
if(nowTime>orderTime){
uni.showToast({
title: "14点以后无法退单",
icon: 'none'