Browse Source

优化

ms
zhoujie 1 year ago
parent
commit
d895577328
7 changed files with 29 additions and 12 deletions
  1. 9
    5
      components/upload-car-img/upload-car-img.vue
  2. 6
    1
      index.html
  3. 2
    4
      main.js
  4. 2
    1
      manifest.json
  5. 2
    1
      package.json
  6. 3
    0
      utils/network/request.js
  7. 5
    0
      yarn.lock

+ 9
- 5
components/upload-car-img/upload-car-img.vue View File

@@ -46,12 +46,17 @@
const emits = defineEmits(['uploadImgHandle'])
let uploadimges = ref('')
const cardImageOcr = () => {

uni.chooseImage({
count: 1, //只能选取一张照片
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
sourceType: ["camera", "album"], //从相册选择
success: function(res) {
success: (res) => {
// console.log(res.tempFiles[0]);
uni.showLoading({
title: '正在识别图片',
mask: true
});
uploadimges.value = res.tempFiles[0].path
let size = res.tempFiles[0].size
let name = res.tempFiles[0].name
@@ -60,7 +65,7 @@
if (scall > 1) {
scall = 1
}
console.log(scall);
// uni.showLoading({
// title: '正在进行识别',
// mask: true
@@ -91,7 +96,7 @@
if (import.meta.env.VITE_APP_TYPE === 'production') {
url = 'http://100.64.2.113:9000/default-bucket/' + url
} else {
url = 'https://http://192.168.100.63:9000/default-bucket/' + url
url = 'http://192.168.101.145:9000/default-bucket/' + url
}
console.log(url, '图片地址');
emits('uploadImgHandle', {
@@ -99,11 +104,10 @@
url,
fileName,
})
uni.hideLoading()
}
});

xhr.open("POST", "/minIo/upload");

xhr.send(data);
}
</script>

+ 6
- 1
index.html View File

@@ -14,8 +14,13 @@
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
<script>
if (navigator.userAgent.indexOf('AlipayClient') > -1) {
document.writeln('<script src="https://appx/web-view.min.js"' + '>' + '<' + '/' + 'script>');
}
</script>
</body>
<!-- <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<!-- <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script>
// 使用jweixin jdl
window.jWeixin = window.wx;

+ 2
- 4
main.js View File

@@ -34,10 +34,8 @@ export function createApp() {
const app = createSSRApp(App);
app.use(store);
app.use(uView);
if(import.meta.env.ENV == 'production'){
app.use(vConsole1)
}
console.log(import.meta.env.VITE_APP_TYPE,'main');
app.use(vConsole1)
console.log(import.meta.env.VITE_APP_TYPE, 'main');
//系统属性全局注册
const counter = useCounterStore();
app.config.globalProperties.$systemInfo = counter.systemInfo

+ 2
- 1
manifest.json View File

@@ -89,6 +89,7 @@
"base" : "./",
"mode" : "hash"
},
"title" : "ETC申办"
"title" : "ETC申办",
"template" : "./index.html"
}
}

+ 2
- 1
package.json View File

@@ -21,7 +21,8 @@
"qrcode.vue": "^3.4.1",
"sm-crypto": "^0.3.12",
"vconsole": "^3.15.1",
"vue-buffer": "^0.0.1"
"vue-buffer": "^0.0.1",
"weixin-js-sdk": "^1.6.0"
},
"devDependencies": {
"@typescript-eslint/parser": "^5.60.0"

+ 3
- 0
utils/network/request.js View File

@@ -65,6 +65,7 @@ export function request(code, options = {}) {
mask: true
});
}
console.time()
if (options.noCommon) {
// 不携带公参
options.data = encryption(code, {
@@ -77,6 +78,7 @@ export function request(code, options = {}) {
'appId': appId
}), 2);
}
console.timeEnd()
}

//参数返回
@@ -85,6 +87,7 @@ export function request(code, options = {}) {
// 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
uni.hideLoading()
if (res.data.statusCode !== 0) {
if(!options.hideShowModal && res.data.statusCode !== options.statusCode)
uni.showModal({
title: '提示',
content: res.data.errorMsg,

+ 5
- 0
yarn.lock View File

@@ -677,6 +677,11 @@ vue-buffer@^0.0.1:
resolved "https://registry.npmmirror.com/vue-buffer/-/vue-buffer-0.0.1.tgz#4b6edfe62d4ad802699442a382e120e4b13e9336"
integrity sha512-D9q93U6rzIeGthpq+yOgKKWDoSrWQlKHTxOW1Y8hVscA8uHYtE600VNLwoFrDhpdcgpMBetM/VRfDCb7/dmImA==

weixin-js-sdk@^1.6.0:
version "1.6.0"
resolved "https://registry.npmmirror.com/weixin-js-sdk/-/weixin-js-sdk-1.6.0.tgz#ff50484d8118ce1208f11248cf4a1c0831577514"
integrity sha512-3IYQH7aalJGFJrwdT3epvTdR1MboMiH7vIZ5BRL2eYOJ12BNah7csoMkmSZzkq1+l92sSq29XdTCVjCJoK2sBQ==

yallist@^4.0.0:
version "4.0.0"
resolved "https://registry.npmmirror.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"

Loading…
Cancel
Save