Authored by htoooth

Merge remote-tracking branch 'origin/master' into feature/yoluck

... ... @@ -20,15 +20,17 @@ exports.promotion = (req, res, next) => {
let uid = req.user.uid,
isApp = req.yoho.isApp,
contentCode = 'b2b5cde8144aff3073573c3b323344ab';
let userAgent = req.get('User-Agent') || '';
let isWx = Boolean(userAgent.match(/MicroMessenger/i) && userAgent.match(/MicroMessenger/i).length > 0);
req.ctx(expandModel).promotionData(uid, isApp, contentCode).then(result => {
result.isApp = !isWx && isApp;
res.render('expand-new/my-promotion', {
pageHeader: headerModel.setNav({
navTitle: '邀请好友',
navBtn: false,
myReward: true
}),
isApp: isApp,
width750: true,
localCss: true,
title: '邀请好友',
... ...
... ... @@ -82,12 +82,34 @@ class featureModel extends global.yoho.BaseModel {
vipBgColor: value.vipBgColor,
showVipPrice: value.showVipPrice,
brandImg: value.brandImg,
showBrandUrl: value.showBrandUrl
showBrandUrl: value.showBrandUrl,
isAdvance: value.isAdvance,
advanceBgImg: value.advanceBgImg,
leftDownImg: value.leftDownImg
};
value._defaultSkns && value._defaultSkns.forEach(val => {
let pro = resList[val];
if (baseConf.isAdvance === '1') {
let plan = pro.product_price_plan_list;
if (plan.length) {
let time = Math.round(new Date() / 1000);
let effectPlan = [];
plan.forEach(planItem => {
if (planItem.effect_time > time) {
effectPlan.push(planItem);
}
});
if (effectPlan.length && time > effectPlan[0].show_begin_time && effectPlan[0].show_status === 1) { // eslint-disable-line
pro.curPlanPrice = effectPlan[0].current_saleprice;
}
}
}
if (pro) {
defaultPros.push(Object.assign({conf: baseConf}, pro));
}
... ...
'use strict';
const _ = require('lodash');
let _getProduct = function(o) {
return {
let plan = o.product_price_plan_list;
let res = {
small_sort_id: o.small_sort_id,
middle_sort_id: o.middle_sort_id,
max_sort_id: o.max_sort_id,
... ... @@ -21,6 +23,29 @@ let _getProduct = function(o) {
default_images: o.default_images,
goods_id: Array.isArray(o.goods_list) && o.goods_list.length ? o.goods_list[0].goods_id : void 0
};
plan = _.sortBy(plan, item => {
return +item.show_begin_time;
});
if (plan.length) {
let time = Math.round(new Date() / 1000);
let effectPlan = [];
plan.forEach(planItem => {
if (planItem.effect_time > time) {
effectPlan.push(planItem);
}
});
if (effectPlan.length && time > effectPlan[0].show_begin_time && effectPlan[0].show_status === 1) { // eslint-disable-line
o.curPlanPrice = effectPlan[0].current_saleprice;
_.assign(res, {curPlanPrice: effectPlan[0].current_saleprice});
}
}
return res;
};
const gender = {
... ...
... ... @@ -27,11 +27,14 @@
<span class="modify button">修改</span>
{{#if isApp}}
<a class="copy button" href='//m.yohobuy.com/?openby:yohobuy={"action":"go.copy","params":{"text":"{{copyCode}}","message":"复制成功"}}'>复制</a>
{{else}}
<a class="copy button" id="copy" data-code="{{copyCode}}">复制</a>
{{/if}}
</div>
<p class="info">1.复制您的潮流口令 2.粘贴给您的朋友(微信/短信等方式)</p>
</div>
</div>
{{#if isApp}}
<div class="invite-link invitation">
<div class="title">方法三:使用邀请链接</div>
<div class="code-content">
... ... @@ -43,7 +46,7 @@
</div>
<p class="link-info">
<span class="info">1.复制您的邀请链接 2.选择您的社交平台 3.粘贴给您的朋友</span>
</p>
</div>
</div>
... ... @@ -56,7 +59,7 @@
</p>
</div>
</div>
{{/if}}
<input id="shareLink" type="hidden" value="{{shareUrl}}">
<input id="shareImg" type="hidden" value="{{sharePic}}">
<input id="shareTitle" type="hidden" value="{{shareMainTitle}}">
... ...
... ... @@ -151,6 +151,10 @@
{{> feature/timed-cut-product}}
{{/isEqualOr}}
{{#isEqualOr type 'redPacket'}}
{{! 红包领取}}
{{> feature/red-packet}}
{{/isEqualOr}}
{{#isEqualOr type 'likedActivity'}}
{{! 点赞楼层}}
{{> feature/liked-activity}}
... ...
... ... @@ -22,6 +22,17 @@
<a class="new-brand-name {{#isEqualOr showBrandUrl '1'}}product-brand{{else}}product-detail{{/isEqualOr}}" href="">
<span class="brand-name" {{#if fontColor}} style="color:{{fontColor}};" {{/if}}></span>
</a>
<div class="sales-imgs-new">
{{#isEqualOr isAdvance '1'}}
<div class="advance" style="background-image: url({{advanceBgImg}});">
<img src="{{advanceBgImg}}" class="img-seat">
<span class="advance-price"></span>
</div>
{{/isEqualOr}}
{{#if leftDownImg}}
<img class="leftdownimg lazy" data-original="{{image2 leftDownImg q=85}}">
{{/if}}
</div>
</div>
</a>
{{#if brandImg}}
... ...
... ... @@ -8,6 +8,19 @@
<img class="rigtopimg lazy" data-original="{{image2 conf.rigTopImg q=85}}">
{{/if}}
<img class="product-detail-img lazy" data-original="{{image2 productimg q=85}}">
<div class="sales-imgs-old">
{{#isEqualOr conf.isAdvance '1'}}
{{#if curPlanPrice}}
<div class="advance" style="background-image: url({{conf.advanceBgImg}});">
<img src="{{conf.advanceBgImg}}" class="img-seat">
<span class="advance-price">¥{{curPlanPrice}}</span>
</div>
{{/if}}
{{/isEqualOr}}
{{#if conf.leftDownImg}}
<img class="leftdownimg lazy" data-original="{{image2 conf.leftDownImg q=85}}">
{{/if}}
</div>
</div>
{{#isEqualOr conf.showPrdName '1'}}
<p class="product-name">{{productname}}</p>
... ...
... ... @@ -19,6 +19,17 @@
<img class="rigtopimg" src="{{image2 rigTopImg q=85}}">
{{/if}}
<img class="product-detail-img lazy" src="">
<div class="sales-imgs-old sales-product-pool">
{{#isEqualOr isAdvance '1'}}
<div class="advance" style="background-image: url({{advanceBgImg}});">
<img src="{{advanceBgImg}}" class="img-seat">
<span class="advance-price"></span>
</div>
{{/isEqualOr}}
{{#if leftDownImg}}
<img class="leftdownimg lazy" data-original="{{image2 leftDownImg q=85}}">
{{/if}}
</div>
</div>
{{#isEqualOr showPrdName '1'}}
<p class="product-name"></p>
... ...
<a class="redenvelope yoho-redenvelope" href="javascript:;" data-token="{{redPacketToken}}">
</a>
... ...
<div class="shop-container{{#isEqualOr numOfOneRow '2'}} shop-two{{^}} shop-three{{/isEqualOr}}">
{{#renderData}}
{{#isEqualOr ../numOfOneRow '2'}}
<a{{#isEqualOr ../jump2Shop '1'}} href="{{href}}"{{/isEqualOr}}class="pull-left shop-box">
<a{{#isEqualOr ../jump2Shop '1'}} href="{{href}}"{{/isEqualOr}} class="pull-left shop-box">
<div class="shop-img">
{{#if ../lefTopImg}}
<img class="left-icon lazy" data-original="{{image2 ../lefTopImg q=85}}" alt="">
{{/if}}
<img class="lazy" data-original="{{image2 picture w=284 h=320 q=85}}" alt="">
<img class="lazy" data-original="{{image2 picture w=268 h=224 q=85}}" alt="">
</div>
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=290 h=60 q=85}})">
<span class="shop-name">{{shop_name}}</span>
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=268 h=60 q=85}})">
<span class="shop-name" style="{{#if ../shopNameFontColor}}color: {{../shopNameFontColor}}{{/if}}">{{shop_name}}</span>
</div>
</a>
{{^}}
<a{{#isEqualOr ../jump2Shop '1'}} href="{{href}}"{{/isEqualOr}}class="pull-left shop-box">
<a{{#isEqualOr ../jump2Shop '1'}} href="{{href}}"{{/isEqualOr}} class="pull-left shop-box">
<div class="shop-img">
<img class="left-icon lazy" data-original="{{image2 ../lefTopImg q=85}}" alt="">
<img class="lazy" data-original="{{image2 picture w=188 h=210 q=85}}" alt="">
{{#if ../lefTopImg}}
<img class="left-icon lazy" data-original="{{image2 ../lefTopImg q=85}}" alt="">
{{/if}}
<img class="lazy" data-original="{{image2 picture w=186 h=156 q=85}}" alt="">
</div>
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=290 h=60 q=85}});">
<span class="shop-name">{{shop_name}}</span>
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=186 h=40 q=85}});">
<span class="shop-name" style="{{#if ../shopNameFontColor}}color: {{../shopNameFontColor}}{{/if}}">{{shop_name}}</span>
</div>
</a>
{{/isEqualOr}}
... ...
... ... @@ -131,7 +131,7 @@ module.exports = {
notifyUrl: domains.service + 'payment/weixin_notify',
},
geetestJs: '//static.geetest.com/static/tools/gt.js',
jsSdk: '//cdn.yoho.cn/js-sdk/1.3.10/jssdk.js',
jsSdk: '//cdn.yoho.cn/js-sdk/1.3.16/jssdk.js',
redis: {
connect: {
host: '192.168.102.49',
... ...
{
"name": "yohobuywap-node",
"version": "6.8.31",
"version": "6.8.33",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -3,21 +3,25 @@
{{#is-equal-or ../numOfOneRow '2'}}
<a href="{{href}}" class="pull-left shop-box">
<div class="shop-img">
<img class="left-icon lazy" data-original="{{image2 ../lefTopImg q=85}}" alt="">
<img class="lazy" data-original="{{image2 shop_logo w=187 h=275 q=85}}" alt="">
{{#if ../lefTopImg}}
<img class="left-icon lazy" data-original="{{image2 ../lefTopImg q=85}}" alt="">
{{/if}}
<img class="lazy" data-original="{{image2 shop_logo w=268 h=224 q=85}}" alt="">
</div>
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=290 h=60 q=85}})">
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=268 h=60 q=85}})">
<span class="shop-name" style="{{#if ../shopNameFontColor}}color: {{../shopNameFontColor}}{{/if}}">{{shop_name}}</span>
</div>
</a>
{{^}}
<a href="{{href}}" class="pull-left shop-box {{#is-equal-or ../displayStyle '0'}}shop-logo{{/is-equal-or}}">
<div class="shop-img">
<img class="left-icon lazy" data-original="{{image2 ../lefTopImg q=85}}" alt="">
<img class="lazy" data-original="{{image2 shop_logo w=156 h=106 q=85}}" {{#is-equal-or ../displayStyle '0'}}class="shop-logo-img lazy"{{/is-equal-or}} alt="">
{{#if ../lefTopImg}}
<img class="left-icon lazy" data-original="{{image2 ../lefTopImg q=85}}" alt="">
{{/if}}
<img class="lazy" data-original="{{image2 shop_logo w=186 h=156 q=85}}" {{#is-equal-or ../displayStyle '0'}}class="shop-logo-img lazy"{{/is-equal-or}} alt="">
<span class="shop-name" style="{{#if ../shopNameFontColor}}color: {{../shopNameFontColor}}{{/if}}">{{shop_name}}</span>
</div>
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=290 h=60 q=85}});">
<div class="shop-bottom-bar" style="background-image: url({{image2 ../brandImg w=186 h=40 q=85}});">
</div>
</a>
{{/is-equal-or}}
... ...
'use strict';
require('scss/activity/my-promotion.page.scss');
import Clipboard from 'clipboard';
import tip from 'js/plugin/tip';
let $ = require('yoho-jquery'),
yoho = require('js/yoho-app');
... ... @@ -49,6 +51,23 @@ if (yoho.isApp) {
});
});
}
$('#copy').click(function() {
let code = $(this).data('code');
let clipboard = new Clipboard('#copy', {
text: function() {
return code;
}
});
clipboard.on('success', function(e) {
e.clearSelection();
tip.show('复制成功');
});
clipboard.on('error', function() {
tip.show('复制失败');
});
});
// 修改潮流口令
$('.modify').click(function() {
... ...
... ... @@ -118,7 +118,7 @@
.invite-content {
.code {
width: 324px;
width: 324px !important;
height: 68px;
display: block;
background-color: #fff;
... ...
... ... @@ -6,6 +6,7 @@
@import "scss/feature/shop";
@import "scss/feature/bottom";
@import "scss/feature/timed-cut";
@import "scss/feature/redenvelope";
@import "scss/feature/liked-activity";
/* stylelint-disable */
... ...
... ... @@ -85,6 +85,30 @@
}
}
&.item3 .feature-product-info {
.sales-imgs-old {
bottom: 24px;
font-size: 0;
}
.leftdownimg {
height: 22px;
}
.advance {
height: 30px;
.advance-price {
font-size: 20px;
line-height: 32px;
}
.img-seat {
height: 30px;
}
}
}
.product-source {
display: block;
overflow: hidden;
... ... @@ -167,6 +191,69 @@
color: #000;
}
.sales-imgs-old {
position: absolute;
right: 0;
bottom: 28px;
width: 100%;
height: auto;
z-index: 1;
}
.sales-imgs-new {
position: absolute;
right: 0;
bottom: 55px;
width: 100%;
height: auto;
z-index: 1;
.advance {
display: none;
}
}
.sales-product-pool {
.advance {
display: none;
}
}
.leftdownimg {
width: auto;
max-width: 100%;
height: 30px;
margin-top: 10px;
}
.advance {
width: auto;
height: 35px;
max-width: 100%;
background-size: contain;
background-repeat: no-repeat;
text-align: right;
display: inline-block;
position: relative;
.img-seat {
visibility: hidden;
height: 35px;
display: inline-block;
width: auto;
}
.advance-price {
position: absolute;
right: 10px;
top: 0;
line-height: 35px;
font-size: 27px;
font-weight: bold;
color: #fff;
}
}
.vip-price-text {
margin-right: 10px;
font-weight: 500;
... ...
.redenvelope {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
... ...
$margin-top: 42px;
$margin-left-2: 20px;
$margin-left-3: 19.75px;
$floor-height-2: 432px;
$floor-height-3: 335px;
$shop-width-2: 285px;
$shop-width-3: 187px;
$margin-left-2: 15px;
$padding-left-2: 45px;
$margin-left-3: 34px;
$floor-height-2: 281px;
$floor-height-3: 196px;
$shop-width-2: 268px;
$shop-width-3: 186px;
$margin-right-3: 7px;
.shop-container {
width: 100%;
... ... @@ -54,19 +56,19 @@ $shop-width-3: 187px;
}
&.shop-two {
padding-left: $margin-left-2;
padding-left: $padding-left-2;
margin-top: $margin-top;
.shop-box {
width: $shop-width-2;
height: $floor-height-2;
margin-right: $margin-left-2;
margin-bottom: 40px;
margin-bottom: 26px;
display: inline-block;
.shop-img {
width: $shop-width-2;
height: 372px;
height: 224px;
}
.shop-bottom-bar {
... ... @@ -87,19 +89,19 @@ $shop-width-3: 187px;
.shop-box {
width: $shop-width-3;
height: $floor-height-3;
margin-right: $margin-left-3;
margin-bottom: 40px;
margin-right: $margin-right-3;
margin-bottom: 16px;
display: inline-block;
.shop-img {
width: $shop-width-3;
height: 275px;
height: 156px;
}
.shop-bottom-bar {
width: 187px;
height: 60px;
line-height: 60px;
width: 186px;
height: 40px;
line-height: 40px;
color: #fff;
background-size: 100% 100%;
background-repeat: no-repeat;
... ... @@ -137,7 +139,7 @@ $shop-width-3: 187px;
height: auto;
.shop-img {
height: 320px;
height: 224px;
}
}
}
... ... @@ -146,17 +148,17 @@ $shop-width-3: 187px;
padding-left: 32px;
.shop-box {
width: 184px;
width: 186px;
height: auto;
margin-right: 8px;
margin-bottom: 20px;
margin-right: 7px;
margin-bottom: 16px;
.shop-bottom-bar {
height: 40px;
}
.shop-img {
height: 210px;
height: 156px;
}
}
... ... @@ -176,9 +178,9 @@ $shop-width-3: 187px;
.shop-logo-img {
position: relative;
width: 132px;
height: 88px;
height: 92px;
left: 26px;
top: 20px;
top: 17px;
}
}
}
... ...