支付寶小程序筆記

 

支付寶小程序支持id寫法json

#Test{background: #000}小程序

<view id="Test"></view>緩存

帶參數跳轉ide

catchTap,ontap
<view class="li-text {{nav[0].style}}" data-hi="Alipay" onTap="urlH">
 
urlH:function(e){
console.log(e);
},
 
頁面跳轉(導航欄):navigateTo,
url:function(url){
    my.navigateTo({
      url:url
    })
  },

 

 
遠程獲取數據 httpRequest
my.httpRequest({
  url: 'http://httpbin.org/post',
  method: 'POST',
  data: {
    from: '支付寶',
    production: 'AlipayJSAPI',
  },
  dataType: 'json',
  success: function(res) {
    my.alert({content: 'success'});
  },
  fail: function(res) {
    my.alert({content: 'fail'});
  },
  complete: function(res) {
    my.hideLoading();
    my.alert({content: 'complete'});
  }
});

 

 
 
緩存
相關文章
相關標籤/搜索