微信小程序实现代付款分享好友商品卡片

2024-01-27 11:26:01 浏览数 (3)

代码语言:javascript复制
  onShareAppMessage: function(res) {
    console.log(JSON.stringify(res))
    const{all_data, user_addr, all_price, username, id_card, order_sku_id} = this.data
    const wxid = wx.getStorageSync('wxOpenId')
    if (res.from === 'button') {
      return new Promise((resolve)=>{
        setTimeout(()=>{
          app.post('/temporae_sku/', {
            initiate_user: wxid, 
            id_card: id_card,
            username: username,
            all_price: all_price,
            user_addr: user_addr,
            all_data: all_data
          }, (j)=>{
            resolve({
              title: "xxx-我有一笔订单需要支付....",
              path: `/pages/shop_card/daifu?openid=${wxid}&order=${j.id}`,
              imageUrl: all_data[0].img,
              })
          })
        },1000)
        })
    }
  },

0 人点赞