Authored by 陈峰

Merge branch 'release/6.7.9' into 'master'

Release/6.7.9



See merge request !1575
... ... @@ -73,6 +73,7 @@ class featureModel extends global.yoho.BaseModel {
lefTopImg: value.lefTopImg,
rigTopImg: value.rigTopImg,
showPrdName: value.showPrdName,
priceFontColor: value.priceFontColor,
showSalePrice: value.showSalePrice,
salePriceBgColor: value.salePriceBgColor,
fontColor: value.fontColor,
... ... @@ -141,7 +142,7 @@ class featureModel extends global.yoho.BaseModel {
data: {
method: 'app.collage.productList.page',
activityId: activityId,
limit: 10
limit: 20
},
param: {
cache: true
... ... @@ -193,6 +194,7 @@ class featureModel extends global.yoho.BaseModel {
return;
}
data = data.data;
if (data && data.floors) {
data.floors.forEach(f => {
let componentArr = [];
... ... @@ -207,8 +209,6 @@ class featureModel extends global.yoho.BaseModel {
componentArr.push(f.component[0]);
// sknsArr.push(self._getProductBySkns(f.component[0], self.ctx));
f.component[0].newStyle = _.get(f, 'component[0].newStyle') === '1';
}
... ... @@ -233,12 +233,9 @@ class featureModel extends global.yoho.BaseModel {
if (componentType === 'swiperSkns') {
componentArr.push(f.component[0]);
// sknsArr.push(self._getProductBySkns(f.component[0], self.ctx));
}
if (componentType === 'collageSkns') {
// componentArr.push(f.component[0]);
sknsArr.push(self._getCollageProductList(f.component[0], self.ctx));
}
... ... @@ -259,6 +256,8 @@ class featureModel extends global.yoho.BaseModel {
f.param.bgimg = '';
}
let set = new Set();
_.forEach(f.component, component => {
if (component.url && component.url.indexOf('go.productDetail') !== -1) {
... ... @@ -276,8 +275,19 @@ class featureModel extends global.yoho.BaseModel {
if (component.type === 'skn') {
componentArr.push(component);
}
component.type && set.add(component.type);
});
// 楼层背景图特殊处理,不推荐使用(新需求强烈要求接口给新楼层标识)
// 原背景图用作撑开楼层,部分覆盖组件覆盖其上,非覆盖组件显示在背景图下
if (['shop-skn'].indexOf(_.sortBy([...set]).join('-')) > -1) {
if (f.param.bgimg) {
f.param._bgimgFill = f.param.bgimg;
f.param.bgimg = '';
}
}
if (componentArr.length) {
sknsArr.push(self._getProductBySkns(componentArr, self.ctx));
}
... ...
... ... @@ -28,7 +28,7 @@
{{#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 clearfix {{type}} {{#if hide}}hide{{/if}}" style="{{#if param.bgcolor}}background-color:{{param.bgcolor}}{{/if}}">
{{#if id}} data-id="{{id}}" {{/if}} class="floor clearfix {{type}} {{#if hide}}hide{{/if}}" style="{{#if param.bgcolor}}background-color:{{param.bgcolor}};{{/if}}{{#if param._bgimgFill}}background-image: url({{param._bgimgFill}});{{/if}}">
{{#if param.bgimg}}
{{#isLazyLoad type @index}}
<img class="lazy" data-original="{{imageslim param.bgimg}}">
... ... @@ -134,7 +134,9 @@
{{! 商品}}
{{#defaultPros}}
<div class="product-container single-item3">
{{> feature/product-old-item}}
{{#isEqualOr ../newStyle '1'}}
{{> feature/product-new-item}} {{^}} {{> feature/product-old-item}}
{{/isEqualOr}}
</div>
{{/defaultPros}}
{{/isEqualOr}}
... ...
... ... @@ -8,10 +8,10 @@
<img class="rigtopimg lazy" data-original="{{image2 conf.rigTopImg q=85}}">
{{/if}}
<img class="product-detail-img product-detail-img-new lazy" data-original="{{image2 productimg q=85}}">
<a class="new-brand-name {{#isEqualOr conf.showBrandUrl '1'}}product-brand{{else}}product-detail{{/isEqualOr}}" href="{{brandurl}}">
<span class="brand-name" {{#if conf.fontColor}} style="color:{{conf.fontColor}};" {{/if}}>{{brandname}}</span>
</a>
</div>
<a class="new-brand-name {{#isEqualOr conf.showBrandUrl '1'}}product-brand{{else}}product-detail{{/isEqualOr}}" href="{{brandurl}}">
<span class="brand-name" {{#if conf.fontColor}} style="color:{{conf.fontColor}};" {{/if}}>{{brandname}}</span>
</a>
</a>
{{#if conf.brandImg}}
<a class="second-part">
... ...
... ... @@ -5,6 +5,7 @@
<li class="side-swiper-item" data-skn="{{productSkn}}">
<a href="{{producturl}}">
<div class="img-box">
<div class="collage-num">{{peopleNum}}人成团</div>
{{#if ../lefTopImg}}
<img class="leftopimg lazy" data-original="{{image2 ../lefTopImg q=85}}">
{{/if}}
... ... @@ -15,10 +16,10 @@
</div>
<div class="goods-info">
<div class="info-middle">
<div class="pro-price" style="{{#if ../priceFontColor}}color:{{../priceFontColor}};{{/if}}">
<div class="pro-price center" style="{{#if ../salePriceBgColor}}background:{{../salePriceBgColor}};{{/if}}{{#if ../priceFontColor}}color:{{../priceFontColor}};{{/if}}">
<span class="sale-price"{{#if ../fontColor}} style="color:{{../fontColor}};" {{/if}}>¥{{collagePrice}}</span>
{{#if marketPrice}}
<span class="market-price" {{#if ../fontColor}} style="color:{{../fontColor}};"{{/if}}>¥{{marketPrice}}</span>
<span class="market-price grey" {{#if ../fontColor}} style="color:{{../fontColor}};"{{/if}}>¥{{marketPrice}}</span>
{{/if}}
</div>
... ...
... ... @@ -12,24 +12,26 @@
<img class="rigtopimg lazy" data-original="{{image2 ../rigTopImg q=85}}">
{{/if}}
<img class="goods-pic lazy" data-original="{{image2 productimg q=85}}" alt="goods">
{{#isEqualOr ../showBrandUrl '1'}}
<a class="brand-name brand-name-cover" href="{{brandurl}}">
<span {{#if ../fontColor}} style="color:{{../fontColor}};" {{/if}}>{{brandname}}</span>
</a>
{{/isEqualOr}}
</div>
<div class="goods-info">
<div class="info-middle">
{{#isEqualOr ../showSalePrice '1'}}
<div class="pro-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" {{#if ../fontColor}} style="color:{{../fontColor}};"{{/if}}>¥{{marketprice}}</span>
{{/if}}
</div>
{{/isEqualOr}}
{{#isEqualOr ../showSalePrice '1'}}
<div class="pro-price {{#if ../brandImg}}pro-price-cover{{/if}}" 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" {{#if ../fontColor}} style="color:{{../fontColor}};"{{/if}}>¥{{marketprice}}</span>
{{/if}}
</div>
{{/isEqualOr}}
{{#isEqualOr ../showBrandUrl '1'}}
<a class="brand-name" href="{{brandurl}}">
<span {{#if ../fontColor}} style="color:{{../fontColor}};" {{/if}}>{{brandname}}</span>
</a>
{{/isEqualOr}}
</div>
{{#if ../brandImg}}
<img class="brand-img" src="{{image2 ../brandImg q=85}}">
{{/if}}
</div>
</a>
</li>
... ...
... ... @@ -134,7 +134,7 @@ class newHome extends global.yoho.BaseModel {
async checkCs(uid) {
let isWechatService = false; // 是否是微信客服
if (uid !== null || uid !== undefined) {
if (uid !== null || uid !== void(0)) {
// 校验是客服还是用户 y则是客服
let ret = await this.get({
data: {
... ...
{
"name": "yohobuywap-node",
"version": "6.7.22",
"version": "6.7.23",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -16,7 +16,7 @@ $('.submitWxAccount').click(function() {
method: 'POST',
url: '/activity/red-envelope/submitWxCode',
data: {
userUid: parseInt($('#uid')[0].value),
userUid: parseInt($('#uid')[0].value, 10),
userCode
},
success: function(data) {
... ...
... ... @@ -83,7 +83,7 @@
height: 100%;
min-height: 440px;
margin: 0 auto;
padding: 33px;
padding: 24px;
background: url("img/activity/red-envelope/txt-bg.png") no-repeat;
background-size: contain;
position: relative;
... ...
... ... @@ -6,3 +6,33 @@
@import "scss/feature/shop";
@import "scss/feature/bottom";
@import "scss/feature/timed-cut";
/* stylelint-disable */
.common_floor {
background-size: 100%;
background-repeat: no-repeat;
img[src=""],
img:not([src]) {
opacity: 0;
}
&.clearfix {
*zoom: 1;
&:before,
&:after {
content: "";
display: table;
}
&:after {
clear: both;
}
}
.single-item3:nth-of-type(3n+1) {
margin-left: 20px;
}
}
/* stylelint-enable */
... ...
/* stylelint-disable */
.common_floor {
&.clearfix {
*zoom: 1;
&:before,
&:after {
content: "";
display: table;
}
&:after {
clear: both;
}
}
.single-item3:nth-of-type(3n+1) {
margin-left: 20px;
}
}
/* stylelint-enable */
.product-container {
overflow: hidden;
padding: 0 20px 10px;
... ... @@ -102,7 +80,8 @@
float: left;
.feature-product-info {
margin: 16px 10px 16px 0;
margin: 16px 10px 0 0;
position: relative;
}
}
... ... @@ -360,12 +339,13 @@
&:after {
content: "";
display: block;
margin-top: -70px;
margin-top: -88px;
}
ul {
padding: 25px 0 100px 26px;
padding: 14px 0 100px 20px;
white-space: nowrap;
font-size: 0;
}
.side-swiper-content {
... ... @@ -374,8 +354,8 @@
.side-swiper-item {
display: inline-block;
width: 153px;
margin-right: 26px;
width: 160px;
margin-right: 20px;
border-radius: 5px;
vertical-align: top;
... ... @@ -385,7 +365,7 @@
}
.img-box {
height: 206px;
height: 216px;
position: relative;
}
... ... @@ -395,6 +375,30 @@
display: block;
}
.collage-num {
height: 30px;
line-height: 32px;
font-size: 10px;
border-radius: 16px;
background-color: #f00;
color: #fff;
position: absolute;
bottom: 0;
padding: 0 20px;
z-index: 2;
&:before {
content: "";
width: 20px;
position: absolute;
left: 0;
top: 0;
bottom: 0;
background-color: #f00;
z-index: -1;
}
}
.leftopimg,
.rigtopimg {
height: auto;
... ... @@ -412,21 +416,39 @@
right: 0;
}
.goods-info {
position: relative;
.pro-price-cover {
width: 100%;
position: absolute;
top: 0;
}
}
.pro-price {
text-align: center;
color: #444;
padding: 6px;
font-size: 26px;
font-size: 24px;
font-weight: 700;
&.center {
text-align: center;
}
> span {
display: inline-block;
}
.grey {
color: #bebebe;
}
}
.market-price {
color: #bebebe;
margin-left: 6px;
font-size: 20px;
margin-left: 4px;
font-size: 16px;
font-weight: 400;
text-decoration: line-through;
}
... ... @@ -442,6 +464,18 @@
color: #444;
}
.brand-name-cover {
position: absolute;
width: 100%;
bottom: 0;
background-color: #272829;
padding: 5px 0;
line-height: 30px;
font-size: 18px;
color: #fff;
z-index: 20;
}
.join-num {
font-size: 22px;
color: #bebebe;
... ...
... ... @@ -116,6 +116,11 @@ button {
background-size: 132px !important;
}
img[src=""],
img:not([src]) {
opacity: 0;
}
/* rich-tip */
.yoho-order-bg {
position: fixed;
... ...
... ... @@ -34,11 +34,11 @@ const _numberValid = (option) => {
const value = option.value;
// 设置默认值
option.require = option.require === undefined ? false : option.require;
option.integer = option.integer === undefined ? false : option.integer;
option.empty = option.empty === undefined ? true : option.empty;
option.require = option.require === void(0) ? false : option.require;
option.integer = option.integer === void(0) ? false : option.integer;
option.empty = option.empty === void(0) ? true : option.empty;
if (value === undefined) {
if (value === void(0)) {
if (option.require === true) {
throw _errJson(`${option.param} 参数是必须的`);
} else {
... ... @@ -55,20 +55,20 @@ const _numberValid = (option) => {
if (option.empty === false) {
throw _errJson(`${option.param} 参数不能为空字符串`);
} else {
return undefined;
return void(0);
}
}
const numValue = Number(value);
if (!Number.isNaN(numValue) && Math.abs(numValue) !== Infinity) {
if (option.equal !== undefined) {
if (option.equal !== void(0)) {
if (numValue !== option.equal) {
throw _errJson(`${option.param} 参数必须等于 ${option.equal}`);
}
return numValue;
}
if (option.equalArr !== undefined) {
if (option.equalArr !== void(0)) {
let result = false;
for (let item of option.equalArr) {
... ... @@ -89,12 +89,12 @@ const _numberValid = (option) => {
throw _errJson(`${option.param} 参数必须是整数`);
}
}
if (option.smaller !== undefined) {
if (option.smaller !== void(0)) {
if (!numValue < option.smaller) {
throw _errJson(`${option.param} 参数必须小于 ${option.smaller}`);
}
}
if (option.bigger !== undefined) {
if (option.bigger !== void(0)) {
if (!numValue > option.bigger) {
throw _errJson(`${option.param} 参数必须大于 ${option.bigger}`);
}
... ... @@ -124,7 +124,7 @@ const _stringValid = (option) => {
option.require = option.require || false;
option.empty = option.empty || true;
if (value === undefined) {
if (value === void(0)) {
if (option.require === true) {
throw _errJson(`${option.param} 参数是必须的`);
} else {
... ... @@ -144,12 +144,12 @@ const _stringValid = (option) => {
throw _errJson(`${option.param} 参数不能为空`);
} else {
if (option.emptyFilter === true) {
return undefined;
return void(0);
}
return strValue;
}
}
if (option.regex !== undefined) {
if (option.regex !== void(0)) {
switch (option.regex) {
case 'phone':
if (!/^1[0-9]{10}$/.test(strValue)) {
... ... @@ -168,12 +168,12 @@ const _stringValid = (option) => {
}
return strValue;
}
if (option.end !== undefined) {
if (option.end !== void(0)) {
if (!strValue.length < option.end) {
throw _errJson(`${option.param} 参数长度必须小于 ${option.end}`);
}
}
if (option.start !== undefined) {
if (option.start !== void(0)) {
if (!strValue.length > option.start) {
throw _errJson(`${option.param} 参数长度必须大于 ${option.start}`);
}
... ... @@ -197,7 +197,7 @@ const _booleanValid = (option) => {
option.require = option.require || false;
option.empty = option.empty || true;
if (value === undefined) {
if (value === void(0)) {
if (option.require === true) {
throw _errJson(`${option.param} 参数是必须的`);
} else {
... ... @@ -210,7 +210,7 @@ const _booleanValid = (option) => {
throw _errJson(`${option.param} 参数不能为空`);
} else {
if (option.emptyFilter === true) {
return undefined;
return void(0);
}
return value;
}
... ... @@ -229,7 +229,7 @@ const _objectValid = (option) => {
option.require = option.require || false;
option.empty = option.empty || true;
if (value === undefined || value === null) {
if (value === void(0) || value === null) {
if (option.require === true) {
throw _errJson(`${option.param} 参数是必须的`);
} else {
... ... @@ -268,28 +268,30 @@ const valid = (data, option) => {
switch (opt.type) {
case 'number':
data[item] = _numberValid(opt);
if (data[item] === undefined) {
if (data[item] === void(0)) {
delete data[item];
}
break;
case 'string':
data[item] = _stringValid(opt);
if (data[item] === undefined) {
if (data[item] === void(0)) {
delete data[item];
}
break;
case 'boolean':
data[item] = _booleanValid(opt);
if (data[item] === undefined) {
if (data[item] === void(0)) {
delete data[item];
}
break;
case 'object':
data[item] = _objectValid(opt);
if (data[item] === undefined) {
if (data[item] === void(0)) {
delete data[item];
}
break;
default:
break;
}
});
... ...