From 206da6685f953ba538b6601c5456ad63595728af Mon Sep 17 00:00:00 2001 From: jscyl13849007907 <13849007907@163.com> Date: Wed, 18 Jun 2025 10:04:06 +0800 Subject: [PATCH] no message --- components/empty.vue | 2 +- components/list/apply.vue | 2 +- components/list/job copy.vue | 2 +- components/list/job.vue | 4 +- components/panel/tabbar.vue | 21 - package-lock.json | 13 +- package.json | 3 +- pages.json | 60 +-- pages/NEUIKit/App.vue | 4 +- pages/message/index.vue | 2 +- pages/person/index.vue | 6 +- pages/workBench/index.vue | 24 +- root/NEUIKit/App.vue | 4 +- root/NEUIKit/pages/index/index.vue | 2 +- root/detail/job copy.vue | 2 +- root/detail/job.vue | 2 +- root/home/applicationSuccess.vue | 2 +- .../apply/index.vue => root/person/applyIndex.vue | 2 +- pages/bill/index.vue => root/person/billIndex.vue | 0 root/person/creatSuccess.vue | 2 +- .../login/index.vue => root/person/loginIndex.vue | 0 root/person/memberApplyAdd.vue | 2 +- root/person/pwdForget.vue | 2 +- root/person/pwdForget1.vue | 2 +- root/person/pwdLogin.vue | 2 +- root/person/set.vue | 2 +- uni_modules/Recorder-UniCore/app-uni-support.js | 2 - uni_modules/Recorder-UniCore/changelog.md | 19 - .../Recorder-UniCore/Recorder-UniCore.vue | 6 - uni_modules/Recorder-UniCore/license.md | 19 - uni_modules/Recorder-UniCore/package.json | 88 ----- uni_modules/Recorder-UniCore/readme.md | 425 --------------------- utils/ajax.js | 4 +- utils/common.js | 2 +- utils/wyyx.js | 4 +- 35 files changed, 73 insertions(+), 665 deletions(-) rename pages/apply/index.vue => root/person/applyIndex.vue (99%) rename pages/bill/index.vue => root/person/billIndex.vue (100%) rename pages/login/index.vue => root/person/loginIndex.vue (100%) delete mode 100644 uni_modules/Recorder-UniCore/app-uni-support.js delete mode 100644 uni_modules/Recorder-UniCore/changelog.md delete mode 100644 uni_modules/Recorder-UniCore/components/Recorder-UniCore/Recorder-UniCore.vue delete mode 100644 uni_modules/Recorder-UniCore/license.md delete mode 100644 uni_modules/Recorder-UniCore/package.json delete mode 100644 uni_modules/Recorder-UniCore/readme.md diff --git a/components/empty.vue b/components/empty.vue index 426765d..9be65c4 100644 --- a/components/empty.vue +++ b/components/empty.vue @@ -39,7 +39,7 @@ let that = this; if(that.text == '请登录'){ uni.reLaunch({ - url: '/pages/login/index?path=' + that.G.getPath().path + '&level=' + that.G.getPath().level + url: '/root/person/loginIndex?path=' + that.G.getPath().path + '&level=' + that.G.getPath().level }); } } diff --git a/components/list/apply.vue b/components/list/apply.vue index 6cc4337..1e4a6ac 100644 --- a/components/list/apply.vue +++ b/components/list/apply.vue @@ -145,7 +145,7 @@ export default { }, goLogin() { uni.reLaunch({ - url: "/pages/login/index", + url: "/root/person/loginIndex", }); }, goTel($item) { diff --git a/components/list/job copy.vue b/components/list/job copy.vue index 225d76b..6a04c79 100644 --- a/components/list/job copy.vue +++ b/components/list/job copy.vue @@ -545,7 +545,7 @@ export default { }, goLogin() { uni.reLaunch({ - url: "/pages/login/index", + url: "/root/person/loginIndex", }); }, }, diff --git a/components/list/job.vue b/components/list/job.vue index 88a11ac..e65bd7b 100644 --- a/components/list/job.vue +++ b/components/list/job.vue @@ -362,7 +362,7 @@ export default { }, goLogin() { uni.reLaunch({ - url: "/pages/login/index", + url: "/root/person/loginIndex", }); }, openApplyPop($item) { @@ -450,7 +450,7 @@ export default { success(res) { if (res.confirm) { uni.navigateTo({ - url: "/pages/login/index", + url: "/root/person/loginIndex", }); } else { } diff --git a/components/panel/tabbar.vue b/components/panel/tabbar.vue index c29abd2..5f8698c 100644 --- a/components/panel/tabbar.vue +++ b/components/panel/tabbar.vue @@ -45,20 +45,6 @@ customIcon: false, pagePath:"/pages/home/index", }, - { - iconPath: this.cdnBaseImg + 'bill.png', - selectedIconPath: this.cdnBaseImg + 'billActive.png', - text: '发单', - customIcon: false, - pagePath:"/pages/bill/index", - }, - { - iconPath: this.cdnBaseImg + 'apply.png', - selectedIconPath: this.cdnBaseImg + 'applyActive.png', - text: '工单', - customIcon: false, - pagePath:"/pages/apply/index", - }, { iconPath: this.cdnBaseImg + 'person.png', selectedIconPath: this.cdnBaseImg + 'personActive.png', @@ -78,13 +64,6 @@ customIcon: false, pagePath:"/pages/home/index", }, - { - iconPath: this.cdnBaseImg + 'apply.png', - selectedIconPath: this.cdnBaseImg + 'applyActive.png', - text: '工单', - customIcon: false, - pagePath:"/pages/apply/index", - }, { iconPath: this.cdnBaseImg + 'person.png', selectedIconPath: this.cdnBaseImg + 'personActive.png', diff --git a/package-lock.json b/package-lock.json index d9d0657..640656a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,8 +16,7 @@ "html2canvas": "^1.4.1", "mobx": "^6.6.1", "nim-web-sdk-ng": "^10.4.0", - "pinyin": "^3.1.0", - "recorder-core": "^1.3.25011100" + "pinyin": "^3.1.0" }, "devDependencies": { "file-saver": "^2.0.5", @@ -1858,11 +1857,6 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/recorder-core": { - "version": "1.3.25011100", - "resolved": "https://registry.npmmirror.com/recorder-core/-/recorder-core-1.3.25011100.tgz", - "integrity": "sha512-trXsCH0zurhoizT4Z22C0OsM0SDOW+2OvtgRxeLQFwxoFeqFjDjYZsbZEZUiKMJLhBvamI4K7Ic+qZ2LBo74TA==" - }, "node_modules/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmmirror.com/require-from-string/-/require-from-string-2.0.2.tgz", @@ -3416,11 +3410,6 @@ "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", "dev": true }, - "recorder-core": { - "version": "1.3.25011100", - "resolved": "https://registry.npmmirror.com/recorder-core/-/recorder-core-1.3.25011100.tgz", - "integrity": "sha512-trXsCH0zurhoizT4Z22C0OsM0SDOW+2OvtgRxeLQFwxoFeqFjDjYZsbZEZUiKMJLhBvamI4K7Ic+qZ2LBo74TA==" - }, "require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmmirror.com/require-from-string/-/require-from-string-2.0.2.tgz", diff --git a/package.json b/package.json index dbb37c5..9f5edee 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,7 @@ "fetch-event-source": "^1.0.0-alpha.2", "mobx": "^6.6.1", "nim-web-sdk-ng": "^10.4.0", - "pinyin": "^3.1.0", - "recorder-core": "^1.3.25011100" + "pinyin": "^3.1.0" }, "devDependencies": { "file-saver": "^2.0.5", diff --git a/pages.json b/pages.json index ffff480..cad5075 100644 --- a/pages.json +++ b/pages.json @@ -8,15 +8,6 @@ "backgroundColorTop": "#caf1e0" } }, - { - "path": "pages/apply/index", - "style": { - "navigationBarTitleText": "工单", - "backgroundColor": "#ededed", - "backgroundColorTop": "#ededed", - "backgroundColorBottom": "#ededed" - } - }, { "path": "pages/message/index", "style": { @@ -35,27 +26,12 @@ "backgroundColorBottom": "#ededed" } }, - { - "path": "pages/bill/index", - "style": { - "navigationBarTitleText": "我的职位", - "backgroundColor": "#ededed", - "backgroundColorTop": "#ededed", - "backgroundColorBottom": "#ededed" - } - }, - { - "path": "pages/person/index", - "style": { - "navigationBarTitleText": "我的" - } - }, - { - "path": "pages/login/index", - "style": { - "navigationBarTitleText": "登录" - } - } + { + "path": "pages/person/index", + "style": { + "navigationBarTitleText": "我的" + } + } ], "subPackages": [ { // 首页 @@ -103,6 +79,30 @@ { // 个人中心二级页面 "root": "root/person", "pages": [ + { + "path": "billIndex", + "style": { + "navigationBarTitleText": "我的职位", + "backgroundColor": "#ededed", + "backgroundColorTop": "#ededed", + "backgroundColorBottom": "#ededed" + } + }, + { + "path": "applyIndex", + "style": { + "navigationBarTitleText": "工单", + "backgroundColor": "#ededed", + "backgroundColorTop": "#ededed", + "backgroundColorBottom": "#ededed" + } + }, + { + "path": "loginIndex", + "style": { + "navigationBarTitleText": "登录" + } + }, { "path": "set", "style": { diff --git a/pages/NEUIKit/App.vue b/pages/NEUIKit/App.vue index b6d7658..3496cca 100644 --- a/pages/NEUIKit/App.vue +++ b/pages/NEUIKit/App.vue @@ -43,7 +43,7 @@ export default { } else { // 需要登录 im customRedirectTo({ - url: isWxApp ? "/pages/index/index" : "/pages/Login/index", + url: isWxApp ? "/pages/index/index" : "/root/person/loginIndex", }); } }, @@ -296,7 +296,7 @@ export default { uni.$UIKitNIM.V2NIMLoginService.logout().then(() => { uni.$UIKitStore.destroy(); customReLaunch({ - url: "/pages/Login/index", + url: "/root/person/loginIndex", }); }); }, diff --git a/pages/message/index.vue b/pages/message/index.vue index 6e352fb..610635a 100644 --- a/pages/message/index.vue +++ b/pages/message/index.vue @@ -141,7 +141,7 @@ onShow(() => { }); const goLogin = () => { uni.reLaunch({ - url: "/pages/login/index", + url: "/root/person/loginIndex", }); }; const goPage = ($path) => { diff --git a/pages/person/index.vue b/pages/person/index.vue index 6784e0b..4278b8c 100644 --- a/pages/person/index.vue +++ b/pages/person/index.vue @@ -188,7 +188,7 @@ export default { { icon: "icon-zhiweiguanli", name: "我的职位", - path: "/pages/bill/index", + path: "/root/person/billIndex", }, { icon: "icon-fazhandaili1", @@ -468,12 +468,12 @@ export default { switch (item.name) { case "全部职位": uni.navigateTo({ - url: "/pages/bill/index", + url: "/root/person/billIndex", }); break; case "在招职位": uni.navigateTo({ - url: "/pages/bill/index?active=1", + url: "/root/person/billIndex?active=1", }); break; case "关注": diff --git a/pages/workBench/index.vue b/pages/workBench/index.vue index 9d1b55b..2c8ae98 100644 --- a/pages/workBench/index.vue +++ b/pages/workBench/index.vue @@ -36,7 +36,7 @@ - + @@ -158,27 +158,27 @@ export default { { name: "审核中", num: 0, - path: "/pages/apply/index?status=1", + path: "/root/person/applyIndex?status=1", }, { name: "待接待", num: 0, - path: "/pages/apply/index?status=2", + path: "/root/person/applyIndex?status=2", }, { name: "待面试", num: 0, - path: "/pages/apply/index?status=3", + path: "/root/person/applyIndex?status=3", }, { name: "待入职", num: 0, - path: "/pages/apply/index?status=4", + path: "/root/person/applyIndex?status=4", }, { name: "在职中", num: 0, - path: "/pages/apply/index?status=5", + path: "/root/person/applyIndex?status=5", }, ], query: { @@ -269,27 +269,27 @@ export default { { name: "审核中", num: that.map.classify2num.num10 || 0, - path: "/pages/apply/index?status=1", + path: "/root/person/applyIndex?status=1", }, { name: "待接待", num: that.map.classify2num.num20 || 0, - path: "/pages/apply/index?status=2", + path: "/root/person/applyIndex?status=2", }, { name: "待面试", num: that.map.classify2num.num25 || 0, - path: "/pages/apply/index?status=3", + path: "/root/person/applyIndex?status=3", }, { name: "待入职", num: that.map.classify2num.num30 || 0, - path: "/pages/apply/index?status=4", + path: "/root/person/applyIndex?status=4", }, { name: "在职中", num: that.map.classify2num.num40 || 0, - path: "/pages/apply/index?status=5", + path: "/root/person/applyIndex?status=5", }, ]; }); @@ -342,7 +342,7 @@ export default { goLogin() { console.log("123"); uni.reLaunch({ - url: "/pages/login/index", + url: "/root/person/loginIndex", }); }, goPage(url) { diff --git a/root/NEUIKit/App.vue b/root/NEUIKit/App.vue index 57acda1..76a1a49 100644 --- a/root/NEUIKit/App.vue +++ b/root/NEUIKit/App.vue @@ -43,7 +43,7 @@ export default { } else { // 需要登录 im customRedirectTo({ - url: isWxApp ? "/pages/index/index" : "/pages/Login/index", + url: isWxApp ? "/pages/index/index" : "/root/person/loginIndex", }); } }, @@ -296,7 +296,7 @@ export default { uni.$UIKitNIM.V2NIMLoginService.logout().then(() => { uni.$UIKitStore.destroy(); customReLaunch({ - url: "/pages/Login/index", + url: "/root/person/loginIndex", }); }); }, diff --git a/root/NEUIKit/pages/index/index.vue b/root/NEUIKit/pages/index/index.vue index 1cf812c..e805236 100644 --- a/root/NEUIKit/pages/index/index.vue +++ b/root/NEUIKit/pages/index/index.vue @@ -25,7 +25,7 @@ import { customRedirectTo } from '../../utils/customNavigate' const onLogin = () => { - customRedirectTo({ url: '/pages/Login/index' }) + customRedirectTo({ url: '/root/person/loginIndex' }) } diff --git a/root/detail/job copy.vue b/root/detail/job copy.vue index 57461d7..2eccb13 100644 --- a/root/detail/job copy.vue +++ b/root/detail/job copy.vue @@ -489,7 +489,7 @@ export default { if (!uni.getStorageSync("apply-token")) { console.log("apply-token"); uni.navigateTo({ - url: "/pages/login/index?type=detail&id=" + options.id, + url: "/root/person/loginIndex?type=detail&id=" + options.id, }); return; } diff --git a/root/detail/job.vue b/root/detail/job.vue index 4641e5d..a838f55 100644 --- a/root/detail/job.vue +++ b/root/detail/job.vue @@ -654,7 +654,7 @@ export default { if (!uni.getStorageSync("apply-token")) { console.log("apply-token"); uni.navigateTo({ - url: "/pages/login/index?type=detail&id=" + options.id, + url: "/root/person/loginIndex?type=detail&id=" + options.id, }); return; } diff --git a/root/home/applicationSuccess.vue b/root/home/applicationSuccess.vue index 50ced44..d99fba7 100644 --- a/root/home/applicationSuccess.vue +++ b/root/home/applicationSuccess.vue @@ -35,7 +35,7 @@ export default { goList() { uni.setStorageSync("apply-tab-active", 1); uni.navigateTo({ - url: "/pages/apply/index", + url: "/root/person/applyIndex", }); }, }, diff --git a/pages/apply/index.vue b/root/person/applyIndex.vue similarity index 99% rename from pages/apply/index.vue rename to root/person/applyIndex.vue index 94e0f96..d78411e 100644 --- a/pages/apply/index.vue +++ b/root/person/applyIndex.vue @@ -350,7 +350,7 @@ export default { }, goLogin() { uni.reLaunch({ - url: "/pages/login/index", + url: "/root/person/loginIndex", }); }, toMessage() { diff --git a/pages/bill/index.vue b/root/person/billIndex.vue similarity index 100% rename from pages/bill/index.vue rename to root/person/billIndex.vue diff --git a/root/person/creatSuccess.vue b/root/person/creatSuccess.vue index 79501bc..58bd995 100644 --- a/root/person/creatSuccess.vue +++ b/root/person/creatSuccess.vue @@ -38,7 +38,7 @@ export default { level: "", }; uni.reLaunch({ - url: "/pages/login/index?" + that.G.objToStr(params), + url: "/root/person/loginIndex?" + that.G.objToStr(params), }); }); // }); diff --git a/pages/login/index.vue b/root/person/loginIndex.vue similarity index 100% rename from pages/login/index.vue rename to root/person/loginIndex.vue diff --git a/root/person/memberApplyAdd.vue b/root/person/memberApplyAdd.vue index 71da931..b02df78 100644 --- a/root/person/memberApplyAdd.vue +++ b/root/person/memberApplyAdd.vue @@ -64,7 +64,7 @@ export default { uni.removeStorageSync("scene"); } else { // uni.reLaunch({ - // url: `/pages/login/index?path='/root1/person/memberApplyAdd'&scene=${options.scene}`, + // url: `/root/person/loginIndex?path='/root1/person/memberApplyAdd'&scene=${options.scene}`, // }); uni.setStorageSync("scene", options.scene); } diff --git a/root/person/pwdForget.vue b/root/person/pwdForget.vue index 88b5a05..e64a419 100644 --- a/root/person/pwdForget.vue +++ b/root/person/pwdForget.vue @@ -135,7 +135,7 @@ level:"", } uni.reLaunch({ - url: '/pages/login/index?' + that.G.objToStr(params) + url: '/root/person/loginIndex?' + that.G.objToStr(params) }); }) },1500) diff --git a/root/person/pwdForget1.vue b/root/person/pwdForget1.vue index 88b5a05..e64a419 100644 --- a/root/person/pwdForget1.vue +++ b/root/person/pwdForget1.vue @@ -135,7 +135,7 @@ level:"", } uni.reLaunch({ - url: '/pages/login/index?' + that.G.objToStr(params) + url: '/root/person/loginIndex?' + that.G.objToStr(params) }); }) },1500) diff --git a/root/person/pwdLogin.vue b/root/person/pwdLogin.vue index d688e7a..26bf28c 100644 --- a/root/person/pwdLogin.vue +++ b/root/person/pwdLogin.vue @@ -135,7 +135,7 @@ export default { level: "", }; uni.reLaunch({ - url: "/pages/login/index?" + that.G.objToStr(params), + url: "/root/person/loginIndex?" + that.G.objToStr(params), }); }); }, 1500); diff --git a/root/person/set.vue b/root/person/set.vue index 53d2155..a112ea7 100644 --- a/root/person/set.vue +++ b/root/person/set.vue @@ -155,7 +155,7 @@ export default { level: "", }; uni.reLaunch({ - url: "/pages/login/index?" + that.G.objToStr(params), + url: "/root/person/loginIndex?" + that.G.objToStr(params), }); }); } diff --git a/uni_modules/Recorder-UniCore/app-uni-support.js b/uni_modules/Recorder-UniCore/app-uni-support.js deleted file mode 100644 index 8f94685..0000000 --- a/uni_modules/Recorder-UniCore/app-uni-support.js +++ /dev/null @@ -1,2 +0,0 @@ - -!function(e){var t="object"==typeof window&&!!window.document,n=t?window:Object,i="https://github.com/xiangyuecn/Recorder/tree/master/app-support-sample/demo_UniApp";if(n.RecordApp){var r=n.Recorder,a=r.i18n;!function(S,h,e,W,B){"use strict";var P=h.RecordApp,j=P.CLog,I=function(){};P.UniSupportLM="2025-03-31 18:10";var N="app-uni-support.js",V=!1,M=!1,E=!1,O=!1,T=!1;(function(){/* #ifdef APP */if(B){V=!0;var e=navigator.userAgent.replace(/[_\d]/g," ");M=!/\bandroid\b/i.test(e)&&/\bios\b|\biphone\b/i.test(e)}else"object"==typeof plus&&("Android"==plus.os.name?V=!0:"iOS"==plus.os.name&&(M=V=!0)),(E=V)||j("App !plus",1)/* #endif */})(),V||((function(){/* #ifdef H5 */O=!0/* #endif */})(),(function(){/* #ifdef MP-WEIXIN */T=!0/* #endif */})());P.UniIsApp=function(){return V?M?2:1:0};var k=P.UniBtoa=function(e){if("object"==typeof uni&&uni.arrayBufferToBase64)return uni.arrayBufferToBase64(e);for(var t=new Uint8Array(e),n="",i=0,r=t.length;i=a[e(652)])o[e(443)](e(429)+s+e(306)+s+e(663)+i+e(541));else{var t=P[e(470)](l),n=u;u+=524288;var r=a[e(417)](n,u);o[e(443)](e(510)+s+e(378)+s+e(520)+a[e(652)]+e(392)+k(r)+e(307)+t+e(419))}};l()}else o[c(443)](c(422)+i+c(272))},P[_(536)]=function(e,t,n){var r=_,i="";r(471)==typeof t&&(i=t[r(518)]||"",t=t[r(490)]||"");var a="";a||E||(a=W(r(550)));var o=!a&&p(e,null==e);if(a||o||(a=W(r(null==e?656:601))),a)return a+=W(r(596)),j(a+r(593)+t[r(289)](0,200),1),a;P[r(413)](e,r(638)+i+r(451)+JSON[r(677)](W(r(330)))+r(248)+o+r(452)+JSON[r(677)](W(r(660)))+r(604)+JSON[r(677)](W(r(255)))+r(611)+t+r(531),n)},P[_(625)]=function(d,f,v,A){return new Promise(function(n,r){var i=y,a=(f=f||{})[i(685)]||"",o=-1==f[i(345)],t="",s=setTimeout(function(){var e=i;c(),s=0;var t=new Error(W(e(o?671:673),0,a));t[e(415)]=1,r(t)},o?2e3:f[i(345)]||5e3),c=function(){var e=P[i(457)];delete e[u],delete e[t]};o&&(t=P[i(470)](function(){clearTimeout(s)}));var e=function(e){var t=i;if(c(),s)return clearTimeout(s),s=0,e[t(565)]?n({value:e[t(397)],bigBytes:P[t(525)](e[t(565)])}):e[t(382)]?n(e[t(397)]):void r(new Error(a+e[t(597)]))},u=P[i(470)](e),l=i(662)+u+i(323)+u+i(521)+m+i(251)+u+i(337)+(o?i(542)+m+i(251)+t+i(614):"")+i(241)+JSON[i(677)](W(i(466)))+i(479)+JSON[i(677)](W(i(475),0,i(360)+N+'"'))+i(408);f[i(356)]?l+=v:l={preCode:l+=i(447),jsCode:v};var p=P[f[i(356)]?i(413):i(536)](d,l,A);p&&e({errMsg:p})})};var m=_(469),r=function(){var i=_;if(E&&i(352)!=typeof UniServiceJSBridge){var e=P[i(501)];if(e){var t="";try{t=uni[i(398)](m)}catch(e){}if(e==t)return;j(W(i(583)),3)}e="r"+Math[i(485)]();try{uni[i(317)](m,e)}catch(e){}P[i(501)]=e,UniServiceJSBridge[i(463)](m),UniServiceJSBridge[i(434)](m,function(e){var t=i,n=e[t(566)]||"";if(t(681)!=n)if(t(668)!=n)if(-1==n[t(355)](t(532)))-1==n[t(355)](t(559))?j(W(t(489))+JSON[t(677)](e),1):P[t(339)](e);else{var r=P[t(457)][n];r?r(e):j(W(t(516))+JSON[t(677)](e),3)}else J(e);else F(e)})}};P[_(470)]=function(t){var e=_,n=P[e(457)],r=++n.id,i=e(532)+r;return n[i]=function(e){delete n[i],t(e)},i},P[_(381)]=function(e,t){var n=_,r=P[n(457)],i=n(293)+e;return t?r[i]=t:delete r[i],i},P[_(312)]=function(e){UniViewJSBridge[_(249)](m,e)},P[_(245)]=function(r,i,e){var a=_;if(B&&V){var o=P[a(324)];if(o){r instanceof ArrayBuffer||(j(a(480),1),r[a(363)]instanceof ArrayBuffer&&(r=r[a(363)]));var s=P[a(457)],c=0,u=++s.id;s[a(559)+u]=function(e){c=e,t()};var l=0,t=function(){var e=a;if(0!=l&&l>=r[e(652)])return delete s[e(559)+u],void i(c);var t=l;l+=524288;var n=r[e(417)](t,l);P[e(312)]({action:e(t?438:605),wvCid:o,wvID:u,mainID:c,b64:k(n)})};t()}else e(W(a(373)))}else e(W(a(295)))},P[_(339)]=function(e){var t=_,n=e[t(445)],r=P[t(457)],i=t(559);t(605)==e[t(566)]&&(n=++r.id,r[i+n]={memory:new Uint8Array(2097152),mOffset:0});var a=r[i+n];if(a){var o=new Uint8Array(D(e[t(580)])),s=o[t(621)];if(a[t(319)]+s>a[t(511)][t(621)]){var c=new Uint8Array(a[t(511)][t(621)]+Math[t(680)](2097152,s));c[t(623)](a[t(511)][t(488)](0,a[t(319)])),a[t(511)]=c}a[t(511)][t(623)](o,a[t(319)]),a[t(319)]+=s,P[t(413)](f(e[t(610)]),t(420)+i+e[t(513)]+t(461)+n+t(572))}else j(W(t(472)),3)},P[_(525)]=function(e){var t=_;if(!E)return null;var n=P[t(457)],r=n[t(559)+e];return delete n[t(559)+e],r?r[t(511)][t(363)][t(417)](0,r[t(319)]):null},P[_(374)]=function(n,i,a,r){var o=_;a=a||I,r=r||I;var s=function(e){var t=y;r(W(t(404),0,n)+(e[t(395)]||e[t(597)]))};if(T){var e=wx[o(435)][o(282)]+"/"+n;wx[o(346)]()[o(341)]({filePath:e,encoding:o(269),data:i,success:function(){a(e)},fail:s})}else E?plus.io[o(499)](plus.io[o(684)],function(e){var t=o;e[t(425)][t(254)](n,{create:!0},function(n){var r=t;n[r(487)](function(e){var t=r;e[t(635)]=function(){a(n[t(642)])},e[t(553)]=s;try{e[t(259)](k(i))}catch(e){s(e)}},s)},s)},s):r(W(o(296)))};var i=function(e){var t=_;if(A(),E){var n=W(t(608),0,S),r=P[t(539)];r&&(!e&&P[t(637)]||(P[t(637)]=1,r[t(514)]?j(W(t(535))+n):j(W(t(257))+n))),P[t(275)]?r?!e&&P[t(334)]||(P[t(334)]=1,j(W(t(533))+n)):j(W(t(465))+n,1):P[t(598)]&&(P[t(322)]?!e&&P[t(493)]||(P[t(493)]=1,j(W(t(616))+n)):j(W(t(519))+a()+n,1))}},a=function(){return W(_(286))};P[_(405)]=function(e,t,n,a){var r=_,o=[],s=function(e){return W(y(561),0,e)};if(T){var c=function(n){var r=y;if(n>=t[r(621)])a[r(629)](e,o);else{var i=t[n];e[r(276)]()[r(299)](i)[r(409)]({node:!0})[r(423)](function(e){var t=r;e[0]?(o[t(367)](e[0][t(448)]),c(n+1)):j(s(i),1)})}};c(0)}else if(O){for(var i=2;i<=3;i++){var u=w(i,e[r(634)],r(431));if(!u)return;for(var l=0,p=t[r(621)];l - - Recorder-UniCore Vue Component - 无需手动显示本UI组件,只需在script中正常引入 RecordApp + app-uni-support.js 即可实现 H5、iOS Android App、微信小程序 多端录音 - - \ No newline at end of file diff --git a/uni_modules/Recorder-UniCore/license.md b/uni_modules/Recorder-UniCore/license.md deleted file mode 100644 index 89e0b74..0000000 --- a/uni_modules/Recorder-UniCore/license.md +++ /dev/null @@ -1,19 +0,0 @@ -《许可及服务协议》 - -**您(以下称“用户”)下载、使用我(以下称“作者”)提供的Recorder-UniCore组件(含原生录音插件、uts插件,以下统称“本组件”),应当阅读并遵守本许可协议。请用户务必审慎阅读、充分理解各条款内容,特别是免除或者限制责任的条款,并选择接受或不接受。除非用户已阅读并接受本协议所有条款,否则用户无权下载、使用本组件及相关服务,用户的下载、使用等行为即视为用户已阅读并同意本许可协议的约束。** - -1. 用户应当直接从作者许可的途径,如作者的GitHub、Gitee仓库、已上架的DCloud插件市场、QQ群等途径中获取本组件;其他途径获取到的组件代码是未经过作者授权的,存在安全隐患,可能会导致你的程序、资产受到侵害,作者对因此给用户造成的损失不予负责。 - -2. 作者将积极并采取措施保护用户的信息和隐私;组件本身不会搜集存储任何用户信息。 - -3. 除法律法规有明确规定外,作者将尽最大努力确保本组件及其所涉及的技术及信息安全、有效、准确、可靠,但受限于现有技术,用户理解作者不能对此进行担保。 - -4. 用户理解,对于不可抗力及第三方原因导致的您的直接或间接损失,作者无法承担责任。 - -5. 用户因使用本组件进行生成、处理数据,由此引起或与有关的包括但不限于利润损失、资料损失、业务中断的损害赔偿或其它商业损害赔偿或损失,需由用户自行承担。 - -6. 如若发生赔偿、退款等行为,赔偿、退款等累计金额不得超过用户实际支付给作者的总金额。 - -7. 已授予的授权许可,包括免费授权,和已购买的原生录音插件、uts插件,均仅限在授权指定的uni-app的应用标识(AppID)对应的项目上使用,不可在其他项目上使用;用户不得对本组件及其中的相关信息擅自出租、出借、销售、逆向工程、破解,不得在未取得作者授权的情况下借助本组件发展与本组件有关联的衍生软件产品、服务、插件、外挂等。 - -8. 用户不得使用本组件从事违反法律法规政策、破坏公序良俗、损害公共利益的行为。 diff --git a/uni_modules/Recorder-UniCore/package.json b/uni_modules/Recorder-UniCore/package.json deleted file mode 100644 index 7460a59..0000000 --- a/uni_modules/Recorder-UniCore/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "id": "Recorder-UniCore", - "displayName": "跨平台Recorder录音插件:支持多种格式、音频可视化、实时上传、语音识别", - "version": "1.0.250331", - "description": "支持H5、Android iOS App、微信小程序;mp3 wav pcm g711a g711u ogg amr 录音格式;实时帧回调处理 音频转码 波形动画显示 ASR语音转文字 无录制时长限制", - "keywords": [ - "Recorder-UniCore", - "recorder-core", - "RecordApp", - "record", - "recording" -], - "repository": "https://github.com/xiangyuecn/Recorder", - "engines": { - "HBuilderX": "^3.6.11" - }, -"dcloudext": { - "type": "component-vue", - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "753610399" - }, - "declaration": { - "ads": "无", - "data": "插件不采集任何数据", - "permissions": "录音权限" - }, - "npmurl": "" - }, - "uni_modules": { - "dependencies": [], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "n" - }, - "client": { - "Vue": { - "vue2": "y", - "vue3": "y" - }, - "App": { - "app-vue": "y", - "app-nvue": "y", - "app-uvue": "n", - "app-harmony": "u" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "n", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "n", - "百度": "n", - "字节跳动": "n", - "QQ": "n", - "钉钉": "n", - "快手": "n", - "飞书": "n", - "京东": "n" - }, - "快应用": { - "华为": "u", - "联盟": "u" - } - } - } - } -} \ No newline at end of file diff --git a/uni_modules/Recorder-UniCore/readme.md b/uni_modules/Recorder-UniCore/readme.md deleted file mode 100644 index ca2eafd..0000000 --- a/uni_modules/Recorder-UniCore/readme.md +++ /dev/null @@ -1,425 +0,0 @@ -*⠀* - -*⠀* - -# Recorder-UniCore组件:uni-app内使用RecordApp录音 - -本组件使用`Recorder`开源库来进行录音和音频数据处理,使用`RecordApp`和本组件内的`app-uni-support.js`来适配到不同平台环境下进行录音。 - -- 支持vue2、vue3、nvue -- 支持编译成:H5、Android App、iOS App、微信小程序 -- 支持已有的大部分录音格式:mp3、wav、pcm、amr、ogg、g711a、g711u等 -- 支持实时处理,包括变速变调、实时上传、ASR语音转文字 -- 支持可视化波形显示;可配置回声消除、降噪;**注意:不支持通话时录音** -- 支持PCM音频流式播放、完整播放,App端用原生插件边录音边播放更流畅 -- 支持离线使用,本组件和配套原生插件均不依赖网络 -- App端有配套的[原生录音插件](https://ext.dcloud.net.cn/plugin?name=Recorder-NativePlugin)可供搭配使用,兼容性和体验更好 - -**详细文档(含Demo项目):** [https://github.com/xiangyuecn/Recorder/tree/master/app-support-sample/demo_UniApp](https://github.com/xiangyuecn/Recorder/tree/master/app-support-sample/demo_UniApp) - -**Recorder开源库地址:** [https://github.com/xiangyuecn/Recorder](https://github.com/xiangyuecn/Recorder) - -如果github打不开,可以[点此访问Gitee仓库地址](https://gitee.com/xiangyuecn/Recorder/tree/master/app-support-sample/demo_UniApp) 。 - - -*⠀* - -## 测试方法 -**示例项目如果在HBuilder中编译失败,请删掉node_modules目录重新手动执行npm install(偶尔出现HBuilder自动创建项目依赖包不完整,导致无法编译)** - -1. 在本插件市场页面右侧下载或导入示例项目(或打开上面详细文档链接中的Demo源码) -2. 在测试项目根目录执行 `npm install --registry=https://registry.npmmirror.com/` ,完成`recorder-core`依赖的安装 -3. 在HBuilder中打开本测试项目文件夹 -4. 在HBuilder中运行到浏览器、手机、微信小程序,即可在不同环境下测试 -5. 测试中提供了:基础录音、播放、上传、WebSocket实时语音通话对讲、ASR语音识别等功能 - - - -*⠀* - -*⠀* - -# 集成到自己项目中 - -你可以直接参考上面的测试示例项目源码,里面的`main_recTest.vue`更容易入门;示例项目中已经实现了很多功能,简单使用可直接照抄Demo代码到你的项目中。 - - -## 一、引入js文件 -1. 在你的项目根目录安装`recorder-core`:`npm install recorder-core --registry=https://registry.npmmirror.com/` -2. 导入Recorder-UniCore组件:插件市场下载本组件,然后添加到你的项目中 `/uni_modules/Recorder-UniCore` -3. 项目配置好录音权限,参考下面的录音权限配置章节,**特别注意App后台录音配置、小程序权限声明** -4. 在需要录音的vue文件script内编写以下代码,按需引入需要的js - -``` html - - - -``` - -5. 编译成app时,默认需要额外提供一个renderjs模块,请照抄下面这段代码放到vue文件末尾 - -``` html - - - -``` - - -*⠀* - -*⠀* - -## 二、调用录音 -``` javascript -/**在逻辑层中编写**/ -//import ... 上面那些import代码 - -//var vue3This=getCurrentInstance().proxy; //当用vue3 setup组合式 API (Composition API) 编写时,直接在import后面取到当前实例this,在需要this的地方传vue3This变量即可,其他的和选项式 API (Options API) 没有任何区别;import {getCurrentInstance} from 'vue';详细可以参考Demo项目中的 page_vue3____composition_api.vue - -//RecordApp.UniNativeUtsPlugin={ nativePlugin:true }; //App中启用配套的原生录音插件支持,配置后会使用原生插件进行录音,没有原生插件时依旧使用renderjs H5录音 -//App中提升后台录音的稳定性:配置了原生插件后,可配置 `RecordApp.UniWithoutAppRenderjs=true` 禁用renderjs层音频编码(WebWorker加速),变成逻辑层中直接编码(但会降低逻辑层性能),后台运行时可避免部分手机WebView运行受限的影响 -//App中提升后台录音的稳定性:需要启用后台录音保活服务(iOS不需要,参考录音权限配置),Android 9开始,锁屏或进入后台一段时间后App可能会被禁止访问麦克风导致录音静音、无法录音(renderjs中H5录音也受影响),请调用配套原生插件的`androidNotifyService`接口,或使用第三方保活插件 - -export default { -data() { return {} } //视图没有引用到的变量无需放data里,直接this.xxx使用 - -,mounted() { - this.isMounted=true; - //页面onShow时【必须调用】的函数,传入当前组件this - RecordApp.UniPageOnShow(this); -} -,onShow(){ //onShow可能比mounted先执行,页面可能还未准备好 - if(this.isMounted) RecordApp.UniPageOnShow(this); -} - -,methods:{ - //请求录音权限 - recReq(){ - //编译成App时提供的授权许可(编译成H5、小程序为免费授权可不填写);如果未填写授权许可,将会在App打开后第一次调用请求录音权限时,弹出“未获得商用授权时,App上仅供测试”提示框 - //RecordApp.UniAppUseLicense='我已获得UniAppID=*****的商用授权'; - - //RecordApp.RequestPermission_H5OpenSet={ audioTrackSet:{ noiseSuppression:true,echoCancellation:true,autoGainControl:true } }; //这个是Start中的audioTrackSet配置,在h5(H5、App+renderjs)中必须提前配置,因为h5中RequestPermission会直接打开录音 - - RecordApp.UniWebViewActivate(this); //App环境下必须先切换成当前页面WebView - RecordApp.RequestPermission(()=>{ - console.log("已获得录音权限,可以开始录音了"); - },(msg,isUserNotAllow)=>{ - if(isUserNotAllow){//用户拒绝了录音权限 - //这里你应当编写代码进行引导用户给录音权限,不同平台分别进行编写 - } - console.error("请求录音权限失败:"+msg); - }); - } - - //开始录音 - ,recStart(){ - //Android App如果要后台录音,需要启用后台录音保活服务(iOS不需要),需使用配套原生插件、或使用第三方保活插件 - //RecordApp.UniNativeUtsPluginCallAsync("androidNotifyService",{ title:"正在录音" ,content:"正在录音中,请勿关闭App运行" }).then(()=>{...}).catch((e)=>{...}) 注意必须RecordApp.RequestPermission得到权限后调用 - - //录音配置信息 - var set={ - type:"mp3",sampleRate:16000,bitRate:16 //mp3格式,指定采样率hz、比特率kbps,其他参数使用默认配置;注意:是数字的参数必须提供数字,不要用字符串;需要使用的type类型,需提前把格式支持文件加载进来,比如使用wav格式需要提前加载wav.js编码引擎 - /*,audioTrackSet:{ //可选,如果需要同时播放声音(比如语音通话),需要打开回声消除(并不一定会生效;打开后声音可能会从听筒播放,部分环境下(如小程序、App原生插件)可调用接口切换成扬声器外放) - //注意:H5、App+renderjs中需要在请求录音权限前进行相同配置RecordApp.RequestPermission_H5OpenSet后此配置才会生效 - echoCancellation:true,noiseSuppression:true,autoGainControl:true} */ - ,onProcess:(buffers,powerLevel,duration,sampleRate,newBufferIdx,asyncEnd)=>{ - //全平台通用:可实时上传(发送)数据,配合Recorder.SampleData方法,将buffers中的新数据连续的转换成pcm上传,或使用mock方法将新数据连续的转码成其他格式上传,可以参考Recorder文档里面的:Demo片段列表 -> 实时转码并上传-通用版;基于本功能可以做到:实时转发数据、实时保存数据、实时语音识别(ASR)等 - - //注意:App里面是在renderjs中进行实际的音频格式编码操作,此处的buffers数据是renderjs实时转发过来的,修改此处的buffers数据不会改变renderjs中buffers,所以不会改变生成的音频文件,可在onProcess_renderjs中进行修改操作就没有此问题了;如需清理buffers内存,此处和onProcess_renderjs中均需要进行清理,H5、小程序中无此限制 - //注意:如果你要用只支持在浏览器中使用的Recorder扩展插件,App里面请在renderjs中引入此扩展插件,然后在onProcess_renderjs中调用这个插件;H5可直接在这里进行调用,小程序不支持这类插件;如果调用插件的逻辑比较复杂,建议封装成js文件,这样逻辑层、renderjs中直接import,不需要重复编写 - - //H5、小程序等可视化图形绘制,直接运行在逻辑层;App里面需要在onProcess_renderjs中进行这些操作 - // #ifdef H5 || MP-WEIXIN - if(this.waveView) this.waveView.input(buffers[buffers.length-1],powerLevel,sampleRate); - // #endif - - /*实时释放清理内存,用于支持长时间录音;在指定了有效的type时,编码器内部可能还会有其他缓冲,必须同时提供takeoffEncodeChunk才能清理内存,否则type需要提供unknown格式来阻止编码器内部缓冲,App的onProcess_renderjs中需要进行相同操作 - if(this.clearBufferIdx>newBufferIdx){ this.clearBufferIdx=0 } //重新录音了就重置 - for(var i=this.clearBufferIdx||0;inewBufferIdx){ this.clearBufferIdx=0 } //重新录音了就重置 - for(var i=this.clearBufferIdx||0;i 转发给逻辑层onProcess -> onProcess_renderjs - }` - - ,takeoffEncodeChunk:true?null:(chunkBytes)=>{ - //全平台通用:实时接收到编码器编码出来的音频片段数据,chunkBytes是Uint8Array二进制数据,可以实时上传(发送)出去 - //App中如果未配置RecordApp.UniWithoutAppRenderjs时,建议提供此回调,因为录音结束后会将整个录音文件从renderjs传回逻辑层,由于uni-app的逻辑层和renderjs层数据交互性能实在太拉跨了,大点的文件传输会比较慢,提供此回调后可避免Stop时产生超大数据回传 - - //App中使用原生插件时,可方便的将数据实时保存到同一文件,第一帧时append:false新建文件,后面的append:true追加到文件 - //RecordApp.UniNativeUtsPluginCallAsync("writeFile",{path:"xxx.mp3",append:回调次数!=1, dataBase64:RecordApp.UniBtoa(chunkBytes.buffer)}).then(...).catch(...) - } - ,takeoffEncodeChunk_renderjs:true?null:`function(chunkBytes){ - //App中这里可以做一些仅在renderjs中才生效的事情,不提供也行,this是renderjs模块的this(也可以用This变量) - }` - - ,start_renderjs:`function(){ - //App中可以放一个函数,在Start成功时renderjs中会先调用这里的代码,this是renderjs模块的this(也可以用This变量) - //放一些仅在renderjs中才生效的事情,比如初始化,不提供也行 - }` - ,stop_renderjs:`function(arrayBuffer,duration,mime){ - //App中可以放一个函数,在Stop成功时renderjs中会先调用这里的代码,this是renderjs模块的this(也可以用This变量) - //放一些仅在renderjs中才生效的事情,不提供也行 - }` - }; - - RecordApp.UniWebViewActivate(this); //App环境下必须先切换成当前页面WebView - RecordApp.Start(set,()=>{ - console.log("已开始录音"); - //【稳如老狗WDT】可选的,监控是否在正常录音有onProcess回调,如果长时间没有回调就代表录音不正常 - //var wdt=this.watchDogTimer=setInterval ... 请参考示例Demo的main_recTest.vue中的watchDogTimer实现 - - //创建音频可视化图形绘制,App环境下是在renderjs中绘制,H5、小程序等是在逻辑层中绘制,因此需要提供两段相同的代码 - //view里面放一个canvas,canvas需要指定宽高(下面style里指定了300*100) - // - RecordApp.UniFindCanvas(this,[".recwave-WaveView"],` - this.waveView=Recorder.WaveView({compatibleCanvas:canvas1, width:300, height:100}); - `,(canvas1)=>{ - this.waveView=Recorder.WaveView({compatibleCanvas:canvas1, width:300, height:100}); - }); - },(msg)=>{ - console.error("开始录音失败:"+msg); - }); - } - - //暂停录音 - ,recPause(){ - if(RecordApp.GetCurrentRecOrNull()){ - RecordApp.Pause(); - console.log("已暂停"); - } - } - //继续录音 - ,recResume(){ - if(RecordApp.GetCurrentRecOrNull()){ - RecordApp.Resume(); - console.log("继续录音中..."); - } - } - - //停止录音 - ,recStop(){ - //RecordApp.UniNativeUtsPluginCallAsync("androidNotifyService",{ close:true }) //关闭Android App后台录音保活服务 - - RecordApp.Stop((arrayBuffer,duration,mime)=>{ - //全平台通用:arrayBuffer是音频文件二进制数据,可以保存成文件或者发送给服务器 - //App中如果在Start参数中提供了stop_renderjs,renderjs中的函数会比这个函数先执行 - - //注意:当Start时提供了takeoffEncodeChunk后,你需要自行实时保存录音文件数据,因此Stop时返回的arrayBuffer的长度将为0字节 - - //如果是H5环境,也可以直接构造成Blob/File文件对象,和Recorder使用一致 - // #ifdef H5 - var blob=new Blob([arrayBuffer],{type:mime}); - console.log(blob, (window.URL||webkitURL).createObjectURL(blob)); - var file=new File([arrayBuffer],"recorder.mp3"); - //uni.uploadFile({file:file, ...}) //参考demo中的test_upload_saveFile.vue - // #endif - - //如果是App、小程序环境,可以直接保存到本地文件,然后调用相关网络接口上传 - // #ifdef APP || MP-WEIXIN - RecordApp.UniSaveLocalFile("recorder.mp3",arrayBuffer,(savePath)=>{ - console.log(savePath); //app保存的文件夹为`plus.io.PUBLIC_DOWNLOADS`,小程序为 `wx.env.USER_DATA_PATH` 路径 - //uni.uploadFile({filePath:savePath, ...}) //参考demo中的test_upload_saveFile.vue - },(errMsg)=>{ console.error(errMsg) }); - // #endif - },(msg)=>{ - console.error("结束录音失败:"+msg); - }); - } - -} -} -``` - - - - - - -*⠀* - -*⠀* - -*⠀* - -*⠀* - -# 录音权限配置、需要注意的细节 -## 编译成H5时录音和权限 -编译成H5时,录音功能由Recorder H5提供,无需额外处理录音权限。 - - -*⠀* - -## 编译成微信小程序时录音和权限 -编译成微信小程序时,录音功能由小程序的`RecorderManager`提供,屏蔽了微信原有的底层细节(无录音时长限制)。 - -小程序录音需要用户授予录音权限,调用`RecordApp.RequestPermission`的时候会检查是否能正常录音,如果用户拒绝了录音权限,会进入错误回调,回调里面你应当编写代码检查`wx.getSetting`中的`scope.record`录音权限,然后引导用户进行授权(可调用`wx.openSetting`打开设置页面,方便用户给权限)。 - -**注意:上架小程序需要到小程序管理后台《[用户隐私保护指引](https://developers.weixin.qq.com/miniprogram/dev/framework/user-privacy/miniprogram-intro.html)》中声明录音权限,否则正式版将无法调用录音功能(请求权限时会直接走错误回调)。** - -更多细节请参考 [miniProgram-wx](https://gitee.com/xiangyuecn/Recorder/tree/master/app-support-sample/miniProgram-wx) 测试项目文档。 - - -*⠀* - -## 编译成App时录音和权限 -编译成App录音时,分两种情况: -1. 默认未配置`RecordApp.UniNativeUtsPlugin`(未使用原生录音插件和uts插件)时,会在renderjs中使用Recorder H5进行录音,录音数据会实时回传到逻辑层。 -2. 配置了`RecordApp.UniNativeUtsPlugin`使用原生录音插件或uts插件时,会直接调用原生插件进行录音;录音数据默认会传递到renderjs中进行音频编码处理(WebWorker加速),然后再实时回传到逻辑层,如果配置了`RecordApp.UniWithoutAppRenderjs=true`时,音频编码处理将会在逻辑层中直接处理。 - -当App是在renderjs中使用H5进行录音时(未使用原生录音插件和uts插件),iOS上只支持14.3以上版本,**且iOS上每次进入页面后第一次请求录音权限时、或长时间无操作再请求录音权限时WebView均会弹出录音权限对话框**,不同旧iOS版本(低于iOS17)下H5录音可能存在的问题在App中同样会存在;使用配套的[原生录音插件](https://ext.dcloud.net.cn/plugin?name=Recorder-NativePlugin)或uts插件时无以上问题和版本限制(uts插件开发中暂不可用),Android也无以上问题。 - -当音频编码是在renderjs中进行处理时,录音结束后会将整个录音文件传回逻辑层,由于uni-app的逻辑层和renderjs层大点的文件传输会比较慢,**建议Start时使用takeoffEncodeChunk实时获取音频文件数据可避免Stop时产生超大数据回传**;配置了`RecordApp.UniWithoutAppRenderjs=true`后,因为音频编码直接是在逻辑层中进行,将不存在传输性能损耗,但会影响逻辑层的性能(正常情况轻微不明显),需要配套使用原生录音插件才可以进行此项配置。 - -在调用`RecordApp.RequestPermission`的时候,`Recorder-UniCore`组件会自动处理好App的系统录音权限,只需要在uni-app项目的 `manifest.json` 中配置好Android和iOS的录音权限声明。 -``` -//Android需要勾选的权限,第二个也必须勾选 - - -【注意】Android如果需要在后台录音,需要启用后台录音保活服务,Android 9开始,锁屏或进入后台一段时间后App可能会被禁止访问麦克风导致录音静音、无法录音(renderjs中H5录音、原生插件录音均受影响),请调用配套原生插件的`androidNotifyService`接口,或使用第三方保活插件 - -//iOS需要声明的权限 -NSMicrophoneUsageDescription -【注意】iOS需要在 `App常用其它设置`->`后台运行能力`中提供`audio`配置,不然App切到后台后立马会停止录音 -``` - - -*⠀* - -## PCM音频流式播放、语音通话、回声消除、声音外放 -在App、H5中,均可使用H5版的[BufferStreamPlayer](https://gitee.com/xiangyuecn/Recorder/blob/master/src/extensions/buffer_stream.player.js)来实时流式播放语音;其中App中需要在renderjs中加载BufferStreamPlayer,在逻辑层中调用`RecordApp.UniWebViewVueCall`等方法将逻辑层中接收到的实时语音数据发送到renderjs中播放;播放声音的同时进行录音,声音可能会被录进去产生回声,因此一般需要打开回声消除;调用代码参考demo中的[test_realtime_voice.vue](https://gitee.com/xiangyuecn/Recorder/blob/master/app-support-sample/demo_UniApp/pages/recTest/test_realtime_voice.vue)。 - -App中如果搭配使用了配套的[原生录音插件](https://ext.dcloud.net.cn/plugin?name=Recorder-NativePlugin),可以调用原生实现的PcmPlayer播放器实时流式播放PCM音频,边录音边播放更流畅;同时也支持完整播放,比如AI语音合成的播放;调用代码参考demo中的[test_player_nativePlugin_pcmPlayer.vue](https://gitee.com/xiangyuecn/Recorder/blob/master/app-support-sample/demo_UniApp/pages/recTest/test_player_nativePlugin_pcmPlayer.vue)。 - -微信小程序请参考 [miniProgram-wx](https://gitee.com/xiangyuecn/Recorder/tree/master/app-support-sample/miniProgram-wx) 文档里面的同名章节,使用WebAudioContext播放。 - -配置audioTrackSet可尝试打开回声消除,或者切换听筒播放或外放,打开回声消除时,一般会转为听筒播放显著降低回声。 -``` js -//打开回声消除 -RecordApp.Start({ - ... 更多配置参数请参考RecordApp文档 - //此配置App、H5、小程序均可打开回声消除;注意:H5、App+renderjs中需要在请求录音权限前进行相同配置RecordApp.RequestPermission_H5OpenSet后此配置才会生效 - ,audioTrackSet:{echoCancellation:true,noiseSuppression:true,autoGainControl:true} - - //Android指定麦克风源(App搭配原生插件、小程序可用),0 DEFAULT 默认音频源,1 MIC 主麦克风,5 CAMCORDER 相机方向的麦,6 VOICE_RECOGNITION 语音识别,7 VOICE_COMMUNICATION 语音通信(带回声消除) - ,android_audioSource:7 //提供此配置时优先级比audioTrackSet更高,默认值为0 - - //iOS的AVAudioSession setCategory的withOptions参数值(App搭配原生插件可用),取值请参考配套原生插件文档中的iosSetDefault_categoryOptions - //,ios_categoryOptions:0x1|0x4 //默认值为5(0x1|0x4) -}); - -//App搭配原生插件时尝试切换听筒播放或外放 -await RecordApp.UniNativeUtsPluginCallAsync("setSpeakerOff",{off:true或false}); -//小程序尝试切换 -wx.setInnerAudioOption({ speakerOn:false或true }) -//H5不支持切换 -``` - - - - -*⠀* - -*⠀* - -*⠀* - -# 详细文档、RecordApp方法、属性文档 -请先阅读 [demo_UniApp文档](https://gitee.com/xiangyuecn/Recorder/tree/master/app-support-sample/demo_UniApp),含Demo项目;更高级使用还需深入阅读 [Recorder文档](https://gitee.com/xiangyuecn/Recorder)、[RecordApp文档](https://gitee.com/xiangyuecn/Recorder/tree/master/app-support-sample) (均为完整的一个README.md文档),Recorder文档中包含了更丰富的示例代码:基础录音、实时处理、格式转码、音频分析、音频混音、音频生成 等等,大部分能在uniapp中直接使用。 - - - - -*⠀* - -*⠀* - -*⠀* - -# 本组件的授权许可限制 -**本组件内的app-uni-support.js文件在uni-app中编译到App平台时仅供测试用(App平台包括:Android App、iOS App),不可用于正式发布或商用,正式发布或商用需先到DCloud插件市场购买[此带授权的插件](https://ext.dcloud.net.cn/plugin?name=Recorder-NativePlugin-Android)(费用为¥199元,赠送Android版原生插件),即可获得授权许可**;编译到其他平台时无此授权限制,比如:H5、小程序,均为免费授权。 - -在App中,如果未获得授权许可,将会在App打开后第一次调用`RecordApp.RequestPermission`请求录音权限时,弹出“未获得商用授权时,App上仅供测试”提示框。 - -在DCloud插件市场购买了[带授权的插件](https://ext.dcloud.net.cn/plugin?name=Recorder-NativePlugin-Android)获得了授权后,请在调用`RecordApp.RequestPermission`请求录音权限前,赋值`RecordApp.UniAppUseLicense="我已获得UniAppID=***的商用授权"`(星号为你项目的uni-app应用标识),就不会弹提示框了;或者直接使用配套的[原生录音插件](https://ext.dcloud.net.cn/plugin?name=Recorder-NativePlugin),设置`RecordApp.UniNativeUtsPlugin`参数后,也不会弹提示框;其他情况请联系作者咨询,更多细节请参考[本组件的GitHub文档](https://gitee.com/xiangyuecn/Recorder/tree/master/app-support-sample/demo_UniApp)。 - -获取授权、需要技术支持、或有不清楚的地方可以联系我们,客服联系方式:QQ 1251654593 ,或者直接联系作者QQ 753610399 (回复可能没有客服及时)。 - -插件开发维护不易,感谢支持~ - - -*⠀* - -*⠀* - - diff --git a/utils/ajax.js b/utils/ajax.js index 96c3768..69fb1da 100644 --- a/utils/ajax.js +++ b/utils/ajax.js @@ -126,7 +126,7 @@ let data = { failback(resData); setTimeout(() => { uni.reLaunch({ - url: '/pages/login/index?path=/' + that.getPathCopy().path + '&level=' + that.getPathCopy().level + url: '/root/person/loginIndex?path=/' + that.getPathCopy().path + '&level=' + that.getPathCopy().level }); }, 1500); } else if (resData.status == 500 || resData.status == 502) {// 某种原因导致接口提示该状态码 @@ -148,7 +148,7 @@ let data = { }); setTimeout(() => { uni.reLaunch({ - url: '/pages/login/index?path=/pages/home/index&level=' + that.getPathCopy().level + url: '/root/person/loginIndex?path=/pages/home/index&level=' + that.getPathCopy().level }); }, 1500); } else {// 其他异常 diff --git a/utils/common.js b/utils/common.js index 4ec11a2..d640fa3 100644 --- a/utils/common.js +++ b/utils/common.js @@ -70,7 +70,7 @@ let data = { let that = this; if (!uni.getStorageSync("apply-token")) { uni.reLaunch({ - url: '/pages/login/index?path=/' + that.getPath().path + '&level=' + that.getPath().level + url: '/root/person/loginIndex?path=/' + that.getPath().path + '&level=' + that.getPath().level }); return false; } else { diff --git a/utils/wyyx.js b/utils/wyyx.js index 4c00cf2..a2ef626 100644 --- a/utils/wyyx.js +++ b/utils/wyyx.js @@ -135,7 +135,7 @@ let data = { failback(resData); setTimeout(() => { uni.reLaunch({ - url: '/pages/login/index?path=/' + that.wyyxgetPathCopy().path + '&level=' + that.wyyxgetPathCopy().level + url: '/root/person/loginIndex?path=/' + that.wyyxgetPathCopy().path + '&level=' + that.wyyxgetPathCopy().level }); }, 1500); } else if (resData.status == 500 || resData.status == 502) {// 某种原因导致接口提示该状态码 @@ -157,7 +157,7 @@ let data = { }); setTimeout(() => { uni.reLaunch({ - url: '/pages/login/index?path=/pages/home/index&level=' + that.wyyxgetPathCopy().level + url: '/root/person/loginIndex?path=/pages/home/index&level=' + that.wyyxgetPathCopy().level }); }, 1500); } else {// 其他异常