Showing
9 changed files
with
45 additions
and
143 deletions
apps/3party/controllers/questionnaire.js
0 → 100644
@@ -16,6 +16,7 @@ const ads = require(`${cRoot}/ads`); // 第三方广告平台对接 | @@ -16,6 +16,7 @@ const ads = require(`${cRoot}/ads`); // 第三方广告平台对接 | ||
16 | const robot = require(`${cRoot}/robot-check`); // 机器人检查 | 16 | const robot = require(`${cRoot}/robot-check`); // 机器人检查 |
17 | const materialController = require(`${cRoot}/material`); | 17 | const materialController = require(`${cRoot}/material`); |
18 | const activate = require(`${cRoot}/activate`); // 激活点击统计 | 18 | const activate = require(`${cRoot}/activate`); // 激活点击统计 |
19 | +const questionnaire = require(`${cRoot}/questionnaire`); | ||
19 | 20 | ||
20 | router.get('/ads', ads.jump); | 21 | router.get('/ads', ads.jump); |
21 | router.get('/check', captcha.tryGeetest, robot.index); | 22 | router.get('/check', captcha.tryGeetest, robot.index); |
@@ -29,5 +30,6 @@ router.get('/material/getRecommendlist', auth, materialController.getRecommendli | @@ -29,5 +30,6 @@ router.get('/material/getRecommendlist', auth, materialController.getRecommendli | ||
29 | 30 | ||
30 | router.get('/activate-count', auth, activate.index); | 31 | router.get('/activate-count', auth, activate.index); |
31 | router.get('/activate-count/getList', auth, activate.getList); | 32 | router.get('/activate-count/getList', auth, activate.getList); |
33 | +router.get('/questionnaire/:id', auth, questionnaire.getQuestionnaire); | ||
32 | 34 | ||
33 | module.exports = router; | 35 | module.exports = router; |
@@ -8,13 +8,10 @@ | @@ -8,13 +8,10 @@ | ||
8 | 'use strict'; | 8 | 'use strict'; |
9 | 9 | ||
10 | const suggestFeedBackModel = require('../models/suggestFeedBack-service'); | 10 | const suggestFeedBackModel = require('../models/suggestFeedBack-service'); |
11 | -const _ = require('lodash'); | ||
12 | 11 | ||
13 | const getFeedBack = (req, res, next) => { | 12 | const getFeedBack = (req, res, next) => { |
14 | 13 | ||
15 | suggestFeedBackModel.suggestFeedBack().then((result) => { | 14 | suggestFeedBackModel.suggestFeedBack().then((result) => { |
16 | - console.log('result99999999999'); | ||
17 | - console.log(result); | ||
18 | res.jsonp(result); | 15 | res.jsonp(result); |
19 | }).catch(next); | 16 | }).catch(next); |
20 | }; | 17 | }; |
@@ -6,26 +6,27 @@ | @@ -6,26 +6,27 @@ | ||
6 | 'use strict'; | 6 | 'use strict'; |
7 | 7 | ||
8 | const api = require('./suggestFeedBack-api'); | 8 | const api = require('./suggestFeedBack-api'); |
9 | - | 9 | +const helpers = global.yoho.helpers; |
10 | const _ = require('lodash'); | 10 | const _ = require('lodash'); |
11 | 11 | ||
12 | const suggestFeedBack = () => { | 12 | const suggestFeedBack = () => { |
13 | 13 | ||
14 | return api.feedBackApi().then((result) => { | 14 | return api.feedBackApi().then((result) => { |
15 | let suggestData = []; | 15 | let suggestData = []; |
16 | - if (result && result.code == 200 && _.get(result, 'data.rows')) { | 16 | + |
17 | + if (result && result.code === 200 && _.get(result, 'data.rows')) { | ||
17 | 18 | ||
18 | if (_.get(result, 'data.rows')) { | 19 | if (_.get(result, 'data.rows')) { |
19 | _.forEach(_.get(result, 'data.rows', []), it => { | 20 | _.forEach(_.get(result, 'data.rows', []), it => { |
20 | let item = { | 21 | let item = { |
21 | description: it.description, | 22 | description: it.description, |
22 | title: it.title, | 23 | title: it.title, |
23 | - id: it.id | 24 | + id: it.id, |
25 | + url: helpers.urlFormat(`/questionnaire/${it.id}`, null, 'm') | ||
24 | }; | 26 | }; |
25 | 27 | ||
26 | suggestData.push(item); | 28 | suggestData.push(item); |
27 | }); | 29 | }); |
28 | - | ||
29 | } | 30 | } |
30 | 31 | ||
31 | result = suggestData; | 32 | result = suggestData; |
@@ -19,7 +19,7 @@ module.exports = { | @@ -19,7 +19,7 @@ module.exports = { | ||
19 | // test3 | 19 | // test3 |
20 | singleApi: 'http://api-test3.yohops.com:9999/', | 20 | singleApi: 'http://api-test3.yohops.com:9999/', |
21 | api: 'http://api-test3.yohops.com:9999/', | 21 | api: 'http://api-test3.yohops.com:9999/', |
22 | - service: 'http://192.168.102.14:8090/', | 22 | + service: 'http://service-test3.yohops.com:9999/', |
23 | serviceNotify: 'http://service-test3.yohops.com:9999/', | 23 | serviceNotify: 'http://service-test3.yohops.com:9999/', |
24 | global: 'http://global-test-soa.yohops.com:9999/', | 24 | global: 'http://global-test-soa.yohops.com:9999/', |
25 | 25 |
@@ -45,77 +45,6 @@ | @@ -45,77 +45,6 @@ | ||
45 | </p> | 45 | </p> |
46 | </dd> | 46 | </dd> |
47 | <dd class="feed-back-box"> | 47 | <dd class="feed-back-box"> |
48 | - <!--<div id="feed-back-box-list" class="foot-panel">--> | ||
49 | - <!--<div class="title">--> | ||
50 | - <!--<div class="title-line"></div>--> | ||
51 | - <!--<div class="text">--> | ||
52 | - <!--<span>调研中心</span>--> | ||
53 | - <!--</div>--> | ||
54 | - <!--</div>--> | ||
55 | - <!--<ul class="vote suggest-feed-back clearfix">--> | ||
56 | - <!--</ul>--> | ||
57 | - <!--<!–<ul class="vote clearfix">–>--> | ||
58 | - <!--<!–{{#each suggestData}}–>--> | ||
59 | - <!--<!–<li key="0">–>--> | ||
60 | - <!--<!–<form class="feed-back-form" action="#">–>--> | ||
61 | - <!--<!–<p>{{description}}</p>–>--> | ||
62 | - <!--<!–<p>{{title}}</p>–>--> | ||
63 | - <!--<!–<div>–>--> | ||
64 | - <!--<!–<span class="feed-back-btn button">我要参与</span>–>--> | ||
65 | - <!--<!–</div>–>--> | ||
66 | - <!--<!–</form>–>--> | ||
67 | - <!--<!–</li>–>--> | ||
68 | - <!--<!–{{/each}}–>--> | ||
69 | - <!--<!–<li class="hide" key="1">–>--> | ||
70 | - <!--<!–<form class="feed-back-form" action="#">–>--> | ||
71 | - <!--<!–<div>您可以方便的找到想查看的内容吗?</div>–>--> | ||
72 | - <!--<!–<div class="vote-item clearfix">–>--> | ||
73 | - <!--<!–<p>–>--> | ||
74 | - <!--<!–<input type="radio" name="solution" value="38">非常方便–>--> | ||
75 | - <!--<!–</p>–>--> | ||
76 | - <!--<!–<p>–>--> | ||
77 | - <!--<!–<input type="radio" name="solution" value="39">方便–>--> | ||
78 | - <!--<!–</p>–>--> | ||
79 | - <!--<!–<p>–>--> | ||
80 | - <!--<!–<input type="radio" name="solution" value="40">一般般–>--> | ||
81 | - <!--<!–</p>–>--> | ||
82 | - <!--<!–<p>–>--> | ||
83 | - <!--<!–<input type="radio" name="solution" value="41">不方便–>--> | ||
84 | - <!--<!–</p>–>--> | ||
85 | - <!--<!–<p>–>--> | ||
86 | - <!--<!–<input type="radio" name="solution" value="42">非常不方便–>--> | ||
87 | - <!--<!–</p>–>--> | ||
88 | - <!--<!–</div>–>--> | ||
89 | - <!--<!–<div>–>--> | ||
90 | - <!--<!–<span class="feed-back-btn button">提交</span>–>--> | ||
91 | - <!--<!–</div>–>--> | ||
92 | - <!--<!–<input class="question-id" type="hidden" value="39">–>--> | ||
93 | - <!--<!–<input class="feedback-id" type="hidden" value="5">–>--> | ||
94 | - <!--<!–</form>–>--> | ||
95 | - <!--<!–</li>–>--> | ||
96 | - <!--<!–<li class="hide" key="2">–>--> | ||
97 | - <!--<!–<form class="feed-back-form" action="#">–>--> | ||
98 | - <!--<!–<div>您对新版还有哪些意见或建议?</div>–>--> | ||
99 | - <!--<!–<textarea name="answer" id="feedback-answer" class="feedback-answer"></textarea>–>--> | ||
100 | - <!--<!–<div>–>--> | ||
101 | - <!--<!–<span class="feed-back-btn button">提交</span>–>--> | ||
102 | - <!--<!–</div>–>--> | ||
103 | - <!--<!–<input class="question-id" type="hidden" value="37">–>--> | ||
104 | - <!--<!–<input class="feedback-id" type="hidden" value="5">–>--> | ||
105 | - <!--<!–</form>–>--> | ||
106 | - <!--<!–</li>–>--> | ||
107 | - <!--<!–<li class="hide" key="3">–>--> | ||
108 | - <!--<!–<p>调研问卷时间未开始,有货君正在生成调研问卷,<br/>–>--> | ||
109 | - <!--<!–请您先逛一逛,稍后再来~~–>--> | ||
110 | - <!--<!–</p>–>--> | ||
111 | - <!--<!–</li>–>--> | ||
112 | - <!--<!–</ul>–>--> | ||
113 | - <!--</div>--> | ||
114 | - <!--<p id="feed-back-page" class="item-nav center">--> | ||
115 | - <!--<span class="iconfont cur"></span>--> | ||
116 | - <!--<span class="iconfont "></span>--> | ||
117 | - <!--<span class="iconfont "></span>--> | ||
118 | - <!--</p>--> | ||
119 | </dd> | 48 | </dd> |
120 | <dd class="last"> | 49 | <dd class="last"> |
121 | <div class="foot-panel"> | 50 | <div class="foot-panel"> |
@@ -8,29 +8,30 @@ | @@ -8,29 +8,30 @@ | ||
8 | <ul class="vote clearfix"> | 8 | <ul class="vote clearfix"> |
9 | {{#if suggestData}} | 9 | {{#if suggestData}} |
10 | {{#each suggestData}} | 10 | {{#each suggestData}} |
11 | - <li key="0"> | 11 | + <li key="{{@index}}" {{#unless @first}}class="hide"{{/unless}}> |
12 | <form class="feed-back-form" action="#"> | 12 | <form class="feed-back-form" action="#"> |
13 | - <p>{{description}}</p> | 13 | + <p class="description">{{description}}</p> |
14 | <p>{{title}}</p> | 14 | <p>{{title}}</p> |
15 | <div> | 15 | <div> |
16 | - <span class="feed-back-btn button">我要参与</span> | 16 | + <a class="feed-back-btn button" href="{{url}}">我要参与</a> |
17 | </div> | 17 | </div> |
18 | </form> | 18 | </form> |
19 | </li> | 19 | </li> |
20 | {{/each}} | 20 | {{/each}} |
21 | {{/if}} | 21 | {{/if}} |
22 | - {{#unless suggestData}} | ||
23 | - <li key="3"> | ||
24 | - <p class="feed-back-none">调研问卷时间未开始,有货君正在生成调研问卷,<br/> | ||
25 | - 请您先逛一逛,稍后再来~~ | ||
26 | - </p> | ||
27 | - </li> | ||
28 | - {{/unless}} | 22 | + |
23 | + <li {{#if suggestData}}class="hide"{{/if}}> | ||
24 | + <p class="feed-back-none">调研问卷时间未开始,有货君正在生成调研问卷,<br/> | ||
25 | + 请您先逛一逛,稍后再来~~ | ||
26 | + </p> | ||
27 | + </li> | ||
29 | </ul> | 28 | </ul> |
30 | </div> | 29 | </div> |
31 | <p id="feed-back-page" class="item-nav center"> | 30 | <p id="feed-back-page" class="item-nav center"> |
32 | - <span class="iconfont cur"></span> | ||
33 | - <span class="iconfont "></span> | ||
34 | - <span class="iconfont "></span> | 31 | +{{#if suggestData}} |
32 | + {{#each suggestData}} | ||
33 | + <span class="iconfont {{#if @first}}cur{{/if}}"></span> | ||
34 | + {{/each}} | ||
35 | +{{/if}} | ||
35 | </p> | 36 | </p> |
36 | 37 |
@@ -66,10 +66,6 @@ function actionSubscription() { | @@ -66,10 +66,6 @@ function actionSubscription() { | ||
66 | } | 66 | } |
67 | 67 | ||
68 | function actionhomeFootChange() { | 68 | function actionhomeFootChange() { |
69 | - var $vote = $('.vote'), | ||
70 | - $feedBackPage = $('#feed-back-page'); | ||
71 | - | ||
72 | - // count = $vote.children('li').length; | ||
73 | 69 | ||
74 | var param = { | 70 | var param = { |
75 | return_type: 'jsonp', | 71 | return_type: 'jsonp', |
@@ -78,7 +74,7 @@ function actionhomeFootChange() { | @@ -78,7 +74,7 @@ function actionhomeFootChange() { | ||
78 | }; | 74 | }; |
79 | 75 | ||
80 | // 意见反馈 | 76 | // 意见反馈 |
81 | - $feedBackPage.on('click', 'span', function() { | 77 | + $feedBackBox.on('click', '#feed-back-page span', function() { |
82 | var $this = $(this); | 78 | var $this = $(this); |
83 | 79 | ||
84 | if ($this.hasClass('cur')) { | 80 | if ($this.hasClass('cur')) { |
@@ -87,8 +83,7 @@ function actionhomeFootChange() { | @@ -87,8 +83,7 @@ function actionhomeFootChange() { | ||
87 | 83 | ||
88 | $this.siblings('.cur').removeClass('cur'); | 84 | $this.siblings('.cur').removeClass('cur'); |
89 | $this.addClass('cur'); | 85 | $this.addClass('cur'); |
90 | - | ||
91 | - $vote.children().not('.hide').addClass('hide') | 86 | + $feedBackBox.find('.vote').children('li').not('.hide').addClass('hide') |
92 | .end() | 87 | .end() |
93 | .eq($this.index()).removeClass('hide'); | 88 | .eq($this.index()).removeClass('hide'); |
94 | }); | 89 | }); |
@@ -98,49 +93,6 @@ function actionhomeFootChange() { | @@ -98,49 +93,6 @@ function actionhomeFootChange() { | ||
98 | $feedBackBox.html(suggestFeedBackHbs({suggestData: suggestData})); | 93 | $feedBackBox.html(suggestFeedBackHbs({suggestData: suggestData})); |
99 | } | 94 | } |
100 | ); | 95 | ); |
101 | - | ||
102 | - | ||
103 | - // $vote.on('click', '.feed-back-btn', function() { | ||
104 | - // var $this = $(this), | ||
105 | - // $li = $this.closest('li'), | ||
106 | - // index = $li.index(), | ||
107 | - // _solution = []; | ||
108 | - // | ||
109 | - // var _answer = $li.find('.feedback-answer').val(), | ||
110 | - // _feedback = $li.find('.feedback-id').val(), | ||
111 | - // _question = $li.find('.question-id').val(); | ||
112 | - // | ||
113 | - // $li.find(':checked').each(function() { | ||
114 | - // _solution.push($(this).val()); | ||
115 | - // }); | ||
116 | - // | ||
117 | - // $.ajax({ | ||
118 | - // url: '//www.yohobuy.com/common/suggestfeedback?callback=?', | ||
119 | - // dataType: 'jsonp', | ||
120 | - // data: { | ||
121 | - // feedback_id: _feedback || 0, | ||
122 | - // question_id: _question || 0, | ||
123 | - // answer: _answer || '', | ||
124 | - // solution: _solution.join(',') | ||
125 | - // }, | ||
126 | - // success: function(data) { | ||
127 | - // var next = index + 1; | ||
128 | - // | ||
129 | - // if (~~data.data.result === 1) { | ||
130 | - // if (index === count - 1) { | ||
131 | - // alert('感谢您的参与!'); // eslint-disable-line | ||
132 | - // return; | ||
133 | - // } | ||
134 | - // | ||
135 | - // $li.addClass('hide'); | ||
136 | - // | ||
137 | - // $vote.children(':eq(' + (index + 1) + ')').removeClass('hide'); | ||
138 | - // $feedBackPage.children('.cur').removeClass('cur'); | ||
139 | - // $feedBackPage.children(':eq(' + next + ')').addClass('cur'); | ||
140 | - // } | ||
141 | - // } | ||
142 | - // }); | ||
143 | - // }); | ||
144 | } | 96 | } |
145 | 97 | ||
146 | function rePosReturn() { | 98 | function rePosReturn() { |
@@ -105,7 +105,7 @@ | @@ -105,7 +105,7 @@ | ||
105 | .button { | 105 | .button { |
106 | height: 24px; | 106 | height: 24px; |
107 | line-height: 24px; | 107 | line-height: 24px; |
108 | - width: 55px; | 108 | + width: 60px; |
109 | font-size: 12px; | 109 | font-size: 12px; |
110 | margin-top: 11px; | 110 | margin-top: 11px; |
111 | margin-right: 10px; | 111 | margin-right: 10px; |
@@ -122,6 +122,13 @@ | @@ -122,6 +122,13 @@ | ||
122 | text-align: center; | 122 | text-align: center; |
123 | } | 123 | } |
124 | 124 | ||
125 | + .description { | ||
126 | + font-size: 12px; | ||
127 | + height: 72px; | ||
128 | + overflow-x: hidden; | ||
129 | + overflow-y: auto; | ||
130 | + } | ||
131 | + | ||
125 | .feed-back-none { | 132 | .feed-back-none { |
126 | margin-top: 35px; | 133 | margin-top: 35px; |
127 | } | 134 | } |
-
Please register or login to post a comment