Authored by yyq

Merge branch 'feature/question2.2' into release/6.2

... ... @@ -52,10 +52,6 @@ exports.submit = (req, res, next) => {
params.uid = req.user.uid || params.uid;
if (!params.uid) {
return res.send({code: 400, message: '请先登录!'});
}
// 标识问卷来源
if (req.yoho.isApp) {
params.sourceType = 'APP';
... ... @@ -88,7 +84,8 @@ exports.detail = (req, res, next) => {
navTitle: 'YOHO!调研中心'
}),
isApp: req.yoho.isApp,
localCss: true
localCss: true,
noLogin: !req.user.uid
}));
}).catch(next);
};
... ...
... ... @@ -64,11 +64,11 @@ module.exports = class extends global.yoho.BaseModel {
}
getQuestionDetail(id, uid) {
return Promise.all([
this.get({
uid ? this.get({
url: '/activity/question/questionValidate',
data: {id: id, uid: uid},
api: global.yoho.ServiceAPI
}),
}) : Promise.resolve({code: 200}),
this.get({
url: 'activity/question/questionDetail',
data: {id: id},
... ...
... ... @@ -27,7 +27,7 @@ router.post('/check/submit', validateCode.check, check.submit);
router.get('/questionnaire', auth, question.list);
router.post('/questionnaire/check', question.check);
router.post('/questionnaire/submit', question.submit);
router.get('/questionnaire/:id', auth, question.detail);
router.get('/questionnaire/:id', question.detail);
router.get('/material', auth, materialNew.list);
module.exports = router;
... ...
<div class="qs-detail-page">
{{# detail}}
<div class="error-tip"></div>
{{#if ../noLogin}}
<p class="qs-prompt"><i class="iconfont">&#xe679;</i>为了您能正常获取参与问卷调研的返利,请正确填写您在有货注册的联系方式</p>
{{/if}}
<div class="detail-wrap">
<p class="sub-title">{{title}}</p>
<p class="guide-tip">{{description}}</p>
... ... @@ -21,6 +24,13 @@
{{/ questions}}
</div>
{{#if ../noLogin}}
<div class="user-mobile">
<label>手机号</label>
<input type="text" name="mobile" maxlength="15" placeholder="请填写有货注册手机号">
</div>
{{/if}}
<div class="submit">
<button class="submit-btn">提交</button>
</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-
<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" />
<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" />
<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" />
... ...
No preview for this file type
No preview for this file type
... ... @@ -11,6 +11,7 @@ let question = {
let that = this;
this.$errTip = $('.error-tip');
this.$mobile = $('.user-mobile > input');
this.$item = $('.qs-item, .sub-qs-item', this.$base);
this.startTime = Date.parse(new Date()) / 1000;
... ... @@ -216,7 +217,8 @@ let question = {
uid: this.$base.data('cid'),
startTime: this.startTime,
endTime: Date.parse(new Date()) / 1000,
frontAnswers: JSON.stringify(info)
frontAnswers: JSON.stringify(info),
mobile: this.$mobile.val()
}
}).then(function(data) {
that.saving = false;
... ...
... ... @@ -22,6 +22,25 @@ body {
z-index: 1;
}
.qs-prompt {
line-height: 1.4;
font-size: 24px;
background-color: #fefced;
color: #ff8a46;
padding: 10px 30px 10px 80px;
position: relative;
.iconfont {
height: 40px;
line-height: 40px;
font-size: 40px;
position: absolute;
left: 30px;
top: 50%;
margin-top: -20px;
}
}
.sub-title {
line-height: 2;
padding: 14px 20px;
... ... @@ -116,6 +135,25 @@ body {
}
}
.user-mobile {
line-height: 60px;
padding: 10px 0;
background: #fff;
margin-bottom: 30px;
padding-left: 30px;
> input {
width: calc(100% - 130px);
height: 60px;
line-height: 60px;
margin-left: 20px;
padding: 0 10px;
border: 1px solid $borderColor;
color: #444;
box-sizing: border-box;
}
}
.submit {
padding: 0 20px;
... ...