|
@ -22,6 +22,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
</a-card> |
|
|
</a-card> |
|
|
<div class="btns" v-if="!outside"> |
|
|
<div class="btns" v-if="!outside"> |
|
|
|
|
|
<input type="file" ref="fileInput" @change="onFileChange" accept="image/*" style="display: none;" /> |
|
|
<a-button :disabled="writeAble" class="common-button" block size="large" v-if="fileList.length < 5" |
|
|
<a-button :disabled="writeAble" class="common-button" block size="large" v-if="fileList.length < 5" |
|
|
@click="openCamera">上传院前CT图片</a-button> |
|
|
@click="openCamera">上传院前CT图片</a-button> |
|
|
<a-button :disabled="writeAble" class="common-button" block type="primary" size="large" |
|
|
<a-button :disabled="writeAble" class="common-button" block type="primary" size="large" |
|
@ -139,19 +140,19 @@ |
|
|
this.$message.success('患者已审核,内容不可更改') |
|
|
this.$message.success('患者已审核,内容不可更改') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if (!window.plus) { |
|
|
// if (!window.plus) { |
|
|
// H5 环境中不使用 `plus` API |
|
|
// // H5 环境中不使用 `plus` API |
|
|
this.$message.success('当前环境不支持 plus API') |
|
|
// this.$message.success('当前环境不支持 plus API') |
|
|
return |
|
|
// return |
|
|
// console.log('当前环境不支持 plus API'); |
|
|
// // console.log('当前环境不支持 plus API'); |
|
|
} |
|
|
// } |
|
|
const cmr = plus.camera.getCamera(); |
|
|
const cmr = plus.camera.getCamera(); |
|
|
if (!cmr) { |
|
|
if (!cmr) { |
|
|
this.$message.success('没有可用的摄像头'); |
|
|
this.$message.success('没有可用的摄像头'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
const res = cmr.supportedImageResolutions.length > 0 ? cmr.supportedImageResolutions[0] : null; |
|
|
const res = cmr.supportedImageResolutions.length > 0 ? cmr.supportedImageResolutions[0] : { width: 640, height: 480 }; // 默认分辨率; |
|
|
const fmt = cmr.supportedImageFormats.length > 0 ? cmr.supportedImageFormats[0] : null; |
|
|
const fmt = cmr.supportedImageFormats.length > 0 ? cmr.supportedImageFormats[0] : 'jpeg'; |
|
|
if (!res || !fmt) { |
|
|
if (!res || !fmt) { |
|
|
plus.nativeUI.toast('摄像头不支持该格式或分辨率'); |
|
|
plus.nativeUI.toast('摄像头不支持该格式或分辨率'); |
|
|
return; |
|
|
return; |
|
@ -202,6 +203,13 @@ |
|
|
} |
|
|
} |
|
|
); |
|
|
); |
|
|
}, |
|
|
}, |
|
|
|
|
|
onFileChange(event) { |
|
|
|
|
|
const file = event.target.files[0]; |
|
|
|
|
|
if (file) { |
|
|
|
|
|
// 处理图片文件 |
|
|
|
|
|
this.compressImage(file); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
//显示图片 |
|
|
//显示图片 |
|
|
showPics(url, name) { |
|
|
showPics(url, name) { |
|
|
let _this = this; |
|
|
let _this = this; |
|
|