Authored by zhangxiaoru

hideTip

... ... @@ -5,9 +5,10 @@ const tideCommandModel = require('../models/tide-command');
exports.tideCommand = (req, res, next) => {
let uid = req.user.uid,
contentCode = '29958987ef0c0f830fad03d7e54f6061';
contentCode = '29958987ef0c0f830fad03d7e54f6061',
hideTips = req.query.hideTips === 'true' ? true : false;
req.ctx(tideCommandModel).invitionData(uid, contentCode).then(result => {
req.ctx(tideCommandModel).invitionData(uid, contentCode, hideTips).then(result => {
res.render('tide-command', {
page: 'tide-command',
pageHeader: headerModel.setNav({
... ...
... ... @@ -39,13 +39,14 @@ module.exports = class extends global.yoho.BaseModel {
});
}
invitionData(uid, contentCode) {
invitionData(uid, contentCode, hideTips) {
return api.all([this.invitionText(uid), this.resources(contentCode)]).then((result) => {
let finaData = {};
finaData = Object.assign(finaData, result[0]);
finaData.imgSrc = _.get(result[1], 'data[0].src', '');
finaData.resourcesUrl = _.get(result[1], 'data[0].url', '');
finaData.hideTips = hideTips;
return finaData;
});
... ...
... ... @@ -8,7 +8,7 @@
<span class="world-number">15</span>
<div class="introduce">
<div class="introduce{{#if hideTips}} hide{{/if}}">
<div class="rules">
{{#if mytrendWordPageDesc}}
<span class="title">玩转潮流口令,超值福利等你拿</span>
... ...
... ... @@ -46,8 +46,4 @@ $('.save').click(function() {
(function() {
$('.world-number').html(15 - $('.command-textarea').val().length);
if (qs.hideTips && qs.hideTips === 'true') {
$('.introduce').hide();
}
}());
... ...