Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CoderSmallfan
uni-app
提交
692dc058
U
uni-app
项目概览
CoderSmallfan
/
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,发现更多精彩内容 >>
提交
692dc058
编写于
10月 30, 2018
作者:
hbcui1984
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update hello uni-app
上级
f85e9822
变更
22
显示空白变更内容
内联
并排
Showing
22 changed file
with
617 addition
and
442 deletion
+617
-442
examples/hello-uniapp/common/uni.css
examples/hello-uniapp/common/uni.css
+9
-3
examples/hello-uniapp/components/load-more.vue
examples/hello-uniapp/components/load-more.vue
+49
-40
examples/hello-uniapp/components/uni-badge.vue
examples/hello-uniapp/components/uni-badge.vue
+1
-3
examples/hello-uniapp/pages.json
examples/hello-uniapp/pages.json
+85
-40
examples/hello-uniapp/pages/API/canvas/canvas.vue
examples/hello-uniapp/pages/API/canvas/canvas.vue
+4
-4
examples/hello-uniapp/pages/API/image/image.vue
examples/hello-uniapp/pages/API/image/image.vue
+53
-56
examples/hello-uniapp/pages/component/button/button.vue
examples/hello-uniapp/pages/component/button/button.vue
+5
-1
examples/hello-uniapp/pages/component/checkbox/checkbox.vue
examples/hello-uniapp/pages/component/checkbox/checkbox.vue
+1
-1
examples/hello-uniapp/pages/component/picker/picker.vue
examples/hello-uniapp/pages/component/picker/picker.vue
+34
-6
examples/hello-uniapp/pages/component/progress/progress.vue
examples/hello-uniapp/pages/component/progress/progress.vue
+6
-2
examples/hello-uniapp/pages/component/radio/radio.vue
examples/hello-uniapp/pages/component/radio/radio.vue
+2
-2
examples/hello-uniapp/pages/component/scroll-view/scroll-view.vue
.../hello-uniapp/pages/component/scroll-view/scroll-view.vue
+23
-7
examples/hello-uniapp/pages/component/slider/slider.vue
examples/hello-uniapp/pages/component/slider/slider.vue
+35
-30
examples/hello-uniapp/pages/component/web-view/web-view.vue
examples/hello-uniapp/pages/component/web-view/web-view.vue
+12
-14
examples/hello-uniapp/pages/tabBar/component/component.vue
examples/hello-uniapp/pages/tabBar/component/component.vue
+133
-106
examples/hello-uniapp/pages/tabBar/template/template.vue
examples/hello-uniapp/pages/tabBar/template/template.vue
+17
-2
examples/hello-uniapp/pages/template/mpvue-picker/mpvue-picker.vue
...hello-uniapp/pages/template/mpvue-picker/mpvue-picker.vue
+10
-0
examples/hello-uniapp/pages/template/nav-bar/nav-bar.vue
examples/hello-uniapp/pages/template/nav-bar/nav-bar.vue
+108
-99
examples/hello-uniapp/pages/template/segmented-control/segmented-control.vue
...pp/pages/template/segmented-control/segmented-control.vue
+1
-1
examples/hello-uniapp/pages/template/tabbar/detail/detail.vue
...ples/hello-uniapp/pages/template/tabbar/detail/detail.vue
+1
-1
examples/hello-uniapp/platforms/app-plus/about/about.vue
examples/hello-uniapp/platforms/app-plus/about/about.vue
+6
-1
examples/hello-uniapp/platforms/app-plus/feedback/feedback.vue
...les/hello-uniapp/platforms/app-plus/feedback/feedback.vue
+22
-23
未找到文件。
examples/hello-uniapp/common/uni.css
浏览文件 @
692dc058
...
...
@@ -83,8 +83,9 @@
/*数字角标*/
.uni-badge
,
.uni-badge-default
{
font-family
:
'Helvetica Neue'
,
Helvetica
,
sans-serif
;
.uni-badge
,
.uni-badge-default
{
font-family
:
'Helvetica Neue'
,
Helvetica
,
sans-serif
;
font-size
:
12px
;
line-height
:
1
;
display
:
inline-block
;
...
...
@@ -631,7 +632,12 @@
.uni-uploader-body
{
margin-top
:
16
upx
;
overflow
:
hidden
;
}
.uni-uploader__files
{
display
:
flex
;
flex-direction
:
row
;
flex-wrap
:
wrap
;
}
.uni-uploader__file
{
...
...
examples/hello-uniapp/components/load-more.vue
浏览文件 @
692dc058
...
...
@@ -25,7 +25,7 @@
</
template
>
<
script
>
export
default
{
export
default
{
name
:
"
load-more
"
,
props
:
{
loadingType
:
{
...
...
@@ -43,17 +43,19 @@ export default {
},
contentText
:
{
type
:
Object
,
default
:
{
default
()
{
return
{
contentdown
:
"
上拉显示更多
"
,
contentrefresh
:
"
正在加载...
"
,
contentnomore
:
"
没有更多数据了
"
};
}
}
},
data
()
{
return
{}
}
}
}
</
script
>
<
style
>
...
...
@@ -64,11 +66,13 @@ export default {
align-items
:
center
;
justify-content
:
center
;
}
.loading-img
{
.loading-img
{
height
:
24px
;
width
:
24px
;
margin-right
:
10px
;
margin-right
:
10px
;
}
.loading-text
{
font-size
:
15px
;
color
:
#777777
;
...
...
@@ -77,10 +81,14 @@ export default {
.loading-img
>
view
{
position
:
absolute
;
}
.load1
,
.load2
,
.load3
{
.load1
,
.load2
,
.load3
{
height
:
24px
;
width
:
24px
;
}
.load2
{
transform
:
rotate
(
30deg
);
}
...
...
@@ -103,25 +111,25 @@ export default {
.loading-img
>
view
view
:nth-child
(
1
)
{
transform
:
rotate
(
90deg
);
top
:
2px
;
left
:
9px
;
top
:
2px
;
left
:
9px
;
}
.loading-img
>
view
view
:nth-child
(
2
)
{
-webkit-transform
:
rotate
(
180deg
);
top
:
11px
;
right
:
0px
;
top
:
11px
;
right
:
0px
;
}
.loading-img
>
view
view
:nth-child
(
3
)
{
transform
:
rotate
(
270deg
);
bottom
:
2px
;
left
:
9px
;
bottom
:
2px
;
left
:
9px
;
}
.loading-img
>
view
view
:nth-child
(
4
)
{
top
:
11px
;
left
:
0px
;
top
:
11px
;
left
:
0px
;
}
.load1
view
:nth-child
(
1
)
{
...
...
@@ -176,6 +184,7 @@ export default {
0
%
{
opacity
:
1
;
}
100
%
{
opacity
:
0.2
;
}
...
...
examples/hello-uniapp/components/uni-badge.vue
浏览文件 @
692dc058
<
template
>
<text
class=
"uni-badge"
v-if=
"text"
:class=
"[inverted === true ? 'uni-badge-inverted' : '','uni-badge-'+type]"
@
click=
"onClick()"
>
{{
text
}}
</text>
<text
class=
"uni-badge"
v-if=
"text"
:class=
"[inverted === true ? 'uni-badge-inverted' : '','uni-badge-'+type]"
@
click=
"onClick()"
>
{{
text
}}
</text>
</
template
>
<
script
>
...
...
examples/hello-uniapp/pages.json
浏览文件 @
692dc058
...
...
@@ -74,9 +74,9 @@
}
},
{
"path"
:
"pages/component/movable-view/movable-view"
,
"style"
:
{
"navigationBarTitleText"
:
"movable-view"
"path"
:
"pages/component/movable-view/movable-view"
,
"style"
:
{
"navigationBarTitleText"
:
"movable-view"
}
},
{
...
...
@@ -477,16 +477,14 @@
}
},
{
"path"
:
"platforms/app-plus/tabbar-nvue/tabbar-nvue"
,
"path"
:
"platforms/app-plus/tabbar/tabbar"
,
"style"
:
{
"navigationBarTitleText"
:
"顶部选项卡(原生)"
"navigationBarTitleText"
:
"顶部选项卡(非原生)"
}
},
{
"path"
:
"platforms/app-plus/tabbar-nvue/detail"
,
"style"
:
{
"navigationBarTitleText"
:
"详情页面"
}
"path"
:
"platforms/app-plus/web-view-local/web-view-local"
,
"style"
:
{}
}
],
"subPackages"
:
[
...
...
@@ -653,7 +651,18 @@
{
"path"
:
"tabbar/tabbar"
,
"style"
:
{
"navigationBarTitleText"
:
"顶部选项卡(非原生)"
"navigationBarTitleText"
:
"顶部选项卡"
,
"app-plus"
:
{
"titleNView"
:
{
"titleText"
:
"顶部选项卡(原生)"
}
}
}
},
{
"path"
:
"tabbar/detail/detail"
,
"style"
:
{
"navigationBarTitleText"
:
"详情页面"
}
},
{
...
...
@@ -732,10 +741,16 @@
"path"
:
"nav-bar/nav-bar"
,
"style"
:
{
"navigationBarTitleText"
:
"导航栏组件"
,
"enablePullDownRefresh"
:
true
,
"app-plus"
:
{
"titleNView"
:
false
,
"bounce"
:
"none"
,
"scrollIndicator"
:
"none"
"scrollIndicator"
:
"none"
,
"pullToRefresh"
:
{
"style"
:
"circle"
,
"offset"
:
"70px"
,
"color"
:
"#007AFF"
}
}
}
},
...
...
@@ -746,22 +761,52 @@
}
},
{
"path"
:
"scrollmsg/scrollmsg"
,
"path"
:
"scrollmsg/scrollmsg"
,
"style"
:
{
"navigationBarTitleText"
:
"滚动公告"
}
},
{
"path"
:
"steps/steps"
,
"path"
:
"steps/steps"
,
"style"
:
{
"navigationBarTitleText"
:
"步骤展示"
}
},
{
"path"
:
"comments/comments"
,
"path"
:
"comments/comments"
,
"style"
:
{
"navigationBarTitleText"
:
"评论界面"
}
},
{
"path"
:
"timeline/timeline"
,
"style"
:
{
"navigationBarTitleText"
:
"时间轴 timeline"
}
},
{
"path"
:
"tag/tag"
,
"style"
:
{
"navigationBarTitleText"
:
"标签tag"
}
},
{
"path"
:
"countdown/countdown"
,
"style"
:
{
"navigationBarTitleText"
:
"倒计时"
}
},
{
"path"
:
"datachecker/datachecker"
,
"style"
:
{
"navigationBarTitleText"
:
"表单校验"
}
},
{
"path"
:
"sbanner/sbanner"
,
"style"
:
{
"navigationBarTitleText"
:
"插屏弹窗"
}
}
]
}
...
...
examples/hello-uniapp/pages/API/canvas/canvas.vue
浏览文件 @
692dc058
...
...
@@ -8,7 +8,7 @@
<block
v-for=
"(name, index) in names"
:key=
"index"
>
<button
class=
"canvas-button"
@
tap=
"handleCanvasButton(name)"
>
{{
name
}}
</button>
</block>
<
!--
<button
class=
"canvas-button"
@
tap=
"toTempFilePath"
type=
"primary"
>
toTempFilePath
</button>
--
>
<
button
class=
"canvas-button"
@
tap=
"toTempFilePath"
type=
"primary"
>
toTempFilePath
</button
>
</scroll-view>
</view>
</view>
...
...
@@ -35,10 +35,10 @@
uni
.
canvasToTempFilePath
({
canvasId
:
'
canvas
'
,
success
:
function
(
res
)
{
console
.
log
(
res
)
console
.
log
(
res
.
tempFilePath
)
},
fail
:
function
(
res
)
{
console
.
log
(
res
)
fail
:
function
(
err
)
{
console
.
error
(
JSON
.
stringify
(
err
)
)
}
})
},
...
...
examples/hello-uniapp/pages/API/image/image.vue
浏览文件 @
692dc058
...
...
@@ -15,7 +15,7 @@
</picker>
</view>
</view>
<!-- #ifdef MP-WEIXIN -->
<view
class=
"uni-list-cell"
>
<view
class=
"uni-list-cell-left"
>
<view
class=
"uni-label"
>
图片质量
</view>
...
...
@@ -26,7 +26,6 @@
</picker>
</view>
</view>
<!-- #endif -->
<view
class=
"uni-list-cell"
>
<view
class=
"uni-list-cell-left"
>
...
...
@@ -54,7 +53,6 @@
<image
class=
"uni-uploader__img"
:src=
"image"
:data-src=
"image"
@
tap=
"previewImage"
></image>
</view>
</block>
</view>
<view
class=
"uni-uploader__input-box"
>
<view
class=
"uni-uploader__input"
@
tap=
"chooseImage"
></view>
</view>
...
...
@@ -62,6 +60,7 @@
</view>
</view>
</view>
</view>
</view>
</form>
...
...
@@ -92,62 +91,60 @@
count
:
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
]
}
},
onUnload
(){
onUnload
()
{
this
.
imageList
=
[],
this
.
sourceTypeIndex
=
2
,
this
.
sourceType
=
[
'
拍照
'
,
'
相册
'
,
'
拍照或相册
'
],
this
.
sizeTypeIndex
=
2
,
this
.
sizeType
=
[
'
压缩
'
,
'
原图
'
,
'
压缩或原图
'
],
this
.
countIndex
=
8
;
this
.
sourceTypeIndex
=
2
,
this
.
sourceType
=
[
'
拍照
'
,
'
相册
'
,
'
拍照或相册
'
],
this
.
sizeTypeIndex
=
2
,
this
.
sizeType
=
[
'
压缩
'
,
'
原图
'
,
'
压缩或原图
'
],
this
.
countIndex
=
8
;
},
methods
:
{
sourceTypeChange
:
function
(
e
)
{
sourceTypeChange
:
function
(
e
)
{
this
.
sourceTypeIndex
=
e
.
target
.
value
},
sizeTypeChange
:
function
(
e
)
{
sizeTypeChange
:
function
(
e
)
{
this
.
sizeTypeIndex
=
e
.
target
.
value
},
countChange
:
function
(
e
)
{
countChange
:
function
(
e
)
{
this
.
countIndex
=
e
.
target
.
value
;
},
chooseImage
:
async
function
()
{
if
(
this
.
imageList
.
length
===
9
)
{
chooseImage
:
async
function
()
{
if
(
this
.
imageList
.
length
===
9
)
{
let
isContinue
=
await
this
.
isFullImg
();
console
.
log
(
"
是否继续?
"
,
isContinue
);
if
(
!
isContinue
)
{
console
.
log
(
"
是否继续?
"
,
isContinue
);
if
(
!
isContinue
)
{
return
;
}
}
uni
.
chooseImage
({
sourceType
:
sourceType
[
this
.
sourceTypeIndex
],
// #ifdef MP-WEIXIN
sizeType
:
sizeType
[
this
.
sizeTypeIndex
],
// #endif
count
:
this
.
imageList
.
length
+
this
.
count
[
this
.
countIndex
]
>
9
?
9
-
this
.
imageList
.
length
:
this
.
count
[
this
.
countIndex
],
success
:
(
res
)
=>
{
this
.
imageList
=
this
.
imageList
.
concat
(
res
.
tempFilePaths
);
}
})
},
isFullImg
:
function
()
{
isFullImg
:
function
()
{
return
new
Promise
((
res
)
=>
{
uni
.
showModal
({
content
:
"
已经有9张图片了,是否清空现有图片?
"
,
content
:
"
已经有9张图片了,是否清空现有图片?
"
,
success
:
(
e
)
=>
{
if
(
e
.
confirm
)
{
if
(
e
.
confirm
)
{
this
.
imageList
=
[];
res
(
true
);
}
else
{
}
else
{
res
(
false
)
}
},
fail
:
()
=>
{
fail
:
()
=>
{
res
(
false
)
}
})
})
},
previewImage
:
function
(
e
)
{
previewImage
:
function
(
e
)
{
var
current
=
e
.
target
.
dataset
.
src
uni
.
previewImage
({
current
:
current
,
...
...
examples/hello-uniapp/pages/component/button/button.vue
浏览文件 @
692dc058
...
...
@@ -24,6 +24,10 @@
<button
class=
"mini-btn"
type=
"default"
size=
"mini"
>
按钮
</button>
<button
class=
"mini-btn"
type=
"warn"
size=
"mini"
>
按钮
</button>
</view>
<!-- #ifdef MP-WEIXIN -->
<button
open-type=
"launchApp"
app-parameter=
"uni-app"
binderror=
"launchAppError"
>
打开APP
</button>
<button
open-type=
"feedback"
>
意见反馈
</button>
<!-- #endif -->
</view>
</view>
</view>
...
...
examples/hello-uniapp/pages/component/checkbox/checkbox.vue
浏览文件 @
692dc058
...
...
@@ -64,7 +64,7 @@
methods
:
{
checkboxChange
:
function
(
e
)
{
var
items
=
this
.
items
,
values
=
e
.
target
.
value
;
values
=
e
.
detail
.
value
;
for
(
var
i
=
0
,
lenI
=
items
.
length
;
i
<
lenI
;
++
i
)
{
items
[
i
].
checked
=
false
;
for
(
var
j
=
0
,
lenJ
=
values
.
length
;
j
<
lenJ
;
++
j
)
{
...
...
examples/hello-uniapp/pages/component/picker/picker.vue
浏览文件 @
692dc058
...
...
@@ -38,7 +38,7 @@
当前选择
</view>
<view
class=
"uni-list-cell-db"
>
<picker
mode=
"date"
:value=
"date"
start=
"2015-09-01"
end=
"2017-09-01
"
@
change=
"bindDateChange"
>
<picker
mode=
"date"
:value=
"date"
:start=
"startDate"
:end=
"endDate
"
@
change=
"bindDateChange"
>
<view
class=
"uni-input"
>
{{
date
}}
</view>
</picker>
</view>
...
...
@@ -52,24 +52,52 @@
<
script
>
export
default
{
data
()
{
const
currentDate
=
this
.
getDate
({
format
:
true
});
return
{
title
:
'
picker
'
,
array
:
[
'
中国
'
,
'
美国
'
,
'
巴西
'
,
'
日本
'
],
index
:
0
,
date
:
'
2016-09-01
'
,
date
:
currentDate
,
time
:
'
12:01
'
}
},
computed
:
{
startDate
()
{
return
this
.
getDate
(
'
start
'
);
},
endDate
()
{
return
this
.
getDate
(
'
end
'
);
}
},
methods
:
{
bindPickerChange
:
function
(
e
)
{
bindPickerChange
:
function
(
e
)
{
console
.
log
(
'
picker发送选择改变,携带值为
'
,
e
.
target
.
value
)
this
.
index
=
e
.
target
.
value
},
bindDateChange
:
function
(
e
)
{
bindDateChange
:
function
(
e
)
{
this
.
date
=
e
.
target
.
value
},
bindTimeChange
:
function
(
e
)
{
bindTimeChange
:
function
(
e
)
{
this
.
time
=
e
.
target
.
value
},
getDate
(
type
)
{
const
date
=
new
Date
();
let
year
=
date
.
getFullYear
();
let
month
=
date
.
getMonth
()
+
1
;
let
day
=
date
.
getDate
();
if
(
type
===
'
start
'
)
{
year
=
year
-
60
;
}
else
if
(
type
===
'
end
'
)
{
year
=
year
+
2
;
}
month
=
month
>
9
?
month
:
'
0
'
+
month
;;
day
=
day
>
9
?
day
:
'
0
'
+
day
;
return
`
${
year
}
-
${
month
}
-
${
day
}
`
;
}
}
}
...
...
examples/hello-uniapp/pages/component/progress/progress.vue
浏览文件 @
692dc058
...
...
@@ -8,7 +8,7 @@
</view>
<view
class=
"progress-box"
>
<progress
percent=
"40"
active
stroke-width=
"3"
/>
<
icon
class=
"progress-cancel"
type=
"cancel"
></
icon>
<
uni-icon
type=
"close"
class=
"progress-cancel"
color=
"#dd524d"
></uni-
icon>
</view>
<view
class=
"progress-box"
>
<progress
percent=
"60"
active
stroke-width=
"3"
/>
...
...
@@ -21,12 +21,16 @@
</view>
</
template
>
<
script
>
import
uniIcon
from
'
../../../components/uni-icon.vue
'
export
default
{
data
()
{
return
{
title
:
'
progress
'
}
}
},
components
:
{
uniIcon
},
}
</
script
>
...
...
examples/hello-uniapp/pages/component/radio/radio.vue
浏览文件 @
692dc058
...
...
@@ -62,10 +62,10 @@
},
methods
:
{
radioChange
:
function
(
e
)
{
console
.
log
(
'
radio发生change事件,携带value值为:
'
,
e
.
target
.
value
)
console
.
log
(
'
radio发生change事件,携带value值为:
'
,
e
.
detail
.
value
)
var
items
=
this
.
items
;
for
(
var
i
=
0
,
len
=
items
.
length
;
i
<
len
;
++
i
)
{
items
[
i
].
checked
=
items
[
i
].
value
==
e
.
target
.
value
items
[
i
].
checked
=
items
[
i
].
value
==
e
.
detail
.
value
}
this
.
items
=
items
...
...
examples/hello-uniapp/pages/component/scroll-view/scroll-view.vue
浏览文件 @
692dc058
...
...
@@ -7,12 +7,16 @@
<text>
Vertical Scroll\n纵向滚动
</text>
</view>
<view
class=
"page-section-spacing"
>
<scroll-view
scroll-y=
"true"
class=
"scroll-Y"
@
scrolltoupper=
"upper"
@
scrolltolower=
"lower"
@
scroll=
"scroll"
>
<scroll-view
:scroll-top=
"scrollTop"
scroll-y=
"true"
class=
"scroll-Y"
@
scrolltoupper=
"upper"
@
scrolltolower=
"lower"
@
scroll=
"scroll"
>
<view
id=
"demo1"
class=
"scroll-view-item color1"
>
A
</view>
<view
id=
"demo2"
class=
"scroll-view-item color2"
>
B
</view>
<view
id=
"demo3"
class=
"scroll-view-item color3"
>
C
</view>
</scroll-view>
</view>
<view
class=
"btn-area"
>
<button
@
tap=
"goTop"
class=
"page-body-button"
type=
"default"
>
返回顶部
</button>
</view>
</view>
<view
class=
"page-section"
>
<view
class=
"page-section-title"
>
...
...
@@ -33,18 +37,30 @@
export
default
{
data
()
{
return
{
title
:
'
scroll-view
'
title
:
'
scroll-view
'
,
scrollTop
:
0
,
old
:
{
scrollTop
:
0
}
}
},
methods
:
{
upper
:
function
(
e
)
{
upper
:
function
(
e
)
{
console
.
log
(
e
)
},
lower
:
function
(
e
)
{
lower
:
function
(
e
)
{
console
.
log
(
e
)
},
scroll
:
function
(
e
)
{
scroll
:
function
(
e
)
{
console
.
log
(
e
)
this
.
old
.
scrollTop
=
e
.
detail
.
scrollTop
},
goTop
:
function
(
e
)
{
// 解决view层不同步的问题
this
.
scrollTop
=
this
.
old
.
scrollTop
this
.
$nextTick
(
function
()
{
this
.
scrollTop
=
0
})
}
}
}
...
...
examples/hello-uniapp/pages/component/slider/slider.vue
浏览文件 @
692dc058
...
...
@@ -5,21 +5,21 @@
<view
class=
"page-section page-section-gap"
>
<view
class=
"page-section-title"
>
设置step
</view>
<view
class=
"body-view"
>
<slider
value=
"60"
@
change=
"slider2c
hange"
step=
"5"
/>
<slider
value=
"60"
@
change=
"sliderC
hange"
step=
"5"
/>
</view>
</view>
<view
class=
"page-section page-section-gap"
>
<view
class=
"page-section-title"
>
显示当前value
</view>
<view
class=
"body-view"
>
<slider
value=
"50"
@
change=
"slider3change"
show-value
/>
<slider
value=
"50"
@
change=
"sliderChange"
show-value
/>
</view>
</view>
<view
class=
"page-section page-section-gap"
>
<view
class=
"page-section-title"
>
设置最小/最大值
</view>
<view
class=
"body-view"
>
<slider
value=
"100"
@
change=
"slider4change"
min=
"50"
max=
"200"
show-value
/>
<slider
value=
"100"
@
change=
"sliderChange"
min=
"50"
max=
"200"
show-value
/>
</view>
</view>
</view>
...
...
@@ -31,6 +31,11 @@
return
{
title
:
'
slider
'
}
},
methods
:
{
sliderChange
(
e
)
{
console
.
log
(
'
value 发生变化:
'
+
e
.
detail
.
value
)
}
}
}
</
script
>
examples/hello-uniapp/pages/component/web-view/web-view.vue
浏览文件 @
692dc058
...
...
@@ -5,9 +5,7 @@
</
template
>
<
script
>
export
default
{
}
export
default
{}
</
script
>
<
style
>
...
...
examples/hello-uniapp/pages/tabBar/component/component.vue
浏览文件 @
692dc058
...
...
@@ -14,8 +14,9 @@
{{
list
.
name
}}
</view>
<view
class=
"uni-list uni-collapse"
:class=
"list.open ? 'uni-active' : ''"
>
<view
class=
"uni-list-cell"
hover-class=
"uni-list-cell-hover"
v-for=
"(item,key) in list.pages"
:key=
"key"
@
click=
"goDetailPage(item)"
>
<view
class=
"uni-list-cell-navigate uni-navigate-right"
>
{{
item
}}
</view>
<view
class=
"uni-list-cell"
hover-class=
"uni-list-cell-hover"
v-for=
"(item,key) in list.pages"
:key=
"key"
@
click=
"goDetailPage(item)"
>
<view
class=
"uni-list-cell-navigate uni-navigate-right"
>
{{
item
.
name
?
item
.
name
:
item
}}
</view>
</view>
</view>
</view>
...
...
@@ -41,7 +42,8 @@
id
:
'
form
'
,
name
:
'
表单组件
'
,
open
:
false
,
pages
:
[
'
button
'
,
'
checkbox
'
,
'
form
'
,
'
input
'
,
'
label
'
,
'
picker
'
,
'
picker-view
'
,
'
radio
'
,
'
slider
'
,
pages
:
[
'
button
'
,
'
checkbox
'
,
'
form
'
,
'
input
'
,
'
label
'
,
'
picker
'
,
'
picker-view
'
,
'
radio
'
,
'
slider
'
,
'
switch
'
,
'
textarea
'
]
},
{
...
...
@@ -59,21 +61,40 @@
name
:
'
地图
'
,
open
:
false
,
pages
:
[
'
map
'
]
},
{
},
{
id
:
'
web-view
'
,
name
:
'
网页
'
,
open
:
false
,
pages
:
[
'
web-view
'
]
}]
}
]
}
},
onLoad
()
{
// #ifdef APP-PLUS
//web-view组件支持本地html,依赖最新版的客户端基座
var
innerversion
=
plus
.
runtime
.
innerVersion
;
var
_v
=
innerversion
.
substring
(
innerversion
.
lastIndexOf
(
'
.
'
)
+
1
,
innerversion
.
length
);
if
(
_v
&&
parseInt
(
_v
)
>=
53650
)
{
var
newPages
=
[{
name
:
'
网络网页
'
,
url
:
'
/pages/component/web-view/web-view
'
},
{
name
:
'
本地网页
'
,
url
:
'
/platforms/app-plus/web-view-local/web-view-local
'
}];
this
.
lists
[
this
.
lists
.
length
-
1
].
pages
=
newPages
;
}
// #endif
},
onShareAppMessage
()
{
return
{
title
:
'
欢迎体验uni-app
'
,
path
:
'
/pages/tabBar/component/component
'
}
},
onNavigationBarButtonTap
(
e
)
{
onNavigationBarButtonTap
(
e
)
{
uni
.
navigateTo
({
url
:
'
/platforms/app-plus/about/about
'
})
...
...
@@ -89,9 +110,15 @@
}
},
goDetailPage
(
e
)
{
if
(
typeof
e
===
'
string
'
)
{
uni
.
navigateTo
({
url
:
'
/pages/component/
'
+
e
+
'
/
'
+
e
})
}
else
{
uni
.
navigateTo
({
url
:
e
.
url
})
}
}
}
}
...
...
examples/hello-uniapp/pages/tabBar/template/template.vue
浏览文件 @
692dc058
...
...
@@ -66,10 +66,10 @@
open
:
false
,
pages
:
[{
name
:
'
非原生
'
,
url
:
'
tabbar
'
url
:
'
/platforms/app-plus/tabbar/
tabbar
'
},
{
name
:
'
原生
'
,
url
:
'
/platforms/app-plus/tabbar-nvue/tabbar-nvue
'
url
:
'
tabbar
'
}]
// #endif
},
{
...
...
@@ -131,6 +131,12 @@
name
:
'
自定义
'
,
url
:
'
lazy-load-custom
'
}]
},{
name
:
'
时间轴 timeline
'
,
url
:
'
timeline
'
},
{
name
:
'
标签 tag
'
,
url
:
'
tag
'
},
{
name
:
'
ECharts图表
'
,
url
:
'
echarts
'
...
...
@@ -171,6 +177,15 @@
},
{
name
:
'
滚动公告
'
,
url
:
'
scrollmsg
'
},{
name
:
'
表单验证
'
,
url
:
'
datachecker
'
},{
name
:
'
插屏弹窗
'
,
url
:
'
sbanner
'
},{
name
:
'
倒计时
'
,
url
:
'
countdown
'
}
// #ifdef APP-PLUS
,
{
...
...
examples/hello-uniapp/pages/template/mpvue-picker/mpvue-picker.vue
浏览文件 @
692dc058
...
...
@@ -86,6 +86,16 @@
this
.
pickerText
=
JSON
.
stringify
(
e
)
}
},
onBackPress
()
{
if
(
this
.
$refs
.
mpvuePicker
.
showPicker
)
{
this
.
$refs
.
mpvuePicker
.
pickerCancel
();
return
true
;
}
if
(
this
.
$refs
.
mpvueCityPicker
.
showPicker
)
{
this
.
$refs
.
mpvueCityPicker
.
pickerCancel
();
return
true
;
}
},
onUnload
()
{
if
(
this
.
$refs
.
mpvuePicker
.
showPicker
)
{
this
.
$refs
.
mpvuePicker
.
pickerCancel
()
...
...
examples/hello-uniapp/pages/template/nav-bar/nav-bar.vue
浏览文件 @
692dc058
...
...
@@ -2,7 +2,8 @@
<view>
<!-- #ifdef APP-PLUS -->
<!-- 固定在顶部的导航栏 -->
<uni-nav-bar
fixed=
"true"
left-icon=
"back"
@
click-left=
"back"
@
click-right=
"showMenu"
left-text=
"返回"
right-text=
"菜单"
title=
"导航栏组件"
></uni-nav-bar>
<uni-nav-bar
fixed=
"true"
left-icon=
"back"
@
click-left=
"back"
@
click-right=
"showMenu"
left-text=
"返回"
right-text=
"菜单"
title=
"导航栏组件"
></uni-nav-bar>
<!-- 占位用的导航栏 -->
<uni-nav-bar
background-color=
"rgba(0,0,0,0)"
status-bar=
"true"
></uni-nav-bar>
<!-- #endif -->
...
...
@@ -14,7 +15,8 @@
<uni-nav-bar
left-icon=
"back"
@
click-left=
"back"
@
click-right=
"showMenu"
left-text=
"返回"
right-text=
"菜单"
title=
"标题"
></uni-nav-bar>
<uni-nav-bar
left-icon=
"back"
@
click-left=
"showMenu"
@
click-right=
"showMenu"
left-text=
"菜单"
right-text=
"菜单"
title=
"标题"
></uni-nav-bar>
-->
<view
class=
"title"
>
其他常见样式
</view>
<uni-nav-bar
color=
"#333333"
background-color=
"#FFFFFF"
fixed=
"false"
right-icon=
"scan"
@
click-left=
"showCity"
@
click-right=
"scan"
>
<uni-nav-bar
color=
"#333333"
background-color=
"#FFFFFF"
fixed=
"false"
right-icon=
"scan"
@
click-left=
"showCity"
@
click-right=
"scan"
>
<block
slot=
"left"
>
<view
class=
"city"
>
<text>
{{
city
}}
</text>
...
...
@@ -38,9 +40,9 @@
uniNavBar
,
uniIcon
},
data
()
{
return
{
city
:
'
北京
'
data
()
{
return
{
city
:
'
北京
'
}
},
methods
:
{
...
...
@@ -79,6 +81,13 @@
title
:
'
搜索
'
})
}
},
onPullDownRefresh
()
{
console
.
log
(
'
onPullDownRefresh
'
)
setTimeout
(
function
()
{
uni
.
stopPullDownRefresh
()
console
.
log
(
'
stopPullDownRefresh
'
)
},
1000
)
}
}
</
script
>
...
...
examples/hello-uniapp/pages/template/segmented-control/segmented-control.vue
浏览文件 @
692dc058
<
template
>
<view
class=
"page"
>
<view
class=
"head"
>
<segmented-control
:values=
"items"
v-on:clickItem=
"onClickItem"
:styleType=
"styleType"
:activeColor=
"activeColor"
></segmented-control>
<segmented-control
:
current=
"current"
:
values=
"items"
v-on:clickItem=
"onClickItem"
:styleType=
"styleType"
:activeColor=
"activeColor"
></segmented-control>
</view>
<view
class=
"content"
>
<view
v-show=
"current === 0"
>
...
...
examples/hello-uniapp/p
latforms/app-plus/tabbar-nvue
/detail.vue
→
examples/hello-uniapp/p
ages/template/tabbar/detail
/detail.vue
浏览文件 @
692dc058
<
template
>
<view
class=
"root"
>
<view
class=
"page-body"
>
<view
class=
"page-section-title"
>
这是
nvue 页面跳转 vue
页面的演示,下面是页面跳转时传递过来的标题:
</view>
<view
class=
"page-section-title"
>
这是
选项卡页面跳转详情
页面的演示,下面是页面跳转时传递过来的标题:
</view>
<view
class=
"page-section-title"
>
{{
data
}}
</view>
</view>
</view>
...
...
examples/hello-uniapp/platforms/app-plus/about/about.vue
浏览文件 @
692dc058
<
template
>
<view
class=
"about"
>
<view
class=
"content"
>
<view
style=
"display:flex;align-items: center;flex-direction: column;
"
>
<view
class=
"qrcode
"
>
<image
src=
"https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/app_download.png"
@
longtap=
"save"
></image>
<text>
扫码体验uni-app
</text>
</view>
...
...
@@ -143,6 +143,11 @@
flex-direction
:
column
;
justify-content
:
center
;
}
.qrcode
{
display
:
flex
;
align-items
:
center
;
flex-direction
:
column
;
}
.desc
{
margin-top
:
30
upx
;
display
:
block
;
...
...
examples/hello-uniapp/platforms/app-plus/feedback/feedback.vue
浏览文件 @
692dc058
...
...
@@ -14,22 +14,23 @@
<view
class=
"uni-uploader"
>
<view
class=
"uni-uploader-head"
>
<view
class=
"uni-uploader-title"
>
点击预览图片
</view>
<view
class=
"uni-uploader-info"
>
{{
imageList
.
length
}}
/
9
</view>
<view
class=
"uni-uploader-info"
>
{{
imageList
.
length
}}
/
8
</view>
</view>
<view
class=
"uni-uploader-body"
>
<view
class=
"uni-uploader__files"
>
<block
v-for=
"(image,index) in imageList"
:key=
"index"
>
<view
class=
"uni-uploader__file"
>
<view
class=
"uni-uploader__file"
style=
"position: relative;"
>
<image
class=
"uni-uploader__img"
:src=
"image"
@
tap=
"previewImage"
></image>
<view
class=
"close-view"
@
click=
"close(index)"
>
x
</view>
</view>
</block>
</view>
<view
class=
"uni-uploader__input-box"
>
<view
class=
"uni-uploader__input-box"
v-show=
"imageList.length
<
8"
>
<view
class=
"uni-uploader__input"
@
tap=
"chooseImg"
></view>
</view>
</view>
</view>
</view>
</view>
<view
class=
'feedback-title'
>
<text>
QQ/邮箱
</text>
</view>
...
...
@@ -63,14 +64,6 @@
}
}
},
onUnload
()
{
this
.
imageList
=
[];
this
.
sendDate
=
{
score
:
0
,
content
:
""
,
contact
:
""
}
},
onLoad
()
{
let
deviceInfo
=
{
appid
:
plus
.
runtime
.
appid
,
...
...
@@ -85,6 +78,9 @@
this
.
sendDate
=
Object
.
assign
(
deviceInfo
,
this
.
sendDate
);
},
methods
:
{
close
(
e
){
this
.
imageList
.
splice
(
e
,
1
);
},
chooseMsg
()
{
//快速输入
uni
.
showActionSheet
({
itemList
:
this
.
msgContents
,
...
...
@@ -97,9 +93,9 @@
uni
.
chooseImage
({
sourceType
:
[
"
camera
"
,
"
album
"
],
sizeType
:
"
compressed
"
,
count
:
9
,
count
:
8
-
this
.
imageList
.
length
,
success
:
(
res
)
=>
{
this
.
imageList
=
res
.
tempFilePaths
;
this
.
imageList
=
this
.
imageList
.
concat
(
res
.
tempFilePaths
)
;
}
})
},
...
...
@@ -153,4 +149,7 @@
.input-view
{
font-size
:
28
upx
;
}
.close-view
{
text-align
:
center
;
line-height
:
14px
;
height
:
16px
;
width
:
16px
;
border-radius
:
50%
;
background
:
#FF5053
;
color
:
#FFFFFF
;
position
:
absolute
;
top
:
-6px
;
right
:
-4px
;
font-size
:
12px
;
}
</
style
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录