easypay.js 965 Bytes
/**
 * 简易结算页特殊数据
 * @author: yyq<yanqing.yang@yoho.cn>
 * @date: 2017/3/2
 */

var $ = require('yoho-jquery');

var queryInfo = {},
    qs;

require('../../common');

if ($('.order-easypay-page').length) {
    qs = window.queryString();

    if (qs.sku && qs.skn && qs.limitcode) { // sku,skn,limitcode 同时存在时为限定商品
        queryInfo = {
            sku: qs.sku,
            skn: qs.skn,
            limitcode: qs.limitcode
        };
    } else if (qs.sku && qs.bundle) { // sku,bundle 同时存在时为套餐商品
        queryInfo = {
            sku: qs.sku,
            bundle: qs.bundle
        };
    }

    // 移除返回购物车
    $('#go-cart-btn').click(function(e) {
        // 阻止事件冒泡
        if (e && e.stopPropagation) {
            e.stopPropagation();
        } else {
            window.event.cancelBubble = true;
        }

        window.history.go(-1);
    });
}

module.exports = queryInfo;