优化会议室预约印章上传逻辑
This commit is contained in:
parent
b2660d85ad
commit
d81d1e316c
@ -55,12 +55,12 @@ export default {
|
|||||||
|
|
||||||
// 2. 验证文件格式
|
// 2. 验证文件格式
|
||||||
const tempFilePath = res.tempFilePaths[0];
|
const tempFilePath = res.tempFilePaths[0];
|
||||||
const isValid = await this.checkPngFormat(tempFilePath);
|
// const isValid = await this.checkPngFormat(tempFilePath);
|
||||||
|
|
||||||
if (!isValid) {
|
// if (!isValid) {
|
||||||
uni.showToast({ title: '请上传PNG格式图片', icon: 'none' });
|
// uni.showToast({ title: '请上传PNG格式图片', icon: 'none' });
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 3. 添加到预览列表
|
// 3. 添加到预览列表
|
||||||
this.fileList = [{
|
this.fileList = [{
|
||||||
@ -106,11 +106,11 @@ export default {
|
|||||||
|
|
||||||
async uploadFile(file) {
|
async uploadFile(file) {
|
||||||
// 上传前再次验证
|
// 上传前再次验证
|
||||||
const isValid = await this.checkPngFormat(file.url);
|
// const isValid = await this.checkPngFormat(file.url);
|
||||||
if (!isValid) {
|
// if (!isValid) {
|
||||||
uni.showToast({ title: '文件格式不符合要求', icon: 'none' });
|
// uni.showToast({ title: '文件格式不符合要求', icon: 'none' });
|
||||||
return Promise.reject('Invalid file format');
|
// return Promise.reject('Invalid file format');
|
||||||
}
|
// }
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await new Promise((resolve, reject) => {
|
const res = await new Promise((resolve, reject) => {
|
||||||
|
|||||||
@ -10,7 +10,9 @@
|
|||||||
<u-button shape="circle" type="primary" @click="reback()" >返回</u-button>
|
<u-button shape="circle" type="primary" @click="reback()" >返回</u-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<u-modal :show="show" title="提示" @confirm="show=false">
|
||||||
|
<view>预约完成,请致电社区,并关注预约记录留意审核状态,谢谢!</view>
|
||||||
|
</u-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -21,6 +23,8 @@
|
|||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
docList:[],
|
docList:[],
|
||||||
|
content:'预约完成,请致电社区,并关注预约记录留意审核状态,谢谢!',
|
||||||
|
show:false,
|
||||||
nameList:{
|
nameList:{
|
||||||
'applyPdf':'申请表申请表申请表申请表申请表申请表申请表申请表申请表申请表',
|
'applyPdf':'申请表申请表申请表申请表申请表申请表申请表申请表申请表申请表',
|
||||||
'covenantPdf':'协议书'
|
'covenantPdf':'协议书'
|
||||||
@ -28,6 +32,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
this.show=true
|
||||||
const obj=JSON.parse(option.files)
|
const obj=JSON.parse(option.files)
|
||||||
this.docList=[
|
this.docList=[
|
||||||
{name:obj.applyPdfName,url:BASE_URL+obj.covenantPdf},
|
{name:obj.applyPdfName,url:BASE_URL+obj.covenantPdf},
|
||||||
|
|||||||
@ -683,10 +683,7 @@
|
|||||||
if (!res || !res.success) {
|
if (!res || !res.success) {
|
||||||
throw new Error('会议室预定失败');
|
throw new Error('会议室预定失败');
|
||||||
}
|
}
|
||||||
uni.showToast({
|
|
||||||
title: '预约完成,请致电社区,并关注预约记录留意审核状态,谢谢!',
|
|
||||||
icon: 'success'
|
|
||||||
});
|
|
||||||
if (res.success == true) {
|
if (res.success == true) {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: `/pages/docList/index?files=${JSON.stringify(res.data)}&&isSelfStudy=${this.isSelfStudy}`
|
url: `/pages/docList/index?files=${JSON.stringify(res.data)}&&isSelfStudy=${this.isSelfStudy}`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user