Authored by 郝肖肖

Merge branch 'release/5.2' into feature/homeOptimization

@@ -170,7 +170,7 @@ const _getLeftNav = (choosed) => { @@ -170,7 +170,7 @@ const _getLeftNav = (choosed) => {
170 * 获取热门搜索 170 * 获取热门搜索
171 **/ 171 **/
172 const _getSearchIndex = () => { 172 const _getSearchIndex = () => {
173 - return api.get('', { 173 + return API.get('', {
174 method: 'app.search.getTerms' 174 method: 'app.search.getTerms'
175 }, { 175 }, {
176 cache: true 176 cache: true
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 <link><![CDATA[{{{url}}}&ref=rss]]></link> 17 <link><![CDATA[{{{url}}}&ref=rss]]></link>
18 <description><![CDATA[{{{intro}}}]]></description> 18 <description><![CDATA[{{{intro}}}]]></description>
19 <pubDate><![CDATA[{{publishTime}}]]></pubDate> 19 <pubDate><![CDATA[{{publishTime}}]]></pubDate>
20 - <source url="{{{url}}}&ref=rss"><![CDATA[有货逛]]></source> 20 + <source><![CDATA[有货逛]]></source>
21 <author>有货</author> 21 <author>有货</author>
22 </item> 22 </item>
23 {{/items}} 23 {{/items}}
@@ -527,18 +527,22 @@ const getShopCouponsList = (req, res, next) => { @@ -527,18 +527,22 @@ const getShopCouponsList = (req, res, next) => {
527 res.setHeader('Access-Control-Allow-Credentials', 'true'); 527 res.setHeader('Access-Control-Allow-Credentials', 'true');
528 528
529 let uid = req.query.uid || req.user.uid; 529 let uid = req.query.uid || req.user.uid;
530 - let shopId = req.query.shopId; 530 + let shopId = parseInt(req.query.shopId, 10);
531 let param = {}; 531 let param = {};
532 532
533 - if (uid) {  
534 - param.uid = uid;  
535 - } 533 + if (shopId) {
  534 + if (uid) {
  535 + param.uid = uid;
  536 + }
536 537
537 - param.shop_id = shopId; 538 + param.shop_id = shopId;
538 539
539 - listModel.shopCouponsList(param).then(result => {  
540 - res.json(result);  
541 - }).catch(next); 540 + listModel.shopCouponsList(param).then(result => {
  541 + res.json(result);
  542 + }).catch(next);
  543 + } else {
  544 + res.json([]);
  545 + }
542 }; 546 };
543 547
544 /** 548 /**
@@ -555,18 +559,22 @@ const getBrandCouponsList = (req, res, next) => { @@ -555,18 +559,22 @@ const getBrandCouponsList = (req, res, next) => {
555 res.setHeader('Access-Control-Allow-Credentials', 'true'); 559 res.setHeader('Access-Control-Allow-Credentials', 'true');
556 560
557 let uid = req.query.uid || req.user.uid; 561 let uid = req.query.uid || req.user.uid;
558 - let brandId = req.query.brandId; 562 + let brandId = parseInt(req.query.brandId, 10);
559 let param = {}; 563 let param = {};
560 564
561 - if (uid) {  
562 - param.uid = uid;  
563 - } 565 + if (brandId) {
  566 + if (uid) {
  567 + param.uid = uid;
  568 + }
564 569
565 - param.brand_id = brandId; 570 + param.brand_id = brandId;
566 571
567 - listModel.brandCouponsList(param).then(result => {  
568 - res.json(result);  
569 - }).catch(next); 572 + listModel.brandCouponsList(param).then(result => {
  573 + res.json(result);
  574 + }).catch(next);
  575 + } else {
  576 + res.json([]);
  577 + }
570 }; 578 };
571 579
572 module.exports = { 580 module.exports = {
@@ -833,7 +833,7 @@ $newList.on('touchstart', 'li', function(e) { @@ -833,7 +833,7 @@ $newList.on('touchstart', 'li', function(e) {
833 default: 833 default:
834 break; 834 break;
835 } 835 }
836 - 836 + $pre = $firstLiDom;
837 search(); 837 search();
838 }); 838 });
839 839
@@ -87,7 +87,6 @@ @@ -87,7 +87,6 @@
87 width: 150px; 87 width: 150px;
88 height: 50px; 88 height: 50px;
89 line-height: 24px; 89 line-height: 24px;
90 - padding-top: 2px;  
91 overflow: hidden; 90 overflow: hidden;
92 word-break: break-all; 91 word-break: break-all;
93 display: -webkit-box; 92 display: -webkit-box;