
微信小程序
微信小程序
dbt@L
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
uni-app——uni-app 之 Hbuilderx 发布微信小程序
uni-app——uni-app 之 Hbuilderx 发布微信小程序原创 2024-11-01 10:30:10 · 1622 阅读 · 0 评论 -
微信小程序——<image>图片组件图片显示闪烁
微信小程序——图片组件图片显示闪烁原创 2022-08-26 15:54:04 · 1456 阅读 · 0 评论 -
微信小程序——微信小程序中类似v-model的双向绑定写法
微信小程序——微信小程序中类似v-model的双向绑定写法原创 2022-08-26 15:53:09 · 1430 阅读 · 0 评论 -
微信小程序——video视频全屏播放
微信小程序——video视频全屏播放原创 2022-08-26 15:44:47 · 1890 阅读 · 0 评论 -
微信小程序——swiper轮播图自定义指示样式
微信小程序——swiper轮播图自定义指示样式原创 2022-08-17 17:52:22 · 523 阅读 · 0 评论 -
微信小程序——video视频全屏展示
微信小程序——video视频全屏展示原创 2022-08-06 11:59:37 · 1964 阅读 · 0 评论 -
微信小程序——swiper内容水平垂直居中
微信小程序——swiper内容水平垂直居中原创 2022-08-06 11:57:53 · 2881 阅读 · 1 评论 -
微信小程序——image图片自适应
微信小程序——image图片自适应原创 2022-08-06 11:56:57 · 614 阅读 · 0 评论 -
微信小程序——swiper设置同时显示滑块数量
微信小程序——swiper设置同时显示滑块数量原创 2022-08-06 11:55:37 · 2239 阅读 · 0 评论 -
微信小程序——动态绑定多个class
微信小程序——动态绑定多个class原创 2022-08-06 11:54:21 · 2498 阅读 · 0 评论 -
微信小程序——小程序中计算属性的使用
微信小程序——小程序中计算属性的使用原创 2022-07-31 09:25:22 · 3835 阅读 · 0 评论 -
微信小程序——点击事件 bindtap和catchtap的区别
微信小程序——点击事件 bindtap和catchtap的区别原创 2022-07-31 09:23:19 · 626 阅读 · 0 评论 -
微信小程序——小程序去除文本中的<br>标签
微信小程序——小程序去除文本中的<br>标签原创 2022-07-30 11:11:44 · 3514 阅读 · 0 评论 -
微信小程序——在小程序自定义组件中获取元素定位及宽度
微信小程序——在小程序自定义组件中获取元素定位及宽度原创 2022-07-12 21:43:20 · 1147 阅读 · 0 评论 -
微信小程序——生命周期方法
微信小程序-生命周期方法原创 2022-07-12 21:37:32 · 158 阅读 · 0 评论 -
微信小程序——TypeError: Cannot read property ‘setData‘ of undefined 解决方法
success: function (res) { this.setData({})}改成了success: (res) => { this.setData({})}原创 2021-12-12 16:37:22 · 598 阅读 · 0 评论 -
微信小程序——input 中 confirm-type 属性的使用
confirm-type的最终表现与手机输入法本身的实现有关,部分安卓系统输入法和第三方输入法可能不支持或不完全支持<input type="text"confirm-type="search" />当设置为“search” 时, 手机软键盘就会出现“搜索”2个字...原创 2021-07-18 20:52:27 · 1617 阅读 · 0 评论 -
微信小程序——云开发报错
VM849 WAService.js:2 Error: errCode: -502005 database collection not exists | errMsg: [ResourceNotFound] Db or Table not exist. Please check your request, but if the problem cannot be solved, contact us.原因:可能是集合名称写错了集合应为users, 而我写成了user db.collect.原创 2021-07-18 20:51:01 · 588 阅读 · 0 评论 -
微信小程序——微信小程序地图显示当前详细位置点
添加:show-location属性为true <map id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="14" show-location></map>原创 2021-07-18 20:49:12 · 829 阅读 · 0 评论 -
微信小程序——微信开发者工具设置保存后实现自动格式化
微信小程序——微信开发者工具设置保存后实现自动格式化原创 2021-07-18 20:48:06 · 12026 阅读 · 5 评论 -
微信小程序——云函数相关操作(读取、查询、更新、文件上传、过滤、排序)
// 引入数据库const db = wx.cloud.database()Page({ demo () { // 在数据库中写入url、name 两条信息 db.collection('users').add({ data: { url: 'http://url.com', name: 'jack', } }).then(res => {}) //原创 2021-07-18 20:44:42 · 1208 阅读 · 0 评论 -
微信小程序——删除组件的封装
romoveList组件romoveList.wxml <movable-area class="area"> <!-- direction="horizontal" 水平方向拖拽 --> <movable-view class="view" direction="horizontal">{{userMessage}}</movable-view> <navigator url="/pages/detail/detail"原创 2021-06-06 16:21:15 · 451 阅读 · 0 评论 -
微信小程序——复制组件的封装
copyText组件copyText.wxml<text class="iconfont iconfuzhi" bindtap="handlCopyText"></text>copyText.js// components/copyText/copyText.jsComponent({ /** * 组件的属性列表 */ // apply-shared 表示页面 wxss 样式将影响到自定义组件,但自定义组件 wxss 中指定的样式不会影响页面原创 2021-06-06 16:16:44 · 242 阅读 · 0 评论 -
微信小程序——拨打电话组件的封装
callPhone组件callPhone.wxml<text class="iconfont icondadianhua" bindtap="handleCallPhone"></text>callPhone.js// components/callPhone/callPhone.jsComponent({ /** * 组件的属性列表 */ // apply-shared 表示页面 wxss 样式将影响到自定义组件,但自定义组件 wxss 中指定的样式原创 2021-06-06 16:11:49 · 587 阅读 · 0 评论 -
微信小程序——iconfont 图标的引入
1、打开阿里巴巴图标库,点击资源管理,找到我的项目, 点击进入2、找到项目对应的图标3、跳转到此页面,然后ctrl + a , 全选, 复制其内容4、在小程序中新建style文件夹, 再里面新建iconfont 文件夹, 再新建iconfont.wxss 文件, 再把刚才全选的内容粘贴到里面5、引入: app.wxss 引入iconfont 图标app.wxss@import "style/iconfont/iconfont.wxss";使用:如在阿里巴巴图标库显示的是这样的图标原创 2021-06-05 17:00:11 · 437 阅读 · 0 评论 -
微信小程序——wxs模块的使用
WXS(WeiXin Script)是小程序的一套脚本语言,结合 WXML,可以构建出页面的结构。注意:只能引用 .wxs 文件模块,且必须使用相对路径。举例:demo.wxml文件<wxs src="../../utils/wordSplit.wxs" module="m1"/><view>{{m1.wordSplit(myText)}}</view><view>{{m1.unitFormat(number)}}</view>d原创 2021-05-05 21:16:04 · 340 阅读 · 0 评论 -
微信小程序——未读消息小红点的显示
显示 tabBar 某一项的右上角的红点属性:index: 是tabBar 的哪一项,从左边算起 wx.showTabBarRedDot({ index: 2, })效果:原创 2021-05-05 21:08:54 · 2601 阅读 · 0 评论 -
微信小程序——剪贴板 的使用
handlCopyText () { wx.setClipboardData({ // this.data.copyText 需要拷贝的文字 data: this.data.copyText, success (res) { wx.showToast({ title: '复制成功', }) } }) }...原创 2021-05-05 21:06:05 · 1303 阅读 · 0 评论 -
微信小程序——拖拽视图组件的使用
demo.wxml<movable-area class="area"> <!-- direction="horizontal" 水平方向拖拽 --> <movable-view class="view" direction="horizontal">123</movable-view> <image src=""></image> <view class="delete">删除</view>原创 2021-05-05 21:00:18 · 484 阅读 · 0 评论 -
微信小程序——文本居中的方法
.demo { width: 100rpx; height: 100rpx; text-align: center;// 行高设置成height 一样 line-height: 100rpx;}原创 2021-05-05 20:53:38 · 5322 阅读 · 0 评论 -
微信小程序——wx:for 循环数值, 写入假数据
写法:数字+双花括号<view wx:for="{{4}}" wx:key="index"> <text>我是假数据</text></view>效果:原创 2021-05-05 20:52:26 · 555 阅读 · 0 评论 -
微信小程序——滚动条列表置顶
<scroll-view scroll-y scroll-top="0"></scroll-view>原创 2021-01-26 18:17:55 · 1043 阅读 · 1 评论 -
JS——es7 async ... await 异步的使用方法
async getCatesList() { //url此处为接口 const res = await request({url: '/categories',data: this.params}) //this.params为要传递的参数 console.log(res) // res为接口调用成功后返回的值 }原创 2021-01-26 18:17:17 · 189 阅读 · 0 评论 -
微信小程序——富文本
<rich-text nodes="{{demo}}"></rich-text>// demo为html标签原创 2021-01-26 18:16:35 · 153 阅读 · 0 评论 -
微信小程序——图片放大预览功能(微信官方)
wx.previewImage({ current: '', // 当前显示图片的http链接 urls: [] // 需要预览的图片http链接列表})原创 2021-01-26 18:16:15 · 369 阅读 · 0 评论 -
微信小程序——view置底样式
.demo { position: fixed; left: 0; bottom: 0; width: 100%; // 一定要设置宽度 height: 90rpx;}原创 2021-01-26 18:15:49 · 3650 阅读 · 1 评论 -
微信小程序——wx.navigateBack 返回上一页面或多级页面
wx.navigateBack({ delta: 2, // 返回上2级页面 })原创 2021-01-25 14:26:13 · 2755 阅读 · 0 评论 -
微信小程序——web中的本地存储与小程序的本地存储的区别
web方式: localStorage.setItem(“key”, value) localStorage.getItem(“key”)类型: 会先调用toString()转换成字符串类型再存储wxApp方式:wx.setStorageSync(‘key’, value) wx.getStorageSync(“key”)类型: 存储之前不做任何操作...原创 2021-01-25 14:26:02 · 232 阅读 · 0 评论 -
微信小程序——触底事件(上拉)、下拉刷新事件思路
onReachBottom (触底事件)* 1 判断当前页码是否大于等于总页数* 2 如果否,当前页码++* 3 重新请求页面数据接口onPullDownRefresh (下拉刷新)* 1 当前页面数据置空* 2 当前页码重置为1* 3 重新请求页面数据接口注意:要实现下拉刷新功能, 其json 文件中应加入以下代码// json文件{"enablePullDownRefresh": true,"backgroundTextStyle": "dark"}..原创 2021-01-25 14:25:50 · 1809 阅读 · 0 评论 -
微信小程序——getCurrentPages(获取当前页面栈)
获取当前页面栈。数组中第一个元素为首页,最后一个元素为当前页面注意:不要在 App.onLaunch 的时候调用 getCurrentPages(),此时 page 还没有生成let pages = getCurrentPages()let currentPage = pages[pages.length -1]console.log(currentPage) 此为当前页面...原创 2021-01-25 14:25:38 · 2123 阅读 · 0 评论