收藏
回答

添加卡券页面出现参数错误?

const timestamp = Math.floor(Date.now() / 1000)
const nonceStr = randomString()


const { apiSignature } = await getApiTicket({
  noncestr: nonceStr,
  timeStamp: timestamp,
  url: location.href.split('#')[0],
  cardId
})


console.log('addCard', cardId)
const cardExt = {
  timestamp,
  nonce_str: nonceStr,
  signature: apiSignature,
  outer_str: JSON.stringify({
    ...outer,
    deviceId,
    openStyleType,
    subActivityWay
  })
}
console.log('addCard', cardExt)
return new Promise((resolve, reject) => {
  wx.addCard({
    cardList: [{
      cardId,
      cardExt: JSON.stringify(cardExt)
    }], // 需要添加的卡券列表
    success: function (res) {
      resolve(res.cardList)
      console.log('addCard', res)
    }
  })
})
回答关注问题邀请回答
收藏

3 个回答

登录 后发表内容
问题标签