客户问题修改1

This commit is contained in:
zzyuan 2025-08-13 15:49:15 +08:00
parent 969874408f
commit 0719279d50
6 changed files with 81 additions and 77 deletions

View File

@ -9,7 +9,7 @@ module.exports = {
// baseUrl: 'http://192.168.0.244:38380',//测试 // baseUrl: 'http://192.168.0.244:38380',//测试
// baseUrl: 'http://sgwpdm.ah.sgcc.com.cn/canteen/dev-api',//测试d // baseUrl: 'http://sgwpdm.ah.sgcc.com.cn/canteen/dev-api',//测试d
// baseUrl: 'http://192.168.0.176:58080',//测试 // 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.2.69:58080',//董高文
// baseUrl: 'http://192.168.0.44:58080',//董高文 // baseUrl: 'http://192.168.0.44:58080',//董高文
// baseUrl: 'http://192.168.2.72:58080',//盛旭 // baseUrl: 'http://192.168.2.72:58080',//盛旭

View File

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

View File

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

View File

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

View File

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

View File

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