微信开卡代码

var cardid = ret.card_id;
console.log("cardid ="+cardid);
var cardExt={"code":"","openid":ret.openid,"nonce_str":ret.noncestr,"timestamp":ret.timestamp,"signature":ret.signature};
console.log("cardExt="+JSON.stringify(cardExt));
addCardBag(cardid,JSON.stringify(cardExt),ret.appointmentInfoId);

var addCardBag = function(cardId,cardExt,uuid){
    wx.addCard({
        cardList: [{
        cardId: cardId,
        cardExt: cardExt
        }], // 需要添加的卡券列表
        success: function (res) {
        
        },
        cancel: function (res) {
            
       },
       complete: function(res){
       
       }
//     fail: function(res){
//      var failDate = {appointmentInfoId:uuid};
//      controller.cancelCardCodeInfo(failDate);
//      console.log("fail="+JSON.stringify(res));
//     }
    });
}

你可能感兴趣的:(微信开卡代码)