所有通过wx对象调用的接口的基础请求参数 见:https://mp.weixin.qq.com/wiki?action=doc&id=mp1421141115&t=0.08966560295638093#7

interface UploadImageConfig {
    isShowProgressTips?: number;
    localId: string;
    cancel?(): void;
    complete?(res?: any): void;
    fail?(error?: any): void;
    success(res: any): void;
}

层级 (查看完整内容)

属性

isShowProgressTips?: number

默认为1,显示进度提示

localId: string

要上传的图片的本地 ID,由 chooseImage 接口获得

方法

  • 用户点击取消时的回调函数,仅部分有用户取消操作的api才会用到

    返回 void

  • 接口调用完成时执行的回调函数,无论成功或失败都会执行

    参数

    • 可选res: any

    返回 void

  • 接口调用失败时执行的回调函数

    参数

    • 可选error: any

    返回 void

  • res: var serverId = res.serverId; 返回图片的服务器端 ID

    参数

    • res: any

    返回 void