wx.switchTab({ url:../index/index, success:function(e){ varpage=getCurrentPages().pop(); if (page==undefined||page== null ) return ; page.onLoad(); } }) switchTab成功跳转后调用success,此时可以拿到跳转后页面的page对象,从而... 阅读更多 »
微信小程序
微信小程序使用wxParse解析富文本HTML
上一个博客记录了 微信小程序组件之rich-text,转义显示富文本操作 ,但是这个微信小程序API文档没有将富文本中的 视频 在wxml中展示出来,那么就存在局限性,但是问题出现,那么就... 阅读更多 »
微信小程序组件之rich-text,转义显示富文
近期在写一个小程序的时候,有一块是数据是后台富文本填写的,入下图所示: 在这之前,我使用的是 wxParse 解析富文本 但是 最大的缺点就是代码配置多,并且无疑多出了一部分源码... 阅读更多 »
微信小程序点击轮播图在新页面中全屏预
xml部分: swiper class =imgListcircular= true swiper-item class =imgList-liwx: for ={{imgArr}} image class =imgsrc={{item}}data-index={{index}}bindtap=previewImg/image /swiper-item /swiper css部分(根据自己的项目写最好):... 阅读更多 »
让原生小程序支持 async/await的runtime.js
在写微信小程序的时候为了让原生小程序支持 async/await,所以就得用到runtime.js了, 下载地址... 阅读更多 »
微信小程序---tab切换
一个朋友在学小程序的时候问了我一个问题:小程序中怎么手写tab切换(当时就发了一个鄙视的图片给他),下面开始上代码了 wxml部分: scroll-viewscroll-x= true class = ip_tab_comtainer view c... 阅读更多 »
微信小程序中setData为数组动态赋值
先说一下需求: 1、请求数据 2、将请求到的数据赋值给data下的一个空数组 3、将data下的数组通过点击事件传递给另外一个页面,另外一个页面接收传过来的数据 代码截图: 接收参数页... 阅读更多 »
微信小程序---手机照片上传和删除
wxml: view class = gallery !--显示图片-- view class = item wx: for = {{images}} wx:key= index imagesrc= {{item}} data-src= {{item}} bindtap= previewImage mode= aspectFit / !--删除按钮-- view class = delete bindtap= delete data-ind... 阅读更多 »
小程序提示框,加载框,模态框写法
提示框: wx.showToast({ title:message, icon:loading, mask: true , duration: 20000 }); wx.hideToast(); 加载框: wx.showToast({ title:message, icon:loading, mask: true , duration: 20000 }); 需要隐藏:wx.hideLoading(); 模态框:... 阅读更多 »