Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
a86ec8b6
Commit
a86ec8b6
authored
Jul 05, 2018
by
Junling Bu
Browse files
[litemall-wx, litemall-wx-api]: 小商场系统调整
parent
936b5511
Changes
33
Show whitespace changes
Inline
Side-by-side
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAuthController.java
View file @
a86ec8b6
...
@@ -147,11 +147,13 @@ public class WxAuthController {
...
@@ -147,11 +147,13 @@ public class WxAuthController {
user
.
setWeixinOpenid
(
openId
);
user
.
setWeixinOpenid
(
openId
);
user
.
setAvatar
(
userInfo
.
getAvatarUrl
());
user
.
setAvatar
(
userInfo
.
getAvatarUrl
());
user
.
setNickname
(
userInfo
.
getNickName
());
user
.
setNickname
(
userInfo
.
getNickName
());
user
.
setGender
(
userInfo
.
getGender
()
==
1
?
"男"
:
"女"
);
user
.
setGender
(
userInfo
.
getGender
());
user
.
setUserLevel
(
"普通用户"
);
user
.
setUserLevel
(
(
byte
)
0
);
user
.
setStatus
(
"可用"
);
user
.
setStatus
(
(
byte
)
0
);
user
.
setLastLoginTime
(
LocalDateTime
.
now
());
user
.
setLastLoginTime
(
LocalDateTime
.
now
());
user
.
setLastLoginIp
(
IpUtil
.
client
(
request
));
user
.
setLastLoginIp
(
IpUtil
.
client
(
request
));
user
.
setAddTime
(
LocalDateTime
.
now
());
userService
.
add
(
user
);
userService
.
add
(
user
);
}
}
else
{
else
{
...
@@ -232,9 +234,9 @@ public class WxAuthController {
...
@@ -232,9 +234,9 @@ public class WxAuthController {
user
.
setWeixinOpenid
(
""
);
user
.
setWeixinOpenid
(
""
);
user
.
setAvatar
(
"https://yanxuan.nosdn.127.net/80841d741d7fa3073e0ae27bf487339f.jpg?imageView&quality=90&thumbnail=64x64"
);
user
.
setAvatar
(
"https://yanxuan.nosdn.127.net/80841d741d7fa3073e0ae27bf487339f.jpg?imageView&quality=90&thumbnail=64x64"
);
user
.
setNickname
(
username
);
user
.
setNickname
(
username
);
user
.
setGender
(
"未知"
);
user
.
setGender
(
(
byte
)
0
);
user
.
setUserLevel
(
"普通用户"
);
user
.
setUserLevel
(
(
byte
)
0
);
user
.
setStatus
(
"可用"
);
user
.
setStatus
(
(
byte
)
0
);
user
.
setLastLoginTime
(
LocalDateTime
.
now
());
user
.
setLastLoginTime
(
LocalDateTime
.
now
());
user
.
setLastLoginIp
(
IpUtil
.
client
(
request
));
user
.
setLastLoginIp
(
IpUtil
.
client
(
request
));
user
.
setAddTime
(
LocalDateTime
.
now
());
user
.
setAddTime
(
LocalDateTime
.
now
());
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCartController.java
View file @
a86ec8b6
...
@@ -65,10 +65,10 @@ public class WxCartController {
...
@@ -65,10 +65,10 @@ public class WxCartController {
BigDecimal
checkedGoodsAmount
=
new
BigDecimal
(
0.00
);
BigDecimal
checkedGoodsAmount
=
new
BigDecimal
(
0.00
);
for
(
LitemallCart
cart
:
cartList
)
{
for
(
LitemallCart
cart
:
cartList
)
{
goodsCount
+=
cart
.
getNumber
();
goodsCount
+=
cart
.
getNumber
();
goodsAmount
=
goodsAmount
.
add
(
cart
.
get
Retail
Price
().
multiply
(
new
BigDecimal
(
cart
.
getNumber
())));
goodsAmount
=
goodsAmount
.
add
(
cart
.
getPrice
().
multiply
(
new
BigDecimal
(
cart
.
getNumber
())));
if
(
cart
.
getChecked
())
{
if
(
cart
.
getChecked
())
{
checkedGoodsCount
+=
cart
.
getNumber
();
checkedGoodsCount
+=
cart
.
getNumber
();
checkedGoodsAmount
=
checkedGoodsAmount
.
add
(
cart
.
get
Retail
Price
().
multiply
(
new
BigDecimal
(
cart
.
getNumber
())));
checkedGoodsAmount
=
checkedGoodsAmount
.
add
(
cart
.
getPrice
().
multiply
(
new
BigDecimal
(
cart
.
getNumber
())));
}
}
}
}
Map
<
String
,
Object
>
cartTotal
=
new
HashMap
<>();
Map
<
String
,
Object
>
cartTotal
=
new
HashMap
<>();
...
@@ -127,32 +127,16 @@ public class WxCartController {
...
@@ -127,32 +127,16 @@ public class WxCartController {
LitemallCart
existCart
=
cartService
.
queryExist
(
goodsId
,
productId
,
userId
);
LitemallCart
existCart
=
cartService
.
queryExist
(
goodsId
,
productId
,
userId
);
if
(
existCart
==
null
){
if
(
existCart
==
null
){
//取得规格的信息,判断规格库存
//取得规格的信息,判断规格库存
if
(
product
==
null
||
number
>
product
.
get
Goods
Number
()
){
if
(
product
==
null
||
number
>
product
.
getNumber
()
){
return
ResponseUtil
.
fail
(
400
,
"库存不足"
);
return
ResponseUtil
.
fail
(
400
,
"库存不足"
);
}
}
Integer
[]
ids
=
product
.
getGoodsSpecificationIds
();
String
goodsSpecificationValue
=
null
;
for
(
Integer
id
:
ids
){
LitemallGoodsSpecification
goodsSpecification
=
goodsSpecificationService
.
findById
(
id
);
if
(
goodsSpecification
==
null
||
!
goodsSpecification
.
getGoodsId
().
equals
(
goodsId
)){
return
ResponseUtil
.
badArgument
();
}
if
(
goodsSpecificationValue
==
null
){
goodsSpecificationValue
=
goodsSpecification
.
getValue
();
}
else
{
goodsSpecificationValue
=
goodsSpecificationValue
+
" "
+
goodsSpecification
.
getValue
();
}
}
cart
.
setId
(
null
);
cart
.
setId
(
null
);
cart
.
setGoodsSn
(
goods
.
getGoodsSn
());
cart
.
setGoodsSn
(
goods
.
getGoodsSn
());
cart
.
setGoodsName
((
goods
.
getName
()));
cart
.
setGoodsName
((
goods
.
getName
()));
cart
.
setPicUrl
(
goods
.
getPrimaryPicUrl
());
cart
.
setPicUrl
(
goods
.
getPicUrl
());
cart
.
setRetailPrice
(
product
.
getRetailPrice
());
cart
.
setPrice
(
product
.
getPrice
());
cart
.
setGoodsSpecificationIds
(
product
.
getGoodsSpecificationIds
());
cart
.
setSpecifications
(
product
.
getSpecifications
());
cart
.
setGoodsSpecificationValues
(
goodsSpecificationValue
);
cart
.
setUserId
(
userId
);
cart
.
setUserId
(
userId
);
cart
.
setChecked
(
true
);
cart
.
setChecked
(
true
);
cartService
.
add
(
cart
);
cartService
.
add
(
cart
);
...
@@ -160,7 +144,7 @@ public class WxCartController {
...
@@ -160,7 +144,7 @@ public class WxCartController {
else
{
else
{
//取得规格的信息,判断规格库存
//取得规格的信息,判断规格库存
int
num
=
existCart
.
getNumber
()
+
number
;
int
num
=
existCart
.
getNumber
()
+
number
;
if
(
num
>
product
.
get
Goods
Number
()){
if
(
num
>
product
.
getNumber
()){
return
ResponseUtil
.
fail
(
400
,
"库存不足"
);
return
ResponseUtil
.
fail
(
400
,
"库存不足"
);
}
}
existCart
.
setNumber
((
short
)
num
);
existCart
.
setNumber
((
short
)
num
);
...
@@ -215,32 +199,16 @@ public class WxCartController {
...
@@ -215,32 +199,16 @@ public class WxCartController {
LitemallCart
existCart
=
cartService
.
queryExist
(
goodsId
,
productId
,
userId
);
LitemallCart
existCart
=
cartService
.
queryExist
(
goodsId
,
productId
,
userId
);
if
(
existCart
==
null
){
if
(
existCart
==
null
){
//取得规格的信息,判断规格库存
//取得规格的信息,判断规格库存
if
(
product
==
null
||
number
>
product
.
get
Goods
Number
()
){
if
(
product
==
null
||
number
>
product
.
getNumber
()
){
return
ResponseUtil
.
fail
(
400
,
"库存不足"
);
return
ResponseUtil
.
fail
(
400
,
"库存不足"
);
}
}
Integer
[]
ids
=
product
.
getGoodsSpecificationIds
();
String
goodsSpecificationValue
=
null
;
for
(
Integer
id
:
ids
){
LitemallGoodsSpecification
goodsSpecification
=
goodsSpecificationService
.
findById
(
id
);
if
(
goodsSpecification
==
null
||
!
goodsSpecification
.
getGoodsId
().
equals
(
goodsId
)){
return
ResponseUtil
.
badArgument
();
}
if
(
goodsSpecificationValue
==
null
){
goodsSpecificationValue
=
goodsSpecification
.
getValue
();
}
else
{
goodsSpecificationValue
=
goodsSpecificationValue
+
" "
+
goodsSpecification
.
getValue
();
}
}
cart
.
setId
(
null
);
cart
.
setId
(
null
);
cart
.
setGoodsSn
(
goods
.
getGoodsSn
());
cart
.
setGoodsSn
(
goods
.
getGoodsSn
());
cart
.
setGoodsName
((
goods
.
getName
()));
cart
.
setGoodsName
((
goods
.
getName
()));
cart
.
setPicUrl
(
goods
.
getPrimaryPicUrl
());
cart
.
setPicUrl
(
goods
.
getPicUrl
());
cart
.
setRetailPrice
(
product
.
getRetailPrice
());
cart
.
setPrice
(
product
.
getPrice
());
cart
.
setGoodsSpecificationIds
(
product
.
getGoodsSpecificationIds
());
cart
.
setSpecifications
(
product
.
getSpecifications
());
cart
.
setGoodsSpecificationValues
(
goodsSpecificationValue
);
cart
.
setUserId
(
userId
);
cart
.
setUserId
(
userId
);
cart
.
setChecked
(
true
);
cart
.
setChecked
(
true
);
cartService
.
add
(
cart
);
cartService
.
add
(
cart
);
...
@@ -248,7 +216,7 @@ public class WxCartController {
...
@@ -248,7 +216,7 @@ public class WxCartController {
else
{
else
{
//取得规格的信息,判断规格库存
//取得规格的信息,判断规格库存
int
num
=
number
;
int
num
=
number
;
if
(
num
>
product
.
get
Goods
Number
()){
if
(
num
>
product
.
getNumber
()){
return
ResponseUtil
.
fail
(
400
,
"库存不足"
);
return
ResponseUtil
.
fail
(
400
,
"库存不足"
);
}
}
existCart
.
setNumber
((
short
)
num
);
existCart
.
setNumber
((
short
)
num
);
...
@@ -307,7 +275,7 @@ public class WxCartController {
...
@@ -307,7 +275,7 @@ public class WxCartController {
//取得规格的信息,判断规格库存
//取得规格的信息,判断规格库存
LitemallProduct
product
=
productService
.
findById
(
productId
);
LitemallProduct
product
=
productService
.
findById
(
productId
);
if
(
product
==
null
||
product
.
get
Goods
Number
()
<
number
){
if
(
product
==
null
||
product
.
getNumber
()
<
number
){
return
ResponseUtil
.
fail
(
403
,
"库存不足"
);
return
ResponseUtil
.
fail
(
403
,
"库存不足"
);
}
}
...
@@ -498,7 +466,7 @@ public class WxCartController {
...
@@ -498,7 +466,7 @@ public class WxCartController {
}
}
BigDecimal
checkedGoodsPrice
=
new
BigDecimal
(
0.00
);
BigDecimal
checkedGoodsPrice
=
new
BigDecimal
(
0.00
);
for
(
LitemallCart
cart
:
checkedGoodsList
)
{
for
(
LitemallCart
cart
:
checkedGoodsList
)
{
checkedGoodsPrice
=
checkedGoodsPrice
.
add
(
cart
.
get
Retail
Price
().
multiply
(
new
BigDecimal
(
cart
.
getNumber
())));
checkedGoodsPrice
=
checkedGoodsPrice
.
add
(
cart
.
getPrice
().
multiply
(
new
BigDecimal
(
cart
.
getNumber
())));
}
}
// 根据订单商品总价计算运费,满88则免运费,否则8元;
// 根据订单商品总价计算运费,满88则免运费,否则8元;
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCollectController.java
View file @
a86ec8b6
...
@@ -29,7 +29,7 @@ public class WxCollectController {
...
@@ -29,7 +29,7 @@ public class WxCollectController {
* 用户收藏列表
* 用户收藏列表
*
*
* @param userId 用户ID
* @param userId 用户ID
* @param type
Id
类型
ID
* @param type 类型
,如果是0则是商品收藏,如果是1则是专题收藏
* 目前没有使用
* 目前没有使用
* @param page 分页页数
* @param page 分页页数
* @param size 分页大小
* @param size 分页大小
...
@@ -47,31 +47,31 @@ public class WxCollectController {
...
@@ -47,31 +47,31 @@ public class WxCollectController {
* 失败则 { errno: XXX, errmsg: XXX }
* 失败则 { errno: XXX, errmsg: XXX }
*/
*/
@GetMapping
(
"list"
)
@GetMapping
(
"list"
)
public
Object
list
(
@LoginUser
Integer
userId
,
Integer
type
Id
,
public
Object
list
(
@LoginUser
Integer
userId
,
Byte
type
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
Integer
size
)
{
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
Integer
size
)
{
if
(
userId
==
null
){
if
(
userId
==
null
){
return
ResponseUtil
.
unlogin
();
return
ResponseUtil
.
unlogin
();
}
}
if
(
type
Id
==
null
){
if
(
type
==
null
){
return
ResponseUtil
.
badArgument
();
return
ResponseUtil
.
badArgument
();
}
}
List
<
LitemallCollect
>
collectList
=
collectService
.
queryByType
(
userId
,
type
Id
,
page
,
size
);
List
<
LitemallCollect
>
collectList
=
collectService
.
queryByType
(
userId
,
type
,
page
,
size
);
int
count
=
collectService
.
countByType
(
userId
,
type
Id
);
int
count
=
collectService
.
countByType
(
userId
,
type
);
int
totalPages
=
(
int
)
Math
.
ceil
((
double
)
count
/
size
);
int
totalPages
=
(
int
)
Math
.
ceil
((
double
)
count
/
size
);
List
<
Object
>
collects
=
new
ArrayList
<>(
collectList
.
size
());
List
<
Object
>
collects
=
new
ArrayList
<>(
collectList
.
size
());
for
(
LitemallCollect
collect
:
collectList
){
for
(
LitemallCollect
collect
:
collectList
){
Map
<
String
,
Object
>
c
=
new
HashMap
();
Map
<
String
,
Object
>
c
=
new
HashMap
();
c
.
put
(
"id"
,
collect
.
getId
());
c
.
put
(
"id"
,
collect
.
getId
());
c
.
put
(
"type
Id
"
,
collect
.
getType
Id
());
c
.
put
(
"type"
,
collect
.
getType
());
c
.
put
(
"valueId"
,
collect
.
getValueId
());
c
.
put
(
"valueId"
,
collect
.
getValueId
());
LitemallGoods
goods
=
goodsService
.
findById
(
collect
.
getValueId
());
LitemallGoods
goods
=
goodsService
.
findById
(
collect
.
getValueId
());
c
.
put
(
"name"
,
goods
.
getName
());
c
.
put
(
"name"
,
goods
.
getName
());
c
.
put
(
"
goodsB
rief"
,
goods
.
get
Goods
Brief
());
c
.
put
(
"
b
rief"
,
goods
.
getBrief
());
c
.
put
(
"
listP
icUrl"
,
goods
.
get
List
PicUrl
());
c
.
put
(
"
p
icUrl"
,
goods
.
getPicUrl
());
c
.
put
(
"retailPrice"
,
goods
.
getRetailPrice
());
c
.
put
(
"retailPrice"
,
goods
.
getRetailPrice
());
collects
.
add
(
c
);
collects
.
add
(
c
);
...
@@ -109,13 +109,13 @@ public class WxCollectController {
...
@@ -109,13 +109,13 @@ public class WxCollectController {
return
ResponseUtil
.
badArgument
();
return
ResponseUtil
.
badArgument
();
}
}
Integer
type
Id
=
JacksonUtil
.
parse
Integer
(
body
,
"type
Id
"
);
Byte
type
=
JacksonUtil
.
parse
Byte
(
body
,
"type"
);
Integer
valueId
=
JacksonUtil
.
parseInteger
(
body
,
"valueId"
);
Integer
valueId
=
JacksonUtil
.
parseInteger
(
body
,
"valueId"
);
if
(!
ObjectUtils
.
allNotNull
(
type
Id
,
valueId
)){
if
(!
ObjectUtils
.
allNotNull
(
type
,
valueId
)){
return
ResponseUtil
.
badArgument
();
return
ResponseUtil
.
badArgument
();
}
}
LitemallCollect
collect
=
collectService
.
queryByTypeAndValue
(
userId
,
type
Id
,
valueId
);
LitemallCollect
collect
=
collectService
.
queryByTypeAndValue
(
userId
,
type
,
valueId
);
String
handleType
=
null
;
String
handleType
=
null
;
if
(
collect
!=
null
){
if
(
collect
!=
null
){
...
@@ -127,7 +127,7 @@ public class WxCollectController {
...
@@ -127,7 +127,7 @@ public class WxCollectController {
collect
=
new
LitemallCollect
();
collect
=
new
LitemallCollect
();
collect
.
setUserId
(
userId
);
collect
.
setUserId
(
userId
);
collect
.
setValueId
(
valueId
);
collect
.
setValueId
(
valueId
);
collect
.
setType
Id
(
type
Id
);
collect
.
setType
(
type
);
collect
.
setAddTime
(
LocalDateTime
.
now
());
collect
.
setAddTime
(
LocalDateTime
.
now
());
collectService
.
add
(
collect
);
collectService
.
add
(
collect
);
}
}
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCommentController.java
View file @
a86ec8b6
...
@@ -66,8 +66,8 @@ public class WxCommentController {
...
@@ -66,8 +66,8 @@ public class WxCommentController {
/**
/**
* 评论数量
* 评论数量
*
*
* @param type
Id
类型ID。 如果是0,则查询商品评论;如果是1,则查询专题评论。
* @param type 类型ID。 如果是0,则查询商品评论;如果是1,则查询专题评论。
* @param valueId 商品或专题ID。如果type
Id
是0,则是商品ID;如果type
Id
是1,则是专题ID。
* @param valueId 商品或专题ID。如果type是0,则是商品ID;如果type是1,则是专题ID。
* @return 评论数量
* @return 评论数量
* 成功则
* 成功则
* {
* {
...
@@ -82,9 +82,9 @@ public class WxCommentController {
...
@@ -82,9 +82,9 @@ public class WxCommentController {
* 失败则 { errno: XXX, errmsg: XXX }
* 失败则 { errno: XXX, errmsg: XXX }
*/
*/
@GetMapping
(
"count"
)
@GetMapping
(
"count"
)
public
Object
count
(
Byte
type
Id
,
Integer
valueId
)
{
public
Object
count
(
Byte
type
,
Integer
valueId
)
{
int
allCount
=
commentService
.
count
(
type
Id
,
valueId
,
0
,
0
,
0
);
int
allCount
=
commentService
.
count
(
type
,
valueId
,
0
,
0
,
0
);
int
hasPicCount
=
commentService
.
count
(
type
Id
,
valueId
,
1
,
0
,
0
);
int
hasPicCount
=
commentService
.
count
(
type
,
valueId
,
1
,
0
,
0
);
Map
<
String
,
Object
>
data
=
new
HashMap
();
Map
<
String
,
Object
>
data
=
new
HashMap
();
data
.
put
(
"allCount"
,
allCount
);
data
.
put
(
"allCount"
,
allCount
);
data
.
put
(
"hasPicCount"
,
hasPicCount
);
data
.
put
(
"hasPicCount"
,
hasPicCount
);
...
@@ -94,8 +94,8 @@ public class WxCommentController {
...
@@ -94,8 +94,8 @@ public class WxCommentController {
/**
/**
* 评论列表
* 评论列表
*
*
* @param type
Id
类型ID。 如果是0,则查询商品评论;如果是1,则查询专题评论。
* @param type 类型ID。 如果是0,则查询商品评论;如果是1,则查询专题评论。
* @param valueId 商品或专题ID。如果type
Id
是0,则是商品ID;如果type
Id
是1,则是专题ID。
* @param valueId 商品或专题ID。如果type是0,则是商品ID;如果type是1,则是专题ID。
* @param showType 显示类型。如果是0,则查询全部;如果是1,则查询有图片的评论。
* @param showType 显示类型。如果是0,则查询全部;如果是1,则查询有图片的评论。
* @param page 分页页数
* @param page 分页页数
* @param size 分页大小
* @param size 分页大小
...
@@ -114,15 +114,15 @@ public class WxCommentController {
...
@@ -114,15 +114,15 @@ public class WxCommentController {
* 失败则 { errno: XXX, errmsg: XXX }
* 失败则 { errno: XXX, errmsg: XXX }
*/
*/
@GetMapping
(
"list"
)
@GetMapping
(
"list"
)
public
Object
list
(
Byte
type
Id
,
Integer
valueId
,
Integer
showType
,
public
Object
list
(
Byte
type
,
Integer
valueId
,
Integer
showType
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
Integer
size
)
{
@RequestParam
(
value
=
"size"
,
defaultValue
=
"10"
)
Integer
size
)
{
if
(!
ObjectUtils
.
allNotNull
(
type
Id
,
valueId
,
showType
)){
if
(!
ObjectUtils
.
allNotNull
(
type
,
valueId
,
showType
)){
return
ResponseUtil
.
badArgument
();
return
ResponseUtil
.
badArgument
();
}
}
List
<
LitemallComment
>
commentList
=
commentService
.
query
(
type
Id
,
valueId
,
showType
,
page
,
size
);
List
<
LitemallComment
>
commentList
=
commentService
.
query
(
type
,
valueId
,
showType
,
page
,
size
);
int
count
=
commentService
.
count
(
type
Id
,
valueId
,
showType
,
page
,
size
);
int
count
=
commentService
.
count
(
type
,
valueId
,
showType
,
page
,
size
);
List
<
Map
<
String
,
Object
>>
commentVoList
=
new
ArrayList
<>(
commentList
.
size
());
List
<
Map
<
String
,
Object
>>
commentVoList
=
new
ArrayList
<>(
commentList
.
size
());
for
(
LitemallComment
comment
:
commentList
){
for
(
LitemallComment
comment
:
commentList
){
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxFootprintController.java
View file @
a86ec8b6
...
@@ -97,8 +97,8 @@ public class WxFootprintController {
...
@@ -97,8 +97,8 @@ public class WxFootprintController {
LitemallGoods
goods
=
goodsService
.
findById
(
footprint
.
getGoodsId
());
LitemallGoods
goods
=
goodsService
.
findById
(
footprint
.
getGoodsId
());
c
.
put
(
"name"
,
goods
.
getName
());
c
.
put
(
"name"
,
goods
.
getName
());
c
.
put
(
"
goodsB
rief"
,
goods
.
get
Goods
Brief
());
c
.
put
(
"
b
rief"
,
goods
.
getBrief
());
c
.
put
(
"
listP
icUrl"
,
goods
.
get
List
PicUrl
());
c
.
put
(
"
p
icUrl"
,
goods
.
getPicUrl
());
c
.
put
(
"retailPrice"
,
goods
.
getRetailPrice
());
c
.
put
(
"retailPrice"
,
goods
.
getRetailPrice
());
footprintVoList
.
add
(
c
);
footprintVoList
.
add
(
c
);
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxGoodsController.java
View file @
a86ec8b6
...
@@ -182,14 +182,14 @@ public class WxGoodsController {
...
@@ -182,14 +182,14 @@ public class WxGoodsController {
LitemallCategory
parent
=
null
;
LitemallCategory
parent
=
null
;
List
<
LitemallCategory
>
children
=
null
;
List
<
LitemallCategory
>
children
=
null
;
if
(
cur
.
getP
arentI
d
()
==
0
){
if
(
cur
.
getP
i
d
()
==
0
){
parent
=
cur
;
parent
=
cur
;
children
=
categoryService
.
queryByPid
(
cur
.
getId
());
children
=
categoryService
.
queryByPid
(
cur
.
getId
());
cur
=
children
.
get
(
0
);
cur
=
children
.
get
(
0
);
}
}
else
{
else
{
parent
=
categoryService
.
findById
(
cur
.
getP
arentI
d
());
parent
=
categoryService
.
findById
(
cur
.
getP
i
d
());
children
=
categoryService
.
queryByPid
(
cur
.
getP
arentI
d
());
children
=
categoryService
.
queryByPid
(
cur
.
getP
i
d
());
}
}
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"currentCategory"
,
cur
);
data
.
put
(
"currentCategory"
,
cur
);
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxHomeController.java
View file @
a86ec8b6
...
@@ -57,7 +57,7 @@ public class WxHomeController {
...
@@ -57,7 +57,7 @@ public class WxHomeController {
public
Object
index
()
{
public
Object
index
()
{
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
List
<
LitemallAd
>
banner
=
adService
.
query
ByApid
(
1
);
List
<
LitemallAd
>
banner
=
adService
.
query
Index
(
);
data
.
put
(
"banner"
,
banner
);
data
.
put
(
"banner"
,
banner
);
List
<
LitemallCategory
>
channel
=
categoryService
.
queryChannel
();
List
<
LitemallCategory
>
channel
=
categoryService
.
queryChannel
();
...
...
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxOrderController.java
View file @
a86ec8b6
...
@@ -222,9 +222,9 @@ public class WxOrderController {
...
@@ -222,9 +222,9 @@ public class WxOrderController {
orderGoodsVo
.
put
(
"goodsId"
,
orderGoods
.
getGoodsId
());
orderGoodsVo
.
put
(
"goodsId"
,
orderGoods
.
getGoodsId
());
orderGoodsVo
.
put
(
"goodsName"
,
orderGoods
.
getGoodsName
());
orderGoodsVo
.
put
(
"goodsName"
,
orderGoods
.
getGoodsName
());
orderGoodsVo
.
put
(
"number"
,
orderGoods
.
getNumber
());
orderGoodsVo
.
put
(
"number"
,
orderGoods
.
getNumber
());
orderGoodsVo
.
put
(
"retailPrice"
,
orderGoods
.
get
Retail
Price
());
orderGoodsVo
.
put
(
"retailPrice"
,
orderGoods
.
getPrice
());
orderGoodsVo
.
put
(
"picUrl"
,
orderGoods
.
getPicUrl
());
orderGoodsVo
.
put
(
"picUrl"
,
orderGoods
.
getPicUrl
());
orderGoodsVo
.
put
(
"goodsSpecificationValues"
,
orderGoods
.
get
Goods
Specification
Value
s
());
orderGoodsVo
.
put
(
"goodsSpecificationValues"
,
orderGoods
.
getSpecifications
());
orderGoodsVoList
.
add
(
orderGoodsVo
);
orderGoodsVoList
.
add
(
orderGoodsVo
);
}
}
...
@@ -284,7 +284,7 @@ public class WxOrderController {
...
@@ -284,7 +284,7 @@ public class WxOrderController {
}
}
BigDecimal
checkedGoodsPrice
=
new
BigDecimal
(
0.00
);
BigDecimal
checkedGoodsPrice
=
new
BigDecimal
(
0.00
);
for
(
LitemallCart
checkGoods
:
checkedGoodsList
)
{
for
(
LitemallCart
checkGoods
:
checkedGoodsList
)
{
checkedGoodsPrice
=
checkedGoodsPrice
.
add
(
checkGoods
.
get
Retail
Price
().
multiply
(
new
BigDecimal
(
checkGoods
.
getNumber
())));
checkedGoodsPrice
=
checkedGoodsPrice
.
add
(
checkGoods
.
getPrice
().
multiply
(
new
BigDecimal
(
checkGoods
.
getNumber
())));
}
}
// 根据订单商品总价计算运费,满88则免运费,否则8元;
// 根据订单商品总价计算运费,满88则免运费,否则8元;
...
@@ -337,10 +337,9 @@ public class WxOrderController {
...
@@ -337,10 +337,9 @@ public class WxOrderController {
orderGoods
.
setProductId
(
cartGoods
.
getProductId
());
orderGoods
.
setProductId
(
cartGoods
.
getProductId
());
orderGoods
.
setGoodsName
(
cartGoods
.
getGoodsName
());
orderGoods
.
setGoodsName
(
cartGoods
.
getGoodsName
());
orderGoods
.
setPicUrl
(
cartGoods
.
getPicUrl
());
orderGoods
.
setPicUrl
(
cartGoods
.
getPicUrl
());
orderGoods
.
set
Retail
Price
(
cartGoods
.
get
Retail
Price
());
orderGoods
.
setPrice
(
cartGoods
.
getPrice
());
orderGoods
.
setNumber
(
cartGoods
.
getNumber
());
orderGoods
.
setNumber
(
cartGoods
.
getNumber
());
orderGoods
.
setGoodsSpecificationIds
(
cartGoods
.
getGoodsSpecificationIds
());
orderGoods
.
setSpecifications
(
cartGoods
.
getSpecifications
());
orderGoods
.
setGoodsSpecificationValues
(
cartGoods
.
getGoodsSpecificationValues
());
orderGoods
.
setAddTime
(
LocalDateTime
.
now
());
orderGoods
.
setAddTime
(
LocalDateTime
.
now
());
// 添加订单商品表项
// 添加订单商品表项
...
@@ -355,11 +354,11 @@ public class WxOrderController {
...
@@ -355,11 +354,11 @@ public class WxOrderController {
Integer
productId
=
checkGoods
.
getProductId
();
Integer
productId
=
checkGoods
.
getProductId
();
LitemallProduct
product
=
productService
.
findById
(
productId
);
LitemallProduct
product
=
productService
.
findById
(
productId
);
Integer
remainNumber
=
product
.
get
Goods
Number
()
-
checkGoods
.
getNumber
();
Integer
remainNumber
=
product
.
getNumber
()
-
checkGoods
.
getNumber
();
if
(
remainNumber
<
0
)
{
if
(
remainNumber
<
0
)
{
throw
new
RuntimeException
(
"下单的商品货品数量大于库存量"
);
throw
new
RuntimeException
(
"下单的商品货品数量大于库存量"
);
}
}
product
.
set
Goods
Number
(
remainNumber
);
product
.
setNumber
(
remainNumber
);
productService
.
updateById
(
product
);
productService
.
updateById
(
product
);
}
}
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
...
@@ -425,8 +424,8 @@ public class WxOrderController {
...
@@ -425,8 +424,8 @@ public class WxOrderController {
for
(
LitemallOrderGoods
orderGoods
:
orderGoodsList
)
{
for
(
LitemallOrderGoods
orderGoods
:
orderGoodsList
)
{
Integer
productId
=
orderGoods
.
getProductId
();
Integer
productId
=
orderGoods
.
getProductId
();
LitemallProduct
product
=
productService
.
findById
(
productId
);
LitemallProduct
product
=
productService
.
findById
(
productId
);
Integer
number
=
product
.
get
Goods
Number
()
+
orderGoods
.
getNumber
();
Integer
number
=
product
.
getNumber
()
+
orderGoods
.
getNumber
();
product
.
set
Goods
Number
(
number
);
product
.
setNumber
(
number
);
productService
.
updateById
(
product
);
productService
.
updateById
(
product
);
}
}
}
catch
(
Exception
ex
)
{
}
catch
(
Exception
ex
)
{
...
...
litemall-wx/app.json
View file @
a86ec8b6
litemall-wx/pages/brand/brand.wxml
View file @
a86ec8b6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<view class="brand-list" >
<view class="brand-list" >
<navigator url="../brandDetail/brandDetail?id={{item.id}}" class="item" wx:for="{{brandList}}" wx:key="id">
<navigator url="../brandDetail/brandDetail?id={{item.id}}" class="item" wx:for="{{brandList}}" wx:key="id">
<view class="img-bg">
<view class="img-bg">
<image src="{{item.
appListP
icUrl}}" background-size="cover"></image>
<image src="{{item.
p
icUrl}}" background-size="cover"></image>
</view>
</view>
<view class="txt-box">
<view class="txt-box">
<view class="line">
<view class="line">
...
...
litemall-wx/pages/brandDetail/brandDetail.wxml
View file @
a86ec8b6
<view class="container">
<view class="container">
<view class="brand-info">
<view class="brand-info">
<view class="name">
<view class="name">
<image class="img" src="{{brand.
appListP
icUrl}}" background-size="cover"></image>
<image class="img" src="{{brand.
p
icUrl}}" background-size="cover"></image>
<view class="info-box">
<view class="info-box">
<view class="info">
<view class="info">
<text class="txt">{{brand.name}}</text>
<text class="txt">{{brand.name}}</text>
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
</view>
</view>
</view>
</view>
<view class="desc">
<view class="desc">
{{brand.
simpleD
esc}}
{{brand.
d
esc}}
</view>
</view>
</view>
</view>
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<view class="b">
<view class="b">
<block wx:for="{{goodsList}}" wx:key="id" wx:for-index="iindex" wx:for-item="iitem">
<block wx:for="{{goodsList}}" wx:key="id" wx:for-index="iindex" wx:for-item="iitem">
<navigator class="item {{iindex % 2 == 0 ? 'item-b' : ''}}" url="../goods/goods?id={{iitem.id}}">
<navigator class="item {{iindex % 2 == 0 ? 'item-b' : ''}}" url="../goods/goods?id={{iitem.id}}">
<image class="img" src="{{iitem.
listP
icUrl}}" background-size="cover"></image>
<image class="img" src="{{iitem.
p
icUrl}}" background-size="cover"></image>
<text class="name">{{iitem.name}}</text>
<text class="name">{{iitem.name}}</text>
<text class="price">¥{{iitem.retailPrice}}</text>
<text class="price">¥{{iitem.retailPrice}}</text>
</navigator>
</navigator>
...
...
litemall-wx/pages/cart/cart.wxml
View file @
a86ec8b6
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
</view>
</view>
<view class="attr">{{ isEditCart ? '已选择:' : ''}}{{item.goodsSpecificationValues||''}}</view>
<view class="attr">{{ isEditCart ? '已选择:' : ''}}{{item.goodsSpecificationValues||''}}</view>
<view class="b">
<view class="b">
<text class="price">¥{{item.
retailP
rice}}</text>
<text class="price">¥{{item.
p
rice}}</text>
<view class="selnum">
<view class="selnum">
<view class="cut" bindtap="cutNumber" data-item-index="{{index}}">-</view>
<view class="cut" bindtap="cutNumber" data-item-index="{{index}}">-</view>
<input value="{{item.number}}" class="number" disabled="true" type="number" />
<input value="{{item.number}}" class="number" disabled="true" type="number" />
...
...
litemall-wx/pages/catalog/catalog.wxml
View file @
a86ec8b6
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
</scroll-view>
</scroll-view>
<scroll-view class="cate" scroll-y="true">
<scroll-view class="cate" scroll-y="true">
<navigator url="url" class="banner">
<navigator url="url" class="banner">
<image class="image" src="{{currentCategory.
wapBanner
Url}}"></image>
<image class="image" src="{{currentCategory.
pic
Url}}"></image>
<view class="txt">{{currentCategory.frontName}}</view>
<view class="txt">{{currentCategory.frontName}}</view>
</navigator>
</navigator>
<view class="hd">
<view class="hd">
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
</view>
</view>
<view class="bd">
<view class="bd">
<navigator url="/pages/category/category?id={{item.id}}" class="item {{(index+1) % 3 == 0 ? 'last' : ''}}" wx:key="id" wx:for="{{currentSubCategoryList}}">
<navigator url="/pages/category/category?id={{item.id}}" class="item {{(index+1) % 3 == 0 ? 'last' : ''}}" wx:key="id" wx:for="{{currentSubCategoryList}}">
<image class="icon" src="{{item.
wapBanner
Url}}"></image>
<image class="icon" src="{{item.
pic
Url}}"></image>
<text class="txt">{{item.name}}</text>
<text class="txt">{{item.name}}</text>
</navigator>
</navigator>
</view>
</view>
...
...
litemall-wx/pages/category/category.wxml
View file @
a86ec8b6
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
</view>
</view>
<view class="b">
<view class="b">
<navigator class="item {{(iindex + 1) % 2 == 0 ? 'item-b' : ''}}" url="/pages/goods/goods?id={{iitem.id}}" wx:for="{{goodsList}}" wx:key="id" wx:for-item="iitem" wx:for-index="iindex" >
<navigator class="item {{(iindex + 1) % 2 == 0 ? 'item-b' : ''}}" url="/pages/goods/goods?id={{iitem.id}}" wx:for="{{goodsList}}" wx:key="id" wx:for-item="iitem" wx:for-index="iindex" >
<image class="img" src="{{iitem.
listP
icUrl}}" background-size="cover"></image>
<image class="img" src="{{iitem.
p
icUrl}}" background-size="cover"></image>
<text class="name">{{iitem.name}}</text>
<text class="name">{{iitem.name}}</text>
<text class="price">¥{{iitem.retailPrice}}</text>
<text class="price">¥{{iitem.retailPrice}}</text>
</navigator>
</navigator>
...
...
litemall-wx/pages/comment/comment.js
View file @
a86ec8b6
...
@@ -7,7 +7,7 @@ Page({
...
@@ -7,7 +7,7 @@ Page({
comments
:
[],
comments
:
[],
allCommentList
:
[],
allCommentList
:
[],
picCommentList
:
[],
picCommentList
:
[],
type
Id
:
0
,
type
:
0
,
valueId
:
0
,
valueId
:
0
,
showType
:
0
,
showType
:
0
,
allCount
:
0
,
allCount
:
0
,
...
@@ -18,7 +18,7 @@ Page({
...
@@ -18,7 +18,7 @@ Page({
},
},
getCommentCount
:
function
()
{
getCommentCount
:
function
()
{
let
that
=
this
;
let
that
=
this
;
util
.
request
(
api
.
CommentCount
,
{
valueId
:
that
.
data
.
valueId
,
type
Id
:
that
.
data
.
type
Id
}).
then
(
function
(
res
)
{
util
.
request
(
api
.
CommentCount
,
{
valueId
:
that
.
data
.
valueId
,
type
:
that
.
data
.
type
}).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
that
.
setData
({
allCount
:
res
.
data
.
allCount
,
allCount
:
res
.
data
.
allCount
,
...
@@ -31,7 +31,7 @@ Page({
...
@@ -31,7 +31,7 @@ Page({
let
that
=
this
;
let
that
=
this
;
util
.
request
(
api
.
CommentList
,
{
util
.
request
(
api
.
CommentList
,
{
valueId
:
that
.
data
.
valueId
,
valueId
:
that
.
data
.
valueId
,
type
Id
:
that
.
data
.
type
Id
,
type
:
that
.
data
.
type
,
size
:
that
.
data
.
size
,
size
:
that
.
data
.
size
,
page
:
(
that
.
data
.
showType
==
0
?
that
.
data
.
allPage
:
that
.
data
.
picPage
),
page
:
(
that
.
data
.
showType
==
0
?
that
.
data
.
allPage
:
that
.
data
.
picPage
),
showType
:
that
.
data
.
showType
showType
:
that
.
data
.
showType
...
@@ -57,7 +57,7 @@ Page({
...
@@ -57,7 +57,7 @@ Page({
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
// 页面初始化 options为页面跳转所带来的参数
this
.
setData
({
this
.
setData
({
type
Id
:
options
.
type
Id
,
type
:
options
.
type
,
valueId
:
options
.
valueId
valueId
:
options
.
valueId
});
});
this
.
getCommentCount
();
this
.
getCommentCount
();
...
...
litemall-wx/pages/commentPost/commentPost.js
View file @
a86ec8b6
...
@@ -5,7 +5,7 @@ var api = require('../../config/api.js');
...
@@ -5,7 +5,7 @@ var api = require('../../config/api.js');
Page
({
Page
({
data
:
{
data
:
{
orderId
:
0
,
orderId
:
0
,
type
Id
:
0
,
type
:
0
,
valueId
:
0
,
valueId
:
0
,
orderGoods
:
{},
orderGoods
:
{},
content
:
''
,
content
:
''
,
...
@@ -102,7 +102,7 @@ Page({
...
@@ -102,7 +102,7 @@ Page({
var
that
=
this
;
var
that
=
this
;
that
.
setData
({
that
.
setData
({
orderId
:
options
.
orderId
,
orderId
:
options
.
orderId
,
type
Id
:
options
.
type
Id
,
type
:
options
.
type
,
valueId
:
options
.
valueId
valueId
:
options
.
valueId
});
});
this
.
getOrderComment
();
this
.
getOrderComment
();
...
@@ -131,7 +131,7 @@ Page({
...
@@ -131,7 +131,7 @@ Page({
}
}
util
.
request
(
api
.
CommentPost
,
{
util
.
request
(
api
.
CommentPost
,
{
type
Id
:
that
.
data
.
type
Id
,
type
:
that
.
data
.
type
,
valueId
:
that
.
data
.
valueId
,
valueId
:
that
.
data
.
valueId
,
content
:
that
.
data
.
content
,
content
:
that
.
data
.
content
,
star
:
that
.
data
.
star
,
star
:
that
.
data
.
star
,
...
...
litemall-wx/pages/goods/goods.js
View file @
a86ec8b6
...
@@ -40,7 +40,7 @@ Page({
...
@@ -40,7 +40,7 @@ Page({
// 如果仅仅存在一种货品,那么商品价格应该和货品价格一致
// 如果仅仅存在一种货品,那么商品价格应该和货品价格一致
// 这里检测一下
// 这里检测一下
let
_productPrice
=
res
.
data
.
productList
[
0
].
retailP
rice
;
let
_productPrice
=
res
.
data
.
productList
[
0
].
p
rice
;
let
_goodsPrice
=
res
.
data
.
info
.
retailPrice
;
let
_goodsPrice
=
res
.
data
.
info
.
retailPrice
;
if
(
_productPrice
!=
_goodsPrice
){
if
(
_productPrice
!=
_goodsPrice
){
console
.
error
(
'
商品数量价格和货品不一致
'
);
console
.
error
(
'
商品数量价格和货品不一致
'
);
...
@@ -75,7 +75,7 @@ Page({
...
@@ -75,7 +75,7 @@ Page({
});
});
}
}
WxParse
.
wxParse
(
'
goodsDetail
'
,
'
html
'
,
res
.
data
.
info
.
goodsD
esc
,
that
);
WxParse
.
wxParse
(
'
goodsDetail
'
,
'
html
'
,
res
.
data
.
info
.
d
esc
,
that
);
that
.
getGoodsRelated
();
that
.
getGoodsRelated
();
}
}
...
@@ -161,7 +161,7 @@ Page({
...
@@ -161,7 +161,7 @@ Page({
},
},
getCheckedSpecKey
:
function
()
{
getCheckedSpecKey
:
function
()
{
let
checkedValue
=
this
.
getCheckedSpecValue
().
map
(
function
(
v
)
{
let
checkedValue
=
this
.
getCheckedSpecValue
().
map
(
function
(
v
)
{
return
v
.
value
Id
;
return
v
.
value
Text
;
});
});
return
checkedValue
;
return
checkedValue
;
...
@@ -206,9 +206,9 @@ Page({
...
@@ -206,9 +206,9 @@ Page({
}
}
let
checkedProduct
=
checkedProductArray
[
0
];
let
checkedProduct
=
checkedProductArray
[
0
];
if
(
checkedProduct
.
goodsN
umber
>
0
){
if
(
checkedProduct
.
n
umber
>
0
){
this
.
setData
({
this
.
setData
({
checkedSpecPrice
:
checkedProduct
.
retailP
rice
,
checkedSpecPrice
:
checkedProduct
.
p
rice
,
soldout
:
false
soldout
:
false
});
});
}
}
...
@@ -231,7 +231,7 @@ Page({
...
@@ -231,7 +231,7 @@ Page({
},
},
getCheckedProductItem
:
function
(
key
)
{
getCheckedProductItem
:
function
(
key
)
{
return
this
.
data
.
productList
.
filter
(
function
(
v
)
{
return
this
.
data
.
productList
.
filter
(
function
(
v
)
{
if
(
v
.
goodsS
pecification
Id
s
.
toString
()
==
key
.
toString
())
{
if
(
v
.
s
pecifications
.
toString
()
==
key
.
toString
())
{
return
true
;
return
true
;
}
else
{
}
else
{
return
false
;
return
false
;
...
@@ -293,7 +293,7 @@ Page({
...
@@ -293,7 +293,7 @@ Page({
}
}
}
else
{
}
else
{
//添加或是取消收藏
//添加或是取消收藏
util
.
request
(
api
.
CollectAddOrDelete
,
{
type
Id
:
0
,
valueId
:
this
.
data
.
id
},
"
POST
"
)
util
.
request
(
api
.
CollectAddOrDelete
,
{
type
:
0
,
valueId
:
this
.
data
.
id
},
"
POST
"
)
.
then
(
function
(
res
)
{
.
then
(
function
(
res
)
{
let
_res
=
res
;
let
_res
=
res
;
if
(
_res
.
errno
==
0
)
{
if
(
_res
.
errno
==
0
)
{
...
@@ -354,7 +354,7 @@ Page({
...
@@ -354,7 +354,7 @@ Page({
let
checkedProduct
=
checkedProductArray
[
0
];
let
checkedProduct
=
checkedProductArray
[
0
];
//验证库存
//验证库存
if
(
checkedProduct
.
goodsN
umber
<=
0
)
{
if
(
checkedProduct
.
n
umber
<=
0
)
{
wx
.
showToast
({
wx
.
showToast
({
image
:
'
/static/images/icon_error.png
'
,
image
:
'
/static/images/icon_error.png
'
,
title
:
'
没有库存
'
title
:
'
没有库存
'
...
@@ -420,7 +420,7 @@ Page({
...
@@ -420,7 +420,7 @@ Page({
let
checkedProduct
=
checkedProductArray
[
0
];
let
checkedProduct
=
checkedProductArray
[
0
];
//验证库存
//验证库存
if
(
checkedProduct
.
goodsN
umber
<=
0
)
{
if
(
checkedProduct
.
n
umber
<=
0
)
{
wx
.
showToast
({
wx
.
showToast
({
image
:
'
/static/images/icon_error.png
'
,
image
:
'
/static/images/icon_error.png
'
,
title
:
'
没有库存
'
title
:
'
没有库存
'
...
...
litemall-wx/pages/goods/goods.wxml
View file @
a86ec8b6
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
</view>
</view>
<view class="comments" wx:if="{{comment.count > 0}}">
<view class="comments" wx:if="{{comment.count > 0}}">
<view class="h">
<view class="h">
<navigator url="/pages/comment/comment?valueId={{goods.id}}&type
Id
=0">
<navigator url="/pages/comment/comment?valueId={{goods.id}}&type=0">
<text class="t">评价({{comment.count > 999 ? '999+' : comment.count}})</text>
<text class="t">评价({{comment.count > 999 ? '999+' : comment.count}})</text>
<text class="i">查看全部</text>
<text class="i">查看全部</text>
</navigator>
</navigator>
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
<view class="b">
<view class="b">
<view class="item" wx:for="{{relatedGoods}}" wx:key="id">
<view class="item" wx:for="{{relatedGoods}}" wx:key="id">
<navigator url="/pages/goods/goods?id={{item.id}}">
<navigator url="/pages/goods/goods?id={{item.id}}">
<image class="img" src="{{item.
listP
icUrl}}" background-size="cover"></image>
<image class="img" src="{{item.
p
icUrl}}" background-size="cover"></image>
<text class="name">{{item.name}}</text>
<text class="name">{{item.name}}</text>
<text class="price">¥{{item.retailPrice}}</text>
<text class="price">¥{{item.retailPrice}}</text>
</navigator>
</navigator>
...
@@ -102,7 +102,7 @@
...
@@ -102,7 +102,7 @@
</view>
</view>
<view wx:if="{{openAttr}}" class="attr-pop">
<view wx:if="{{openAttr}}" class="attr-pop">
<view class="img-info">
<view class="img-info">
<image class="img" src="{{goods.p
rimaryP
icUrl}}"></image>
<image class="img" src="{{goods.picUrl}}"></image>
<view class="info">
<view class="info">
<view class="c">
<view class="c">
<view class="p">价格:¥{{checkedSpecPrice}}</view>
<view class="p">价格:¥{{checkedSpecPrice}}</view>
...
...
litemall-wx/pages/hotGoods/hotGoods.wxml
View file @
a86ec8b6
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
<view class="b">
<view class="b">
<block wx:for="{{goodsList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="id">
<block wx:for="{{goodsList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="id">
<navigator class="item {{iindex % 2 == 0 ? 'item-b' : '' }}" url="../goods/goods?id={{iitem.id}}">
<navigator class="item {{iindex % 2 == 0 ? 'item-b' : '' }}" url="../goods/goods?id={{iitem.id}}">
<image class="img" src="{{iitem.
listP
icUrl}}" background-size="cover"></image>
<image class="img" src="{{iitem.
p
icUrl}}" background-size="cover"></image>
<text class="name">{{iitem.name}}</text>
<text class="name">{{iitem.name}}</text>
<text class="price">¥{{iitem.retailPrice}}</text>
<text class="price">¥{{iitem.retailPrice}}</text>
</navigator>
</navigator>
...
...
litemall-wx/pages/index/index.wxml
View file @
a86ec8b6
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
<view class="b">
<view class="b">
<view class="item" wx:for="{{newGoods}}" wx:for-index="index" wx:for-item="item" wx:key="id">
<view class="item" wx:for="{{newGoods}}" wx:for-index="index" wx:for-item="item" wx:key="id">
<navigator url="../goods/goods?id={{item.id}}">
<navigator url="../goods/goods?id={{item.id}}">
<image class="img" src="{{item.
listP
icUrl}}" background-size="cover"></image>
<image class="img" src="{{item.
p
icUrl}}" background-size="cover"></image>
<text class="name">{{item.name}}</text>
<text class="name">{{item.name}}</text>
<text class="price">¥{{item.retailPrice}}</text>
<text class="price">¥{{item.retailPrice}}</text>
</navigator>
</navigator>
...
@@ -64,11 +64,11 @@
...
@@ -64,11 +64,11 @@
<view class="b">
<view class="b">
<view class="item" wx:for="{{hotGoods}}" wx:for-index="index" wx:for-item="item" wx:key="id">
<view class="item" wx:for="{{hotGoods}}" wx:for-index="index" wx:for-item="item" wx:key="id">
<navigator url="/pages/goods/goods?id={{item.id}}">
<navigator url="/pages/goods/goods?id={{item.id}}">
<image class="img" src="{{item.
listP
icUrl}}" background-size="cover"></image>
<image class="img" src="{{item.
p
icUrl}}" background-size="cover"></image>
<view class="right">
<view class="right">
<view class="text">
<view class="text">
<text class="name">{{item.name}}</text>
<text class="name">{{item.name}}</text>
<text class="desc">{{item.
goods_
brief}}</text>
<text class="desc">{{item.brief}}</text>
<text class="price">¥{{item.retailPrice}}</text>
<text class="price">¥{{item.retailPrice}}</text>
</view>
</view>
</view>
</view>
...
@@ -88,10 +88,10 @@
...
@@ -88,10 +88,10 @@
<scroll-view scroll-x class="list">
<scroll-view scroll-x class="list">
<view class="item" wx:for="{{topics}}" wx:for-index="index" wx:for-item="item" wx:key="id">
<view class="item" wx:for="{{topics}}" wx:for-index="index" wx:for-item="item" wx:key="id">
<navigator url="../topicDetail/topicDetail?id={{item.id}}">
<navigator url="../topicDetail/topicDetail?id={{item.id}}">
<image class="img" src="{{item.
sceneP
icUrl}}" background-size="cover"></image>
<image class="img" src="{{item.
p
icUrl}}" background-size="cover"></image>
<view class="np">
<view class="np">
<text class="name">{{item.title}}</text>
<text class="name">{{item.title}}</text>
<text class="price">¥{{item.price
Info
}}元起</text>
<text class="price">¥{{item.price}}元起</text>
</view>
</view>
<text class="desc">{{item.subtitle}}</text>
<text class="desc">{{item.subtitle}}</text>
</navigator>
</navigator>
...
@@ -109,7 +109,7 @@
...
@@ -109,7 +109,7 @@
<block wx:for="{{item.goodsList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="id">
<block wx:for="{{item.goodsList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="id">
<view class="item {{iindex % 2 == 0 ? '' : 'item-b'}}">
<view class="item {{iindex % 2 == 0 ? '' : 'item-b'}}">
<navigator url="../goods/goods?id={{iitem.id}}" class="a">
<navigator url="../goods/goods?id={{iitem.id}}" class="a">
<image class="img" src="{{iitem.
listP
icUrl}}" background-size="cover"></image>
<image class="img" src="{{iitem.
p
icUrl}}" background-size="cover"></image>
<text class="name">{{iitem.name}}</text>
<text class="name">{{iitem.name}}</text>
<text class="price">¥{{iitem.retailPrice}}</text>
<text class="price">¥{{iitem.retailPrice}}</text>
</navigator>
</navigator>
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment