@dcloudio/uni-mp-toutiao 3.0.0-alpha-3040820220424003 → 3.0.0-alpha-3040920220508001
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/uni.api.esm.js +1 -104
- package/package.json +6 -6
- package/src/api/protocols.ts +1 -7
package/dist/uni.api.esm.js
CHANGED
|
@@ -854,107 +854,6 @@ function initGetProvider(providers) {
|
|
|
854
854
|
};
|
|
855
855
|
}
|
|
856
856
|
|
|
857
|
-
const UUID_KEY = '__DC_STAT_UUID';
|
|
858
|
-
let deviceId;
|
|
859
|
-
function useDeviceId(global = tt) {
|
|
860
|
-
return function addDeviceId(_, toRes) {
|
|
861
|
-
deviceId = deviceId || global.getStorageSync(UUID_KEY);
|
|
862
|
-
if (!deviceId) {
|
|
863
|
-
deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
|
|
864
|
-
tt.setStorage({
|
|
865
|
-
key: UUID_KEY,
|
|
866
|
-
data: deviceId,
|
|
867
|
-
});
|
|
868
|
-
}
|
|
869
|
-
toRes.deviceId = deviceId;
|
|
870
|
-
};
|
|
871
|
-
}
|
|
872
|
-
function addSafeAreaInsets(fromRes, toRes) {
|
|
873
|
-
if (fromRes.safeArea) {
|
|
874
|
-
const safeArea = fromRes.safeArea;
|
|
875
|
-
toRes.safeAreaInsets = {
|
|
876
|
-
top: safeArea.top,
|
|
877
|
-
left: safeArea.left,
|
|
878
|
-
right: fromRes.windowWidth - safeArea.right,
|
|
879
|
-
bottom: fromRes.screenHeight - safeArea.bottom,
|
|
880
|
-
};
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
function populateParameters(fromRes, toRes) {
|
|
884
|
-
const { brand, model, system, language, theme, version, hostName, platform } = fromRes;
|
|
885
|
-
// osName osVersion
|
|
886
|
-
let osName = '';
|
|
887
|
-
let osVersion = '';
|
|
888
|
-
{
|
|
889
|
-
osName = system.split(' ')[0] || '';
|
|
890
|
-
osVersion = system.split(' ')[1] || '';
|
|
891
|
-
}
|
|
892
|
-
let hostVersion = version;
|
|
893
|
-
// deviceType
|
|
894
|
-
let deviceType = fromRes.deviceType || 'phone';
|
|
895
|
-
{
|
|
896
|
-
const deviceTypeMaps = {
|
|
897
|
-
ipad: 'pad',
|
|
898
|
-
windows: 'pc',
|
|
899
|
-
mac: 'pc',
|
|
900
|
-
};
|
|
901
|
-
const deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
|
|
902
|
-
const _model = model.toLocaleLowerCase();
|
|
903
|
-
for (let index = 0; index < deviceTypeMapsKeys.length; index++) {
|
|
904
|
-
const _m = deviceTypeMapsKeys[index];
|
|
905
|
-
if (_model.indexOf(_m) !== -1) {
|
|
906
|
-
deviceType = deviceTypeMaps[_m];
|
|
907
|
-
break;
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
}
|
|
911
|
-
// deviceModel
|
|
912
|
-
let deviceBrand = model.split(' ')[0].toLocaleLowerCase();
|
|
913
|
-
{
|
|
914
|
-
deviceBrand = brand.toLocaleLowerCase();
|
|
915
|
-
}
|
|
916
|
-
// hostName
|
|
917
|
-
let _hostName = hostName; // mp-jd
|
|
918
|
-
_hostName = fromRes.appName;
|
|
919
|
-
// wx.getAccountInfoSync
|
|
920
|
-
const parameters = {
|
|
921
|
-
appId: process.env.UNI_APP_ID,
|
|
922
|
-
appName: process.env.UNI_APP_NAME,
|
|
923
|
-
appVersion: process.env.UNI_APP_VERSION_NAME,
|
|
924
|
-
appVersionCode: process.env.UNI_APP_VERSION_CODE,
|
|
925
|
-
uniCompileVersion: process.env.UNI_COMPILER_VERSION,
|
|
926
|
-
uniRuntimeVersion: process.env.UNI_COMPILER_VERSION,
|
|
927
|
-
uniPlatform: process.env.UNI_PLATFORM,
|
|
928
|
-
deviceBrand,
|
|
929
|
-
deviceModel: model,
|
|
930
|
-
deviceType,
|
|
931
|
-
osName,
|
|
932
|
-
osVersion,
|
|
933
|
-
osLanguage: language,
|
|
934
|
-
osTheme: theme,
|
|
935
|
-
hostTheme: theme,
|
|
936
|
-
hostVersion,
|
|
937
|
-
hostLanguage: language,
|
|
938
|
-
hostName: _hostName,
|
|
939
|
-
// TODO
|
|
940
|
-
ua: '',
|
|
941
|
-
hostPackageName: '',
|
|
942
|
-
browserName: '',
|
|
943
|
-
browseVersion: '',
|
|
944
|
-
};
|
|
945
|
-
extend(toRes, parameters);
|
|
946
|
-
}
|
|
947
|
-
|
|
948
|
-
const getSystemInfo = {
|
|
949
|
-
returnValue: (fromRes, toRes) => {
|
|
950
|
-
addSafeAreaInsets(fromRes, toRes);
|
|
951
|
-
useDeviceId()(fromRes, toRes);
|
|
952
|
-
populateParameters(fromRes, toRes);
|
|
953
|
-
},
|
|
954
|
-
};
|
|
955
|
-
|
|
956
|
-
const getSystemInfoSync = getSystemInfo;
|
|
957
|
-
|
|
958
857
|
const redirectTo = {};
|
|
959
858
|
|
|
960
859
|
const previewImage = {
|
|
@@ -1092,9 +991,7 @@ var protocols = /*#__PURE__*/Object.freeze({
|
|
|
1092
991
|
getFileInfo: getFileInfo,
|
|
1093
992
|
redirectTo: redirectTo,
|
|
1094
993
|
navigateTo: navigateTo,
|
|
1095
|
-
previewImage: previewImage
|
|
1096
|
-
getSystemInfo: getSystemInfo,
|
|
1097
|
-
getSystemInfoSync: getSystemInfoSync
|
|
994
|
+
previewImage: previewImage
|
|
1098
995
|
});
|
|
1099
996
|
|
|
1100
997
|
var index = initUni(shims, protocols);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-mp-toutiao",
|
|
3
|
-
"version": "3.0.0-alpha-
|
|
3
|
+
"version": "3.0.0-alpha-3040920220508001",
|
|
4
4
|
"description": "uni-app mp-toutiao",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
},
|
|
23
23
|
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@dcloudio/uni-cli-shared": "3.0.0-alpha-
|
|
26
|
-
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-
|
|
27
|
-
"@dcloudio/uni-mp-vite": "3.0.0-alpha-
|
|
28
|
-
"@dcloudio/uni-mp-vue": "3.0.0-alpha-
|
|
29
|
-
"@dcloudio/uni-shared": "3.0.0-alpha-
|
|
25
|
+
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3040920220508001",
|
|
26
|
+
"@dcloudio/uni-mp-compiler": "3.0.0-alpha-3040920220508001",
|
|
27
|
+
"@dcloudio/uni-mp-vite": "3.0.0-alpha-3040920220508001",
|
|
28
|
+
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3040920220508001",
|
|
29
|
+
"@dcloudio/uni-shared": "3.0.0-alpha-3040920220508001",
|
|
30
30
|
"@vue/shared": "3.2.33",
|
|
31
31
|
"@vue/compiler-core": "3.2.33"
|
|
32
32
|
}
|
package/src/api/protocols.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
redirectTo,
|
|
3
|
-
navigateTo,
|
|
4
|
-
previewImage,
|
|
5
|
-
getSystemInfo,
|
|
6
|
-
getSystemInfoSync,
|
|
7
|
-
} from '@dcloudio/uni-mp-core'
|
|
1
|
+
export { redirectTo, navigateTo, previewImage } from '@dcloudio/uni-mp-core'
|
|
8
2
|
export const chooseImage = {
|
|
9
3
|
args: {
|
|
10
4
|
sizeType: false,
|