Authored by 毕凯

Merge branch 'release/6.5.2' into gray

<div class="feature-page yoho-page" data-id="{{activity_id}}">
{{#unless content.visiable}}
<div class="over">
<p>此活动已结束</p>
<p>稍后自动跳转更多其他精彩活动...</p>
</div>
{{else}}
{{#content.webShare}}
<input id="shareLink" type="hidden" value="{{url}}">
<input id="shareDesc" type="hidden" value="{{content}}">
<input id="shareImg" type="hidden" value="{{pic}}">
<input id="shareTitle" type="hidden" value="{{title}}">
{{/content.webShare}}
{{#content.floors}}
{{#isEqualOr type 'sidebar'}}
{{! 侧悬浮}}
<div id="sidebar" pageid="{{param.sidebarPageId}}"></div>
{{/isEqualOr}}
{{#isEqualOr type '' 'common_floor' 'fix'}}
{{! 普通楼层 顶悬浮}}
<div {{#if param.anchorname}}id="{{param.anchorname}}"{{/if}} {{#if param.tabname}}tabname="{{param.tabname}}"{{/if}} {{#if id}}data-id="{{id}}"{{/if}} class="floor {{type}} {{#if hide}}hide{{/if}}"
style="{{#if param.bgcolor}}background-color:{{param.bgcolor}}{{/if}}">
{{#if param.bgimg}}
{{#isLazyLoad type @index}}
<img class="lazy" data-original="{{image2 param.bgimg q=85}}">
<div class="over">
<p>此活动已结束</p>
<p>稍后自动跳转更多其他精彩活动...</p>
</div>
{{else}}
{{#content.webShare}}
<input id="shareLink" type="hidden" value="{{url}}">
<input id="shareDesc" type="hidden" value="{{content}}">
<input id="shareImg" type="hidden" value="{{pic}}">
<input id="shareTitle" type="hidden" value="{{title}}">
{{/content.webShare}}
{{#content.floors}}
{{#isEqualOr type 'sidebar'}}
{{! 侧悬浮}}
{{#isEqualOr param.linkTarget '1' '3'}}
<a href="{{param.sidebarPageId}}" class="sidebar-link" target="_blank">
<img src="{{param.icon}}">
</a>
{{/isEqualOr}}
{{#isEqualOr param.linkTarget '2'}}
<div id="sidebar" pageid="{{param.sidebarPageId}}">
<img src="{{param.icon}}">
</div>
{{/isEqualOr}}
{{/isEqualOr}}
{{#isEqualOr type '' 'common_floor' 'fix'}}
{{! 普通楼层 顶悬浮}}
<div {{#if param.anchorname}} id="{{param.anchorname}}" {{/if}} {{#if param.tabname}} tabname="{{param.tabname}}" {{/if}}
{{#if id}} data-id="{{id}}" {{/if}} class="floor {{type}} {{#if hide}}hide{{/if}}" style="{{#if param.bgcolor}}background-color:{{param.bgcolor}}{{/if}}">
{{#if param.bgimg}}
{{#isLazyLoad type @index}}
<img class="lazy" data-original="{{image2 param.bgimg q=85}}">
{{else}}
<img src="{{image2 param.bgimg q=85}}">
{{/isLazyLoad}}
{{/if}}
{{#component}}
{{#isEqualOr type 'link'}}
{{! 普通组件}}
<a class="anchor {{#if modalImg}}modalimg{{/if}}" style="{{styleFormat this percent=1}}" href="{{#if url}}{{url}}{{else}}javascript:void(0);{{/if}}" fp="{{getAnalysis ../this @index}}"></a>
{{#if modalImg}}
<div class="modal">
<span class="modal-close"></span>
<img class="modal-img lazy" data-original="{{image2 modalImg q=85}}">
</div>
{{/if}}
{{/isEqualOr}}
{{/isLazyLoad}}
{{/if}}
{{#component}}
{{#isEqualOr type 'link'}}
{{! 普通组件}}
<a class="anchor {{#if modalImg}}modalimg{{/if}}" style="{{styleFormat this percent=1}}" href="{{#if url}}{{url}}{{else}}javascript:void(0);{{/if}}"
{{#isEqualOr linkTarget '3'}} target="_blank" {{/isEqualOr}} fp="{{getAnalysis ../this @index}}"></a>
{{#if modalImg}}
<div class="modal">
<span class="modal-close"></span>
<img class="modal-img lazy" data-original="{{image2 modalImg q=85}}">
</div>
{{/if}}
{{/isEqualOr}}
{{#isEqualOr type 'coupon'}}
{{! 优惠券}}
<a class="anchor yoho-conpon" style="{{styleFormat this percent=1}}" data-persenal-enable="{{persenal_enable}}" data-token="{{token}}" href="{{#if url}}{{url}}{{else}}javascript:void(0);{{/if}}"
fp="{{getAnalysis ../this @index}}"></a>
{{/isEqualOr}}
{{#isEqualOr type 'coupon'}}
{{! 优惠券}}
<a class="anchor yoho-conpon" style="{{styleFormat this percent=1}}" data-persenal-enable="{{persenal_enable}}" data-token="{{token}}"
href="{{#if url}}{{url}}{{else}}javascript:void(0);{{/if}}" fp="{{getAnalysis ../this @index}}"></a>
{{/isEqualOr}}
{{#isEqualOr type 'yohoCoin'}}
{{! 有货币}}
<a class="anchor yoho-coin" style="{{styleFormat this percent=1}}" data-token="{{token}}" href="{{#if url}}{{url}}{{else}}javascript:void(0);{{/if}}" fp="{{getAnalysis ../this @index}}"></a>
{{/isEqualOr}}
{{#isEqualOr type 'yohoCoin'}}
{{! 有货币}}
<a class="anchor yoho-coin" style="{{styleFormat this percent=1}}" data-token="{{token}}" href="{{#if url}}{{url}}{{else}}javascript:void(0);{{/if}}"
fp="{{getAnalysis ../this @index}}"></a>
{{/isEqualOr}}
{{#isEqualOr type 'video'}}
{{! 视频}}
<a class="anchor video-bg" style="{{styleFormat this percent=1}}" href="{{#if url}}{{url}}{{else}}javascript:void(0);{{/if}}" fp="{{getAnalysis ../this @index}}"></a>
<div class="video-android-close hide"></div>
<div class="video-android-bg hide"></div>
<video class="video" controls loop preload="meta" name="media">
<source src="{{videoSrc}}">
</video>
{{/isEqualOr}}
{{#isEqualOr type 'video'}}
{{! 视频}}
<a class="anchor video-bg" style="{{styleFormat this percent=1}}" href="{{#if url}}{{url}}{{else}}javascript:void(0);{{/if}}"
fp="{{getAnalysis ../this @index}}"></a>
<div class="video-android-close hide"></div>
<div class="video-android-bg hide"></div>
<video class="video" controls loop preload="meta" name="media">
<source src="{{videoSrc}}">
</video>
{{/isEqualOr}}
{{#isEqualOr type 'marquee' 'swiper'}}
{{! 轮播/滑动}}
<div class="swiper-container {{type}}" data-loop="{{loop}}" {{#if spaceBetween}}data-spacebetween="{{spaceBetween}}"{{/if}} {{#if autoplay}}data-autoplay="{{autoplay}}"{{/if}}>
<div class="swiper-wrapper">
{{#list}}
<div class="swiper-slide" style="{{styleFormat this percent=1}}">
<img src="{{image2 src q=85}}">
<a class="anchor" href="{{#if link}}{{link}}{{else}}javascript:void(0);{{/if}}" fp="{{getAnalysis ../../this @index}}"></a>
</div>
{{/list}}
{{#isEqualOr type 'marquee' 'swiper'}}
{{! 轮播/滑动}}
<div class="swiper-container {{type}}" data-loop="{{loop}}" {{#if spaceBetween}} data-spacebetween="{{spaceBetween}}" {{/if}}
{{#if autoplay}} data-autoplay="{{autoplay}}" {{/if}}>
<div class="swiper-wrapper">
{{#list}}
<div class="swiper-slide" style="{{styleFormat this percent=1}}">
<img src="{{image2 src q=85}}">
<a class="anchor" href="{{#if link}}{{link}}{{else}}javascript:void(0);{{/if}}" fp="{{getAnalysis ../../this @index}}"></a>
</div>
{{/list}}
</div>
{{#isEqualOr type 'marquee'}}
<div class="swiper-pagination"></div>
{{/isEqualOr}}
</div>
{{#isEqualOr type 'marquee'}}
<div class="swiper-pagination"></div>
{{/isEqualOr}}
</div>
{{/isEqualOr}}
{{/isEqualOr}}
{{#isEqualOr type 'tab'}}
{{! tab}}
<div class="tab-container">
{{#repeat count}}
<a class="anchor {{#if @first}}active{{/if}}" tab={{tabName @index ../tabnames}} style="{{tabStyle @index ../count}}"></a>
{{/repeat}}
</div>
{{/isEqualOr}}
{{#isEqualOr type 'tab'}}
{{! tab}}
<div class="tab-container">
{{#repeat count}}
<a class="anchor {{#if @first}}active{{/if}}" tab= {{tabName @index ../tabnames}} style="{{tabStyle @index ../count}}"></a>
{{/repeat}}
</div>
{{/isEqualOr}}
{{#isEqualOr type 'shopGroup'}}
{{!-- 店铺组 --}}
{{> feature/shop-group}}
{{/isEqualOr}}
{{#isEqualOr type 'shopGroup'}}
{{!-- 店铺组 --}}
{{> feature/shop-group}}
{{/isEqualOr}}
{{#isEqualOr type 'productGroup'}}
{{! 商品池}}
{{#isEqualOr newStyle '1'}}
{{> feature/product-new-style}}
{{^}}
{{> feature/product-old-style}}
{{#isEqualOr type 'productGroup'}}
{{! 商品池}}
{{#isEqualOr newStyle '1'}}
{{> feature/product-new-style}} {{^}} {{> feature/product-old-style}}
{{/isEqualOr}}
{{/isEqualOr}}
{{/isEqualOr}}
{{/component}}
</div>
{{/isEqualOr}}
{{#isEqualOr type 'bottombar'}}
<div class="floor common_floor" style="width:100%;height:{{height}}rem"></div>
{{> feature/bottom-fix}}
{{/isEqualOr}}
{{/content.floors}}
{{/component}}
</div>
{{/isEqualOr}}
{{#isEqualOr type 'bottombar'}}
<div class="floor common_floor" style="width:100%;height:{{height}}rem"></div>
{{> feature/bottom-fix}}
{{/isEqualOr}}
{{/content.floors}}
{{/unless}}
</div>
... ...
{{#if content.thumbnail}}
<img class="sidebar-img" src="{{image2 content.thumbnail q=85}}">
{{/if}}
<div class="sidebar">
<div class="sidebar-content">
{{#content.floors}}
... ...
... ... @@ -8,13 +8,17 @@
{{/if}}
<div class="show-area" id="bottomShowArea">
{{#component}}
<div class="per-show hide" style="width: {{width}}%;left:{{left}}%;bottom:{{../height}}rem" id="bottomShow{{url}}-{{@index}}"></div>
<div class="per-show hide" style="width: {{width}}%;left:{{left}}%;bottom:{{../height}}rem"{{#isEqualOr linkTarget '2'}} id="bottomShow{{url}}-{{@index}}"{{/isEqualOr}}></div>
{{/component}}
</div>
<div class="click-area" id="bottomFixClickArea" style="height:{{height}}rem">
{{#component}}
<div class="per-click" style="width: {{width}}%;height:{{height}}%" data-url="{{url}}" id="bottomClick{{url}}-{{@index}}">
</div>
{{#isEqualOr linkTarget '1' '3'}}
<a href="{{url}}" target="_blank" class="per-click" style="width: {{width}}%;height:{{height}}%"></a>
{{/isEqualOr}}
{{#isEqualOr linkTarget '2'}}
<div class="per-click" style="width: {{width}}%;height:{{height}}%" data-url="{{url}}" id="bottomClick{{url}}-{{@index}}"></div>
{{/isEqualOr}}
{{/component}}
</div>
</div>
... ...
... ... @@ -25,10 +25,10 @@
<a class="second-part">
<div class="new-brand-div">
{{#isEqualOr ../showSalePrice '1'}}
<div class="new-price" style="{{#if ../salePriceBgColor}}background:{{../salePriceBgColor}};{{/if}}">
<span class="sale-price" {{#if ../fontColor}} style="color:{{../fontColor}};" {{/if}}>¥{{saleprice}}</span>
<div class="new-price" style="{{#if ../salePriceBgColor}}background:{{../salePriceBgColor}};{{/if}}{{#if ../priceFontColor}}color:{{../priceFontColor}};{{/if}}">
<span class="sale-price"{{#if ../fontColor}} style="color:{{../fontColor}};" {{/if}}>¥{{saleprice}}</span>
{{#if marketprice}}
<span class="market-price">¥{{marketprice}}</span>
<span class="market-price"{{#if ../fontColor}} style="color:{{../fontColor}};" {{/if}}>¥{{marketprice}}</span>
{{/if}}
</div>
{{/isEqualOr}}
... ... @@ -64,9 +64,9 @@
<a class="second-part">
<div class="new-brand-div">
{{#isEqualOr showSalePrice '1'}}
<div class="new-price" style="{{#if salePriceBgColor}}background:{{salePriceBgColor}};{{/if}}">
<span class="sale-price" {{#if fontColor}} style="color:{{fontColor}};" {{/if}}></span>
<span class="market-price"></span>
<div class="new-price" style="{{#if salePriceBgColor}}background:{{salePriceBgColor}};{{/if}}{{#if ../priceFontColor}}color:{{../priceFontColor}};{{/if}}">
<span class="sale-price"{{#if fontColor}} style="color:{{fontColor}};" {{/if}}></span>
<span class="market-price"{{#if fontColor}} style="color:{{fontColor}};" {{/if}}></span>
</div>
{{/isEqualOr}}
{{#isEqualOr showVipPrice '1'}}
... ...
... ... @@ -23,9 +23,9 @@
<div class="product-detail-text">
{{#isEqualOr ../showSalePrice '1'}}
<div class="price" style="{{#if ../salePriceBgColor}}background:{{../salePriceBgColor}};{{/if}}">
<span class="sale-price" {{#if ../fontColor}} style="color:{{../fontColor}};" {{/if}}>¥{{saleprice}}</span>
<span class="sale-price"{{#if ../fontColor}} style="color:{{../fontColor}};" {{/if}}>¥{{saleprice}}</span>
{{#if marketprice}}
<span class="market-price">¥{{marketprice}}</span>
<span class="market-price"{{#if ../fontColor}} style="color:{{../fontColor}};" {{/if}}>¥{{marketprice}}</span>
{{/if}}
</div>
{{/isEqualOr}}
... ... @@ -65,8 +65,8 @@
<div class="product-detail-text">
{{#isEqualOr showSalePrice '1'}}
<div class="price" style="{{#if salePriceBgColor}}background:{{salePriceBgColor}};{{/if}}">
<span class="sale-price" {{#if fontColor}} style="color:{{fontColor}};" {{/if}}></span>
<span class="market-price"></span>
<span class="sale-price"{{#if fontColor}} style="color:{{fontColor}};" {{/if}}></span>
<span class="market-price"{{#if fontColor}} style="color:{{fontColor}};" {{/if}}></span>
</div>
{{/isEqualOr}}
{{#isEqualOr showVipPrice '1'}}
... ...
... ... @@ -304,7 +304,7 @@ class cartModel extends global.yoho.BaseModel {
orderCode: orderCode,
sessionKey: sessionKey
}).then(result => {
return paymentProcess.transformJit(_.get(result, 'data.package_list', []));
return paymentProcess.transformJit(_.get(result, 'data.package_info.package_list', []));
});
}
... ...
... ... @@ -53,6 +53,7 @@ exports.orderDetailData = (req, res, next) => {
pageFooter: true,
orderDetail: orderDetail,
refundReason: refundReason,
width750: true,
localCss: true,
});
}).catch(next);
... ...
... ... @@ -3,7 +3,6 @@
const _ = require('lodash');
const moment = require('moment');
const camelCase = global.yoho.camelCase;
const family = global.yoho.FamilyAPI;
const service = global.yoho.ServiceAPI;
const resourcesProcess = require(`${global.utils}/resources-process`);
const helpers = global.yoho.helpers;
... ... @@ -19,10 +18,18 @@ class familyModel extends global.yoho.BaseModel {
*/
_userData(uid) {
if (uid) {
return family.get('user/getUserInfo.json', {
uid: uid
}, {
code: 200
let options = {
data: {
method: 'app.family.userinfo',
uid: uid
},
param: {
code: 200
}
};
return this.get(options).then(result => {
return result;
});
} else {
return Promise.resolve({});
... ... @@ -34,10 +41,18 @@ class familyModel extends global.yoho.BaseModel {
*/
_getCode(uid) {
if (uid) {
return family.get('user/getInvitecode', {
uid: uid
}, {
code: 200
let options = {
data: {
method: 'app.family.invitecode',
uid: uid
},
param: {
code: 200
}
};
return this.get(options).then(result => {
return result;
});
} else {
return Promise.resolve({});
... ... @@ -102,11 +117,17 @@ class familyModel extends global.yoho.BaseModel {
* 获取APP列表
*/
_getAppList(uid) {
return family.get('vip/getUserVipInfo', {
uid: uid
}, {
code: 200
}).then((result => {
let options = {
data: {
method: 'app.family.uservip',
uid: uid
},
param: {
code: 200
}
};
return this.get(options).then((result => {
if (result && result.data && result.code === 200) {
let loginList = [];
let noLoginList = [];
... ... @@ -143,11 +164,17 @@ class familyModel extends global.yoho.BaseModel {
*查询各个体系成长等级信息及等级特权
*/
_getVipInfo(udid) {
return family.get('vip/getVipInfo.json', {
udid: udid
}, {
code: 200
}).then((result) => {
let options = {
data: {
method: 'app.family.vipinfo',
udid: udid
},
param: {
code: 200
}
};
return this.get(options).then((result) => {
if (_.get(result, 'data.mars.vipLevelList', []).length > 0) {
_.forEach(_.get(result, 'data.mars.vipLevelList', []), function(val) {
... ... @@ -163,12 +190,18 @@ class familyModel extends global.yoho.BaseModel {
*查询当前用户各个体系成长等级信息及等级特权
*/
_getUserVipInfo(udid, uid) {
return family.get('vip/getUserVipInfo.json', {
udid: udid,
uid: uid
}, {
code: 200
}).then((result) => {
let options = {
data: {
method: 'app.family.uservip',
udid: udid,
uid: uid
},
param: {
code: 200
}
};
return this.get(options).then((result) => {
if (result && result.data) {
return result.data;
} else {
... ... @@ -408,11 +441,17 @@ class familyModel extends global.yoho.BaseModel {
* 积分乐园数据
*/
integralCharts(uid) {
return family.get('user/getUserCoin', {
uid: uid
}, {
code: 200
}).then((result) => {
let options = {
data: {
method: 'app.family.usercoin',
uid: uid
},
param: {
code: 200
}
};
return this.get(options).then((result) => {
let chartsData = {};
let list = [];
let colorList = [];
... ... @@ -509,17 +548,23 @@ class familyModel extends global.yoho.BaseModel {
}
getCoinData(params) {
return family.get('user/getYohoCoinLog', {
uid: params.uid,
source: params.source || -1,
queryType: params.queryType || 0,
beginTime: params.beginTime ? this.formatDay(parseInt(params.beginTime, 10)) : '',
endTime: params.endTime ? this.formatDay(parseInt(params.endTime, 10)) : '',
page: params.page || 1,
limit: params.limit || 10
}, {
code: 200
}).then(result => {
let options = {
data: {
method: 'app.family.coinlog',
uid: params.uid,
source: params.source || -1,
queryType: params.queryType || 0,
beginTime: params.beginTime ? this.formatDay(parseInt(params.beginTime, 10)) : '',
endTime: params.endTime ? this.formatDay(parseInt(params.endTime, 10)) : '',
page: params.page || 1,
limit: params.limit || 10
},
param: {
code: 200
}
};
return this.get(options).then(result => {
let resu = {
coinList: []
};
... ... @@ -543,11 +588,15 @@ class familyModel extends global.yoho.BaseModel {
* 设置我的潮流口令
*/
setTrendWord(uid, trendWord) {
return family.get('user/updateInviteCode', {
uid: uid,
trendWord: trendWord
}).then((result) => {
let options = {
data: {
method: 'app.family.updateinvitecode',
uid: uid,
trendWord: trendWord
}
};
return this.get(options).then((result) => {
return result;
});
}
... ... @@ -636,28 +685,42 @@ class familyModel extends global.yoho.BaseModel {
}
modify(params) {
return family.get('user/updateUserInfo.json', {
uid: params.uid,
nickName: params.nickName,
gender: params.gender,
birthday: params.birthday,
height: params.height,
weight: params.weight,
province: params.province,
city: params.city
}).then(result => {
let options = {
data: {
method: 'app.family.updateuser',
uid: params.uid,
nickName: params.nickName,
gender: params.gender,
birthday: params.birthday,
height: params.height,
weight: params.weight,
province: params.province,
city: params.city
},
param: {
code: 200
}
};
return this.get(options).then(result => {
return result;
});
}
getCity(params) {
return family.get('area/provinces', {
uid: params.uid,
id: params.id
}, {
cache: true,
code: 200
}).then(result => {
let options = {
data: {
method: 'app.family.province',
uid: params.uid,
id: params.id
},
param: {
cache: true,
code: 200
}
};
return this.get(options).then(result => {
let resu = {
cityList: []
};
... ... @@ -678,15 +741,21 @@ class familyModel extends global.yoho.BaseModel {
}
getList(params) {
return family.get('shop/getShopProducts.json', {
uid: params.uid,
type: params.type,
page: params.page || 1,
limit: params.limit || 20,
city_id: params.cityId
}, {
code: 200
}).then(result => {
let options = {
data: {
method: 'app.family.shopproducts',
uid: params.uid,
type: params.type,
page: params.page || 1,
limit: params.limit || 20,
city_id: params.cityId
},
param: {
code: 200
}
};
return this.get(options).then(result => {
let resu = {
list: []
};
... ... @@ -734,11 +803,17 @@ class familyModel extends global.yoho.BaseModel {
}
coinMall(params) {
return family.get('user/getTotalCoin', {
uid: params.uid
}, {
code: 200
}).then(result => {
let options = {
data: {
method: 'app.family.totalcoin',
uid: params.uid
},
param: {
code: 200
}
};
return this.get(options).then(result => {
if (result && result.code === 200) {
return result.data;
} else {
... ...
... ... @@ -35,13 +35,9 @@ module.exports = class extends global.yoho.BaseModel {
_assignExpressInfo(showLogistics, order) {
let data = {};
if (showLogistics && order.expressCompany && order.expressCompany.caption) {
data = {
logisticsUrl: helpers.urlFormat('/home/logistic', {order_code: order.orderCode}),
logisticsCompany: order.expressCompany.caption,
logisticsNum: order.expressNumber || ''
};
}
data = {
logisticsUrl: helpers.urlFormat('/home/logistic', {order_code: order.orderCode})
};
return data;
}
... ... @@ -57,9 +53,32 @@ module.exports = class extends global.yoho.BaseModel {
return {};
}
let attribute = _.parseInt(order.attribute);
let attribute = _.parseInt(_.get(order, 'orderExtInfo.attribute'));
order = _.assign(order, {
orderCode: _.get(order, 'orderExtInfo.orderCode')
});
if (attribute === 9 || attribute === 11) {
// 定金预售拼接提示语
let countTime = 0;
let payAmount = 0;
if (_.get(order, 'orderDetailInfo.ext.payLefttime') &&
parseInt(order.orderDetailInfo.ext.payLefttime, 10)) {
countTime = order.orderDetailInfo.ext.payLefttime * 1000;
}
if (_.get(order, 'orderDetailInfo.key') === '203') { // 待支付尾款
payAmount = _.get(order, 'orderExtInfo.orderTailPayAmount');
order.orderDetailInfo.ext.desc = `你的商品已到货,您还需支付尾款<span>¥${payAmount}</span>
请在<i class="hours new-hours hide">${countTime}</i>内完成支付。超时订单自动取消`;
} else if (_.get(order, 'orderDetailInfo.key') === '201') { // 待支付定金
payAmount = _.get(order, 'orderExtInfo.orderDepositAmount');
order.orderDetailInfo.ext.desc = `您需支付定金<span>¥${payAmount}</span>
请在<i class="hours new-hours hide">${countTime}</i>内完成支付。超时订单自动取消`;
}
/* 预售商品,不能进行任何操作 */
orderBtn.push({
isAdvance: true
... ... @@ -68,9 +87,9 @@ module.exports = class extends global.yoho.BaseModel {
}
/* 倒计时时间 订单详情页倒计时不在同一级*/
if (order.counterFlag === 'Y' && parseInt(order.payLefttime, 10)) {
if (_.get(order, 'orderDetailInfo.ext.payLefttime') && parseInt(order.orderDetailInfo.ext.payLefttime, 10)) {
orderBtn.push({
leftTimeTop: order.payLefttime * 1000
leftTimeTop: order.orderDetailInfo.ext.payLefttime * 1000
});
}
... ... @@ -87,9 +106,9 @@ module.exports = class extends global.yoho.BaseModel {
link: helpers.urlFormat('/home/orders/addressModify', {
relation: order.relateOrderCode === 'Y', // 判断是否有关联订单
orderCode: order.orderCode,
areaCode: _.get(order, 'deliveryAddress.areaCode', ''),
provinceAreaCode: order.isSupportChangeProvince !== 'Y' &&
_.get(order, 'deliveryAddress.provinceAreaCode', '') || ''// 如果不允许修改省
areaCode: _.get(order, 'deliveryInfo.deliveryAddress.areaCode', ''),
provinceAreaCode: _.get(order, 'deliveryInfo.isSupportChangeProvince') !== 'Y' &&
_.get(order, 'deliveryInfo.deliveryAddress.provinceAreaCode', '') || ''// 如果不允许修改省
})
});
break;
... ... @@ -166,18 +185,31 @@ module.exports = class extends global.yoho.BaseModel {
let offlinestore; // 线下店订单
let deliveryOffline; // 门店取货
orderDetail = _.assign(orderDetail, status);
orderDetail = _.assign(orderDetail, status, {orderCode: orderCode});
if (parseInt(orderDetail.attribute, 10) === 3) {
if (parseInt(_.get(orderDetail, 'orderExtInfo.attribute'), 10) === 3) {
orderDetail = _.assign(orderDetail, {
isVirtual: true,
mobile: result.data.mobile
mobile: _.get(orderDetail, 'deliveryInfo.mobile')
});
}
orderDetail = _.assign(orderDetail, {
addressAll: orderDetail.area + orderDetail.address
});
if (orderDetail.deliveryInfo) {
orderDetail = _.assign(orderDetail, {
addressAll: orderDetail.deliveryInfo.area + orderDetail.deliveryInfo.address
});
}
if (orderDetail.links) {
_.forEach(orderDetail.links, (val) => {
if (val === 'getExpress') {
orderDetail = _.assign(orderDetail, {
expressUrl: helpers.urlFormat('/home/logistic', {order_code: orderCode})
});
return;
}
});
}
_.forEach(orderDetail.orderGoods, function(data) {
let obj = {};
... ... @@ -244,9 +276,12 @@ module.exports = class extends global.yoho.BaseModel {
orderDetail.goods = goods;
// 为支付的拆单配送信息
if (orderDetail.isMultiPackage === 'Y') {
if (orderDetail.packageInfo) {
orderDetail = _.assign(orderDetail, {
jitDetailUrl: helpers.urlFormat('/cart/index/new/jitDetail', {orderCode: orderCode})
jitDetailUrl: helpers.urlFormat('/cart/index/new/jitDetail', {
orderCode: orderCode
}),
packageTitle: _.get(orderDetail, 'packageInfo.packageTitle')
});
}
... ... @@ -333,8 +368,8 @@ module.exports = class extends global.yoho.BaseModel {
method: 'app.SpaceOrders.close',
uid: uid,
order_code: orderCode,
reasonId: reasonId,
reasons: reason,
reason_id: reasonId,
reason: reason,
gender: gender,
yh_channel: channel
}
... ...
... ... @@ -3,6 +3,21 @@
{{> fraud}}
<a class="base-status clearfix" {{#if expressUrl}}href="{{expressUrl}}"{{/if}}>
{{#if orderDetailInfo}}
{{#orderDetailInfo}}
<div class="status-c">
<div class="status-title">{{value}}</div>
<div class="status-body">{{{ext.desc}}}</div>
<div class="status-time">{{ext.pay_expire}}</div>
</div>
{{#if ../expressUrl}}
<span class="iconfont">&#xe614;</span>
{{/if}}
{{/orderDetailInfo}}
{{/if}}
</a>
<div id="order-detail" data-id="{{orderCode}}">
{{#unless deliveryOffline}}
{{#if isVirtual}}
... ... @@ -17,8 +32,8 @@
<span class="iconfont">&#xe637;</span>
<div class="beside-icon">
<p class="name-phone">
{{userName}}
<span>{{mobile}}</span>
{{deliveryInfo.userName}}
<span>{{deliveryInfo.mobile}}</span>
</p>
<p class="address">
{{addressAll}}
... ... @@ -26,52 +41,7 @@
</div>
</section>
{{/if}}
<div class="range"></div>
{{/unless}}
<section class="order-status block">
<div class="status sub">
<span class="iconfont">&#xe632;</span>
<p class="beside-icon sub-content">
<span class="sub-title">订单编号:{{orderCode}}</span>
<span >订单状态:{{statusStr}}</span>
<span>下单时间:<b class="createTime">{{createTime}}</b></span>
{{#if paymentName}}
<span>支付方式:{{paymentName}}</span>
{{/if}}
{{#if offlinestore}}
<span>下单门店: {{offlinestore}}</span>
{{/if}}
</p>
<a href="{{serviceUrl}}" target="_blank" class="iconfont icon-right">&#xe63c;</a>
</div>
{{# orderBtn}}
{{#if getExpress}}
<a class="logistics sub" href="{{logisticsUrl}}">
<span class="iconfont">&#xe630;</span>
<p class="beside-icon sub-content">
<span class="sub-title">物流信息</span>
<span>物流公司:{{logisticsCompany}}</span>
{{#if logisticsNum}}
<span>快递单号:{{logisticsNum}}</span>
{{/if}}
</p>
<span class="iconfont icon-right">&#xe614;</span>
</a>
{{/if}}
{{/orderBtn}}
{{#if deliveryOffline}}
<div class="offline-delivery">
<span class="delivery-img"></span>
<p class="beside-left">
<span class="delivery-title">配送信息</span>
<span class="delivery-content">配送方式:门店取货</span>
</p>
</div>
{{/if}}
</section>
<section class="goods block">
{{> jit-more}}
... ... @@ -81,17 +51,23 @@
{{/ goods}}
</section>
{{#orderAmountInfo}}
<ul class="cost block">
{{#each promotionFormulas}}
<li> {{promotion}}:
<span>{{promotionAmount}}</span>
</li>
{{/each}}
</ul>
<ul class="real-amount">
{{#realAmount}}
<li>
{{#if isPayonline}}实付金额{{else}}应付金额{{/if}}
<span>{{amount}}</span>
{{promotion}}:
<span>{{promotionAmount}}</span>
</li>
{{/realAmount}}
</ul>
{{/orderAmountInfo}}
{{#if yohoGiveCoin}}
<p class="dollar">
<span class="bg-dollar"></span>
... ... @@ -140,6 +116,16 @@
{{!-- 申请售后退换货组件 --}}
{{> order-detail/refund-change-mask}}
{{#if orderBasicInfo}}
<div class="info-table">
{{#orderBasicInfo}}
<div class="table-item">{{key}}{{value}}</div>
{{/orderBasicInfo}}
<a href="{{serviceUrl}}" target="_blank" class="iconfont">&#xe63c;</a>
</div>
{{/if}}
{{/ orderDetail}}
{{!-- 申请退款原因 --}}
... ...
... ... @@ -13,36 +13,31 @@ const isTest = process.env.NODE_ENV === 'test';
const domains = {
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/',
liveApi: 'http://testapi.live.yohops.com:9999/',
singleApi: 'http://api-test3.yohops.com:9999/',
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
// liveApi: 'http://testapi.live.yohops.com:9999/',
// gray
// singleApi: 'http://single.gray.yohops.com/',
// api: 'http://apigray.yoho.cn/',
// service: 'http://apigray.yoho.cn/',
// platformApi: 'http://172.16.6.210:8088/',
// api: 'http://api-test3.yohops.com:9999/',
// service: 'http://service-test3.yohops.com:9999/',
// liveApi: 'http://testapi.live.yohops.com:9999/',
// singleApi: 'http://api-test3.yohops.com:9999/',
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
liveApi: 'http://testapi.live.yohops.com:9999/',
imSocket: 'ws://socket.yohobuy.com:10240',
imCs: 'http://im.yohobuy.com/api',
global: 'http://api-global.yohobuy.com',
store: 'http://192.168.102.47:8080/portal-gateway/',
platformApi: 'http://192.168.102.48:8088/',
extstore: 'http://extstore-test1.yohops.com',
family: 'http://192.168.103.73:8096/uic/',
yohoNowApi: 'http://yohonow-test.yohops.com:9999/'
};
module.exports = {
app: 'h5',
appVersion: '6.4.0', // 调用api的版本
appVersion: '6.5.2', // 调用api的版本
appName: 'yohobuywap-node',
port: 6001,
siteUrl: '//m.yohobuy.com',
... ... @@ -163,12 +158,10 @@ if (isProduction) {
global: 'http://api-global.yohobuy.com',
store: 'http://openstore.yohobuy.com',
liveApi: 'http://api.live.yoho.cn/',
singleApi: 'http://single.yoho.cn/',
imSocket: 'wss://imsocket.yohobuy.com:443',
imCs: 'https://imhttp.yohobuy.com/api',
platformApi: 'http://api.platform.yohoops.org',
extstore: 'http://extstore.yohobuy.com',
family: 'http://uic.yohoops.org/uic/',
yohoNowApi: 'http://new.yohoboys.com/'
},
memcache: {
... ... @@ -272,12 +265,10 @@ if (isProduction) {
global: process.env.TEST_GLOBAL || 'http://global-test-soa.yohops.com:9999/',
store: process.env.TEST_STORE || 'http://192.168.102.210:8080/portal-gateway/wechat/',
liveApi: process.env.TEST_LIVE || 'http://testapi.live.yohops.com:9999/',
singleApi: process.env.TEST_SINGLE || 'http://api-test1.yohops.com:9999/',
imSocket: process.env.TEST_IM_SOCKET || 'ws://socket.yohobuy.com:10240',
imCs: process.env.TEST_IM_CS || 'http://im.yohobuy.com/api',
platformApi: 'http://192.168.102.48:8088/',
extstore: 'http://extstore-test1.yohops.com',
family: 'http://192.168.102.31:8096/uic/',
yohoNowApi: process.env.YOHO_NOW_API || 'http://yohonow-test.yohops.com:9999/'
},
memcache: {
... ...
{
"name": "yohobuywap-node",
"version": "6.5.4",
"version": "6.5.20",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -28,6 +28,8 @@ let $sureClose = $('.order-opt').find('.cancel'); // 取消订单按钮
let $sureRefund = $('.order-opt').find('.refund'); // 申请退款按钮
let $refundChangeMask = $('.refund-change-mask'); // 退换货选择组件
let $newHours = $('.new-hours').length > 0 ? true : false; // 新的倒计时格式标示
require('common');
require('plugin/modal.alert');
... ... @@ -66,10 +68,19 @@ function downCount(options) {
// set to DOM
$countdownContainer.removeClass('hide');
$('.new-hours').removeClass('hide');
if (hours === '00') {
$countDownHours.text('剩余' + minutes + ':' + seconds);
if ($newHours) {
$countDownHours.text(minutes + '分' + seconds + '秒');
} else {
$countDownHours.text('剩余' + minutes + ':' + seconds);
}
} else {
$countDownHours.text('剩余' + hours + ':' + minutes + ':' + seconds);
if ($newHours) {
$countDownHours.text(hours + '时' + minutes + '分' + seconds + '秒');
} else {
$countDownHours.text('剩余' + hours + ':' + minutes + ':' + seconds);
}
}
difference -= 1000;
... ...
... ... @@ -106,6 +106,15 @@ class ProductListWithFilter {
});
}
/**
* 重置
*/
reset() {
filter.resetFilter();
this.page = 0;
this.view.container.html('');
}
dataRender(result) {
// 去掉正在加载
... ...
... ... @@ -30,12 +30,14 @@ Tab.prototype.getallgoods = function() { // 显示筛选 TAB
$listNav.find('.default').addClass('active');
$filterBox.css('display', 'block');
$('.filter-mask').addClass('hide');
productListWithFilter.reset();
productListWithFilter.getGoodsList({type: 'default', page: 1});
productListWithFilter.scrollActived = true;
};
Tab.prototype.getnewgoods = function() {
$filterBox.css('display', 'none');
$('.filter-mask').addClass('hide');
productListWithFilter.reset();
productListWithFilter.getGoodsList({type: 'new', page: 1});
productListWithFilter.scrollActived = true;
};
... ...
/*
* @Author: Targaryen
* @Date: 2017-03-24 13:43:55
* @Last Modified by: Targaryen
* @Last Modified time: 2017-06-20 09:50:01
*/
/** *****************************
* 红人店铺使用的全部商品页面碎片
*******************************/
const filter = require('../../plugin/filter');
const lazyLoad = require('yoho-jquery-lazyload');
let noResultHbs = require('product/search/no-result-new.hbs');
let $goodsContainer = $('#goods-container');
let $container = $goodsContainer.children('.default-goods'); // 承载商品列表的容器
let $listNav = $('#list-nav'); // 筛选项列表
let $pre = $listNav.find('.active'); // 记录进入筛选前的active项,初始为选中项
let $allGoodsTabPage = $(document.getElementById('all-goods'));
let $filterBody = $('.filter-body');
let $dropList = $('.drop-list');
const shopId = $('#shopId').val();
let navInfo = {
price: {
order: 1,
end: false
},
discount: {
order: 1,
end: false
},
default: {
order: 0,
end: false,
type: 'default'
},
new: {
order: 0,
end: false
},
sale: {
order: 0,
end: false
},
popularity: {
order: 0,
end: false
}
};
let beforeScroll = document.body.scrollTop; // 滚动前位置记录
let navType = 'default'; // 目前激活的导航页面
let defaultOpt = Object.assign({}, navInfo.default, {shop_id: shopId}); // 默认参数
let onSearching = false; // 是否正在搜索
let isScrollLoad = false; // 是否是滚动加载
let page = 1; // 页码
let nav;
let $firstText = $('.first-li-more').find('.nav-txt');
let $thisLi = '';
// 物料商品列表标记
if ($('#material-flag').val() === 'material') {
let material = true;
if ($('.first-li-more').hasClass('active')) {
page = 2; // 已在服务端渲染第一页
}
Object.assign(defaultOpt, {
material: material,
unionType: window.queryString.union_type
});
}
/**
* 处理筛选参数
*/
const handleChoseFilter = function() {
$.each($filterBody.find('.chosed'), function(index, elem) {
let choseOpt = {};
choseOpt[$(elem).parent().data('type')] = $(elem).data('id');
Object.assign(defaultOpt, choseOpt);
});
};
/**
* 获取商品列表
*/
const getGoodsList = params => {
handleChoseFilter();
if (!onSearching) {
Object.assign(defaultOpt, {
page: page++
});
}
// 有参数,参数优先,滚动加载相关参数重置
if (params && !params.filtering) {
Object.assign(defaultOpt, params);
if (params.page) {
page = params.page + 1;
}
isScrollLoad = false;
beforeScroll = document.body.scrollTop;
}
if (nav && nav.end) {
return false;
}
if (!onSearching) {
onSearching = true;
$.ajax({
type: 'GET',
url: location.protocol + '//m.yohobuy.com/product/search/search',
data: defaultOpt,
xhrFields: {
withCredentials: true
},
beforeSend: function() {
if ($('.no-result-new').length > 0) {
$('.no-result-new').remove();
}
$container.append('<div class="search-divide">正在加载...</div>');
},
success: function(result) {
// 去掉正在加载
$('.search-divide').remove();
let noResult = !result || result.length < 1 || (result.list && result.list.length < 1);
// 没有结果输出没有结果页面
if (noResult) {
if (isScrollLoad) {
$container.append('<div class="search-divide">没有更多内容了...</div>');
} else {
$container.html(noResultHbs());
}
if (nav) {
nav.end = true;
}
onSearching = false;
return false;
}
if (isScrollLoad) {
$container.append(result);
} else {
$container.html(result);
}
lazyLoad($container.find('img[class=lazy]').not('img[src]'));
onSearching = false;
},
error: function() {
let $divide = $('.search-divide');
$divide.text('加载失败,点击重试');
$divide.one('click', function() {
$divide.text('正在加载...');
getGoodsList();
});
onSearching = false;
}
});
}
};
/**
* 加载筛选数据
*/
const getFilter = function() {
$.ajax({
type: 'GET',
url: location.protocol + '//m.yohobuy.com/product/search/filter',
data: defaultOpt,
success: function(data) {
if (!data) {
return false;
}
$goodsContainer.append(data);
// 初始化filter&注册filter回调
filter.initFilter({
fCbFn: getGoodsList,
hCbFn: function() {
// 切换active状态到$pre上
$pre.addClass('active');
$pre.siblings('.filter').removeClass('active');
}
});
$filterBody = $('.filter-body');
}
});
};
$listNav.bind('contextmenu', function() {
return false;
});
const popularityFilter = function(thisLi, type) {
if (thisLi.hasClass('active')) {
$dropList.hide();
return false;
}
$thisLi.addClass('active').siblings('li').removeClass('active');
defaultOpt.type = type;
nav = navInfo[type];
if (thisLi.hasClass('asc')) {
nav.order = 1;
} else {
nav.order = 0;
}
Object.assign(defaultOpt, nav);
getGoodsList();
$dropList.hide();
};
$listNav.on('touchend touchcancel', function(e) {
page = 1;
beforeScroll = $(window).scrollTop();
isScrollLoad = false;
let $this = $(e.target).closest('li'); // 被点击的 Tab
let $active;
// 默认列表增加人气筛选
if ($this.hasClass('first-li-more') && $this.hasClass('active')) {
$this.siblings('.active').removeClass('active');
$this.addClass('active');
$dropList.toggle();
$dropList.find('.default').on('touchend touchcancel', function() {
$thisLi = $(this);
$firstText.html('默认');
popularityFilter($thisLi, 'default');
return false;
});
$dropList.find('.discount').on('touchend touchcancel', function() {
$thisLi = $(this);
$firstText.html($(this).data('text'));
popularityFilter($thisLi, 'discount');
$('.first-li-more').removeClass('new default sale discount').addClass('discount');
return false;
});
} else if ($this.hasClass('filter')) { // 筛选面板
$dropList.css('display', 'none');
// 筛选面板切换状态
if ($this.hasClass('active')) {
filter.hideFilter();
// 点击筛选前的 active 项恢复 active
$pre.addClass('active');
$this.removeClass('active');
} else {
$pre = $this.siblings('.active');
$pre.removeClass('active');
$this.addClass('active');
filter.showFilter();
}
} else { // 排序改变
$dropList.css('display', 'none');
if ($this.hasClass('new')) {
navType = 'new';
} else if ($this.hasClass('price')) {
navType = 'price';
} else if ($this.hasClass('discount')) {
navType = 'discount';
} else if ($this.hasClass('default')) {
navType = 'default';
} else if ($this.hasClass('sale')) {
navType = 'sale';
} else if ($this.hasClass('popularity')) {
navType = 'popularity';
}
// 更新当前排序:默认、最新、价格、折扣
nav = navInfo[navType];
if ($this.hasClass('active')) {
// 默认、最新无排序切换
if ($this.hasClass('default') || $this.hasClass('new') || $this.hasClass('popularity')) {
return false;
}
if ($this.hasClass('price') || $this.hasClass('discount')) {
// 价格或折扣切换排序状态
$this.find('.icon > .iconfont').toggleClass('cur');
$pre = $this; // 更新 pre 为当前项
nav.order = nav.order === 0 ? 1 : 0; // 切换排序
}
} else {
$active = $this.siblings('.active');
$pre = $this; // $pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项
if ($active.hasClass('filter')) {
// 若之前active项为筛选,则隐藏筛选面板
filter.hideFilter();
}
$active.removeClass('active');
$this.addClass('active');
}
/* 排序条件更新 */
defaultOpt.type = navType;
Object.assign(defaultOpt, nav);
getGoodsList();
}
});
/**
* 当scroll到1/2$goodsContainer高度后继续请求下一页数据
*/
const scrollHandler = function() {
if ($allGoodsTabPage.hasClass('active') && $(window).scrollTop() > $goodsContainer.height() * 0.6) {
isScrollLoad = true;
getGoodsList();
}
};
/**
* 滚动加载
*/
$(window).scroll(function() {
setTimeout(function() {
let afterScroll = document.body.scrollTop;
if (afterScroll - beforeScroll > 0) {
window.requestAnimationFrame(scrollHandler);
beforeScroll = afterScroll;
} else {
return false;
}
}, 5);
});
module.exports = {
getGoodsList,
getFilter
};
... ... @@ -240,6 +240,22 @@ li {
transform: translateX(-50%);
}
.feature-page .sidebar-link {
position: fixed;
display: block;
top: 50%;
right: 0;
width: 150px;
height: 150px;
margin-top: -75px;
z-index: 999;
img {
width: 150px;
height: 150px;
}
}
.feature-page .sidebar {
position: fixed;
width: 100%;
... ...
... ... @@ -2,7 +2,7 @@
background: #fff;
display: block;
padding: 20px 30px;
margin-bottom: 30px;
margin-bottom: 20px;
border-bottom: 1px solid #e0e0e0;
.tip-title {
... ...
... ... @@ -113,14 +113,6 @@
line-height: 1.5;
}
.range {
background-image: resolve("home/rang.png");
background-size: cover;
width: 640px;
height: 20px;
background-color: #fff;
}
.beside-icon {
margin-left: 60px;
}
... ... @@ -171,27 +163,25 @@
span {
float: right;
}
&:last-child span {
color: #f00;
}
}
}
.dollar {
margin: 20px 0;
background: #fff;
padding: 0.5rem 0.75rem;
height: 1.5rem;
line-height: 0.5rem;
padding: 0 30px;
height: 88px;
line-height: 88px;
font-size: 0.7rem;
.bg-dollar {
display: inline-block;
width: 0.6rem;
height: 0.6rem;
background: url("/home/yoho-coin/dollar.png") center center;
width: 36px;
height: 36px;
background: resolve("home/yoho-coin/yoho_icon.png");
background-size: 100% 100%;
vertical-align: middle;
vertical-align: sub;
margin-right: 5px;
}
}
... ...
... ... @@ -405,6 +405,7 @@
color: #f00;
float: right;
margin-right: 30px;
margin-top: 40px;
}
}
... ...
... ... @@ -98,7 +98,7 @@
.gallery {
.code-copy {
top: -624px;
top: -628px;
left: 335px;
}
}
... ...
... ... @@ -2,3 +2,4 @@
@import "order";
@import "order-detail";
@import "fraud";
@import "orderDetail/order-detail-new";
... ...
.base-status {
background-color: #fff;
padding: 30px;
margin-bottom: 20px;
display: flex;
align-items: center;
.status-c {
float: left;
width: 640px;
}
.status-title {
font-size: 34px;
color: #444;
line-height: 48px;
margin-bottom: 10px;
}
.status-body {
font-size: 28px;
color: #b0b0b0;
line-height: 40px;
margin-bottom: 5px;
span {
color: #e01;
}
}
.status-time {
font-size: 24px;
color: #b0b0b0;
line-height: 34px;
}
.iconfont {
margin-left: 30px;
width: 20px;
float: right;
color: #e0e0e0;
font-size: 32px;
}
}
.info-table {
margin: 20px 0;
padding: 30px 0 30px 30px;
background-color: #fff;
position: relative;
.table-item {
line-height: 50px;
font-size: 28px;
color: #444;
}
.iconfont {
position: absolute;
top: 30px;
right: 30px;
font-size: 40px;
}
}
.real-amount {
background-color: #fff;
li {
margin-left: 30px;
padding-right: 30px;
font-size: 28px;
border-top: solid 1px #e0e0e0;
line-height: 80px;
span {
float: right;
}
&:last-child span {
color: #f00;
}
}
}
... ...