Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
anyefeiyu
uni-app
提交
3b44e515
U
uni-app
项目概览
anyefeiyu
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3b44e515
编写于
6月 22, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
上级
0fc53fdd
022e0d25
变更
27
展开全部
隐藏空白更改
内联
并排
Showing
27 changed file
with
263 addition
and
144 deletion
+263
-144
packages/uni-app-plus/template/common/__uniapperror.png
packages/uni-app-plus/template/common/__uniapperror.png
+0
-0
packages/uni-cli-shared/template/common/__uniapperror.png
packages/uni-cli-shared/template/common/__uniapperror.png
+0
-0
packages/uni-template-compiler/__tests__/compiler-extra.spec.js
...es/uni-template-compiler/__tests__/compiler-extra.spec.js
+9
-9
packages/uni-template-compiler/__tests__/compiler-mp-alipay.spec.js
...ni-template-compiler/__tests__/compiler-mp-alipay.spec.js
+12
-8
packages/uni-template-compiler/__tests__/compiler-mp-baidu.spec.js
...uni-template-compiler/__tests__/compiler-mp-baidu.spec.js
+6
-0
packages/uni-template-compiler/__tests__/compiler-mp-kuaishou.spec.js
...-template-compiler/__tests__/compiler-mp-kuaishou.spec.js
+6
-0
packages/uni-template-compiler/__tests__/compiler-mp-qq.spec.js
...es/uni-template-compiler/__tests__/compiler-mp-qq.spec.js
+22
-16
packages/uni-template-compiler/__tests__/compiler-mp-toutiao.spec.js
...i-template-compiler/__tests__/compiler-mp-toutiao.spec.js
+12
-8
packages/uni-template-compiler/__tests__/compiler-mp-weixin.spec.js
...ni-template-compiler/__tests__/compiler-mp-weixin.spec.js
+14
-0
packages/uni-template-compiler/lib/script/traverse/data/class.js
...s/uni-template-compiler/lib/script/traverse/data/class.js
+8
-7
packages/uni-template-compiler/lib/script/traverse/resolve-scoped-slots.js
...late-compiler/lib/script/traverse/resolve-scoped-slots.js
+1
-1
packages/vue-cli-plugin-hbuilderx/packages/weex-styler/lib/validator.js
...li-plugin-hbuilderx/packages/weex-styler/lib/validator.js
+1
-0
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
+1
-1
packages/webpack-uni-pages-loader/lib/platforms/mp-qq/project.config.json
...-uni-pages-loader/lib/platforms/mp-qq/project.config.json
+3
-2
src/core/helpers/protocol/ui/popup.js
src/core/helpers/protocol/ui/popup.js
+2
-2
src/core/view/components/input/index.vue
src/core/view/components/input/index.vue
+19
-10
src/core/view/components/textarea/index.vue
src/core/view/components/textarea/index.vue
+1
-0
src/core/view/index.css
src/core/view/index.css
+4
-0
src/core/view/mixins/field.js
src/core/view/mixins/field.js
+1
-0
src/core/view/mixins/keyboard.js
src/core/view/mixins/keyboard.js
+3
-0
src/platforms/app-plus/service/api/location/get-location.js
src/platforms/app-plus/service/api/location/get-location.js
+4
-5
src/platforms/app-plus/service/api/ui/popup.js
src/platforms/app-plus/service/api/ui/popup.js
+3
-3
src/platforms/app-plus/view/components/video/index.vue
src/platforms/app-plus/view/components/video/index.vue
+2
-2
src/platforms/app-plus/view/index.css
src/platforms/app-plus/view/index.css
+4
-0
src/platforms/h5/components/app/popup/toast.vue
src/platforms/h5/components/app/popup/toast.vue
+9
-1
src/platforms/h5/view/components/ad/index.vue
src/platforms/h5/view/components/ad/index.vue
+112
-69
src/platforms/h5/view/index.css
src/platforms/h5/view/index.css
+4
-0
未找到文件。
packages/uni-app-plus/template/common/__uniapperror.png
0 → 100644
浏览文件 @
3b44e515
5.7 KB
packages/uni-cli-shared/template/common/__uniapperror.png
0 → 100644
浏览文件 @
3b44e515
5.7 KB
packages/uni-template-compiler/__tests__/compiler-extra.spec.js
浏览文件 @
3b44e515
...
@@ -64,14 +64,14 @@ describe('mp:compiler-extra', () => {
...
@@ -64,14 +64,14 @@ describe('mp:compiler-extra', () => {
)
)
assertCodegen
(
assertCodegen
(
'
<view class="static" :class="[{ active: isActive }, errorClass]"></view>
'
,
'
<view class="static" :class="[{ active: isActive }, errorClass]"></view>
'
,
'
<view class="{{[
\'
static
data-v-4
\'
,[(isActive)?
\'
active
\'
:
\'\'
],errorClass]}}"></view>
'
,
'
<view class="{{[
\'
static
\'
,
\'
data-v-4
\'
,[(isActive)?
\'
active
\'
:
\'\'
],errorClass]}}"></view>
'
,
undefined
,
{
undefined
,
{
scopeId
:
'
data-v-4
'
scopeId
:
'
data-v-4
'
}
}
)
)
assertCodegen
(
assertCodegen
(
'
<view ref="ref" :class="[{ active: isActive }, errorClass]"></view>
'
,
'
<view ref="ref" :class="[{ active: isActive }, errorClass]"></view>
'
,
'
<view data-ref="ref" class="{{[
\'
data-v-5
vue-ref
\'
,[(isActive)?
\'
active
\'
:
\'\'
],errorClass]}}"></view>
'
,
'
<view data-ref="ref" class="{{[
\'
data-v-5
\'
,
\'
vue-ref
\'
,[(isActive)?
\'
active
\'
:
\'\'
],errorClass]}}"></view>
'
,
undefined
,
{
undefined
,
{
scopeId
:
'
data-v-5
'
scopeId
:
'
data-v-5
'
}
}
...
@@ -92,7 +92,7 @@ describe('mp:compiler-extra', () => {
...
@@ -92,7 +92,7 @@ describe('mp:compiler-extra', () => {
// )
// )
assertCodegen
(
assertCodegen
(
'
<view :class="view" class="view"></view>
'
,
'
<view :class="view" class="view"></view>
'
,
'
<view class="{{[
\'
view
data-v-7
\'
,view]}}"></view>
'
,
'
<view class="{{[
\'
view
\'
,
\'
data-v-7
\'
,view]}}"></view>
'
,
undefined
,
{
undefined
,
{
scopeId
:
'
data-v-7
'
scopeId
:
'
data-v-7
'
}
}
...
@@ -378,23 +378,23 @@ describe('mp:compiler-extra', () => {
...
@@ -378,23 +378,23 @@ describe('mp:compiler-extra', () => {
)
)
assertCodegen
(
assertCodegen
(
'
<p class="static" :class="{ active: isActive,
\'
text-danger
\'
: hasError }">2</p>
'
,
'
<p class="static" :class="{ active: isActive,
\'
text-danger
\'
: hasError }">2</p>
'
,
'
<view class="{{[
\'
static
_p
\'
,(isActive)?
\'
active
\'
:
\'\'
,(hasError)?
\'
text-danger
\'
:
\'\'
]}}">2</view>
'
'
<view class="{{[
\'
static
\'
,
\'
_p
\'
,(isActive)?
\'
active
\'
:
\'\'
,(hasError)?
\'
text-danger
\'
:
\'\'
]}}">2</view>
'
)
)
assertCodegen
(
assertCodegen
(
'
<p class="static" :class="[activeClass, errorClass]">3</p>
'
,
'
<p class="static" :class="[activeClass, errorClass]">3</p>
'
,
'
<view class="{{[
\'
static
_p
\'
,activeClass,errorClass]}}">3</view>
'
'
<view class="{{[
\'
static
\'
,
\'
_p
\'
,activeClass,errorClass]}}">3</view>
'
)
)
assertCodegen
(
assertCodegen
(
'
<p class="static" :class="[isActive ? activeClass :
\'\'
, errorClass]">4</p>
'
,
'
<p class="static" :class="[isActive ? activeClass :
\'\'
, errorClass]">4</p>
'
,
'
<view class="{{[
\'
static
_p
\'
,isActive?activeClass:
\'\'
,errorClass]}}">4</view>
'
'
<view class="{{[
\'
static
\'
,
\'
_p
\'
,isActive?activeClass:
\'\'
,errorClass]}}">4</view>
'
)
)
assertCodegen
(
assertCodegen
(
'
<p class="static" :class="[{ active: isActive }, errorClass]">5</p>
'
,
'
<p class="static" :class="[{ active: isActive }, errorClass]">5</p>
'
,
'
<view class="{{[
\'
static
_p
\'
,[(isActive)?
\'
active
\'
:
\'\'
],errorClass]}}">5</view>
'
'
<view class="{{[
\'
static
\'
,
\'
_p
\'
,[(isActive)?
\'
active
\'
:
\'\'
],errorClass]}}">5</view>
'
)
)
assertCodegen
(
assertCodegen
(
'
<div class="container" :class="computedClassObject">6</div>
'
,
'
<div class="container" :class="computedClassObject">6</div>
'
,
'
<view class="{{[
\'
container
_div
\'
,computedClassObject]}}">6</view>
'
'
<view class="{{[
\'
container
\'
,
\'
_div
\'
,computedClassObject]}}">6</view>
'
)
)
// assertCodegen(
// assertCodegen(
// `<div class="container" :class="computedClassObject">6</div>`,
// `<div class="container" :class="computedClassObject">6</div>`,
...
@@ -411,7 +411,7 @@ describe('mp:compiler-extra', () => {
...
@@ -411,7 +411,7 @@ describe('mp:compiler-extra', () => {
)
)
assertCodegen
(
assertCodegen
(
'
<p :class="classStr1 || classStr2" class="bg">9</p>
'
,
'
<p :class="classStr1 || classStr2" class="bg">9</p>
'
,
'
<view class="{{[
\'
bg
_p
\'
,classStr1||classStr2]}}">9</view>
'
'
<view class="{{[
\'
bg
\'
,
\'
_p
\'
,classStr1||classStr2]}}">9</view>
'
)
)
})
})
...
...
packages/uni-template-compiler/__tests__/compiler-mp-alipay.spec.js
浏览文件 @
3b44e515
...
@@ -137,27 +137,27 @@ describe('mp:compiler-mp-alipay', () => {
...
@@ -137,27 +137,27 @@ describe('mp:compiler-mp-alipay', () => {
)
)
assertCodegen
(
assertCodegen
(
'
<p class="static" :class="{ active: isActive,
\'
text-danger
\'
: hasError }">2</p>
'
,
'
<p class="static" :class="{ active: isActive,
\'
text-danger
\'
: hasError }">2</p>
'
,
'
<view class="{{(((
\'
static
_p
\'
)+
\'
\'
+((isActive)?
\'
active
\'
:
\'\'
))+
\'
\'
+((hasError)?
\'
text-danger
\'
:
\'\'
))}}">2</view>
'
'
<view class="{{(((
(
\'
static
\'
)+
\'
\'
+
\'
_p
\'
)+
\'
\'
+((isActive)?
\'
active
\'
:
\'\'
))+
\'
\'
+((hasError)?
\'
text-danger
\'
:
\'\'
))}}">2</view>
'
)
)
assertCodegen
(
assertCodegen
(
'
<p class="static" :class="[activeClass, errorClass]">3</p>
'
,
'
<p class="static" :class="[activeClass, errorClass]">3</p>
'
,
'
<view class="{{(((
\'
static
_p
\'
)+
\'
\'
+activeClass)+
\'
\'
+errorClass)}}">3</view>
'
'
<view class="{{(((
(
\'
static
\'
)+
\'
\'
+
\'
_p
\'
)+
\'
\'
+activeClass)+
\'
\'
+errorClass)}}">3</view>
'
)
)
assertCodegen
(
assertCodegen
(
'
<p class="static" :class="[isActive ? activeClass :
\'\'
, errorClass]">4</p>
'
,
'
<p class="static" :class="[isActive ? activeClass :
\'\'
, errorClass]">4</p>
'
,
'
<view class="{{(((
\'
static
_p
\'
)+
\'
\'
+(isActive?activeClass:
\'\'
))+
\'
\'
+errorClass)}}">4</view>
'
'
<view class="{{(((
(
\'
static
\'
)+
\'
\'
+
\'
_p
\'
)+
\'
\'
+(isActive?activeClass:
\'\'
))+
\'
\'
+errorClass)}}">4</view>
'
)
)
assertCodegen
(
assertCodegen
(
'
<p class="static" :class="[{ active: isActive }, errorClass]">5</p>
'
,
'
<p class="static" :class="[{ active: isActive }, errorClass]">5</p>
'
,
'
<view class="{{(((
\'
static
_p
\'
)+
\'
\'
+((isActive)?
\'
active
\'
:
\'\'
))+
\'
\'
+errorClass)}}">5</view>
'
'
<view class="{{(((
(
\'
static
\'
)+
\'
\'
+
\'
_p
\'
)+
\'
\'
+((isActive)?
\'
active
\'
:
\'\'
))+
\'
\'
+errorClass)}}">5</view>
'
)
)
assertCodegen
(
assertCodegen
(
'
<p class="static" :class="[{ active: isActive, disabled: isDisabled }, errorClass]">52</p>
'
,
'
<p class="static" :class="[{ active: isActive, disabled: isDisabled }, errorClass]">52</p>
'
,
'
<view class="{{(((
\'
static
_p
\'
)+
\'
\'
+(((isActive)?
\'
active
\'
:
\'\'
)+
\'
\'
+((isDisabled)?
\'
disabled
\'
:
\'\'
)))+
\'
\'
+errorClass)}}">52</view>
'
'
<view class="{{(((
(
\'
static
\'
)+
\'
\'
+
\'
_p
\'
)+
\'
\'
+(((isActive)?
\'
active
\'
:
\'\'
)+
\'
\'
+((isDisabled)?
\'
disabled
\'
:
\'\'
)))+
\'
\'
+errorClass)}}">52</view>
'
)
)
assertCodegen
(
assertCodegen
(
'
<div class="container" :class="computedClassObject">6</div>
'
,
'
<div class="container" :class="computedClassObject">6</div>
'
,
'
<view class="{{((
\'
container
_div
\'
)+
\'
\'
+computedClassObject)}}">6</view>
'
'
<view class="{{((
(
\'
container
\'
)+
\'
\'
+
\'
_div
\'
)+
\'
\'
+computedClassObject)}}">6</view>
'
)
)
// assertCodegen(
// assertCodegen(
// `<div class="container" :class="computedClassObject">6</div>`,
// `<div class="container" :class="computedClassObject">6</div>`,
...
@@ -174,11 +174,15 @@ describe('mp:compiler-mp-alipay', () => {
...
@@ -174,11 +174,15 @@ describe('mp:compiler-mp-alipay', () => {
)
)
assertCodegen
(
assertCodegen
(
'
<p :class="classStr1 || classStr2" class="bg">9</p>
'
,
'
<p :class="classStr1 || classStr2" class="bg">9</p>
'
,
'
<view class="{{((
\'
bg
_p
\'
)+
\'
\'
+(classStr1||classStr2))}}">9</view>
'
'
<view class="{{((
(
\'
bg
\'
)+
\'
\'
+
\'
_p
\'
)+
\'
\'
+(classStr1||classStr2))}}">9</view>
'
)
)
assertCodegen
(
assertCodegen
(
'
<p class="static" :class="[{ active: isActive }, errorClass, [flex,
\'
flex-row
\'
]]">10</p>
'
,
'
<p class="static" :class="[{ active: isActive }, errorClass, [flex,
\'
flex-row
\'
]]">10</p>
'
,
'
<view class="{{((((
\'
static _p
\'
)+
\'
\'
+((isActive)?
\'
active
\'
:
\'\'
))+
\'
\'
+errorClass)+
\'
\'
+((flex)+
\'
\'
+
\'
flex-row
\'
))}}">10</view>
'
'
<view class="{{(((((
\'
static
\'
)+
\'
\'
+
\'
_p
\'
)+
\'
\'
+((isActive)?
\'
active
\'
:
\'\'
))+
\'
\'
+errorClass)+
\'
\'
+((flex)+
\'
\'
+
\'
flex-row
\'
))}}">10</view>
'
)
assertCodegen
(
'
<p class="a external-class c" :class="class1">hello world</p>
'
,
'
<view class="{{(((((
\'
a
\'
)+
\'
\'
+
\'
external-class
\'
)+
\'
\'
+
\'
c
\'
)+
\'
\'
+
\'
_p
\'
)+
\'
\'
+class1)}}">hello world</view>
'
)
)
})
})
...
...
packages/uni-template-compiler/__tests__/compiler-mp-baidu.spec.js
浏览文件 @
3b44e515
...
@@ -15,6 +15,12 @@ function assertCodegen (template, templateCode, renderCode = 'with(this){}', opt
...
@@ -15,6 +15,12 @@ function assertCodegen (template, templateCode, renderCode = 'with(this){}', opt
}
}
describe
(
'
mp:compiler-mp-baidu
'
,
()
=>
{
describe
(
'
mp:compiler-mp-baidu
'
,
()
=>
{
it
(
'
generate class
'
,
()
=>
{
assertCodegen
(
'
<view class="a external-class c" :class="class1">hello world</view>
'
,
'
<view class="{{[
\'
a
\'
,
\'
external-class
\'
,
\'
c
\'
,class1]}}">hello world</view>
'
)
})
it
(
'
generate v-for directive
'
,
()
=>
{
it
(
'
generate v-for directive
'
,
()
=>
{
assertCodegen
(
assertCodegen
(
'
<view><view v-for="(item,index) in items" :key="index"></view></view>
'
,
'
<view><view v-for="(item,index) in items" :key="index"></view></view>
'
,
...
...
packages/uni-template-compiler/__tests__/compiler-mp-kuaishou.spec.js
浏览文件 @
3b44e515
...
@@ -20,6 +20,12 @@ function assertCodegen (template, templateCode, renderCode = 'with(this){}', opt
...
@@ -20,6 +20,12 @@ function assertCodegen (template, templateCode, renderCode = 'with(this){}', opt
}
}
describe
(
'
mp:compiler-mp-kuaishou
'
,
()
=>
{
describe
(
'
mp:compiler-mp-kuaishou
'
,
()
=>
{
it
(
'
generate class
'
,
()
=>
{
assertCodegen
(
'
<view class="a external-class c" :class="class1">hello world</view>
'
,
'
<view class="{{[
\'
a
\'
,
\'
external-class
\'
,
\'
c
\'
,class1]}}">hello world</view>
'
)
})
it
(
'
generate scoped slot
'
,
()
=>
{
it
(
'
generate scoped slot
'
,
()
=>
{
assertCodegen
(
assertCodegen
(
'
<foo><template slot-scope="{bar}">{{ bar.foo }}</template></foo>
'
,
'
<foo><template slot-scope="{bar}">{{ bar.foo }}</template></foo>
'
,
...
...
packages/uni-template-compiler/__tests__/compiler-mp-qq.spec.js
浏览文件 @
3b44e515
const
compiler
=
require
(
'
../lib
'
)
const
compiler
=
require
(
'
../lib
'
)
function
assertCodegen
(
template
,
templateCode
,
renderCode
=
'
with(this){}
'
,
options
=
{})
{
function
assertCodegen
(
template
,
templateCode
,
renderCode
=
'
with(this){}
'
,
options
=
{})
{
const
res
=
compiler
.
compile
(
template
,
{
const
res
=
compiler
.
compile
(
template
,
{
resourcePath
:
'
test.wxml
'
,
resourcePath
:
'
test.wxml
'
,
mp
:
Object
.
assign
({
mp
:
Object
.
assign
({
minified
:
true
,
minified
:
true
,
isTest
:
true
,
isTest
:
true
,
platform
:
'
mp-qq
'
platform
:
'
mp-qq
'
},
options
)
},
options
)
})
})
expect
(
res
.
template
).
toBe
(
templateCode
)
expect
(
res
.
template
).
toBe
(
templateCode
)
expect
(
res
.
render
).
toBe
(
renderCode
)
expect
(
res
.
render
).
toBe
(
renderCode
)
}
}
describe
(
'
mp:compiler-mp-qq
'
,
()
=>
{
describe
(
'
mp:compiler-mp-qq
'
,
()
=>
{
it
(
'
generate class
'
,
()
=>
{
assertCodegen
(
'
<view class="a external-class c" :class="class1">hello world</view>
'
,
'
<view class="{{[
\'
a
\'
,
\'
external-class
\'
,
\'
c
\'
,class1]}}">hello world</view>
'
)
})
it
(
'
generate text trim
'
,
()
=>
{
it
(
'
generate text trim
'
,
()
=>
{
assertCodegen
(
assertCodegen
(
'
<text>
\n
N: {{title}}
\n
′</text>
'
,
'
<text>
\n
N: {{title}}
\n
′</text>
'
,
...
@@ -33,5 +39,5 @@ describe('mp:compiler-mp-qq', () => {
...
@@ -33,5 +39,5 @@ describe('mp:compiler-mp-qq', () => {
我的第二行2{{title}}</text>`
,
我的第二行2{{title}}</text>`
,
'
<text>{{"我是第一行3
\\\\
n 我的第二行2"+title}}</text>
'
'
<text>{{"我是第一行3
\\\\
n 我的第二行2"+title}}</text>
'
)
)
})
})
})
})
packages/uni-template-compiler/__tests__/compiler-mp-toutiao.spec.js
浏览文件 @
3b44e515
...
@@ -36,27 +36,27 @@ describe('mp:compiler-mp-toutiao', () => {
...
@@ -36,27 +36,27 @@ describe('mp:compiler-mp-toutiao', () => {
)
)
assertCodegen
(
assertCodegen
(
'
<p class="static" :class="{ active: isActive,
\'
text-danger
\'
: hasError }">2</p>
'
,
'
<p class="static" :class="{ active: isActive,
\'
text-danger
\'
: hasError }">2</p>
'
,
'
<view class="{{(((
\'
static
_p
\'
)+
\'
\'
+((isActive)?
\'
active
\'
:
\'\'
))+
\'
\'
+((hasError)?
\'
text-danger
\'
:
\'\'
))}}">2</view>
'
'
<view class="{{(((
(
\'
static
\'
)+
\'
\'
+
\'
_p
\'
)+
\'
\'
+((isActive)?
\'
active
\'
:
\'\'
))+
\'
\'
+((hasError)?
\'
text-danger
\'
:
\'\'
))}}">2</view>
'
)
)
assertCodegen
(
assertCodegen
(
'
<p class="static" :class="[activeClass, errorClass]">3</p>
'
,
'
<p class="static" :class="[activeClass, errorClass]">3</p>
'
,
'
<view class="{{(((
\'
static
_p
\'
)+
\'
\'
+activeClass)+
\'
\'
+errorClass)}}">3</view>
'
'
<view class="{{(((
(
\'
static
\'
)+
\'
\'
+
\'
_p
\'
)+
\'
\'
+activeClass)+
\'
\'
+errorClass)}}">3</view>
'
)
)
assertCodegen
(
assertCodegen
(
'
<p class="static" :class="[isActive ? activeClass :
\'\'
, errorClass]">4</p>
'
,
'
<p class="static" :class="[isActive ? activeClass :
\'\'
, errorClass]">4</p>
'
,
'
<view class="{{(((
\'
static
_p
\'
)+
\'
\'
+(isActive?activeClass:
\'\'
))+
\'
\'
+errorClass)}}">4</view>
'
'
<view class="{{(((
(
\'
static
\'
)+
\'
\'
+
\'
_p
\'
)+
\'
\'
+(isActive?activeClass:
\'\'
))+
\'
\'
+errorClass)}}">4</view>
'
)
)
assertCodegen
(
assertCodegen
(
'
<p class="static" :class="[{ active: isActive }, errorClass]">5</p>
'
,
'
<p class="static" :class="[{ active: isActive }, errorClass]">5</p>
'
,
'
<view class="{{(((
\'
static
_p
\'
)+
\'
\'
+((isActive)?
\'
active
\'
:
\'\'
))+
\'
\'
+errorClass)}}">5</view>
'
'
<view class="{{(((
(
\'
static
\'
)+
\'
\'
+
\'
_p
\'
)+
\'
\'
+((isActive)?
\'
active
\'
:
\'\'
))+
\'
\'
+errorClass)}}">5</view>
'
)
)
assertCodegen
(
assertCodegen
(
'
<p class="static" :class="[{ active: isActive, disabled: isDisabled }, errorClass]">52</p>
'
,
'
<p class="static" :class="[{ active: isActive, disabled: isDisabled }, errorClass]">52</p>
'
,
'
<view class="{{(((
\'
static
_p
\'
)+
\'
\'
+(((isActive)?
\'
active
\'
:
\'\'
)+
\'
\'
+((isDisabled)?
\'
disabled
\'
:
\'\'
)))+
\'
\'
+errorClass)}}">52</view>
'
'
<view class="{{(((
(
\'
static
\'
)+
\'
\'
+
\'
_p
\'
)+
\'
\'
+(((isActive)?
\'
active
\'
:
\'\'
)+
\'
\'
+((isDisabled)?
\'
disabled
\'
:
\'\'
)))+
\'
\'
+errorClass)}}">52</view>
'
)
)
assertCodegen
(
assertCodegen
(
'
<div class="container" :class="computedClassObject">6</div>
'
,
'
<div class="container" :class="computedClassObject">6</div>
'
,
'
<view class="{{((
\'
container
_div
\'
)+
\'
\'
+computedClassObject)}}">6</view>
'
'
<view class="{{((
(
\'
container
\'
)+
\'
\'
+
\'
_div
\'
)+
\'
\'
+computedClassObject)}}">6</view>
'
)
)
// assertCodegen(
// assertCodegen(
// `<div class="container" :class="computedClassObject">6</div>`,
// `<div class="container" :class="computedClassObject">6</div>`,
...
@@ -73,11 +73,15 @@ describe('mp:compiler-mp-toutiao', () => {
...
@@ -73,11 +73,15 @@ describe('mp:compiler-mp-toutiao', () => {
)
)
assertCodegen
(
assertCodegen
(
'
<p :class="classStr1 || classStr2" class="bg">9</p>
'
,
'
<p :class="classStr1 || classStr2" class="bg">9</p>
'
,
'
<view class="{{((
\'
bg
_p
\'
)+
\'
\'
+(classStr1||classStr2))}}">9</view>
'
'
<view class="{{((
(
\'
bg
\'
)+
\'
\'
+
\'
_p
\'
)+
\'
\'
+(classStr1||classStr2))}}">9</view>
'
)
)
assertCodegen
(
assertCodegen
(
'
<p class="static" :class="[{ active: isActive }, errorClass, [flex,
\'
flex-row
\'
]]">10</p>
'
,
'
<p class="static" :class="[{ active: isActive }, errorClass, [flex,
\'
flex-row
\'
]]">10</p>
'
,
'
<view class="{{((((
\'
static _p
\'
)+
\'
\'
+((isActive)?
\'
active
\'
:
\'\'
))+
\'
\'
+errorClass)+
\'
\'
+((flex)+
\'
\'
+
\'
flex-row
\'
))}}">10</view>
'
'
<view class="{{(((((
\'
static
\'
)+
\'
\'
+
\'
_p
\'
)+
\'
\'
+((isActive)?
\'
active
\'
:
\'\'
))+
\'
\'
+errorClass)+
\'
\'
+((flex)+
\'
\'
+
\'
flex-row
\'
))}}">10</view>
'
)
assertCodegen
(
'
<p class="a external-class c" :class="class1">hello world</p>
'
,
'
<view class="{{(((((
\'
a
\'
)+
\'
\'
+
\'
external-class
\'
)+
\'
\'
+
\'
c
\'
)+
\'
\'
+
\'
_p
\'
)+
\'
\'
+class1)}}">hello world</view>
'
)
)
})
})
...
...
packages/uni-template-compiler/__tests__/compiler-mp-weixin.spec.js
浏览文件 @
3b44e515
...
@@ -20,6 +20,12 @@ function assertCodegen (template, templateCode, renderCode = 'with(this){}', opt
...
@@ -20,6 +20,12 @@ function assertCodegen (template, templateCode, renderCode = 'with(this){}', opt
}
}
describe
(
'
mp:compiler-mp-weixin
'
,
()
=>
{
describe
(
'
mp:compiler-mp-weixin
'
,
()
=>
{
it
(
'
generate class
'
,
()
=>
{
assertCodegen
(
'
<view class="a external-class c" :class="class1">hello world</view>
'
,
'
<view class="{{[
\'
a
\'
,
\'
external-class
\'
,
\'
c
\'
,class1]}}">hello world</view>
'
)
})
it
(
'
generate scoped slot
'
,
()
=>
{
it
(
'
generate scoped slot
'
,
()
=>
{
assertCodegen
(
assertCodegen
(
'
<foo><template slot-scope="{bar}">{{ bar.foo }}</template></foo>
'
,
'
<foo><template slot-scope="{bar}">{{ bar.foo }}</template></foo>
'
,
...
@@ -142,6 +148,14 @@ describe('mp:compiler-mp-weixin', () => {
...
@@ -142,6 +148,14 @@ describe('mp:compiler-mp-weixin', () => {
scopedSlotsCompiler
:
'
augmented
'
scopedSlotsCompiler
:
'
augmented
'
}
}
)
)
assertCodegen
(
'
<my-component><template v-slot="{item}">{{item}}<template></my-component>
'
,
'
<my-component vue-id="551070e6-1" bind:__l="__l" vue-slots="{{[
\'
default
\'
]}}"><block><block wx:if="{{$root.m0}}">{{$root.m1}}</block></block></my-component>
'
,
'
with(this){var m0=$hasScopedSlotsParams("551070e6-1");var m1=m0?$getScopedSlotsParams("551070e6-1","default","item"):null;$mp.data=Object.assign({},{$root:{m0:m0,m1:m1}})}
'
,
{
scopedSlotsCompiler
:
'
augmented
'
}
)
assertCodegen
(
assertCodegen
(
'
<my-component><template v-slot="item">{{getValue(item.text)}}<template></my-component>
'
,
'
<my-component><template v-slot="item">{{getValue(item.text)}}<template></my-component>
'
,
'
<my-component vue-id="551070e6-1" bind:__l="__l" vue-slots="{{[
\'
default
\'
]}}"><block><block wx:if="{{$root.m0}}">{{$root.m1}}</block></block></my-component>
'
,
'
<my-component vue-id="551070e6-1" bind:__l="__l" vue-slots="{{[
\'
default
\'
]}}"><block><block wx:if="{{$root.m0}}">{{$root.m1}}</block></block></my-component>
'
,
...
...
packages/uni-template-compiler/lib/script/traverse/data/class.js
浏览文件 @
3b44e515
...
@@ -8,9 +8,9 @@ function processClassArrayExpressionElements (classArrayExpression) {
...
@@ -8,9 +8,9 @@ function processClassArrayExpressionElements (classArrayExpression) {
let
binaryExpression
let
binaryExpression
classArrayExpression
.
elements
.
forEach
(
expr
=>
{
classArrayExpression
.
elements
.
forEach
(
expr
=>
{
if
(
t
.
isArrayExpression
(
expr
))
{
if
(
t
.
isArrayExpression
(
expr
))
{
expr
=
processClassArrayExpressionElements
(
expr
)
expr
=
processClassArrayExpressionElements
(
expr
)
}
}
if
(
!
binaryExpression
)
{
if
(
!
binaryExpression
)
{
binaryExpression
=
t
.
parenthesizedExpression
(
expr
)
binaryExpression
=
t
.
parenthesizedExpression
(
expr
)
}
else
{
}
else
{
...
@@ -31,9 +31,10 @@ function processClassArrayExpressionElements (classArrayExpression) {
...
@@ -31,9 +31,10 @@ function processClassArrayExpressionElements (classArrayExpression) {
function
processStaticClass
(
classArrayExpression
,
staticClassPath
,
state
)
{
function
processStaticClass
(
classArrayExpression
,
staticClassPath
,
state
)
{
if
(
staticClassPath
)
{
if
(
staticClassPath
)
{
classArrayExpression
.
elements
.
unshift
(
const
staticClassPathArr
=
staticClassPath
.
node
.
value
.
value
.
split
(
'
'
)
t
.
stringLiteral
(
staticClassPath
.
node
.
value
.
value
)
for
(
let
len
=
staticClassPathArr
.
length
,
index
=
len
-
1
;
index
>=
0
;
index
--
)
{
)
classArrayExpression
.
elements
.
unshift
(
t
.
stringLiteral
(
staticClassPathArr
[
index
]))
}
staticClassPath
.
remove
()
staticClassPath
.
remove
()
}
}
if
(
if
(
...
@@ -135,4 +136,4 @@ module.exports = function processClass (paths, path, state) {
...
@@ -135,4 +136,4 @@ module.exports = function processClass (paths, path, state) {
}
}
}
}
return
[]
return
[]
}
}
packages/uni-template-compiler/lib/script/traverse/resolve-scoped-slots.js
浏览文件 @
3b44e515
...
@@ -64,7 +64,7 @@ module.exports = function getResolveScopedSlots (parent, state) {
...
@@ -64,7 +64,7 @@ module.exports = function getResolveScopedSlots (parent, state) {
updateIds
(
vueId
,
slot
,
params
.
node
.
name
)
updateIds
(
vueId
,
slot
,
params
.
node
.
name
)
}
}
const
fnBody
=
fn
.
get
(
'
value.body
'
)
const
fnBody
=
fn
.
get
(
'
value.body
'
)
if
(
needSlotMode
(
fnBody
,
ids
))
{
if
(
state
.
options
.
scopedSlotsCompiler
===
'
augmented
'
||
needSlotMode
(
fnBody
,
ids
))
{
if
(
replaceId
(
fnBody
,
ids
))
{
if
(
replaceId
(
fnBody
,
ids
))
{
const
orgin
=
fnBody
.
get
(
'
body.0.argument
'
)
const
orgin
=
fnBody
.
get
(
'
body.0.argument
'
)
const
elements
=
orgin
.
get
(
'
elements
'
)
const
elements
=
orgin
.
get
(
'
elements
'
)
...
...
packages/vue-cli-plugin-hbuilderx/packages/weex-styler/lib/validator.js
浏览文件 @
3b44e515
...
@@ -549,6 +549,7 @@ function FLEW_WRAP_VALIDATOR (v) {
...
@@ -549,6 +549,7 @@ function FLEW_WRAP_VALIDATOR (v) {
var
PROP_NAME_GROUPS
=
{
var
PROP_NAME_GROUPS
=
{
boxModel
:
{
boxModel
:
{
display
:
genEnumValidator
([
'
flex
'
]),
width
:
LENGTH_VALIDATOR
,
width
:
LENGTH_VALIDATOR
,
height
:
LENGTH_VALIDATOR
,
height
:
LENGTH_VALIDATOR
,
overflow
:
genEnumValidator
([
'
hidden
'
]),
overflow
:
genEnumValidator
([
'
hidden
'
]),
...
...
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
浏览文件 @
3b44e515
此差异已折叠。
点击以展开。
packages/webpack-uni-pages-loader/lib/platforms/mp-qq/project.config.json
浏览文件 @
3b44e515
...
@@ -8,7 +8,8 @@
...
@@ -8,7 +8,8 @@
"es6"
:
false
,
"es6"
:
false
,
"postcss"
:
false
,
"postcss"
:
false
,
"minified"
:
false
,
"minified"
:
false
,
"newFeature"
:
true
"newFeature"
:
true
,
"nodeModules"
:
false
},
},
"compileType"
:
"miniprogram"
,
"compileType"
:
"miniprogram"
,
"libVersion"
:
"1.6.3"
,
"libVersion"
:
"1.6.3"
,
...
@@ -32,4 +33,4 @@
...
@@ -32,4 +33,4 @@
"list"
:
[]
"list"
:
[]
}
}
}
}
}
}
src/core/helpers/protocol/ui/popup.js
浏览文件 @
3b44e515
...
@@ -51,7 +51,7 @@ export const showToast = {
...
@@ -51,7 +51,7 @@ export const showToast = {
icon
:
{
icon
:
{
default
:
'
success
'
,
default
:
'
success
'
,
validator
(
icon
,
params
)
{
validator
(
icon
,
params
)
{
if
([
'
success
'
,
'
loading
'
,
'
none
'
].
indexOf
(
icon
)
===
-
1
)
{
if
([
'
success
'
,
'
loading
'
,
'
error
'
,
'
none
'
].
indexOf
(
icon
)
===
-
1
)
{
params
.
icon
=
'
success
'
params
.
icon
=
'
success
'
}
}
}
}
...
@@ -122,4 +122,4 @@ export const showActionSheet = {
...
@@ -122,4 +122,4 @@ export const showActionSheet = {
popover
:
{
popover
:
{
type
:
Object
type
:
Object
}
}
}
}
src/core/view/components/input/index.vue
浏览文件 @
3b44e515
...
@@ -178,10 +178,28 @@ export default {
...
@@ -178,10 +178,28 @@ export default {
})
})
},
},
_onInput
(
$event
,
force
)
{
_onInput
(
$event
,
force
)
{
let
outOfMaxlength
=
false
if
(
this
.
composing
)
{
if
(
this
.
composing
)
{
return
return
}
}
// type="number" 不支持 maxlength 属性,因此需要主动限制长度。
if
(
this
.
inputType
===
'
number
'
)
{
const
maxlength
=
parseInt
(
this
.
maxlength
,
10
)
if
(
maxlength
>
0
&&
$event
.
target
.
value
.
length
>
maxlength
)
{
// 输入前字符长度超出范围,则不触发input,且将值还原
// 否则截取一定长度且触发input
if
(
this
.
cachedValue
.
length
===
maxlength
)
{
this
.
valueSync
=
this
.
cachedValue
outOfMaxlength
=
true
}
else
{
$event
.
target
.
value
=
$event
.
target
.
value
.
slice
(
0
,
maxlength
)
this
.
valueSync
=
$event
.
target
.
value
}
}
}
if
(
~
NUMBER_TYPES
.
indexOf
(
this
.
type
))
{
if
(
~
NUMBER_TYPES
.
indexOf
(
this
.
type
))
{
// 在输入 - 负号 的情况下,event.target.value没有值,但是会触发校验 false
// 在输入 - 负号 的情况下,event.target.value没有值,但是会触发校验 false
this
.
valid
=
this
.
$refs
.
input
.
validity
&&
this
.
$refs
.
input
.
validity
.
valid
this
.
valid
=
this
.
$refs
.
input
.
validity
&&
this
.
$refs
.
input
.
validity
.
valid
...
@@ -200,16 +218,7 @@ export default {
...
@@ -200,16 +218,7 @@ export default {
}
}
}
}
// type="number" 不支持 maxlength 属性,因此需要主动限制长度。
if
(
outOfMaxlength
)
return
if
(
this
.
inputType
===
'
number
'
)
{
const
maxlength
=
parseInt
(
this
.
maxlength
,
10
)
if
(
maxlength
>
0
&&
$event
.
target
.
value
.
length
>
maxlength
)
{
$event
.
target
.
value
=
$event
.
target
.
value
.
slice
(
0
,
maxlength
)
this
.
valueSync
=
$event
.
target
.
value
// 字符长度超出范围不触发 input 事件
return
}
}
this
.
$triggerInput
(
$event
,
Object
.
assign
({
this
.
$triggerInput
(
$event
,
Object
.
assign
({
value
:
this
.
valueSync
value
:
this
.
valueSync
...
...
src/core/view/components/textarea/index.vue
浏览文件 @
3b44e515
...
@@ -270,6 +270,7 @@ uni-textarea[hidden] {
...
@@ -270,6 +270,7 @@ uni-textarea[hidden] {
position
:
relative
;
position
:
relative
;
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
min-height
:
inherit
;
}
}
.uni-textarea-placeholder
,
.uni-textarea-placeholder
,
.uni-textarea-line
,
.uni-textarea-line
,
...
...
src/core/view/index.css
浏览文件 @
3b44e515
...
@@ -64,6 +64,10 @@ body {
...
@@ -64,6 +64,10 @@ body {
content
:
"\EA08"
;
content
:
"\EA08"
;
}
}
.uni-icon-error
:before
{
content
:
"\EA0B"
;
}
.uni-loading
,
.uni-loading
,
uni-button
[
loading
]
:before
{
uni-button
[
loading
]
:before
{
background
:
transparent
url("data:image/svg+xml;base64, PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGg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DYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=")
no-repeat
;
...
...
src/core/view/mixins/field.js
浏览文件 @
3b44e515
...
@@ -117,6 +117,7 @@ export default {
...
@@ -117,6 +117,7 @@ export default {
},
100
)
},
100
)
this
.
$watch
(
'
value
'
,
valueChange
)
this
.
$watch
(
'
value
'
,
valueChange
)
this
.
__triggerInput
=
throttle
((
$event
,
detail
)
=>
{
this
.
__triggerInput
=
throttle
((
$event
,
detail
)
=>
{
this
.
__valueChange
.
cancel
()
this
.
$emit
(
'
update:value
'
,
detail
.
value
)
this
.
$emit
(
'
update:value
'
,
detail
.
value
)
this
.
$trigger
(
'
input
'
,
$event
,
detail
)
this
.
$trigger
(
'
input
'
,
$event
,
detail
)
},
100
)
},
100
)
...
...
src/core/view/mixins/keyboard.js
浏览文件 @
3b44e515
...
@@ -188,6 +188,9 @@ export default {
...
@@ -188,6 +188,9 @@ export default {
}
}
el
.
addEventListener
(
'
blur
'
,
()
=>
{
el
.
addEventListener
(
'
blur
'
,
()
=>
{
// 在iOS设备上,手动调用uni.hideKeyboard(),键盘收起并且触发blur,但实际并没有blur。
// 此时如果再点击页面其他地方会重新聚焦,此处做处理
el
.
blur
()
focus
=
false
focus
=
false
onKeyboardHide
()
onKeyboardHide
()
})
})
...
...
src/platforms/app-plus/service/api/location/get-location.js
浏览文件 @
3b44e515
import
{
import
{
wgs84togcj02
,
wgs84togcj02
,
gcj02towgs84
gcj02towgs84
,
warpPlusErrorCallback
}
from
'
../util
'
}
from
'
../util
'
import
{
import
{
...
@@ -53,6 +54,7 @@ export function getLocation ({
...
@@ -53,6 +54,7 @@ export function getLocation ({
geocode
=
false
,
geocode
=
false
,
altitude
=
false
altitude
=
false
}
=
{},
callbackId
)
{
}
=
{},
callbackId
)
{
const
errorCallback
=
warpPlusErrorCallback
(
callbackId
,
'
getLocation
'
)
plus
.
geolocation
.
getCurrentPosition
(
plus
.
geolocation
.
getCurrentPosition
(
position
=>
{
position
=>
{
getLocationSuccess
(
type
,
position
,
callbackId
)
getLocationSuccess
(
type
,
position
,
callbackId
)
...
@@ -63,10 +65,7 @@ export function getLocation ({
...
@@ -63,10 +65,7 @@ export function getLocation ({
getLocationSuccess
(
type
,
e
,
callbackId
)
getLocationSuccess
(
type
,
e
,
callbackId
)
return
return
}
}
errorCallback
(
e
)
invoke
(
callbackId
,
{
errMsg
:
'
getLocation:fail
'
+
e
.
message
})
},
{
},
{
geocode
:
geocode
,
geocode
:
geocode
,
enableHighAccuracy
:
altitude
enableHighAccuracy
:
altitude
...
...
src/platforms/app-plus/service/api/ui/popup.js
浏览文件 @
3b44e515
...
@@ -43,7 +43,7 @@ export function showToast ({
...
@@ -43,7 +43,7 @@ export function showToast ({
})
})
toast
=
true
toast
=
true
}
else
{
}
else
{
if
(
icon
&&
!~
[
'
success
'
,
'
loading
'
,
'
none
'
].
indexOf
(
icon
))
{
if
(
icon
&&
!~
[
'
success
'
,
'
loading
'
,
'
error
'
,
'
none
'
].
indexOf
(
icon
))
{
icon
=
'
success
'
icon
=
'
success
'
}
}
const
waitingOptions
=
{
const
waitingOptions
=
{
...
@@ -70,11 +70,11 @@ export function showToast ({
...
@@ -70,11 +70,11 @@ export function showToast ({
interval
:
duration
interval
:
duration
}
}
}
else
{
}
else
{
if
(
icon
===
'
success
'
)
{
if
(
icon
!==
'
loading
'
)
{
waitingOptions
.
loading
=
{
waitingOptions
.
loading
=
{
display
:
'
block
'
,
display
:
'
block
'
,
height
:
'
55px
'
,
height
:
'
55px
'
,
icon
:
'
__uniappsuccess
.png
'
,
icon
:
icon
===
'
success
'
?
'
__uniappsuccess.png
'
:
'
__uniapperror
.png
'
,
interval
:
duration
interval
:
duration
}
}
}
}
...
...
src/platforms/app-plus/view/components/video/index.vue
浏览文件 @
3b44e515
...
@@ -174,13 +174,13 @@ export default {
...
@@ -174,13 +174,13 @@ export default {
},
},
header
:
{
header
:
{
type
:
Object
,
type
:
Object
,
defult
()
{
def
a
ult
()
{
return
{}
return
{}
}
}
},
},
advanced
:
{
advanced
:
{
type
:
Array
,
type
:
Array
,
defult
()
{
def
a
ult
()
{
return
[]
return
[]
}
}
}
}
...
...
src/platforms/app-plus/view/index.css
浏览文件 @
3b44e515
...
@@ -72,6 +72,10 @@ body {
...
@@ -72,6 +72,10 @@ body {
content
:
"\EA08"
;
content
:
"\EA08"
;
}
}
.uni-icon-error
:before
{
content
:
"\EA0B"
;
}
.uni-loading
,
.uni-loading
,
uni-button
[
loading
]
:before
{
uni-button
[
loading
]
:before
{
background
:
transparent
url("data:image/svg+xml;base64, PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5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A2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=")
no-repeat
;
...
...
src/platforms/h5/components/app/popup/toast.vue
浏览文件 @
3b44e515
...
@@ -52,7 +52,7 @@ export default {
...
@@ -52,7 +52,7 @@ export default {
icon
:
{
icon
:
{
default
:
'
success
'
,
default
:
'
success
'
,
validator
(
value
)
{
validator
(
value
)
{
return
[
'
success
'
,
'
loading
'
,
'
none
'
].
indexOf
(
value
)
!==
-
1
return
[
'
success
'
,
'
loading
'
,
'
error
'
,
'
none
'
].
indexOf
(
value
)
!==
-
1
}
}
},
},
image
:
{
image
:
{
...
@@ -80,6 +80,9 @@ export default {
...
@@ -80,6 +80,9 @@ export default {
if
(
this
.
icon
===
'
loading
'
)
{
if
(
this
.
icon
===
'
loading
'
)
{
return
'
uni-loading
'
return
'
uni-loading
'
}
}
if
(
this
.
icon
===
'
error
'
)
{
return
'
uni-icon-error
'
}
return
''
return
''
}
}
},
},
...
@@ -168,6 +171,11 @@ uni-toast .uni-icon_toast.uni-icon-success-no-circle:before {
...
@@ -168,6 +171,11 @@ uni-toast .uni-icon_toast.uni-icon-success-no-circle:before {
font-size
:
55px
;
font-size
:
55px
;
}
}
uni-toast
.uni-icon_toast.uni-icon-error
:before
{
color
:
#ffffff
;
font-size
:
50px
;
}
uni-toast
.uni-icon_toast.uni-loading
{
uni-toast
.uni-icon_toast.uni-loading
{
margin
:
20px
0
0
;
margin
:
20px
0
0
;
width
:
38px
;
width
:
38px
;
...
...
src/platforms/h5/view/components/ad/index.vue
浏览文件 @
3b44e515
...
@@ -78,9 +78,9 @@ class AdConfig {
...
@@ -78,9 +78,9 @@ class AdConfig {
_doCallback
(
adpid
,
success
,
fail
)
{
_doCallback
(
adpid
,
success
,
fail
)
{
AdConfig
.
IS
++
AdConfig
.
IS
++
var
data
=
this
.
_adConfig
var
{
a
,
b
}
=
this
.
_adConfig
if
(
dat
a
[
adpid
])
{
if
(
a
[
adpid
])
{
success
(
dat
a
[
adpid
])
success
(
b
,
a
[
adpid
])
}
else
{
}
else
{
fail
(
this
.
ERROR_INVALID_ADPID
)
fail
(
this
.
ERROR_INVALID_ADPID
)
}
}
...
@@ -95,7 +95,7 @@ class AdConfig {
...
@@ -95,7 +95,7 @@ class AdConfig {
uni
.
request
({
uni
.
request
({
url
:
this
.
URL
,
url
:
this
.
URL
,
method
:
'
GET
'
,
method
:
'
GET
'
,
timeout
:
5
000
,
timeout
:
8
000
,
data
:
{
data
:
{
d
:
location
.
hostname
,
d
:
location
.
hostname
,
a
:
adpid
a
:
adpid
...
@@ -150,11 +150,11 @@ class AdConfig {
...
@@ -150,11 +150,11 @@ class AdConfig {
}
}
}
}
Object
.
assign
(
AdConfig
.
prototype
,
{
Object
.
assign
(
AdConfig
.
prototype
,
{
URL
:
'
//qy5y9ee9ch8r87pg72w5.dcloud.net.cn/hcs
'
,
URL
:
'
https://hac1.dcloud.net.cn/ah5
'
,
KEY
:
'
uni_app_ad_config
'
,
KEY
:
'
uni_app_ad_config
'
,
CACHE_TIME
:
1000
*
60
*
10
,
CACHE_TIME
:
1000
*
60
*
10
,
ERROR_INVALID_ADPID
:
{
ERROR_INVALID_ADPID
:
{
'
-5002
'
:
'
无效
adpid
'
'
-5002
'
:
'
invalid
adpid
'
}
}
})
})
...
@@ -234,17 +234,73 @@ class AdReport {
...
@@ -234,17 +234,73 @@ class AdReport {
}
}
}
}
Object
.
assign
(
AdReport
.
prototype
,
{
Object
.
assign
(
AdReport
.
prototype
,
{
URL
:
'
//hp66hwpyev7yx2hfughh
.dcloud.net.cn/ahl
'
,
URL
:
'
https://has1
.dcloud.net.cn/ahl
'
,
KEY
:
'
uni_app_ad_guid
'
KEY
:
'
uni_app_ad_guid
'
})
})
const
adProvider
=
{
class
AdScript
{
hx
:
'
zswx_hx
'
,
static
get
instance
()
{
ky
:
'
zswx_ky
'
if
(
this
.
_instance
==
null
)
{
this
.
_instance
=
new
AdScript
()
}
return
this
.
_instance
}
constructor
()
{
this
.
_instance
=
null
this
.
_callback
=
{}
this
.
_cache
=
{}
}
load
(
data
,
success
,
fail
)
{
const
provider
=
data
.
provider
if
(
this
.
_cache
[
provider
]
===
undefined
)
{
this
.
loadScript
(
data
)
}
if
(
this
.
_cache
[
provider
]
===
1
)
{
success
()
}
else
{
if
(
!
this
.
_callback
[
provider
])
{
this
.
_callback
[
provider
]
=
[]
}
this
.
_callback
[
provider
].
push
({
success
,
fail
})
}
}
loadScript
(
data
)
{
const
provider
=
data
.
provider
this
.
_cache
[
provider
]
=
0
var
ads
=
document
.
createElement
(
'
script
'
)
ads
.
setAttribute
(
'
id
'
,
'
uniad_provider
'
+
provider
)
const
script
=
data
.
script
for
(
const
var1
in
script
)
{
ads
.
setAttribute
(
var1
,
script
[
var1
])
}
ads
.
onload
=
()
=>
{
this
.
_cache
[
provider
]
=
1
this
.
_callback
[
provider
].
forEach
(({
success
})
=>
{
success
()
})
this
.
_callback
[
provider
].
length
=
0
}
ads
.
onerror
=
(
err
)
=>
{
this
.
_cache
[
provider
]
=
undefined
this
.
_callback
[
provider
].
forEach
(({
fail
})
=>
{
fail
(
err
)
})
this
.
_callback
[
provider
].
length
=
0
}
document
.
body
.
append
(
ads
)
}
}
}
const
CHECK_RENDER_DELAY
=
1000
const
CHECK_RENDER_DELAY
=
1000
const
CHECK_RENDER_RETRY
=
3
const
CHECK_RENDER_RETRY
=
5
const
DEFAULT_WIDESCREEN_WIDTH
=
750
export
default
{
export
default
{
name
:
'
Ad
'
,
name
:
'
Ad
'
,
...
@@ -253,6 +309,14 @@ export default {
...
@@ -253,6 +309,14 @@ export default {
adpid
:
{
adpid
:
{
type
:
[
Number
,
String
],
type
:
[
Number
,
String
],
default
:
''
default
:
''
},
adpidWidescreen
:
{
type
:
[
Number
,
String
],
default
:
''
},
widescreenWidth
:
{
type
:
[
Number
,
String
],
default
:
DEFAULT_WIDESCREEN_WIDTH
}
}
},
},
watch
:
{
watch
:
{
...
@@ -260,19 +324,25 @@ export default {
...
@@ -260,19 +324,25 @@ export default {
if
(
val
)
{
if
(
val
)
{
this
.
_loadData
(
val
)
this
.
_loadData
(
val
)
}
}
},
adpidWidescreen
(
val
)
{
if
(
val
)
{
this
.
_loadData
(
val
)
}
}
}
},
},
mounted
()
{
mounted
()
{
this
.
_p
=
{}
this
.
_pl
=
[]
this
.
_pl
=
[]
this
.
_pd
=
{}
this
.
_pi
=
0
this
.
_pi
=
0
this
.
_checkTimer
=
null
this
.
_checkTimer
=
null
this
.
_checkTimerCount
=
0
this
.
_checkTimerCount
=
0
this
.
_isWidescreen
=
this
.
$refs
.
container
.
clientWidth
>
parseInt
(
this
.
widescreenWidth
)
this
.
_loadData
()
this
.
_loadData
()
AdReport
.
instance
.
get
({
AdReport
.
instance
.
get
({
h
:
__uniConfig
.
compilerVersion
,
h
:
__uniConfig
.
compilerVersion
,
a
:
this
.
adpid
,
a
:
this
.
adpid
,
at
:
30
,
at
:
-
3
,
ic
:
AdConfig
.
IC
,
ic
:
AdConfig
.
IC
,
is
:
AdConfig
.
IS
is
:
AdConfig
.
IS
})
})
...
@@ -286,17 +356,18 @@ export default {
...
@@ -286,17 +356,18 @@ export default {
this
.
_report
(
41
)
this
.
_report
(
41
)
},
},
_reset
()
{
_reset
()
{
this
.
_p
=
{}
this
.
_pl
=
[]
this
.
_pl
=
[]
this
.
_pd
=
{}
this
.
_pi
=
0
this
.
_pi
=
0
this
.
_clearCheckTimer
()
this
.
_clearCheckTimer
()
this
.
$refs
.
container
.
innerHTML
=
''
this
.
$refs
.
container
.
innerHTML
=
''
},
},
_loadData
(
adpid
)
{
_loadData
(
adpid
)
{
this
.
_reset
()
this
.
_reset
()
AdConfig
.
instance
.
get
(
adpid
||
this
.
adpid
,
(
data
)
=>
{
const
aid
=
adpid
||
(
this
.
_isWidescreen
?
this
.
adpidWidescreen
:
this
.
adpid
)
this
.
_pd
=
data
AdConfig
.
instance
.
get
(
aid
,
(
b
,
a
)
=>
{
this
.
_pl
=
data
.
psp
.
split
(
'
,
'
)
this
.
_b
=
b
this
.
_pl
=
a
this
.
_renderAd
()
this
.
_renderAd
()
},
(
err
)
=>
{
},
(
err
)
=>
{
this
.
$trigger
(
'
error
'
,
{},
err
)
this
.
$trigger
(
'
error
'
,
{},
err
)
...
@@ -307,56 +378,37 @@ export default {
...
@@ -307,56 +378,37 @@ export default {
return
return
}
}
var
ap
=
this
.
_pl
[
this
.
_pi
]
const
data
=
this
.
_pl
[
this
.
_pi
]
var
data
=
this
.
_pd
[
ap
]
const
providerId
=
data
.
a1
switch
(
ap
)
{
this
.
_b
[
providerId
].
provider
=
providerId
case
adProvider
.
hx
:
this
.
_renderHX
(
data
)
break
case
adProvider
.
ky
:
this
.
_renderKY
(
data
)
break
}
},
_renderNext
()
{
if
(
this
.
_pi
>=
this
.
_pl
.
length
-
1
)
{
return
}
this
.
_pi
++
AdScript
.
instance
.
load
(
this
.
_b
[
providerId
],
()
=>
{
this
.
_renderAd
()
this
.
_renderAdView
(
this
.
_b
[
providerId
],
data
)
},
(
err
)
=>
{
this
.
$trigger
(
'
error
'
,
{},
err
)
})
},
},
_renderHX
(
data
)
{
_renderAdView
(
provider
,
data
)
{
if
(
document
.
querySelector
(
'
#
'
+
adProvider
.
hx
))
{
var
randomId
=
this
.
_randomId
()
this
.
_renderNext
()
return
}
var
ad
=
document
.
createElement
(
'
script
'
)
ad
.
src
=
data
.
src
||
data
.
url
var
adView
=
document
.
createElement
(
'
div
'
)
var
adView
=
document
.
createElement
(
'
div
'
)
adView
.
setAttribute
(
'
id
'
,
adProvider
.
hx
)
adView
.
setAttribute
(
'
class
'
,
randomId
)
adView
.
appendChild
(
ad
)
this
.
$refs
.
container
.
innerHTML
=
''
this
.
$refs
.
container
.
innerHTML
=
''
this
.
$refs
.
container
.
append
(
adView
)
this
.
$refs
.
container
.
append
(
adView
)
let
bindThis
=
window
provider
.
s
.
split
(
'
.
'
).
reduce
((
total
,
currentValue
)
=>
{
bindThis
=
total
return
total
[
currentValue
]
},
window
).
bind
(
bindThis
)(
data
.
a2
,
randomId
,
2
)
this
.
_startCheckTimer
()
this
.
_startCheckTimer
()
},
},
_renderKY
(
data
)
{
_renderNext
()
{
var
randomId
=
this
.
_randomId
()
if
(
this
.
_pi
>=
this
.
_pl
.
length
-
1
)
{
var
ad
=
document
.
createElement
(
'
script
'
)
return
ad
.
src
=
(
data
.
src
||
data
.
url
)
+
'
&_ct=
'
+
randomId
}
var
adView
=
document
.
createElement
(
'
div
'
)
adView
.
setAttribute
(
'
id
'
,
randomId
)
adView
.
appendChild
(
ad
)
this
.
$refs
.
container
.
innerHTML
=
''
this
.
$refs
.
container
.
append
(
adView
)
this
.
_startCheckTimer
()
this
.
_pi
++
this
.
_renderAd
()
},
},
_checkRender
()
{
_checkRender
()
{
var
hasContent
=
(
this
.
$refs
.
container
.
children
.
length
>
0
&&
this
.
$refs
.
container
.
clientHeight
>
40
)
var
hasContent
=
(
this
.
$refs
.
container
.
children
.
length
>
0
&&
this
.
$refs
.
container
.
clientHeight
>
40
)
...
@@ -388,27 +440,18 @@ export default {
...
@@ -388,27 +440,18 @@ export default {
}
}
},
},
_report
(
type
)
{
_report
(
type
)
{
var
taskId
=
''
if
(
this
.
_pl
.
length
>
0
&&
this
.
_pi
<
this
.
_pl
.
length
)
{
var
data
=
this
.
_pd
[
this
.
_pl
[
this
.
_pi
]]
if
(
data
)
{
taskId
=
data
.
task_id
}
}
AdReport
.
instance
.
get
({
AdReport
.
instance
.
get
({
h
:
__uniConfig
.
compilerVersion
,
h
:
__uniConfig
.
compilerVersion
,
a
:
this
.
adpid
,
a
:
this
.
adpid
,
t
:
taskId
,
at
:
type
at
:
type
})
})
},
},
_randomId
()
{
_randomId
()
{
var
result
=
''
var
result
=
''
for
(
let
i
=
0
;
i
<
2
;
i
++
)
{
for
(
let
i
=
0
;
i
<
4
;
i
++
)
{
result
+=
(
65536
*
(
1
+
Math
.
random
())
|
0
).
toString
(
16
).
substring
(
1
)
result
+=
(
65536
*
(
1
+
Math
.
random
())
|
0
).
toString
(
16
).
substring
(
1
)
}
}
return
result
return
'
_u
'
+
result
}
}
}
}
}
}
...
...
src/platforms/h5/view/index.css
浏览文件 @
3b44e515
...
@@ -64,6 +64,10 @@ body {
...
@@ -64,6 +64,10 @@ body {
content
:
"\EA08"
;
content
:
"\EA08"
;
}
}
.uni-icon-error
:before
{
content
:
"\EA0B"
;
}
.uni-loading
,
.uni-loading
,
uni-button
[
loading
]
:before
{
uni-button
[
loading
]
:before
{
background
:
transparent
url("data:image/svg+xml;base64, PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5Ny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1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=")
no-repeat
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录