php微信拍照接口范例

php微信拍照接口范例,第1张

    // 接口
    //拍照、本地选图
    var images = {
    localId: [],
    serverId: []
    };
    wxchooseImage({
      success: function (res) {
        imageslocalId = reslocalIds;
        alert('已选择 ' + reslocalIdslength + ' 张');
      }
    });
  //上传
  $("#upload")click(function(){
    if (imageslocalIdlength == 0) {
      alert('请先使用 chooseImage 接口选择');
      return;
    }
    var i = 0, length = imageslocalIdlength;
    imagesserverId = [];
    function upload() {
      wxuploadImage({
        localId: imageslocalId[i],
        success: function (res) {
          i++;
          alert('已上传:' + i + '/' + length);
          imagesserverIdpush(resserverId);
          if (i < length) {
            upload();
          }
        },
        fail: function (res) {
          alert(JSONstringify(res));
        }
      });
    }
    upload();
  });
  // 54 下载
  $("#download")click(function(){
    if (imagesserverIdlength === 0) {
      alert('请先使用 uploadImage 上传');
      return;
    }
    var i = 0, length = imagesserverIdlength;
    imageslocalId = [];
    function download() {
      wxdownloadImage({
        serverId: imagesserverId[i],
        success: function (res) {
          i++;
          alert('已下载:' + i + '/' + length);
          imageslocalIdpush(reslocalId);
          if (i < length) {
            download();
          }
        }
      });
    }
    download();
  });

以上就是关于php微信拍照接口范例全部的内容,包括:php微信拍照接口范例、、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/10094126.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-05
下一篇2023-05-05

发表评论

登录后才能评论

评论列表(0条)

    保存