...
|
...
|
@@ -10,6 +10,8 @@ var $ = require('yoho-jquery'), |
|
|
var $returnTop = $('.return-top');
|
|
|
var $qrcodeHoverBox = $('.qrcode-hover-box');
|
|
|
var $rightFloatingLayer = $('.right-floating-layer');
|
|
|
var suggestFeedBackHbs = require('hbs/common/suggest-feed-back.hbs');
|
|
|
var $feedBackBox = $('.feed-back-box');
|
|
|
|
|
|
lazyLoad($('img.lazy'));
|
|
|
|
...
|
...
|
@@ -64,12 +66,15 @@ function actionSubscription() { |
|
|
}
|
|
|
|
|
|
function actionhomeFootChange() {
|
|
|
var $vote = $('.vote'),
|
|
|
$feedBackPage = $('#feed-back-page'),
|
|
|
count = $vote.children('li').length;
|
|
|
|
|
|
var param = {
|
|
|
return_type: 'jsonp',
|
|
|
client_secret: 'web',
|
|
|
code: 200
|
|
|
};
|
|
|
|
|
|
// 意见反馈
|
|
|
$feedBackPage.on('click', 'span', function() {
|
|
|
$feedBackBox.on('click', '#feed-back-page span', function() {
|
|
|
var $this = $(this);
|
|
|
|
|
|
if ($this.hasClass('cur')) {
|
...
|
...
|
@@ -78,53 +83,16 @@ function actionhomeFootChange() { |
|
|
|
|
|
$this.siblings('.cur').removeClass('cur');
|
|
|
$this.addClass('cur');
|
|
|
|
|
|
$vote.children().not('.hide').addClass('hide')
|
|
|
$feedBackBox.find('.vote').children('li').not('.hide').addClass('hide')
|
|
|
.end()
|
|
|
.eq($this.index()).removeClass('hide');
|
|
|
});
|
|
|
|
|
|
$vote.on('click', '.feed-back-btn', function() {
|
|
|
var $this = $(this),
|
|
|
$li = $this.closest('li'),
|
|
|
index = $li.index(),
|
|
|
_solution = [];
|
|
|
|
|
|
var _answer = $li.find('.feedback-answer').val(),
|
|
|
_feedback = $li.find('.feedback-id').val(),
|
|
|
_question = $li.find('.question-id').val();
|
|
|
|
|
|
$li.find(':checked').each(function() {
|
|
|
_solution.push($(this).val());
|
|
|
});
|
|
|
|
|
|
$.ajax({
|
|
|
url: '//new.yohobuy.com/common/suggestfeedback',
|
|
|
dataType: 'jsonp',
|
|
|
data: {
|
|
|
feedback_id: _feedback || 0,
|
|
|
question_id: _question || 0,
|
|
|
answer: _answer || '',
|
|
|
solution: _solution.join(',')
|
|
|
},
|
|
|
success: function(data) {
|
|
|
var next = index + 1;
|
|
|
|
|
|
if (~~data.data.result === 1) {
|
|
|
if (index === count - 1) {
|
|
|
alert('感谢您的参与!'); // eslint-disable-line
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$li.addClass('hide');
|
|
|
|
|
|
$vote.children(':eq(' + (index + 1) + ')').removeClass('hide');
|
|
|
$feedBackPage.children('.cur').removeClass('cur');
|
|
|
$feedBackPage.children(':eq(' + next + ')').addClass('cur');
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
return $.getJSON('//www.yohobuy.com/common/suggestfeedback?callback=?', param,
|
|
|
function(suggestData) {
|
|
|
$feedBackBox.html(suggestFeedBackHbs({suggestData: suggestData}));
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
|
|
|
function rePosReturn() {
|
...
|
...
|
|