diff --git a/App.vue b/App.vue
index f034845..8a1e5ae 100644
--- a/App.vue
+++ b/App.vue
@@ -4,7 +4,7 @@ import { onLaunch, onShow, onError } from '@dcloudio/uni-app'
import { NxInit } from './nx'
import $store from '@/nx/store'
// #ifdef APP-PLUS
-import * as chainway from '@/uni_modules/zzjc-chainway-p100'
+import * as urovo from '@/uni_modules/zzjc-urovo'
// #endif
onLaunch(async () => {
// 加载nx底层依赖
@@ -15,9 +15,8 @@ onLaunch(async () => {
if (brand === 'chainway') {
plus.screen.lockOrientation('landscape')
}
-
- chainway.scanRegister(data => {
- console.log('扫码结果:' + data)
+ urovo.scanRegister(data => {
+ console.log('优博讯扫码结果:' + data)
$store('biz').scanQRInfo = data
})
// #endif
diff --git a/components/n-verify/n-verify.vue b/components/n-verify/n-verify.vue
index c01a44b..0aa73b2 100644
--- a/components/n-verify/n-verify.vue
+++ b/components/n-verify/n-verify.vue
@@ -363,7 +363,10 @@ defineExpose({
diff --git a/pages/analysis/sample/sample-work-detail.vue b/pages/analysis/sample/sample-work-detail.vue
index b44a054..267188a 100644
--- a/pages/analysis/sample/sample-work-detail.vue
+++ b/pages/analysis/sample/sample-work-detail.vue
@@ -84,13 +84,25 @@
>
-
+
+
+
+
-
+
{{ currentAuncel.code }}
杯号:{{ currentCupNum }}
@@ -123,7 +135,7 @@
确认采集
-
+
@@ -354,7 +366,7 @@ const parameterClassifyChange = v => {
const fieldClick = (field, key) => {
if (!field.isEdit) return
- if (field.fillingWay === 'input') {
+ if (currentFillingWay.value === 'input') {
inputValue.value = field.value
}
selectedField.value = field
@@ -366,13 +378,26 @@ const fieldClick = (field, key) => {
let decimalPosition = field.decimalPosition
if (decimalPosition == null || decimalPosition < -1) decimalPosition = -1
numKeyboardParam.decimal = decimalPosition
- if (field.fillingWay == 'collect') {
+ if (currentFillingWay.value == 'collect') {
listenDeviceData()
} else {
closeDeviceListener()
}
}
-
+const currentFillingIndex = ref(0)
+const fillingWay = computed(() => {
+ if (selectedField.value.fillingWay) {
+ return selectedField.value.fillingWay.split(',')
+ } else {
+ return []
+ }
+})
+const currentFillingWay = computed(() => {
+ return fillingWay.value[currentFillingIndex.value] || ''
+})
+const switchFillingWay = () => {
+ currentFillingIndex.value = (currentFillingIndex.value + 1) % fillingWay.value.length
+}
//自动切换到下一个字段
const autoNextField = () => {
let groupIndex = 0
@@ -1053,9 +1078,13 @@ const listenNumKeyboard = () => {
return
}
//自动补全小数位数
- const decimalPosition = selectedField.value.decimalPosition || 0
+ const decimalPosition = selectedField.value.decimalPosition
let val = res.val
- selectedField.value.value = handleRoundFiveNumber(val, decimalPosition)
+ if (decimalPosition == null) {
+ selectedField.value.value = val
+ } else {
+ selectedField.value.value = handleRoundFiveNumber(val, decimalPosition)
+ }
calcAnalysisValue(fieldGroup.value)
//自动跳转下一个字段
setTimeout(() => {
@@ -1098,7 +1127,8 @@ const releaseDeviceControl = deviceId => {
data: {
deviceId: deviceId,
isControl: false,
- controlRealName: userInfo.value.nickname
+ controlRealName: userInfo.value.nickname,
+ controlUserId: userInfo.value.id
}
}
//发送控制数据
@@ -1304,8 +1334,8 @@ onBackPress(() => {
position: relative;
.code {
position: absolute;
- top: 10px;
- left: 50px;
+ top: 15px;
+ left: 55px;
}
}
@@ -1375,6 +1405,7 @@ onBackPress(() => {
.field-name {
font-size: 26px;
padding: 8px;
+ width: 100%;
}
.my-collapse {
@@ -1401,6 +1432,7 @@ onBackPress(() => {
}
.field-name {
font-size: 16px;
+ width: 100%;
}
}
diff --git a/pages/index/index.vue b/pages/index/index.vue
index b34f532..ab3b480 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -14,11 +14,13 @@ import nx from '@/nx'
import { useGridCol } from '@/nx/hooks/useGridCol'
let list = reactive([
{ url: '/pages/lims/index/index', name: '设备管理', icon: 'device' },
- { url: '/pages/analysis/index/index', name: '分析管理', icon: 'analyse' }
+ { url: '/pages/analysis/index/index', name: '分析管理', icon: 'analyse' },
+ { url: '/pages/sampleWarehouse/index/index', name: '样品库管理', icon: 'sampleWarehouse' }
])
// const sysMenus = computed(() => nx.$store('user').sysMenus)
function goSystem(url) {
+ uni.setStorageSync('defaultModule', url)
uni.reLaunch({ url })
}
diff --git a/pages/index/me-popup.vue b/pages/index/me-popup.vue
index be78526..b3be615 100644
--- a/pages/index/me-popup.vue
+++ b/pages/index/me-popup.vue
@@ -9,6 +9,7 @@
+
diff --git a/pages/lims/index/index.vue b/pages/lims/index/index.vue
index d20816f..debbac2 100644
--- a/pages/lims/index/index.vue
+++ b/pages/lims/index/index.vue
@@ -1,7 +1,12 @@
-
-
+
+
+
diff --git a/pages/sampleWarehouse/execChangeLocation/index.vue b/pages/sampleWarehouse/execChangeLocation/index.vue
new file mode 100644
index 0000000..c38aec0
--- /dev/null
+++ b/pages/sampleWarehouse/execChangeLocation/index.vue
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 样品名称:{{ sampleData.sampleName }}
+ 样品库名称:{{ sampleData.sampleCode }}
+ 归库编码:{{ sampleData.sampleCode }}
+ (原)库位编码:{{ sampleData.sampleCode }}
+
+
+
+
+
+
+
+
+
diff --git a/pages/sampleWarehouse/index/index.vue b/pages/sampleWarehouse/index/index.vue
new file mode 100644
index 0000000..e10aa16
--- /dev/null
+++ b/pages/sampleWarehouse/index/index.vue
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+ (popupShow = val)" />
+
+
+
+
+
+
diff --git a/pages/sampleWarehouse/returnToStock/index.vue b/pages/sampleWarehouse/returnToStock/index.vue
new file mode 100644
index 0000000..2a7e6d7
--- /dev/null
+++ b/pages/sampleWarehouse/returnToStock/index.vue
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+
+ {{ successCount }}
+
+
+
+
+
+
+
+
+
diff --git a/pages/sampleWarehouse/sampleSearch/index.vue b/pages/sampleWarehouse/sampleSearch/index.vue
new file mode 100644
index 0000000..b1d216e
--- /dev/null
+++ b/pages/sampleWarehouse/sampleSearch/index.vue
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 样品名称:{{ sampleData.sampleName }}
+
+
+ 样品编号:{{ sampleData.sampleCode }}
+ 归库编码:{{ sampleData.sampleCode }}
+ 样品库名称:{{ sampleData.sampleCode }}
+ 库位信息:{{ sampleData.sampleCode }}
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/setting/print.vue b/pages/setting/print.vue
new file mode 100644
index 0000000..97cc1ec
--- /dev/null
+++ b/pages/setting/print.vue
@@ -0,0 +1,233 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 服务名称:{{ print.printName }}
+
+ 服务IP地址:{{ print.printIp }}
+
+ 服务端口:{{ print.printPort }}
+
+ 连接状态:{{ print.isOpen ? '连接正常!!!' : '连接关闭!!!' }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/static/images/menus/execChangeLocation.png b/static/images/menus/execChangeLocation.png
new file mode 100644
index 0000000..6bdcba0
Binary files /dev/null and b/static/images/menus/execChangeLocation.png differ
diff --git a/static/images/menus/returnToStock.png b/static/images/menus/returnToStock.png
new file mode 100644
index 0000000..6662596
Binary files /dev/null and b/static/images/menus/returnToStock.png differ
diff --git a/static/images/menus/sampleWarehouse.png b/static/images/menus/sampleWarehouse.png
new file mode 100644
index 0000000..8816c0a
Binary files /dev/null and b/static/images/menus/sampleWarehouse.png differ
diff --git a/uni_modules/zzjc-urovo/changelog.md b/uni_modules/zzjc-urovo/changelog.md
new file mode 100644
index 0000000..e69de29
diff --git a/uni_modules/zzjc-urovo/package.json b/uni_modules/zzjc-urovo/package.json
new file mode 100644
index 0000000..20d52cd
--- /dev/null
+++ b/uni_modules/zzjc-urovo/package.json
@@ -0,0 +1,84 @@
+{
+ "id": "zzjc-urovo",
+ "displayName": "优博讯PDA插件",
+ "version": "1.0.0",
+ "description": "优博讯PDA插件",
+ "keywords": [
+ "zzjc-urovo",
+ "PDA",
+ "优博讯"
+],
+ "repository": "",
+ "engines": {
+ "HBuilderX": "^3.6.8"
+ },
+ "dcloudext": {
+ "type": "uts",
+ "sale": {
+ "regular": {
+ "price": "0.00"
+ },
+ "sourcecode": {
+ "price": "0.00"
+ }
+ },
+ "contact": {
+ "qq": ""
+ },
+ "declaration": {
+ "ads": "",
+ "data": "",
+ "permissions": ""
+ },
+ "npmurl": ""
+ },
+ "uni_modules": {
+ "dependencies": [],
+ "encrypt": [],
+ "platforms": {
+ "cloud": {
+ "tcb": "u",
+ "aliyun": "u",
+ "alipay": "u"
+ },
+ "client": {
+ "Vue": {
+ "vue2": "u",
+ "vue3": "u"
+ },
+ "App": {
+ "app-android": "u",
+ "app-ios": "u"
+ },
+ "H5-mobile": {
+ "Safari": "u",
+ "Android Browser": "u",
+ "微信浏览器(Android)": "u",
+ "QQ浏览器(Android)": "u"
+ },
+ "H5-pc": {
+ "Chrome": "u",
+ "IE": "u",
+ "Edge": "u",
+ "Firefox": "u",
+ "Safari": "u"
+ },
+ "小程序": {
+ "微信": "u",
+ "阿里": "u",
+ "百度": "u",
+ "字节跳动": "u",
+ "QQ": "u",
+ "钉钉": "u",
+ "快手": "u",
+ "飞书": "u",
+ "京东": "u"
+ },
+ "快应用": {
+ "华为": "u",
+ "联盟": "u"
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/uni_modules/zzjc-urovo/readme.md b/uni_modules/zzjc-urovo/readme.md
new file mode 100644
index 0000000..3d21371
--- /dev/null
+++ b/uni_modules/zzjc-urovo/readme.md
@@ -0,0 +1,14 @@
+# zzjc-urovo 优博讯PDA插件
+
+## 方法清单
+| 方法名称 | 说明 |
+| --- | ------------ |
+| scanRegister | 扫码注册 (该方法参数里的所有回调都会在内存中持续存在,使用者避免频繁调用此方法)|
+| scanUnRegister | 扫码卸载 |
+
+
+### 开发文档
+[UTS 语法](https://uniapp.dcloud.net.cn/tutorial/syntax-uts.html)
+[UTS API插件](https://uniapp.dcloud.net.cn/plugin/uts-plugin.html)
+[UTS 组件插件](https://uniapp.dcloud.net.cn/plugin/uts-component.html)
+[Hello UTS](https://gitcode.net/dcloud/hello-uts)
\ No newline at end of file
diff --git a/uni_modules/zzjc-urovo/utssdk/app-android/config.json b/uni_modules/zzjc-urovo/utssdk/app-android/config.json
new file mode 100644
index 0000000..bf95925
--- /dev/null
+++ b/uni_modules/zzjc-urovo/utssdk/app-android/config.json
@@ -0,0 +1,3 @@
+{
+ "minSdkVersion": "21"
+}
\ No newline at end of file
diff --git a/uni_modules/zzjc-urovo/utssdk/app-android/index.uts b/uni_modules/zzjc-urovo/utssdk/app-android/index.uts
new file mode 100644
index 0000000..c753819
--- /dev/null
+++ b/uni_modules/zzjc-urovo/utssdk/app-android/index.uts
@@ -0,0 +1,118 @@
+/**
+ * 引用 Android 系统库,示例如下:
+ * import { Context } from "android.content.Context";
+ * [可选实现,按需引入]
+ */
+import Activity from 'android.app.Activity';
+import IntentFilter from 'android.content.IntentFilter';
+import BroadcastReceiver from 'android.content.BroadcastReceiver';
+import Context from 'android.content.Context';
+import Intent from 'android.content.Intent';
+
+/* 引入 interface.uts 文件中定义的变量 */
+import { MyApiOptions, MyApiResult, MyApi, MyApiSync, OnScanReceiverCallback, ScanRegister, ScanUnRegister } from '../interface.uts';
+
+/* 引入 unierror.uts 文件中定义的变量 */
+import { MyApiFailImpl } from '../unierror';
+
+import ScanBroadcastReceiver from './scan/ScanBroadcastReceiver';
+
+/**
+ * 引入三方库
+ * [可选实现,按需引入]
+ *
+ * 在 Android 平台引入三方库有以下两种方式:
+ * 1、[推荐] 通过 仓储 方式引入,将 三方库的依赖信息 配置到 config.json 文件下的 dependencies 字段下。详细配置方式[详见](https://uniapp.dcloud.net.cn/plugin/uts-plugin.html#dependencies)
+ * 2、直接引入,将 三方库的aar或jar文件 放到libs目录下。更多信息[详见](https://uniapp.dcloud.net.cn/plugin/uts-plugin.html#android%E5%B9%B3%E5%8F%B0%E5%8E%9F%E7%94%9F%E9%85%8D%E7%BD%AE)
+ *
+ * 在通过上述任意方式依赖三方库后,使用时需要在文件中 import,如下示例:
+ * import { LottieAnimationView } from 'com.airbnb.lottie.LottieAnimationView'
+ */
+
+/**
+ * UTSAndroid 为平台内置对象,不需要 import 可直接调用其API,[详见](https://uniapp.dcloud.net.cn/uts/utsandroid.html#utsandroid)
+ */
+
+
+/**
+ * 异步方法
+ *
+ * uni-app项目中(vue/nvue)调用示例:
+ * 1、引入方法声明 import { myApi } from "@/uni_modules/uts-api"
+ * 2、方法调用
+ * myApi({
+ * paramA: false,
+ * complete: (res) => {
+ * console.log(res)
+ * }
+ * });
+ * uni-app x项目(uvue)中调用示例:
+ * 1、引入方法及参数声明 import { myApi, MyApiOptions } from "@/uni_modules/uts-api";
+ * 2、方法调用
+ * let options = {
+ * paramA: false,
+ * complete: (res : any) => {
+ * console.log(res)
+ * }
+ * } as MyApiOptions;
+ * myApi(options);
+ *
+ */
+export const myApi : MyApi = function (options : MyApiOptions) {
+ if (options.paramA == true) {
+ // 返回数据
+ const res : MyApiResult = {
+ fieldA: 85,
+ fieldB: true,
+ fieldC: 'some message'
+ };
+ options.success?.(res);
+ options.complete?.(res);
+ } else {
+ // 返回错误
+ const err = new MyApiFailImpl(9010001);
+ options.fail?.(err)
+ options.complete?.(err)
+ }
+}
+
+/**
+ * 同步方法
+ *
+ * uni-app项目中(vue/nvue)调用示例:
+ * 1、引入方法声明 import { myApiSync } from "@/uni_modules/uts-api"
+ * 2、方法调用 myApiSync(true)
+ *
+ * uni-app x项目(uvue)中调用示例:
+ * 1、引入方法及参数声明 import { myApiSync } from "@/uni_modules/uts-api";
+ * 2、方法调用 myApiSync(true)
+ */
+export const myApiSync : MyApiSync = function (paramA : boolean) : MyApiResult {
+ // 返回数据,根据插件功能获取实际的返回值
+ const res : MyApiResult = {
+ fieldA: 85,
+ fieldB: paramA,
+ fieldC: 'some message'
+ };
+ return res;
+}
+
+// 目前装饰器不支持 export const test:Test = ()=>{} // 这种导出方式,需要使用export function test(){}
+// @UTSJS.keepAlive
+// export const scanRegister : ScanRegister = function (callback: OnScanReceiverCallback) {
+// const sbr = ScanBroadcastReceiver.getInstance(UTSAndroid.getAppContext());
+// sbr.registerReceiver(callback);
+// }
+
+@UTSJS.keepAlive
+export function scanRegister(callback: OnScanReceiverCallback) {
+ const sbr = ScanBroadcastReceiver.getInstance(UTSAndroid.getAppContext());
+ sbr.registerReceiver(callback);
+}
+
+export const scanUnRegister : ScanUnRegister = function () {
+ const sbr = ScanBroadcastReceiver.getInstance(UTSAndroid.getAppContext());
+ sbr.unregisterReceiver();
+}
+
+
diff --git a/uni_modules/zzjc-urovo/utssdk/app-android/libs/platform_sdk_v3.1.0326.jar b/uni_modules/zzjc-urovo/utssdk/app-android/libs/platform_sdk_v3.1.0326.jar
new file mode 100644
index 0000000..940bfb0
Binary files /dev/null and b/uni_modules/zzjc-urovo/utssdk/app-android/libs/platform_sdk_v3.1.0326.jar differ
diff --git a/uni_modules/zzjc-urovo/utssdk/app-android/scan/ScanBroadcastReceiver.uts b/uni_modules/zzjc-urovo/utssdk/app-android/scan/ScanBroadcastReceiver.uts
new file mode 100644
index 0000000..f9ca85f
--- /dev/null
+++ b/uni_modules/zzjc-urovo/utssdk/app-android/scan/ScanBroadcastReceiver.uts
@@ -0,0 +1,86 @@
+import Activity from 'android.app.Activity';
+import IntentFilter from 'android.content.IntentFilter';
+import BroadcastReceiver from 'android.content.BroadcastReceiver';
+import Context from 'android.content.Context';
+import Intent from 'android.content.Intent';
+
+import ScanManager from 'android.device.ScanManager';
+import PropertyID from 'android.device.scanner.configuration.PropertyID';
+
+import { OnScanReceiverCallback } from '../../interface.uts';
+
+export default class ScanBroadcastReceiver {
+ private static instance : ScanBroadcastReceiver = new ScanBroadcastReceiver();
+
+ private context : Context | null = null;
+
+ private scanBroadcastReceiver: UrovoScanBroadcastReceiver | null = null;
+
+ private scanManager: ScanManager | null = null;
+
+ private intentFilter: IntentFilter | null = null;
+
+ private constructor() {
+ }
+
+ static getInstance(context : Context | null) : ScanBroadcastReceiver {
+ ScanBroadcastReceiver.instance.context = context;
+ return ScanBroadcastReceiver.instance;
+ }
+
+ registerReceiver(callback: OnScanReceiverCallback) {
+ this.scanBroadcastReceiver = new UrovoScanBroadcastReceiver(callback);
+ if(this.scanManager == null) {
+ this.scanManager = new ScanManager();
+ this.scanManager!.openScanner();
+ this.scanManager!.switchOutputMode(0);
+ }
+ this.intentFilter = new IntentFilter();
+ let idbuf = intArrayOf(PropertyID.WEDGE_INTENT_ACTION_NAME, PropertyID.WEDGE_INTENT_DATA_STRING_TAG);
+ let value_buf = this.scanManager!.getParameterString(idbuf);
+ if (value_buf != null && value_buf[0] != null && !value_buf[0].equals("")) {
+ this.intentFilter!.addAction(value_buf[0]);
+ } else {
+ this.intentFilter!.addAction(ScanManager.ACTION_DECODE);
+ }
+ //this.intentFilter!.addAction(ScanManager.ACTION_CAPTURE_IMAGE);
+
+ UTSAndroid.getUniActivity()!.registerReceiver(this.scanBroadcastReceiver, this.intentFilter);
+ }
+
+ unregisterReceiver () {
+ let uniActivity: Activity | null = UTSAndroid.getUniActivity();
+ if(this.scanBroadcastReceiver != null) {
+ uniActivity!.unregisterReceiver(this.scanBroadcastReceiver);
+ }
+
+ //停止扫描
+ if (this.scanManager != null){
+ this.scanManager?.stopDecode();
+ }
+
+ this.scanBroadcastReceiver = null;
+ }
+}
+
+class UrovoScanBroadcastReceiver extends BroadcastReceiver {
+
+ private callback: OnScanReceiverCallback;
+
+ constructor(callback: OnScanReceiverCallback) {
+ super();
+ this.callback = callback;
+ }
+
+ override onReceive(context : Context, intent : Intent) {
+ let barcode = intent.getByteArrayExtra(ScanManager.DECODE_DATA_TAG);
+ let barcodelen = intent.getIntExtra(ScanManager.BARCODE_LENGTH_TAG, 0);
+ let temp = intent.getByteExtra(ScanManager.BARCODE_TYPE_TAG, 0);
+ console.log("----codetype--:" + temp);
+ if(barcode != null) {
+ let barcodeStr : string = new String(barcode, 0, barcodelen.toInt());
+ this.callback(barcodeStr);
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/uni_modules/zzjc-urovo/utssdk/app-ios/config.json b/uni_modules/zzjc-urovo/utssdk/app-ios/config.json
new file mode 100644
index 0000000..721b81e
--- /dev/null
+++ b/uni_modules/zzjc-urovo/utssdk/app-ios/config.json
@@ -0,0 +1,3 @@
+{
+ "deploymentTarget": "9"
+}
\ No newline at end of file
diff --git a/uni_modules/zzjc-urovo/utssdk/app-ios/index.uts b/uni_modules/zzjc-urovo/utssdk/app-ios/index.uts
new file mode 100644
index 0000000..c24f8c2
--- /dev/null
+++ b/uni_modules/zzjc-urovo/utssdk/app-ios/index.uts
@@ -0,0 +1,85 @@
+/**
+ * 引用 iOS 系统库,示例如下:
+ * import { UIDevice } from "UIKit";
+ * [可选实现,按需引入]
+ */
+
+/* 引入 interface.uts 文件中定义的变量 */
+import { MyApiOptions, MyApiResult, MyApi, MyApiSync } from '../interface.uts';
+
+/* 引入 unierror.uts 文件中定义的变量 */
+import { MyApiFailImpl } from '../unierror';
+
+/**
+ * 引入三方库
+ * [可选实现,按需引入]
+ *
+ * 在 iOS 平台引入三方库有以下两种方式:
+ * 1、通过引入三方库framework 或者.a 等方式,需要将 .framework 放到 ./Frameworks 目录下,将.a 放到 ./Libs 目录下。更多信息[详见](https://uniapp.dcloud.net.cn/plugin/uts-plugin.html#ios-平台原生配置)
+ * 2、通过 cocoaPods 方式引入,将要引入的 pod 信息配置到 config.json 文件下的 dependencies-pods 字段下。详细配置方式[详见](https://uniapp.dcloud.net.cn/plugin/uts-ios-cocoapods.html)
+ *
+ * 在通过上述任意方式依赖三方库后,使用时需要在文件中 import:
+ * 示例:import { LottieLoopMode } from 'Lottie'
+ */
+
+/**
+ * UTSiOS 为平台内置对象,不需要 import 可直接调用其API,[详见](https://uniapp.dcloud.net.cn/uts/utsios.html)
+ */
+
+/**
+ * 异步方法
+ *
+ * uni-app项目中(vue/nvue)调用示例:
+ * 1、引入方法声明 import { myApi } from "@/uni_modules/uts-api"
+ * 2、方法调用
+ * myApi({
+ * paramA: false,
+ * complete: (res) => {
+ * console.log(res)
+ * }
+ * });
+ *
+ */
+export const myApi : MyApi = function (options : MyApiOptions) {
+
+ if (options.paramA == true) {
+ // 返回数据
+ const res : MyApiResult = {
+ fieldA: 85,
+ fieldB: true,
+ fieldC: 'some message'
+ };
+ options.success?.(res);
+ options.complete?.(res);
+
+ } else {
+ // 返回错误
+ let failResult = new MyApiFailImpl(9010001);
+ options.fail?.(failResult)
+ options.complete?.(failResult)
+ }
+
+}
+
+/**
+ * 同步方法
+ *
+ * uni-app项目中(vue/nvue)调用示例:
+ * 1、引入方法声明 import { myApiSync } from "@/uni_modules/uts-api"
+ * 2、方法调用
+ * myApiSync(true);
+ *
+ */
+export const myApiSync : MyApiSync = function (paramA : boolean) : MyApiResult {
+ // 返回数据,根据插件功能获取实际的返回值
+ const res : MyApiResult = {
+ fieldA: 85,
+ fieldB: paramA,
+ fieldC: 'some message'
+ };
+ return res;
+}
+
+/**
+ * 更多插件开发的信息详见:https://uniapp.dcloud.net.cn/plugin/uts-plugin.html
+ */
diff --git a/uni_modules/zzjc-urovo/utssdk/interface.uts b/uni_modules/zzjc-urovo/utssdk/interface.uts
new file mode 100644
index 0000000..a1d8023
--- /dev/null
+++ b/uni_modules/zzjc-urovo/utssdk/interface.uts
@@ -0,0 +1,54 @@
+/**
+ * interface.uts
+ * uts插件接口定义文件,按规范定义接口文件可以在HBuilderX中更好的做到语法提示
+ */
+
+/**
+ * myApi 异步函数的参数,在type里定义函数需要的参数以及api成功、失败的相关回调函数。
+ */
+export type MyApiOptions = {
+ paramA : boolean
+ success ?: (res : MyApiResult) => void
+ fail ?: (res : MyApiFail) => void
+ complete ?: (res : any) => void
+}
+
+/**
+ * 函数返回结果
+ * 可以是void, 基本数据类型,自定义type, 或者其他类型。
+ * [可选实现]
+ */
+export type MyApiResult = {
+ fieldA : number,
+ fieldB : boolean,
+ fieldC : string
+}
+
+/**
+ * 错误码
+ * 根据uni错误码规范要求,建议错误码以90开头,以下是错误码示例:
+ * - 9010001 错误信息1
+ * - 9010002 错误信息2
+ */
+export type MyApiErrorCode = 9010001 | 9010002;
+/**
+ * myApi 的错误回调参数
+ */
+export interface MyApiFail extends IUniError {
+ errCode : MyApiErrorCode
+};
+
+/* 异步函数定义 */
+export type MyApi = (options : MyApiOptions) => void
+
+/* 同步函数定义 */
+export type MyApiSync = (paramA : boolean) => MyApiResult
+
+/* 扫码接收回调 */
+export type OnScanReceiverCallback = (data: string) => void;
+
+/* 扫码注册 */
+export type ScanRegister = (callback : OnScanReceiverCallback) => void
+
+/* 扫码卸载 */
+export type ScanUnRegister = () => void
\ No newline at end of file
diff --git a/uni_modules/zzjc-urovo/utssdk/unierror.uts b/uni_modules/zzjc-urovo/utssdk/unierror.uts
new file mode 100644
index 0000000..da0ff8b
--- /dev/null
+++ b/uni_modules/zzjc-urovo/utssdk/unierror.uts
@@ -0,0 +1,39 @@
+/* 此规范为 uni 规范,可以按照自己的需要选择是否实现 */
+import { MyApiErrorCode, MyApiFail } from "./interface.uts"
+/**
+ * 错误主题
+ * 注意:错误主题一般为插件名称,每个组件不同,需要使用时请更改。
+ * [可选实现]
+ */
+export const UniErrorSubject = 'zzjc-urovo';
+
+
+/**
+ * 错误信息
+ * @UniError
+ * [可选实现]
+ */
+export const MyAPIErrors : Map = new Map([
+ /**
+ * 错误码及对应的错误信息
+ */
+ [9010001, 'custom error mseeage1'],
+ [9010002, 'custom error mseeage2'],
+]);
+
+
+/**
+ * 错误对象实现
+ */
+export class MyApiFailImpl extends UniError implements MyApiFail {
+
+ /**
+ * 错误对象构造函数
+ */
+ constructor(errCode : MyApiErrorCode) {
+ super();
+ this.errSubject = UniErrorSubject;
+ this.errCode = errCode;
+ this.errMsg = MyAPIErrors.get(errCode) ?? "";
+ }
+}