var e = require("./utils/network.js");

require("./utils/util.js");

App({
 onLaunch: function (options) {
  console.log('onLaunch');
    
 }, 
 onShow:function(options){
  let that=this;
  if (options.scene !=undefined){
   this.globalData.scene = options.scene;
   var scene = [1007, 1008];
   var indexof = scene.indexOf(options.scene);
   if (indexof == -1) {
    //场景不在在数组中的处理
    that.globalData.share_id = 0;
   } else {

   }
  }
  
 },
    uploadimg: function(e) {
        var s = this, o = e.i ? e.i : 0, t = e.success ? e.success : 0, a = e.fail ? e.fail : 0;
        wx.uploadFile({
            url: e.url,
            filePath: e.path[o],
            name: "logo",
            formData: {
                id: e.id
            },
            success: function(e) {
                t++;
            },
            fail: function(e) {
                a++;
            },
            complete: function(i) {
                ++o == e.path.length || (e.i = o, e.success = t, e.fail = a, s.uploadimg(e));
            }
        });
    },
 
 globalData: {
  userInfo: null,
  share_id:0,
 }
});