diff --git a/App.vue b/App.vue index ca77364..26d8505 100644 --- a/App.vue +++ b/App.vue @@ -1,13 +1,13 @@ diff --git a/manifest.json b/manifest.json index 7a468ce..37c36e6 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "appid" : "__UNI__44D25EC", "description" : "", "versionName" : "1.0.0", - "versionCode" : "100", + "versionCode" : 101, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { @@ -38,12 +38,67 @@ "", "", "" - ] + ], + "minSdkVersion" : 21, + "targetSdkVersion" : 28 }, /* ios打包配置 */ - "ios" : {}, + "ios" : { + "dSYMs" : false + }, /* SDK配置 */ - "sdkConfigs" : {} + "sdkConfigs" : { + "ad" : {} + } + }, + "nativePlugins" : { + "Mpaas-Scan" : { + "AppId" : "ALIPUB292A079010931", + "License" : "KXaY6vzdsbbpso9o+9XOdpbiWPfgWstqa2NFfXVxEJZ4sVFaH33wvGUvLELnwibqFU3LEeWQPm+nW5TOfHNIOVnrUVji+bZoDuRTvPGFnVupqKpZRiF3kNB76pXHy9LuqAkH0h/eI44ZapbQNj15/Jma4WR5bffSdNKuTUnbDiaQSpBp9A38TGeWJ222eQL+RjGvFm15MZntBou93IspOnN58cDAvk75A6hUydJupKqYDl7UgQurm5pRKvB0UMYQOFcymuUVJH6N8a8pyJkvgP98oy3MskMcdJtYAzbjbdQi8/4ZuhPwbjqhVqzM3Pq2ebA2QcH/zbGT4LuvnQKXLw==", + "WorkspaceId" : "default", + "__plugin_info__" : { + "name" : "支付宝原生扫码插件", + "description" : "支付宝原生扫码组件,包体积仅0.7MB,15分钟即可完成接入。同时,mPaaS提供「扫码分析」大盘", + "platforms" : "Android,iOS", + "url" : "https://ext.dcloud.net.cn/plugin?id=2636", + "android_package_name" : "uni.UNI44D25EC", + "ios_bundle_id" : "", + "isCloud" : true, + "bought" : 1, + "pid" : "2636", + "parameters" : { + "AppId" : { + "des" : "Android平台的AppId,请填写Android的config文件中的appId对应的值", + "key" : "mobilegw.appid", + "value" : "" + }, + "License" : { + "des" : "Android平台的License,,请填写Android的config文件中的mpaasConfigLicense对应的值", + "key" : "mpaasConfigLicense", + "value" : "" + }, + "WorkspaceId" : { + "des" : "Android平台的WorkspaceId,请填写Android的config文件中的workspaceId对应的值", + "key" : "workspaceId", + "value" : "" + } + } + } + }, + "scanCode" : { + "__plugin_info__" : { + "name" : "scanCode", + "description" : "测试插件流程", + "platforms" : "Android", + "url" : "", + "android_package_name" : "", + "ios_bundle_id" : "", + "isCloud" : false, + "bought" : -1, + "pid" : "", + "parameters" : {} + } + } } }, /* 快应用特有相关 */ diff --git a/nativeplugins/test/android/scanCode-release.aar b/nativeplugins/test/android/scanCode-release.aar new file mode 100644 index 0000000..16bdba2 Binary files /dev/null and b/nativeplugins/test/android/scanCode-release.aar differ diff --git a/pages/scan/Book.vue b/pages/scan/Book.vue index 53fc598..7801124 100644 --- a/pages/scan/Book.vue +++ b/pages/scan/Book.vue @@ -54,10 +54,13 @@ } }, onLoad() { - + this.loadPage(); }, methods: { - + + loadPage(){ + console.log('11111') + } } } diff --git a/pages/scan/Scan.vue b/pages/scan/Scan.nvue similarity index 55% rename from pages/scan/Scan.vue rename to pages/scan/Scan.nvue index 7234583..d65b9bb 100644 --- a/pages/scan/Scan.vue +++ b/pages/scan/Scan.nvue @@ -1,13 +1,9 @@ @@ -29,10 +28,23 @@ title: 'Scan' } }, - onLoad() { - + created() { + // this.scanCode(); }, methods: { + + testAdd(){ + const testModule = uni.requireNativePlugin('scanCode'); + testModule.add({ + a:1, + b:2 + },res => { + uni.showToast({ + title: '提示', + content: JSON.stringify(res) + }) + }) + }, //根据扫码返回结果判断跳转到哪个指定页面 jumpToPage(url){ uni.navigateTo({ @@ -41,20 +53,41 @@ }, //扫码 - scanCode(){ - // 允许从相机和相册扫码 - uni.scanCode({ - success: function (res) { - console.log('条码类型:' + res.scanType); - console.log('条码内容:' + res.result); - } - }); - } + // scanCode(){ + // // 允许从相机和相册扫码 + // uni.scanCode({ + // success: function (res) { + // console.log(JSON.stringify(res)) + // console.log('条码类型:' + res.scanType); + // console.log('条码内容:' + res.result); + // } + // }); + // } + + scanCode() { + var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module") + mpaasScanModule.mpaasScan({ + // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有 + // 'scanType': ['qrCode', 'barCode'], + // 是否隐藏相册,默认false不隐藏 + 'hideAlbum': false, + }, + (ret) => { + console.log(JSON.stringify(ret)) + this.$refs.toast.show({ + title: '支付成功', + content: JSON.stringify(ret), + icon: 'success', + duration: 2000 + }); + console.log('24123123') + }) + }, } } -