@dcloudio/uni-cli-shared 2.0.2-4020420240722003 → 2.0.2-4020820240925002
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/components/ad-fullscreen-video.vue +9 -3
- package/components/ad-interstitial.vue +8 -2
- package/components/ad-rewarded-video.vue +8 -2
- package/components/{ad.mixin.js → ad.mixin.app.js} +7 -4
- package/components/ad.mixin.mp-alipay.js +111 -0
- package/components/{ad.mixin.mp.js → ad.mixin.mp-weixin.js} +3 -5
- package/components/uniad.vue +7 -3
- package/components/unicloud-db.vue +596 -602
- package/lib/platform.js +34 -5
- package/license.md +1 -0
- package/package.json +2 -2
package/lib/platform.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
const fs = require('fs')
|
|
2
2
|
const path = require('path')
|
|
3
|
+
const {
|
|
4
|
+
getManifestJson
|
|
5
|
+
} = require('./manifest')
|
|
3
6
|
|
|
4
7
|
const {
|
|
5
8
|
isInHBuilderX,
|
|
@@ -17,10 +20,12 @@ function getShadowCss () {
|
|
|
17
20
|
if (process.env.UNI_PLATFORM === 'h5') {
|
|
18
21
|
tagName = 'body'
|
|
19
22
|
}
|
|
20
|
-
const
|
|
21
|
-
return `${tagName}::after{position:fixed;content:'';left:-1000px;top:-1000px;-webkit-animation:shadow-preload .1s;-webkit-animation-delay:3s;animation:shadow-preload .1s;animation-delay:3s}@-webkit-keyframes shadow-preload{0%{background-image:url(${
|
|
23
|
+
const url = createShadowImageUrl(getShadowCdn(), 'grey')
|
|
24
|
+
return `${tagName}::after{position:fixed;content:'';left:-1000px;top:-1000px;-webkit-animation:shadow-preload .1s;-webkit-animation-delay:3s;animation:shadow-preload .1s;animation-delay:3s}@-webkit-keyframes shadow-preload{0%{background-image:url(${url})}100%{background-image:url(${url})}}@keyframes shadow-preload{0%{background-image:url(${url})}100%{background-image:url(${url})}}`
|
|
22
25
|
}
|
|
23
26
|
const cdns = {
|
|
27
|
+
h5: '',
|
|
28
|
+
web: '',
|
|
24
29
|
'mp-weixin': 1,
|
|
25
30
|
'mp-alipay': 2,
|
|
26
31
|
'mp-baidu': 3,
|
|
@@ -37,8 +42,31 @@ const cdns = {
|
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
function getShadowCdn () {
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
return cdns[process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM] || ''
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let appid
|
|
49
|
+
|
|
50
|
+
function createIdent () {
|
|
51
|
+
if (process.env.UNI_INPUT_DIR) {
|
|
52
|
+
if (typeof appid === 'undefined') {
|
|
53
|
+
appid = getManifestJson().appid || ''
|
|
54
|
+
}
|
|
55
|
+
const id = appid.replace('__UNI__', '')
|
|
56
|
+
if (id) {
|
|
57
|
+
return Buffer.from(Buffer.from(id).toString('base64')).toString('hex')
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return ''
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function createShadowImageUrl (cdn, type = 'grey') {
|
|
64
|
+
let identStr = ''
|
|
65
|
+
if (process.env.UNI_PLATFORM !== 'h5' && process.env.UNI_PLATFORM !== 'web') {
|
|
66
|
+
const ident = createIdent()
|
|
67
|
+
identStr = ident ? `${ident}/` : ''
|
|
68
|
+
}
|
|
69
|
+
return `https://cdn${cdn || ''}.dcloud.net.cn/${identStr}img/shadow-${type}.png`
|
|
42
70
|
}
|
|
43
71
|
|
|
44
72
|
// 解决 vue-cli-service lint 时 UNI_PLATFORM 不存在
|
|
@@ -145,6 +173,7 @@ module.exports = {
|
|
|
145
173
|
discardDuplicates: false // 条件编译会导致重复
|
|
146
174
|
}
|
|
147
175
|
},
|
|
176
|
+
createShadowImageUrl,
|
|
148
177
|
getShadowCss,
|
|
149
178
|
getShadowTemplate (colorType = 'grey') {
|
|
150
179
|
let tagName = 'cover-image'
|
|
@@ -152,7 +181,7 @@ module.exports = {
|
|
|
152
181
|
.UNI_PLATFORM === 'mp-xhs') {
|
|
153
182
|
tagName = 'image'
|
|
154
183
|
}
|
|
155
|
-
return `<${tagName} src="${getShadowCdn()
|
|
184
|
+
return `<${tagName} src="${createShadowImageUrl(getShadowCdn(), colorType)}" style="z-index:998;position:fixed;left:0;top:0;width:100%;height:3px;"/>`
|
|
156
185
|
},
|
|
157
186
|
getPlatformScss () {
|
|
158
187
|
return SCSS
|
package/license.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[https://uniapp.dcloud.net.cn/license.html ](https://uniapp.dcloud.net.cn/license.html )
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-cli-shared",
|
|
3
|
-
"version": "2.0.2-
|
|
3
|
+
"version": "2.0.2-4020820240925002",
|
|
4
4
|
"description": "uni-cli-shared",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"postcss-urlrewrite": "^0.2.2",
|
|
27
27
|
"strip-json-comments": "^2.0.1"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "2f172a32971238da33d2228bd14f0ab3e7699d09"
|
|
30
30
|
}
|