|
@@ -11,6 +11,7 @@ Page({ |
|
@@ -11,6 +11,7 @@ Page({ |
|
11
|
lable: 0,
|
11
|
lable: 0,
|
|
12
|
datas02: [],
|
12
|
datas02: [],
|
|
13
|
title: '',
|
13
|
title: '',
|
|
|
|
14
|
+ isIdCard:true,
|
|
14
|
extrainfo_arr: ["请上传子女出生证明、学籍信息凭证、学费凭证、本人结婚证和分摊协议", "请上传学历学籍凭证", "请上传出生证明或关系证明、独生子女证、分摊协议、其他法定赡养人赡养证明", "请上传诊断书和医疗费用收据", "请上传首套房证明、还款证明、不动产登记证、结婚证和夫妻约定抵扣协议"],
|
15
|
extrainfo_arr: ["请上传子女出生证明、学籍信息凭证、学费凭证、本人结婚证和分摊协议", "请上传学历学籍凭证", "请上传出生证明或关系证明、独生子女证、分摊协议、其他法定赡养人赡养证明", "请上传诊断书和医疗费用收据", "请上传首套房证明、还款证明、不动产登记证、结婚证和夫妻约定抵扣协议"],
|
|
15
|
cur_index: 0,
|
16
|
cur_index: 0,
|
|
16
|
lovercardtypeData: {
|
17
|
lovercardtypeData: {
|
|
@@ -46,9 +47,9 @@ Page({ |
|
@@ -46,9 +47,9 @@ Page({ |
|
46
|
onChange: 'onPickerSelect'
|
47
|
onChange: 'onPickerSelect'
|
|
47
|
},
|
48
|
},
|
|
48
|
childrencardtypeData: {
|
49
|
childrencardtypeData: {
|
|
49
|
- label: '身份证件类型',
|
50
|
+ label: '子女身份证件类型',
|
|
50
|
bindtype: 'childrencardtype',
|
51
|
bindtype: 'childrencardtype',
|
|
51
|
- selected: '',
|
52
|
+ selected: '居民身份证',
|
|
52
|
isblack: 'true',
|
53
|
isblack: 'true',
|
|
53
|
placeholder: '请选择身份证件类型',
|
54
|
placeholder: '请选择身份证件类型',
|
|
54
|
values: ["居民身份证", "军官证", '士兵证', '武警警官证', '港澳居民来往内地通行证', '外交官证', '中国护照',
|
55
|
values: ["居民身份证", "军官证", '士兵证', '武警警官证', '港澳居民来往内地通行证', '外交官证', '中国护照',
|
|
@@ -68,6 +69,15 @@ Page({ |
|
@@ -68,6 +69,15 @@ Page({ |
|
68
|
end: '2018-01-01',
|
69
|
end: '2018-01-01',
|
|
69
|
onChange: 'onPickerSelect',
|
70
|
onChange: 'onPickerSelect',
|
|
70
|
},
|
71
|
},
|
|
|
|
72
|
+ childedudegreeData: {
|
|
|
|
73
|
+ label: '子女受教育阶段',
|
|
|
|
74
|
+ bindtype: 'edu_degree',
|
|
|
|
75
|
+ selected: '',
|
|
|
|
76
|
+ isblack: 'true',
|
|
|
|
77
|
+ values: ["学前教育(满3岁)", "小学教育", "初中教育", "普通高中教育", "中等职业教育", "大学专科教育", "大学本科教育","硕士研究生教育","博士研究生教育"],
|
|
|
|
78
|
+ placeholder: '请选择教育阶段',
|
|
|
|
79
|
+ onChange: 'onPickerSelect'
|
|
|
|
80
|
+ },
|
|
71
|
edudegreeData: {
|
81
|
edudegreeData: {
|
|
72
|
label: '教育阶段',
|
82
|
label: '教育阶段',
|
|
73
|
bindtype: 'edu_degree',
|
83
|
bindtype: 'edu_degree',
|
|
@@ -78,11 +88,20 @@ Page({ |
|
@@ -78,11 +88,20 @@ Page({ |
|
78
|
onChange: 'onPickerSelect'
|
88
|
onChange: 'onPickerSelect'
|
|
79
|
},
|
89
|
},
|
|
80
|
edutypeData: {
|
90
|
edutypeData: {
|
|
|
|
91
|
+ label: '教育类别',
|
|
|
|
92
|
+ bindtype: 'edu_style',
|
|
|
|
93
|
+ selected: '',
|
|
|
|
94
|
+ isblack: 'true',
|
|
|
|
95
|
+ values: ["职业能力", "专业能力"],
|
|
|
|
96
|
+ placeholder: '请选择教育类别',
|
|
|
|
97
|
+ onChange: 'onPickerSelect'
|
|
|
|
98
|
+ },
|
|
|
|
99
|
+ edutypeData: {
|
|
81
|
label: '教育类型',
|
100
|
label: '教育类型',
|
|
82
|
bindtype: 'edu_type',
|
101
|
bindtype: 'edu_type',
|
|
83
|
selected: '',
|
102
|
selected: '',
|
|
84
|
isblack: 'true',
|
103
|
isblack: 'true',
|
|
85
|
- values: ["学历教育", "技能职业资格", "专业职业资格"],
|
104
|
+ values: ["学历教育", "非学历教育"],
|
|
86
|
placeholder: '请选择教育类型',
|
105
|
placeholder: '请选择教育类型',
|
|
87
|
onChange: 'onPickerSelect'
|
106
|
onChange: 'onPickerSelect'
|
|
88
|
},
|
107
|
},
|
|
@@ -91,7 +110,7 @@ Page({ |
|
@@ -91,7 +110,7 @@ Page({ |
|
91
|
bindtype: 'support_type',
|
110
|
bindtype: 'support_type',
|
|
92
|
selected: '',
|
111
|
selected: '',
|
|
93
|
isblack: 'true',
|
112
|
isblack: 'true',
|
|
94
|
- values: ["独立赡养", "共同赡养"],
|
113
|
+ values: ["独生子女", "非独生子女"],
|
|
95
|
placeholder: '请选择赡养类型',
|
114
|
placeholder: '请选择赡养类型',
|
|
96
|
onChange: 'onPickerSelect'
|
115
|
onChange: 'onPickerSelect'
|
|
97
|
},
|
116
|
},
|
|
@@ -141,7 +160,7 @@ Page({ |
|
@@ -141,7 +160,7 @@ Page({ |
|
141
|
reducetypeData: {
|
160
|
reducetypeData: {
|
|
142
|
label: '扣除方式',
|
161
|
label: '扣除方式',
|
|
143
|
bindtype: 'reduce_type',
|
162
|
bindtype: 'reduce_type',
|
|
144
|
- selected: '',
|
163
|
+ selected: '月度扣除',
|
|
145
|
isblack: 'true',
|
164
|
isblack: 'true',
|
|
146
|
values: ["月度扣除", "年度扣除"],
|
165
|
values: ["月度扣除", "年度扣除"],
|
|
147
|
placeholder: '请选择扣除方式',
|
166
|
placeholder: '请选择扣除方式',
|
|
@@ -157,6 +176,7 @@ Page({ |
|
@@ -157,6 +176,7 @@ Page({ |
|
157
|
onChange: 'onPickerSelect',
|
176
|
onChange: 'onPickerSelect',
|
|
158
|
mode: "date",
|
177
|
mode: "date",
|
|
159
|
fields: "day",
|
178
|
fields: "day",
|
|
|
|
179
|
+ datelong:0,
|
|
160
|
start: '1970-01-01',
|
180
|
start: '1970-01-01',
|
|
161
|
},
|
181
|
},
|
|
162
|
studyenddate: {
|
182
|
studyenddate: {
|
|
@@ -170,13 +190,14 @@ Page({ |
|
@@ -170,13 +190,14 @@ Page({ |
|
170
|
mode: "date",
|
190
|
mode: "date",
|
|
171
|
fields: "day",
|
191
|
fields: "day",
|
|
172
|
start: '1970-01-01',
|
192
|
start: '1970-01-01',
|
|
|
|
193
|
+ datelong: 0,
|
|
173
|
},
|
194
|
},
|
|
174
|
identifytypeData: {
|
195
|
identifytypeData: {
|
|
175
|
label: '证书类型',
|
196
|
label: '证书类型',
|
|
176
|
bindtype: 'identify_type',
|
197
|
bindtype: 'identify_type',
|
|
177
|
selected: '',
|
198
|
selected: '',
|
|
178
|
isblack: 'true',
|
199
|
isblack: 'true',
|
|
179
|
- values: ["产权证", "不动产权登记证"],
|
200
|
+ values: ["产权证", "不动产权登记证","出售合同号","预售合同号"],
|
|
180
|
placeholder: '请选择证书类型',
|
201
|
placeholder: '请选择证书类型',
|
|
181
|
onChange: 'onPickerSelect'
|
202
|
onChange: 'onPickerSelect'
|
|
182
|
},
|
203
|
},
|
|
@@ -220,6 +241,7 @@ Page({ |
|
@@ -220,6 +241,7 @@ Page({ |
|
220
|
mode: "date",
|
241
|
mode: "date",
|
|
221
|
fields: "day",
|
242
|
fields: "day",
|
|
222
|
start: '2018-01-01',
|
243
|
start: '2018-01-01',
|
|
|
|
244
|
+ datelong: 0,
|
|
223
|
},
|
245
|
},
|
|
224
|
leasestartDate: {
|
246
|
leasestartDate: {
|
|
225
|
label: '租赁期起',
|
247
|
label: '租赁期起',
|
|
@@ -232,6 +254,7 @@ Page({ |
|
@@ -232,6 +254,7 @@ Page({ |
|
232
|
mode: "date",
|
254
|
mode: "date",
|
|
233
|
fields: "day",
|
255
|
fields: "day",
|
|
234
|
start: '2000-01-01',
|
256
|
start: '2000-01-01',
|
|
|
|
257
|
+ datelong: 0,
|
|
235
|
},
|
258
|
},
|
|
236
|
leaseendDate: {
|
259
|
leaseendDate: {
|
|
237
|
label: '租赁期止',
|
260
|
label: '租赁期止',
|
|
@@ -244,6 +267,7 @@ Page({ |
|
@@ -244,6 +267,7 @@ Page({ |
|
244
|
mode: "date",
|
267
|
mode: "date",
|
|
245
|
fields: "day",
|
268
|
fields: "day",
|
|
246
|
start: '2000-01-01',
|
269
|
start: '2000-01-01',
|
|
|
|
270
|
+ datelong: 0,
|
|
247
|
},
|
271
|
},
|
|
248
|
loandatelongData: {
|
272
|
loandatelongData: {
|
|
249
|
label: '贷款期限(月数)',
|
273
|
label: '贷款期限(月数)',
|
|
@@ -265,10 +289,10 @@ Page({ |
|
@@ -265,10 +289,10 @@ Page({ |
|
265
|
mode: "date",
|
289
|
mode: "date",
|
|
266
|
fields: "month",
|
290
|
fields: "month",
|
|
267
|
start: '1970-01',
|
291
|
start: '1970-01',
|
|
|
|
292
|
+ datelong:0,
|
|
268
|
},
|
293
|
},
|
|
269
|
edu_lable: "",
|
294
|
edu_lable: "",
|
|
270
|
oldersupport_lable: "",
|
295
|
oldersupport_lable: "",
|
|
271
|
- long_reduce_date: 0,
|
|
|
|
272
|
img_path: "/images/upload_img.png"
|
296
|
img_path: "/images/upload_img.png"
|
|
273
|
},
|
297
|
},
|
|
274
|
|
298
|
|
|
@@ -278,16 +302,6 @@ Page({ |
|
@@ -278,16 +302,6 @@ Page({ |
|
278
|
onLoad: function(options) {
|
302
|
onLoad: function(options) {
|
|
279
|
var that = this
|
303
|
var that = this
|
|
280
|
console.log("options", options);
|
304
|
console.log("options", options);
|
|
281
|
- wx.getStorage({
|
|
|
|
282
|
- key: 'selectitems',
|
|
|
|
283
|
- success: function(res) {
|
|
|
|
284
|
- console.log("selectitems", res.data)
|
|
|
|
285
|
- that.setData({
|
|
|
|
286
|
- datas02: res.data
|
|
|
|
287
|
- })
|
|
|
|
288
|
- },
|
|
|
|
289
|
-
|
|
|
|
290
|
- })
|
|
|
|
291
|
this.setData({
|
305
|
this.setData({
|
|
292
|
title: '添加' + options.title,
|
306
|
title: '添加' + options.title,
|
|
293
|
cur_index: options.index
|
307
|
cur_index: options.index
|
|
@@ -352,27 +366,23 @@ Page({ |
|
@@ -352,27 +366,23 @@ Page({ |
|
352
|
var newdata = formdata;
|
366
|
var newdata = formdata;
|
|
353
|
switch (this.data.cur_index + '') {
|
367
|
switch (this.data.cur_index + '') {
|
|
354
|
case '0':
|
368
|
case '0':
|
|
355
|
- if (!formdata.lover_name || formdata.lover_name.length < 1) {
|
369
|
+ if (!formdata.spouse_name || formdata.spouse_name.length < 1) {
|
|
356
|
this.showToast('请填写配偶姓名')
|
370
|
this.showToast('请填写配偶姓名')
|
|
357
|
return
|
371
|
return
|
|
358
|
- } else if (!formdata.lover_idno || formdata.lover_idno.length < 1) {
|
372
|
+ } else if (!formdata.spouse_id_card_no || formdata.spouse_id_card_no.length < 1) {
|
|
359
|
this.showToast('请填写配偶证件号码')
|
373
|
this.showToast('请填写配偶证件号码')
|
|
360
|
return
|
374
|
return
|
|
361
|
} else if (!formdata.children_name || formdata.children_name.length < 1) {
|
375
|
} else if (!formdata.children_name || formdata.children_name.length < 1) {
|
|
362
|
this.showToast('请填写子女姓名')
|
376
|
this.showToast('请填写子女姓名')
|
|
363
|
return
|
377
|
return
|
|
364
|
- } else if (!formdata.children_idno || formdata.children_idno.length < 1) {
|
|
|
|
365
|
- this.showToast('请填写子女身份证号')
|
378
|
+ } else if (!formdata.children_id_card_no || formdata.children_id_card_no.length < 1) {
|
|
|
|
379
|
+ this.showToast('请填写子女证件号码')
|
|
366
|
return
|
380
|
return
|
|
367
|
- } else if (!formdata.children_schoolno || formdata.children_schoolno.length < 1) {
|
381
|
+ } else if (!formdata.children_student_no || formdata.children_student_no.length < 1) {
|
|
368
|
this.showToast('请填写学籍号')
|
382
|
this.showToast('请填写学籍号')
|
|
369
|
return
|
383
|
return
|
|
370
|
}
|
384
|
}
|
|
371
|
- // else if (!formdata.reduce_money || formdata.reduce_money< 0) {
|
|
|
|
372
|
- // this.showToast('请填写扣除金额')
|
|
|
|
373
|
- // return
|
|
|
|
374
|
- // }
|
|
|
|
375
|
- else if (!formdata.reduce_ratio || formdata.reduce_ratio.length < 1) {
|
385
|
+ else if (!formdata.percent || formdata.percent.length < 1) {
|
|
376
|
this.showToast('请填写扣除比例')
|
386
|
this.showToast('请填写扣除比例')
|
|
377
|
return
|
387
|
return
|
|
378
|
}
|
388
|
}
|
|
@@ -404,18 +414,20 @@ Page({ |
|
@@ -404,18 +414,20 @@ Page({ |
|
404
|
this.showToast('请选择受教育日期')
|
414
|
this.showToast('请选择受教育日期')
|
|
405
|
return
|
415
|
return
|
|
406
|
}
|
416
|
}
|
|
407
|
- if (this.data.edudegreeData.selected.length < 1) {
|
417
|
+ if (this.data.childedudegreeData.selected.length < 1) {
|
|
408
|
this.showToast('请选择教育阶段')
|
418
|
this.showToast('请选择教育阶段')
|
|
409
|
return
|
419
|
return
|
|
410
|
}
|
420
|
}
|
|
411
|
- newdata.lover_cardtype = this.data.lovercardtypeData.selected
|
|
|
|
412
|
- newdata.lover_birthdate = this.data.loverbirthDate.selected
|
|
|
|
413
|
- newdata.taxperson_relative = this.data.taxperson_relativeData.selected
|
|
|
|
414
|
- newdata.children_cardtype = this.data.childrencardtypeData.selected
|
|
|
|
415
|
- newdata.children_birthDate = this.data.childrenbirthDate.selected
|
|
|
|
416
|
- newdata.study_startdate = this.data.studystartdate.selected
|
|
|
|
417
|
- newdata.study_enddate = this.data.studyenddate.selected
|
|
|
|
418
|
- newdata.edu_degree = this.data.edudegreeData.selected
|
421
|
+ newdata.spouse_id_card_type = this.data.lovercardtypeData.selected
|
|
|
|
422
|
+ newdata.spouse_birthday = this.data.loverbirthDate.selected
|
|
|
|
423
|
+ newdata.relationship = this.data.taxperson_relativeData.selected
|
|
|
|
424
|
+ newdata.children_id_card_type = this.data.childrencardtypeData.selected
|
|
|
|
425
|
+ newdata.children_birthday = this.data.childrenbirthDate.selected
|
|
|
|
426
|
+ newdata.education_end = this.data.studystartdate.datelong
|
|
|
|
427
|
+ newdata.education_start = this.data.studyenddate.datelong
|
|
|
|
428
|
+ newdata.education_period = this.data.childedudegreeData.selected
|
|
|
|
429
|
+ newdata.children_nation = "中国"
|
|
|
|
430
|
+ newdata.nation = "中国"
|
|
419
|
break;
|
431
|
break;
|
|
420
|
case '1':
|
432
|
case '1':
|
|
421
|
if (this.data.edutypeData.selected.length < 1) {
|
433
|
if (this.data.edutypeData.selected.length < 1) {
|
|
@@ -596,22 +608,41 @@ Page({ |
|
@@ -596,22 +608,41 @@ Page({ |
|
596
|
this.showToast('请填写扣除金额')
|
608
|
this.showToast('请填写扣除金额')
|
|
597
|
return
|
609
|
return
|
|
598
|
}
|
610
|
}
|
|
599
|
- newdata.reduce_type = this.data.reducetypeData.selected
|
|
|
|
600
|
- this.gosave(newdata)
|
611
|
+ newdata.deduction_type = this.data.reducetypeData.selected
|
|
|
|
612
|
+ newdata.deduction_amount = formdata.reduce_money
|
|
|
|
613
|
+ newdata.legal_entity = ""
|
|
|
|
614
|
+ newdata.legal_entity_id = ""
|
|
|
|
615
|
+ this.addDatas(newdata)
|
|
601
|
},
|
616
|
},
|
|
602
|
|
617
|
|
|
603
|
- gosave: function(data) {
|
|
|
|
604
|
- var selectitems = this.data.datas02;
|
|
|
|
605
|
- selectitems[this.data.cur_index].path = this.data.img_path
|
|
|
|
606
|
- selectitems[this.data.cur_index].data = data
|
|
|
|
607
|
- wx.setStorage({
|
|
|
|
608
|
- key: 'selectitems',
|
|
|
|
609
|
- data: selectitems,
|
618
|
+ addDatas: function (newdata){
|
|
|
|
619
|
+ var that = this;
|
|
|
|
620
|
+ var Authorization = app.globalData.Authorization;
|
|
|
|
621
|
+ wx.request({
|
|
|
|
622
|
+ url: baseUrl + 'persontax/v1/children-educations',
|
|
|
|
623
|
+ method: "POST",
|
|
|
|
624
|
+ header: {
|
|
|
|
625
|
+ 'content-type': 'application/json',
|
|
|
|
626
|
+ "Authorization": Authorization
|
|
|
|
627
|
+ },
|
|
|
|
628
|
+ data: newdata,
|
|
|
|
629
|
+ success(res){
|
|
|
|
630
|
+ if (res&&res.statusCode==200){
|
|
|
|
631
|
+ wx.navigateBack({
|
|
|
|
632
|
+ delta: 1
|
|
|
|
633
|
+ })
|
|
|
|
634
|
+ }
|
|
|
|
635
|
+ }
|
|
610
|
})
|
636
|
})
|
|
|
|
637
|
+ },
|
|
611
|
|
638
|
|
|
612
|
- wx.navigateBack({
|
|
|
|
613
|
- delta: 1
|
|
|
|
614
|
- })
|
639
|
+ getIdInfo: function (e) {
|
|
|
|
640
|
+ if (this.data.isIdCard) {
|
|
|
|
641
|
+ wx.navigateTo({
|
|
|
|
642
|
+ url: '../../taxperson/idinfo/idinfo',
|
|
|
|
643
|
+ success: function (res) { },
|
|
|
|
644
|
+ })
|
|
|
|
645
|
+ }
|
|
615
|
},
|
646
|
},
|
|
616
|
|
647
|
|
|
617
|
onPickerSelect: function(e) {
|
648
|
onPickerSelect: function(e) {
|
|
@@ -656,6 +687,7 @@ Page({ |
|
@@ -656,6 +687,7 @@ Page({ |
|
656
|
case 'study_start_date':
|
687
|
case 'study_start_date':
|
|
657
|
var study_startdate = this.data.studystartdate
|
688
|
var study_startdate = this.data.studystartdate
|
|
658
|
study_startdate.selected = e.detail.value
|
689
|
study_startdate.selected = e.detail.value
|
|
|
|
690
|
+ study_startdate.datelong = (Date.parse(new Date(e.detail.value)) / 1000)
|
|
659
|
this.setData({
|
691
|
this.setData({
|
|
660
|
studystartdate: study_startdate
|
692
|
studystartdate: study_startdate
|
|
661
|
})
|
693
|
})
|
|
@@ -663,6 +695,7 @@ Page({ |
|
@@ -663,6 +695,7 @@ Page({ |
|
663
|
case 'study_end_date':
|
695
|
case 'study_end_date':
|
|
664
|
var study_enddate = this.data.studyenddate
|
696
|
var study_enddate = this.data.studyenddate
|
|
665
|
study_enddate.selected = e.detail.value
|
697
|
study_enddate.selected = e.detail.value
|
|
|
|
698
|
+ study_enddate.datelong = (Date.parse(new Date(e.detail.value)) / 1000)
|
|
666
|
this.setData({
|
699
|
this.setData({
|
|
667
|
studyenddate: study_enddate
|
700
|
studyenddate: study_enddate
|
|
668
|
})
|
701
|
})
|
|
@@ -787,9 +820,9 @@ Page({ |
|
@@ -787,9 +820,9 @@ Page({ |
|
787
|
case 'reduce_date':
|
820
|
case 'reduce_date':
|
|
788
|
var reducedate_data = this.data.reducedateData
|
821
|
var reducedate_data = this.data.reducedateData
|
|
789
|
reducedate_data.selected = e.detail.value
|
822
|
reducedate_data.selected = e.detail.value
|
|
|
|
823
|
+ reducedate_data.datelong = Date.parse(new Date(e.detail.value)) / 1000,
|
|
790
|
console.log('reduce_date', Date.parse(new Date(e.detail.value)))
|
824
|
console.log('reduce_date', Date.parse(new Date(e.detail.value)))
|
|
791
|
this.setData({
|
825
|
this.setData({
|
|
792
|
- long_reduce_date: Date.parse(new Date(e.detail.value)) / 1000,
|
|
|
|
793
|
reducedateData: reducedate_data
|
826
|
reducedateData: reducedate_data
|
|
794
|
})
|
827
|
})
|
|
795
|
break;
|
828
|
break;
|
|
@@ -800,79 +833,79 @@ Page({ |
|
@@ -800,79 +833,79 @@ Page({ |
|
800
|
// })
|
833
|
// })
|
|
801
|
},
|
834
|
},
|
|
802
|
|
835
|
|
|
803
|
- goupload: function(e) {
|
|
|
|
804
|
- console.log(e)
|
|
|
|
805
|
- var that = this
|
|
|
|
806
|
- wx.chooseImage({
|
|
|
|
807
|
- sourceType: ['camera', 'album'],
|
|
|
|
808
|
- // sizeType: ['original'],
|
|
|
|
809
|
- count: 1,
|
|
|
|
810
|
- success: function(res) {
|
|
|
|
811
|
- console.log('success', res)
|
|
|
|
812
|
- that.setData({
|
|
|
|
813
|
- img_path: res.tempFilePaths[0]
|
|
|
|
814
|
- })
|
|
|
|
815
|
- that.uploadImage(that.data.img_path)
|
|
|
|
816
|
- }
|
|
|
|
817
|
- })
|
|
|
|
818
|
- },
|
|
|
|
819
|
-
|
|
|
|
820
|
- uploadImage: function(path) {
|
|
|
|
821
|
- var that = this
|
|
|
|
822
|
- wx.showLoading({
|
|
|
|
823
|
- title: '上传图片中...',
|
|
|
|
824
|
- })
|
|
|
|
825
|
- console.log('key', 'imagepath_' + path.substring(path.length - 10, path.length))
|
|
|
|
826
|
- wx.uploadFile({
|
|
|
|
827
|
- url: getApp().globalData.OSSUrl,
|
|
|
|
828
|
- filePath: path,
|
|
|
|
829
|
- name: 'file',
|
|
|
|
830
|
- formData: {
|
|
|
|
831
|
- 'key': 'imagepath_' + path.substring(path.length - 15, path.length),
|
|
|
|
832
|
- 'OSSAccessKeyId': OSSInit.access_key_id,
|
|
|
|
833
|
- 'policy': OSSInit.policy,
|
|
|
|
834
|
- 'signature': OSSInit.signature,
|
|
|
|
835
|
- 'callback': OSSInit.callback_body,
|
|
|
|
836
|
- 'x:access_token': OSSInit.callback_token,
|
|
|
|
837
|
- 'success_action_status': '200',
|
|
|
|
838
|
- },
|
|
|
|
839
|
- success: function(res) {
|
|
|
|
840
|
- console.log('uploadFile', res.data)
|
|
|
|
841
|
- if (res.statusCode == 200) {
|
|
|
|
842
|
- var data = JSON.parse(res.data)
|
|
|
|
843
|
- console.log('上传成功', res)
|
|
|
|
844
|
- that.oss_bucket = data.bucket
|
|
|
|
845
|
-
|
|
|
|
846
|
- } else {
|
|
|
|
847
|
- var title = '图片上传失败,请重新上传'
|
|
|
|
848
|
- if (res.statusCode == 413) {
|
|
|
|
849
|
- title = '图片体积过大,请选择较小图片上传'
|
|
|
|
850
|
- }
|
|
|
|
851
|
- wx.showModal({
|
|
|
|
852
|
- title: '上传失败',
|
|
|
|
853
|
- content: title,
|
|
|
|
854
|
- showCancel: false,
|
|
|
|
855
|
- confirmColor: '#4E8FE7'
|
|
|
|
856
|
- })
|
|
|
|
857
|
- }
|
|
|
|
858
|
- wx.hideLoading()
|
|
|
|
859
|
- },
|
|
|
|
860
|
- fail: function(err) {
|
|
|
|
861
|
- console.log('fail', err)
|
|
|
|
862
|
- wx.showModal({
|
|
|
|
863
|
- title: '上传失败',
|
|
|
|
864
|
- content: '图片上传失败,请重新上传',
|
|
|
|
865
|
- showCancel: false,
|
|
|
|
866
|
- confirmColor: '#4E8FE7'
|
|
|
|
867
|
- })
|
|
|
|
868
|
- wx.hideLoading()
|
|
|
|
869
|
- },
|
|
|
|
870
|
- complete(res) {
|
|
|
|
871
|
- console.log('complete', res)
|
|
|
|
872
|
- wx.hideLoading()
|
|
|
|
873
|
- }
|
|
|
|
874
|
- })
|
|
|
|
875
|
- },
|
836
|
+ // goupload: function(e) {
|
|
|
|
837
|
+ // console.log(e)
|
|
|
|
838
|
+ // var that = this
|
|
|
|
839
|
+ // wx.chooseImage({
|
|
|
|
840
|
+ // sourceType: ['camera', 'album'],
|
|
|
|
841
|
+ // // sizeType: ['original'],
|
|
|
|
842
|
+ // count: 1,
|
|
|
|
843
|
+ // success: function(res) {
|
|
|
|
844
|
+ // console.log('success', res)
|
|
|
|
845
|
+ // that.setData({
|
|
|
|
846
|
+ // img_path: res.tempFilePaths[0]
|
|
|
|
847
|
+ // })
|
|
|
|
848
|
+ // that.uploadImage(that.data.img_path)
|
|
|
|
849
|
+ // }
|
|
|
|
850
|
+ // })
|
|
|
|
851
|
+ // },
|
|
|
|
852
|
+
|
|
|
|
853
|
+ // uploadImage: function(path) {
|
|
|
|
854
|
+ // var that = this
|
|
|
|
855
|
+ // wx.showLoading({
|
|
|
|
856
|
+ // title: '上传图片中...',
|
|
|
|
857
|
+ // })
|
|
|
|
858
|
+ // console.log('key', 'imagepath_' + path.substring(path.length - 10, path.length))
|
|
|
|
859
|
+ // wx.uploadFile({
|
|
|
|
860
|
+ // url: getApp().globalData.OSSUrl,
|
|
|
|
861
|
+ // filePath: path,
|
|
|
|
862
|
+ // name: 'file',
|
|
|
|
863
|
+ // formData: {
|
|
|
|
864
|
+ // 'key': 'imagepath_' + path.substring(path.length - 15, path.length),
|
|
|
|
865
|
+ // 'OSSAccessKeyId': OSSInit.access_key_id,
|
|
|
|
866
|
+ // 'policy': OSSInit.policy,
|
|
|
|
867
|
+ // 'signature': OSSInit.signature,
|
|
|
|
868
|
+ // 'callback': OSSInit.callback_body,
|
|
|
|
869
|
+ // 'x:access_token': OSSInit.callback_token,
|
|
|
|
870
|
+ // 'success_action_status': '200',
|
|
|
|
871
|
+ // },
|
|
|
|
872
|
+ // success: function(res) {
|
|
|
|
873
|
+ // console.log('uploadFile', res.data)
|
|
|
|
874
|
+ // if (res.statusCode == 200) {
|
|
|
|
875
|
+ // var data = JSON.parse(res.data)
|
|
|
|
876
|
+ // console.log('上传成功', res)
|
|
|
|
877
|
+ // that.oss_bucket = data.bucket
|
|
|
|
878
|
+
|
|
|
|
879
|
+ // } else {
|
|
|
|
880
|
+ // var title = '图片上传失败,请重新上传'
|
|
|
|
881
|
+ // if (res.statusCode == 413) {
|
|
|
|
882
|
+ // title = '图片体积过大,请选择较小图片上传'
|
|
|
|
883
|
+ // }
|
|
|
|
884
|
+ // wx.showModal({
|
|
|
|
885
|
+ // title: '上传失败',
|
|
|
|
886
|
+ // content: title,
|
|
|
|
887
|
+ // showCancel: false,
|
|
|
|
888
|
+ // confirmColor: '#4E8FE7'
|
|
|
|
889
|
+ // })
|
|
|
|
890
|
+ // }
|
|
|
|
891
|
+ // wx.hideLoading()
|
|
|
|
892
|
+ // },
|
|
|
|
893
|
+ // fail: function(err) {
|
|
|
|
894
|
+ // console.log('fail', err)
|
|
|
|
895
|
+ // wx.showModal({
|
|
|
|
896
|
+ // title: '上传失败',
|
|
|
|
897
|
+ // content: '图片上传失败,请重新上传',
|
|
|
|
898
|
+ // showCancel: false,
|
|
|
|
899
|
+ // confirmColor: '#4E8FE7'
|
|
|
|
900
|
+ // })
|
|
|
|
901
|
+ // wx.hideLoading()
|
|
|
|
902
|
+ // },
|
|
|
|
903
|
+ // complete(res) {
|
|
|
|
904
|
+ // console.log('complete', res)
|
|
|
|
905
|
+ // wx.hideLoading()
|
|
|
|
906
|
+ // }
|
|
|
|
907
|
+ // })
|
|
|
|
908
|
+ // },
|
|
876
|
|
909
|
|
|
877
|
showToast: function(data) {
|
910
|
showToast: function(data) {
|
|
878
|
if (data && data.length > 0) {
|
911
|
if (data && data.length > 0) {
|