@tarojs/taro-h5 3.7.0-alpha.5 → 3.7.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/alipay/index.d.ts +2 -1
- package/dist/api/alipay/index.js +2 -1
- package/dist/api/alipay/index.js.map +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/media/video/chooseMedia.js +1 -1
- package/dist/api/media/video/chooseMedia.js.map +1 -1
- package/dist/index.cjs.d.ts +2 -1
- package/dist/index.cjs.js +3 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.d.ts +2 -1
- package/dist/index.esm.js +3 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -6
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
declare const getOpenUserInfo: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
2
|
-
|
|
2
|
+
declare const tradePay: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
3
|
+
export { getOpenUserInfo, tradePay };
|
package/dist/api/alipay/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { temporarilyNotSupport } from '../../utils/index.js';
|
|
|
2
2
|
|
|
3
3
|
// AliPay
|
|
4
4
|
const getOpenUserInfo = /* @__PURE__ */ temporarilyNotSupport('getOpenUserInfo');
|
|
5
|
+
const tradePay = /* @__PURE__ */ temporarilyNotSupport('tradePay');
|
|
5
6
|
|
|
6
|
-
export { getOpenUserInfo };
|
|
7
|
+
export { getOpenUserInfo, tradePay };
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/api/alipay/index.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// AliPay\nexport const getOpenUserInfo = /* @__PURE__ */ temporarilyNotSupport('getOpenUserInfo')\n"],"names":[],"mappings":";;AAEA;AACa,MAAA,eAAe,mBAAmB,qBAAqB,CAAC,iBAAiB;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/api/alipay/index.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// AliPay\nexport const getOpenUserInfo = /* @__PURE__ */ temporarilyNotSupport('getOpenUserInfo')\nexport const tradePay = /* @__PURE__ */ temporarilyNotSupport('tradePay')\n"],"names":[],"mappings":";;AAEA;AACa,MAAA,eAAe,mBAAmB,qBAAqB,CAAC,iBAAiB,EAAC;AAC1E,MAAA,QAAQ,mBAAmB,qBAAqB,CAAC,UAAU;;;;"}
|
package/dist/api/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { createInterstitialAd, createRewardedVideoAd } from './ad/index.js';
|
|
2
2
|
import './ai/index.js';
|
|
3
|
-
export { getOpenUserInfo } from './alipay/index.js';
|
|
3
|
+
export { getOpenUserInfo, tradePay } from './alipay/index.js';
|
|
4
4
|
export { arrayBufferToBase64, base64ToArrayBuffer, env } from './base/index.js';
|
|
5
5
|
export { createOffscreenCanvas } from './canvas/index.js';
|
|
6
6
|
export { cloud } from './cloud/index.js';
|
|
@@ -58,7 +58,7 @@ const chooseMedia = function (options, methodName = 'chooseMedia') {
|
|
|
58
58
|
const { tapIndex } = yield showActionSheet({
|
|
59
59
|
itemList: ['拍摄', '从相册选择'],
|
|
60
60
|
}, methodName);
|
|
61
|
-
sourceType.splice(0,
|
|
61
|
+
sourceType.splice(0, sourceType.length, tapIndex === 0 ? 'camera' : 'album');
|
|
62
62
|
}
|
|
63
63
|
catch (e) {
|
|
64
64
|
return handle.fail({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chooseMedia.js","sources":["../../../../src/api/media/video/chooseMedia.ts"],"sourcesContent":["import Taro from '@tarojs/api'\nimport { getMobileDetect } from '@tarojs/router/dist/utils/navigate'\n\nimport { showActionSheet } from '../../../api/ui'\nimport { getParameterError, shouldBeObject } from '../../../utils'\nimport { MethodHandler } from '../../../utils/handler'\n\n/**\n * 拍摄或从手机相册中选择图片或视频。\n */\nexport const chooseMedia = async function (\n options: Taro.chooseMedia.Option,\n methodName = 'chooseMedia',\n): Promise<Taro.chooseMedia.SuccessCallbackResult> {\n // options must be an Object\n const isObject = shouldBeObject(options)\n if (!isObject.flag) {\n const res = { errMsg: `${methodName}:fail ${isObject.msg}` }\n console.error(res.errMsg)\n return Promise.reject(res)\n }\n\n const {\n count = 9,\n mediaId = 'taroChooseMedia',\n mediaType = ['image', 'video'],\n sourceType = ['album', 'camera'],\n // sizeType = ['original', 'compressed'], // TODO 考虑通过 ffmpeg 支持压缩\n // maxDuration = 10, // TODO 考虑通过 ffmpeg 剪裁视频\n camera = 'back',\n success,\n fail,\n complete,\n } = options\n const handle = new MethodHandler({ name: methodName, success, fail, complete })\n const withImage = mediaType.length < 1 || mediaType.indexOf('image') > -1\n const withVideo = mediaType.length < 1 || mediaType.indexOf('video') > -1\n const res: Partial<Taro.chooseMedia.SuccessCallbackResult> = {\n tempFiles: [],\n type: withImage && withVideo ? 'mix' : withImage ? 'image' : 'video',\n }\n\n if (count && typeof count !== 'number') {\n res.errMsg = getParameterError({\n para: 'count',\n correct: 'Number',\n wrong: count\n })\n return handle.fail(res)\n }\n\n let el = document.getElementById(mediaId)\n if (!el) {\n el = document.createElement('input')\n el.setAttribute('type', 'file')\n el.setAttribute('id', mediaId)\n el.setAttribute('style', 'position: fixed; top: -4000px; left: -3000px; z-index: -300;')\n }\n\n if (count > 1) {\n el.setAttribute('multiple', 'multiple')\n } else {\n el.removeAttribute('multiple')\n }\n\n // Note: Input 仅在移动端支持 capture 属性,可以使用 getUserMedia 替代(暂不考虑)\n const md = getMobileDetect()\n if (md.mobile()) {\n if (sourceType.length > 1 || sourceType.length < 1) {\n try {\n const { tapIndex } = await showActionSheet({\n itemList: ['拍摄', '从相册选择'],\n }, methodName)\n sourceType.splice(0, 1, tapIndex === 0 ? 'camera' : 'album')\n } catch (e) {\n return handle.fail({\n errMsg: e.errMsg?.replace('^.*:fail ', '')\n })\n }\n }\n }\n if (sourceType.includes('camera')) {\n el.setAttribute('capture', camera === 'front' ? 'user' : 'environment')\n } else {\n el.removeAttribute('capture')\n }\n\n if (res.type === 'image') {\n el.setAttribute('accept', 'image/*')\n } else if (res.type === 'video') {\n el.setAttribute('accept', 'video/*')\n } else {\n el.setAttribute('accept', 'image/*, video/*')\n }\n return new Promise<Taro.chooseMedia.SuccessCallbackResult>((resolve, reject) => {\n if (!el) return\n document.body.appendChild(el)\n el.onchange = async function (e) {\n const target = e.target as HTMLInputElement\n if (target) {\n const files = target.files || []\n const arr = [...files]\n await Promise.all(\n arr.map(async item => {\n try {\n res.tempFiles?.push(await loadMedia(item))\n } catch (error) {\n console.error(error)\n }\n })\n )\n }\n handle.success(res, { resolve, reject })\n target.value = ''\n }\n el.onabort = () => handle.fail({ errMsg: 'abort' }, { resolve, reject })\n el.oncancel = () => handle.fail({ errMsg: 'cancel' }, { resolve, reject })\n el.onerror = e => handle.fail({ errMsg: e.toString() }, { resolve, reject })\n el.click()\n }).finally(() => {\n if (!el) return\n document.body.removeChild(el)\n })\n\n function loadMedia (file: File): Promise<Taro.chooseMedia.ChooseMedia> {\n const dataUrl = URL.createObjectURL(file)\n const res = {\n tempFilePath: dataUrl,\n size: file.size,\n duration: 0,\n height: 0,\n width: 0,\n thumbTempFilePath: '',\n fileType: file.type,\n originalFileObj: file\n }\n\n if (/^video\\//.test(res.fileType)) {\n // Video\n const video = document.createElement('video')\n const reader = new FileReader()\n video.crossOrigin = 'Anonymous'\n video.preload = 'metadata'\n video.src = res.tempFilePath\n\n return new Promise((resolve, reject) => {\n // 对齐旧版本实现\n reader.onload = (event) => {\n res.tempFilePath = event.target?.result as string\n }\n reader.onerror = e => reject(e)\n reader.readAsDataURL(res.originalFileObj)\n\n video.onloadedmetadata = () => {\n res.duration = video.duration\n res.height = video.videoHeight\n res.width = video.videoWidth\n }\n video.oncanplay = () => {\n res.thumbTempFilePath = getThumbTempFilePath(video, res.height, res.width, 0.8)\n resolve(res)\n }\n video.onerror = e => reject(e)\n })\n } else {\n // Image\n const img = new Image()\n /** 允许图片和 canvas 跨源使用\n * https://developer.mozilla.org/zh-CN/docs/Web/HTML/CORS_enabled_image\n */\n img.crossOrigin = 'Anonymous'\n img.src = res.tempFilePath\n\n return new Promise((resolve, reject) => {\n if (img.complete) {\n res.height = img.height\n res.width = img.width\n res.thumbTempFilePath = getThumbTempFilePath(img, res.height, res.width, 0.8)\n resolve(res)\n } else {\n img.onload = () => {\n res.height = img.height\n res.width = img.width\n res.thumbTempFilePath = getThumbTempFilePath(img, res.height, res.width, 0.8)\n resolve(res)\n }\n img.onerror = e => reject(e)\n }\n })\n }\n }\n\n function getThumbTempFilePath (el: CanvasImageSource, height = 0, width = height, quality = 0.8) {\n const max = 256\n const canvas = document.createElement('canvas')\n if (height > max || width > max) {\n const radio = height / width\n if (radio > 1) {\n height = max\n width = height / radio\n } else {\n width = max\n height = width * radio\n }\n }\n canvas.height = height\n canvas.width = width\n\n const ctx = canvas.getContext('2d')\n ctx?.drawImage(el, 0, 0, canvas.width, canvas.height)\n return canvas.toDataURL('image/jpeg', quality)\n }\n}\n"],"names":[],"mappings":";;;;;;;AAOA;;AAEG;MACU,WAAW,GAAG,UACzB,OAAgC,EAChC,UAAU,GAAG,aAAa,EAAA;;;;AAG1B,QAAA,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,CAAA;AACxC,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;AAClB,YAAA,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,CAAA,EAAG,UAAU,CAAA,MAAA,EAAS,QAAQ,CAAC,GAAG,CAAA,CAAE,EAAE,CAAA;AAC5D,YAAA,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AACzB,YAAA,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EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;SAC/C;;;;;;"}
|
|
1
|
+
{"version":3,"file":"chooseMedia.js","sources":["../../../../src/api/media/video/chooseMedia.ts"],"sourcesContent":["import Taro from '@tarojs/api'\nimport { getMobileDetect } from '@tarojs/router/dist/utils/navigate'\n\nimport { showActionSheet } from '../../../api/ui'\nimport { getParameterError, shouldBeObject } from '../../../utils'\nimport { MethodHandler } from '../../../utils/handler'\n\n/**\n * 拍摄或从手机相册中选择图片或视频。\n */\nexport const chooseMedia = async function (\n options: Taro.chooseMedia.Option,\n methodName = 'chooseMedia',\n): Promise<Taro.chooseMedia.SuccessCallbackResult> {\n // options must be an Object\n const isObject = shouldBeObject(options)\n if (!isObject.flag) {\n const res = { errMsg: `${methodName}:fail ${isObject.msg}` }\n console.error(res.errMsg)\n return Promise.reject(res)\n }\n\n const {\n count = 9,\n mediaId = 'taroChooseMedia',\n mediaType = ['image', 'video'],\n sourceType = ['album', 'camera'],\n // sizeType = ['original', 'compressed'], // TODO 考虑通过 ffmpeg 支持压缩\n // maxDuration = 10, // TODO 考虑通过 ffmpeg 剪裁视频\n camera = 'back',\n success,\n fail,\n complete,\n } = options\n const handle = new MethodHandler({ name: methodName, success, fail, complete })\n const withImage = mediaType.length < 1 || mediaType.indexOf('image') > -1\n const withVideo = mediaType.length < 1 || mediaType.indexOf('video') > -1\n const res: Partial<Taro.chooseMedia.SuccessCallbackResult> = {\n tempFiles: [],\n type: withImage && withVideo ? 'mix' : withImage ? 'image' : 'video',\n }\n\n if (count && typeof count !== 'number') {\n res.errMsg = getParameterError({\n para: 'count',\n correct: 'Number',\n wrong: count\n })\n return handle.fail(res)\n }\n\n let el = document.getElementById(mediaId)\n if (!el) {\n el = document.createElement('input')\n el.setAttribute('type', 'file')\n el.setAttribute('id', mediaId)\n el.setAttribute('style', 'position: fixed; top: -4000px; left: -3000px; z-index: -300;')\n }\n\n if (count > 1) {\n el.setAttribute('multiple', 'multiple')\n } else {\n el.removeAttribute('multiple')\n }\n\n // Note: Input 仅在移动端支持 capture 属性,可以使用 getUserMedia 替代(暂不考虑)\n const md = getMobileDetect()\n if (md.mobile()) {\n if (sourceType.length > 1 || sourceType.length < 1) {\n try {\n const { tapIndex } = await showActionSheet({\n itemList: ['拍摄', '从相册选择'],\n }, methodName)\n sourceType.splice(0, sourceType.length, tapIndex === 0 ? 'camera' : 'album')\n } catch (e) {\n return handle.fail({\n errMsg: e.errMsg?.replace('^.*:fail ', '')\n })\n }\n }\n }\n if (sourceType.includes('camera')) {\n el.setAttribute('capture', camera === 'front' ? 'user' : 'environment')\n } else {\n el.removeAttribute('capture')\n }\n\n if (res.type === 'image') {\n el.setAttribute('accept', 'image/*')\n } else if (res.type === 'video') {\n el.setAttribute('accept', 'video/*')\n } else {\n el.setAttribute('accept', 'image/*, video/*')\n }\n return new Promise<Taro.chooseMedia.SuccessCallbackResult>((resolve, reject) => {\n if (!el) return\n document.body.appendChild(el)\n el.onchange = async function (e) {\n const target = e.target as HTMLInputElement\n if (target) {\n const files = target.files || []\n const arr = [...files]\n await Promise.all(\n arr.map(async item => {\n try {\n res.tempFiles?.push(await loadMedia(item))\n } catch (error) {\n console.error(error)\n }\n })\n )\n }\n handle.success(res, { resolve, reject })\n target.value = ''\n }\n el.onabort = () => handle.fail({ errMsg: 'abort' }, { resolve, reject })\n el.oncancel = () => handle.fail({ errMsg: 'cancel' }, { resolve, reject })\n el.onerror = e => handle.fail({ errMsg: e.toString() }, { resolve, reject })\n el.click()\n }).finally(() => {\n if (!el) return\n document.body.removeChild(el)\n })\n\n function loadMedia (file: File): Promise<Taro.chooseMedia.ChooseMedia> {\n const dataUrl = URL.createObjectURL(file)\n const res = {\n tempFilePath: dataUrl,\n size: file.size,\n duration: 0,\n height: 0,\n width: 0,\n thumbTempFilePath: '',\n fileType: file.type,\n originalFileObj: file\n }\n\n if (/^video\\//.test(res.fileType)) {\n // Video\n const video = document.createElement('video')\n const reader = new FileReader()\n video.crossOrigin = 'Anonymous'\n video.preload = 'metadata'\n video.src = res.tempFilePath\n\n return new Promise((resolve, reject) => {\n // 对齐旧版本实现\n reader.onload = (event) => {\n res.tempFilePath = event.target?.result as string\n }\n reader.onerror = e => reject(e)\n reader.readAsDataURL(res.originalFileObj)\n\n video.onloadedmetadata = () => {\n res.duration = video.duration\n res.height = video.videoHeight\n res.width = video.videoWidth\n }\n video.oncanplay = () => {\n res.thumbTempFilePath = getThumbTempFilePath(video, res.height, res.width, 0.8)\n resolve(res)\n }\n video.onerror = e => reject(e)\n })\n } else {\n // Image\n const img = new Image()\n /** 允许图片和 canvas 跨源使用\n * https://developer.mozilla.org/zh-CN/docs/Web/HTML/CORS_enabled_image\n */\n img.crossOrigin = 'Anonymous'\n img.src = res.tempFilePath\n\n return new Promise((resolve, reject) => {\n if (img.complete) {\n res.height = img.height\n res.width = img.width\n res.thumbTempFilePath = getThumbTempFilePath(img, res.height, res.width, 0.8)\n resolve(res)\n } else {\n img.onload = () => {\n res.height = img.height\n res.width = img.width\n res.thumbTempFilePath = getThumbTempFilePath(img, res.height, res.width, 0.8)\n resolve(res)\n }\n img.onerror = e => reject(e)\n }\n })\n }\n }\n\n function getThumbTempFilePath (el: CanvasImageSource, height = 0, width = height, quality = 0.8) {\n const max = 256\n const canvas = document.createElement('canvas')\n if (height > max || width > max) {\n const radio = height / width\n if (radio > 1) {\n height = max\n width = height / radio\n } else {\n width = max\n height = width * radio\n }\n }\n canvas.height = height\n canvas.width = width\n\n const ctx = canvas.getContext('2d')\n ctx?.drawImage(el, 0, 0, canvas.width, canvas.height)\n return canvas.toDataURL('image/jpeg', quality)\n }\n}\n"],"names":[],"mappings":";;;;;;;AAOA;;AAEG;MACU,WAAW,GAAG,UACzB,OAAgC,EAChC,UAAU,GAAG,aAAa,EAAA;;;;AAG1B,QAAA,MAAM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KAAK,CAAA;AACvB,iBAAA;AACF,aAAA;AACD,YAAA,MAAM,CAAC,MAAM,GAAG,MAAM,CAAA;AACtB,YAAA,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA;YAEpB,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;YACnC,GAAG,KAAA,IAAA,IAAH,GAAG,KAAH,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,GAAG,CAAE,SAAS,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;YACrD,OAAO,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;SAC/C;;;;;;"}
|
package/dist/index.cjs.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ declare const isVKSupport: (option?: {}, ...args: any[]) => Promise<Partial<Taro
|
|
|
34
34
|
declare const createVKSession: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
35
35
|
// AliPay
|
|
36
36
|
declare const getOpenUserInfo: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
37
|
+
declare const tradePay: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
|
|
37
38
|
declare const env: {
|
|
38
39
|
FRAMEWORK: string | undefined;
|
|
39
40
|
TARO_ENV: string | undefined;
|
|
@@ -815,5 +816,5 @@ declare const createWorker: (option?: {}, ...args: any[]) => Promise<Partial<Tar
|
|
|
815
816
|
declare const createSelectorQuery: typeof Taro.createSelectorQuery;
|
|
816
817
|
declare const createIntersectionObserver: typeof Taro.createIntersectionObserver;
|
|
817
818
|
declare const createMediaQueryObserver: typeof Taro.createMediaQueryObserver;
|
|
818
|
-
export { taro as default, taro, createRewardedVideoAd, createInterstitialAd, stopFaceDetect, initFaceDetect, faceDetect, getInferenceEnvInfo, createInferenceSession, isVKSupport, createVKSession, getOpenUserInfo, env, arrayBufferToBase64, base64ToArrayBuffer, getUserCryptoManager, setEnableDebug, getRealtimeLogManager, getLogManager, reportPerformance, getPerformance, preloadWebview, preloadSkylineView, preloadAssets, openSystemBluetoothSetting, openAppAuthorizeSetting, getWindowInfo, getSystemSetting, getDeviceInfo, getAppBaseInfo, getAppAuthorizeSetting, getSystemInfoSync, getSystemInfoAsync, getSystemInfo, getSkylineInfoSync, getSkylineInfo, getRendererUserAgent, updateWeChatApp, getUpdateManager, onUnhandledRejection, onThemeChange, onPageNotFound, onLazyLoadError, onError, onAudioInterruptionEnd, onAudioInterruptionBegin, onAppShow, onAppHide, offUnhandledRejection, offThemeChange, offPageNotFound, offLazyLoadError, offError, offAudioInterruptionEnd, offAudioInterruptionBegin, offAppShow, offAppHide, getLaunchOptionsSync, getEnterOptionsSync, createOffscreenCanvas, createCanvasContext, canvasToTempFilePath, canvasPutImageData, canvasGetImageData, cloud, reportMonitor, reportAnalytics, reportEvent, getExptInfoSync, stopAccelerometer, startAccelerometer, onAccelerometerChange, offAccelerometerChange, checkIsOpenAccessibility, getBatteryInfoSync, getBatteryInfo, stopBluetoothDevicesDiscovery, startBluetoothDevicesDiscovery, openBluetoothAdapter, onBluetoothDeviceFound, onBluetoothAdapterStateChange, offBluetoothDeviceFound, offBluetoothAdapterStateChange, makeBluetoothPair, isBluetoothDevicePaired, getConnectedBluetoothDevices, getBluetoothDevices, getBluetoothAdapterState, closeBluetoothAdapter, writeBLECharacteristicValue, setBLEMTU, readBLECharacteristicValue, onBLEMTUChange, onBLEConnectionStateChange, onBLECharacteristicValueChange, offBLEMTUChange, offBLEConnectionStateChange, offBLECharacteristicValueChange, notifyBLECharacteristicValueChange, getBLEMTU, getBLEDeviceServices, getBLEDeviceRSSI, getBLEDeviceCharacteristics, createBLEConnection, closeBLEConnection, onBLEPeripheralConnectionStateChanged, offBLEPeripheralConnectionStateChanged, createBLEPeripheralServer, addPhoneRepeatCalendar, addPhoneCalendar, setClipboardData, getClipboardData, stopCompass, startCompass, onCompassChange, offCompassChange, chooseContact, addPhoneContact, getRandomValues, stopGyroscope, startGyroscope, onGyroscopeChange, offGyroscopeChange, stopBeaconDiscovery, startBeaconDiscovery, onBeaconUpdate, onBeaconServiceChange, offBeaconUpdate, offBeaconServiceChange, getBeacons, onKeyboardHeightChange, offKeyboardHeightChange, hideKeyboard, getSelectedTextRange, onMemoryWarning, offMemoryWarning, stopDeviceMotionListening, startDeviceMotionListening, onDeviceMotionChange, offDeviceMotionChange, getNetworkType, onNetworkWeakChange, onNetworkStatusChange, offNetworkWeakChange, offNetworkStatusChange, getLocalIPAddress, stopHCE, startHCE, sendHCEMessage, onHCEMessage, offHCEMessage, getNFCAdapter, getHCEState, makePhoneCall, scanCode, setVisualEffectOnCapture, setScreenBrightness, setKeepScreenOn, onUserCaptureScreen, offUserCaptureScreen, getScreenBrightness, onScreenRecordingStateChanged, offScreenRecordingStateChanged, getScreenRecordingState, sendSms, vibrateShort, vibrateLong, stopWifi, startWifi, setWifiList, onWifiConnectedWithPartialInfo, onWifiConnected, onGetWifiList, offWifiConnectedWithPartialInfo, offWifiConnected, offGetWifiList, getWifiList, getConnectedWifi, connectWifi, getExtConfigSync, getExtConfig, saveFileToDisk, saveFile, removeSavedFile, openDocument, getSavedFileList, getSavedFileInfo, getFileSystemManager, getFileInfo, getApp, getCurrentInstance, stopLocationUpdate, startLocationUpdateBackground, startLocationUpdate, openLocation, onLocationChangeError, onLocationChange, offLocationChangeError, offLocationChange, getLocation, choosePoi, getFuzzyLocation, chooseLocation, stopVoice, setInnerAudioOption, playVoice, pauseVoice, getAvailableAudioSources, createWebAudioContext, createMediaAudioPlayer, createInnerAudioContext, createAudioContext, stopBackgroundAudio, seekBackgroundAudio, playBackgroundAudio, pauseBackgroundAudio, onBackgroundAudioStop, onBackgroundAudioPlay, onBackgroundAudioPause, getBackgroundAudioPlayerState, getBackgroundAudioManager, createCameraContext, saveImageToPhotosAlbum, previewMedia, getImageInfo, previewImage, compressImage, chooseMessageFile, chooseImage, editImage, cropImage, createLivePusherContext, createLivePlayerContext, createMapContext, createMediaRecorder, stopRecord, startRecord, getRecorderManager, saveVideoToPhotosAlbum, openVideoEditor, getVideoInfo, createVideoContext, compressVideo, chooseMedia, chooseVideo, createVideoDecoder, createMediaContainer, updateVoIPChatMuteConfig, subscribeVoIPVideoMembers, setEnable1v1Chat, onVoIPVideoMembersChanged, onVoIPChatStateChanged, onVoIPChatSpeakersChanged, onVoIPChatMembersChanged, onVoIPChatInterrupted, offVoIPChatSpeakersChanged, offVoIPVideoMembersChanged, offVoIPChatStateChanged, offVoIPChatMembersChanged, offVoIPChatInterrupted, joinVoIPChat, join1v1Chat, exitVoIPChat, openEmbeddedMiniProgram, navigateToMiniProgram, navigateBackMiniProgram, exitMiniProgram, openBusinessView, downloadFile, stopLocalServiceDiscovery, startLocalServiceDiscovery, onLocalServiceResolveFail, onLocalServiceLost, onLocalServiceFound, onLocalServiceDiscoveryStop, offLocalServiceResolveFail, offLocalServiceLost, offLocalServiceFound, offLocalServiceDiscoveryStop, request, addInterceptor, cleanInterceptors, createTCPSocket, createUDPSocket, uploadFile, sendSocketMessage, onSocketOpen, onSocketMessage, onSocketError, onSocketClose, connectSocket, closeSocket, getAccountInfoSync, chooseAddress, authorizeForMiniProgram, authorize, openCard, addCard, reserveChannelsLive, openChannelsUserProfile, openChannelsLive, openChannelsEvent, openChannelsActivity, getChannelsShareKey, getChannelsLiveNoticeInfo, getChannelsLiveInfo, openCustomerServiceChat, requestDeviceVoIP, getDeviceVoIPList, checkIsSupportFacialRecognition, startFacialRecognitionVerify, startFacialRecognitionVerifyAndUploadVideo, faceVerifyForPay, addVideoToFavorites, addFileToFavorites, checkIsAddedToMyMiniProgram, getGroupEnterInfo, chooseInvoiceTitle, chooseInvoice, chooseLicensePlate, pluginLogin, login, checkSession, showRedPackage, openSetting, getSetting, startSoterAuthentication, checkIsSupportSoterAuthentication, checkIsSoterEnrolledInDevice, requestSubscribeMessage, requestSubscribeDeviceMessage, getUserProfile, getUserInfo, shareToWeRun, getWeRunData, requestPayment, requestPluginPayment, requestOrderPayment, openQzonePublish, updateShareMenu, showShareMenu, showShareImageMenu, shareVideoMessage, shareFileMessage, onCopyUrl, offCopyUrl, hideShareMenu, getShareInfo, authPrivateMessage, setStorageSync, setStorage, revokeBufferURL, removeStorageSync, removeStorage, getStorageSync, getStorageInfoSync, getStorageInfo, getStorage, createBufferURL, clearStorageSync, clearStorage, batchSetStorageSync, batchSetStorage, batchGetStorageSync, batchGetStorage, setBackgroundFetchToken, onBackgroundFetchData, getBackgroundFetchToken, getBackgroundFetchData, createCacheManager, setPageInfo, ocrIdCard, ocrBankCard, ocrDrivingLicense, ocrVehicleLicense, textReview, textToAudio, imageAudit, advancedGeneralIdentify, objectDetectIdentify, carClassify, dishClassify, logoClassify, animalClassify, plantClassify, getSwanId, requestPolymerPayment, navigateToSmartGameProgram, navigateToSmartProgram, navigateBackSmartProgram, preloadSubPackage, createAnimation, setBackgroundTextStyle, setBackgroundColor, nextTick, loadFontFace, disableAlertBeforeUnload, enableAlertBeforeUnload, hideLoading, hideToast, showActionSheet, showLoading, showModal, showToast, getMenuButtonBoundingClientRect, showNavigationBarLoading, setNavigationBarTitle, setNavigationBarColor, hideNavigationBarLoading, hideHomeButton, startPullDownRefresh, stopPullDownRefresh, pageScrollTo, setTopBarText, initTabBarApis, showTabBarRedDot, showTabBar, setTabBarStyle, setTabBarItem, setTabBarBadge, removeTabBarBadge, hideTabBarRedDot, hideTabBar, setWindowSize, onWindowResize, offWindowResize, checkIsPictureInPictureActive, createWorker, createSelectorQuery, createIntersectionObserver, createMediaQueryObserver, Behavior, canIUseWebp, Current, ENV_TYPE, eventCenter, Events, getAppInfo, getEnv, history, initPxTransform, interceptorify, interceptors, Link, options, preload, pxTransform, requirePlugin };
|
|
819
|
+
export { taro as default, taro, createRewardedVideoAd, createInterstitialAd, stopFaceDetect, initFaceDetect, faceDetect, getInferenceEnvInfo, createInferenceSession, isVKSupport, createVKSession, getOpenUserInfo, tradePay, env, arrayBufferToBase64, base64ToArrayBuffer, getUserCryptoManager, setEnableDebug, getRealtimeLogManager, getLogManager, reportPerformance, getPerformance, preloadWebview, preloadSkylineView, preloadAssets, openSystemBluetoothSetting, openAppAuthorizeSetting, getWindowInfo, getSystemSetting, getDeviceInfo, getAppBaseInfo, getAppAuthorizeSetting, getSystemInfoSync, getSystemInfoAsync, getSystemInfo, getSkylineInfoSync, getSkylineInfo, getRendererUserAgent, updateWeChatApp, getUpdateManager, onUnhandledRejection, onThemeChange, onPageNotFound, onLazyLoadError, onError, onAudioInterruptionEnd, onAudioInterruptionBegin, onAppShow, onAppHide, offUnhandledRejection, offThemeChange, offPageNotFound, offLazyLoadError, offError, offAudioInterruptionEnd, offAudioInterruptionBegin, offAppShow, offAppHide, getLaunchOptionsSync, getEnterOptionsSync, createOffscreenCanvas, createCanvasContext, canvasToTempFilePath, canvasPutImageData, canvasGetImageData, cloud, reportMonitor, reportAnalytics, reportEvent, getExptInfoSync, stopAccelerometer, startAccelerometer, onAccelerometerChange, offAccelerometerChange, checkIsOpenAccessibility, getBatteryInfoSync, getBatteryInfo, stopBluetoothDevicesDiscovery, startBluetoothDevicesDiscovery, openBluetoothAdapter, onBluetoothDeviceFound, onBluetoothAdapterStateChange, offBluetoothDeviceFound, offBluetoothAdapterStateChange, makeBluetoothPair, isBluetoothDevicePaired, getConnectedBluetoothDevices, getBluetoothDevices, getBluetoothAdapterState, closeBluetoothAdapter, writeBLECharacteristicValue, setBLEMTU, readBLECharacteristicValue, onBLEMTUChange, onBLEConnectionStateChange, onBLECharacteristicValueChange, offBLEMTUChange, offBLEConnectionStateChange, offBLECharacteristicValueChange, notifyBLECharacteristicValueChange, getBLEMTU, getBLEDeviceServices, getBLEDeviceRSSI, getBLEDeviceCharacteristics, createBLEConnection, closeBLEConnection, onBLEPeripheralConnectionStateChanged, offBLEPeripheralConnectionStateChanged, createBLEPeripheralServer, addPhoneRepeatCalendar, addPhoneCalendar, setClipboardData, getClipboardData, stopCompass, startCompass, onCompassChange, offCompassChange, chooseContact, addPhoneContact, getRandomValues, stopGyroscope, startGyroscope, onGyroscopeChange, offGyroscopeChange, stopBeaconDiscovery, startBeaconDiscovery, onBeaconUpdate, onBeaconServiceChange, offBeaconUpdate, offBeaconServiceChange, getBeacons, onKeyboardHeightChange, offKeyboardHeightChange, hideKeyboard, getSelectedTextRange, onMemoryWarning, offMemoryWarning, stopDeviceMotionListening, startDeviceMotionListening, onDeviceMotionChange, offDeviceMotionChange, getNetworkType, onNetworkWeakChange, onNetworkStatusChange, offNetworkWeakChange, offNetworkStatusChange, getLocalIPAddress, stopHCE, startHCE, sendHCEMessage, onHCEMessage, offHCEMessage, getNFCAdapter, getHCEState, makePhoneCall, scanCode, setVisualEffectOnCapture, setScreenBrightness, setKeepScreenOn, onUserCaptureScreen, offUserCaptureScreen, getScreenBrightness, onScreenRecordingStateChanged, offScreenRecordingStateChanged, getScreenRecordingState, sendSms, vibrateShort, vibrateLong, stopWifi, startWifi, setWifiList, onWifiConnectedWithPartialInfo, onWifiConnected, onGetWifiList, offWifiConnectedWithPartialInfo, offWifiConnected, offGetWifiList, getWifiList, getConnectedWifi, connectWifi, getExtConfigSync, getExtConfig, saveFileToDisk, saveFile, removeSavedFile, openDocument, getSavedFileList, getSavedFileInfo, getFileSystemManager, getFileInfo, getApp, getCurrentInstance, stopLocationUpdate, startLocationUpdateBackground, startLocationUpdate, openLocation, onLocationChangeError, onLocationChange, offLocationChangeError, offLocationChange, getLocation, choosePoi, getFuzzyLocation, chooseLocation, stopVoice, setInnerAudioOption, playVoice, pauseVoice, getAvailableAudioSources, createWebAudioContext, createMediaAudioPlayer, createInnerAudioContext, createAudioContext, stopBackgroundAudio, seekBackgroundAudio, playBackgroundAudio, pauseBackgroundAudio, onBackgroundAudioStop, onBackgroundAudioPlay, onBackgroundAudioPause, getBackgroundAudioPlayerState, getBackgroundAudioManager, createCameraContext, saveImageToPhotosAlbum, previewMedia, getImageInfo, previewImage, compressImage, chooseMessageFile, chooseImage, editImage, cropImage, createLivePusherContext, createLivePlayerContext, createMapContext, createMediaRecorder, stopRecord, startRecord, getRecorderManager, saveVideoToPhotosAlbum, openVideoEditor, getVideoInfo, createVideoContext, compressVideo, chooseMedia, chooseVideo, createVideoDecoder, createMediaContainer, updateVoIPChatMuteConfig, subscribeVoIPVideoMembers, setEnable1v1Chat, onVoIPVideoMembersChanged, onVoIPChatStateChanged, onVoIPChatSpeakersChanged, onVoIPChatMembersChanged, onVoIPChatInterrupted, offVoIPChatSpeakersChanged, offVoIPVideoMembersChanged, offVoIPChatStateChanged, offVoIPChatMembersChanged, offVoIPChatInterrupted, joinVoIPChat, join1v1Chat, exitVoIPChat, openEmbeddedMiniProgram, navigateToMiniProgram, navigateBackMiniProgram, exitMiniProgram, openBusinessView, downloadFile, stopLocalServiceDiscovery, startLocalServiceDiscovery, onLocalServiceResolveFail, onLocalServiceLost, onLocalServiceFound, onLocalServiceDiscoveryStop, offLocalServiceResolveFail, offLocalServiceLost, offLocalServiceFound, offLocalServiceDiscoveryStop, request, addInterceptor, cleanInterceptors, createTCPSocket, createUDPSocket, uploadFile, sendSocketMessage, onSocketOpen, onSocketMessage, onSocketError, onSocketClose, connectSocket, closeSocket, getAccountInfoSync, chooseAddress, authorizeForMiniProgram, authorize, openCard, addCard, reserveChannelsLive, openChannelsUserProfile, openChannelsLive, openChannelsEvent, openChannelsActivity, getChannelsShareKey, getChannelsLiveNoticeInfo, getChannelsLiveInfo, openCustomerServiceChat, requestDeviceVoIP, getDeviceVoIPList, checkIsSupportFacialRecognition, startFacialRecognitionVerify, startFacialRecognitionVerifyAndUploadVideo, faceVerifyForPay, addVideoToFavorites, addFileToFavorites, checkIsAddedToMyMiniProgram, getGroupEnterInfo, chooseInvoiceTitle, chooseInvoice, chooseLicensePlate, pluginLogin, login, checkSession, showRedPackage, openSetting, getSetting, startSoterAuthentication, checkIsSupportSoterAuthentication, checkIsSoterEnrolledInDevice, requestSubscribeMessage, requestSubscribeDeviceMessage, getUserProfile, getUserInfo, shareToWeRun, getWeRunData, requestPayment, requestPluginPayment, requestOrderPayment, openQzonePublish, updateShareMenu, showShareMenu, showShareImageMenu, shareVideoMessage, shareFileMessage, onCopyUrl, offCopyUrl, hideShareMenu, getShareInfo, authPrivateMessage, setStorageSync, setStorage, revokeBufferURL, removeStorageSync, removeStorage, getStorageSync, getStorageInfoSync, getStorageInfo, getStorage, createBufferURL, clearStorageSync, clearStorage, batchSetStorageSync, batchSetStorage, batchGetStorageSync, batchGetStorage, setBackgroundFetchToken, onBackgroundFetchData, getBackgroundFetchToken, getBackgroundFetchData, createCacheManager, setPageInfo, ocrIdCard, ocrBankCard, ocrDrivingLicense, ocrVehicleLicense, textReview, textToAudio, imageAudit, advancedGeneralIdentify, objectDetectIdentify, carClassify, dishClassify, logoClassify, animalClassify, plantClassify, getSwanId, requestPolymerPayment, navigateToSmartGameProgram, navigateToSmartProgram, navigateBackSmartProgram, preloadSubPackage, createAnimation, setBackgroundTextStyle, setBackgroundColor, nextTick, loadFontFace, disableAlertBeforeUnload, enableAlertBeforeUnload, hideLoading, hideToast, showActionSheet, showLoading, showModal, showToast, getMenuButtonBoundingClientRect, showNavigationBarLoading, setNavigationBarTitle, setNavigationBarColor, hideNavigationBarLoading, hideHomeButton, startPullDownRefresh, stopPullDownRefresh, pageScrollTo, setTopBarText, initTabBarApis, showTabBarRedDot, showTabBar, setTabBarStyle, setTabBarItem, setTabBarBadge, removeTabBarBadge, hideTabBarRedDot, hideTabBar, setWindowSize, onWindowResize, offWindowResize, checkIsPictureInPictureActive, createWorker, createSelectorQuery, createIntersectionObserver, createMediaQueryObserver, Behavior, canIUseWebp, Current, ENV_TYPE, eventCenter, Events, getAppInfo, getEnv, history, initPxTransform, interceptorify, interceptors, Link, options, preload, pxTransform, requirePlugin };
|
|
819
820
|
export { getCurrentPages, navigateBack, navigateTo, redirectTo, reLaunch, switchTab } from "@tarojs/router";
|
package/dist/index.cjs.js
CHANGED
|
@@ -331,6 +331,7 @@ const createVKSession = /* @__PURE__ */ temporarilyNotSupport('createVKSession')
|
|
|
331
331
|
|
|
332
332
|
// AliPay
|
|
333
333
|
const getOpenUserInfo = /* @__PURE__ */ temporarilyNotSupport('getOpenUserInfo');
|
|
334
|
+
const tradePay = /* @__PURE__ */ temporarilyNotSupport('tradePay');
|
|
334
335
|
|
|
335
336
|
// 加密
|
|
336
337
|
const getUserCryptoManager = /* @__PURE__ */ temporarilyNotSupport('getUserCryptoManager');
|
|
@@ -4433,7 +4434,7 @@ const chooseMedia = function (options, methodName = 'chooseMedia') {
|
|
|
4433
4434
|
const { tapIndex } = yield showActionSheet({
|
|
4434
4435
|
itemList: ['拍摄', '从相册选择'],
|
|
4435
4436
|
}, methodName);
|
|
4436
|
-
sourceType.splice(0,
|
|
4437
|
+
sourceType.splice(0, sourceType.length, tapIndex === 0 ? 'camera' : 'album');
|
|
4437
4438
|
}
|
|
4438
4439
|
catch (e) {
|
|
4439
4440
|
return handle.fail({
|
|
@@ -6565,6 +6566,7 @@ exports.stopWifi = stopWifi;
|
|
|
6565
6566
|
exports.subscribeVoIPVideoMembers = subscribeVoIPVideoMembers;
|
|
6566
6567
|
exports.textReview = textReview;
|
|
6567
6568
|
exports.textToAudio = textToAudio;
|
|
6569
|
+
exports.tradePay = tradePay;
|
|
6568
6570
|
exports.updateShareMenu = updateShareMenu;
|
|
6569
6571
|
exports.updateVoIPChatMuteConfig = updateVoIPChatMuteConfig;
|
|
6570
6572
|
exports.updateWeChatApp = updateWeChatApp;
|