Authored by 毕凯

Merge remote-tracking branch 'origin/release/5.9' into feature/trendRecode

Showing 61 changed files with 997 additions and 75 deletions
'use strict';
const expandModel = require('../models/expand-new'),
headerModel = require('../../../doraemon/models/header');
exports.promotion = (req, res, next) => {
let uid = req.user.uid,
isApp = req.yoho.isApp;
req.ctx(expandModel).promotionData(uid, isApp).then(result => {
res.render('expand-new/my-promotion', {
pageHeader: headerModel.setNav({
navTitle: '我的邀请码',
navBtn: false,
myReward: true
}),
isApp: isApp,
width750: true,
localCss: true,
title: '我的邀请码',
page: 'my-promotion',
promotionData: result
});
}).catch(next);
};
exports.myReward = (req, res, next) => {
let isApp = req.yoho.isApp,
uid = req.user.uid,
page = 1,
limit = 20;
req.ctx(expandModel).rewardList(uid, page, limit, isApp).then(result => {
res.render('expand-new/my-reward', {
pageHeader: headerModel.setNav({
navTitle: '我的奖励'
}),
isApp: isApp,
width750: true,
localCss: true,
title: '我的奖励',
page: 'my-reward',
rewardData: result
});
}).catch(next);
};
exports.rewardList = (req, res, next) => {
let uid = req.user.uid,
page = req.query.page,
limit = 20,
isApp = req.yoho.isApp;
req.ctx(expandModel).rewardList(uid, page, limit, isApp).then(result => {
res.render('expand-new/reward-list', {
layout: false,
rewardList: result.rewardList
});
}).catch(next);
};
exports.rewardDetail = (req, res, next) => {
let isApp = req.yoho.isApp,
uid = req.user.uid,
firstOrderUid = req.query.firstOrderUid;
req.ctx(expandModel).rewardDeatil(uid, firstOrderUid).then(result => {
res.render('expand-new/reward-detail', {
pageHeader: headerModel.setNav({
navTitle: '我的奖励'
}),
isApp: isApp,
width750: true,
localCss: true,
title: '我的奖励',
page: 'reward-detail',
rewardDetail: result
});
}).catch(next);
};
... ...
const api = global.yoho.API;
const _ = require('lodash');
const helpers = global.yoho.helpers;
module.exports = class extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
}
/**
* 我的邀请码页
*/
promotionData(uid, isApp) {
return api.get('', {
method: 'app.invitecode.my',
uid: uid
}, {
code: 200
}).then((result) => {
if (result && result.code === 200 && result.data) {
result.data.isApp = isApp;
result.data.copyUrl = result.data.url.replace(/"/g, '"').replace(/=/g, ':');
return result.data;
} else {
return {};
}
});
}
/**
* 奖励列表页
*/
rewardList(uid, page, limit, isApp) {
return api.get('', {
method: 'app.invitecode.history',
uid: uid,
page: page,
limit: limit
}).then((result) => {
if (result && result.code === 200 && result.data) {
let finData = {};
_.forEach(result.data.data, function(val) {
val.detailUrl = helpers.urlFormat('/activity/reward-detail', {
firstOrderUid: val.firstOrderUid
});
val.orderAmountDis = val.orderAmountDis === '-' ? val.orderAmountDis : '¥' + val.orderAmountDis;
if (isApp) {
val.detailUrl = val.detailUrl +
'&openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"http:' +
val.detailUrl + '","params":{"firstOrderUid":"' + val.firstOrderUid + '"}}}';
}
});
finData.rewardList = result.data.data.length !== 0 ? result.data.data : false;
if (parseInt(page, 10) === 1) {
finData.activityRuleDesc = result.data.activityRuleDesc;
}
return finData;
} else {
return {};
}
});
}
/**
* 奖励详情页
*/
rewardDeatil(uid, firstOrderUid) {
return api.get('', {
method: 'app.invitecode.detail',
uid: uid,
firstOrderUid: firstOrderUid
}).then((result) => {
if (result && result.code === 200) {
result.data.orderAmountDis = result.data.orderAmountDis === '-' ?
result.data.orderAmountDis : '¥' + result.data.orderAmountDis;
return result.data;
} else {
return {};
}
});
}
};
... ...
... ... @@ -51,6 +51,8 @@ const update = require('../../doraemon/middleware/update');
const userRecommend = require(`${cRoot}/user-recommend`);
const expand = require(`${cRoot}/expand-new`);
// routers
... ... @@ -264,4 +266,9 @@ router.get('/share-buy/my-rebeat', update('5.7.0'), auth, shareBuy.myRebeat); //
router.get('/user-recommend', userRecommend.index); // 广点通投放落地页
router.get('/user-recommend/moreGoods', userRecommend.moreGoods); // 获取商品分页
router.get('/my-promotion', auth, expand.promotion); // 拓展新客 我的邀请码页
router.get('/my-reward', auth, expand.myReward); // 拓展新客 我的奖励页
router.get('/reward-list', expand.rewardList); // 拓展新客 我的奖励列表
router.get('/reward-detail', auth, expand.rewardDetail); // 拓展新客 我的奖励详情页
module.exports = router;
... ...
<div class="my-promotion-page yoho-page">
{{# promotionData}}
<div class="my-code">
<div class="describe">
{{{activityDescribe}}}
</div>
<div class="title"></div>
<div class="code-outer">
<div class="code-qr" qr-data="{{url}}"></div>
</div>
</div>
<div class="invite-code invitation">
<div class="title"></div>
<div class="code-content">
<div class="invite-content">
<span class="code">{{inviteCode}}</span>
{{#if isApp}}
<a class="copy" href='//m.yohobuy.com/?openby:yohobuy={"action":"go.copy","params":{"text":"{{inviteCode}}","message":"复制成功"}}'>复制</a>
{{/if}}
</div>
<p class="info">1.复制您的邀请码 2.粘贴给您的朋友</p>
</div>
</div>
<div class="invite-link invitation">
<div class="title"></div>
<div class="code-content">
<div class="invite-content">
<span class="code">{{url}}</span>
{{#if isApp}}
<a class="copy" href='//m.yohobuy.com/?openby:yohobuy={"action":"go.copy","params":{"text":"{{copyUrl}}","message":"复制成功"}}'>复制</a>
{{/if}}
</div>
<p class="link-info">
<span class="info">1.复制您的邀请链接 2.选择您的社交平台 3.粘贴给您的朋友</span>
{{#if isApp}}
<span class="share">分享</span>
{{/if}}
</p>
</div>
</div>
<input id="shareLink" type="hidden" value="{{url}}">
<input id="shareImg" type="hidden" value="{{sharePic}}">
<input id="shareTitle" type="hidden" value="{{shareMainTitle}}">
<input id="shareDesc" type="hidden" value="{{shareSubTitle}}">
{{/ promotionData}}
</div>
... ...
<div class="my-reward-list-page yoho-page">
{{# rewardData}}
<div class="message">
<span>开启消息推送获取奖励发放状态</span>
<span class="state"><b>去开启</b><i class="iconfont">&#xe614;</i></span>
</div>
<div class="rules">
<div class="title">
<p>活动细则</p>
<i class="iconfont down">&#xe616;</i>
</div>
<p class="detail">
{{{activityRuleDesc}}}
</p>
</div>
<div class="reward-list">
<div class="list-item list-title">
<span>我邀请的好友</span>
<span>首单购物金额</span>
<span>我的奖励</span>
<span>状态</span>
</div>
{{#if rewardList}}
{{> expand-new/reward-list}}
{{else}}
<div class="no-list">暂无奖励数据</div>
{{/if}}
</div>
{{/ rewardData}}
</div>
... ...
<div class="reward-detail-page yoho-page">
{{# rewardDetail}}
<div class="reward-detail">
<p class="detail-item">
<span>我的奖励</span>
<span>{{couponName}}</span>
</p>
<p class="detail-item">
<span>奖励状态</span>
<span>{{couponStatusDesc}}</span>
</p>
<p class="detail-item">
<span>发放时间</span>
<span>{{couponSendTimeDis}}</span>
</p>
</div>
<div class="reward-related">
<div class="releated-item">
<span>我邀请的好友</span>
<span>{{nickName}}</span>
</div>
<div class="releated-item">
<span>注册时间</span>
<span>{{registerTimeDis}}</span>
</div>
<div class="releated-item">
<span>首单购物金额</span>
<span>{{orderAmountDis}}</span>
</div>
<div class="releated-item">
<span>首单购物时间</span>
<span>{{firstOrderTimeDis}}</span>
</div>
<div class="releated-item">
<span>订单类型</span>
<span>{{paymentTypeDis}}</span>
</div>
<div class="releated-item">
<span>订单状态</span>
<span>{{paymentStatusDesc}}</span>
</div>
<div class="releated-item">
<span>确认收货时间</span>
<span>{{confirmReceiptTimeDis}}</span>
</div>
</div>
{{/ rewardDetail}}
</div>
... ...
{{> expand-new/reward-list}}
... ...
{{# rewardList}}
<a href="{{detailUrl}}" class="list-item">
<span>{{nickName}}</span>
<span>{{orderAmountDis}}</span>
<span>{{couponName}}</span>
<span>{{couponStatusDesc}}<i class="iconfont">&#xe614;</i></span>
</a>
{{/ rewardList}}
... ...
... ... @@ -17,7 +17,8 @@ const ticketsConfirm = (req, res) => {
// pageFooter: true,
localCss: true,
navBtn: false
navBtn: false,
width750: true
};
let params = {
... ... @@ -55,9 +56,17 @@ const checkTickets = (req, res) => {
useYohoCoin: req.body.useYohoCoin
};
indexModel.checkTickets(params).then(result => {
res.json(result);
});
// 未登录
if (!req.user.uid) {
return res.json({
code: 401,
redirect: '/signin.html'
});
} else {
indexModel.checkTickets(params).then(result => {
res.json(result);
});
}
};
module.exports = {
... ...
... ... @@ -2,6 +2,7 @@
const api = global.yoho.API;
const helpers = global.yoho.helpers;
const _ = require('lodash');
// 展览票(单日票)skn
const SINGLE_TICKETS_SKN = 51335912;
... ... @@ -14,8 +15,6 @@ const checkTickets = (param) => {
buy_number: param.buyNumber,
use_yoho_coin: param.useYohoCoin || 0,
yoho_coin_mode: param.yohoCoinMode ? param.yohoCoinMode : 0
}, {
code: 200
}).then((result) => {
return result;
});
... ... @@ -71,7 +70,7 @@ const ticketsConfirm = (param) => {
orderEnsurePage: true
};
if (result && result[0] && result[0].data) {
if (_.get(result, '[0].data.goods_list', false)) {
let bulid = [];
result[0].data.goods_list.forEach((val) => {
... ...
<div class="order-good" data-id="{{id}}" data-skn="{{skn}}">
<div class="thumb-wrap">
{{#if link}}
<a href="{{link}}"><img class="thumb lazy" data-original="{{thumb}}"></a>
<div class="pic-c">
<a href="{{link}}">
<img class="thumb lazy" data-original="{{thumb}}">
</a>
<p>虚拟商品</p>
</div>
{{else}}
<img class="thumb lazy" data-original="{{thumb}}">
<div class="pic-c">
<img class="thumb lazy" data-original="{{thumb}}">
<p>虚拟商品</p>
</div>
{{/if}}
<p class="tag{{#if gift}} gift-tag{{/if}}{{#if advanceBuy}} advance-buy-tag{{/if}}"></p>
</div>
... ... @@ -11,13 +19,13 @@
<p class="name row">{{name}}</p>
<p class="row">
{{#if color}}
<span class="color">
<span class="color{{#if tickets}} date{{/if}}">
{{#if tickets}}日期{{else}}颜色{{/if}}:{{color}}
</span>
{{/if}}
{{#if size}}
<span class="size">
<span class="size{{#if tickets}} hide{{/if}}">
{{#if tickets}}区域{{else}}尺码{{/if}}:{{size}}
</span>
{{/if}}
... ...
... ... @@ -8,10 +8,6 @@ const _ = require('lodash');
* 门票
* @type {{SINGLE_TICKETS_SKN: number}}
*/
const TICKETS = {
SINGLE_TICKETS_SKN: 51335912, // 展览票(单日票)skn
PACKAGE_TICKETS_SKN: 51335908 // 套票skn
};
/**
* 格式化价格
... ... @@ -25,7 +21,7 @@ const transPrice = (price, isSepcialZero) => {
* 格式化订单商品
* @private
*/
const _formatOrderGoods = (orderGoods, count, haveLink, tickets) => {
const _formatOrderGoods = (orderGoods, count, haveLink) => {
let result = [];
_.forEach(orderGoods, value => {
... ... @@ -79,12 +75,7 @@ const _formatOrderGoods = (orderGoods, count, haveLink, tickets) => {
count += parseInt(value.buy_number, 10);
/* 门票 */
if (tickets) {
/* 展览票不显示区域 */
if (value.product_skn === TICKETS.SINGLE_TICKETS_SKN) {
delete goods.size;
}
if (value.goods_type === 'ticket') {
Object.assign(goods, {
tickets: true
});
... ...
... ... @@ -153,7 +153,6 @@ const orderDetailData = (uid, orderCode) => {
uid: uid,
order_code: orderCode
}).then(result => {
if (result && result.code === 200) {
let orderDetail = camelCase(result.data);
let goods = [];
... ... @@ -185,7 +184,8 @@ const orderDetailData = (uid, orderCode) => {
size: data.sizeName,
payPrice: data.realPayPrice,
salePrice: parseFloat(data.salesPrice).toFixed(2),
count: count
count: count,
tickets: data.goodsType === 'ticket'
// isVipPrice: data.discountTag === 'V',
// isStudebt: data.discountTag === 'S'
... ... @@ -221,6 +221,12 @@ const orderDetailData = (uid, orderCode) => {
});
}
if (data.goodsType === 'ticket') {
obj = _.assign(obj, {
tickets: true
});
}
goods.push(obj);
orderDetail = _.assign(orderDetail, {
... ...
... ... @@ -5,7 +5,7 @@
{{#qrcodeData}}
<div class="qrcode yoho-page">
<h2 class='qrcode-title'>2016 非常潮流盛世 YO'HOOD门票(限量) {{ticks.length}}</h2>
<h2 class='qrcode-title'>2017 非常潮流盛世 YO'HOOD门票(限量) {{ticks.length}}</h2>
<p class='qrcode-tip'>提示:凭借二维码入场,每场二维码只可使用一次,请妥善保管;</p>
<div class='qrcode-wrap'>
... ...
... ... @@ -106,7 +106,12 @@
</a>
</div>
<div class="group-list">
<a class="list-item" href="/home/message">
<a class="list-item invite" href="https://activity.yoho.cn/feature/357.html?share_id=2391&title=">
<span class="horn"></span>
邀请好友,50元现金券无限赚
<span class="iconfont num">&#xe604;</span>
</a>
<a class="list-item message" href="/home/message">
<span class="iconfont icon">&#xe636;</span>
消息
<span class="iconfont num">{{inboxTotal}} &#xe604;</span>
... ...
... ... @@ -115,6 +115,7 @@ let verifyMobile = (req, res, next) => {
let mobile = +req.body.phoneNum;
let area = +(req.body.areaCode || 86);
let inviteCode = +req.body.inviteCode || '';
// 判断参数是否合法
if (!_.isNumber(mobile) || !_.isNumber(area)) {
... ... @@ -153,7 +154,8 @@ let verifyMobile = (req, res, next) => {
result.data = helpers.urlFormat('/passport/reg/code', {
token: token,
phoneNum: mobile,
areaCode: area
areaCode: area,
inviteCode: inviteCode
});
}
... ... @@ -169,6 +171,7 @@ let codeAction = (req, res, next) => {
let token = req.query.token;
let mobile = +req.query.phoneNum;
let area = +(req.query.areaCode || 86);
let inviteCode = +req.query.inviteCode || '';
// 判断是否允许访问, 不允许则跳转到错误页面
if (!_.isString(token) || !_.isNumber(mobile) || !sign.verifyToken(mobile, token)) {
... ... @@ -188,6 +191,7 @@ let codeAction = (req, res, next) => {
areaCode: area, // 默认的区号
phoneNum: mobile, // 手机号
token: token, // 访问令牌
inviteCode: inviteCode,
serviceUrl: serviceUrl // 在线客服
});
};
... ... @@ -273,6 +277,7 @@ let verifyCode = (req, res, next) => {
let mobile = +req.body.phoneNum;
let area = +(req.body.areaCode || 86);
let code = +req.body.code;
let inviteCode = +req.body.inviteCode || '';
/* 判断参数是否合法 */
if (!_.isNumber(mobile) || !_.isNumber(area) || !_.isNumber(code)) {
... ... @@ -304,7 +309,8 @@ let verifyCode = (req, res, next) => {
token: token,
phoneNum: mobile,
areaCode: area,
smsCode: code
smsCode: code,
inviteCode: inviteCode
});
break;
case 404:
... ... @@ -324,6 +330,7 @@ let passwordAction = (req, res, next) => {
let mobile = +req.query.phoneNum;
let area = +(req.query.areaCode || 86);
let smsCode = +req.query.smsCode;
let inviteCode = +req.query.inviteCode || '';
// 判断是否允许访问, 不允许则跳转到错误页面
if (!smsCode || !_.isString(token) || !_.isNumber(mobile) ||
... ... @@ -343,7 +350,8 @@ let passwordAction = (req, res, next) => {
areaCode: area, // 默认的区号
phoneNum: mobile, // 手机号
token: token, // 访问令牌
smsCode: smsCode // 手机验证码
smsCode: smsCode, // 手机验证码
inviteCode: inviteCode
});
};
... ... @@ -360,6 +368,7 @@ let setPassword = (req, res, next) => {
let token = req.body.token;
let smsCode = +req.body.smsCode;
let isFromMy = _.get(req.session, 'phoneReg.isFromMy', '0');
let inviteCode = req.body.inviteCode || '';
// 判断参数是否合法
if (!smsCode || !_.isString(token) || !_.isNumber(mobile) || !_.isNumber(area) || !password) {
... ... @@ -384,7 +393,7 @@ let setPassword = (req, res, next) => {
// 验证注册的标识码是否有效
let resultCopy = null;
RegService.regMobileAes(area, mobile, password, shoppingKey, smsCode, isFromMy).then((result) => {
RegService.regMobileAes(area, mobile, password, shoppingKey, smsCode, inviteCode, isFromMy).then((result) => {
if (!result.code || result.code !== 200) {
return res.send(result);
}
... ...
... ... @@ -96,7 +96,7 @@ const RegService = {
return api.post('', params);
},
regMobileAes(area, mobile, password, shoppingKey, smsCode, isFromMy) {
regMobileAes(area, mobile, password, shoppingKey, smsCode, inviteCode, isFromMy) {
isFromMy = isFromMy || '0';
let params = {
... ... @@ -105,6 +105,7 @@ const RegService = {
profile: mobile,
password: aes.aesPwd(password),
verifyCode: smsCode,
inviteCode: inviteCode,
isFromMy
};
... ...
... ... @@ -6,6 +6,10 @@
<span id="area-code" class="area-code">{{areaCode}}</span>
<input id="phone-num" class="input phone-num" type="text" placeholder="手机号">
</div>
<div class="input-container row code-container">
<span id="code" class="invite-code">邀请码</span>
<input id="invite-code" class="input code" type="text" placeholder="无邀请码可不填">
</div>
{{!--图片验证--}}
<div data-geetest="{{useGeetest}}" id="js-img-check"></div>
... ... @@ -13,4 +17,4 @@
<span id="btn-next" class="btn btn-next disable row">下一步</span>
<p class="register-tip">Yoho!Family账号可登录Yoho!Buy有货、Yoho!Now、mars及SHOW</p>
</div>
</div>
\ No newline at end of file
</div>
... ...
... ... @@ -17,6 +17,7 @@
<input id="area-code" type="hidden" value="{{areaCode}}">
<input id="token" type="hidden" value="{{token}}">
<input id="sms-code" type="hidden" value="{{smsCode}}">
<input id="invite-code" type="hidden" value="{{inviteCode}}">
</div>
<div class="prompt">
... ... @@ -24,6 +25,6 @@
<div class="choose">
<span class="ensure"></span>
<span class="deny"></span>
</div>
</div>
... ...
... ... @@ -19,4 +19,5 @@
<input id="phone-num" type="hidden" value={{phoneNum}}>
<input id="area-code" type="hidden" value={{areaCode}}>
<input id="token" type="hidden" value={{token}}>
<input id="invite-code" type="hidden" value={{inviteCode}}>
</div>
... ...
... ... @@ -14,7 +14,7 @@ const singleAPI = global.yoho.SingleAPI;
const helpers = global.yoho.helpers;
const productProcess = require(`${utils}/product-process`);
const SINGLE_TICKETS_SKN = 51335912; // 展览票
// const SINGLE_TICKETS_SKN = 51335912; // 展览票
/**
* 获取用户数据信息
... ... @@ -625,17 +625,19 @@ const _detailDataPkgAsync = (origin, uid, vipLevel, ua) => {
}).then(result => {
// 虚拟商品(门票)
if (origin.attribute * 1 === 3) {
result.cartInfo.addToCartUrl = false;
result.tickets = result.cartInfo.tickets = true;
if (result.cartInfo.addToCartUrl) {
result.cartInfo.addToCartUrl = false;
result.tickets = result.cartInfo.tickets = true;
}
result.ticketsConfirm = helpers.urlFormat('/cart/index/ticketsConfirm');
// 展览票
if (origin.product_skn * 1 === SINGLE_TICKETS_SKN) {
result.single = true;
} else {
// 套票
result.package = true;
}
// if (origin.product_skn * 1 === SINGLE_TICKETS_SKN) {
// result.single = true;
// } else {
// // 套票
// result.package = true;
// }
// 购票限制
result.cartInfo.limit = 4;
... ... @@ -748,6 +750,16 @@ const getNewProductAsyncData = (data) => {
discount: discountBuy.bundleInfo.discount
};
}
// 2017电子门票不显示区域
let ticketsProps = finalResult.cartInfo.props;
_.forEach(ticketsProps, function(value) {
if (value.name === '区域') {
value.ticketHide = true;
value.name = '';
}
});
return finalResult;
});
});
... ...
... ... @@ -66,7 +66,7 @@
{{! 品牌优惠券}}
<div class="brand-coupon hide">
<i class="iconfont font-right pull-right">&#xe614;</i>
<i class="iconfont font-quan">&#xe63a;</i><span>领取优惠券</span>
<i class="promotion-icon"></i><span>领取优惠券</span>
</div>
{{!--占位: 促销--}}
... ...
... ... @@ -11,14 +11,14 @@ const isProduction = process.env.NODE_ENV === 'production';
const isTest = process.env.NODE_ENV === 'test';
const domains = {
singleApi: 'http://api-test3.yohops.com:9999/',
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
global: 'http://api-global.yohobuy.com',
store: 'http://192.168.102.47:8080/portal-gateway/',
// api: 'http://192.168.103.59:8080/gateway',
// service: 'http://192.168.103.59:8080/gateway',
// liveApi: 'http://api.live.yoho.cn/',
// singleApi: 'http://single.yoho.cn/',
api: 'http://api-test2.yohops.com:9999/',
service: 'http://service-test2.yohops.com:9999/',
singleApi: 'http://api-test2.yohops.com:9999/',
global: 'http://global-test-soa.yohops.com:9999',
liveApi: 'http://testapi.live.yohops.com:9999/',
imSocket: 'ws://socket.yohobuy.com:10240',
imCs: 'http://im.yohobuy.com/api',
platformApi: 'http://192.168.102.48:8088/'
... ... @@ -26,7 +26,7 @@ const domains = {
module.exports = {
app: 'h5',
appVersion: '5.8.0', // 调用api的版本
appVersion: '5.9.0', // 调用api的版本
port: 6001,
siteUrl: '//m.yohobuy.com',
assetUrl: '//127.0.0.1:5001',
... ...
... ... @@ -44,6 +44,9 @@
{{channel}} <span class="iconfont">&#xe616;</span>
</span>
{{/saleNav}}
{{#myReward}}
<a href="/activity/my-reward" class="nav-home my-reward">我的奖励</a>
{{/myReward}}
{{#invoiceNotice}}
<span class="invoice-btn">{{.}}</span>
{{/invoiceNotice}}
... ...
... ... @@ -11,7 +11,7 @@
<p class="name row">{{name}}</p>
<p class="row">
{{#if color}}
<span class="color">
<span class="color{{#if tickets}} date{{/if}}">
{{#if tickets}}日期{{else}}颜色{{/if}}:{{color}}
</span>
{{/if}}
... ...
<div class="order-good" data-id="{{id}}">
<div class="thumb-wrap">
{{#if link}}
<a href="{{link}}"><img class="thumb" src="{{image thumb 90 120}}"></a>
{{#if link}}
<div class="pic-c">
<a href="{{link}}">
<img class="thumb" src="{{image thumb 90 120}}">
</a>
{{#if tickets}}
<p>虚拟商品</p>
{{/if}}
</div>
{{else}}
<img class="thumb" src="{{image thumb 90 120}}">
<div class="pic-c">
<img class="thumb" src="{{image thumb 90 120}}">
{{#if tickets}}
<p>虚拟商品</p>
{{/if}}
</div>
{{/if}}
<p class="tag{{#if gift}} gift-tag{{/if}}{{#if advanceBuy}} advance-buy-tag{{/if}}"></p>
</div>
... ... @@ -11,13 +23,13 @@
<p class="name row">{{name}}</p>
<p class="row">
{{#if color}}
<span class="color">
<span class="color{{#if tickets}} date{{/if}}">
{{#if tickets}}日期{{else}}颜色{{/if}}:{{color}}
</span>
{{/if}}
{{#if size}}
<span class="size">
<span class="size{{#if tickets}} hide{{/if}}">
{{#if tickets}}区域{{else}}尺码{{/if}}:{{size}}
</span>
{{/if}}
... ...
... ... @@ -31,7 +31,7 @@
<span class="btn del">删除订单</span>
{{else if lookQrcode}}
<a class="locHref" href="{{link}}">
<span class="btn check-logistics">查看二维码</span>
<span class="btn check-logistics check-ewm">查看二维码</span>
</a>
{{else if afterService}}
<span class="btn after-sales">申请售后</span>
... ...
{
"name": "m-yohobuy-node",
"version": "5.8.10",
"version": "5.9.0",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -23,11 +23,11 @@
</div>
<div class="chose-items">
{{#each props}}
<div class="block-list">
<div class="block-list{{#if ticketHide}} hide{{/if}}">
<span class="name">{{name}}</span>
<ul class="size-row clearfix">
{{#each values}}
<li class="block" data-prop-id="{{../type}}" data-value-id="{{id}}">{{name}}</li>
<li class="block{{#if ../ticketHide}} chosed hide{{/if}}" data-prop-id="{{../type}}" data-value-id="{{id}}">{{#if ../ticketHide}}{{else}}{{name}}{{/if}}</li>
{{/each}}
</ul>
</div>
... ...
... ... @@ -22,7 +22,7 @@
<a id="addtoCart" href="javascript:;" class="addto-cart add-to-cart-url">加入购物车</a>
{{/if}}
{{#if tickets}}
<a id="addtoCart" href="javascript:;" class="addto-cart add-to-cart-url">立即购买</a>
<a id="ticketsToCart" href="javascript:;" class="addto-cart add-to-cart-url">立即购买</a>
{{/if}}
{{#if isDepositAdvance}}
<a id="isDepositAdvance" href="javascript:;" class="addto-cart add-to-cart-url">立即购买</a>
... ...
... ... @@ -3,10 +3,10 @@
<div class="goods-discount" id="goodsDiscount">
{{#each promotion}}
{{#if @first}}
<h1 class="first-item short-text tap-hightlight">{{promotionTitle}}<span class="icon-down iconfont dropdown">&#xe609;</span></h1>
<h1 class="first-item short-text tap-hightlight"><span class="promotion-icon"></span>{{promotionTitle}}<span class="icon-down iconfont dropdown">&#xe609;</span></h1>
{{else}}
<div class="discount-folder">
<h1 class="folder-item tap-hightlight">{{promotionTitle}}</h1>
<h1 class="folder-item tap-hightlight"><span class="promotion-icon"></span>{{promotionTitle}}</h1>
</div>
{{/if}}
{{/each}}
... ...
'use strict';
require('activity/my-promotion.page.css');
let $ = require('yoho-jquery'),
yoho = require('yoho-app');
let shareData = {
title: $('#shareTitle').val(),
link: $('#shareLink').val(),
desc: $('#shareDesc').val(),
imgUrl: $('#shareImg').val(),
};
require('yoho-jquery-qrcode');
require('common');
require('common/share')(shareData);
// 生成二维码
setTimeout(function() {
let text = $('.code-qr').attr('qr-data'),
width = $('.code-qr').css('width');
$('.code-qr').qrcode({
render: 'image', // 显示方式,canvas,image和div
text: text, // 二维码的内容
size: parseInt(width, 10) * 10, // 大小
ecLevel: 'L', // 纠错级别
background: '#fff'
});
}, 0);
// 分享弹框
$('.share').click(function() {
if (yoho && yoho.isApp) {
yoho.invokeMethod('go.showshareaction', shareData);
}
});
// 设置APP的头部
if (yoho.isApp) {
yoho.ready(function() {
yoho.invokeMethod('set.rightbuttoninfo', {
title: '我的奖励',
url: 'http://m.yohobuy.com/activity/my-reward?openby:yohobuy={"action":"go.h5","params":{"url":"http://m.yohobuy.com/activity/my-reward","islogin": "N","type": 0}}'
});
});
}
... ...
'use strict';
require('activity/my-reward.page.css');
let $ = require('yoho-jquery'),
yoho = require('yoho-app');
let page = 2,
searching = false,
winH = $(window).height();
// 获取推送消息开启状态
function getStatus() {
yoho.invokeMethod('get.usernotificationstatus', {}, function(res) {
if (parseInt(res, 10) === 1 || res === '1') {
$('.state').find('b').html('已开启');
} else if (parseInt(res, 10) === 0) {
$('.state').find('b').html('去开启');
}
});
}
if (yoho.isApp) {
// 提供给APP调取刷新
yoho.ready(function() {
yoho.addNativeMethod('refreshInfoPushState', function() {
getStatus();
});
});
}
// 点击开启状态跳转APP设置
$('.state').click(function() {
yoho.invokeMethod('go.appsetting');
});
// 活动规则展开与收起
$('.title').click(function() {
if ($(this).find('i').hasClass('down')) {
$('.detail').css('height', 'auto');
$(this).find('i').removeClass('down').html('&#xe615;');
} else {
$('.detail').css('height', '0px');
$(this).find('i').addClass('down').html('&#xe616;');
}
});
// 奖励列表数据
function moreList() {
if (searching) {
return;
}
searching = true;
$.ajax({
type: 'GET',
url: '/activity/reward-list',
data: {
page: page
},
success: function(data) {
if (data === '') {
return true;
}
$('.reward-list').append(data);
searching = false;
page++;
},
});
}
function scrollHandler() {
// 当scroll到3/4$goodsContainer高度后继续请求下一页数据
if ($(window).scrollTop() + winH >
$(document).height() - 0.25 * $('.reward-list').height()) {
moreList();
}
}
// srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
$(function() {
if (yoho.isApp) {
yoho.ready(function() {
getStatus();
});
}
});
... ...
'use strict';
require('activity/reward-detail.page.css');
... ...
... ... @@ -39,6 +39,9 @@ require('common');
lazyLoad();
// 初始化有货币
orderInfo('yohoCoin', 0);
function getQueryParam() {
let queryArray = location.search.substr(1).split('&'),
i,
... ...
... ... @@ -414,6 +414,14 @@ class ChosePanel {
return $(ele).text();
}));
if (this.modes.tickets) {
let $chosed = $('.block.chosed');
valueList = Array.from($chosed.not('.hide').map((index, ele) => {
return $(ele).text();
}));
}
if (valueList.length) {
$noChoose.addClass('hide');
$chooseInfo.removeClass('hide');
... ...
... ... @@ -15,7 +15,8 @@ module.exports = function(useInRegister, useForBind, useForRelate) {
sourceType = $('#sourceType').val(),
openId = $('#openId').val(),
phoneNum = $('#phone-num').val(),
areaCode = $('#area-code').val().replace('+', '');
areaCode = $('#area-code').val().replace('+', ''),
inviteCode = $('#invite-code').val();
let api = require('./api');
let tip = require('plugin/tip');
... ... @@ -64,7 +65,8 @@ module.exports = function(useInRegister, useForBind, useForRelate) {
phoneNum: phoneNum,
areaCode: areaCode,
code: trim($captcha.val()),
token: $('#token').val()
token: $('#token').val(),
inviteCode: inviteCode
},
success: function(data) {
if (data.code === 200) {
... ...
... ... @@ -74,7 +74,8 @@ function setPassword() {
phoneNum: $('#phone-num').val(),
areaCode: $('#area-code').val(),
smsCode: $('#sms-code').val(),
token: $('#token').val()
token: $('#token').val(),
inviteCode: $('#invite-code').val()
},
success: function(data) {
let res = data.data;
... ...
... ... @@ -81,7 +81,8 @@ $btnNext.on('touchstart', function() {
requested = true;
let params = {
areaCode: areaCode.replace('+', ''),
phoneNum: pn
phoneNum: pn,
inviteCode: $('#invite-code').val()
};
$.extend(params, result);
... ...
... ... @@ -11,7 +11,7 @@ let $ = require('yoho-jquery'),
require('./detail/page-render')(function() {
let $discountFolder = $('.goods-discount .discount-folder'),
$discountArrow = $('.goods-discount .first-item span');
$discountArrow = $('.goods-discount .first-item .iconfont');
let goodsDiscountEl = document.getElementById('goodsDiscount'),
goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl),
... ...
... ... @@ -155,7 +155,7 @@ setTimeout(() => {
let chosePanel = require('common/chose-panel-new');
$('#addtoCart').on('touchstart', function() {
$('#addtoCart, #ticketsToCart').on('touchstart', function() {
let productCode = $('#limitProductCode').val();
let seckill = $('.seckill-time').length;
... ... @@ -304,7 +304,7 @@ setTimeout(() => {
let $goodsDiscount = $('#goodsDiscount');
let $discountFirstItem = $goodsDiscount.find('.first-item');
let $discountFolder = $goodsDiscount.find('.discount-folder');
let $discountArrow = $goodsDiscount.find('.first-item span');
let $discountArrow = $goodsDiscount.find('.first-item .iconfont');
// 初始化goods-discount
if ($discountFolder.children().length === 0) {
... ...
.my-promotion-page {
.my-code {
height: 468px;
overflow: hidden;
background-image: resolve("activity/expand-new/qrcode-back.png");
background-size: 100%;
background-repeat: no-repeat;
position: relative;
.describe {
width: 100%;
text-align: center;
font-size: 38px;
margin: 33px auto;
font-family: SourceHanSansCN;
transform: rotate(-2.3deg);
font-weight: 700;
font-style: oblique;
color: #000;
line-height: 58px;
margin-left: 13px;
}
.code-outer {
width: 140px;
height: 140px;
padding: 10px;
background-color: #fff;
margin: 16px 0 0 308px;
}
.code-qr {
width: 120px;
height: 120px;
}
}
.title {
height: 60px;
}
.invitation {
.code-content {
margin: 25px auto 50px;
height: 207px;
width: 690px;
padding: 30px 0 0 64px;
background-image: resolve("activity/expand-new/invite-back.png");
background-size: 100%;
background-repeat: no-repeat;
}
.invite-content {
.code {
width: 440px;
height: 68px;
display: block;
background-color: #fff;
color: #000;
line-height: 68px;
padding-left: 20px;
float: left;
font-size: 24px;
overflow: hidden;
}
.copy {
height: 68px;
width: 120px;
color: #fff;
background-color: #b40001;
line-height: 68px;
text-align: center;
display: block;
float: left;
font-size: 30px;
}
}
.info {
padding-top: 15px;
color: #fff;
clear: both;
width: 440px;
line-height: 40px;
display: inline-block;
font-size: 24px;
}
.link-info {
clear: both;
width: 560px;
}
.share {
width: 88px;
height: 36px;
border: 1px solid #fff;
color: #fff;
background-color: #000;
line-height: 36px;
text-align: center;
display: block;
float: right;
margin-top: 20px;
font-size: 24px;
}
}
.my-code {
.title {
background-image: resolve("activity/expand-new/invite-1.png");
background-size: 100%;
background-repeat: no-repeat;
}
}
.invite-code {
.title {
background-image: resolve("activity/expand-new/invite-2.png");
background-size: 100%;
background-repeat: no-repeat;
}
}
.invite-link {
.title {
background-image: resolve("activity/expand-new/invite-3.png");
background-size: 100%;
background-repeat: no-repeat;
}
}
}
... ...
.my-reward-list-page {
.message {
font-size: 32px;
height: 94px;
line-height: 94px;
padding: 0 30px;
font-weight: 700;
.state {
float: right;
i {
color: #e0e0e0;
}
}
}
.rules {
color: #b0b0b0;
padding: 0 30px 30px;
.title {
text-align: center;
font-size: 24px;
p {
height: 30px;
line-height: 30px;
text-align: center;
width: 100%;
display: inline-block;
margin: 0 auto;
}
i {
color: #e0e0e0;
display: inline-block;
position: relative;
top: -5px;
}
}
.detail {
font-size: 22px;
line-height: 36px;
height: 0;
overflow: hidden;
.more {
display: block;
color: #4a90e2;
}
}
}
.reward-list {
font-size: 24px;
width: 100%;
overflow: hidden;
background-color: #f2f2f2;
padding-top: 20px;
.list-item {
height: 95px;
line-height: 95px;
border-bottom: 1px solid #e0e0e0;
background-color: #fff;
}
.list-title {
font-weight: 700;
}
a {
overflow: hidden;
width: 100%;
display: block;
}
span {
width: 25%;
text-align: center;
padding-left: 20px;
display: block;
float: left;
i {
color: #e0e0e0;
}
}
.no-list {
background-color: #fff;
text-align: center;
padding-top: 40px;
}
}
}
... ...
.reward-detail-page {
.reward-detail {
margin: 30px;
height: 240px;
background-color: #f06a6b;
color: #fff;
border-radius: 10px;
font-size: 28px;
padding: 30px 0 0 50px;
}
.detail-item {
height: 60px;
line-height: 60px;
span {
margin-right: 40px;
}
}
.reward-related {
background-color: #f0f0f0;
padding-top: 20px;
font-size: 28px;
.releated-item {
height: 88px;
line-height: 88px;
border-bottom: 1px solid #e0e0e0;
background-color: #fff;
span:first-child {
margin-left: 30px;
width: 230px;
display: inline-block;
}
}
}
}
... ...
@import "expand-new/my-promotion";
... ...
@import "expand-new/my-reward";
... ...
@import "expand-new/reward-detail";
... ...
... ... @@ -451,6 +451,11 @@
color: #b6b6b6;
}
.date {
max-width: none !important;
display: block !important;
}
.price-wrap {
position: absolute;
top: 20px;
... ...
... ... @@ -20,7 +20,7 @@
h4 {
width: 95%;
margin-left: 5%;
margin: 0 2.5%;
font-size: 30px;
color: #b0b0b0;
margin-bottom: 20px;
... ... @@ -28,8 +28,8 @@
}
.yoho-coin {
margin-left: 5%;
width: 90%;
margin: 0 2.5%;
width: 95%;
overflow: hidden;
border-bottom: 1px solid #e0e0e0;
... ... @@ -41,7 +41,8 @@
.dispatch {
.sub-block {
h3 {
width: 90%;
width: 95% !important;
margin: 0 2.5% !important;
span {
color: #afafaf;
... ... @@ -77,4 +78,21 @@
color: #b0b0b0;
}
}
.pic-c {
position: relative;
p {
position: absolute;
bottom: 0;
left: 0;
color: #fff;
width: 100%;
text-align: center;
height: 35px;
line-height: 35px;
background-color: #d0021b;
font-size: 20px;
}
}
}
... ...
... ... @@ -307,6 +307,29 @@
}
}
.invite {
background: #d0021b;
color: #fff;
&:after {
content: none;
}
.horn {
width: 45px;
height: 88px;
display: block;
background-image: url("/home/index/horn.png");
background-size: 100%;
float: left;
margin-right: 12px;
}
}
.message {
clear: both;
}
.icon {
margin-right: 10px;
font-size: 50px;
... ...
... ... @@ -400,6 +400,11 @@
border-radius: 5PX;
margin-left: 15px;
margin-top: 5px;
&.check-ewm {
width: auto;
padding: 0 10px;
}
}
.pay {
... ...
... ... @@ -250,6 +250,23 @@
border-bottom: 1px solid #e0e0e0;
font-size: 26px;
.pic-c {
position: relative;
p {
position: absolute;
bottom: 0;
left: 0;
color: #fff;
width: 100%;
text-align: center;
height: 35px;
line-height: 35px;
background-color: #d0021b;
font-size: 20px;
}
}
&:last-child {
border-bottom: none;
}
... ... @@ -338,6 +355,11 @@
color: #b6b6b6;
}
.date {
max-width: none !important;
display: block !important;
}
.price-wrap {
position: absolute;
top: 0;
... ...
... ... @@ -51,6 +51,11 @@
font-size: 42px;
font-weight: normal;
}
.my-reward {
font-size: 28px;
width: auto;
}
}
}
... ...
... ... @@ -150,10 +150,20 @@ body.passport-body {
line-height: 2.5;
}
.invite-code {
position: absolute;
left: 15PX;
line-height: 2.5;
}
.phone-container {
padding-left: 55PX;
}
.code-container {
padding-left: 70PX;
}
.input {
width: 100%;
line-height: 26PX;
... ...
... ... @@ -483,6 +483,18 @@ $basicBtnC: #eb0313;
font-size: 28px;
line-height: 88px;
.promotion-icon {
line-height: 36px;
background-color: #d0021b;
color: #fff;
padding: 0 4px;
border-radius: 4px;
margin-right: 10px;
font-size: 22px;
float: left;
margin-top: 26px;
}
span {
color: $mainFontC;
}
... ... @@ -711,6 +723,17 @@ $basicBtnC: #eb0313;
line-height: 36px;
}
.first-item > .promotion-icon,
.folder-item > .promotion-icon {
background-color: #d0021b;
color: #fff;
padding: 0 4px;
border-radius: 4px;
margin-right: 10px;
font-size: 22px;
float: left;
}
.short-text {
overflow: hidden;
text-overflow: ellipsis;
... ...