<scroll-view>
<view>Some of the words<view>
<view bindscroll="scroll" class="{{variable>200 ? 'class1' : 'class2'}}"</view>
</scroll-view>
//JS文件
//滚动监听
scroll: function (e) {
this.setData({
scrollTop:e.detail.scrollTop
})
}
其中,variable为全局变量, class1、class2即为相应的css
二:微信支付php案例分享
前端代码:
wx.request({
url: 'https://www.yourhost.com/weixin/WeiActivity/payJoinfee',//改成你自己的链接
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
method:'POST',
success: function(res) {
console.log(res.data);
console.log('调起支付');
wx.requestPayment({
'timeStamp': res.data.timeStamp,
'nonceStr': res.data.nonceStr,
'package': res.data.package,
'signType': 'MD5',
'paySign': res.data.paySign,
'success':function(res){
console.log('success');
wx.showToast({
title: '支付成功',
icon: 'success',
duration: 3000
});
},
'fail':function(res){
console.log('fail');
},
'complete':function(res){
console.log('complete');
}
});
},
fail:function(res){
console.log(res.data)
}
});