Authored by 王水玲

Merge branch 'release/4.6' of git.yoho.cn:fe/yohobuywap-node into release/4.6

@@ -31,6 +31,8 @@ app.locals.version = pkg.version; @@ -31,6 +31,8 @@ app.locals.version = pkg.version;
31 31
32 // 指定libray目录 32 // 指定libray目录
33 global.library = path.resolve('./library/'); 33 global.library = path.resolve('./library/');
  34 +global.middleware = path.resolve('./doraemon/middleware');
  35 +global.utils = path.resolve('./utils');
34 36
35 app.set('view engine', '.hbs'); 37 app.set('view engine', '.hbs');
36 app.set('views', './doraemon/views'); 38 app.set('views', './doraemon/views');
@@ -75,16 +77,17 @@ app.use((req, res, next) => { @@ -75,16 +77,17 @@ app.use((req, res, next) => {
75 }); 77 });
76 78
77 const logger = require('./library/logger'); 79 const logger = require('./library/logger');
78 -const user = require('./doraemon/middleware/user');  
79 -const setChannel = require('./doraemon/middleware/set-channel');  
80 -const errorHanlder = require('./doraemon/middleware/error-hanlder');  
81 -  
82 -// YOHO 前置中间件  
83 -app.use(user());  
84 -app.use(setChannel());  
85 80
86 // dispatcher 81 // dispatcher
87 try { 82 try {
  83 + const user = require('./doraemon/middleware/user');
  84 + const setChannel = require('./doraemon/middleware/set-channel');
  85 + const errorHanlder = require('./doraemon/middleware/error-hanlder');
  86 +
  87 + // YOHO 前置中间件
  88 + app.use(user());
  89 + app.use(setChannel());
  90 +
88 require('./dispatch')(app); 91 require('./dispatch')(app);
89 92
90 app.all('*', errorHanlder.notFound()); // 404 93 app.all('*', errorHanlder.notFound()); // 404
@@ -21,7 +21,7 @@ exports.index = (req, res) => { @@ -21,7 +21,7 @@ exports.index = (req, res) => {
21 }); 21 });
22 22
23 let categoryId = req.query.category_id; 23 let categoryId = req.query.category_id;
24 - let yhChannel = req.query.yh_channel || 1; 24 + let yhChannel = req.query.yh_channel || 0;
25 let contentcode = req.query.content_code; 25 let contentcode = req.query.content_code;
26 26
27 outletModel.getContent(categoryId, yhChannel, contentcode).then(result => { 27 outletModel.getContent(categoryId, yhChannel, contentcode).then(result => {
@@ -26,6 +26,12 @@ @@ -26,6 +26,12 @@
26 {{# isSoonSoldOut}} 26 {{# isSoonSoldOut}}
27 <p class="few-tag">即将售罄</p> 27 <p class="few-tag">即将售罄</p>
28 {{/ isSoonSoldOut}} 28 {{/ isSoonSoldOut}}
  29 +
  30 + {{#if noStorage}}
  31 + <div class="no-storage">
  32 + <div class="no-storage-img"></div>
  33 + </div>
  34 + {{/if}}
29 </div> 35 </div>
30 <div class="good-detail-text"> 36 <div class="good-detail-text">
31 <div class="name"> 37 <div class="name">
@@ -77,6 +77,7 @@ if ($('.outlet-category-nav').length > 0) { @@ -77,6 +77,7 @@ if ($('.outlet-category-nav').length > 0) {
77 }).goto(0); 77 }).goto(0);
78 } 78 }
79 79
  80 +//更多活动按钮
80 if ($('.back-ground-white').length > 10) { 81 if ($('.back-ground-white').length > 10) {
81 $('.more-activity').show(); 82 $('.more-activity').show();
82 $('.back-ground-white').each(function(index, e) { 83 $('.back-ground-white').each(function(index, e) {
@@ -94,6 +94,28 @@ @@ -94,6 +94,28 @@
94 font-size: 18px; 94 font-size: 18px;
95 line-height: 28px; 95 line-height: 28px;
96 } 96 }
  97 +
  98 + .no-storage {
  99 + width: 100%;
  100 + height: 100%;
  101 + overflow: hidden;
  102 + background-color: #000;
  103 + opacity: 0.4;
  104 + z-index: 10;
  105 + position: absolute;
  106 + top: 0;
  107 +
  108 + .no-storage-img {
  109 + display: block;
  110 + width: 90px;
  111 + height: 90px;
  112 + margin-left: 93px;
  113 + margin-top: 139px;
  114 + background-image: resolve("product/bag_moren.png");
  115 + background-repeat: no-repeat;
  116 + background-size: contain;
  117 + }
  118 + }
97 } 119 }
98 120
99 .good-detail-text { 121 .good-detail-text {
@@ -43,6 +43,11 @@ exports.processProductList = (list, options) => { @@ -43,6 +43,11 @@ exports.processProductList = (list, options) => {
43 return; 43 return;
44 } 44 }
45 45
  46 + //如果库存为0,显示已抢完
  47 + if (product.storageNum === 0){
  48 + product.noStorage = true;
  49 + }
  50 +
46 // 市场价和售价一样,则不显示市场价 51 // 市场价和售价一样,则不显示市场价
47 if (product.marketPrice === product.salesPrice) { 52 if (product.marketPrice === product.salesPrice) {
48 product.marketPrice = false; 53 product.marketPrice = false;
@@ -103,7 +108,7 @@ exports.processProductList = (list, options) => { @@ -103,7 +108,7 @@ exports.processProductList = (list, options) => {
103 108
104 pruductList.push(product); 109 pruductList.push(product);
105 }); 110 });
106 - 111 + console.log(pruductList);
107 return pruductList; 112 return pruductList;
108 }; 113 };
109 114