Authored by yyq

question detail no login

@@ -52,10 +52,6 @@ exports.submit = (req, res, next) => { @@ -52,10 +52,6 @@ exports.submit = (req, res, next) => {
52 52
53 params.uid = req.user.uid || params.uid; 53 params.uid = req.user.uid || params.uid;
54 54
55 - if (!params.uid) {  
56 - return res.send({code: 400, message: '请先登录!'});  
57 - }  
58 -  
59 // 标识问卷来源 55 // 标识问卷来源
60 if (req.yoho.isApp) { 56 if (req.yoho.isApp) {
61 params.sourceType = 'APP'; 57 params.sourceType = 'APP';
@@ -88,7 +84,8 @@ exports.detail = (req, res, next) => { @@ -88,7 +84,8 @@ exports.detail = (req, res, next) => {
88 navTitle: 'YOHO!调研中心' 84 navTitle: 'YOHO!调研中心'
89 }), 85 }),
90 isApp: req.yoho.isApp, 86 isApp: req.yoho.isApp,
91 - localCss: true 87 + localCss: true,
  88 + noLogin: !req.user.uid
92 })); 89 }));
93 }).catch(next); 90 }).catch(next);
94 }; 91 };
@@ -27,7 +27,7 @@ router.post('/check/submit', validateCode.check, check.submit); @@ -27,7 +27,7 @@ router.post('/check/submit', validateCode.check, check.submit);
27 router.get('/questionnaire', auth, question.list); 27 router.get('/questionnaire', auth, question.list);
28 router.post('/questionnaire/check', question.check); 28 router.post('/questionnaire/check', question.check);
29 router.post('/questionnaire/submit', question.submit); 29 router.post('/questionnaire/submit', question.submit);
30 -router.get('/questionnaire/:id', auth, question.detail); 30 +router.get('/questionnaire/:id', question.detail);
31 router.get('/material', auth, materialNew.list); 31 router.get('/material', auth, materialNew.list);
32 32
33 module.exports = router; 33 module.exports = router;
1 <div class="qs-detail-page"> 1 <div class="qs-detail-page">
2 {{# detail}} 2 {{# detail}}
3 <div class="error-tip"></div> 3 <div class="error-tip"></div>
  4 + {{#if ../noLogin}}
  5 + <p class="qs-prompt"><i class="iconfont">&#xe679;</i>为了您能正常获取参与问卷调研的返利,请正确填写您在有货注册的联系方式</p>
  6 + {{/if}}
4 <div class="detail-wrap"> 7 <div class="detail-wrap">
5 <p class="sub-title">{{title}}</p> 8 <p class="sub-title">{{title}}</p>
6 <p class="guide-tip">{{description}}</p> 9 <p class="guide-tip">{{description}}</p>
@@ -21,6 +24,13 @@ @@ -21,6 +24,13 @@
21 {{/ questions}} 24 {{/ questions}}
22 </div> 25 </div>
23 26
  27 + {{#if ../noLogin}}
  28 + <div class="user-mobile">
  29 + <label>请填写有货<br>注册手机号</label>
  30 + <input type="text" name="mobile" maxlength="15">
  31 + </div>
  32 + {{/if}}
  33 +
24 <div class="submit"> 34 <div class="submit">
25 <button class="submit-btn">提交</button> 35 <button class="submit-btn">提交</button>
26 </div> 36 </div>
No preview for this file type
@@ -261,6 +261,9 @@ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q- @@ -261,6 +261,9 @@ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-
261 <glyph glyph-name="facebook" unicode="&#58958;" d="M435.959 524.089l0-96.095-76.888 0 0-115.239 76.888 0 0-268.953 115.26 0L551.219 312.755l115.281 0L666.5 427.994l-115.26 0 0 76.867c0 23.064 15.369 38.413 38.372 38.413l76.888 0 0 115.26-96.136 0C497.416 658.535 435.959 597.078 435.959 524.089L435.959 524.089zM512.032 861.888C248.096 861.888 34.144 648 34.144 384c0-263.936 213.952-477.888 477.888-477.888S989.856 120.128 989.856 384C989.856 648 775.968 861.888 512.032 861.888zM830.496 65.472c-41.344-41.344-89.472-73.856-143.104-96.512-55.488-23.488-114.432-35.392-175.296-35.392-60.8 0-119.808 11.904-175.36 35.392-53.632 22.656-101.824 55.104-143.168 96.512-41.344 41.344-73.856 89.6-96.512 143.232C73.504 264.128 61.6 323.2 61.6 384s11.904 119.744 35.392 175.296c22.656 53.632 55.168 101.76 96.512 143.168 41.344 41.344 89.536 73.856 143.168 96.512 55.552 23.424 114.56 35.392 175.36 35.392 60.864 0 119.808-11.968 175.296-35.392 53.632-22.656 101.76-55.168 143.104-96.512 41.344-41.408 73.856-89.536 96.64-143.168 23.424-55.488 35.392-114.432 35.392-175.296s-12.032-119.936-35.392-175.296C904.352 155.136 871.84 106.88 830.496 65.472z" horiz-adv-x="1024" /> 261 <glyph glyph-name="facebook" unicode="&#58958;" d="M435.959 524.089l0-96.095-76.888 0 0-115.239 76.888 0 0-268.953 115.26 0L551.219 312.755l115.281 0L666.5 427.994l-115.26 0 0 76.867c0 23.064 15.369 38.413 38.372 38.413l76.888 0 0 115.26-96.136 0C497.416 658.535 435.959 597.078 435.959 524.089L435.959 524.089zM512.032 861.888C248.096 861.888 34.144 648 34.144 384c0-263.936 213.952-477.888 477.888-477.888S989.856 120.128 989.856 384C989.856 648 775.968 861.888 512.032 861.888zM830.496 65.472c-41.344-41.344-89.472-73.856-143.104-96.512-55.488-23.488-114.432-35.392-175.296-35.392-60.8 0-119.808 11.904-175.36 35.392-53.632 22.656-101.824 55.104-143.168 96.512-41.344 41.344-73.856 89.6-96.512 143.232C73.504 264.128 61.6 323.2 61.6 384s11.904 119.744 35.392 175.296c22.656 53.632 55.168 101.76 96.512 143.168 41.344 41.344 89.536 73.856 143.168 96.512 55.552 23.424 114.56 35.392 175.36 35.392 60.864 0 119.808-11.968 175.296-35.392 53.632-22.656 101.76-55.168 143.104-96.512 41.344-41.408 73.856-89.536 96.64-143.168 23.424-55.488 35.392-114.432 35.392-175.296s-12.032-119.936-35.392-175.296C904.352 155.136 871.84 106.88 830.496 65.472z" horiz-adv-x="1024" />
262 262
263 263
  264 + <glyph glyph-name="laba" unicode="&#59001;" d="M443.079 741.034c-13.393 0-26.994-6.842-40.7-20.563l-131.508-134.897h-106.747c-43.256 0-73.455-33.333-73.455-81.066v-216.223c0-47.681 27.485-97.008 73.455-97.008h93.684l144.805-140.635c11.933-11.948 24.51-18.019 37.419-18.019 15.339 0 28.581 8.558 36.317 23.488 5.12 9.882 7.708 22.295 7.708 36.876l0 593.295c0 40.419-22.077 54.754-40.977 54.754zM431.605 95.68l-144.907 140.763c-4.891 4.747-11.448 7.406-18.261 7.406h-104.313c-10.015 0-21.001 23.257-21.001 44.434v216.224c0 13 3.638 28.492 21.001 28.492h117.785c7.065 0 13.829 2.851 18.746 7.922l130.95 134.32v-579.561zM616.081 716.992c-14.393 0.334-26.611-10.86-27.099-25.376-0.512-14.502 10.837-26.671 25.305-27.17 145.112-5.006 263.153-129.791 263.153-278.179 0-148.48-115.584-268.768-263.153-273.864-14.469-0.501-25.817-12.67-25.305-27.173 0.488-14.209 12.116-25.389 26.176-25.389h0.923c175.972 0 313.811 149.452 313.811 326.425 0 176.382-140.784 324.76-313.811 330.725zM720.087 388.411c0 89.322-68.278 164.346-155.434 170.8-14.393 1.346-26.994-9.795-28.069-24.275-1.075-14.477 9.782-27.078 24.23-28.145 59.902-4.44 106.822-56.435 106.822-118.38 0-61.929-46.921-113.911-106.822-118.352-14.448-1.070-25.305-13.668-24.23-28.148 1.025-13.826 12.525-24.351 26.123-24.351 0.64 0 1.306 0.029 1.946 0.076 87.156 6.457 155.434 81.471 155.434 170.774z" horiz-adv-x="1024" />
  265 +
  266 +
264 <glyph glyph-name="wenhao" unicode="&#59033;" d="M512 886.272c-277.504 0-502.272-224.768-502.272-502.272s224.768-502.272 502.272-502.272 502.272 224.768 502.272 502.272S789.504 886.272 512 886.272zM520.704-14.848c-45.568 0-82.432 36.864-82.432 82.432 0 45.568 36.864 82.432 82.432 82.432 45.568 0 82.432-36.864 82.432-82.432C603.648 22.528 566.272-14.848 520.704-14.848zM737.792 477.184c-11.264-23.552-33.28-50.688-67.072-83.456-37.376-35.84-52.736-52.736-59.392-60.928-7.68-9.728-13.824-20.992-17.408-34.816-4.096-14.336-6.144-35.328-5.632-61.44l0.512-30.72-141.824 0 0 30.208c0 37.376 3.072 67.072 9.216 90.112 6.656 24.064 16.384 45.568 29.696 63.488 12.288 16.896 32.768 39.936 62.464 71.168 33.792 34.816 47.104 51.712 51.712 59.904 3.072 5.12 8.192 16.896 8.192 44.544 0 18.944-6.656 35.328-20.48 50.688-13.312 14.336-33.28 20.992-60.928 20.992-81.408 0-92.672-58.368-92.672-115.712l0-30.208-142.336 0 1.024 30.72c1.536 48.128 7.168 84.48 17.92 111.104 10.752 27.136 28.672 51.712 52.224 73.216 23.04 20.992 49.664 36.352 77.824 46.08 28.16 9.728 57.856 14.336 88.576 14.336 62.976 0 116.736-18.944 159.744-56.832l0 0c43.52-38.912 66.048-90.624 66.048-154.112C755.2 527.872 749.568 501.248 737.792 477.184z" horiz-adv-x="1024" /> 267 <glyph glyph-name="wenhao" unicode="&#59033;" d="M512 886.272c-277.504 0-502.272-224.768-502.272-502.272s224.768-502.272 502.272-502.272 502.272 224.768 502.272 502.272S789.504 886.272 512 886.272zM520.704-14.848c-45.568 0-82.432 36.864-82.432 82.432 0 45.568 36.864 82.432 82.432 82.432 45.568 0 82.432-36.864 82.432-82.432C603.648 22.528 566.272-14.848 520.704-14.848zM737.792 477.184c-11.264-23.552-33.28-50.688-67.072-83.456-37.376-35.84-52.736-52.736-59.392-60.928-7.68-9.728-13.824-20.992-17.408-34.816-4.096-14.336-6.144-35.328-5.632-61.44l0.512-30.72-141.824 0 0 30.208c0 37.376 3.072 67.072 9.216 90.112 6.656 24.064 16.384 45.568 29.696 63.488 12.288 16.896 32.768 39.936 62.464 71.168 33.792 34.816 47.104 51.712 51.712 59.904 3.072 5.12 8.192 16.896 8.192 44.544 0 18.944-6.656 35.328-20.48 50.688-13.312 14.336-33.28 20.992-60.928 20.992-81.408 0-92.672-58.368-92.672-115.712l0-30.208-142.336 0 1.024 30.72c1.536 48.128 7.168 84.48 17.92 111.104 10.752 27.136 28.672 51.712 52.224 73.216 23.04 20.992 49.664 36.352 77.824 46.08 28.16 9.728 57.856 14.336 88.576 14.336 62.976 0 116.736-18.944 159.744-56.832l0 0c43.52-38.912 66.048-90.624 66.048-154.112C755.2 527.872 749.568 501.248 737.792 477.184z" horiz-adv-x="1024" />
265 268
266 269
@@ -375,6 +378,9 @@ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q- @@ -375,6 +378,9 @@ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-
375 <glyph glyph-name="ewm_x_ic" unicode="&#59194;" d="M445.50144 409.88672H121.73312V733.65504h323.76832v-323.76832z m-241.84832 81.92h159.92832v159.92832H203.65312v-159.92832zM861.3888 409.6H537.6V733.36832h323.7888V409.6z m-241.8688 81.92h159.9488v159.92832h-159.9488v-159.92832zM445.50144-7.65952H121.73312V316.1088h323.76832v-323.76832z m-241.84832 81.92h159.92832v159.92832H203.65312v-159.92832zM537.04704 318.34112h163.84v-81.92h-163.84zM537.25184 236.2368h80.73216v-81.92h-80.73216zM779.55072 236.2368h80.73216v-81.92h-80.73216zM779.55072 317.7472h80.73216v-81.92h-80.73216zM537.31328 154.50112h80.73216v-81.92h-80.73216zM698.59328 154.03008h80.73216v-81.92h-80.73216zM537.68192 72.3968h161.28v-81.92h-161.28zM779.55072 72.3968h80.73216v-81.92h-80.73216z" horiz-adv-x="1024" /> 378 <glyph glyph-name="ewm_x_ic" unicode="&#59194;" d="M445.50144 409.88672H121.73312V733.65504h323.76832v-323.76832z m-241.84832 81.92h159.92832v159.92832H203.65312v-159.92832zM861.3888 409.6H537.6V733.36832h323.7888V409.6z m-241.8688 81.92h159.9488v159.92832h-159.9488v-159.92832zM445.50144-7.65952H121.73312V316.1088h323.76832v-323.76832z m-241.84832 81.92h159.92832v159.92832H203.65312v-159.92832zM537.04704 318.34112h163.84v-81.92h-163.84zM537.25184 236.2368h80.73216v-81.92h-80.73216zM779.55072 236.2368h80.73216v-81.92h-80.73216zM779.55072 317.7472h80.73216v-81.92h-80.73216zM537.31328 154.50112h80.73216v-81.92h-80.73216zM698.59328 154.03008h80.73216v-81.92h-80.73216zM537.68192 72.3968h161.28v-81.92h-161.28zM779.55072 72.3968h80.73216v-81.92h-80.73216z" horiz-adv-x="1024" />
376 379
377 380
  381 + <glyph glyph-name="tan" unicode="&#59195;" d="M512 691.2c-169.65632 0-307.2-137.54368-307.2-307.2 0-169.65632 137.54368-307.2 307.2-307.2s307.2 137.54368 307.2 307.2c0 169.65632-137.54368 307.2-307.2 307.2z m-40.96-160.91136a40.96 40.96 0 0 0 81.92 0v-160.91136a40.96 40.96 0 0 0-81.92 0v160.91136z m40.96-321.8432a43.86816 43.86816 0 1 0-0.02048 87.7568A43.86816 43.86816 0 0 0 512 208.44544z" horiz-adv-x="1024" />
  382 +
  383 +
378 384
379 385
380 </font> 386 </font>
No preview for this file type
No preview for this file type
@@ -11,6 +11,7 @@ let question = { @@ -11,6 +11,7 @@ let question = {
11 let that = this; 11 let that = this;
12 12
13 this.$errTip = $('.error-tip'); 13 this.$errTip = $('.error-tip');
  14 + this.$mobile = $('.user-mobile > input');
14 this.$item = $('.qs-item, .sub-qs-item', this.$base); 15 this.$item = $('.qs-item, .sub-qs-item', this.$base);
15 this.startTime = Date.parse(new Date()) / 1000; 16 this.startTime = Date.parse(new Date()) / 1000;
16 17
@@ -216,7 +217,8 @@ let question = { @@ -216,7 +217,8 @@ let question = {
216 uid: this.$base.data('cid'), 217 uid: this.$base.data('cid'),
217 startTime: this.startTime, 218 startTime: this.startTime,
218 endTime: Date.parse(new Date()) / 1000, 219 endTime: Date.parse(new Date()) / 1000,
219 - frontAnswers: JSON.stringify(info) 220 + frontAnswers: JSON.stringify(info),
  221 + mobile: this.$mobile.val()
220 } 222 }
221 }).then(function(data) { 223 }).then(function(data) {
222 that.saving = false; 224 that.saving = false;
@@ -22,6 +22,25 @@ body { @@ -22,6 +22,25 @@ body {
22 z-index: 1; 22 z-index: 1;
23 } 23 }
24 24
  25 + .qs-prompt {
  26 + line-height: 1.4;
  27 + font-size: 24px;
  28 + background-color: #fefced;
  29 + color: #ff8a46;
  30 + padding: 10px 30px 10px 80px;
  31 + position: relative;
  32 +
  33 + .iconfont {
  34 + height: 40px;
  35 + line-height: 40px;
  36 + font-size: 40px;
  37 + position: absolute;
  38 + left: 30px;
  39 + top: 50%;
  40 + margin-top: -20px;
  41 + }
  42 + }
  43 +
25 .sub-title { 44 .sub-title {
26 line-height: 2; 45 line-height: 2;
27 padding: 14px 20px; 46 padding: 14px 20px;
@@ -116,6 +135,31 @@ body { @@ -116,6 +135,31 @@ body {
116 } 135 }
117 } 136 }
118 137
  138 + .user-mobile {
  139 + line-height: 60px;
  140 + padding: 10px 0;
  141 + background: #fff;
  142 + margin-bottom: 30px;
  143 + padding-left: 30px;
  144 +
  145 + > label {
  146 + line-height: 1.4;
  147 + display: inline-block;
  148 + vertical-align: middle;
  149 + }
  150 +
  151 + > input {
  152 + width: calc(100% - 190px);
  153 + height: 60px;
  154 + line-height: 60px;
  155 + margin-left: 20px;
  156 + padding: 0 10px;
  157 + border: 1px solid $borderColor;
  158 + color: #444;
  159 + box-sizing: border-box;
  160 + }
  161 + }
  162 +
119 .submit { 163 .submit {
120 padding: 0 20px; 164 padding: 0 20px;
121 165