Authored by 毕凯

频道页面样式优化

@@ -42,7 +42,8 @@ exports.switchChannel = (req, res, next) => { @@ -42,7 +42,8 @@ exports.switchChannel = (req, res, next) => {
42 */ 42 */
43 exports.boys = (req, res) => { 43 exports.boys = (req, res) => {
44 channelModel.getChannelDate({ 44 channelModel.getChannelDate({
45 - gender: 'boys' 45 + gender: 'boys',
  46 + uid: 123
46 }).then(result => { 47 }).then(result => {
47 res.render('channel', Object.assign({ 48 res.render('channel', Object.assign({
48 module: mod, 49 module: mod,
@@ -114,16 +114,20 @@ const processFloor = (list) => { @@ -114,16 +114,20 @@ const processFloor = (list) => {
114 * @param {[object]} gender 114 * @param {[object]} gender
115 * @return {[type]} 115 * @return {[type]}
116 */ 116 */
117 -const getChannelResource = (gender) => {  
118 - gender = gender || 'boys'; 117 +const getChannelResource = (params) => {
  118 + params.gender = params.gender || 'boys';
119 119
120 - return api.get('operations/api/v5/resource/home', sign.apiSign({  
121 - new_device: true, // eslint-disable-line  
122 - gender: genderData[gender],  
123 - content_code: contentCode[gender], // eslint-disable-line 120 + params = Object.assign({
  121 + gender: genderData[params.gender],
  122 + content_code: contentCode[params.gender], // eslint-disable-line
124 page: 1, 123 page: 1,
125 limit: 30 124 limit: 30
126 - })).then(result => { 125 + }, params);
  126 + if (!params.uid) {
  127 + params.new_device = true; // eslint-disable-line
  128 + }
  129 +
  130 + return api.get('operations/api/v5/resource/home', sign.apiSign(params)).then(result => {
127 if (result.code === 200) { 131 if (result.code === 200) {
128 return processFloor(result.data.list); 132 return processFloor(result.data.list);
129 } else { 133 } else {
@@ -157,7 +161,7 @@ const getLeftNav = (choosed) => { @@ -157,7 +161,7 @@ const getLeftNav = (choosed) => {
157 exports.getChannelDate = (params) => { 161 exports.getChannelDate = (params) => {
158 var channelData = {}; 162 var channelData = {};
159 163
160 - return Promise.all([getChannelResource(params.gender), getLeftNav(params.gender)]).then((data) => { 164 + return Promise.all([getChannelResource(params), getLeftNav(params.gender)]).then((data) => {
161 channelData.content = data[0]; // 资源位数据 165 channelData.content = data[0]; // 资源位数据
162 channelData.sideNav = data[1]; // 侧边栏数据 166 channelData.sideNav = data[1]; // 侧边栏数据
163 167
@@ -37,7 +37,7 @@ class API { @@ -37,7 +37,7 @@ class API {
37 37
38 ret.then((body)=>{ 38 ret.then((body)=>{
39 let duration = timer.put('getApi');// 接口返回 39 let duration = timer.put('getApi');// 接口返回
40 - log.info('API GET: %s, parms: %j , durationMs: %d ms , body: %s', options.url, options.qs, duration, body); 40 + // log.info('API GET: %s, parms: %j , durationMs: %d ms , body: %s', options.url, options.qs, duration, body);
41 }).catch((error)=>{ 41 }).catch((error)=>{
42 let duration = timer.put('getApi');// 接口返回 42 let duration = timer.put('getApi');// 接口返回
43 log.error('API GET: %s, parms: %j , durationMs: %d ms error: %s , statusCode: %d', options.url, options.qs, duration, error.message, error.statusCode); 43 log.error('API GET: %s, parms: %j , durationMs: %d ms error: %s , statusCode: %d', options.url, options.qs, duration, error.message, error.statusCode);
1 .footer-tab { 1 .footer-tab {
2 position: fixed; 2 position: fixed;
3 - left: 0; 3 + left: 50%;
4 bottom: 0; 4 bottom: 0;
  5 + margin-left: -320px;
5 width: 100%; 6 width: 100%;
6 height: 100px; 7 height: 100px;
  8 + max-width: 640px;
7 padding-top: 20px; 9 padding-top: 20px;
8 box-sizing: border-box; 10 box-sizing: border-box;
9 background: #fff; 11 background: #fff;
@@ -23,7 +23,10 @@ @@ -23,7 +23,10 @@
23 @import "coupon"; 23 @import "coupon";
24 24
25 .mobile-container { 25 .mobile-container {
  26 + margin-left: auto;
  27 + margin-right: auto;
26 width: 100%; 28 width: 100%;
  29 + max-width: 640px;
27 overflow: hidden; 30 overflow: hidden;
28 } 31 }
29 32