| | |
| | | } |
| | | }, |
| | | "nativePlugins" : { |
| | | "business-module" : { |
| | | "__plugin_info__" : { |
| | | "name" : "business-module", |
| | | "description" : "业务模块插件", |
| | | "platforms" : "Android,iOS", |
| | | "url" : "", |
| | | "android_package_name" : "", |
| | | "ios_bundle_id" : "", |
| | | "isCloud" : false, |
| | | "bought" : -1, |
| | | "pid" : "", |
| | | "parameters" : {} |
| | | } |
| | | }, |
| | | "JG-JCore" : { |
| | | "JPUSH_APPKEY_ANDROID" : "b5aed7d076638a0d835786bd", |
| | | "JPUSH_APPKEY_IOS" : "b5aed7d076638a0d835786bd", |
| | |
| | | { |
| | | "id": "wlp-progress-new", |
| | | "name": "超级好用的最基础的半、全、渐变圆环进度条组件,可二次开发或者联系我二次开发哟", |
| | | "displayName": "超级好用的最基础的半、全、渐变圆环进度条组件,可二次开发或者联系我二次开发哟", |
| | | "version": "1.0.0", |
| | | "description": "超级好用的最基础的圆环进度条组件,可二次开发,半圆,全圆,渐变等等,利用canvas实现", |
| | | "keywords": [ |
| | | "进度条", |
| | | "半圆环", |
| | | "全圆环", |
| | | "渐变" |
| | | ], |
| | | "dcloudext": { |
| | | "type": "component-vue", |
| | | "sale": { |
| | | "regular": { |
| | | "price": "0.00" |
| | | }, |
| | | "sourcecode": { |
| | | "price": "0.00" |
| | | } |
| | | } |
| | | }, |
| | | "uni_modules": { |
| | | "dependencies": [], |
| | | "encrypt": [] |
| | | "id": "wlp-progress-new", |
| | | "name": "超级好用的最基础的半、全、渐变圆环进度条组件,可二次开发或者联系我二次开发哟", |
| | | "displayName": "超级好用的最基础的半、全、渐变圆环进度条组件,可二次开发或者联系我二次开发哟", |
| | | "version": "1.0.0", |
| | | "description": "超级好用的最基础的圆环进度条组件,可二次开发,半圆,全圆,渐变等等,利用canvas实现", |
| | | "keywords": [ |
| | | "进度条", |
| | | "半圆环", |
| | | "全圆环", |
| | | "渐变" |
| | | ], |
| | | "dcloudext": { |
| | | "type": "component-vue", |
| | | "sale": { |
| | | "regular": { |
| | | "price": "0.00" |
| | | }, |
| | | "sourcecode": { |
| | | "price": "0.00" |
| | | } |
| | | } |
| | | }, |
| | | "uni_modules": { |
| | | "dependencies": [], |
| | | "encrypt": [] |
| | | }, |
| | | "_dp_type": "nativeplugin", |
| | | "_dp_nativeplugin": { |
| | | "android": { |
| | | "plugins": [ |
| | | { |
| | | "type": "module", |
| | | "name": "business-module", |
| | | "class": "com.example.mylibrary.BusinessModule" |
| | | } |
| | | ], |
| | | "integrateType": "aar", |
| | | "useAndroidX": true |
| | | } |
| | | } |
| | | } |
| | |
| | | import { computed, ref, onMounted } from "vue"; |
| | | import { onPullDownRefresh, onShow } from "@dcloudio/uni-app"; |
| | | import { createLiveRoomEntry, getBannerList, getHomeFeaturedContent, getHomeLiveCourseList, getLiveRoomSetting } from "./service"; |
| | | import { HardwareAPI } from '@/utils/visitorDevice.js'; |
| | | import { resolveCurrentAppUserId } from "@/utils/app-user.js"; |
| | | |
| | | interface HomeBannerItem { |
| | |
| | | return; |
| | | } |
| | | |
| | | const webviewUrl = `/pages/weizanLive/weizanLive?url=${encodeURIComponent(targetUrl)}&title=${encodeURIComponent('微赞直播')}`; |
| | | console.log('[goWeiZanLive] 准备跳转 WebView:', webviewUrl); |
| | | |
| | | uni.navigateTo({ |
| | | url: webviewUrl |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '进入原生', |
| | | showCancel: false |
| | | }); |
| | | console.log('[goWeiZanLive] navigateTo 调用完成'); |
| | | |
| | | const webPayOptions = { |
| | | ua: 'webchatPay/wx074c1f0cf5a0ecf4 InAppPay', |
| | | url: targetUrl, |
| | | title: '微赞直播' |
| | | }; |
| | | // #ifdef APP-PLUS |
| | | HardwareAPI.openWebPay(webPayOptions).catch((error) => { |
| | | console.error('[goWeiZanLive] openWebPay 调用失败:', error); |
| | | }); |
| | | HardwareAPI.startScan((result) => { |
| | | let content = ''; |
| | | try { |
| | | content = typeof result === 'string' ? result : JSON.stringify(result); |
| | | } catch (error) { |
| | | content = String(result); |
| | | } |
| | | uni.showModal({ |
| | | title: 'startScan 回调参数', |
| | | content: content || '空参数', |
| | | showCancel: false |
| | | }); |
| | | }); |
| | | return; |
| | | // #endif |
| | | |
| | | return; |
| | | } catch (error) { |
| | | console.error('[goWeiZanLive] 异常捕获:', error); |
| | | uni.showToast({ title: '获取直播间地址失败', icon: 'none' }); |
| New file |
| | |
| | | // 安卓业务插件桥接,保持与设备初始化页相同的插件入口。 |
| | | let HardwarePlugin = null; |
| | | if (typeof uni !== 'undefined' && typeof uni.requireNativePlugin === 'function') { |
| | | HardwarePlugin = uni.requireNativePlugin('business-module'); |
| | | } |
| | | |
| | | const getPluginMethod = (methodNames = []) => { |
| | | if (!HardwarePlugin) { |
| | | return null; |
| | | } |
| | | |
| | | return methodNames.find((methodName) => typeof HardwarePlugin[methodName] === 'function') || null; |
| | | }; |
| | | |
| | | export const HardwareAPI = { |
| | | startScan(callback) { |
| | | // #ifdef APP-PLUS |
| | | const methodName = getPluginMethod(['startScan']); |
| | | if (!methodName) { |
| | | throw new Error('当前插件未提供 startScan 能力'); |
| | | } |
| | | HardwarePlugin[methodName]({ duration: 2000 }, (result) => callback?.(result)); |
| | | return; |
| | | // #endif |
| | | // #ifndef APP-PLUS |
| | | throw new Error('当前平台不支持 startScan'); |
| | | // #endif |
| | | }, |
| | | |
| | | openWebPay(options = {}) { |
| | | return new Promise((resolve, reject) => { |
| | | // #ifdef APP-PLUS |
| | | const methodName = getPluginMethod(['openWebPay']); |
| | | if (!methodName) { |
| | | reject(new Error('当前插件未提供网页支付能力')); |
| | | return; |
| | | } |
| | | try { |
| | | HardwarePlugin[methodName](options, resolve); |
| | | } catch (error) { |
| | | reject(error); |
| | | } |
| | | // #endif |
| | | // #ifndef APP-PLUS |
| | | reject(new Error('当前平台不支持网页支付')); |
| | | // #endif |
| | | }); |
| | | }, |
| | | }; |