Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
zhangxiaoru
8 years ago
Commit
66df000df989fde11e1d365757c8f53e94f38eff
2 parents
f4b3a216
c4e2af03
merge
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
67 additions
and
51 deletions
apps/guang/controllers/info.js
apps/home/models/orderDetail.js
apps/product/models/detail.js
config/common.js
doraemon/middleware/page-cache.js
package.json
public/js/common.js
public/js/footer.js
public/js/guang/plusstar-index.page.js
apps/guang/controllers/info.js
View file @
66df000
...
...
@@ -108,40 +108,45 @@ const _pageArticleContent = (articleContent, isApp, gender) => {
let
callArtGoodGroup
=
(
ii
,
len2
)
=>
{
if
(
ii
<
len2
)
{
let
goods
=
art
.
goodsGroup
.
data
[
ii
];
let
good
=
{
thumb
:
goods
.
cover
?
helpers
.
image
(
goods
.
cover
.
cover
,
235
,
314
)
:
''
,
type
:
goods
.
cover
?
guangProcess
.
getProductIcon
(
goods
.
cover
.
maxSortId
)
:
''
,
goods
:
[]
};
let
skns
=
[];
let
arr
=
[];
goods
.
list
.
forEach
((
mini
)
=>
{
skns
.
push
(
mini
.
id
);
arr
[
mini
.
id
]
=
mini
.
src
;
});
// 通过SKN获取商品信息
productDetailModel
.
productInfoBySkns
(
skns
).
then
((
product
)
=>
{
if
(
product
&&
product
.
data
&&
product
.
data
.
product_list
)
{
let
g
=
[];
product
.
data
.
product_list
.
forEach
(
_
=>
{
g
.
push
(
guangProcess
.
formatProduct
(
_
,
false
,
true
,
true
,
235
,
314
,
isApp
,
gender
));
});
g
.
forEach
(
p
=>
{
if
(
arr
[
p
.
id
])
{
p
.
thumb
=
helpers
.
image
(
arr
[
p
.
id
],
235
,
314
);
good
.
goods
.
push
(
p
);
if
(
goods
)
{
let
good
=
{
thumb
:
goods
.
cover
?
helpers
.
image
(
goods
.
cover
.
cover
,
235
,
314
)
:
''
,
type
:
goods
.
cover
?
guangProcess
.
getProductIcon
(
goods
.
cover
.
maxSortId
)
:
''
,
goods
:
[]
};
let
skns
=
[];
let
arr
=
[];
goods
.
list
.
forEach
((
mini
)
=>
{
skns
.
push
(
mini
.
id
);
arr
[
mini
.
id
]
=
mini
.
src
;
});
// 通过SKN获取商品信息
productDetailModel
.
productInfoBySkns
(
skns
).
then
((
product
)
=>
{
if
(
product
&&
product
.
data
&&
product
.
data
.
product_list
)
{
let
g
=
[];
product
.
data
.
product_list
.
forEach
(
_
=>
{
g
.
push
(
guangProcess
.
formatProduct
(
_
,
false
,
true
,
true
,
235
,
314
,
isApp
,
gender
));
});
g
.
forEach
(
p
=>
{
if
(
arr
[
p
.
id
])
{
p
.
thumb
=
helpers
.
image
(
arr
[
p
.
id
],
235
,
314
);
good
.
goods
.
push
(
p
);
}
});
if
(
!
build
.
collocation
)
{
build
.
collocation
=
[];
}
});
if
(
!
build
.
collocation
)
{
build
.
collocation
=
[];
build
.
collocation
.
push
(
good
);
}
build
.
collocation
.
push
(
good
);
}
callArtGoodGroup
(
++
ii
,
len2
);
});
}
else
{
callArtGoodGroup
(
++
ii
,
len2
);
});
}
}
else
{
contents
.
push
(
build
);
joinContentFunc
(
++
i
,
len
);
...
...
apps/home/models/orderDetail.js
View file @
66df000
...
...
@@ -64,7 +64,7 @@ const _getOrderStatus = (order, showLogistics) => {
/* 待付款 */
Object
.
assign
(
result
,
{
unpaid
:
true
,
payUrl
:
helpers
.
urlFormat
(
'/home/orders/pay'
,
{
order_code
:
order
.
order
_c
ode
})
payUrl
:
helpers
.
urlFormat
(
'/home/orders/pay'
,
{
order_code
:
order
.
order
C
ode
})
});
break
;
case
1
:
...
...
@@ -87,7 +87,7 @@ const _getOrderStatus = (order, showLogistics) => {
/* 是否门票 */
if
(
order
.
virtualType
&&
parseInt
(
order
.
virtualType
,
10
)
===
3
)
{
Object
.
assign
(
result
,
{
qrcode
:
helpers
.
urlFormat
(
`
/
home
/
QRcode
/
$
{
order
.
order
_c
ode
}
`
)
qrcode
:
helpers
.
urlFormat
(
`
/
home
/
QRcode
/
$
{
order
.
order
C
ode
}
`
)
});
}
else
{
Object
.
assign
(
result
,
_assignExpressInfo
(
showLogistics
,
order
));
...
...
@@ -103,7 +103,7 @@ const _getOrderStatus = (order, showLogistics) => {
/* 是否门票 */
if
(
order
.
virtual_type
&&
parseInt
(
order
.
virtual_type
,
10
)
===
3
)
{
Object
.
assign
(
result
,
{
qrcode
:
helpers
.
urlFormat
(
`
/
home
/
QRcode
/
$
{
order
.
order
_c
ode
}
`
)
qrcode
:
helpers
.
urlFormat
(
`
/
home
/
QRcode
/
$
{
order
.
order
C
ode
}
`
)
});
}
else
{
Object
.
assign
(
result
,
_assignExpressInfo
(
showLogistics
,
order
));
...
...
apps/product/models/detail.js
View file @
66df000
...
...
@@ -1511,14 +1511,16 @@ let getProductAsyncData = (data) => {
return
Promise
.
all
([
_getPromotionInfo
(
result
.
product_skn
),
_getFavorite
(
result
.
product_id
,
data
.
uid
)]).
then
((
res
)
=>
{
result
.
promotionBoList
=
res
[
0
];
var
isFavorite
=
res
[
1
];
finalResult
=
_detailDataPkgAsync
(
result
,
data
.
uid
,
data
.
vipLevel
,
data
.
ua
);
finalResult
.
isCollect
=
isFavorite
;
if
(
finalResult
.
cartInfo
)
{
finalResult
.
cartInfo
.
isCollect
=
isFavorite
;
}
finalResult
.
isStudent
=
data
.
isStudent
;
return
finalResult
;
return
_detailDataPkgAsync
(
result
,
data
.
uid
,
data
.
vipLevel
,
data
.
ua
).
then
(
pkg
=>
{
finalResult
=
pkg
;
finalResult
.
isCollect
=
isFavorite
;
if
(
finalResult
.
cartInfo
)
{
finalResult
.
cartInfo
.
isCollect
=
isFavorite
;
}
finalResult
.
isStudent
=
data
.
isStudent
;
return
finalResult
;
});
});
});
...
...
config/common.js
View file @
66df000
...
...
@@ -51,7 +51,8 @@ module.exports = {
infoFile
:
{
name
:
'info'
,
level
:
'info'
,
filename
:
'logs/info.log'
filename
:
'logs/info.log'
,
maxFiles
:
7
},
errorFile
:
{
name
:
'error'
,
...
...
doraemon/middleware/page-cache.js
View file @
66df000
...
...
@@ -45,7 +45,7 @@ module.exports = () => {
res
.
set
({
'Cache-Control'
:
'no-cache'
,
Pragma
:
'no-cache'
,
Expires
:
new
Date
(
1900
,
0
,
1
,
0
,
0
,
0
,
0
)
Expires
:
(
new
Date
(
1900
,
0
,
1
,
0
,
0
,
0
,
0
)).
toUTCString
(
)
});
}
...
...
package.json
View file @
66df000
{
"name"
:
"m-yohobuy-node"
,
"version"
:
"5.1.
2
"
,
"version"
:
"5.1.
3
"
,
"private"
:
true
,
"description"
:
"A New Yohobuy Project With Express"
,
"repository"
:
{
...
...
public/js/common.js
View file @
66df000
...
...
@@ -202,9 +202,9 @@ $.extend({
$footer
.
removeClass
(
'hide'
);
// 接受微信商城或者第三方来源的数据埋点信息
//
单击下载按钮 -
接受微信商城或者第三方来源的数据埋点信息
if
(
queryString
().
mkt_code
)
{
setCookie
(
'
mkt_cod
e'
,
queryString
().
mkt_code
);
setCookie
(
'
unionTyp
e'
,
queryString
().
mkt_code
);
}
}());
...
...
public/js/footer.js
View file @
66df000
...
...
@@ -25,16 +25,24 @@ function getQueryString(name) {
}
function
downLoadApp
()
{
var
appUrl
=
'http://
www.yohoshow.com/about/index/yohobuyqr/
'
;
var
appUrl
=
'http://
union.yoho.cn/union/downapp.html
'
;
var
clickedAt
=
new
Date
();
setTimeout
(
function
()
{
var
mkt
=
getQueryString
(
'mkt_code'
)
;
var
mkt
=
window
.
queryString
.
mkt_code
||
window
.
cookie
(
'unionType'
)
||
false
;
if
((
new
Date
())
-
clickedAt
<
2000
)
{
if
(
mkt
)
{
appUrl
+=
'?union_type='
+
mkt
;
}
if
(
window
.
_yas
&&
window
.
_yas
.
sendCustomInfo
)
{
window
.
_yas
.
sendCustomInfo
({
op
:
'YB_DOWNLOAD_C'
,
param
:
JSON
.
stringify
({
C_ID
:
window
.
_ChannelVary
[
window
.
cookie
(
'_Channel'
)]
||
1
,
TO_URL
:
appUrl
})
},
true
);
}
window
.
location
=
appUrl
;
}
},
500
);
...
...
public/js/guang/plusstar-index.page.js
View file @
66df000
...
...
@@ -127,7 +127,7 @@ plusstar = {
TAB_ID
:
that
.
ParentLiDom
.
index
()
+
1
,
F_ID
:
$dom
.
closest
(
'ul'
).
data
(
'id'
),
F_NAME
:
'焦点图'
,
F_URL
:
$dom
.
find
(
'a'
).
attr
(
'href'
),
F_URL
:
encodeURIComponent
(
$dom
.
find
(
'a'
).
attr
(
'href'
).
replace
(
/
\"
/g
,
'\\"'
)
),
F_INDEX
:
1
,
I_INDEX
:
index
%
2
+
1
// banner,li是双倍的
},
speckParamApp
))
...
...
@@ -143,7 +143,7 @@ plusstar = {
TAB_ID
:
that
.
ParentLiDom
.
index
()
+
1
,
F_ID
:
$dom
.
data
(
'fid'
),
F_NAME
:
$dom
.
data
(
'name'
),
F_URL
:
$domA
.
attr
(
'href'
),
F_URL
:
encodeURIComponent
(
$domA
.
attr
(
'href'
).
replace
(
/
\"
/g
,
'\\"'
)
),
F_INDEX
:
$dom
.
index
()
+
1
,
I_INDEX
:
$domA
.
hasClass
(
'more'
)
?
0
:
(
$domA
.
index
()
+
1
)
},
speckParamApp
))
...
...
Please
register
or
login
to post a comment