Authored by 陈轩

/product/seckill

... ... @@ -73,7 +73,7 @@ const index = (req, res, next) => {
return seckillModel.queryActivity().then((resultActivity) => {
// console.log(resultActivity)
if (resultActivity.code !== 200) {
if (resultActivity.code !== 200 || resultActivity.data.secKillProductVoList.length === 0) {
return next();
}
result.activitys = resultActivity.data.secKillProductVoList;
... ...
... ... @@ -17,7 +17,7 @@ module.exports = {
assetUrl: '//localhost:5001',
domains: {
// service: 'http://devservice.yoho.cn:58077/'
api: 'http://dev-api.yohops.com:9999/',
api: 'http://api.yoho.cn/',
service: 'http://dev-service.yohops.com:9999/',
liveApi: 'http://testapi.live.yohops.com:9999/'
},
... ...
... ... @@ -37,8 +37,9 @@
{{#if systemUpdate}}
{{> updata}}
{{/if}}
{{> header}}
{{#unless isApp}}
{{> header}}
{{/unless}}
{{{body}}}
{{> footer}}
</div>
... ...
... ... @@ -6,7 +6,8 @@
var yoho = require('../yoho-app');
var $ = require('yoho-jquery'),
IScroll = require('yoho-iscroll'),
tip = require('../plugin/tip');
loading = require('plugin/loading'),
tip = require('plugin/tip');
var seckillObj = {};
... ... @@ -191,7 +192,7 @@ seckillObj = {
* [异步加载商品列表]
*/
refreshProductList: function(activityId) {
loading.show();
$.ajax({
url: '/product/seckill/get-product-list',
data: {
... ... @@ -208,6 +209,9 @@ seckillObj = {
error: function(data) {
tip.show('网络断开连接了~');
}
})
.always(function() {
loading.hide();
});
},
... ... @@ -276,19 +280,19 @@ seckillObj = {
failTip,
onsuccess;
if (!yoho.isLogin) {
if (!yoho.isLogin()) {
yoho.invokeMethod('go.login');
return;
}
$remindBtn = $(event.currentTarget);
$product = $remindBtn.parent('.item');
$product = $remindBtn.closest('.item');
actionName = $remindBtn.data('data-action');
actionName = $remindBtn.data('action');
// default
on_off = true;
action = 'go.addSecKil';
action = 'go.addSecKill';
params = {
skn: $product.data('skn'),
startTime: $product.find('[data-start]').data('start'),
... ... @@ -309,18 +313,15 @@ seckillObj = {
onsuccess = function() {
$.post('/product/seckill/remind?app_version=1', {
type: actionName,
data: {
on_off: on_off,
activity_id: $product.data('activity'),
product_skn: $product.data('skn'),
uid: yoho.isLogin(),
sec_kill_id: 1,
app_type: 0
}
on_off: on_off,
activity_id: $product.data('activity'),
product_skn: $product.data('skn'),
uid: yoho.isLogin(),
sec_kill_id: 1,
app_type: 0
})
.done(function(res) {
if (res.code === 200 && res.success) {
if (res.code === 200 && res.data === 'success') {
$remindBtn.hide().siblings().show();
tip.show(okTip);
} else {
... ...
... ... @@ -35,7 +35,7 @@ var yoho = {
/**
* 判断是否是 登录
*/
isLogin() {
isLogin: function() {
return cookie.get('_YOHOUID');
},
... ...