- 微信小程序开发工具启动不了
安装后启动不了,重启也没有作用
2018-10-31 - 微信小程序wx:for循环的数量问题
如何让wx:for循环出的元素内容能够有数量控制 例如数据中一共可以循环出10条内容,但是我只想让他循环出4条,应该怎么处理?有具体例子吗
2018-10-24 - 地区名字转为地区ID问题
[{"count":314,"id":292,"n":"上海","pinyinFull":"Shanghai","pinyinShort":"sh"}请问,如何根据地区,例如上海,获取到它(上海)对应的ID是292呢?请大神赐教,谢谢。
2018-10-22 - 瀑布图实现点击全屏预览效果
瀑布图如何实现点击全屏预览: // pages/map/index.js let col1H = 0; let col2H = 0; Page({ data: { images: [], col1: [], col2: [], }, onLoad: function (options) { wx.showToast({ title: "页面加载中...", icon: 'loading', duration: 2000, }); wx.getSystemInfo({ success: (res) => { let ww = res.windowWidth; let wh = res.windowHeight; let imgWidth = ww * 0.48; let scrollH = wh; this.setData({ scrollH: scrollH, imgWidth: imgWidth }); this.loadImages(); } }) }, onImageLoad: function (e) { let imageId = e.currentTarget.id; let oImgW = e.detail.width; //图片原始宽度 let oImgH = e.detail.height; //图片原始高度 let imgWidth = this.data.imgWidth; //图片设置的宽度 let scale = imgWidth / oImgW; //比例计算 let imgHeight = oImgH * scale; //自适应高度 let images = this.data.images; let imageObj = null; for (let i = 0; i < images.length; i++) { let img = images[i]; if (img.id === imageId) { imageObj = img; break; } } imageObj.height = imgHeight; let loadingCount = this.data.loadingCount - 1; let col1 = this.data.col1; let col2 = this.data.col2; if (col1H <= col2H) { col1H += imgHeight; col1.push(imageObj); } else { col2H += imgHeight; col2.push(imageObj); } let data = { loadingCount: loadingCount, col1: col1, col2: col2 }; if (!loadingCount) { data.images = []; } this.setData(data); }, loadImages: function () { let images = [ { pic: "https://7765-1", height: 0 }, { pic: "https://7765-2", height: 0}, { pic: "https://7765-3", height: 0}‘ { pic: "https://7765-4", height: 0}’ 】 let baseId = "img-" + (+new Date()); for (let i = 0; i < images.length; i++) { images[i].id = baseId + "-" + i; } this.setData({ loadingCount: images.length, images: images }); }, previewImg1: function(e) { //如何在这里实现点击全屏预览呢? this.loadImages(); var images = this.data.images; console.log(this.data.images); wx.previewImage({ urls: images, }) } })
2018-10-18 - 微信小程序中按钮禁用或开启问题
我在一个页面中设置一个头像和一个按钮,只有用户先去点击头像后,按钮的disabled=true,否则按钮disabled=false。在js代码里如何实现,请各位大神赐教。
2018-10-13 - 微信图片长按可以扫描关注问题
在微信小程序中,页面图片如何实现长按可以扫描关注呢?请大神赐教!
2018-10-12