客户问题修改1
This commit is contained in:
parent
969874408f
commit
0719279d50
|
|
@ -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',//盛旭
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
|
||||||
|
|
@ -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({
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue