当前位置:网站首页>唤醒手腕 - 微信小程序、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

边栏推荐
猜你喜欢

IO进程线程->进程间的通信->day7

Week 8 Document Clustering

TCP sticky packet unpacking problem + solution

AI + video technology helps to ensure campus security, how to build a campus intelligent security platform?

【 LeetCode 】 235. A binary search tree in recent common ancestor

Illegal key size 报错问题

MySQL:连接查询 | 内连接,外连接

DeFi 前景展望:概览主流 DeFi 协议二季度进展

蓝牙gap协议

It turns out that Maya Arnold can also render high-quality works!Awesome Tips
随机推荐
2022 crane driver (limited bridge crane) exam question bank and simulation test
腾讯业务安全岗 IDP 谈话总结
Advanced Redis
Shared memory + inotify mechanism to achieve multi-process low-latency data sharing
原来使Maya Arnold也能渲染出高质量作品!超赞小技巧
对数据类型而言运算符无效。运算符为 add,类型为 text。
typescript59-泛型工具类型(partial )
女生做软件测试会不会成为一个趋势?
Invalid operator for data type.The operator is add and the type is text.
In the anaconda Promat interface, import torch is passed, and the error is reported in the jupyter notebook (only provide ideas and understanding!)
Does Libpq support read-write separation configuration?
props 后面的数据流是什么?
Re regular expressions
真实字节跳动测试开发面试题,拿下年薪50万offer。
1, Citrix XenDesktop 2203 AD domain system installation (1)
Redis数据库学习
国家强制性灯具安全标准GB7000.1-2015
访问被拒绝:“microsoft.web.ui.webcontrols”的解决办法
栈与队列的基本介绍和创建、销毁、出入、计算元素数量、查看元素等功能的c语言实现,以及栈的压入、弹出序列判断,栈结构的链式表示与实现
protobuf根据有关联的.proto文件进行编译