Authored by 毕凯

Revert "Merge branch 'hotfix/question2.0' into 'release/5.8.1'"

This reverts merge request !682
@@ -196,18 +196,10 @@ let question = { @@ -196,18 +196,10 @@ let question = {
196 } 196 }
197 }, 197 },
198 saveAnswers: function(info) { 198 saveAnswers: function(info) {
199 - var that = this;  
200 -  
201 - if (this.saving || !info || !info.length) { 199 + if (!info || !info.length) {
202 return; 200 return;
203 } 201 }
204 202
205 - this.saving = true;  
206 -  
207 - setTimeout(function() {  
208 - that.saving = false;  
209 - }, 5000);  
210 -  
211 $.ajax({ 203 $.ajax({
212 type: 'POST', 204 type: 'POST',
213 url: '/3party/questionnaire/submit', 205 url: '/3party/questionnaire/submit',
@@ -219,8 +211,6 @@ let question = { @@ -219,8 +211,6 @@ let question = {
219 frontAnswers: JSON.stringify(info) 211 frontAnswers: JSON.stringify(info)
220 } 212 }
221 }).then(function(data) { 213 }).then(function(data) {
222 - that.saving = false;  
223 -  
224 if (data.code === 200) { 214 if (data.code === 200) {
225 tipDg.show('调查问卷已成功提交,感谢您的帮助!'); 215 tipDg.show('调查问卷已成功提交,感谢您的帮助!');
226 216
@@ -66,15 +66,17 @@ let tipDialog = { @@ -66,15 +66,17 @@ let tipDialog = {
66 that.hide(); 66 that.hide();
67 }); 67 });
68 this.$base.on('click', '.share-btn', function() { 68 this.$base.on('click', '.share-btn', function() {
69 - that.share();  
70 - that.hide(); 69 + if (that.share && typeof that.share === 'function') {
  70 + that.share();
  71 + } else {
  72 + that.hide();
  73 + }
71 }); 74 });
72 }, 75 },
73 show: function(info) { 76 show: function(info) {
74 - this.shareInfo = false; 77 + this.share = false;
75 78
76 - if (typeof info === 'object' && info.share) {  
77 - this.shareInfo = info.share; 79 + if (typeof info === 'object') {
78 this.$content.html(info.content); 80 this.$content.html(info.content);
79 this.$sureBtns.addClass('hide'); 81 this.$sureBtns.addClass('hide');
80 this.$shareBtns.removeClass('hide'); 82 this.$shareBtns.removeClass('hide');
@@ -90,11 +92,6 @@ let tipDialog = { @@ -90,11 +92,6 @@ let tipDialog = {
90 }, 92 },
91 hide: function() { 93 hide: function() {
92 this.$base.addClass('hide'); 94 this.$base.addClass('hide');
93 - },  
94 - share: function() {  
95 - if (this.shareInfo && yoho && yoho.isApp) {  
96 - yoho.invokeMethod('go.showshareaction', this.shareInfo);  
97 - }  
98 } 95 }
99 }; 96 };
100 97
@@ -114,14 +111,11 @@ $list.on('click', 'li', function() { @@ -114,14 +111,11 @@ $list.on('click', 'li', function() {
114 jumpQuestionDetail(data); 111 jumpQuestionDetail(data);
115 } else if (resData.code === 206) { 112 } else if (resData.code === 206) {
116 if (yoho && yoho.isApp) { 113 if (yoho && yoho.isApp) {
117 - tipDialog.show({  
118 - content: '<p>调查问卷已成功提交,<br>感谢您的帮助!</p>',  
119 - share: {  
120 - title: data.title,  
121 - link: 'https://m.yohobuy.com/3party/questionnaire/' + data.id,  
122 - desc: data.desc,  
123 - imgUrl: data.img  
124 - } 114 + yoho.invokeMethod('go.showShareAlert', {
  115 + title: data.title,
  116 + link: 'http://m.yohobuy.com/3party/questionnaire/' + data.id,
  117 + desc: data.desc,
  118 + imgUrl: data.img
125 }); 119 });
126 } else { 120 } else {
127 tipDialog.show('调查问卷已成功提交,<br>感谢您的帮助!'); 121 tipDialog.show('调查问卷已成功提交,<br>感谢您的帮助!');