app.js
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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,
}
});