Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cosin_
weapp-demo
提交
df36df42
W
weapp-demo
项目概览
cosin_
/
weapp-demo
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
weapp-demo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
df36df42
编写于
10月 11, 2016
作者:
H
Hao-Wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Version 20161010
上级
b5a87585
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
42 addition
and
16 deletion
+42
-16
page/API/canvas/canvas.js
page/API/canvas/canvas.js
+14
-1
page/API/canvas/canvas.wxml
page/API/canvas/canvas.wxml
+1
-0
page/API/canvas/canvas.wxss
page/API/canvas/canvas.wxss
+2
-1
page/API/canvas/example.js
page/API/canvas/example.js
+10
-0
page/API/image/image.js
page/API/image/image.js
+3
-3
page/component/component-pages/audio/audio.wxml
page/component/component-pages/audio/audio.wxml
+1
-1
page/component/component-pages/map/map.js
page/component/component-pages/map/map.js
+2
-2
page/component/component-pages/text/text.js
page/component/component-pages/text/text.js
+9
-8
未找到文件。
page/API/canvas/canvas.js
浏览文件 @
df36df42
...
@@ -13,11 +13,24 @@ Page({
...
@@ -13,11 +13,24 @@ Page({
methods
.
forEach
(
function
(
method
)
{
methods
.
forEach
(
function
(
method
)
{
that
[
method
]
=
function
()
{
that
[
method
]
=
function
()
{
example
[
method
](
that
.
context
)
example
[
method
](
that
.
context
)
var
actions
=
that
.
context
.
getActions
()
wx
.
drawCanvas
({
wx
.
drawCanvas
({
canvasId
:
'
canvas
'
,
canvasId
:
'
canvas
'
,
actions
:
that
.
context
.
getActions
()
actions
:
actions
})
})
}
}
})
})
},
toTempFilePath
:
function
()
{
wx
.
toTempFilePath
({
canvasId
:
'
canvas
'
,
success
:
function
(
res
)
{
console
.
log
(
res
)
},
fail
:
function
(
res
)
{
console
.
log
(
res
)
}
})
}
}
})
})
page/API/canvas/canvas.wxml
浏览文件 @
df36df42
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
<block wx:for="{{methods}}" wx:for-item="method">
<block wx:for="{{methods}}" wx:for-item="method">
<button class="canvas-button" bindtap="{{method}}">{{method}}</button>
<button class="canvas-button" bindtap="{{method}}">{{method}}</button>
</block>
</block>
<button class="canvas-button" bindtap="toTempFilePath" type="primary">toTempFilePath</button>
</view>
</view>
</view>
</view>
</view>
</view>
...
...
page/API/canvas/canvas.wxss
浏览文件 @
df36df42
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
}
}
.canvas-element {
.canvas-element {
width: 100%;
width: 100%;
height:
250
px;
height:
400r
px;
}
}
.canvas-buttons {
.canvas-buttons {
padding: 50rpx 50rpx 10rpx;
padding: 50rpx 50rpx 10rpx;
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
box-sizing: border-box;
box-sizing: border-box;
}
}
.canvas-button {
.canvas-button {
font-size: 28rpx;
width: 290rpx;
width: 290rpx;
margin: 20rpx auto;
margin: 20rpx auto;
}
}
...
...
page/API/canvas/example.js
浏览文件 @
df36df42
...
@@ -214,6 +214,16 @@ example.setStrokeStyle = function (context) {
...
@@ -214,6 +214,16 @@ example.setStrokeStyle = function (context) {
});
});
};
};
example
.
setGlobalAlpha
=
function
(
context
)
{
context
.
setFillStyle
(
'
#000000
'
);
[
1
,
0.5
,
0.1
].
forEach
(
function
(
item
,
index
)
{
context
.
setGlobalAlpha
(
item
)
context
.
beginPath
();
context
.
rect
(
0
+
75
*
index
,
0
,
50
,
50
);
context
.
fill
();
});
}
example
.
setShadow
=
function
(
context
)
{
example
.
setShadow
=
function
(
context
)
{
context
.
beginPath
();
context
.
beginPath
();
context
.
setShadow
(
10
,
10
,
10
,
'
rgba(0, 0, 0, 199)
'
);
context
.
setShadow
(
10
,
10
,
10
,
'
rgba(0, 0, 0, 199)
'
);
...
...
page/API/image/image.js
浏览文件 @
df36df42
...
@@ -3,13 +3,13 @@ var sizeType = [ ['compressed'], ['original'], ['compressed', 'original'] ]
...
@@ -3,13 +3,13 @@ var sizeType = [ ['compressed'], ['original'], ['compressed', 'original'] ]
Page
({
Page
({
data
:
{
data
:
{
sourceTypeIndex
:
0
,
sourceTypeIndex
:
2
,
sourceType
:
[
'
拍照
'
,
'
相册
'
,
'
拍照或相册
'
],
sourceType
:
[
'
拍照
'
,
'
相册
'
,
'
拍照或相册
'
],
sizeTypeIndex
:
0
,
sizeTypeIndex
:
2
,
sizeType
:
[
'
压缩
'
,
'
原图
'
,
'
压缩或原图
'
],
sizeType
:
[
'
压缩
'
,
'
原图
'
,
'
压缩或原图
'
],
countIndex
:
0
,
countIndex
:
8
,
count
:
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
]
count
:
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
]
},
},
sourceTypeChange
:
function
(
e
)
{
sourceTypeChange
:
function
(
e
)
{
...
...
page/component/component-pages/audio/audio.wxml
浏览文件 @
df36df42
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
</view>
</view>
<view class="page__bd">
<view class="page__bd">
<view class="section section_gap" style="text-align: center;">
<view class="section section_gap" style="text-align: center;">
<audio src="{{current.src}}" poster="{{current.poster}}" name="{{current.name}}" author="{{current.author}}" action="{{audioAction}}"
bindplay="audioPlayed" bindtimeupdate="audioTimeUpdated"
controls></audio>
<audio src="{{current.src}}" poster="{{current.poster}}" name="{{current.name}}" author="{{current.author}}" action="{{audioAction}}" controls></audio>
</view>
</view>
</view>
</view>
</view>
</view>
page/component/component-pages/map/map.js
浏览文件 @
df36df42
...
@@ -10,11 +10,11 @@ Page({
...
@@ -10,11 +10,11 @@ Page({
covers
:
[{
covers
:
[{
latitude
:
23.099994
,
latitude
:
23.099994
,
longitude
:
113.344520
,
longitude
:
113.344520
,
iconPath
:
'
image/green_tri.png
'
,
// 目前有 bug,正确的写法应该是 /image/green_tri.png ,等我们下个版本修复吧T_T
iconPath
:
'
/
image/green_tri.png
'
,
// 目前有 bug,正确的写法应该是 /image/green_tri.png ,等我们下个版本修复吧T_T
},
{
},
{
latitude
:
23.099994
,
latitude
:
23.099994
,
longitude
:
113.304520
,
longitude
:
113.304520
,
iconPath
:
'
image/green_tri.png
'
,
iconPath
:
'
/
image/green_tri.png
'
,
rotate
:
180
rotate
:
180
}]
}]
}
}
...
...
page/component/component-pages/text/text.js
浏览文件 @
df36df42
var
initText
=
'
this is first line
\n
this is second line
'
Page
({
Page
({
data
:
{
data
:
{
initData
:
'
this is first line
\n
this is second line
'
,
text
:
initText
text
:
'
this is first line
\n
this is second line
'
,
extraLine
:
[]
},
},
extraLine
:
[],
add
:
function
(
e
)
{
add
:
function
(
e
)
{
this
.
data
.
extraLine
.
push
(
'
other line
'
)
this
.
extraLine
.
push
(
'
other line
'
)
this
.
setData
({
this
.
setData
({
text
:
this
.
data
.
initData
+
'
\n
'
+
this
.
data
.
extraLine
.
join
(
'
\n
'
)
text
:
initText
+
'
\n
'
+
this
.
extraLine
.
join
(
'
\n
'
)
})
})
},
},
remove
:
function
(
e
)
{
remove
:
function
(
e
)
{
if
(
this
.
data
.
extraLine
.
length
>
0
)
{
if
(
this
.
extraLine
.
length
>
0
)
{
this
.
data
.
extraLine
.
pop
()
this
.
extraLine
.
pop
()
this
.
setData
({
this
.
setData
({
text
:
this
.
data
.
initData
+
'
\n
'
+
this
.
data
.
extraLine
.
join
(
'
\n
'
)
text
:
initText
+
'
\n
'
+
this
.
extraLine
.
join
(
'
\n
'
)
})
})
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录