3 网站链接walletconnect后,无法调用起钱包支付窗口,极少数可以成功

const web3js = new Web3(global_config.link_url);
        const abi = that.yx_item.abi;
        let myContract = new web3js.eth.Contract(
          abi,
          that.yx_item.contract_address
        );
        const code = myContract.methods.buy_ticket(that.count).encodeABI();
        const yx_value = that.yx_item.ticket_price * that.count;
        const tx = {
          from: that.$store.state.acount,
          to: that.yx_item.contract_address,
          data: code,
          gas: 150000,
          value: yx_value,
        };
        const connector = new WalletConnect({
          bridge: "https://bridge.walletconnect.org", // Required
          qrcodeModal: QRCodeModal,
        });
        connector
          .sendTransaction(tx)
          .then((result) => {
            if (result) {
              that.checkDd(that.yx_item.contract_address, result);
            }
          })
          .catch((error) => {
            that.$notify.error({
              title: "Error",
              message: "购买失败",
            });
          });
请先 登录 后评论

4 个回答

Crypto0xCat - 开发工程师
请先 登录 后评论
mxsbet
请先 登录 后评论
kindle1994
请先 登录 后评论
nm
请先 登录 后评论
  • 4 关注
  • 0 收藏,4618 浏览
  • 张哲 提出于 2021-11-22 09:43