![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
微信小程序
hmk1900
这个作者很懒,什么都没留下…
展开
-
微信小程序实现3D轮播图
在写时,有写到实现3D轮播图的,可以直接使用中的组件swiper来实现。原创 2022-11-08 14:03:46 · 1632 阅读 · 2 评论 -
js和wxs精确四舍五入,保留两位小数
js:toFix方法为银行家算法,0.15会算成0.01,所以舍弃var num =2.446242342;num = Math.round((num + Number.EPSILON) * 100) / 100; // 输出结果为 2.45wxs:var toFixedFn = function (x) { var f = parseFloat(x); if (isNaN(f)) { return '0.00';原创 2022-04-11 16:25:11 · 673 阅读 · 0 评论 -
微信小程序父组件、子组件互相调用方法
<my-page id="page"></my-page>#父组件中this.selectComponent("#page").getData('我是参数');#子组件methods中getData(data){ console.log('我是子组件方法',data)}原创 2022-03-27 12:01:57 · 1022 阅读 · 0 评论 -
小程序上传图片、回显、并上传到服务器
//选取图片wx.chooseImage({ count: 1, sizeType: ['original'],//原图 sourceType: [ 'album','camera'],//支持选取图片 success (res) { // tempFilePath可以作为img标签的src属性显示图片 const tempFilePaths =.原创 2022-03-25 23:28:54 · 874 阅读 · 0 评论 -
微信小程序动态改变数组中某个元素的值
let temp = 'cartArray[' + index + '].goodsNumber'_this.setData({ [temp]: count})原创 2022-03-20 16:53:42 · 375 阅读 · 0 评论 -
小程序处理价格显示两位小数的方法
在.wxml页面<!--commponents/goods/goods.wxml--><wxs module="m1"> var toFixedFn = function (price) { return Number(price).toFixed(2) } module.exports = { toFixedFn: toFixedFn };</wxs><view>{{m1.toFi原创 2022-03-18 15:18:55 · 611 阅读 · 0 评论