c5_labsci/fapp/ciyon_ap/pages/pub/camera.vue
2026-01-27 00:52:00 +08:00

59 lines
1.3 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<ciy-header title="PC端快捷拍照" ref="header"></ciy-header>
<view class="ciy-card">
<ciy-aicameraocr @change="addnew" ref="cameraocr" :height="camheight"></ciy-aicameraocr>
</view>
</template>
<style>
</style>
<script>
/*
PC端生成唯一ID显示二维码
打开SSE或HTTP轮询请求发现新图片传回后立即标记已用。
可设置无回传3分钟后二维码失效停止轮询。
*/
export default {
data() {
return {
init: {},
camheight: '56',
}
},
onLoad() {
var app = getApp();
setTimeout(() => {
this.getrefsSync('cameraocr').Step(1);
}, 1000);
},
onUnload() {
var postparam = {};
postparam.id = this.opn.id;
var retjson = this.callfunc({
func: 'pub.imgend',
data: postparam
});
},
watch: {},
computed: {},
methods: {
async addnew(e) {
var opn = {};
opn.basepath = this.opn.basepath;
opn.stor = this.opn.stor;
opn.action = this.opn.action;
var postparam = {};
postparam.id = this.opn.id;
postparam.txts = e.txts.join('\n');
postparam.img = await this.file_upload1(e.tempimg, opn);
var retjson = await this.callfunc({
func: 'pub.imgadd',
data: postparam
});
if (retjson.code != 1)
return this.alert(retjson.errmsg);
}
}
}
</script>