zoukankan      html  css  js  c++  java
  • h5嵌套小程序、app端传参写法

    var order_code = result.data
    var terminal = $('#terminal').val()
    if(terminal == 1){
    // 小程序
    wx.miniProgram.getEnv(function (res) {
    if(res.miniprogram){
    wx.miniProgram.navigateTo({
    url:'/pages/payresult/cashier/cashier'+'?order_code='+ order_code + '&price=' + price
    })
    }
    })
    }else if(terminal == 2){
    // ios 注意 ios传参是字符串  不是字符串记得转换一下
    order_code = order_code.toString()
    price = price.toString()
    _data = {
    'order_code': order_code,
    'price': price
    }
    try{
    
    //goPayMember自己起的 和ios端对应好
    window.webkit.messageHandlers.goPayMember.postMessage(_data);
    }catch (e){
    tconsole(e.message)
    }
    }else if(terminal == 3){
    order_code = order_code.toString()
    price = price.toString()
    // android
    try{
    
    //BigoffsPromotion.goPayMember自己起的和安卓端对应好
    BigoffsPromotion.goPayMember(order_code,price)
    }catch (e){
    tconsole(e.message)
    }
    
    }
    

      

  • 相关阅读:
    我該怎麼辦
    這麼多年興許從來沒有釋放過
    我想做一個快樂的孩子
    纠结
    如何克服心煩氣躁
    如何樹立威嚴
    第零次作业
    第三周作业
    第二周作业,
    第二周作业
  • 原文地址:https://www.cnblogs.com/yaoling/p/13615387.html
Copyright © 2011-2022 走看看