Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
shuaiguo
5 years ago
Commit
bdd3100aa64086f68a4149bc5cc723dd0df3d692
2 parents
00516b88
b773aaac
Merge branch 'refs/heads/master' into feature/company-profile
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
111 additions
and
44 deletions
apps/home/models/orders-service.js
apps/home/views/action/home/orders/order-detail.hbs
apps/home/views/partial/home/orders/order-block.hbs
apps/passport/models/login-service.js
apps/product/models/detail-service.js
apps/product/views/partial/product/color-list.hbs
apps/product/views/partial/product/detail-header.hbs
apps/product/views/partial/product/size-list.hbs
package.json
public/js/common.js
public/scss/product/_detail.css
apps/home/models/orders-service.js
View file @
bdd3100
...
...
@@ -423,6 +423,8 @@ module.exports = class extends global.yoho.BaseModel {
newGood
.
name
=
good
.
product_name
;
newGood
.
color
=
good
.
factory_color_name
;
newGood
.
size
=
good
.
size_name
;
newGood
.
colorAttr
=
_
.
get
(
good
,
'sale_attr_desc.skc_attr'
);
newGood
.
sizeAttr
=
_
.
get
(
good
,
'sale_attr_desc.sku_attr'
);
newGood
.
skuTitle
=
good
.
sku_title
||
'尺码'
;
newGood
.
price
=
that
.
transPrice
(
good
.
sales_price
);
// 默认显示销售价
newGood
.
isVipPrice
=
good
.
discount_tag
===
'V'
;
...
...
@@ -860,6 +862,8 @@ module.exports = class extends global.yoho.BaseModel {
name
:
good
.
product_name
,
color
:
good
.
factory_color_name
,
size
:
good
.
size_name
,
colorAttr
:
_
.
get
(
good
,
'sale_attr_desc.skc_attr'
),
sizeAttr
:
_
.
get
(
good
,
'sale_attr_desc.sku_attr'
),
skuTitle
:
good
.
sku_title
||
'尺码'
,
price
:
that
.
transPrice
(
good
.
sales_price
),
// 默认显示销售价
isVipPrice
:
good
.
discount_tag
===
'V'
,
...
...
apps/home/views/action/home/orders/order-detail.hbs
View file @
bdd3100
...
...
@@ -237,25 +237,16 @@
</a>
<p
class=
"name-color-size"
>
<a
class=
"name"
href=
"
{{
url
}}
"
target=
"_blank"
>
{{
name
}}
</a>
{{#if
..
/
virtualGood
}}
{{#if
color
}}
日期:
{{
color
}}
{{/if}}
{{#if
size
}}
区域:
{{
size
}}
{{/if}}
{{else}}
{{#if
color
}}
<b
title=
"
{{
color
}}
"
>
颜色:
{{
color
}}
</b>
{{/if}}
{{#if
color
}}
<b
title=
"
{{
color
}}
"
>
{{#if
colorAttr
}}{{
colorAttr
}}{{else}}
颜色:
{{
color
}}{{/if}}
</b>
{{/if}}
{{#if
size
}}
{{
skuTitle
}}
:
{{
size
}}
{{/if}}
{{#if
size
}}
{{#if
sizeAttr
}}{{
sizeAttr
}}{{else}}{{
skuTitle
}}
:
{{
size
}}{{/if}}
{{/if}}
{{#if
date
}}
{{#if
date
}}
日期:
{{
date
}}
{{/if}}
{{/if}}
</p>
</td>
...
...
apps/home/views/partial/home/orders/order-block.hbs
View file @
bdd3100
...
...
@@ -37,25 +37,16 @@
{{/if}}
<a
class=
"name"
href=
"
{{
href
}}
"
target=
"_blank"
>
{{
name
}}
</a>
<span
class=
"color-size"
>
{{#if
virtualGood
}}
{{#if
color
}}
日期:
{{
color
}}
{{/if}}
{{#if
size
}}
区域:
{{
size
}}
{{/if}}
{{else}}
{{#if
color
}}
<b
title=
"
{{
color
}}
"
>
颜色:
{{
color
}}
</b>
{{/if}}
{{#if
size
}}
{{
skuTitle
}}
:
{{
size
}}
{{/if}}
{{#if
arrivalDate
}}
<i
class=
"arrival-date"
>
上市期:
{{
arrivalDate
}}
</i>
{{/if}}
{{#if
color
}}
<b
title=
"
{{
color
}}
"
>
{{#if
colorAttr
}}{{
colorAttr
}}{{else}}
颜色:
{{
color
}}{{/if}}
</b>
{{/if}}
{{#if
size
}}
{{#if
sizeAttr
}}{{
sizeAttr
}}{{else}}{{
skuTitle
}}
:
{{
size
}}{{/if}}
{{/if}}
{{#if
arrivalDate
}}
<i
class=
"arrival-date"
>
上市期:
{{
arrivalDate
}}
</i>
{{/if}}
</span>
</div>
...
...
apps/passport/models/login-service.js
View file @
bdd3100
'use strict'
;
const
request
=
require
(
'request-promise'
);
const
md5
=
require
(
'md5'
);
const
uuid
=
require
(
'uuid'
);
const
_
=
require
(
'lodash'
);
...
...
@@ -20,6 +21,34 @@ const UserService = require('./user-service');
const
LoginApi
=
require
(
'./login-api'
);
const
logger
=
global
.
yoho
.
logger
;
class
BaiduSDK
{
/*
* @ description: 广告主回传转化数据接口, 上报百度
* @ author: huzhiming
* @ date: 2019-11-19 17:21:29
* @ version: v1.0.0
* 详情见文档:[http://ocpc.baidu.com/developer/d/guide/?iurl=api%2Fapi-doc%2Fapi-interface%2F]
*/
static
reportOcpcApi
({
token
=
'7GULUkX90QLZU6cHO9OEqUsRKttGNqpN@O62eFfb91OUVhmkakV1bQHIxF8xURBvP'
,
conversionTypes
=
[{
logidUrl
:
''
,
newType
:
null
}]
})
{
request
({
method
:
'POST'
,
uri
:
'http://ocpc.baidu.com/ocpcapi/api/uploadConvertData'
,
body
:
{
token
,
conversionTypes
},
json
:
true
}).
then
((
result
)
=>
{
console
.
log
(
`
[
账号注册成功后上报
百度
ocpc
返回信息:
$
{
JSON
.
stringify
(
result
)}
`
);
}).
catch
((
error
)
=>
{
console
.
log
(
`
[
账号注册成功后上报
百度
ocpc
失败
错误信息:
$
{
error
}
`
);
});
}
}
module
.
exports
=
class
extends
global
.
yoho
.
BaseModel
{
constructor
(
ctx
)
{
super
(
ctx
);
...
...
@@ -125,6 +154,23 @@ module.exports = class extends global.yoho.BaseModel {
domain
:
config
.
cookieDomain
});
/*
* @ description: feat(oCPC搜索推广): 推广链接转化数据发送给百度服务器,埋点:OCPC推广链接打开并完成注册进行数据上报
* @ author: huzhiming
* @ date: 2019-11-19 19:09:39
* @ version: v1.0.0
* bd_vid_path存值见:public/js/common.js 文件
*/
const
logidUrl
=
req
.
cookies
.
bd_vid_path
;
if
(
logidUrl
)
{
BaiduSDK
.
reportOcpcApi
({
conversionTypes
:
{
logidUrl
,
newType
:
25
}
});
}
req
.
session
.
TOKEN_
=
publicToken
;
req
.
session
.
LOGIN_UID_
=
uid
;
...
...
apps/product/models/detail-service.js
View file @
bdd3100
...
...
@@ -1050,7 +1050,10 @@ function _detailDataPkg(origin, uid, vipLevel, cookies) {
result
.
shopId
=
propOrigin
(
'shop_id'
,
0
);
result
.
brandId
=
propOrigin
(
'brand_info.brand_id'
,
''
);
result
.
brandName
=
propOrigin
(
'brand_info.brand_name'
,
''
);
result
.
skcTitle
=
propOrigin
(
'skcTitle'
,
'颜色'
);
result
.
skcTitleLength
=
result
.
skcTitle
.
length
;
result
.
skuTitle
=
propOrigin
(
'skuTitle'
,
'尺码'
);
result
.
skuTitleLength
=
result
.
skuTitle
.
length
;
result
.
maxSortId
=
propOrigin
(
'maxSortId'
,
''
);
result
.
smallSortId
=
propOrigin
(
'smallSortId'
,
''
);
...
...
apps/product/views/partial/product/color-list.hbs
View file @
bdd3100
<div
class=
"chose-color row clearfix"
>
<span
class=
"title pull-left"
>
颜
色
:
</span>
<span
class=
"title pull-left"
>
<i
class=
"skc-label label-size-
{{
skcTitleLength
}}
"
>
{{
skcTitle
}}
</i>
:
</span>
<ul
class=
"colors pull-left clearfix"
>
{{#
each
colors
}}
<li
class=
"
{{#if
focus
}}
focus
{{/if}}
{{#if
disable
}}
disable
{{/if}}
pull-left"
...
...
apps/product/views/partial/product/detail-header.hbs
View file @
bdd3100
...
...
@@ -89,12 +89,8 @@
<div
class=
"trade-content"
>
<div
id=
"type-chose"
class=
"type-chose"
>
{{#if
virtualGoods
}}
{{>
product
/
yohood-tick
}}
{{else}}
{{>
product
/
color-list
}}
{{>
product
/
size-list
}}
{{/if}}
{{>
product
/
color-list
}}
{{>
product
/
size-list
}}
<div
class=
"chose-count row clearfix"
>
<span
class=
"title pull-left"
>
数
量:
</span>
...
...
apps/product/views/partial/product/size-list.hbs
View file @
bdd3100
<div
class=
"chose-size row clearfix"
>
<span
class=
"title pull-left"
><i
class=
"sku-label"
>
{{
skuTitle
}}
</i>
:
</span>
<span
class=
"title pull-left"
><i
class=
"sku-label
label-size-
{{
skuTitleLength
}}
"
>
{{
skuTitle
}}
</i>
:
</span>
<div
id=
"sizes"
class=
"size-wrapper pull-left"
>
{{#
each
colors
}}
...
...
package.json
View file @
bdd3100
{
"name"
:
"yohobuy-node"
,
"version"
:
"6.9.1
0
"
,
"version"
:
"6.9.1
1
"
,
"private"
:
true
,
"description"
:
"A New Yohobuy Project With Express"
,
"repository"
:
{
...
...
public/js/common.js
View file @
bdd3100
...
...
@@ -130,6 +130,17 @@ function getShoppingKey() {
if
(
window
.
_yas
)
{
window
.
_yas
(
1
*
new
Date
(),
window
.
_yasVersion
,
'yohobuy_web'
,
uid
,
''
,
''
);
}
/* 【加入ocpcApi代码】: 判断当前页面地址若百度sem推广链接,即将推广链接存到cookies,支付成功后将推广链接上报百度 ocpcapi
* @ description: 收集百度sem推广链接
* @ author: huzhiming
* @ date: 2019-11-18 16:55:17
* @ version: v1.0.0
* 详情见文档:[http://ocpc.baidu.com/developer/d/guide/?iurl=api%2Fapi-doc%2Fapi-interface%2F]
*/
if
(
location
.
href
.
includes
(
'bd_vid='
))
{
setCookie
(
'bd_vid_path'
,
location
.
href
,
{
path
:
'/'
,
domain
:
'.yohobuy.com'
,
expires
:
90
});
}
}());
// window.resize在width<1180时适配成990
...
...
public/scss/product/_detail.css
View file @
bdd3100
...
...
@@ -2668,6 +2668,23 @@
margin-top
:
14px
;
}
.skc-label
{
letter-spacing
:
22px
;
width
:
54px
;
display
:
inline-block
;
overflow
:
hidden
;
white-space
:
nowrap
;
vertical-align
:
middle
;
}
.label-size-3
{
letter-spacing
:
5px
;
}
.label-size-4
{
letter-spacing
:
0
;
}
img
{
float
:
left
;
display
:
inline-block
;
...
...
@@ -2718,6 +2735,14 @@
vertical-align
:
middle
;
}
.label-size-3
{
letter-spacing
:
5px
;
}
.label-size-4
{
letter-spacing
:
0
;
}
li
{
float
:
left
;
display
:
block
;
...
...
Please
register
or
login
to post a comment