Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
c0bd179c
U
uni-app
项目概览
DCloud
/
uni-app
30 天 前同步成功
通知
702
Star
38704
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c0bd179c
编写于
8月 03, 2018
作者:
H
hulinNeil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新部分示例
上级
cb3739e3
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
69 addition
and
46 deletion
+69
-46
examples/hello-uniapp/common/uni.css
examples/hello-uniapp/common/uni.css
+12
-6
examples/hello-uniapp/pages.json
examples/hello-uniapp/pages.json
+1
-1
examples/hello-uniapp/pages/API/API.vue
examples/hello-uniapp/pages/API/API.vue
+6
-6
examples/hello-uniapp/pages/API/action-sheet/action-sheet.vue
...ples/hello-uniapp/pages/API/action-sheet/action-sheet.vue
+5
-1
examples/hello-uniapp/pages/API/get-network-type/get-network-type.vue
...lo-uniapp/pages/API/get-network-type/get-network-type.vue
+3
-0
examples/hello-uniapp/pages/API/get-system-info/get-system-info.vue
...ello-uniapp/pages/API/get-system-info/get-system-info.vue
+3
-0
examples/hello-uniapp/pages/API/scan-code/scan-code.vue
examples/hello-uniapp/pages/API/scan-code/scan-code.vue
+4
-1
examples/hello-uniapp/pages/API/share/share.vue
examples/hello-uniapp/pages/API/share/share.vue
+19
-1
examples/hello-uniapp/pages/component/component.vue
examples/hello-uniapp/pages/component/component.vue
+4
-2
examples/hello-uniapp/pages/component/form/form.vue
examples/hello-uniapp/pages/component/form/form.vue
+3
-3
examples/hello-uniapp/pages/component/input/input.vue
examples/hello-uniapp/pages/component/input/input.vue
+5
-18
examples/hello-uniapp/pages/component/video/video.vue
examples/hello-uniapp/pages/component/video/video.vue
+1
-1
examples/hello-uniapp/pages/template/list2detail-detail/list2detail-detail.vue
.../pages/template/list2detail-detail/list2detail-detail.vue
+1
-1
examples/hello-uniapp/pages/template/template.vue
examples/hello-uniapp/pages/template/template.vue
+1
-3
examples/hello-uniapp/platforms/app-plus/feedback/feedback.vue
...les/hello-uniapp/platforms/app-plus/feedback/feedback.vue
+1
-2
未找到文件。
examples/hello-uniapp/common/uni.css
浏览文件 @
c0bd179c
...
...
@@ -62,9 +62,10 @@
}
.uni-input
{
height
:
80px
;
min-height
:
80px
;
line-height
:
80px
;
height
:
50px
;
min-height
:
50px
;
padding
:
15px
0
;
line-height
:
50px
;
}
.uni-label
{
...
...
@@ -78,7 +79,7 @@
/*数字角标
*/
/*数字角标*/
.uni-badge
{
padding
:
4px
14px
;
...
...
@@ -724,13 +725,18 @@
.feedback-textare
{
height
:
200px
;
font-size
:
34px
;
line-height
:
50px
;
width
:
100%
;
box-sizing
:
border-box
;
padding
:
20px
30px
0
;
}
.feedback-input
{
height
:
80px
;
font-size
:
34px
;
padding-left
:
20px
;
height
:
50px
;
min-height
:
50px
;
padding
:
15px
20px
;
line-height
:
50px
;
}
.feedback-uploader
{
...
...
examples/hello-uniapp/pages.json
浏览文件 @
c0bd179c
...
...
@@ -161,7 +161,7 @@
"navigationBarTitleText"
:
"发起支付"
}
},
{
"path"
:
"p
latforms/app-plus
/share/share"
,
"path"
:
"p
ages/API
/share/share"
,
"style"
:
{
"navigationBarTitleText"
:
"分享"
}
...
...
examples/hello-uniapp/pages/API/API.vue
浏览文件 @
c0bd179c
...
...
@@ -169,17 +169,17 @@
name
:
'
发起支付
'
,
url
:
'
request-payment
'
}]
}
//#ifdef APP-PLUS
,
{
},
{
id
:
'
share
'
,
name
:
'
分享
'
,
open
:
false
,
pages
:
[{
name
:
'
分享
'
,
url
:
'
/platforms/app-plus/share/
share
'
url
:
'
share
'
}]
},
{
}
//#ifdef APP-PLUS
,
{
id
:
'
speech
'
,
name
:
'
语音
'
,
open
:
false
,
...
...
@@ -204,7 +204,7 @@
},
onShareAppMessage
()
{
return
{
title
:
'
欢迎体验uniapp
'
,
title
:
'
欢迎体验uni
-
app
'
,
path
:
'
/pages/API/API
'
}
},
...
...
examples/hello-uniapp/pages/API/action-sheet/action-sheet.vue
浏览文件 @
c0bd179c
...
...
@@ -21,7 +21,11 @@
uni
.
showActionSheet
({
itemList
:
[
'
item1
'
,
'
item2
'
,
'
item3
'
,
'
item4
'
],
success
:
(
e
)
=>
{
console
.
log
(
e
.
tapIndex
)
console
.
log
(
e
.
tapIndex
);
uni
.
showToast
({
title
:
"
点击了第
"
+
e
.
tapIndex
+
"
个选项
"
,
icon
:
"
none
"
})
}
})
}
...
...
examples/hello-uniapp/pages/API/get-network-type/get-network-type.vue
浏览文件 @
c0bd179c
...
...
@@ -32,6 +32,9 @@
networkType
:
''
}
},
onUnload
:
function
(){
this
.
networkType
=
''
,
this
.
hasNetworkType
=
false
;
},
methods
:
{
getNetworkType
:
function
()
{
uni
.
getNetworkType
({
...
...
examples/hello-uniapp/pages/API/get-system-info/get-system-info.vue
浏览文件 @
c0bd179c
...
...
@@ -70,6 +70,9 @@
systemInfo
:
{}
}
},
onUnload
:
function
(){
this
.
systemInfo
=
{};
},
methods
:
{
getSystemInfo
:
function
()
{
uni
.
getSystemInfo
({
...
...
examples/hello-uniapp/pages/API/scan-code/scan-code.vue
浏览文件 @
c0bd179c
...
...
@@ -24,6 +24,9 @@
result
:
''
}
},
onUnload
:
function
(){
this
.
result
=
''
;
},
methods
:
{
scanCode
:
function
()
{
var
that
=
this
...
...
@@ -46,7 +49,7 @@
@import
"../../../common/uni.css"
;
.uni-input
{
padding
:
0
30px
;
padding
:
15px
30px
;
word-break
:
break-all
;
}
</
style
>
examples/hello-uniapp/p
latforms/app-plus
/share/share.vue
→
examples/hello-uniapp/p
ages/API
/share/share.vue
浏览文件 @
c0bd179c
...
...
@@ -8,12 +8,14 @@
<textarea
class=
"textarea"
v-model=
"shareText"
/>
</view>
</view>
<!-- #ifdef APP-PLUS -->
<view
class=
"page-section-title"
>
分享链接
</view>
<view
class=
"page-section"
>
<view
class=
"textarea-wrp"
>
<input
class=
"uni-input"
type=
"text"
v-model=
"href"
>
</view>
</view>
<!-- #endif -->
<view
class=
"page-section-title"
>
分享图片:
</view>
<view
class=
"page-section"
>
<view
class=
"uni-uploader-body"
>
...
...
@@ -21,11 +23,18 @@
<image
class=
"uni-uploader__img"
v-if=
"image"
:src=
"image"
></image>
</view>
</view>
<!-- #ifdef APP-PLUS -->
<view
class=
"btn-area"
v-if=
"providerList.length > 0"
>
<block
v-for=
"(value,index) in providerList"
:key=
"index"
>
<button
type=
"primary"
v-if=
"value"
@
tap=
"share(value)"
>
{{
value
.
name
}}
</button>
</block>
</view>
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<view
class=
"btn-area"
>
<button
type=
"primary"
open-type=
"share"
>
分享
</button>
</view>
<!-- #endif -->
</view>
</view>
...
...
@@ -43,11 +52,19 @@
providerList
:
[]
}
},
onShareAppMessage
()
{
return
{
title
:
this
.
shareText
?
this
.
shareText
:
"
欢迎体验uni-app
"
,
path
:
'
/pages/component/component
'
,
imageUrl
:
this
.
image
?
this
.
image
:
'
https://img-cdn-qiniu.dcloud.net.cn/uniapp/app/share-logo@3.png
'
}
},
onUnload
:
function
(){
this
.
shareText
=
'
uni-app可以同时发布成原生App、微信小程序,邀请你一起体验!
'
,
this
.
href
=
"
https://uniapp.dcloud.io
"
,
this
.
image
=
''
;
},
// #ifdef APP-PLUS
onLoad
:
function
()
{
uni
.
getProvider
({
service
:
"
share
"
,
...
...
@@ -100,6 +117,7 @@
}
});
},
// #endif
methods
:
{
async
share
(
e
)
{
console
.
log
(
"
分享通道:
"
,
e
.
id
);
...
...
@@ -211,7 +229,7 @@
.textarea
{
border
:
2px
solid
#D8D8D8
;
padding
:
10px
;
height
:
9
0px
;
height
:
10
0px
;
width
:
690px
;
}
.uni-input
{
...
...
examples/hello-uniapp/pages/component/component.vue
浏览文件 @
c0bd179c
...
...
@@ -2,7 +2,9 @@
<view
class=
"index"
>
<view
class=
"index-hd"
>
<image
class=
"index-logo"
src=
"../../static/componentIndex.png"
></image>
<view
class=
"page-section-title"
>
以下将展示uni-app官方组件能力,组件样式仅供参考,开发者可根据自身需求自定义组件样式,具体属性参数详见uni-app开发文档。
</view>
<view
class=
"page-section-title"
>
以下将展示uni-app官方组件能力,组件样式仅供参考,开发者可根据自身需求自定义组件样式,具体属性参数详见uni-app开发文档。
</view>
</view>
<view
class=
"uni-card"
v-for=
"(list,index) in lists"
:key=
"index"
>
<view
class=
"uni-list"
>
...
...
@@ -67,7 +69,7 @@
},
onShareAppMessage
()
{
return
{
title
:
'
欢迎体验uniapp
'
,
title
:
'
欢迎体验uni
-
app
'
,
path
:
'
/pages/component/component
'
}
},
...
...
examples/hello-uniapp/pages/component/form/form.vue
浏览文件 @
c0bd179c
...
...
@@ -2,7 +2,7 @@
<view>
<page-head
:title=
"title"
></page-head>
<view
class=
"page-body"
>
<form
catchsubmit=
"formSubmit"
catch
reset=
"formReset"
>
<form
@
submit=
"formSubmit"
@
reset=
"formReset"
>
<view
class=
"page-section page-section-gap"
>
<view
class=
"page-section-title"
>
switch
</view>
<switch
name=
"switch"
/>
...
...
@@ -73,10 +73,10 @@
this
.
pickerHidden
=
false
},
formSubmit
:
function
(
e
)
{
console
.
log
(
'
form发生了submit事件,携带数据为:
'
,
e
.
target
.
value
)
console
.
log
(
'
form发生了submit事件,携带数据为:
'
+
JSON
.
stringify
(
e
.
detail
.
value
)
)
},
formReset
:
function
(
e
)
{
console
.
log
(
'
form发生了reset事件,携带数据为:
'
,
e
.
target
.
value
)
console
.
log
(
"
清空数据
"
)
this
.
chosen
=
''
}
},
...
...
examples/hello-uniapp/pages/component/input/input.vue
浏览文件 @
c0bd179c
...
...
@@ -22,7 +22,7 @@
<view
class=
"page-section-title"
>
控制输入的input
</view>
<view
class=
"uni-list"
>
<view
class=
"uni-list-cell"
>
<input
class=
"uni-input"
@
input=
"bindReplaceInput"
placeholder=
"连续的两个1会变成2"
/>
<input
class=
"uni-input"
@
input=
"bindReplaceInput"
v-model=
"changeValue"
placeholder=
"连续的两个1会变成2"
/>
</view>
</view>
</view>
...
...
@@ -106,6 +106,7 @@
inputValue
:
''
,
showClearIcon
:
false
,
inputClearValue
:
""
,
changeValue
:
""
,
showPassword
:
true
,
src
:
"
../../../static/eye-1.png
"
}
...
...
@@ -115,24 +116,10 @@
this
.
inputValue
=
e
.
target
.
value
},
bindReplaceInput
:
function
(
e
)
{
var
value
=
e
.
target
.
value
var
pos
=
e
.
target
.
cursor
var
left
if
(
pos
!==
-
1
)
{
// 光标在中间
left
=
e
.
target
.
value
.
slice
(
0
,
pos
)
// 计算光标的位置
pos
=
left
.
replace
(
/11/g
,
'
2
'
).
length
var
value
=
e
.
target
.
value
;
if
(
value
===
'
11
'
){
this
.
changeValue
=
"
2
"
;
}
// 直接返回对象,可以对输入进行过滤处理,同时可以控制光标的位置
return
{
value
:
value
.
replace
(
/11/g
,
'
2
'
),
cursor
:
pos
}
// 或者直接返回字符串,光标在最后边
// return value.replace(/11/g,'2'),
},
bindHideKeyboard
:
function
(
e
)
{
if
(
e
.
target
.
value
===
'
123
'
)
{
...
...
examples/hello-uniapp/pages/component/video/video.vue
浏览文件 @
c0bd179c
...
...
@@ -17,7 +17,7 @@
</view>
</view>
<view
class=
"btn-area"
>
<button
@
tap=
"bindSendDanmu"
class=
"page-body-button"
formType=
"submit"
>
发送弹幕
</button>
<button
@
tap=
"bindSendDanmu"
class=
"page-body-button"
>
发送弹幕
</button>
</view>
</view>
</view>
...
...
examples/hello-uniapp/pages/template/list2detail-detail/list2detail-detail.vue
浏览文件 @
c0bd179c
...
...
@@ -39,7 +39,7 @@
url
:
'
https://spider.dcloud.net.cn/api/news/36kr/
'
+
this
.
banner
.
post_id
,
success
:
(
data
)
=>
{
if
(
data
.
statusCode
==
200
)
{
this
.
htmlString
=
data
.
data
.
content
.
replace
(
/
\\
/g
,
""
);
this
.
htmlString
=
data
.
data
.
content
.
replace
(
/
\\
/g
,
""
)
.
replace
(
/<img/g
,
"
<img width='100%'
"
)
;
}
},
fail
:
()
=>
{
...
...
examples/hello-uniapp/pages/template/template.vue
浏览文件 @
c0bd179c
...
...
@@ -62,12 +62,10 @@
name
:
'
选项卡
'
,
url
:
'
tabbar
'
},
//
// {
// name: '问题反馈',
// url: '/platforms/app-plus/feedback/feedback'
// },
//
{
name
:
'
数字选择框
'
,
url
:
'
number-box
'
...
...
@@ -80,7 +78,7 @@
},
onShareAppMessage
()
{
return
{
title
:
'
欢迎体验uniapp
'
,
title
:
'
欢迎体验uni
-
app
'
,
path
:
'
/pages/template/template
'
}
},
...
...
examples/hello-uniapp/platforms/app-plus/feedback/feedback.vue
浏览文件 @
c0bd179c
...
...
@@ -5,8 +5,7 @@
<text
class=
"feedback-quick"
@
tap=
"chooseMsg"
>
快速键入
</text>
</view>
<view
class=
"feedback-body"
>
<textarea
auto-focus=
"true"
placeholder=
"请详细描述你的问题和意见..."
v-model=
"sendDate.content"
class=
"feedback-textare"
placeholder-class=
"input-view"
/>
<textarea
auto-focus=
"true"
placeholder=
"请详细描述你的问题和意见..."
v-model=
"sendDate.content"
class=
"feedback-textare"
/>
</view>
<view
class=
'feedback-title'
>
<text>
图片(选填,提供问题截图,总大小10M以下)
</text>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录