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)
    }
    
    }
    

      

  • 相关阅读:
    【BZOJ4444】国旗计划
    NOIp模拟赛三十一
    [arc086e]snuke line
    NOIp模拟赛三十
    [agc004f]namori
    [agc004d]salvage robot
    [agc016b]colorful hats
    NOIp模拟赛二十九
    [arc082f]sandglass
    Oracle性能报告--ASH
  • 原文地址:https://www.cnblogs.com/yaoling/p/13615387.html
Copyright © 2011-2022 走看看