Authored by 郭成尧

Merge branch 'master' into feature/passportctx

... ... @@ -13,7 +13,8 @@ exports.index = (req, res) => {
page: 'birthday',
title: '生日券',
width750: true,
localCss: true
localCss: true,
isApp: req.yoho.isApp
};
res.render('birthday', responseData);
... ...
... ... @@ -54,7 +54,7 @@ module.exports = {
yh_channel: params.yh_channel,
limit: params.limit || 60,
need_filter: 'null',
rec_pos: '100004',
rec_pos: '100053',
gender: params.gender || gender[params.yh_channel]
}, {
cache: true
... ...
... ... @@ -11,7 +11,7 @@
</div>
<div class="rule-item">
<div>领取资格:</div>
<div>您在领取时,必须是有货VIP银卡、金卡、白金卡用户,<a href="//m.yohobuy.com/home/grade">(了解您当前的VIP级别)</a>,且在个人信息中已完善生日信息<a href="//m.yohobuy.com/home/mydetails">(查看/完善个人信息)</a></div>
<div>您在领取时,必须是有货VIP银卡、金卡、白金卡用户,<a href='//m.yohobuy.com/home/grade?openby:yohobuy={"action":"go.vipInfo"}'>(了解您当前的VIP级别)</a>,且在个人信息中已完善生日信息{{#unless @root.isApp}}<a href="//m.yohobuy.com/home/mydetails">(查看/完善个人信息)</a>{{/unless}}</div>
</div>
</div>
<p class="foot-tip">温馨提示:同一用户一年内(365天)仅可以领取一次生日特惠哦!</p>
... ...
... ... @@ -50,6 +50,7 @@ class BuyNowController {
if (product_sku !== orderInfo.product_sku) {
orderInfo = {};
res.clearCookie('buynow_info', actCkOpthn);
}
co(function * () {
... ...
... ... @@ -11,6 +11,11 @@ const headerModel = require('../../../doraemon/models/header'); // 头部model
const cartModel = require('../models/index');
// cookie 参数
const actCkOpthn = {
path: '/cart/index'
};
/**
* [购物车首页]
*/
... ... @@ -23,10 +28,13 @@ const index = (req, res) => {
})
};
// 标识是从普通购物车进的提交订单页面,普通购物车进入提交订单页面默认不使用优惠券
res.cookie('ensure_from', 'cart', actCkOpthn);
// 唤起 APP 的路径
res.locals.appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.shopcart","params":{}}';
res.render('index', Object.assign(pageData, {
res.render('cart-index', Object.assign(pageData, {
title: '购物车',
module: 'cart',
page: 'index',
... ...
... ... @@ -9,7 +9,7 @@
const router = require('express').Router(); //eslint-disable-line
const cRoot = './controllers';
const authMW = require('../../doraemon/middleware/auth');
const disableBFCache = require('../../doraemon/middleware/disable-BFCache');
const seckill = require(cRoot + '/seckill');
const order = require(cRoot + '/order');
const countController = require(`${cRoot}/count`);
... ... @@ -33,7 +33,7 @@ router.get('/shopping/pay/payZero', payController.payZero);// 支付成功,支
router.get('/index/new/pay', authMW, payController.pay);// 统一支付 URL,支持微信,支付宝
router.get('/index/new/pay/alipayresult', authMW, payController.payAli);// 支付宝付款支付成功
router.get('/index/new/orderEnsure', authMW, order.orderEnsure); // 订单结算
router.get('/index/new/orderEnsure', authMW, disableBFCache, order.orderEnsure); // 订单结算
router.post('/index/new/orderCompute', authMW, order.orderCompute); // 结算页参数改变,重新运算
router.post('/index/new/orderSub', authMW, order.orderSub); // 订单提交
router.get('/index/new/selectCoupon', authMW, order.selectCoupon); // 选择优惠券 页面
... ... @@ -64,7 +64,7 @@ router.post('/index/new/giftinfo', indexController.giftinfo); // 获取购物车
router.post('/index/new/incrbundle', indexController.incrBundle); // 购物车增加套餐数量
router.post('/index/new/decrbundle', indexController.decrBundle); // 购物车减少加套餐数量
router.get('/index/buynow/orderensure', authMW, BuyNowController.orderEnsure); // 立即购买订单确认页面
router.get('/index/buynow/orderensure', authMW, disableBFCache, BuyNowController.orderEnsure); // 立即购买订单确认页面
router.post('/index/buynow/ordercompute', authMW, BuyNowController.orderCompute); // 立即购买订单重新计算
router.post('/index/buynow/ordersub', authMW, BuyNowController.orderSub); // 立即购买订单提交
router.get('/index/buynow/selectAddress', authMW, BuyNowController.selectAddress); // 选择地址
... ...
... ... @@ -8,8 +8,9 @@ exports.familyIndex = (req, res, next) => {
let contentCodeOne = '486e6adc7c83001b2e9e83996438fab8';
let contentCodeTwo = 'eebbcc60607ac443922d8fabe44eb222';
let isMarsApp = req.yoho.isMarsApp;
let protocol = req.protocol;
req.ctx(family).familyIndex(uid, contentCodeOne, contentCodeTwo, isMarsApp).then(result => {
req.ctx(family).familyIndex(uid, contentCodeOne, contentCodeTwo, isMarsApp, protocol).then(result => {
res.render('family/index', {
page: 'family',
title: 'YOHO!Family',
... ...
... ... @@ -433,7 +433,7 @@ class familyModel extends global.yoho.BaseModel {
/**
* family主页
*/
familyIndex(uid, contentCodeOne, contentCodeTwo, isMarsApp) {
familyIndex(uid, contentCodeOne, contentCodeTwo, isMarsApp, protocol) {
return Promise.all([
this._userData(uid),
this._getCode(uid),
... ... @@ -445,6 +445,11 @@ class familyModel extends global.yoho.BaseModel {
let familyIndexData = {};
if (result[0] && result[0].data) {
if (result[0].data.headIco) {
result[0].data.headIco = result[0].data.headIco.replace('img01.yohomars.com', 'imgmars.yohobuy.com').replace('img02.yohomars.com', 'imgmars.yohobuy.com'); // eslint-disable-line
}
familyIndexData = _.assign(familyIndexData, {
head_ico: result[0].data.headIco,
nickname: result[0].data.nickName,
... ... @@ -472,9 +477,9 @@ class familyModel extends global.yoho.BaseModel {
}
if (isMarsApp) {
familyIndexData.userInfoLink = 'http://m.yohobuy.com/home/family/userInfo?openby:mars={"action":"go.h5","params":{"url":"http://m.yohobuy.com/home/family/userInfo"}}';
familyIndexData.userInfoLink = `${protocol}://m.yohobuy.com/home/family/userInfo?openby:mars={"action":"go.h5","params":{"url":"${protocol}://m.yohobuy.com/home/family/userInfo"}}`;
} else {
familyIndexData.userInfoLink = 'http://m.yohobuy.com/home/family/userInfo?openby:yohobuy={"action":"go.h5","params":{"url":"http://m.yohobuy.com/home/family/userInfo"}}';
familyIndexData.userInfoLink = `${protocol}://m.yohobuy.com/home/family/userInfo?openby:yohobuy={"action":"go.h5","params":{"url":"${protocol}://m.yohobuy.com/home/family/userInfo"}}`;
}
return familyIndexData;
... ... @@ -545,6 +550,9 @@ class familyModel extends global.yoho.BaseModel {
let vip = 0; // 从family进入二维码,暂时显示0
let hideTips = true;
if (result[0].data.headIco) {
result[0].data.headIco = result[0].data.headIco.replace('img01.yohomars.com', 'imgmars.yohobuy.com').replace('img02.yohomars.com', 'imgmars.yohobuy.com'); // eslint-disable-line
}
result[0].data.gender = (thisGender === '1' ? 'BOY' : 'GIRL');
result[0].data.otherGender = (thisGender === '1' ? 'GIRL' : 'BOY');
... ...
... ... @@ -27,7 +27,7 @@
</a>
<a class="iconfont qrcode" href="/home/newQrcode">&#xe73a;</a>
<div class="gif-part hide"></div>
<!-- <a class="family-entry" href="//m.yohobuy.com/home/family"></a> -->
<a class="family-entry" href="//m.yohobuy.com/home/family">
{{/ baseInfo}}
{{else}}
<a class="login-btn" href="{{signinUrl}}" data-refer="{{referUrl}}">
... ...
... ... @@ -26,7 +26,7 @@ const domains = {
module.exports = {
app: 'h5',
appVersion: '6.3.0', // 调用api的版本
appVersion: '6.2.3', // 调用api的版本
port: 6001,
siteUrl: '//m.yohobuy.com',
assetUrl: '//127.0.0.1:5001',
... ... @@ -134,7 +134,7 @@ module.exports = {
if (isProduction) {
Object.assign(module.exports, {
appName: 'm.yohobuy.com',
assetUrl: `//cdn.yoho.cn/m-yohobuy-node/${pkg.version}/`,
assetUrl: `//cdn.yoho.cn/yohobuywap-node/${pkg.version}/`,
domains: {
api: 'http://api.yoho.yohoops.org/',
service: 'http://api.yoho.yohoops.org/',
... ... @@ -221,7 +221,7 @@ if (isProduction) {
} else if (isTest) {
Object.assign(module.exports, {
appName: 'm.yohobuy.com for test',
assetUrl: `//cdn.yoho.cn/m-yohobuy-node/${pkg.version}/`,
assetUrl: `//cdn.yoho.cn/yohobuywap-node/${pkg.version}/`,
domains: {
api: process.env.TEST_API || 'http://api-test1.yohops.com:9999/',
service: process.env.TEST_API || 'http://api-test1.yohops.com:9999/',
... ...
{
"name": "yohobuywap-node",
"version": "6.3.0",
"version": "6.2.32",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -4,7 +4,7 @@ require('3party/question-list.page.css');
let $ = require('yoho-jquery'),
yoho = require('yoho-app');
const DETAIL_URI = 'http://m.yohobuy.com/3party/questionnaire';
const DETAIL_URI = location.protocol + '//m.yohobuy.com/3party/questionnaire';
require('../common');
... ... @@ -115,7 +115,7 @@ $list.on('click', 'li', function() {
if (canShare && yoho && yoho.isApp) {
yoho.invokeMethod('go.showShareAlert', {
title: data.title,
link: 'https://m.yohobuy.com/3party/questionnaire/' + data.id,
link: DETAIL_URI + '/' + data.id,
desc: data.desc,
imgUrl: data.img
});
... ...
... ... @@ -15,8 +15,7 @@ let $ = require('yoho-jquery'),
let isGetData;
let $newCoupon = $('#new-coupon'),
linkUrl = document.referrer;
let $newCoupon = $('#new-coupon');
let $couponAvailable = $('#couponAvailable');
let $couponUnavailable = $('#couponUnavailable');
let $useCoupon = $('#useCoupon');
... ... @@ -44,11 +43,7 @@ function fixedLayOut() {
ellipsis.init();
function goToBack() {
if (linkUrl) {
window.location.href = linkUrl;
} else {
history.go(-1);
}
history.go(-1);
}
/**
... ...
... ... @@ -40,6 +40,11 @@ let $invoice = $('.invoice'),
const orderEnsure = new OrderEnsure(order);
// cookie 参数
const actCkOpthn = {
path: '/cart/index'
};
require('common');
lazyLoad();
... ... @@ -49,12 +54,16 @@ function isLimitGood() {
}
// 来自购物车的链接默认不使用优惠券
if (document.referrer && document.referrer.indexOf('/cart/index/index') !== -1) {
if (cookie.get('ensure_from') === 'cart') {
orderInfo('couponCode', null);
orderInfo('usable_usual_code', null);
orderInfo('usable_free_code', null);
cookie.removeSpecific('ensure_from', actCkOpthn);
}
// 清除立即购买的 cookie,以免优惠券数据冲突
cookie.removeSpecific('buynow_info', actCkOpthn);
isLimitGood() && (function() {
let a = [];
... ...
... ... @@ -14,8 +14,7 @@ let $ = require('yoho-jquery'),
let isGetData;
let $newCoupon = $('#new-coupon'),
linkUrl = document.referrer;
let $newCoupon = $('#new-coupon');
let $couponAvailable = $('#couponAvailable');
let $couponUnavailable = $('#couponUnavailable');
let $useCoupon = $('#useCoupon');
... ... @@ -43,11 +42,7 @@ function fixedLayOut() {
ellipsis.init();
function goToBack() {
if (linkUrl) {
window.location.href = linkUrl;
} else {
history.go(-1);
}
history.go(-1);
}
/**
... ...