Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
WIP: 更新了 README,加了一些后来的想法,做了一些 canvas 的尝试
Browse files Browse the repository at this point in the history
  • Loading branch information
zzsqwq committed Aug 20, 2021
1 parent 6db3d85 commit 53e67c1
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 33 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# Postwall-MiniApp
A QQ MiniApp for Postwall posting
## 概述

一个用于贴贴墙发单的小程序



## 后续功能前瞻

+ 单发
+ 配合 Mirai 机器人来审核是否单发
+ 单独做一个可折叠按钮
+ 视频
+ 想办法可以做到可发视频
+ 集合一个寻物启事的功能
+ 有人发了寻物启事,可以选择是否贴到寻物墙上
1 change: 1 addition & 0 deletions pages/index/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Page({
success(res) {
console.log(res);
imageList = imageList.concat(res.tempFilePaths);
console.log(res.tempFilePaths);
that.setData({
imageList: imageList
})
Expand Down
2 changes: 1 addition & 1 deletion pages/index/index.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</block>

<view qq:if="{{imageList.length<9}}"class="upload-wrap__item upload-wrap__item_default" bindtap="chooseImage">
<image class="image-block" src="../../images/[email protected]" mode="aspectFill" />
<image class="image-combine" src="../../images/[email protected]" mode="aspectFill" />
</view>

<view class="section">
Expand Down
49 changes: 35 additions & 14 deletions pages/test/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,46 @@
// index.js
Page({
data: {
message : 'Hello MINA!',
array: [1,2,3,4,5],
view: "APP",
text: 'This is page data.'
tmp_path : "tmp"
},
onLoad(options) {
// Do some initialize when page load.
},
onReady() {
// Do something when page ready.
this.drawBall()
},
drawBall() {
const context = qq.createCanvasContext('submit-canvas');
const that = this;

context.arc(100, 100, 30, 0, 2 * Math.PI);
context.clip();
context.restore();
//绘制文字
context.setTextAlign('center')
context.setFillStyle('#fff')
context.fillText("测试看看", 100, 180)//用户昵称
context.setFontSize(16)
context.stroke()

context.draw()
qq.canvasToTempFilePath({
x: 0,
y: 0,
width: 670,
height: 800,
canvasId: 'submit-canvas',
success : function (res) {
console.log(res.tempFilePath);
that.setData({
tmp_path: res.tempFilePath
})
}
})
},
test() {
console.log(this.data.tmp_path)
},
onShow() {
// Do something when page show.
Expand All @@ -19,6 +49,7 @@ Page({
// Do something when page hide.
},
onUnload() {
clearInterval(this.interval)
// Do something when page close.
},
onPullDownRefresh() {
Expand All @@ -45,14 +76,4 @@ Page({
console.log(item.text)
},
// Event handler.
viewTap() {
this.setData({
text: 'Set some data for updating view.'
}, function () {
// this is setData callback
})
},
customData: {
hi: 'MINA'
}
})
23 changes: 6 additions & 17 deletions pages/test/index.qml
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
<!-- index.qml -->

<view>{{message}}</view>
<view qq:for="{{array}}">{{item}}</view>
<!-- if -->
<view qq:if="{{view == 'MINA'}}">1</view>
<view qq:if="{{view == 'APP'}}">2</view>
<view qq:if="{{view == 'WEBVIEW'}}">3</view>

<template name="staffName">
<view>
FirstName: {{firstName}},
LastName: {{lastName}}
</view>
</template>

<template is="staffName" data="{{...staffA}}"></template>
<template is="staffName" data="{{...staffB}}"></template>
<template is="staffName" data="{{...staffC}}"></template>
<view class="page-preview"> 订单效果预览 </view>
<canvas canvas-id="submit-canvas" class="canvas">
<view> 测试一下 </view>
</canvas>
<view bindtap="test">测试</view>
<image class="test-class" src="{{tmp_path}}" bindtap="previewImage" mode="aspectFill" />
18 changes: 18 additions & 0 deletions pages/test/index.qss
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@

page {
background-color: #F5F6FA !important;
}
.page-preview {
display: block;
width: 400rpx;
margin: 20rpx 140rpx 0 auto;
font-size: 50rpx;
color: #8A8A8A;
}

.canvas {
width: 670rpx;
height: 800rpx;
margin: 50rpx auto 0 auto;
background-color: red;
}
.test-class {
width: 300rpx;
height: 300rpx;
}

0 comments on commit 53e67c1

Please sign in to comment.