Procházet zdrojové kódy

nfc样式提交

yxb
DESKTOP-2IO5MST\huting před 1 rokem
rodič
revize
4df991a0f5

+ 5
- 2
pages/nfc/nfc.vue Zobrazit soubor

@@ -53,7 +53,7 @@
}

function scanNfc() {
tools.showLoadingAlert("扫描蓝牙中");
tools.showLoadingAlert("扫描NFC中");
//先断开所有设备
NFCAPI.remove(() => {
//开始扫描设备
@@ -149,5 +149,8 @@
}
</script>
<style lang='scss' scoped>

image {
width: 40rpx;
height: 40rpx;
}
</style>

+ 5
- 1
subpackage/orders/opening-account-people.vue Zobrazit soubor

@@ -252,7 +252,8 @@
import {
msg,
checkStr,
strReplace
strReplace,
uploadFile
} from "@/utils/utils";
import {
onLoad,
@@ -619,6 +620,9 @@
state.isTakePhotoModeShow = false
var imageType = state.choiceIndex;
console.log("图片地址val", val.tempImagePath)
// uploadFile(val.tempImagePath,imageType,etcOcrCard).then((res)=>{

// })
uni.uploadFile({
url: 'https://qtzl.etcjz.cn/minIo/upload', //仅为示例,非真实的接口地址
filePath: val.tempImagePath,

+ 1
- 8
subpackage/personal-center/setting/car-information/car-create.vue Zobrazit soubor

@@ -207,7 +207,7 @@
uni.chooseImage({
count: 1, //只能选取一张照片
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
sourceType: ["camera", "album"], //从相册选择
sourceType: ["camera",], //从相册选择
success: function (res) {
pathToBase64(res.tempFilePaths[0])
.then((path) => {
@@ -231,11 +231,6 @@
},
});
};
// const strReplace = (str : string) => {
// let imgUrl = str.replace("http://192.168.101.145:9000", envs[process.env.NODE_ENV].baseUrl);
// imgUrl = imgUrl.replace("http://100.64.2.113:9000", envs[process.env.NODE_ENV].baseUrl);
// return imgUrl;
// };

const state = reactive({
phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
@@ -425,8 +420,6 @@
}
state.isTakePhotoModeShow = false
});
// })
// .catch((error) => { });
},
})
}

+ 43
- 1
utils/utils.ts Zobrazit soubor

@@ -1,7 +1,12 @@
import { getItem, StorageKeys } from "./storage";
import { OrderStatus, OrderTypes } from "@/datas/enum.ts";
import { envs } from "@/utils/network/api.js";

import {
stringToJson
} from "@/utils/network/encryption";
import {
request
} from "@/utils/network/request.js";
//toast
export const msg = (title : string = "", param : any = {}) => {
if (!title) return;
@@ -426,4 +431,41 @@ export function nowDate(date : any) {
function formatNumber(n : any) {
n = n.toString()
return n[1] ? n : `0${n}`
}
export function uploadFile(tempImagePath, imageType, code) {
uni.uploadFile({
url: 'https://qtzl.etcjz.cn/minIo/upload', //仅为示例,非真实的接口地址
filePath: tempImagePath,
name: 'file',
formData: {
'user': 'test',
"bucket": 'default-bucket'
},
success: (uploadFileRes) => {
let uploadFileImage = 'http://100.64.2.113:9000' + '/default-bucket/' + JSON.parse(uploadFileRes.data).data.ossFilePath
console.log("111", JSON.parse(uploadFileRes.data).data.ossFilePath);
var data = {
source: "1",
agencyId: "52010106004",
imageType: imageType,
fileName: tempImagePath,
url: uploadFileImage
};

const options = {
type: 2,
data: data,
method: "POST",
showLoading: true,
};
console.log('输出内容=====123')
request(code, options).then((res) => {
const data = stringToJson(res.bizContent);
return data

});
}
});


}

Načítá se…
Zrušit
Uložit