找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索本站精品资源

首页 教程频道 小程序开发 查看内容

微信小程序滚动到某个位置改变效果,微信支付PHP案例

作者:模板之家 2018-2-9 14:52 701人关注

scroll-viewviewSome of the wordsviewview bindscroll=scroll class={{variable200 ? class1 : class2}}/view/scroll-view //JS文件//滚动监听scroll: function (e) {this.setData({scrollTop:e.detail.scrollTop}) ...

 

 

 

  1. <scroll-view>
    <view>Some of the words<view>
    <view bindscroll="scroll" class="{{variable>200 ? 'class1' : 'class2'}}"</view>
    </scroll-view>
 

  1. //JS文件
    //滚动监听
    scroll: function (e) {
    this.setData({
    scrollTop:e.detail.scrollTop
    })
    }

其中,variable为全局变量,  class1、class2即为相应的css

 

二:微信支付php案例分享

 前端代码:

 

  1. 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)
    }
    });


路过

雷人

握手

鲜花

鸡蛋
原作者: 模板之家 来自: 网络收集

全部回复(0)