...
|
...
|
@@ -3,7 +3,15 @@ require('3party/question-detail.page.css'); |
|
|
let $ = require('yoho-jquery'),
|
|
|
yoho = require('yoho-app'),
|
|
|
tipDg = require('plugin/tip'),
|
|
|
share = require('common/share');
|
|
|
share = require('common/share'),
|
|
|
Validate = require('plugin/validata');
|
|
|
|
|
|
let validate = new Validate('#js-img-check', {
|
|
|
useREM: {
|
|
|
rootFontSize: 40,
|
|
|
picWidth: 150
|
|
|
}
|
|
|
});
|
|
|
|
|
|
let question = {
|
|
|
$base: $('#qs-wrap'),
|
...
|
...
|
@@ -197,31 +205,31 @@ let question = { |
|
|
}
|
|
|
},
|
|
|
saveAnswers: function(info) {
|
|
|
var that = this;
|
|
|
|
|
|
if (this.saving || !info || !info.length) {
|
|
|
if (!info || !info.length) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
this.saving = true;
|
|
|
|
|
|
setTimeout(function() {
|
|
|
that.saving = false;
|
|
|
}, 5000);
|
|
|
return validate.getResults().then(result => {
|
|
|
if (typeof result === 'undefined') {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: '/3party/questionnaire/submit',
|
|
|
data: {
|
|
|
let params = {
|
|
|
id: this.$base.data('id'),
|
|
|
uid: this.$base.data('cid'),
|
|
|
startTime: this.startTime,
|
|
|
endTime: Date.parse(new Date()) / 1000,
|
|
|
frontAnswers: JSON.stringify(info),
|
|
|
mobile: this.$mobile.val()
|
|
|
}
|
|
|
};
|
|
|
|
|
|
$.extend(params, result);
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'POST',
|
|
|
url: '/3party/questionnaire/submit',
|
|
|
data: params
|
|
|
}).then(function(data) {
|
|
|
that.saving = false;
|
|
|
if (data.code === 200 || data.code === 206) {
|
|
|
let tip = '调查问卷已成功提交,感谢您的帮助!';
|
|
|
|
...
|
...
|
@@ -242,6 +250,7 @@ let question = { |
|
|
tipDg.show(data.message || '网络出了点问题~');
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
|
...
|
...
|
|