哈哈哈哈哈哈
1.this 指向问题

一大早上就要被这个搞得晕。要定义到回调函数的外面。
2.swiper 的高度问题


swiper 的高度需要获取屏幕高度再重新赋值。不然撑不开页面。我用了我认为最简单的方法,网上也还有其他的方法。
<swiper current="{{currentTab}}" duration="200" bindchange="swiperChange"
style="height:{{clineheight?clineheight+'px':'auto'}}">
</swiper>data: {
currentTab:0,
clineheight:''
},
/** * 生命周期函数--监听页面加载 */
onLoad: function (options) {
this.getheight();
},
getheight:function(){
const that=this;
wx.getSystemInfo({
success: function (res) {
that.setData({
clineheight: res.windowHeight
})
},
})
},3.如何禁用右上角三点转发分享?
在该对应js页面中删除 onShareAppMessage
4.scroll-view根据索引不跳转的问题
没有好好看文档,看实例。是需要赋值id,而不是自定义data-id .


随时随地看视频