@ -0,0 +1,16 @@ |
|||||||
|
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ |
||||||
|
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 |
||||||
|
"version": "0.0", |
||||||
|
"configurations": [{ |
||||||
|
"app-plus" : |
||||||
|
{ |
||||||
|
"launchtype" : "local" |
||||||
|
}, |
||||||
|
"default" : |
||||||
|
{ |
||||||
|
"launchtype" : "local" |
||||||
|
}, |
||||||
|
"type" : "uniCloud" |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
@ -0,0 +1,53 @@ |
|||||||
|
<script> |
||||||
|
export default { |
||||||
|
onLaunch: function() { |
||||||
|
console.log('App Launch') |
||||||
|
this.qxcz() |
||||||
|
}, |
||||||
|
onShow: function() { |
||||||
|
console.log('App Show') |
||||||
|
|
||||||
|
}, |
||||||
|
onHide: function() { |
||||||
|
console.log('App Hide') |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
// 判断有没有存储权限 |
||||||
|
qxcz() { |
||||||
|
var _this = this |
||||||
|
plus.android.requestPermissions(['android.permission.WRITE_EXTERNAL_STORAGE'], function(e) { |
||||||
|
if (e.deniedAlways.length > 0) { //权限被永久拒绝 |
||||||
|
// 弹出提示框解释为何需要读写手机储存权限,引导用户打开设置页面开启 |
||||||
|
uni.showModal({ |
||||||
|
title: '存储权限', |
||||||
|
content: '您拒绝了存储权限,请去设置-应用开启存储权限。', |
||||||
|
success: function(res) { |
||||||
|
if (res.confirm) { |
||||||
|
// console.log('用户点击确定'); |
||||||
|
} else if (res.cancel) { |
||||||
|
// console.log('用户点击取消'); |
||||||
|
} |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
if (e.deniedPresent.length > 0) { //权限被临时拒绝 |
||||||
|
// 弹出提示框解释为何需要读写手机储存权限,可再次调用plus.android.requestPermissions申请权限 |
||||||
|
plus.android.requestPermissions(['android.permission.WRITE_EXTERNAL_STORAGE']) |
||||||
|
// console.log('666666666 ' + e.deniedPresent.toString()); |
||||||
|
} |
||||||
|
if (e.granted.length > 0) { //权限被允许 |
||||||
|
//调用依赖获取读写手机储存权限的代码 |
||||||
|
// _this.upload() // 获取权限成功之后调用的函数 |
||||||
|
// console.log('2222222222 ' + e.granted.toString()); |
||||||
|
} |
||||||
|
}, function(e) { |
||||||
|
// console.log('R12133313221' + JSON.stringify(e)); |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style> |
||||||
|
/*每个页面公共css */ |
||||||
|
</style> |
||||||
@ -0,0 +1,24 @@ |
|||||||
|
import { httpRequest } from '@/request/index.js' |
||||||
|
let url = { |
||||||
|
// 获取token
|
||||||
|
getToken:'oauth/2.0/token', |
||||||
|
idCard:'rest/2.0/ocr/v1/accurate_basic', |
||||||
|
// idCard:'rest/2.0/ocr/v1/general_basic',
|
||||||
|
} |
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
getTokenR(params){ |
||||||
|
return httpRequest({ |
||||||
|
url:`${url.getToken}?grant_type=client_credentials&client_id=W4jgXICF2kyaivdsYzKoDOxD&client_secret=h6uwa0q0hkjn4im4Vb9QXaC7xrBbvw6B` |
||||||
|
}) |
||||||
|
}, |
||||||
|
getMessage(params){ |
||||||
|
return httpRequest({ |
||||||
|
url:`${url.idCard}?access_token=${params.access_token}`, |
||||||
|
data:params.data, |
||||||
|
header:{ |
||||||
|
"Content-Type":"application/x-www-form-urlencoded" |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,91 @@ |
|||||||
|
function getLocalFilePath(path) { |
||||||
|
if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path.indexOf('_downloads') === 0) { |
||||||
|
return path |
||||||
|
} |
||||||
|
if (path.indexOf('file://') === 0) { |
||||||
|
return path |
||||||
|
} |
||||||
|
if (path.indexOf('/storage/emulated/0/') === 0) { |
||||||
|
return path |
||||||
|
} |
||||||
|
if (path.indexOf('/') === 0) { |
||||||
|
var localFilePath = plus.io.convertAbsoluteFileSystem(path) |
||||||
|
if (localFilePath !== path) { |
||||||
|
return localFilePath |
||||||
|
} else { |
||||||
|
path = path.substr(1) |
||||||
|
} |
||||||
|
} |
||||||
|
return '_www/' + path |
||||||
|
} |
||||||
|
|
||||||
|
export function pathToBase64(path) { |
||||||
|
return new Promise(function(resolve, reject) { |
||||||
|
if (typeof window === 'object' && 'document' in window) { |
||||||
|
if (typeof FileReader === 'function') { |
||||||
|
var xhr = new XMLHttpRequest() |
||||||
|
xhr.open('GET', path, true) |
||||||
|
xhr.responseType = 'blob' |
||||||
|
xhr.onload = function() { |
||||||
|
if (this.status === 200) { |
||||||
|
let fileReader = new FileReader() |
||||||
|
fileReader.onload = function(e) { |
||||||
|
resolve(e.target.result) |
||||||
|
} |
||||||
|
fileReader.onerror = reject |
||||||
|
fileReader.readAsDataURL(this.response) |
||||||
|
} |
||||||
|
} |
||||||
|
xhr.onerror = reject |
||||||
|
xhr.send() |
||||||
|
return |
||||||
|
} |
||||||
|
var canvas = document.createElement('canvas') |
||||||
|
var c2x = canvas.getContext('2d') |
||||||
|
var img = new Image |
||||||
|
img.onload = function() { |
||||||
|
canvas.width = img.width |
||||||
|
canvas.height = img.height |
||||||
|
c2x.drawImage(img, 0, 0) |
||||||
|
resolve(canvas.toDataURL()) |
||||||
|
canvas.height = canvas.width = 0 |
||||||
|
} |
||||||
|
img.onerror = reject |
||||||
|
img.src = path |
||||||
|
return |
||||||
|
} |
||||||
|
if (typeof plus === 'object') { |
||||||
|
plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), function(entry) { |
||||||
|
entry.file(function(file) { |
||||||
|
var fileReader = new plus.io.FileReader() |
||||||
|
fileReader.onload = function(data) { |
||||||
|
resolve(data.target.result) |
||||||
|
} |
||||||
|
fileReader.onerror = function(error) { |
||||||
|
reject(error) |
||||||
|
} |
||||||
|
fileReader.readAsDataURL(file) |
||||||
|
}, function(error) { |
||||||
|
reject(error) |
||||||
|
}) |
||||||
|
}, function(error) { |
||||||
|
reject(error) |
||||||
|
}) |
||||||
|
return |
||||||
|
} |
||||||
|
if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) { |
||||||
|
wx.getFileSystemManager().readFile({ |
||||||
|
filePath: path, |
||||||
|
encoding: 'base64', |
||||||
|
success: function(res) { |
||||||
|
resolve('data:image/png;base64,' + res.data) |
||||||
|
}, |
||||||
|
fail: function(error) { |
||||||
|
reject(error) |
||||||
|
} |
||||||
|
}) |
||||||
|
return |
||||||
|
} |
||||||
|
reject(new Error('not support')) |
||||||
|
}) |
||||||
|
} |
||||||
@ -0,0 +1,20 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="UTF-8" /> |
||||||
|
<script> |
||||||
|
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || |
||||||
|
CSS.supports('top: constant(a)')) |
||||||
|
document.write( |
||||||
|
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + |
||||||
|
(coverSupport ? ', viewport-fit=cover' : '') + '" />') |
||||||
|
</script> |
||||||
|
<title></title> |
||||||
|
<!--preload-links--> |
||||||
|
<!--app-context--> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<div id="app"><!--app-html--></div> |
||||||
|
<script type="module" src="/main.js"></script> |
||||||
|
</body> |
||||||
|
</html> |
||||||
@ -0,0 +1,21 @@ |
|||||||
|
import App from './App' |
||||||
|
|
||||||
|
// #ifndef VUE3
|
||||||
|
import Vue from 'vue' |
||||||
|
Vue.config.productionTip = false |
||||||
|
App.mpType = 'app' |
||||||
|
const app = new Vue({ |
||||||
|
...App |
||||||
|
}) |
||||||
|
app.$mount() |
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef VUE3
|
||||||
|
import { createSSRApp } from 'vue' |
||||||
|
export function createApp() { |
||||||
|
const app = createSSRApp(App) |
||||||
|
return { |
||||||
|
app |
||||||
|
} |
||||||
|
} |
||||||
|
// #endif
|
||||||
@ -0,0 +1,115 @@ |
|||||||
|
{ |
||||||
|
"name" : "xumuocr_app", |
||||||
|
"appid" : "__UNI__80814F7", |
||||||
|
"description" : "", |
||||||
|
"versionName" : "1.0.0", |
||||||
|
"versionCode" : "100", |
||||||
|
"transformPx" : false, |
||||||
|
/* 5+App特有相关 */ |
||||||
|
"app-plus" : { |
||||||
|
"usingComponents" : true, |
||||||
|
"nvueStyleCompiler" : "uni-app", |
||||||
|
"compilerVersion" : 3, |
||||||
|
"splashscreen" : { |
||||||
|
"alwaysShowBeforeRender" : true, |
||||||
|
"waiting" : true, |
||||||
|
"autoclose" : true, |
||||||
|
"delay" : 0 |
||||||
|
}, |
||||||
|
/* 模块配置 */ |
||||||
|
"modules" : { |
||||||
|
"Camera" : {} |
||||||
|
}, |
||||||
|
/* 应用发布信息 */ |
||||||
|
"distribute" : { |
||||||
|
/* android打包配置 */ |
||||||
|
"android" : { |
||||||
|
"permissionExternalStorage" : { |
||||||
|
"request" : "always", |
||||||
|
"prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。" |
||||||
|
}, |
||||||
|
"permissions" : [ |
||||||
|
"<uses-feature android:name=\"android.hardware.camera\"/>", |
||||||
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", |
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", |
||||||
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", |
||||||
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>", |
||||||
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", |
||||||
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", |
||||||
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", |
||||||
|
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", |
||||||
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", |
||||||
|
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>", |
||||||
|
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>", |
||||||
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", |
||||||
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", |
||||||
|
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>", |
||||||
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" |
||||||
|
] |
||||||
|
}, |
||||||
|
/* ios打包配置 */ |
||||||
|
"ios" : { |
||||||
|
"dSYMs" : false |
||||||
|
}, |
||||||
|
/* SDK配置 */ |
||||||
|
"sdkConfigs" : { |
||||||
|
"ad" : {} |
||||||
|
}, |
||||||
|
"icons" : { |
||||||
|
"android" : { |
||||||
|
"hdpi" : "unpackage/res/icons/72x72.png", |
||||||
|
"xhdpi" : "unpackage/res/icons/96x96.png", |
||||||
|
"xxhdpi" : "unpackage/res/icons/144x144.png", |
||||||
|
"xxxhdpi" : "unpackage/res/icons/192x192.png" |
||||||
|
}, |
||||||
|
"ios" : { |
||||||
|
"appstore" : "unpackage/res/icons/1024x1024.png", |
||||||
|
"ipad" : { |
||||||
|
"app" : "unpackage/res/icons/76x76.png", |
||||||
|
"app@2x" : "unpackage/res/icons/152x152.png", |
||||||
|
"notification" : "unpackage/res/icons/20x20.png", |
||||||
|
"notification@2x" : "unpackage/res/icons/40x40.png", |
||||||
|
"proapp@2x" : "unpackage/res/icons/167x167.png", |
||||||
|
"settings" : "unpackage/res/icons/29x29.png", |
||||||
|
"settings@2x" : "unpackage/res/icons/58x58.png", |
||||||
|
"spotlight" : "unpackage/res/icons/40x40.png", |
||||||
|
"spotlight@2x" : "unpackage/res/icons/80x80.png" |
||||||
|
}, |
||||||
|
"iphone" : { |
||||||
|
"app@2x" : "unpackage/res/icons/120x120.png", |
||||||
|
"app@3x" : "unpackage/res/icons/180x180.png", |
||||||
|
"notification@2x" : "unpackage/res/icons/40x40.png", |
||||||
|
"notification@3x" : "unpackage/res/icons/60x60.png", |
||||||
|
"settings@2x" : "unpackage/res/icons/58x58.png", |
||||||
|
"settings@3x" : "unpackage/res/icons/87x87.png", |
||||||
|
"spotlight@2x" : "unpackage/res/icons/80x80.png", |
||||||
|
"spotlight@3x" : "unpackage/res/icons/120x120.png" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
/* 快应用特有相关 */ |
||||||
|
"quickapp" : {}, |
||||||
|
/* 小程序特有相关 */ |
||||||
|
"mp-weixin" : { |
||||||
|
"appid" : "", |
||||||
|
"setting" : { |
||||||
|
"urlCheck" : false |
||||||
|
}, |
||||||
|
"usingComponents" : true |
||||||
|
}, |
||||||
|
"mp-alipay" : { |
||||||
|
"usingComponents" : true |
||||||
|
}, |
||||||
|
"mp-baidu" : { |
||||||
|
"usingComponents" : true |
||||||
|
}, |
||||||
|
"mp-toutiao" : { |
||||||
|
"usingComponents" : true |
||||||
|
}, |
||||||
|
"uniStatistics" : { |
||||||
|
"enable" : false |
||||||
|
}, |
||||||
|
"vueVersion" : "2" |
||||||
|
} |
||||||
@ -0,0 +1,20 @@ |
|||||||
|
{ |
||||||
|
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages |
||||||
|
{ |
||||||
|
"path": "pages/index/index", |
||||||
|
"style": { |
||||||
|
"navigationBarTitleText": "OCR识别", |
||||||
|
"app-plus": { |
||||||
|
"bounce": "none" // 将回弹属性关掉 |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"globalStyle": { |
||||||
|
"navigationBarTextStyle": "black", |
||||||
|
"navigationBarTitleText": "OCR识别", |
||||||
|
"navigationBarBackgroundColor": "#F8F8F8", |
||||||
|
"backgroundColor": "#F8F8F8" |
||||||
|
}, |
||||||
|
"uniIdRouter": {} |
||||||
|
} |
||||||
@ -0,0 +1,171 @@ |
|||||||
|
<template> |
||||||
|
<view class="box"> |
||||||
|
<view class="header"> |
||||||
|
<button @tap="uploadImage" type="primary">拍照或上传图片进行识别</button> |
||||||
|
</view> |
||||||
|
<view class="main"> |
||||||
|
<scroll-view scroll-y="true"> |
||||||
|
<view style="display: flex;align-items: center;"> |
||||||
|
<h4 style="margin-left: 4px;" v-if="content.length>0">识别结果:</h4> |
||||||
|
<text style="color: green;font-weight: bold;font-size: 12px;">{{message}}</text> |
||||||
|
</view> |
||||||
|
<view style="padding: 0 4px;margin-bottom: 100rpx;"> |
||||||
|
<text v-for="(item,index) in content" :key="index"> |
||||||
|
<p> |
||||||
|
<text selectable="true">{{item.words}}</text> |
||||||
|
</p> |
||||||
|
</text> |
||||||
|
</view> |
||||||
|
</scroll-view> |
||||||
|
</view> |
||||||
|
<view class="footer"> |
||||||
|
<button @tap="saveTxt(contentStr)" type="primary" v-if="contentStr!==''" >保存本地</button> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
|
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import { |
||||||
|
getTokenR, |
||||||
|
} from '@/api/index.js' |
||||||
|
import { |
||||||
|
pathToBase64, |
||||||
|
base64ToPath |
||||||
|
} from '@/components/image-tools/index.js' |
||||||
|
export default { |
||||||
|
data() { |
||||||
|
return { |
||||||
|
content: [], |
||||||
|
token: "", |
||||||
|
contentStr: "", |
||||||
|
message: "", |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
getTokenR().then(res => { |
||||||
|
this.token = res.access_token |
||||||
|
}) |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
uploadImage() { // 选取照片,进行OCR识别 |
||||||
|
|
||||||
|
uni.chooseImage({ |
||||||
|
count: 1, //默认9 |
||||||
|
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 |
||||||
|
success: (res) => { |
||||||
|
this.contentStr = "" |
||||||
|
this.message = "" |
||||||
|
uni.showLoading({ |
||||||
|
title: '正在识别中...' |
||||||
|
}); |
||||||
|
// this.src = res.tempFilePaths[0]; //后面还能用到 src 暂且留着 |
||||||
|
pathToBase64(res.tempFilePaths[0]).then(res2 => { |
||||||
|
// 下面进行转码 |
||||||
|
uni.request({ |
||||||
|
url: `https://aip.baidubce.com/rest/2.0/ocr/v1/accurate_basic?access_token=${this.token}`, |
||||||
|
data: { |
||||||
|
image: res2, |
||||||
|
language_type: 'ENG', //识别语言类型,默认中英文结合 |
||||||
|
detect_direction: true, //检测图像朝向 |
||||||
|
}, |
||||||
|
method: 'POST', |
||||||
|
header: { |
||||||
|
'Content-Type': 'application/x-www-form-urlencoded' |
||||||
|
}, |
||||||
|
success: (res) => { |
||||||
|
this.content = res.data.words_result; |
||||||
|
for (const i in res.data.words_result) { |
||||||
|
this.contentStr += res.data.words_result[i] |
||||||
|
.words + |
||||||
|
"\n" |
||||||
|
} |
||||||
|
uni.hideLoading(); //把正在加载中隐藏 |
||||||
|
} |
||||||
|
}) |
||||||
|
}) |
||||||
|
|
||||||
|
} |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 保存本地文件txt |
||||||
|
saveTxt(res) { |
||||||
|
let dir = '/A_store'; |
||||||
|
let pathUrl = `/A_store/${Date.parse(new Date())}.txt`; |
||||||
|
// #ifdef APP-PLUS |
||||||
|
let environment = plus.android.importClass("android.os.Environment"); |
||||||
|
let sdRoot = environment.getExternalStorageDirectory(); //文件夹根目录 |
||||||
|
let File = plus.android.importClass("java.io.File"); |
||||||
|
let BufferedReader = plus.android.importClass("java.io.BufferedReader"); |
||||||
|
let FileReader = plus.android.importClass("java.io.FileReader"); |
||||||
|
let FileWriter = plus.android.importClass("java.io.FileWriter"); |
||||||
|
let BufferedWriter = plus.android.importClass("java.io.BufferedWriter"); |
||||||
|
let OutputStreamWriter = plus.android.importClass("java.io.OutputStreamWriter"); |
||||||
|
let FileOutputStream = plus.android.importClass("java.io.FileOutputStream"); |
||||||
|
// #endif |
||||||
|
// #ifdef APP-PLUS |
||||||
|
try { |
||||||
|
//不加根目录创建文件(即用相对地址)的话directory.exists()这个判断一值都是false |
||||||
|
let directory = new File(sdRoot + dir); |
||||||
|
if (!directory.exists()) { |
||||||
|
console.log('创建目录') |
||||||
|
directory.mkdirs(); //创建目录 |
||||||
|
} |
||||||
|
let file = new File(sdRoot + pathUrl); |
||||||
|
console.log(file.exists()) |
||||||
|
if (!file.exists()) { |
||||||
|
file.createNewFile(); //创建文件 |
||||||
|
} |
||||||
|
let path = sdRoot + pathUrl |
||||||
|
|
||||||
|
// let writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path), "UTF-8")); |
||||||
|
// writer.write(res); |
||||||
|
// writer.close(); |
||||||
|
|
||||||
|
let fos = new FileWriter(sdRoot + pathUrl, true); |
||||||
|
fos.write(res); |
||||||
|
fos.close(); |
||||||
|
uni.showToast({ |
||||||
|
icon: "success", |
||||||
|
mask: true, |
||||||
|
title: "保存成功" |
||||||
|
}) |
||||||
|
this.message = "(提示:文件存储在本地/A_store/目录下)" |
||||||
|
return true; |
||||||
|
} catch (e) { |
||||||
|
uni.showToast({ |
||||||
|
icon: "error", |
||||||
|
mask: true, |
||||||
|
title: "保存失败" |
||||||
|
}) |
||||||
|
return false; |
||||||
|
} |
||||||
|
return false; |
||||||
|
//#endif |
||||||
|
}, |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
</script> |
||||||
|
<style lang="scss" scoped> |
||||||
|
.box { |
||||||
|
position: relative; |
||||||
|
.header,.footer { |
||||||
|
position: fixed; |
||||||
|
width: 100%; |
||||||
|
} |
||||||
|
.header { |
||||||
|
top: 0%; |
||||||
|
z-index: 1000; |
||||||
|
} |
||||||
|
.footer { |
||||||
|
bottom: 0%; |
||||||
|
background: #fff; |
||||||
|
} |
||||||
|
.main { |
||||||
|
position: absolute; |
||||||
|
top: 90rpx; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
</style> |
||||||
@ -0,0 +1,70 @@ |
|||||||
|
// 配置公共的URL路径
|
||||||
|
const Host = "https://aip.baidubce.com/" |
||||||
|
|
||||||
|
|
||||||
|
const http = (params) => { |
||||||
|
|
||||||
|
//返回promise 对象
|
||||||
|
return new Promise((resolve, reject) => { |
||||||
|
uni.request({ |
||||||
|
// 服务器url+参数中携带的接口具体地址
|
||||||
|
url:Host+params.url, |
||||||
|
// 请求参数
|
||||||
|
data: params.data, |
||||||
|
// 设置后端需要的常用的格式就好,特殊情况调用的时候单独设置
|
||||||
|
header: params.header || { |
||||||
|
"Content-Type": "application/json;charset=utf-8", |
||||||
|
"api-version": params.apiVersion ||'1.0' |
||||||
|
}, |
||||||
|
// "Authorization": token
|
||||||
|
// 默认为GET,可以不写,如常用请求格式为POST,可以设置POST为默认请求方式
|
||||||
|
method: params.method && params.method.toUpperCase() || 'POST', |
||||||
|
dataType: params.dataType,//返回的数据格式,默认为JSON,特殊格式可以在调用的时候传入参数
|
||||||
|
responseType: params.responseType,//响应的数据类型
|
||||||
|
success: res => { |
||||||
|
// 接口访问正常返回数据
|
||||||
|
if ((res.statusCode == 200 && res.data.code === 200)||res.data.code === 401) { |
||||||
|
//1. 操作成功返回数据
|
||||||
|
resolve(res.data) |
||||||
|
} else { |
||||||
|
//2. 操作不成功返回数据,以toast方式弹出响应信息,如后端未格式化非操作成功异常信息,则可以统一定义异常提示
|
||||||
|
if(res.data.code === 503){ |
||||||
|
uni.showToast({ |
||||||
|
icon: "none", |
||||||
|
title: "系统异常", |
||||||
|
duration:3000 |
||||||
|
})
|
||||||
|
}else{ |
||||||
|
if(res.data.msg){ |
||||||
|
uni.showToast({ |
||||||
|
icon: "none", |
||||||
|
title: res.data.msg, |
||||||
|
duration:3000 |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
||||||
|
resolve(res.data) |
||||||
|
} |
||||||
|
}, |
||||||
|
fail: function (e) { |
||||||
|
if(e.errMsg === "request:fail timeout"){ |
||||||
|
uni.showToast({ |
||||||
|
icon: "none", |
||||||
|
title: "网络连接超时,请稍后重试" |
||||||
|
}) |
||||||
|
} |
||||||
|
reject(e); |
||||||
|
setTimeout(() =>{ |
||||||
|
uni.hideLoading(); |
||||||
|
}, 1500) |
||||||
|
}, |
||||||
|
complete(e){ |
||||||
|
resolve(e) |
||||||
|
} |
||||||
|
}) |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
module.exports = { |
||||||
|
httpRequest: http |
||||||
|
} |
||||||
|
After Width: | Height: | Size: 3.9 KiB |
@ -0,0 +1,76 @@ |
|||||||
|
/** |
||||||
|
* 这里是uni-app内置的常用样式变量 |
||||||
|
* |
||||||
|
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 |
||||||
|
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App |
||||||
|
* |
||||||
|
*/ |
||||||
|
|
||||||
|
/** |
||||||
|
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 |
||||||
|
* |
||||||
|
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 |
||||||
|
*/ |
||||||
|
|
||||||
|
/* 颜色变量 */ |
||||||
|
|
||||||
|
/* 行为相关颜色 */ |
||||||
|
$uni-color-primary: #007aff; |
||||||
|
$uni-color-success: #4cd964; |
||||||
|
$uni-color-warning: #f0ad4e; |
||||||
|
$uni-color-error: #dd524d; |
||||||
|
|
||||||
|
/* 文字基本颜色 */ |
||||||
|
$uni-text-color:#333;//基本色 |
||||||
|
$uni-text-color-inverse:#fff;//反色 |
||||||
|
$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息 |
||||||
|
$uni-text-color-placeholder: #808080; |
||||||
|
$uni-text-color-disable:#c0c0c0; |
||||||
|
|
||||||
|
/* 背景颜色 */ |
||||||
|
$uni-bg-color:#ffffff; |
||||||
|
$uni-bg-color-grey:#f8f8f8; |
||||||
|
$uni-bg-color-hover:#f1f1f1;//点击状态颜色 |
||||||
|
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色 |
||||||
|
|
||||||
|
/* 边框颜色 */ |
||||||
|
$uni-border-color:#c8c7cc; |
||||||
|
|
||||||
|
/* 尺寸变量 */ |
||||||
|
|
||||||
|
/* 文字尺寸 */ |
||||||
|
$uni-font-size-sm:12px; |
||||||
|
$uni-font-size-base:14px; |
||||||
|
$uni-font-size-lg:16; |
||||||
|
|
||||||
|
/* 图片尺寸 */ |
||||||
|
$uni-img-size-sm:20px; |
||||||
|
$uni-img-size-base:26px; |
||||||
|
$uni-img-size-lg:40px; |
||||||
|
|
||||||
|
/* Border Radius */ |
||||||
|
$uni-border-radius-sm: 2px; |
||||||
|
$uni-border-radius-base: 3px; |
||||||
|
$uni-border-radius-lg: 6px; |
||||||
|
$uni-border-radius-circle: 50%; |
||||||
|
|
||||||
|
/* 水平间距 */ |
||||||
|
$uni-spacing-row-sm: 5px; |
||||||
|
$uni-spacing-row-base: 10px; |
||||||
|
$uni-spacing-row-lg: 15px; |
||||||
|
|
||||||
|
/* 垂直间距 */ |
||||||
|
$uni-spacing-col-sm: 4px; |
||||||
|
$uni-spacing-col-base: 8px; |
||||||
|
$uni-spacing-col-lg: 12px; |
||||||
|
|
||||||
|
/* 透明度 */ |
||||||
|
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度 |
||||||
|
|
||||||
|
/* 文章场景相关 */ |
||||||
|
$uni-color-title: #2C405A; // 文章标题颜色 |
||||||
|
$uni-font-size-title:20px; |
||||||
|
$uni-color-subtitle: #555555; // 二级标题颜色 |
||||||
|
$uni-font-size-subtitle:26px; |
||||||
|
$uni-color-paragraph: #3F536E; // 文章段落颜色 |
||||||
|
$uni-font-size-paragraph:15px; |
||||||
@ -0,0 +1 @@ |
|||||||
|
https://ide.dcloud.net.cn/build/download/7fe38f30-9fbb-11ed-a7b8-23b57467eb25 |
||||||
@ -0,0 +1,3 @@ |
|||||||
|
andrCertfile=D:/1.developSoftware/HBuilderX.3.6.15.20221228/HBuilderX/plugins/app-safe-pack/Test.keystore |
||||||
|
andrCertAlias=android |
||||||
|
andrCertPass=ep/Tdjka4Y7WYqDB6/S7dw== |
||||||
@ -0,0 +1,4 @@ |
|||||||
|
[General] |
||||||
|
andrCertfile=package.keystore |
||||||
|
andrCertAlias=__UNI__80814F7 |
||||||
|
andrCertPass="sHX4moGGeENQuyPxpgSgew==" |
||||||
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
@ -0,0 +1,25 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="zh-CN"> |
||||||
|
|
||||||
|
<head> |
||||||
|
<meta charset="UTF-8" /> |
||||||
|
<script> |
||||||
|
var __UniViewStartTime__ = Date.now(); |
||||||
|
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || |
||||||
|
CSS.supports('top: constant(a)')) |
||||||
|
document.write( |
||||||
|
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + |
||||||
|
(coverSupport ? ', viewport-fit=cover' : '') + '" />') |
||||||
|
</script> |
||||||
|
<title>View</title> |
||||||
|
<link rel="stylesheet" href="view.css" /> |
||||||
|
</head> |
||||||
|
|
||||||
|
<body> |
||||||
|
<div id="app"></div> |
||||||
|
<script src="__uniappes6.js"></script> |
||||||
|
<script src="view.umd.min.js"></script> |
||||||
|
<script src="app-view.js"></script> |
||||||
|
</body> |
||||||
|
|
||||||
|
</html> |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
|
||||||
|
var isReady=false;var onReadyCallbacks=[]; |
||||||
|
var isServiceReady=false;var onServiceReadyCallbacks=[]; |
||||||
|
var __uniConfig = {"pages":["pages/index/index"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"OCR识别","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"xumuocr_app","compilerVersion":"3.6.18","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}}; |
||||||
|
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true},"window":{"navigationBarTitleText":"OCR识别","bounce":"none"}}]; |
||||||
|
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}}); |
||||||
|
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}}); |
||||||
|
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}}); |
||||||
@ -0,0 +1 @@ |
|||||||
|
(function(e){function r(r){for(var n,l,i=r[0],p=r[1],a=r[2],c=0,s=[];c<i.length;c++)l=i[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in p)Object.prototype.hasOwnProperty.call(p,n)&&(e[n]=p[n]);f&&f(r);while(s.length)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var p=t[i];0!==o[p]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={"app-config":0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e["default"]}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var i=this["webpackJsonp"]=this["webpackJsonp"]||[],p=i.push.bind(i);i.push=r,i=i.slice();for(var a=0;a<i.length;a++)r(i[a]);var f=p;t()})([]); |
||||||
@ -0,0 +1 @@ |
|||||||
|
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__80814F7","name":"xumuocr_app","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"Camera":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":true,"delay":0,"target":"id:1","waiting":true},"popGesture":"close","launchwebview":{"render":"always","id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"icons":{"android":{"hdpi":"icon-android-hdpi.png","xhdpi":"icon-android-xhdpi.png","xxhdpi":"icon-android-xxhdpi.png","xxxhdpi":"icon-android-xxxhdpi.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"},"prerendered":"false"}},"google":{"permissionExternalStorage":{"prompt":"应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。","request":"always"},"permissions":["<uses-feature android:name=\"android.hardware.camera\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"],"packagename":"uni.UNI80814F7","custompermissions":true},"apple":{"dSYMs":false,"devices":"universal"},"plugins":{"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}},"orientation":"portrait-primary"},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"3.6.18","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"launch_path":"__uniappview.html","adid":"122840010410"}} |
||||||
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
@ -0,0 +1,25 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="zh-CN"> |
||||||
|
|
||||||
|
<head> |
||||||
|
<meta charset="UTF-8" /> |
||||||
|
<script> |
||||||
|
var __UniViewStartTime__ = Date.now(); |
||||||
|
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || |
||||||
|
CSS.supports('top: constant(a)')) |
||||||
|
document.write( |
||||||
|
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + |
||||||
|
(coverSupport ? ', viewport-fit=cover' : '') + '" />') |
||||||
|
</script> |
||||||
|
<title>View</title> |
||||||
|
<link rel="stylesheet" href="view.css" /> |
||||||
|
</head> |
||||||
|
|
||||||
|
<body> |
||||||
|
<div id="app"></div> |
||||||
|
<script src="__uniappes6.js"></script> |
||||||
|
<script src="view.umd.min.js"></script> |
||||||
|
<script src="app-view.js"></script> |
||||||
|
</body> |
||||||
|
|
||||||
|
</html> |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
|
||||||
|
var isReady=false;var onReadyCallbacks=[]; |
||||||
|
var isServiceReady=false;var onServiceReadyCallbacks=[]; |
||||||
|
var __uniConfig = {"pages":["pages/index/index"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"OCR识别","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"xumuocr_app","compilerVersion":"3.6.18","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}}; |
||||||
|
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true},"window":{"navigationBarTitleText":"OCR识别","bounce":"none"}}]; |
||||||
|
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}}); |
||||||
|
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}}); |
||||||
|
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}}); |
||||||
@ -0,0 +1 @@ |
|||||||
|
(function(e){function r(r){for(var n,l,i=r[0],p=r[1],a=r[2],c=0,s=[];c<i.length;c++)l=i[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in p)Object.prototype.hasOwnProperty.call(p,n)&&(e[n]=p[n]);f&&f(r);while(s.length)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var p=t[i];0!==o[p]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={"app-config":0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e["default"]}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var i=this["webpackJsonp"]=this["webpackJsonp"]||[],p=i.push.bind(i);i.push=r,i=i.slice();for(var a=0;a<i.length;a++)r(i[a]);var f=p;t()})([]); |
||||||
@ -0,0 +1 @@ |
|||||||
|
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__80814F7","name":"xumuocr_app","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"Camera":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"render":"always","id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"google":{"permissionExternalStorage":{"request":"always","prompt":"应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"},"permissions":["<uses-feature android:name=\"android.hardware.camera\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{"dSYMs":false},"plugins":{"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"3.6.18","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"launch_path":"__uniappview.html"}} |
||||||
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
@ -0,0 +1,25 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="zh-CN"> |
||||||
|
|
||||||
|
<head> |
||||||
|
<meta charset="UTF-8" /> |
||||||
|
<script> |
||||||
|
var __UniViewStartTime__ = Date.now(); |
||||||
|
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || |
||||||
|
CSS.supports('top: constant(a)')) |
||||||
|
document.write( |
||||||
|
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + |
||||||
|
(coverSupport ? ', viewport-fit=cover' : '') + '" />') |
||||||
|
</script> |
||||||
|
<title>View</title> |
||||||
|
<link rel="stylesheet" href="view.css" /> |
||||||
|
</head> |
||||||
|
|
||||||
|
<body> |
||||||
|
<div id="app"></div> |
||||||
|
<script src="__uniappes6.js"></script> |
||||||
|
<script src="view.umd.min.js"></script> |
||||||
|
<script src="app-view.js"></script> |
||||||
|
</body> |
||||||
|
|
||||||
|
</html> |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
|
||||||
|
var isReady=false;var onReadyCallbacks=[]; |
||||||
|
var isServiceReady=false;var onServiceReadyCallbacks=[]; |
||||||
|
var __uniConfig = {"pages":["pages/index/index"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"OCR识别","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"xumuocr_app","compilerVersion":"3.6.18","entryPagePath":"pages/index/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}}; |
||||||
|
var __uniRoutes = [{"path":"/pages/index/index","meta":{"isQuit":true},"window":{"navigationBarTitleText":"OCR识别","bounce":"none"}}]; |
||||||
|
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}}); |
||||||
|
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}}); |
||||||
|
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}}); |
||||||
@ -0,0 +1,154 @@ |
|||||||
|
/******/ (function(modules) { // webpackBootstrap
|
||||||
|
/******/ // install a JSONP callback for chunk loading
|
||||||
|
/******/ function webpackJsonpCallback(data) { |
||||||
|
/******/ var chunkIds = data[0]; |
||||||
|
/******/ var moreModules = data[1]; |
||||||
|
/******/ var executeModules = data[2]; |
||||||
|
/******/ |
||||||
|
/******/ // add "moreModules" to the modules object,
|
||||||
|
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||||
|
/******/ var moduleId, chunkId, i = 0, resolves = []; |
||||||
|
/******/ for(;i < chunkIds.length; i++) { |
||||||
|
/******/ chunkId = chunkIds[i]; |
||||||
|
/******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) { |
||||||
|
/******/ resolves.push(installedChunks[chunkId][0]); |
||||||
|
/******/ } |
||||||
|
/******/ installedChunks[chunkId] = 0; |
||||||
|
/******/ } |
||||||
|
/******/ for(moduleId in moreModules) { |
||||||
|
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { |
||||||
|
/******/ modules[moduleId] = moreModules[moduleId]; |
||||||
|
/******/ } |
||||||
|
/******/ } |
||||||
|
/******/ if(parentJsonpFunction) parentJsonpFunction(data); |
||||||
|
/******/ |
||||||
|
/******/ while(resolves.length) { |
||||||
|
/******/ resolves.shift()(); |
||||||
|
/******/ } |
||||||
|
/******/ |
||||||
|
/******/ // add entry modules from loaded chunk to deferred list
|
||||||
|
/******/ deferredModules.push.apply(deferredModules, executeModules || []); |
||||||
|
/******/ |
||||||
|
/******/ // run deferred modules when all chunks ready
|
||||||
|
/******/ return checkDeferredModules(); |
||||||
|
/******/ }; |
||||||
|
/******/ function checkDeferredModules() { |
||||||
|
/******/ var result; |
||||||
|
/******/ for(var i = 0; i < deferredModules.length; i++) { |
||||||
|
/******/ var deferredModule = deferredModules[i]; |
||||||
|
/******/ var fulfilled = true; |
||||||
|
/******/ for(var j = 1; j < deferredModule.length; j++) { |
||||||
|
/******/ var depId = deferredModule[j]; |
||||||
|
/******/ if(installedChunks[depId] !== 0) fulfilled = false; |
||||||
|
/******/ } |
||||||
|
/******/ if(fulfilled) { |
||||||
|
/******/ deferredModules.splice(i--, 1); |
||||||
|
/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]); |
||||||
|
/******/ } |
||||||
|
/******/ } |
||||||
|
/******/ |
||||||
|
/******/ return result; |
||||||
|
/******/ } |
||||||
|
/******/ |
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var installedModules = {}; |
||||||
|
/******/ |
||||||
|
/******/ // object to store loaded and loading chunks
|
||||||
|
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||||
|
/******/ // Promise = chunk loading, 0 = chunk loaded
|
||||||
|
/******/ var installedChunks = { |
||||||
|
/******/ "app-config": 0 |
||||||
|
/******/ }; |
||||||
|
/******/ |
||||||
|
/******/ var deferredModules = []; |
||||||
|
/******/ |
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) { |
||||||
|
/******/ |
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ if(installedModules[moduleId]) { |
||||||
|
/******/ return installedModules[moduleId].exports; |
||||||
|
/******/ } |
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = installedModules[moduleId] = { |
||||||
|
/******/ i: moduleId, |
||||||
|
/******/ l: false, |
||||||
|
/******/ exports: {} |
||||||
|
/******/ }; |
||||||
|
/******/ |
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); |
||||||
|
/******/ |
||||||
|
/******/ // Flag the module as loaded
|
||||||
|
/******/ module.l = true; |
||||||
|
/******/ |
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports; |
||||||
|
/******/ } |
||||||
|
/******/ |
||||||
|
/******/ |
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = modules; |
||||||
|
/******/ |
||||||
|
/******/ // expose the module cache
|
||||||
|
/******/ __webpack_require__.c = installedModules; |
||||||
|
/******/ |
||||||
|
/******/ // define getter function for harmony exports
|
||||||
|
/******/ __webpack_require__.d = function(exports, name, getter) { |
||||||
|
/******/ if(!__webpack_require__.o(exports, name)) { |
||||||
|
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); |
||||||
|
/******/ } |
||||||
|
/******/ }; |
||||||
|
/******/ |
||||||
|
/******/ // define __esModule on exports
|
||||||
|
/******/ __webpack_require__.r = function(exports) { |
||||||
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
||||||
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
||||||
|
/******/ } |
||||||
|
/******/ Object.defineProperty(exports, '__esModule', { value: true }); |
||||||
|
/******/ }; |
||||||
|
/******/ |
||||||
|
/******/ // create a fake namespace object
|
||||||
|
/******/ // mode & 1: value is a module id, require it
|
||||||
|
/******/ // mode & 2: merge all properties of value into the ns
|
||||||
|
/******/ // mode & 4: return value when already ns object
|
||||||
|
/******/ // mode & 8|1: behave like require
|
||||||
|
/******/ __webpack_require__.t = function(value, mode) { |
||||||
|
/******/ if(mode & 1) value = __webpack_require__(value); |
||||||
|
/******/ if(mode & 8) return value; |
||||||
|
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; |
||||||
|
/******/ var ns = Object.create(null); |
||||||
|
/******/ __webpack_require__.r(ns); |
||||||
|
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); |
||||||
|
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); |
||||||
|
/******/ return ns; |
||||||
|
/******/ }; |
||||||
|
/******/ |
||||||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||||
|
/******/ __webpack_require__.n = function(module) { |
||||||
|
/******/ var getter = module && module.__esModule ? |
||||||
|
/******/ function getDefault() { return module['default']; } : |
||||||
|
/******/ function getModuleExports() { return module; }; |
||||||
|
/******/ __webpack_require__.d(getter, 'a', getter); |
||||||
|
/******/ return getter; |
||||||
|
/******/ }; |
||||||
|
/******/ |
||||||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||||||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; |
||||||
|
/******/ |
||||||
|
/******/ // __webpack_public_path__
|
||||||
|
/******/ __webpack_require__.p = "/"; |
||||||
|
/******/ |
||||||
|
/******/ var jsonpArray = this["webpackJsonp"] = this["webpackJsonp"] || []; |
||||||
|
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); |
||||||
|
/******/ jsonpArray.push = webpackJsonpCallback; |
||||||
|
/******/ jsonpArray = jsonpArray.slice(); |
||||||
|
/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]); |
||||||
|
/******/ var parentJsonpFunction = oldJsonpFunction; |
||||||
|
/******/ |
||||||
|
/******/ |
||||||
|
/******/ // run deferred modules from other chunks
|
||||||
|
/******/ checkDeferredModules(); |
||||||
|
/******/ }) |
||||||
|
/************************************************************************/ |
||||||
|
/******/ ([]); |
||||||
@ -0,0 +1 @@ |
|||||||
|
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__80814F7","name":"xumuocr_app","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"Camera":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"render":"always","id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"google":{"permissionExternalStorage":{"request":"always","prompt":"应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"},"permissions":["<uses-feature android:name=\"android.hardware.camera\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{"dSYMs":false},"plugins":{"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"uni-app":{"compilerVersion":"3.6.18","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"launch_path":"__uniappview.html"}} |
||||||
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 595 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 9.1 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 19 KiB |