Authored by 陈峰

Merge branch 'feature/renameCss' into 'release/5.4.1'

秒杀支付方式和选择发票返回修复

1、秒杀支付方式和支付方式ID修复。
2、秒杀选择发票返回修复。
3、js require下划线样式修改成.page模式。

See merge request !281
Showing 35 changed files with 76 additions and 78 deletions
... ... @@ -72,9 +72,9 @@ exports.ensure = (req, res, next) => {
if (orderInfo) {
orderComputerData = yield seckillModel.compute(_.assign(paymentOption, {
delivery_way: orderInfo.deliveryId,
payment_type: orderInfo.paymentType,
use_yoho_coin: orderInfo.yohoCoin
delivery_way: orderInfo.deliveryId || 1,
payment_type: orderInfo.paymentType || 1,
use_yoho_coin: orderInfo.yohoCoin || 0
}));
}
... ... @@ -100,7 +100,6 @@ exports.ensure = (req, res, next) => {
}, paymentInfo.data);
}
// console.log(view);
res.locals.title = '确认订单';
res.render('order-ensure', Object.assign({
module: 'cart',
... ... @@ -117,6 +116,7 @@ exports.ensure = (req, res, next) => {
exports.compute = (req, res, next) => {
const uid = req.user.uid,
sku = req.body.sku,
paymentType = Number.parseInt(req.body.paymentType || 1, 10),
activityId = req.body.activityId;
if (!req.xhr) {
... ... @@ -124,7 +124,7 @@ exports.compute = (req, res, next) => {
}
// 必填字段
if ([uid, sku, activityId].some(field => !field)) {
if ([uid, sku, activityId, paymentType].some(field => !field)) {
return res.status(400).json({
code: 400,
msg: BAD_REQUEST
... ... @@ -135,7 +135,7 @@ exports.compute = (req, res, next) => {
sku_type: 'S', // 秒杀
buy_number: 1,
yoho_coin_mode: 1,
payment_type: 1,
payment_type: paymentType,
uid: req.user.uid,
product_sku: sku,
delivery_way: req.body.deliveryId || 1,
... ...
... ... @@ -8,13 +8,15 @@ const processInvoiceData = (orderInfo, mobile, addresslist) => {
let invoiceType = '7';
let invoices_type = '2';
let invoice_Top = '个人';
let addressId = orderInfo.addressId &&
parseInt(crypto.encryption('', orderInfo.addressId), 10) || 0;
// 用户手机号处理
if (orderInfo.receiverMobile && orderInfo.isModifyTel) {
mobile = orderInfo.receiverMobile;
} else {
_.forEach(addresslist, addressValue => {
if (addressValue.address_id === crypto.encryption('', orderInfo.addressId)) {
if (addressValue.address_id === addressId) {
mobile = addressValue.mobile;
return false;
}
... ...
... ... @@ -32,7 +32,7 @@ exports.payment = (options, orderInfo, orderComputerData) => {
});
};
// http://git.yoho.cn/yoho-documents/api-interfaces/blob/master/%E8%AE%A2%E5%8D%95/%E7%AB%8B%E5%8D%B3%E8%B4%AD%E4%B9%B0.md#L628
exports.compute = options => {
let url = '';
let queryData = Object.assign({
... ...
... ... @@ -32,7 +32,7 @@
{{#if isSupport}}
<li {{#if recommend}}class="chosed"{{/if}}>
<span>{{name}}</span>
<i class="right iconfont {{#if recommend}}icon-cb-radio{{else}}icon-radio{{/if}}" data-id="{{paymentType}}"></i>
<i class="right iconfont {{#if recommend}}icon-cb-radio{{else}}icon-radio{{/if}}" data-id="{{id}}" data-payment-type="{{paymentType}}"></i>
</li>
{{/if}}
{{/each}}
... ...
/* eslint no-undef: "_yas" */
/** eslint no-undef: "_yas" */
require('../../scss/activity/_app-downloads.css');
require('activity/app-downloads.page.css');
require('../../js/common');
var url = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"gender":"1","channel":"2"}}';
... ... @@ -11,7 +11,7 @@ var appPath = url;
var ifr;
setTimeout(function() {
//记录唤醒时间
// 记录唤醒时间
var openTime = +new Date();
window.setTimeout(function() {
... ... @@ -28,7 +28,6 @@ setTimeout(function() {
}
location.href = url;
// window.open(url);
}
}, 1000);
... ... @@ -42,7 +41,7 @@ setTimeout(function() {
}
}, 500);
//1: 男生,2-女生,3-潮童,4-创意生活
// 1: 男生,2-女生,3-潮童,4-创意生活
var CHANNELS = {
boys: 1,
girls: 2,
... ...
/**
* Created by Acgpiano on 2016/9/19.
*/
require('../../scss/activity/_coupon-floor.css');
require('activity/coupon-floor.page.css');
var $ = require('yoho-jquery'),
Swiper = require('yoho-swiper2'),
... ...
... ... @@ -61,8 +61,6 @@ function invoiceInit() {
$('.invoice-type').text(invoiceCont[orderCont.invoiceType] + '(' + invoicesType[orderCont.invoicesType] + ')');
} else {
$('.invoice-type').text('服装(电子)');
// $('.invoice-type').text('服装(纸质)');
}
}
... ... @@ -85,7 +83,6 @@ function isLimitGood() {
return getQueryParam().limitproductcode;
}
if (window.getUid() !== orderInfo('uid')) {
order.init();
window.location.reload();
... ... @@ -192,8 +189,8 @@ function orderCompute() {
deliverId = orderInfo('deliveryId'),
data = {
cartType: orderInfo('cartType') || 'ordinary',
deliveryId: orderInfo('deliveryId'),
paymentTypeId: orderInfo('paymentTypeId'),
deliveryId: deliverId, // 配送方式id
paymentType: orderInfo('paymentType'),
yohoCoin: yohoCoin,
sku: productSku,
activityId: activityId
... ... @@ -283,7 +280,7 @@ function submitOrder() {
invoiceTypeId: orderInfo('invoice') ? ($invoice.find('.invoice-type').val() ||
orderInfo('invoiceType')) : null,
remark: msg,
paymentId: orderInfo('paymentTypeId'),
paymentId: orderInfo('paymentTypeId'), // 支付方式id
paymentType: orderInfo('paymentType'), // 支付方式
useYohoCoin: orderInfo('yohoCoin'),
cartToken: $('#cart-token').val()
... ... @@ -331,7 +328,10 @@ $('.delivery-id').on('touchend', 'li', function() {
});
$('.payment-type').on('touchend', 'li', function() {
orderInfo('paymentType', $('.icon-cb-radio', this).data('id'));
var $paymentType = $('.icon-cb-radio', this);
orderInfo('paymentTypeId', $paymentType.data('id')); // 支付方式id
orderInfo('paymentType', $paymentType.data('payment-type')); // 支付方式
});
$('.dispatch-time').on('touchend', 'li', function() {
... ... @@ -391,14 +391,6 @@ $('#msg').find('textarea').on('blur', function() {
orderInfo('msg', $(this).val());
});
$('.pay-mode').on('click', 'li', function() {
var $this = $(this);
orderInfo('paymentTypeId', $this.data('pay-id'));
orderInfo('paymentType', $this.data('pay-type'));
payType = $this.data('pay-type');
});
$('form').on('submit', function() {
return false;
});
... ... @@ -446,10 +438,12 @@ $subBlock.on('touchstart', 'li', function() {
$('.bill a').on('touchstart', function() {
orderInfo('paymentTypeId', $('.delivery-id .icon-cb-radio').data('id'));
orderInfo('paymentType', $('.payment-type .icon-cb-radio').data('id'));
var $paymentType = $('.payment-type .icon-cb-radio');
orderInfo('paymentTypeId', $paymentType.data('id')); // 支付方式id
orderInfo('paymentType', $paymentType.data('payment-type')); // 支付方式
payType = $('.payment-type .icon-cb-radio').data('id');
payType = $paymentType.data('payment-type');
submitOrder();
});
... ...
... ... @@ -23,7 +23,7 @@ var $invoiceNotice = $('.invoice-notice'),
isModifyTel = false;
var myreg = /^(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/,
linkUrl = $('.address-more').val() || '/cart/index/new/orderEnsure?cartType=ordinary';
linkUrl = document.referrer || '/cart/index/new/orderEnsure?cartType=ordinary';
var C_ID = window._ChannelVary[window.cookie('_Channel')] || 1;
... ...
... ... @@ -3,7 +3,7 @@
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/10/23
*/
require('../../scss/channel/_brand.css');
require('channel/brand.page.css');
var $ = require('yoho-jquery'),
Hammer = require('../common/toy-hammer'),
... ...
// 不要使用es6
'use strict';
require('home/_coupons.css');
require('home/coupons.page.css');
var $ = require('yoho-jquery'),
fastclick = require('yoho-fastclick'),
ellipsis = require('yoho-mlellipsis');
... ...
require('../../scss/home/coin/_yoho-coin-detail.css');
require('home/coin/yoho-coin-detail.page.css');
var $ = require('yoho-jquery'),
loading = require('../plugin/loading'),
... ...
... ... @@ -3,7 +3,7 @@
* @author: zxr
* @date: 2016/8/16
*/
require('../../scss/home/_favorite.css');
require('home/favorite.page.css');
var $ = require('yoho-jquery'),
Hammer = require('yoho-hammer'),
Swiper = require('yoho-swiper');
... ...
/**
* 新有货币界面
*/
require('../../scss/home/_currency-index.css');
require('home/currency-index.page.css');
var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload');
... ...
... ... @@ -4,7 +4,7 @@
* @date: 2015/11/16
*/
require('../../scss/home/_order-detail-index.css');
require('home/order-detail-index.page.css');
var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload'),
... ...
... ... @@ -4,7 +4,7 @@
* @date: 2016/5/20
*/
require('../../scss/product/sale/_break-code-index.css');
require('product/sale/break-code-index.page.css');
var $ = require('yoho-jquery'),
Swiper = require('yoho-swiper2'),
... ...
... ... @@ -4,7 +4,7 @@
* @date: 2016/5/20
*/
require('../../scss/product/sale/_discount-detail-index.css');
require('../../scss/product/sale/discount-detail-index.page.css');
var $ = require('yoho-jquery'),
tip = require('../plugin/tip'),
... ...
... ... @@ -4,7 +4,7 @@
* @date: 2016/5/20
*/
require('../../scss/product/sale/_discount-index.css');
require('product/sale/discount-index.page.css');
var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload');
... ...
... ... @@ -9,8 +9,7 @@ var $categoryNav = $('.outlet-category-nav');
var search = require('./sale/search');
require('../../scss/product/outlet/_index.css');
require('product/outlet/index.page.css');
require('./outlet/nav');
... ... @@ -42,7 +41,7 @@ function searchInitParam(dom) {
}
if ($el.length > 0) {
setTimeout(function(){
setTimeout(function() {
ajaxActivityTime({
type: 0, // 获取全部奥莱活动列表, 不区分是否将开始或结束
yh_channel: window.queryString.yh_channel
... ... @@ -81,7 +80,7 @@ $categoryNavItem.on('click', function(e) {
// 触发第一个search
if ($categoryNavItem.length > 0) {
// $categoryNavItem.eq(0).trigger('click');
setTimeout(function(){
setTimeout(function() {
search.start({
type: 'category'
}, searchInitParam($categoryNavItem.eq(0)));
... ...
... ... @@ -4,7 +4,7 @@
* @date: 2016/5/17
*/
require('../../scss/product/sale/_index.css');
require('product/sale/index.page.css');
var $ = require('yoho-jquery'),
Swiper = require('yoho-swiper2'),
... ...
require('../../scss/product/sale/_vip-index.css');
require('product/sale/vip-index.page.css');
var Swiper = require('yoho-swiper2');
var search = require('./sale/search');
... ...
@import "coupon-floor";
\ No newline at end of file
... ...
@import "brand";
\ No newline at end of file
... ...
... ... @@ -15,7 +15,6 @@
@import "installment/index";
@import "qrcode";
@import "myqrcode";
@import "favorite";
@import "address/index";
@import "favorite";
@import "coupons";
... ...
@import "coupons";
\ No newline at end of file
... ...
@import "../channel/maybe-like";
@import "../common/index";
@import "coin/yoho-coin-new";
@import "../channel/maybe-like";
@import "../common/index";
@import "coin/yoho-coin-new";
... ...
@import "favorite";
\ No newline at end of file
... ...
@import "../layout/swiper";
@import "order";
@import "order-detail";
@import "order-detail";
\ No newline at end of file
... ...
@import "break-code";
@import "goods-list";
@import "../../layout/_swiper.css";
@import "../../channel/_banner-top.css";
@import "../../channel/_floor-header.css";
@import "../../common/_good.css";
@import "../../common/_filter.css";
@import "break-code";
@import "goods-list";
@import "../../layout/_swiper.css";
@import "../../channel/_banner-top.css";
@import "../../channel/_floor-header.css";
@import "../../common/_good.css";
@import "../../common/_filter.css";
... ...
@import "goods-list";
@import "sale";
@import "discount-detail";
@import "../../layout/_swiper.css";
@import "../../channel/_banner-top.css";
@import "../../channel/_floor-header.css";
@import "../../common/_good.css";
@import "../../common/_filter.css";
@import "goods-list";
@import "sale";
@import "discount-detail";
@import "../../layout/_swiper.css";
@import "../../channel/_banner-top.css";
@import "../../channel/_floor-header.css";
@import "../../common/_good.css";
@import "../../common/_filter.css";
... ...
@import "discount";
@import "../../channel/_floor-header.css";
@import "discount";
@import "../../channel/_floor-header.css";
@import "../../channel/_discount-list.css";
\ No newline at end of file
... ...
@import "goods-list";
@import "../../layout/_swiper.css";
@import "../../channel/_banner-top.css";
@import "../../channel/_floor-header.css";
@import "../../common/_good.css";
@import "../../common/_filter.css";
@import "goods-list";
@import "../../layout/_swiper.css";
@import "../../channel/_banner-top.css";
@import "../../channel/_floor-header.css";
@import "../../common/_good.css";
@import "../../common/_filter.css";
... ...