Authored by xuqi

Merge branch 'release/1.0' of http://git.yoho.cn/fe/yoho-blk into release/1.0

... ... @@ -6,6 +6,7 @@
'use strict';
const auth = require(`${global.middleware}/auth`);
const router = require('express').Router(); // eslint-disable-line
const cRoot = './controllers';
const list = require(cRoot + '/list');
... ... @@ -19,14 +20,14 @@ router.get('/list', list.index); // 列表页面
router.get('/list/new', list.newPage); // 新品列表页
router.get(/\/pro_([\d]+)_([\d]+)\/(.*)/, item.index); // 商品详情routers
router.post('/item/togglecollect', fav.product); // 商品详情页
router.post('/item/togglecollect', auth, fav.product); // 商品详情页
router.get('/item/getProductInfo', item.getProductInfo); // 商品详情信息
router.get('/shop/query/all', shop.indexQuery);
router.get('/shop/:domain/list', shop.list);
router.get('/shop/:domain', shop.index);
router.post('/shop/togglecollect', fav.shop);
router.post('/brand/togglecollect', fav.brand);
router.post('/shop/togglecollect', auth, fav.shop);
router.post('/brand/togglecollect', auth, fav.brand);
router.get('/query', query.index);
... ...
... ... @@ -23,10 +23,8 @@ const getOnlinePayProvider = () => {
return [];
}
console.log(result.data);
let online = _(result.data)
.filter(i => _.includes(['Alipay', 'Wechatqrcode'], i.payCode))
.filter(i => _.includes(['Alipay'], i.payCode))
.map(i => {
return {
id: i.id,
... ...
... ... @@ -231,16 +231,16 @@
<div class="pro-list">
\{{#each invalidPros}}
<ul>
<li class="chk">
<li class="chk" data-product_info='{"goods_type": "invalid", "buy_number": \{{buy_number}}, "selected": "\{{selected}}", "product_sku": "\{{product_sku}}", "promotion_id": 0}'>
<span class="iconfont warning">&#xe625;</span>
</li>
<li>
<a href="/product/pro_\{{product_id}}_\{{goods_id}}/\{{cn_alphabet}}.html" target="_blank">
<a href="javascript:void(0)">
<img src="\{{image goods_images 100 134}}" alt="\{{product_name}}">
</a>
</li>
<li class="pro-info">
<div class="pro-name"><a href="/product/pro_\{{product_id}}_\{{goods_id}}/\{{cn_alphabet}}.html" target="_blank">\{{product_name}}</a></div>
<div class="pro-name"><a href="javascript:void(0)">\{{product_name}}</a></div>
<div>
\{{#if color_name}}
<span class="mr20">颜色: \{{color_name}}</span>
... ...
... ... @@ -111,16 +111,16 @@
<div class="pro-list">
{{#each invalidPros}}
<ul>
<li class="chk">
<li class="chk" data-product_info='{"goods_type": "invalid", "buy_number": {{buy_number}}, "selected": "{{selected}}", "product_sku": "{{product_sku}}", "promotion_id": 0}'>
<span class="iconfont warning">&#xe625;</span>
</li>
<li>
<a href="/product/pro_{{product_id}}_{{goods_id}}/{{cn_alphabet}}.html" target="_blank">
<a href="javascript:void(0)">
<img src="{{image goods_images 100 134}}" alt="{{product_name}}">
</a>
</li>
<li class="pro-info">
<div class="pro-name"><a href="/product/pro_{{product_id}}_{{goods_id}}/{{cn_alphabet}}.html" target="_blank">{{product_name}}</a></div>
<div class="pro-name"><a href="javascript:void(0)">{{product_name}}</a></div>
<div>
{{#if color_name}}
<span class="mr20">颜色: {{color_name}}</span>
... ... @@ -131,7 +131,7 @@
</div>
</li>
<li class="price-num">
<span class="price sale-price">¥ {{round salesPrice 2}}</span>
<span class="price sale-price">¥ {{round sales_price 2}}</span>
{{> cart/stepper }}
</li>
<li class="total-price-action">
... ...
... ... @@ -19,8 +19,8 @@ module.exports = {
},
cookieDomain: 'yohobuy.com',
domains: {
api: 'http://testapi.yoho.cn:28078/', // devapi.yoho.cn:58078 testapi.yoho.cn:28078 devapi.yoho.cn:58078
service: 'http://testservice.yoho.cn:28077/', // testservice.yoho.cn:28077 devservice.yoho.cn:58077
api: 'http://api.yoho.cn/', // devapi.yoho.cn:58078 testapi.yoho.cn:28078 devapi.yoho.cn:58078
service: 'http://service.yoho.cn/', // testservice.yoho.cn:28077 devservice.yoho.cn:58077
search: 'http://192.168.102.216:8080/yohosearch/'
},
useOneapm: false,
... ...
... ... @@ -14,7 +14,15 @@ module.exports = (req, res, next) => {
return req.protocol + '://' + req.get('host') + req.originalUrl;
};
let loginUrl = helpers.urlFormat('/passport/login', {refer: req.getUrl()});
let refer = '';
if (req.method === 'GET') {
refer = req.getUrl();
} else {
refer = req.get('Referer');
}
let loginUrl = helpers.urlFormat('/passport/login', {refer: refer});
if (_.isEmpty(req.user) || !req.user.uid) {
if (req.xhr) {
... ...
... ... @@ -7,6 +7,8 @@
function _favBack(data) {
if (data && data.code === 200) {
$('#brand-fav').toggleClass('coled');
} else if (data && data.data && data.data.refer) {
location.href = data.data.refer;
}
}
... ...
... ... @@ -77,7 +77,7 @@ var Stepper = {
currNum = $input.val();
plus = $input.parent().next();
if (!$target.hasClass('disable')) {
if (!$target.hasClass('disable') && !$target.parents('.cart-pro-list').hasClass('invalid-pros')) {
sku = $.parseJSON($target.parents('ul').children().first().attr('data-product_info')).product_sku;
goodType = $target.parent().attr('data-producttype');
_this.decrease(goodType, sku, currNum, function(num, changed) {
... ... @@ -103,7 +103,7 @@ var Stepper = {
currNum = $input.val();
minus = $input.parent().prev();
if (!$target.hasClass('disable')) {
if (!$target.hasClass('disable') && !$target.parents('.cart-pro-list').hasClass('invalid-pros')) {
sku = $.parseJSON($target.parents('ul').children().first().attr('data-product_info')).product_sku;
goodType = $target.parent().attr('data-producttype');
_this.increase(goodType, sku, currNum, function(num, changed, overflow) {
... ...
... ... @@ -6,6 +6,24 @@ var $ = require('yoho-jquery');
var $orderDetail = $('.order-detail');
var Dialog = require('../plugins/dialog').Dialog;
var tpl = '<div class="pay-page-tips">' +
'<h3>请您在新打开的页面完成付款</h3>' +
'<p>付款完成前请不要关闭此窗口</p>' +
'<p>完成付款后请根据您的情况点击下面的按钮</p>' +
'<div><a href="/me/order"><span class="btn">已完成付款</span></a>' +
'<span class="btn white close-btn">更换支付方式</span>' +
'</div>' +
'</div>';
var infoDaialog = new Dialog({
className: 'pay-info-dialog',
content: tpl,
keep: true
});
// 展开详情/收起详情
$('#order-detail-ctrl').click(function() {
var $this = $(this);
... ... @@ -40,6 +58,14 @@ $('.pay-type-icon').click(function() {
$('#pay-type-name').text($this.data('name'));
});
function showDialog() {
infoDaialog.show();
$('.pay-page-tips .btn.close-btn').off().on('click', function() {
infoDaialog.close();
});
}
// 去支付
$('#go-pay-btn').click(function() {
var payType = $('.pay-type-icon.active').data('id');
... ... @@ -48,13 +74,16 @@ $('#go-pay-btn').click(function() {
$.ajax({
type: 'POST',
url: '/shopping/pay/online/go',
async: false,
data: {
code: order,
method: payType
}
}).then(function(data) {
if (data.code === 200) {
location.href = data.data.href;
window.open(data.data.href);
showDialog();
}
});
});
... ...
... ... @@ -223,6 +223,20 @@ $hoverColor: #379ed6;
border-top: 1px solid #eee;
color: #999;
input {
color: #999 !important;
}
a {
color: #999 !important;
}
.stepper {
.warning {
display: none;
}
}
.warning {
font-size: 18px !important;
color: #666;
... ...
... ... @@ -156,3 +156,25 @@ $fontColor: #616161;
}
}
.pay-info-dialog {
.pay-page-tips {
text-align: center;
h3 {
font-size: 18px;
font-weight: 700;
margin: 30px 0;
}
p {
font-size: 14px;
color: #999;
margin: 10px 0;
}
.btn {
margin-top: 20px;
}
}
}
... ...