提交 df36df42 编写于 作者: H Hao-Wu

Version 20161010

上级 b5a87585
......@@ -13,11 +13,24 @@ Page({
methods.forEach(function (method) {
that[method] = function () {
example[method](that.context)
var actions = that.context.getActions()
wx.drawCanvas({
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)
}
})
}
})
......@@ -11,6 +11,7 @@
<block wx:for="{{methods}}" wx:for-item="method">
<button class="canvas-button" bindtap="{{method}}">{{method}}</button>
</block>
<button class="canvas-button" bindtap="toTempFilePath" type="primary">toTempFilePath</button>
</view>
</view>
</view>
......
......@@ -7,7 +7,7 @@
}
.canvas-element {
width: 100%;
height: 250px;
height: 400rpx;
}
.canvas-buttons {
padding: 50rpx 50rpx 10rpx;
......@@ -22,6 +22,7 @@
box-sizing: border-box;
}
.canvas-button {
font-size: 28rpx;
width: 290rpx;
margin: 20rpx auto;
}
......
......@@ -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) {
context.beginPath();
context.setShadow(10, 10, 10, 'rgba(0, 0, 0, 199)');
......
......@@ -3,13 +3,13 @@ var sizeType = [ ['compressed'], ['original'], ['compressed', 'original'] ]
Page({
data: {
sourceTypeIndex: 0,
sourceTypeIndex: 2,
sourceType: ['拍照', '相册', '拍照或相册'],
sizeTypeIndex: 0,
sizeTypeIndex: 2,
sizeType: ['压缩', '原图', '压缩或原图'],
countIndex: 0,
countIndex: 8,
count: [1, 2, 3, 4, 5, 6, 7, 8, 9]
},
sourceTypeChange: function (e) {
......
......@@ -5,7 +5,7 @@
</view>
<view class="page__bd">
<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>
......@@ -10,11 +10,11 @@ Page({
covers: [{
latitude: 23.099994,
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,
longitude: 113.304520,
iconPath: 'image/green_tri.png',
iconPath: '/image/green_tri.png',
rotate: 180
}]
}
......
var initText = 'this is first line\nthis is second line'
Page({
data: {
initData: 'this is first line\nthis is second line',
text: 'this is first line\nthis is second line',
extraLine: []
text: initText
},
extraLine: [],
add: function(e) {
this.data.extraLine.push('other line')
this.extraLine.push('other line')
this.setData({
text: this.data.initData + '\n' + this.data.extraLine.join('\n')
text: initText + '\n' + this.extraLine.join('\n')
})
},
remove: function(e) {
if (this.data.extraLine.length > 0) {
this.data.extraLine.pop()
if (this.extraLine.length > 0) {
this.extraLine.pop()
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.
先完成此消息的编辑!
想要评论请 注册