当前位置:网站首页>唤醒手腕 - 微信小程序、QQ小程序、抖音小程序学习笔记(更新中)
唤醒手腕 - 微信小程序、QQ小程序、抖音小程序学习笔记(更新中)
2022-08-05 07:04:00 【唤醒手腕】
Textarea 自动增高
首先就是 qml 页面中,height 属性要绑定 data 中,bindlinechange 检测 textarea 行高变化。
<textarea class="input-show" maxlength="100" style="height:{
{inputHeight}}" type="text" show-confirm-bar="{
{false}}" bindlinechange="remarkLineAction" />
进行 js 调整
data: {
inputHeight: '30px'
},
remarkLineAction: function (options) {
let lineCount = options.detail.lineCount;
this.setData({
inputHeight: lineCount * 20 + 10 + 'px'
})
},
进行隐藏底部的 ‘确定’ 按钮
show-confirm-bar="{
{false}}"
QQ 小程序 调用相机
qq.chooseImage(Object object) 从本地相册选择图片或使用相机拍照。
object.sizeType 的合法值:original 原图、compressed 压缩图
object.sourceType 的合法值:album 从相册选图、camera 使用相机
qq.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: ['album', 'camera'],
success: res => {
const tempFilePaths = res.tempFilePaths
var tempFilesSize = res.tempFiles[0].size;
if (tempFilesSize >= 1000000) {
wx.showToast({
title: '图片尺寸超标',
icon: 'none'
})
} else {
this.setData({
loadImage: tempFilePaths[0] })
}
}
})
Object res
res.tempFiles 的结构
QQ 小程序 加QQ群
如果做过小程序授权登录的话,应该发现这个功能的实现方法了。没错QQ小程序加群加好友也是通过button组件的open-type开发能力实现的,加群代码如下:
<button open-type = "openGroupProfile" group-id="123456"><text>点我加群</text></button>
其中 group-id
只定要加的群号,要注意的是需要打开的群必须要添加在app.json文件里的groupIdList里面,并且最多只能添加10个群。
"groupIdList":["123456"]
基本跟打开小程序的流程操作一样,只要仔细看文档很简单的。
QQ 小程序 分享卡片
用户点击右上角菜单的「转发」、「分享到空间」按钮时触发的事件的回调函数,参数在每个需要增加分享功能的页面 js 文件 Page({})
增加函数绑定。
onShareAppMessage: function () {
return {
title: '秒数联盟数学派每日壹题',
imageUrl: this.data.problem.problem
}
},
参数 Object res
边栏推荐
- UDP broadcast
- 线程池的创建及参数设置详解
- An IP conflict is reported after installing the software on a dedicated computer terminal
- cmake 学习使用笔记(三)
- In the anaconda Promat interface, import torch is passed, and the error is reported in the jupyter notebook (only provide ideas and understanding!)
- Advanced Redis
- 专用机终端安装软件后报IP冲突
- 腾讯业务安全岗 IDP 谈话总结
- 【instancetype类型 Objective-C】
- RNote108---Display the running progress of the R program
猜你喜欢
【win7】NtWaitForKeyedEvent
protobuf根据有关联的.proto文件进行编译
二叉树进阶复习1
在anaconda Promat界面import torch通过,在jupyter notebook中报错的问题(仅提供思路理解!)
今天虚竹哥又发现了一款好用的国产化API工具
Summary of Text Characterization Methods
MySQL:连接查询 | 内连接,外连接
UDP group (multi)cast
Japan Sanitary Equipment Industry Association: Japan's warm water shower toilet seat shipments reached 100 million sets
Week 8 Document Clustering(文本聚类)
随机推荐
browserslist 选项的目的是什么?
原来使Maya Arnold也能渲染出高质量作品!超赞小技巧
mysql使用in函数的一个小问题
2022熔化焊接与热切割操作证考试题及模拟考试
cmake 学习使用笔记(三)
693. 行程排序
MySQL: order by sorting query, group by grouping query
1, Citrix XenDesktop 2203 AD domain system installation (1)
TRACE32——C源码关联1
工作3年,回想刚入门和现在的今昔对比,笑谈一下自己的测试生涯
不太会讲爱,其实已经偷偷幸福很久啦----我们的故事
配合屏幕录像专家,又小又清晰!
(4) Rotating object detection data roLabelImg to DOTA format
任务流调度工具AirFlow,,220804,,
专用机终端安装软件后报IP冲突
TRACE32——通用寄存器查看与修改
protobuf根据有关联的.proto文件进行编译
Week 8 Document Clustering(文本聚类)
Shiny04---Application of DT and progress bar in shiny
今天虚竹哥又发现了一款好用的国产化API工具