cyy
cyy
  • 发布:2015-11-26 23:13
  • 更新:2018-04-25 16:21
  • 阅读:5071

有大神能帮忙解释下feedback.js里面上传图片的代码呀,实在看不懂了

分类:Native.js

/**

  • 发送反馈信息
    **/
    feedback.send = function(content, callback) {
    feedback.login(function(user, conn) {
    //发送文本消息
    var msgText = '问题:' + content.question;
    if (content.contact) {
    msgText += '; 联系方式:' + content.contact + ';'
    }
    conn.sendTextMessage({
    to: CUSTOM_ID,
    msg: msgText,
    type: "chat"
    });
    //如果没有截图
    if (!content.images || content.images.length < 1) {
    if (callback) callback();
    return;
    }
    //如果有截图
    var sendImageCount = 0;
    var hasError = false;
    content.images.forEach(function(fileInputId) {
    //alert(fileInputId)
    conn.sendPicture({
    fileInputId: fileInputId,
    to: CUSTOM_ID,
    onFileUploadError: function(error) {
    //处理图片上传失败
    alert(JSON.stringify(error));
    hasError = true;
    },
    onFileUploadComplete: function(data) {
    //处理图片上传成功,如本地消息显示
    sendImageCount++;
    if (!hasError && sendImageCount >= content.images.length) {
    if (callback) callback();
    }
    }
    });
    });
    //--
    });
    };

conn是啥呀?还有上传的服务器路径在哪里填?万分感谢

2015-11-26 23:13 负责人:无 分享
已邀请:
拖拉机司机

拖拉机司机 - 开着拖拉机去北京天安门广场看升旗

其实这个问题貌似~

该问题目前已经被锁定, 无法添加新回复