Authored by 郭成尧

Merge branch 'master' into feature/seo2

... ... @@ -149,9 +149,9 @@ exports.coupon = (req, res, next) => {
module: 'activity',
page: 'store-coupon',
pageHeader: headerModel.setNav({
navTitle: '我的优惠'
navTitle: '我的优惠'
}),
title: '我的优惠',
title: '我的优惠',
width750: true,
localCss: true,
};
... ...
... ... @@ -8,7 +8,7 @@ module.exports = class extends global.yoho.BaseModel {
}
/**
* 领取验证以及领列表
* 领取验证以及领列表
*/
freeMail(uid, verify) {
return api.get('', {
... ...
... ... @@ -262,8 +262,8 @@ router.get('/app-downloads', appDownloads.index);
router.get('/couponSend', couponFloor.couponSend); // 获取优惠券
router.get('/birthday', auth, birthday.index); // 生日卷活动
router.get('/getCoupon', birthday.getCoupon); // 获取生日卷状态
router.get('/birthday', auth, birthday.index); // 生日券活动
router.get('/getCoupon', birthday.getCoupon); // 获取生日券状态
router.get('/share-buy', update('5.7.0'), auth, shareBuy.index); // 分享购首页
router.get('/share-buy/detail', update('5.7.0'), shareBuy.detail); // 分享购详情页
... ... @@ -292,7 +292,7 @@ router.get('/store-home/coffee', storeHome.storeAuth, storeHome.coffee); // 线
router.get('/store-home/green', storeHome.storeAuth, storeHome.green); // 线下店个人中心-绿植
router.get('/store-home/history', storeHome.storeAuth, storeHome.history); // 线下店个人中心-消费明细
router.get('/store-home/ewm', storeHome.storeAuth, storeHome.ewm); // 线下店个人中心-二维码
router.get('/store-home/coupon', storeHome.storeAuth, storeHome.coupon); // 线下店个人中心-优惠
router.get('/store-home/coupon', storeHome.storeAuth, storeHome.coupon); // 线下店个人中心-优惠
router.get('/store-home/moreHistory', storeHome.storeAuth, storeHome.moreHistory); // 线下店个人中心-更多记录
router.get('/store-home/modify', storeHome.storeAuth, storeHome.modify); // 线下店个人中心-修改宝宝信息
... ...
... ... @@ -80,15 +80,15 @@ exports.pickCoupon = (req, res, next) => {
}).catch(next);
};
// 生日
// 生日
exports.birthCoupon = (req, res, next) => {
let responseData = {
module: 'home',
page: 'message',
pageHeader: headerModel.setNav({
navTitle: '生日'
navTitle: '生日'
}),
title: '生日',
title: '生日',
pageFooter: true
};
... ...
... ... @@ -107,7 +107,7 @@ router.get('/messageDetail', auth, message.index);
router.post('/ajaxDelMes', auth, message.ajaxDelMes);
router.post('/pickCoupon', auth, message.pickCoupon);
// 生日消息
// 生日消息
router.get('/birthCoupon', auth, message.birthCoupon);
// 在线客服
... ...
... ... @@ -3,15 +3,13 @@
<span>{{coinNum}}</span>
</div>
<div class="btn-c">
<a class="acquiring-help" href='https://activity.yoho.cn/feature/905.html?share_id=3111&title=YOHO!FAMILY积分说明&openby:yohobuy={"action":"go.h5","params":{"url":"https://activity.yoho.cn/feature/905.html?share_id=3111&title=YOHO!FAMILY积分说明"}}'>如何获取积分</a>
{{#if isNowApp}}
<a class="acquiring-help">如何获取Yoho!Coins</a>
<a class="detail">Yoho!Coins明细</a>
<a class="detail" href='//m.yohobuy.com/home/family/coinDetail?plateType=3&openby:yohobuy={"action":"go.h5","params":{"url":"http://m.yohobuy.com/home/family/coinDetail","param":{"plateType":"3"}}}'>积分明细</a>
{{else if isMarsApp}}
<a class="acquiring-help">如何获取mars points</a>
<a class="detail">mars points明细</a>
<a class="detail" href='//m.yohobuy.com/home/family/coinDetail?plateType=2&openby:yohobuy={"action":"go.h5","params":{"url":"http://m.yohobuy.com/home/family/coinDetail","param":{"plateType":"2"}}}'>积分明细</a>
{{else}}
<a href='//m.yohobuy.com/service/qaDetail?keyword=有货币&sonId=227&openby:yohobuy={"action":"go.h5","params":{"url":"http://m.yohobuy.com/service/qaDetail","param":{"keyword":"有货币","sonId":"227"}}}'>如何获取有货币</a>
<a href='//m.yohobuy.com/home/family/coinDetail?plateType=1&openby:yohobuy={"action":"go.h5","params":{"url":"http://m.yohobuy.com/home/family/coinDetail","param":{"plateType":"1"}}}'>有货币明细</a>
<a class="detail" href='//m.yohobuy.com/home/family/coinDetail?plateType=1&openby:yohobuy={"action":"go.h5","params":{"url":"http://m.yohobuy.com/home/family/coinDetail","param":{"plateType":"1"}}}'>积分明细</a>
{{/if}}
</div>
<div class="tab-fixed">
... ... @@ -24,4 +22,7 @@
<div class="tab-item-c" id="yohonow-tab"></div>
<div class="tab-item-c hide" id="mars-tab"></div>
</div>
<div class="tip-app hide">
<span class="close-tip"></span>
</div>
</div>
\ No newline at end of file
... ...
... ... @@ -45,6 +45,17 @@
<span class="iconfont">&#xe604;</span>
</div>
</div>
<div class="list-item">
<div class="title">手机</div>
<div class="main">
<span class="inp phone{{#if mobile}} canMod{{/if}}">{{#if mobile}}{{mobile}}{{else}}请绑定手机号码{{/if}}</span>
</div>
{{#if isYohoApp}}
<div class="arr">
<span class="iconfont">&#xe604;</span>
</div>
{{/if}}
</div>
<div id="chosen-city" class="list-item">
<div class="title">城市</div>
<div class="main">
... ...
... ... @@ -73,7 +73,7 @@ module.exports = {
// mip-link
// $('a').each(function() {
// let $this = $(this);
// let mipLink = `<mip-link href="${$this.attr('href')}" class="${$this.attr('class') || ''}"
// let mipLink = `<mip-link href="${$this.attr('href')}" class="${$this.attr('class') || ''}"
// title="${$this.attr('title') || ''}">${$this.html()}</mip-link>`; // eslint-disable-line
// $this.replaceWith(mipLink);
// });
... ...
... ... @@ -17,7 +17,7 @@ module.exports = class extends global.yoho.BaseModel {
return Promise.resolve({
code: 200,
data: {
verifiedGraphicCode: `${serviceAPI}passport/img-check.jpg?udid=${udid}&fromPage=${PAGE}&client_type=${config.app}`
verifiedGraphicCode: `${serviceAPI}passport/img-check.jpg?udid=${udid}&fromPage=${PAGE}&client_type=${config.app}` // eslint-disable-line
}
});
}
... ...
... ... @@ -25,7 +25,7 @@
</div>
{{/ shopInfo}}
<!-- 优惠 -->
<!-- 优惠 -->
<div class="shop-coupon coupon-group">
{{> reds-shop/coupon}}
</div>
... ...
... ... @@ -53,7 +53,7 @@
<div id="home-page" class="main">
<div id="nav-main" class="nav-main">
<!-- 优惠 -->
<!-- 优惠 -->
<div class="shop-coupon coupon-group"></div>
<!-- 大导航 -->
... ...
... ... @@ -109,7 +109,7 @@
{{!--/基础店铺页面--}}
{{#ifor brandHome baseShopHome}}
{{!--优惠--}}
{{!--优惠--}}
<div class="shop-coupon coupon-group"></div>
{{/ifor}}
... ...
... ... @@ -26,7 +26,7 @@ const domains = {
module.exports = {
app: 'h5',
appVersion: '6.2.0', // 调用api的版本
appVersion: '6.3.0', // 调用api的版本
port: 6001,
siteUrl: '//m.yohobuy.com',
assetUrl: '//127.0.0.1:5001',
... ... @@ -112,7 +112,7 @@ module.exports = {
jsSdk: '//cdn.yoho.cn/js-sdk/1.2.6/jssdk.js',
redis: {
connect: {
host: '192.168.104.32',
host: '127.0.0.1',
port: '6379',
retry_strategy(options) {
if (options.error && options.error.code === 'ECONNREFUSED') {
... ... @@ -146,7 +146,7 @@ if (isProduction) {
imCs: 'https://imhttp.yohobuy.com/api',
platformApi: 'http://api.platform.yohoops.org',
extstore: 'http://extstore.yohobuy.com',
family: 'http://uic.yoho.cn/uic/',
family: 'http://uic.yohoops.org/uic/',
yohoNowApi: 'http://new.yohoboys.com/'
},
memcache: {
... ...
... ... @@ -66,16 +66,16 @@
{{/if}}
{{else}}
{{#if localCss }}
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/common.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/yohobuywap-node/{{version}}/common.css?t={{startTime}}">
{{/if}}
{{#if isFeature}}
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/feature.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/yohobuywap-node/{{version}}/feature.css?t={{startTime}}">
{{else}}
{{#ifor localCss vue}}
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/{{module}}.{{page}}.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/yohobuywap-node/{{version}}/{{module}}.{{page}}.css?t={{startTime}}">
{{^}}
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/index.css?t={{startTime}}">
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/yohobuywap-node/{{version}}/index.css?t={{startTime}}">
{{/ifor}}
{{/if}}
{{/if}}
... ... @@ -115,9 +115,9 @@
<script src="//{{devHost}}:5001/libs.js"></script>
<script src="//{{devHost}}:5001/{{module}}.{{page}}.js"></script>
{{^}}
<script>var STATIC_RESOURCE_PATH = '//cdn.yoho.cn/m-yohobuy-node/assets';</script>
<script src="//cdn.yoho.cn/m-yohobuy-node/{{version}}/libs.js?t={{startTime}}" crossorigin="anonymous"></script>
<script src="//cdn.yoho.cn/m-yohobuy-node/{{version}}/{{module}}.{{page}}.js?t={{startTime}}" crossorigin="anonymous"></script>
<script>var STATIC_RESOURCE_PATH = '//cdn.yoho.cn/yohobuywap-node/{{version}}';</script>
<script src="//cdn.yoho.cn/yohobuywap-node/{{version}}/libs.js?t={{startTime}}" crossorigin="anonymous"></script>
<script src="//cdn.yoho.cn/yohobuywap-node/{{version}}/{{module}}.{{page}}.js?t={{startTime}}" crossorigin="anonymous"></script>
{{/if}}
{{#loadJs}}
<script type="text/javascript" src="{{src}}" crossorigin="anonymous"></script>
... ...
{
"name": "m-yohobuy-node",
"version": "6.2.9",
"name": "yohobuywap-node",
"version": "6.3.0",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -50,11 +50,6 @@
<span class="precell-dia">预售商品购物预知&nbsp;<span class="iconfont">&#xe73b;</span></span>
</div>
</div>
<p class="presell-info hide">
<span class="iconfont">&#xe61a;</span>
<span class="txt">由于商品上市期不同,先到的将先发货</span>
<span class="txt">预售商品不参加活动,不可使用优惠券</span>
</p>
{{> cart-content}}
{{/preSellCart}}
</div>
... ...
<a class="integral-total" href="{{totalHref}}">
<span class="total">{{total}}</span>
<span class="name">积分总计</span>
<span class="name">积分余额</span>
</a>
<div class="mark">
{{# list}}
... ...
... ... @@ -64,10 +64,11 @@ $newCoupon.on('submit', function() {
}
$.ajax({
method: 'POST',
url: '/cart/index/buynow/usePromotionCode',
url: '/cart/index/buynow/useCoupon',
data: {
promotion_code: couponCode,
buy_number: qs.buy_number
coupon_code: couponCode,
buy_number: qs.buy_number,
product_sku: qs.product_sku
}
}).then(function(res) {
if (res.message) {
... ...
... ... @@ -21,7 +21,7 @@ class PrecellDia extends Page {
precellDia() {
dialog.showDialog({
dialogText: '由于商品上市期不同,先到的将先发货。预售商品不参加活动,不可使用优惠券。',
dialogText: '由于商品上市期不同,同笔订单商品需同时发货,预售商品不参加活动,不可使用优惠券。',
fast: true,
hasFooter: {
centerBtnText: '我知道了'
... ...
import 'home/family-coinMall.page.css';
import $ from 'yoho-jquery';
import Page from 'yoho-page';
import tip from 'plugin/tip';
import tabRender from 'home/coin-get-list.hbs';
import lazyLoad from 'yoho-jquery-lazyload';
import yoho from 'yoho-app';
... ... @@ -17,8 +16,9 @@ class IconMall extends Page {
$tabFixed: $('.tab-fixed'),
$yohonowTab: $('#yohonow-tab'),
$marsTab: $('#mars-tab'),
$acquiringHelp: $('.acquiring-help'),
$detail: $('.detail')
$detail: $('.detail'),
$tipApp: $('.tip-app'),
$closeTip: $('.close-tip')
};
this.view = {
... ... @@ -135,10 +135,13 @@ class IconMall extends Page {
bindEvents() {
this.selector.$tabItem.on('click', this.tabItem.bind(this));
this.selector.$acquiringHelp.on('click', this.openHelp.bind(this));
this.selector.$detail.on('click', this.openDetail.bind(this));
// this.selector.$acquiringHelp.on('click', this.openHelp.bind(this));
// this.selector.$detail.on('click', this.openDetail.bind(this));
$(window).on('scroll touchmove touchstart touchend', this.move.bind(this));
$(document).on('click', '.go-btn', this.goConversion.bind(this));
this.selector.$closeTip.on('click', this.closeTip.bind(this));
this.selector.$tipApp.on('mousewheel touchmove', this.banSliding(this));
}
move() {
... ... @@ -170,32 +173,36 @@ class IconMall extends Page {
$this.addClass('active').siblings('div').removeClass('active');
if ($this.attr('id') === 'yohonow') {
this.type = 'now';
this.selector.$detail.attr('href', `${location.protocol}//m.yohobuy.com/home/family/coinDetail?plateType=3&openby:yohobuy={"action":"go.h5","params":{"url":"${location.protocol}//m.yohobuy.com/home/family/coinDetail?plateType=3"}}`); // eslint-disable-line
}
if ($this.attr('id') === 'mars') {
this.type = 'mars';
this.selector.$detail.attr('href', `${location.protocol}//m.yohobuy.com/home/family/coinDetail?plateType=2&openby:yohobuy={"action":"go.h5","params":{"url":"${location.protocol}//m.yohobuy.com/home/family/coinDetail?plateType=2"}}`); // eslint-disable-line
}
this.page = 1;
this.beforeScroll = 0;
this.getList();
}
openHelp() {
if (yoho && yoho.isNowApp) {
yoho.invokeMethod('go.coins_help');
} else if (yoho && yoho.isMarsApp) {
yoho.invokeMethod('go.point_help');
}
}
openDetail() {
yoho.ready(() => {
if (yoho && yoho.isNowApp) {
yoho.invokeMethod('go.coins_detail');
} else if (yoho && yoho.isMarsApp) {
yoho.invokeMethod('go.point_detail');
}
});
}
// openHelp() {
// if (yoho && yoho.isNowApp) {
// yoho.invokeMethod('go.coins_help');
// } else if (yoho && yoho.isMarsApp) {
// yoho.invokeMethod('go.point_help');
// }
// }
// openDetail() {
// yoho.ready(() => {
// if (yoho && yoho.isNowApp) {
// yoho.invokeMethod('go.coins_detail');
// } else if (yoho && yoho.isMarsApp) {
// yoho.invokeMethod('go.point_detail');
// }
// });
// }
goConversion(e) {
let $this = $(e.currentTarget);
... ... @@ -218,12 +225,26 @@ class IconMall extends Page {
}
} else {
if (type === 'yohonow-tab') {
tip.show('请到yohonowapp打开');
this.selector.$tipApp.removeClass('hide').addClass('now-tip');
} else if (type === 'mars-tab') {
tip.show('请到mars打开');
this.selector.$tipApp.removeClass('hide').addClass('mars-tip');
}
}
}
closeTip(e) {
let $this = $(e.currentTarget);
if ($this.parent().hasClass('now-tip')) {
$this.parent().removeClass('now-tip').addClass('hide');
} else {
$this.parent().removeClass('mars-tip').addClass('hide');
}
}
banSliding() {
return false;
}
}
$(() => {
... ...
... ... @@ -29,7 +29,8 @@ class UserInfo extends Page {
$cityText: $('.city-text'),
$userPic: $('.user-pic'),
$noDate: $('.inp.modify[type!=date]'),
$bottomOut: $('.bottom-out')
$bottomOut: $('.bottom-out'),
$phone: $('.phone')
};
this.view = {
... ... @@ -85,6 +86,7 @@ class UserInfo extends Page {
this.selector.$modifyInp.on('click', this.closeCitySwiper.bind(this));
this.selector.$bottomOut.on('focus', this.keepOut.bind(this));
this.selector.$bottomOut.on('blur', this.restore.bind(this));
this.selector.$phone.on('click', this.modPhone.bind(this));
if (yoho.isApp) {
this.selector.$modifyInp.on('change', this.modifyInp.bind(this));
... ... @@ -124,7 +126,7 @@ class UserInfo extends Page {
userPic() {
if (yoho.isApp) {
yoho.ready(() => {
if (yoho.isYohoApp || yoho.isNowApp) {
if (yoho.isYohoApp) {
yoho.invokeMethod('go.setAvatar', {}, (data) => {
if (data) {
let reg = /(\w*){mode}(.*){width}(.*){height}(.*)/g;
... ... @@ -133,7 +135,7 @@ class UserInfo extends Page {
this.selector.$userAvatar.css('background-image', `url(${data})`);
}
});
} else if (yoho.isMarsApp) {
} else if (yoho.isMarsApp || yoho.isNowApp) {
yoho.invokeMethod('go.modify_user', {}, (data) => {
if (data) {
this.selector.$userAvatar.css('background-image', `url(${data})`);
... ... @@ -226,6 +228,28 @@ class UserInfo extends Page {
console.error(error);
});
}
modPhone(e) {
let $this = $(e.currentTarget);
if (yoho && yoho.isApp) {
yoho.ready(() => {
if ($this.hasClass('canMod')) {
if (yoho.isYohoApp) {
yoho.invokeMethod('go.changebindphone');
}
} else {
let href = location.protocol + '//m.yohobuy.com/';
if (yoho.isYohoApp) {
yoho.goH5(href, JSON.stringify({
action: 'go.associatephone'
}));
}
}
});
}
}
}
$(() => {
... ...
... ... @@ -263,6 +263,33 @@ html {
line-height: 50px;
height: 50px;
}
.tip-app {
position: fixed;
top: 0;
width: 100%;
height: 100%;
z-index: 5;
.close-tip {
display: block;
width: 360px;
height: 220px;
position: relative;
top: 81%;
left: 200px;
}
}
.now-tip {
background-image: resolve("home/family/now-tip.png");
background-size: 100%;
}
.mars-tip {
background-image: resolve("home/family/mars-tip.png");
background-size: 100%;
}
}
#mars {
... ...