Authored by 郭成尧

'shop-coupon-status'

... ... @@ -62,7 +62,7 @@ const baseShopFav = (req, res) => {
const _shop = (req, res, shopId) => {
let isApp = req.query.app_version || req.query.appVersion || false;
let pageHeader = {};
let uid = 0;
let uid = req.user.uid;
// pagecache前端判断
if (!isApp) {
... ... @@ -190,6 +190,7 @@ const brand = (req, res, next) => {
if (!domain) {
res.redirect('/?go=1');
return;
}
listModel.getBrandLogoByDomain(domain).then((result) => {
... ...
... ... @@ -166,16 +166,16 @@ const _shopCouponsList = (shopId, uid) => {
let shopCoupons = [];
_.forEach(result.data, value => {
let status = parseInt(value.status, 10);
let couPonstatus = parseInt(value.status, 10);
if (status === 1 || status === 3) {
if (couPonstatus === 1 || couPonstatus === 3) {
shopCoupons.push({
validity: value.couponValidity,
id: crypto.encryption('', value.coupon_id),
id: crypto.encryption('', value.coupon_id + ''),
name: value.coupon_name,
pic: value.coupon_pic,
money: value.money,
status: status === 1
money: parseInt(value.money, 10),
status: couPonstatus === 1
});
}
});
... ...
... ... @@ -12,7 +12,7 @@
{{name}}
</span>
</div>
{{#if status}}
{{#if status}}
<div class='coupon-right receive-btn'>
立即领取
</div>
... ... @@ -35,7 +35,7 @@
{{name}}
</span>
</div>
{{#if status}}
{{#if status}}
<div class='coupon-right receive-btn'>
立即领取
</div>
... ...
... ... @@ -43,36 +43,36 @@ var winH = $(window).height(),
require('../../common');
// pagecache判断app设置cookie,判断是否收藏
(function () {
var param = location.search;
var isApp = param.indexOf('app_version') > -1 || param.indexOf('appVersion') > -1;
if (isApp) {
$.ajax({
type: 'GET',
url: '/product/index/shopAppCookie',
error: function () {
tip.show('网络断开连接了~');
}
});
}
$.ajax({
type: 'GET',
url: '/product/index/shopFav',
data: {
shopId: $('.shopid').val(),
},
success: function (data) {
if (data.collect) {
$collect.attr('class', 'already-collect');
}
},
error: function () {
tip.show('网络断开连接了~');
}
});
}());
// (function () {
// var param = location.search;
// var isApp = param.indexOf('app_version') > -1 || param.indexOf('appVersion') > -1;
//
// if (isApp) {
// $.ajax({
// type: 'GET',
// url: '/product/index/shopAppCookie',
// error: function () {
// tip.show('网络断开连接了~');
// }
// });
// }
//
// $.ajax({
// type: 'GET',
// url: '/product/index/shopFav',
// data: {
// shopId: $('.shopid').val(),
// },
// success: function (data) {
// if (data.collect) {
// $collect.attr('class', 'already-collect');
// }
// },
// error: function () {
// tip.show('网络断开连接了~');
// }
// });
// }());
// 默认筛选条件
var defaultOpt = require('../../common/query-param');
... ...
... ... @@ -17,7 +17,7 @@
}
.coupon-left .coupon-left-price {
margin: 0 50px;
margin: 0 15px;
float: left;
}
... ...