Authored by 沈志敏

fix bug client_type

@@ -271,7 +271,6 @@ exports.floor = (params, isApp, appVersion) => { @@ -271,7 +271,6 @@ exports.floor = (params, isApp, appVersion) => {
271 let result = {}, 271 let result = {},
272 resource = yield api.get('', Object.assign(params, { 272 resource = yield api.get('', Object.assign(params, {
273 method: 'app.promotion.queryCouponCenter', 273 method: 'app.promotion.queryCouponCenter',
274 - client_type: isApp ? 'iphone' : 'h5' // 根据不同设备 java端会返回不同的数据  
275 })); 274 }));
276 275
277 if (resource && resource.code === 200) { 276 if (resource && resource.code === 200) {
@@ -2,14 +2,6 @@ @@ -2,14 +2,6 @@
2 const _ = require('lodash'); 2 const _ = require('lodash');
3 const api = global.yoho.API; 3 const api = global.yoho.API;
4 4
5 -const privateKeyList = {  
6 - android: 'fd4ad5fcfa0de589ef238c0e7331b585',  
7 - iphone: 'a85bb0674e08986c6b115d5e3a4884fa',  
8 - ipad: 'ad9fcda2e679cf9229e37feae2cdcf80',  
9 - web: '0ed29744ed318fd28d2c07985d3ba633',  
10 - h5: 'fd4ad5fcfa0de589ef238c0e7331b585'  
11 -};  
12 -  
13 /** 5 /**
14 * 购物车结算 6 * 购物车结算
15 * doc: http://git.yoho.cn/yoho-documents/api-interfaces/blob/master/订单/shopping.md 7 * doc: http://git.yoho.cn/yoho-documents/api-interfaces/blob/master/订单/shopping.md
@@ -163,7 +155,6 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime, @@ -163,7 +155,6 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime,
163 } 155 }
164 156
165 let params = { 157 let params = {
166 - private_key: privateKeyList.h5,  
167 method: activityInfo ? 'app.Shopping.easySubmit' : 'app.Shopping.submit', 158 method: activityInfo ? 'app.Shopping.easySubmit' : 'app.Shopping.submit',
168 address_id: addressId, 159 address_id: addressId,
169 cart_type: cartType, 160 cart_type: cartType,
@@ -89,7 +89,6 @@ const getDetailData = (req, res, next) => { @@ -89,7 +89,6 @@ const getDetailData = (req, res, next) => {
89 let udid = req.sessionID || 'yoho'; 89 let udid = req.sessionID || 'yoho';
90 let gender = req.query.gender || req.cookies._Channel && channels[req.cookies._Channel] || '1,3'; 90 let gender = req.query.gender || req.cookies._Channel && channels[req.cookies._Channel] || '1,3';
91 let isApp = req.query.app_version || req.query.appVersion || false; 91 let isApp = req.query.app_version || req.query.appVersion || false;
92 - let clientType = (req.body.client_type || '').toLowerCase();  
93 let userAgent = req.get('User-Agent'); 92 let userAgent = req.get('User-Agent');
94 let isWeixin = userAgent.includes('MicroMessenger'); // 标识是否是微信访问 93 let isWeixin = userAgent.includes('MicroMessenger'); // 标识是否是微信访问
95 94
@@ -101,15 +100,7 @@ const getDetailData = (req, res, next) => { @@ -101,15 +100,7 @@ const getDetailData = (req, res, next) => {
101 uid = req.user.uid; 100 uid = req.user.uid;
102 } 101 }
103 102
104 - if (clientType === 'ios' && isApp) {  
105 - clientType = 'iphone';  
106 - } else if (clientType === 'android' && isApp) {  
107 - clientType = 'android';  
108 - } else {  
109 - clientType = 'h5';  
110 - }  
111 -  
112 - plustarModel.getDetailData(id, uid, udid, gender, isApp, clientType).then((result) => { 103 + plustarModel.getDetailData(id, uid, udid, gender, isApp).then((result) => {
113 result.brand_intro = htmlProcess.removeHtml(result.brand_intro); 104 result.brand_intro = htmlProcess.removeHtml(result.brand_intro);
114 105
115 if (!isApp & !isWeixin) { 106 if (!isApp & !isWeixin) {
@@ -144,7 +135,6 @@ const getDetailData = (req, res, next) => { @@ -144,7 +135,6 @@ const getDetailData = (req, res, next) => {
144 const getDetailDataAsync = (req, res, next) => { 135 const getDetailDataAsync = (req, res, next) => {
145 let uid; 136 let uid;
146 let udid = req.sessionID || 'yoho'; 137 let udid = req.sessionID || 'yoho';
147 - let clientType = req.body.client_type || '';  
148 let brandId = req.body.brand_id || 0; 138 let brandId = req.body.brand_id || 0;
149 let isApp = req.body.isApp || false; 139 let isApp = req.body.isApp || false;
150 140
@@ -159,7 +149,7 @@ const getDetailDataAsync = (req, res, next) => { @@ -159,7 +149,7 @@ const getDetailDataAsync = (req, res, next) => {
159 if (!brandId) { 149 if (!brandId) {
160 return res.json({code: 400, message: '参数错误'}); 150 return res.json({code: 400, message: '参数错误'});
161 } 151 }
162 - plustarModel.getDetailDataAsync(brandId, uid, udid, clientType, isApp).then((result) => { 152 + plustarModel.getDetailDataAsync(brandId, uid, udid, isApp).then((result) => {
163 res.json({ 153 res.json({
164 isLike: result.isLike, 154 isLike: result.isLike,
165 infos: result.infos 155 infos: result.infos
@@ -9,14 +9,6 @@ const helpers = global.yoho.helpers; @@ -9,14 +9,6 @@ const helpers = global.yoho.helpers;
9 const htmlProcess = require(`${global.utils}/html-process`); 9 const htmlProcess = require(`${global.utils}/html-process`);
10 const imageProcess = require(`${global.utils}/image`); 10 const imageProcess = require(`${global.utils}/image`);
11 11
12 -const privateKeyList = {  
13 - android: 'fd4ad5fcfa0de589ef238c0e7331b585',  
14 - iphone: 'a85bb0674e08986c6b115d5e3a4884fa',  
15 - ipad: 'ad9fcda2e679cf9229e37feae2cdcf80',  
16 - web: '0ed29744ed318fd28d2c07985d3ba633',  
17 - h5: 'fd4ad5fcfa0de589ef238c0e7331b585'  
18 -};  
19 -  
20 const formaData = (data, gender) => { 12 const formaData = (data, gender) => {
21 let build = []; 13 let build = [];
22 14
@@ -232,15 +224,13 @@ const getNewProduct = (brandId, gender, url, isApp) => { @@ -232,15 +224,13 @@ const getNewProduct = (brandId, gender, url, isApp) => {
232 }; 224 };
233 225
234 // 相关资讯--不能加cache,否则点赞有缓存. 226 // 相关资讯--不能加cache,否则点赞有缓存.
235 -const getRelatedEditorial = (brandId, uid, udid, clientType, isApp) => { 227 +const getRelatedEditorial = (brandId, uid, udid, isApp) => {
236 228
237 return serviceAPI.get('guang/service/v1/article/getArticleByBrand', { 229 return serviceAPI.get('guang/service/v1/article/getArticleByBrand', {
238 brand_id: brandId, 230 brand_id: brandId,
239 uid: uid, 231 uid: uid,
240 udid: udid, 232 udid: udid,
241 - client_type: clientType,  
242 - limit: 3,  
243 - private_key: privateKeyList[clientType] 233 + limit: 3
244 }).then((result) => { 234 }).then((result) => {
245 if (result && result.code === 200) { 235 if (result && result.code === 200) {
246 236
@@ -271,12 +261,10 @@ const getRelatedEditorial = (brandId, uid, udid, clientType, isApp) => { @@ -271,12 +261,10 @@ const getRelatedEditorial = (brandId, uid, udid, clientType, isApp) => {
271 }; 261 };
272 262
273 // 是否收藏 263 // 是否收藏
274 -const isCollection = (brandId, clientType, uid) => { 264 +const isCollection = (brandId, uid) => {
275 265
276 let param = { 266 let param = {
277 - brandId: brandId,  
278 - client_type: clientType,  
279 - private_key: privateKeyList[clientType] 267 + brandId: brandId
280 }; 268 };
281 269
282 if (uid) { 270 if (uid) {
@@ -299,11 +287,10 @@ const isCollection = (brandId, clientType, uid) => { @@ -299,11 +287,10 @@ const isCollection = (brandId, clientType, uid) => {
299 }; 287 };
300 288
301 // 品牌详情 289 // 品牌详情
302 -const getDetailData = (id, uid, udid, gender, isApp, clientType) => { 290 +const getDetailData = (id, uid, udid, gender, isApp) => {
303 291
304 return serviceAPI.get('guang/api/v1/plustar/getbrandinfo', { 292 return serviceAPI.get('guang/api/v1/plustar/getbrandinfo', {
305 - id: id,  
306 - client_type: clientType 293 + id: id
307 }, {cache: true}).then((result) => { 294 }, {cache: true}).then((result) => {
308 if (result && result.code === 200) { 295 if (result && result.code === 200) {
309 let list = result.data || []; 296 let list = result.data || [];
@@ -337,8 +324,7 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => { @@ -337,8 +324,7 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => {
337 shareLink: '//guang.m.yohobuy.com/plustar/brandinfo?id=' + id, 324 shareLink: '//guang.m.yohobuy.com/plustar/brandinfo?id=' + id,
338 shareTitle: list.brand_name, 325 shareTitle: list.brand_name,
339 shareImg: list.brand_ico, 326 shareImg: list.brand_ico,
340 - shareDesc: htmlProcess.removeHtml(list.brand_intro),  
341 - clientType: clientType 327 + shareDesc: htmlProcess.removeHtml(list.brand_intro)
342 }); 328 });
343 }); 329 });
344 330
@@ -352,10 +338,10 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => { @@ -352,10 +338,10 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => {
352 /** 338 /**
353 * [品牌详情异步数据] 339 * [品牌详情异步数据]
354 */ 340 */
355 -const getDetailDataAsync = (brandId, uid, udid, clientType, isApp) => { 341 +const getDetailDataAsync = (brandId, uid, udid, isApp) => {
356 return Promise.all([ 342 return Promise.all([
357 - isCollection(brandId, clientType, uid),  
358 - getRelatedEditorial(brandId, uid, udid, clientType, isApp) 343 + isCollection(brandId, uid),
  344 + getRelatedEditorial(brandId, uid, udid, isApp)
359 ]).then((result) => { 345 ]).then((result) => {
360 return { 346 return {
361 isLike: result[0], 347 isLike: result[0],
@@ -23,7 +23,7 @@ const contentCode = contentCodeConfig.guang; @@ -23,7 +23,7 @@ const contentCode = contentCodeConfig.guang;
23 const _getResources = (page) => { 23 const _getResources = (page) => {
24 return serviceAPI.get('operations/api/v5/resource/get', { 24 return serviceAPI.get('operations/api/v5/resource/get', {
25 content_code: contentCode[page], 25 content_code: contentCode[page],
26 - client_type: 'iphone' 26 + platform: 'iphone'
27 }, { 27 }, {
28 cache: true 28 cache: true
29 }).then((result) => { 29 }).then((result) => {
@@ -162,8 +162,7 @@ const _processGuangData = (list, flag) => { @@ -162,8 +162,7 @@ const _processGuangData = (list, flag) => {
162 const getIndexData = () => { 162 const getIndexData = () => {
163 return api.get('', { 163 return api.get('', {
164 method: 'app.starClass.index', 164 method: 'app.starClass.index',
165 - code: '8adc27fcf5676f356602889afcfd2a8e',  
166 - client_type: 'iphone' 165 + code: '8adc27fcf5676f356602889afcfd2a8e'
167 }, { 166 }, {
168 cache: true 167 cache: true
169 }).then((result) => { 168 }).then((result) => {
@@ -185,8 +184,7 @@ const getDetailData = (params, uid) => { @@ -185,8 +184,7 @@ const getDetailData = (params, uid) => {
185 tag: params.tag, 184 tag: params.tag,
186 page: params.page || 1, 185 page: params.page || 1,
187 size: 10, 186 size: 10,
188 - uid: uid,  
189 - client_type: 'iphone' 187 + uid: uid
190 }, { 188 }, {
191 cache: true 189 cache: true
192 }).then((result) => { 190 }).then((result) => {
@@ -101,7 +101,6 @@ @@ -101,7 +101,6 @@
101 101
102 <input id="jump-to-app" type="hidden" value="{{jumpToApp}}"> 102 <input id="jump-to-app" type="hidden" value="{{jumpToApp}}">
103 <input id="brandId" type="hidden" value="{{brand_id}}"> 103 <input id="brandId" type="hidden" value="{{brand_id}}">
104 - <input id="clientType" type="hidden" value="{{clientType}}">  
105 {{#unless @root.wap.plustar.removeRelatedPost}} 104 {{#unless @root.wap.plustar.removeRelatedPost}}
106 <input id="related-infos-demote" type="hidden" value="1"> 105 <input id="related-infos-demote" type="hidden" value="1">
107 {{/unless}} 106 {{/unless}}
1 -<ul class="head-tab" {{#if notIndex}}style="position: fixed;"{{/if}}> 1 +<ul class="head-tab">
2 {{#each headTab}} 2 {{#each headTab}}
3 <li {{#if cur}} class="cur" {{/if}} ><a href="{{ url }}" data-bp-id="guang_tab_{{name}}_false">{{ name }}</a></li> 3 <li {{#if cur}} class="cur" {{/if}} ><a href="{{ url }}" data-bp-id="guang_tab_{{name}}_false">{{ name }}</a></li>
4 {{/each}} 4 {{/each}}
@@ -539,8 +539,7 @@ const setMasterCard = (params) => { @@ -539,8 +539,7 @@ const setMasterCard = (params) => {
539 const getNotices = () => { 539 const getNotices = () => {
540 return middleApi('', { 540 return middleApi('', {
541 method: 'app.resources.getNotices', 541 method: 'app.resources.getNotices',
542 - position: 8,  
543 - client_type: 'iphone' 542 + position: 8
544 }, { 543 }, {
545 cache: true 544 cache: true
546 }).then((res) => { 545 }).then((res) => {
@@ -5,14 +5,12 @@ let dbClass = 'data-bind', @@ -5,14 +5,12 @@ let dbClass = 'data-bind',
5 5
6 module.exports = function(callback) { 6 module.exports = function(callback) {
7 let brandId = $('#brandId').val(); 7 let brandId = $('#brandId').val();
8 - let clientType = $('#clientType').val();  
9 8
10 if (brandId && $('#related-infos-demote').length) { 9 if (brandId && $('#related-infos-demote').length) {
11 $.ajax({ 10 $.ajax({
12 type: 'POST', 11 type: 'POST',
13 url: '/guang/plustar/brandinfoAsync', 12 url: '/guang/plustar/brandinfoAsync',
14 data: { 13 data: {
15 - client_type: clientType,  
16 brand_id: brandId, 14 brand_id: brandId,
17 isApp: isApp, 15 isApp: isApp,
18 uid: uid 16 uid: uid
1 .star-page { 1 .star-page {
2 - .collocation-list {  
3 - padding-top: 88px;  
4 - }  
5 -  
6 .collocation-list, 2 .collocation-list,
7 .detail-list { 3 .detail-list {
8 width: 100%; 4 width: 100%;
@@ -3,7 +3,6 @@ @@ -3,7 +3,6 @@
3 width: 100%; 3 width: 100%;
4 height: auto; 4 height: auto;
5 overflow: hidden; 5 overflow: hidden;
6 - padding-top: 88px;  
7 6
8 li { 7 li {
9 width: 100%; 8 width: 100%;
@@ -33,8 +33,6 @@ @@ -33,8 +33,6 @@
33 } 33 }
34 34
35 .head-tab { 35 .head-tab {
36 - position: fixed;  
37 - top: 0;  
38 width: 640px; 36 width: 640px;
39 height: 88px; 37 height: 88px;
40 background: #000; 38 background: #000;