Showing
7 changed files
with
54 additions
and
33 deletions
@@ -26,7 +26,7 @@ exports.check = (req, res, next) => { | @@ -26,7 +26,7 @@ exports.check = (req, res, next) => { | ||
26 | 26 | ||
27 | if (!params.uid) { | 27 | if (!params.uid) { |
28 | 28 | ||
29 | - return res.send({code: 206, message: '请先登录!'}); | 29 | + return res.send({code: 400, message: '请先登录!'}); |
30 | } | 30 | } |
31 | 31 | ||
32 | req.ctx(questionModel).getQuestionStatus(params).then(result => { | 32 | req.ctx(questionModel).getQuestionStatus(params).then(result => { |
@@ -29,7 +29,7 @@ | @@ -29,7 +29,7 @@ | ||
29 | <i class="arr-ico iconfont"></i> | 29 | <i class="arr-ico iconfont"></i> |
30 | </a> | 30 | </a> |
31 | <a class="list clearfix" href="/3party/questionnaire"> | 31 | <a class="list clearfix" href="/3party/questionnaire"> |
32 | - <i class="tel-ico icon"></i> | 32 | + <i class="questionnaire-ico icon"></i> |
33 | <div> | 33 | <div> |
34 | <p class="title">调研中心</p> | 34 | <p class="title">调研中心</p> |
35 | <p class="tip">一起来参与,赢取更多惊喜!</p> | 35 | <p class="tip">一起来参与,赢取更多惊喜!</p> |
@@ -4,7 +4,7 @@ const path = require('path'); | @@ -4,7 +4,7 @@ const path = require('path'); | ||
4 | const info = { | 4 | const info = { |
5 | host: '127.0.0.1', | 5 | host: '127.0.0.1', |
6 | port: 5001, | 6 | port: 5001, |
7 | - publicPath: 'http://127.0.0.1:5001' | 7 | + publicPath: 'http://127.0.0.1:5001/' |
8 | }; | 8 | }; |
9 | 9 | ||
10 | try { | 10 | try { |
1.42 KB
@@ -8,6 +8,8 @@ let $ = require('yoho-jquery'), | @@ -8,6 +8,8 @@ let $ = require('yoho-jquery'), | ||
8 | let question = { | 8 | let question = { |
9 | $base: $('#qs-wrap'), | 9 | $base: $('#qs-wrap'), |
10 | init: function() { | 10 | init: function() { |
11 | + let that = this; | ||
12 | + | ||
11 | this.$errTip = $('.error-tip'); | 13 | this.$errTip = $('.error-tip'); |
12 | this.$item = $('.qs-item', this.$base); | 14 | this.$item = $('.qs-item', this.$base); |
13 | this.startTime = Date.parse(new Date()) / 1000; | 15 | this.startTime = Date.parse(new Date()) / 1000; |
@@ -31,7 +33,7 @@ let question = { | @@ -31,7 +33,7 @@ let question = { | ||
31 | yoho.invokeMethod('get.pageType', { | 33 | yoho.invokeMethod('get.pageType', { |
32 | pageType: 'questionnaire' | 34 | pageType: 'questionnaire' |
33 | }); | 35 | }); |
34 | - yoho.invokeMethod('set.shareInfo', this.shareInfo); | 36 | + yoho.invokeMethod('set.shareInfo', that.shareInfo); |
35 | }); | 37 | }); |
36 | } | 38 | } |
37 | } | 39 | } |
@@ -26,6 +26,33 @@ function getQuestionStatus(reqData, cb) { | @@ -26,6 +26,33 @@ function getQuestionStatus(reqData, cb) { | ||
26 | }); | 26 | }); |
27 | } | 27 | } |
28 | 28 | ||
29 | +function jumpQuestionDetail(data) { | ||
30 | + let href; | ||
31 | + | ||
32 | + if (qs && qs.uid && yoho.isApp) { | ||
33 | + href = DETAIL_URI + '/' + data.id + '?uid=' + qs.uid; | ||
34 | + } else { | ||
35 | + href = DETAIL_URI + '/' + data.id; | ||
36 | + } | ||
37 | + | ||
38 | + if (yoho && yoho.isApp) { | ||
39 | + let link = yoho.parseUrl(href); | ||
40 | + | ||
41 | + yoho.goH5(href, JSON.stringify({ | ||
42 | + action: 'go.h5', | ||
43 | + params: { | ||
44 | + islogin: 'N', | ||
45 | + type: 14, | ||
46 | + updateflag: Date.now() + '', | ||
47 | + url: link.path, | ||
48 | + param: link.query | ||
49 | + } | ||
50 | + })); | ||
51 | + } else { | ||
52 | + window.location.href = href; | ||
53 | + } | ||
54 | +} | ||
55 | + | ||
29 | let tipDialog = { | 56 | let tipDialog = { |
30 | $base: $('#tip-dialog'), | 57 | $base: $('#tip-dialog'), |
31 | init: function() { | 58 | init: function() { |
@@ -70,7 +97,9 @@ let tipDialog = { | @@ -70,7 +97,9 @@ let tipDialog = { | ||
70 | 97 | ||
71 | tipDialog.init(); | 98 | tipDialog.init(); |
72 | 99 | ||
73 | -$('#qs-list').on('click', 'li', function() { | 100 | +let $list = $('#qs-list'); |
101 | + | ||
102 | +$list.on('click', 'li', function() { | ||
74 | let data = $(this).data(); | 103 | let data = $(this).data(); |
75 | 104 | ||
76 | if (!data.id) { | 105 | if (!data.id) { |
@@ -79,30 +108,7 @@ $('#qs-list').on('click', 'li', function() { | @@ -79,30 +108,7 @@ $('#qs-list').on('click', 'li', function() { | ||
79 | 108 | ||
80 | getQuestionStatus({uid: qs.uid, id: data.id}, function(resData) { | 109 | getQuestionStatus({uid: qs.uid, id: data.id}, function(resData) { |
81 | if (resData.code === 200) { | 110 | if (resData.code === 200) { |
82 | - let href; | ||
83 | - | ||
84 | - if (qs && qs.uid) { | ||
85 | - href = DETAIL_URI + '/' + data.id + '?uid=' + qs.uid; | ||
86 | - } else { | ||
87 | - href = DETAIL_URI + '/' + data.id; | ||
88 | - } | ||
89 | - | ||
90 | - if (yoho && yoho.isApp) { | ||
91 | - let link = yoho.parseUrl(href); | ||
92 | - | ||
93 | - yoho.goH5(href, JSON.stringify({ | ||
94 | - action: 'go.h5', | ||
95 | - params: { | ||
96 | - islogin: 'N', | ||
97 | - type: 14, | ||
98 | - updateflag: Date.now() + '', | ||
99 | - url: link.path, | ||
100 | - param: link.query | ||
101 | - } | ||
102 | - })); | ||
103 | - } else { | ||
104 | - window.location.href = href; | ||
105 | - } | 111 | + jumpQuestionDetail(data); |
106 | } else if (resData.code === 206) { | 112 | } else if (resData.code === 206) { |
107 | if (yoho && yoho.isApp) { | 113 | if (yoho && yoho.isApp) { |
108 | yoho.invokeMethod('go.showShareAlert', { | 114 | yoho.invokeMethod('go.showShareAlert', { |
@@ -123,3 +129,13 @@ $('#qs-list').on('click', 'li', function() { | @@ -123,3 +129,13 @@ $('#qs-list').on('click', 'li', function() { | ||
123 | } | 129 | } |
124 | }); | 130 | }); |
125 | }); | 131 | }); |
132 | + | ||
133 | +if ($list.children().length === 1) { | ||
134 | + let data = $list.children().first().data(); | ||
135 | + | ||
136 | + getQuestionStatus({uid: qs.uid, id: data.id}, function(resData) { | ||
137 | + if (resData.code === 200) { | ||
138 | + jumpQuestionDetail(data); | ||
139 | + } | ||
140 | + }); | ||
141 | +} |
@@ -124,6 +124,13 @@ | @@ -124,6 +124,13 @@ | ||
124 | margin: 30px 20px; | 124 | margin: 30px 20px; |
125 | } | 125 | } |
126 | 126 | ||
127 | + .questionnaire-ico { | ||
128 | + background-image: url("/service/chat/questionnaire-ico.png"); | ||
129 | + width: 60px; | ||
130 | + height: 60px; | ||
131 | + margin: 30px 20px; | ||
132 | + } | ||
133 | + | ||
127 | .arr-ico { | 134 | .arr-ico { |
128 | line-height: 120px; | 135 | line-height: 120px; |
129 | color: #e1e1e1; | 136 | color: #e1e1e1; |
@@ -145,10 +152,6 @@ | @@ -145,10 +152,6 @@ | ||
145 | font-size: 32px; | 152 | font-size: 32px; |
146 | } | 153 | } |
147 | 154 | ||
148 | - .title-mid { | ||
149 | - margin-top: 15px; | ||
150 | - } | ||
151 | - | ||
152 | .tip { | 155 | .tip { |
153 | line-height: 35px; | 156 | line-height: 35px; |
154 | font-size: 24px; | 157 | font-size: 24px; |
-
Please register or login to post a comment