Authored by yyq

fix

... ... @@ -26,7 +26,7 @@ exports.check = (req, res, next) => {
if (!params.uid) {
return res.send({code: 206, message: '请先登录!'});
return res.send({code: 400, message: '请先登录!'});
}
req.ctx(questionModel).getQuestionStatus(params).then(result => {
... ...
... ... @@ -29,7 +29,7 @@
<i class="arr-ico iconfont">&#xe604;</i>
</a>
<a class="list clearfix" href="/3party/questionnaire">
<i class="tel-ico icon"></i>
<i class="questionnaire-ico icon"></i>
<div>
<p class="title">调研中心</p>
<p class="tip">一起来参与,赢取更多惊喜!</p>
... ...
... ... @@ -4,7 +4,7 @@ const path = require('path');
const info = {
host: '127.0.0.1',
port: 5001,
publicPath: 'http://127.0.0.1:5001'
publicPath: 'http://127.0.0.1:5001/'
};
try {
... ...
... ... @@ -8,6 +8,8 @@ let $ = require('yoho-jquery'),
let question = {
$base: $('#qs-wrap'),
init: function() {
let that = this;
this.$errTip = $('.error-tip');
this.$item = $('.qs-item', this.$base);
this.startTime = Date.parse(new Date()) / 1000;
... ... @@ -31,7 +33,7 @@ let question = {
yoho.invokeMethod('get.pageType', {
pageType: 'questionnaire'
});
yoho.invokeMethod('set.shareInfo', this.shareInfo);
yoho.invokeMethod('set.shareInfo', that.shareInfo);
});
}
}
... ...
... ... @@ -26,6 +26,33 @@ function getQuestionStatus(reqData, cb) {
});
}
function jumpQuestionDetail(data) {
let href;
if (qs && qs.uid && yoho.isApp) {
href = DETAIL_URI + '/' + data.id + '?uid=' + qs.uid;
} else {
href = DETAIL_URI + '/' + data.id;
}
if (yoho && yoho.isApp) {
let link = yoho.parseUrl(href);
yoho.goH5(href, JSON.stringify({
action: 'go.h5',
params: {
islogin: 'N',
type: 14,
updateflag: Date.now() + '',
url: link.path,
param: link.query
}
}));
} else {
window.location.href = href;
}
}
let tipDialog = {
$base: $('#tip-dialog'),
init: function() {
... ... @@ -70,7 +97,9 @@ let tipDialog = {
tipDialog.init();
$('#qs-list').on('click', 'li', function() {
let $list = $('#qs-list');
$list.on('click', 'li', function() {
let data = $(this).data();
if (!data.id) {
... ... @@ -79,30 +108,7 @@ $('#qs-list').on('click', 'li', function() {
getQuestionStatus({uid: qs.uid, id: data.id}, function(resData) {
if (resData.code === 200) {
let href;
if (qs && qs.uid) {
href = DETAIL_URI + '/' + data.id + '?uid=' + qs.uid;
} else {
href = DETAIL_URI + '/' + data.id;
}
if (yoho && yoho.isApp) {
let link = yoho.parseUrl(href);
yoho.goH5(href, JSON.stringify({
action: 'go.h5',
params: {
islogin: 'N',
type: 14,
updateflag: Date.now() + '',
url: link.path,
param: link.query
}
}));
} else {
window.location.href = href;
}
jumpQuestionDetail(data);
} else if (resData.code === 206) {
if (yoho && yoho.isApp) {
yoho.invokeMethod('go.showShareAlert', {
... ... @@ -123,3 +129,13 @@ $('#qs-list').on('click', 'li', function() {
}
});
});
if ($list.children().length === 1) {
let data = $list.children().first().data();
getQuestionStatus({uid: qs.uid, id: data.id}, function(resData) {
if (resData.code === 200) {
jumpQuestionDetail(data);
}
});
}
... ...
... ... @@ -124,6 +124,13 @@
margin: 30px 20px;
}
.questionnaire-ico {
background-image: url("/service/chat/questionnaire-ico.png");
width: 60px;
height: 60px;
margin: 30px 20px;
}
.arr-ico {
line-height: 120px;
color: #e1e1e1;
... ... @@ -145,10 +152,6 @@
font-size: 32px;
}
.title-mid {
margin-top: 15px;
}
.tip {
line-height: 35px;
font-size: 24px;
... ...