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
b68151cb
Unverified
Commit
b68151cb
authored
Jul 13, 2018
by
Menethil
Committed by
GitHub
Jul 13, 2018
Browse files
Merge pull request #1 from linlinjava/master
update
parents
126d027a
02679509
Changes
251
Show whitespace changes
Inline
Side-by-side
litemall-wx/pages/cart/cart.wxml
View file @
b68151cb
...
...
@@ -33,7 +33,7 @@
</view>
<view class="attr">{{ isEditCart ? '已选择:' : ''}}{{item.goodsSpecificationValues||''}}</view>
<view class="b">
<text class="price">¥{{item.
retailP
rice}}</text>
<text class="price">¥{{item.
p
rice}}</text>
<view class="selnum">
<view class="cut" bindtap="cutNumber" data-item-index="{{index}}">-</view>
<input value="{{item.number}}" class="number" disabled="true" type="number" />
...
...
litemall-wx/pages/catalog/catalog.wxml
View file @
b68151cb
...
...
@@ -11,7 +11,7 @@
</scroll-view>
<scroll-view class="cate" scroll-y="true">
<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>
</navigator>
<view class="hd">
...
...
@@ -21,7 +21,7 @@
</view>
<view class="bd">
<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>
</navigator>
</view>
...
...
litemall-wx/pages/category/category.wxml
View file @
b68151cb
...
...
@@ -15,7 +15,7 @@
</view>
<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" >
<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="price">¥{{iitem.retailPrice}}</text>
</navigator>
...
...
litemall-wx/pages/comment/comment.js
View file @
b68151cb
...
...
@@ -7,7 +7,7 @@ Page({
comments
:
[],
allCommentList
:
[],
picCommentList
:
[],
type
Id
:
0
,
type
:
0
,
valueId
:
0
,
showType
:
0
,
allCount
:
0
,
...
...
@@ -18,7 +18,7 @@ Page({
},
getCommentCount
:
function
()
{
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
)
{
that
.
setData
({
allCount
:
res
.
data
.
allCount
,
...
...
@@ -31,7 +31,7 @@ Page({
let
that
=
this
;
util
.
request
(
api
.
CommentList
,
{
valueId
:
that
.
data
.
valueId
,
type
Id
:
that
.
data
.
type
Id
,
type
:
that
.
data
.
type
,
size
:
that
.
data
.
size
,
page
:
(
that
.
data
.
showType
==
0
?
that
.
data
.
allPage
:
that
.
data
.
picPage
),
showType
:
that
.
data
.
showType
...
...
@@ -57,7 +57,7 @@ Page({
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
this
.
setData
({
type
Id
:
options
.
type
Id
,
type
:
options
.
type
,
valueId
:
options
.
valueId
});
this
.
getCommentCount
();
...
...
litemall-wx/pages/commentPost/commentPost.js
View file @
b68151cb
...
...
@@ -5,7 +5,7 @@ var api = require('../../config/api.js');
Page
({
data
:
{
orderId
:
0
,
type
Id
:
0
,
type
:
0
,
valueId
:
0
,
orderGoods
:
{},
content
:
''
,
...
...
@@ -102,7 +102,7 @@ Page({
var
that
=
this
;
that
.
setData
({
orderId
:
options
.
orderId
,
type
Id
:
options
.
type
Id
,
type
:
options
.
type
,
valueId
:
options
.
valueId
});
this
.
getOrderComment
();
...
...
@@ -131,7 +131,7 @@ Page({
}
util
.
request
(
api
.
CommentPost
,
{
type
Id
:
that
.
data
.
type
Id
,
type
:
that
.
data
.
type
,
valueId
:
that
.
data
.
valueId
,
content
:
that
.
data
.
content
,
star
:
that
.
data
.
star
,
...
...
litemall-wx/pages/goods/goods.js
View file @
b68151cb
...
...
@@ -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
;
if
(
_productPrice
!=
_goodsPrice
){
console
.
error
(
'
商品数量价格和货品不一致
'
);
...
...
@@ -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
();
}
...
...
@@ -161,7 +161,7 @@ Page({
},
getCheckedSpecKey
:
function
()
{
let
checkedValue
=
this
.
getCheckedSpecValue
().
map
(
function
(
v
)
{
return
v
.
value
Id
;
return
v
.
value
Text
;
});
return
checkedValue
;
...
...
@@ -206,9 +206,9 @@ Page({
}
let
checkedProduct
=
checkedProductArray
[
0
];
if
(
checkedProduct
.
goodsN
umber
>
0
){
if
(
checkedProduct
.
n
umber
>
0
){
this
.
setData
({
checkedSpecPrice
:
checkedProduct
.
retailP
rice
,
checkedSpecPrice
:
checkedProduct
.
p
rice
,
soldout
:
false
});
}
...
...
@@ -231,7 +231,7 @@ Page({
},
getCheckedProductItem
:
function
(
key
)
{
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
;
}
else
{
return
false
;
...
...
@@ -293,7 +293,7 @@ Page({
}
}
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
)
{
let
_res
=
res
;
if
(
_res
.
errno
==
0
)
{
...
...
@@ -354,7 +354,7 @@ Page({
let
checkedProduct
=
checkedProductArray
[
0
];
//验证库存
if
(
checkedProduct
.
goodsN
umber
<=
0
)
{
if
(
checkedProduct
.
n
umber
<=
0
)
{
wx
.
showToast
({
image
:
'
/static/images/icon_error.png
'
,
title
:
'
没有库存
'
...
...
@@ -420,7 +420,7 @@ Page({
let
checkedProduct
=
checkedProductArray
[
0
];
//验证库存
if
(
checkedProduct
.
goodsN
umber
<=
0
)
{
if
(
checkedProduct
.
n
umber
<=
0
)
{
wx
.
showToast
({
image
:
'
/static/images/icon_error.png
'
,
title
:
'
没有库存
'
...
...
litemall-wx/pages/goods/goods.wxml
View file @
b68151cb
...
...
@@ -28,7 +28,7 @@
</view>
<view class="comments" wx:if="{{comment.count > 0}}">
<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="i">查看全部</text>
</navigator>
...
...
@@ -54,8 +54,8 @@
<view class="goods-attr">
<view class="t">商品参数</view>
<view class="l">
<view class="item" wx:for="{{attribute}}" wx:key="
name
">
<text class="left">{{item.
nam
e}}</text>
<view class="item" wx:for="{{attribute}}" wx:key="
item
">
<text class="left">{{item.
attribut
e}}</text>
<text class="right">{{item.value}}</text>
</view>
</view>
...
...
@@ -92,7 +92,7 @@
<view class="b">
<view class="item" wx:for="{{relatedGoods}}" wx:key="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="price">¥{{item.retailPrice}}</text>
</navigator>
...
...
@@ -102,7 +102,7 @@
</view>
<view wx:if="{{openAttr}}" class="attr-pop">
<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="c">
<view class="p">价格:¥{{checkedSpecPrice}}</view>
...
...
litemall-wx/pages/hotGoods/hotGoods.js
View file @
b68151cb
...
...
@@ -13,6 +13,7 @@ Page({
goodsList
:
[],
categoryId
:
0
,
currentSortType
:
'
default
'
,
currentSort
:
'
add_time
'
,
currentSortOrder
:
'
desc
'
,
page
:
1
,
size
:
100
...
...
@@ -42,7 +43,7 @@ Page({
getGoodsList
:
function
(){
var
that
=
this
;
util
.
request
(
api
.
GoodsList
,
{
isHot
:
1
,
page
:
that
.
data
.
page
,
size
:
that
.
data
.
size
,
order
:
that
.
data
.
currentSortOrder
,
sort
:
that
.
data
.
currentSort
Type
,
categoryId
:
that
.
data
.
categoryId
})
util
.
request
(
api
.
GoodsList
,
{
isHot
:
true
,
page
:
that
.
data
.
page
,
size
:
that
.
data
.
size
,
order
:
that
.
data
.
currentSortOrder
,
sort
:
that
.
data
.
currentSort
,
categoryId
:
that
.
data
.
categoryId
})
.
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
...
...
@@ -80,7 +81,8 @@ Page({
this
.
setData
({
categoryFilter
:
!
this
.
data
.
categoryFilter
,
currentSortType
:
'
category
'
,
currentSortOrder
:
'
asc
'
currentSort
:
'
add_time
'
,
currentSortOrder
:
'
desc
'
});
break
;
case
'
priceSort
'
:
...
...
@@ -90,6 +92,7 @@ Page({
}
this
.
setData
({
currentSortType
:
'
price
'
,
currentSort
:
'
retail_price
'
,
currentSortOrder
:
tmpSortOrder
,
categoryFilter
:
false
});
...
...
@@ -100,6 +103,7 @@ Page({
//综合排序
this
.
setData
({
currentSortType
:
'
default
'
,
currentSort
:
'
add_time
'
,
currentSortOrder
:
'
desc
'
,
categoryFilter
:
false
,
categoryId
:
0
,
...
...
litemall-wx/pages/hotGoods/hotGoods.wxml
View file @
b68151cb
...
...
@@ -30,7 +30,7 @@
<view class="b">
<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}}">
<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="price">¥{{iitem.retailPrice}}</text>
</navigator>
...
...
litemall-wx/pages/index/index.wxml
View file @
b68151cb
...
...
@@ -46,7 +46,7 @@
<view class="b">
<view class="item" wx:for="{{newGoods}}" wx:for-index="index" wx:for-item="item" wx:key="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="price">¥{{item.retailPrice}}</text>
</navigator>
...
...
@@ -64,11 +64,11 @@
<view class="b">
<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}}">
<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="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>
</view>
</view>
...
...
@@ -88,10 +88,10 @@
<scroll-view scroll-x class="list">
<view class="item" wx:for="{{topics}}" wx:for-index="index" wx:for-item="item" wx:key="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">
<text class="name">{{item.title}}</text>
<text class="price">¥{{item.price
Info
}}元起</text>
<text class="price">¥{{item.price}}元起</text>
</view>
<text class="desc">{{item.subtitle}}</text>
</navigator>
...
...
@@ -109,7 +109,7 @@
<block wx:for="{{item.goodsList}}" wx:for-index="iindex" wx:for-item="iitem" wx:key="id">
<view class="item {{iindex % 2 == 0 ? '' : 'item-b'}}">
<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="price">¥{{iitem.retailPrice}}</text>
</navigator>
...
...
litemall-wx/pages/index/index.wxss
View file @
b68151cb
...
...
@@ -96,12 +96,12 @@
display: block;
font-size: 33rpx;
height: 43rpx;
color: #
333
;
color: #
fff
;
}
.a-brand .mt .price, .a-brand .mt .unit {
font-size: 25rpx;
color: #
999
;
color: #
fff
;
}
.a-brand .item-1 {
...
...
litemall-wx/pages/newGoods/newGoods.js
View file @
b68151cb
...
...
@@ -13,6 +13,7 @@ Page({
goodsList
:
[],
categoryId
:
0
,
currentSortType
:
'
default
'
,
currentSort
:
'
add_time
'
,
currentSortOrder
:
'
desc
'
,
page
:
1
,
size
:
100
...
...
@@ -30,7 +31,7 @@ Page({
getGoodsList
:
function
()
{
var
that
=
this
;
util
.
request
(
api
.
GoodsList
,
{
isNew
:
1
,
page
:
that
.
data
.
page
,
size
:
that
.
data
.
size
,
order
:
that
.
data
.
currentSortOrder
,
sort
:
that
.
data
.
currentSort
Type
,
categoryId
:
that
.
data
.
categoryId
})
util
.
request
(
api
.
GoodsList
,
{
isNew
:
true
,
page
:
that
.
data
.
page
,
size
:
that
.
data
.
size
,
order
:
that
.
data
.
currentSortOrder
,
sort
:
that
.
data
.
currentSort
,
categoryId
:
that
.
data
.
categoryId
})
.
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
that
.
setData
({
...
...
@@ -67,7 +68,8 @@ Page({
this
.
setData
({
categoryFilter
:
!
this
.
data
.
categoryFilter
,
currentSortType
:
'
category
'
,
currentSortOrder
:
'
asc
'
currentSort
:
'
add_time
'
,
currentSortOrder
:
'
desc
'
});
break
;
case
'
priceSort
'
:
...
...
@@ -77,6 +79,7 @@ Page({
}
this
.
setData
({
currentSortType
:
'
price
'
,
currentSort
:
'
retail_price
'
,
currentSortOrder
:
tmpSortOrder
,
categoryFilter
:
false
});
...
...
@@ -87,6 +90,7 @@ Page({
//综合排序
this
.
setData
({
currentSortType
:
'
default
'
,
currentSort
:
'
add_time
'
,
currentSortOrder
:
'
desc
'
,
categoryFilter
:
false
,
categoryId
:
0
...
...
litemall-wx/pages/newGoods/newGoods.wxml
View file @
b68151cb
...
...
@@ -30,7 +30,7 @@
<view class="b">
<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}}">
<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="price">¥{{iitem.retailPrice}}</text>
</navigator>
...
...
litemall-wx/pages/shopping/addressAdd/addressAdd.js
View file @
b68151cb
...
...
@@ -287,7 +287,7 @@ Page({
return
false
;
}
if
(
!
check
.
isValidPhone
(
this
.
data
.
mobile
))
{
if
(
!
check
.
isValidPhone
(
address
.
mobile
))
{
util
.
showErrorToast
(
'
手机号不正确
'
);
return
false
;
}
...
...
litemall-wx/pages/shopping/checkout/checkout.js
View file @
b68151cb
...
...
@@ -162,6 +162,11 @@ Page({
}
});
}
else
{
wx
.
redirectTo
({
url
:
'
/pages/payResult/payResult?status=0&orderId=
'
+
orderId
});
}
});
}
else
{
...
...
litemall-wx/pages/shopping/checkout/checkout.wxml
View file @
b68151cb
...
...
@@ -72,8 +72,8 @@
<text class="name">{{item.goodsName}}</text>
<text class="number">x{{item.number}}</text>
</view>
<view class="m">{{item.
goodsS
pecification
Value
s}}</view>
<view class="b">¥{{item.
retailP
rice}}</view>
<view class="m">{{item.
s
pecifications}}</view>
<view class="b">¥{{item.
p
rice}}</view>
</view>
</view>
</view>
...
...
litemall-wx/pages/topic/topic.wxml
View file @
b68151cb
<view class="container">
<scroll-view class="topic-list" scroll-y="true" scroll-top="{{scrollTop}}">
<navigator class="item" wx:for="{{topicList}}" wx:key="id" url="../topicDetail/topicDetail?id={{item.id}}">
<image class="img" src="{{item.
sceneP
icUrl}}"></image>
<image class="img" src="{{item.
p
icUrl}}"></image>
<view class="info">
<text class="title">{{item.title}}</text>
<text class="desc">{{item.subtitle}}</text>
<text class="price">{{item.price
Info
}}元起</text>
<text class="price">{{item.price}}元起</text>
</view>
</navigator>
<view class="page" wx:if="{{showPage}}">
...
...
litemall-wx/pages/topicComment/topicComment.js
View file @
b68151cb
...
...
@@ -8,7 +8,7 @@ Page({
comments
:
[],
allCommentList
:
[],
picCommentList
:
[],
type
Id
:
0
,
type
:
0
,
valueId
:
0
,
showType
:
0
,
allCount
:
0
,
...
...
@@ -19,7 +19,7 @@ Page({
},
getCommentCount
:
function
()
{
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
)
{
that
.
setData
({
...
...
@@ -33,7 +33,7 @@ Page({
let
that
=
this
;
util
.
request
(
api
.
CommentList
,
{
valueId
:
that
.
data
.
valueId
,
type
Id
:
that
.
data
.
type
Id
,
type
:
that
.
data
.
type
,
size
:
that
.
data
.
size
,
page
:
(
that
.
data
.
showType
==
0
?
that
.
data
.
allPage
:
that
.
data
.
picPage
),
showType
:
that
.
data
.
showType
...
...
@@ -59,7 +59,7 @@ Page({
onLoad
:
function
(
options
)
{
// 页面初始化 options为页面跳转所带来的参数
this
.
setData
({
type
Id
:
options
.
type
Id
,
type
:
options
.
type
,
valueId
:
options
.
valueId
});
this
.
getCommentCount
();
...
...
litemall-wx/pages/topicCommentPost/topicCommentPost.js
View file @
b68151cb
...
...
@@ -97,7 +97,7 @@ Page({
},
onLoad
:
function
(
options
)
{
if
(
parseInt
(
options
.
type
Id
)
!==
1
){
if
(
parseInt
(
options
.
type
)
!==
1
){
return
;
}
...
...
@@ -131,7 +131,7 @@ Page({
}
util
.
request
(
api
.
CommentPost
,
{
type
Id
:
1
,
type
:
1
,
valueId
:
that
.
data
.
valueId
,
content
:
that
.
data
.
content
,
star
:
that
.
data
.
star
,
...
...
litemall-wx/pages/topicCommentPost/topicCommentPost.wxml
View file @
b68151cb
...
...
@@ -2,7 +2,7 @@
<view class="post-comment">
<view class="goods">
<view class="img">
<image src="{{topic.
sceneP
icUrl}}"></image>
<image src="{{topic.
p
icUrl}}"></image>
</view>
<view class="info">
<view class="t">
...
...
Prev
1
…
8
9
10
11
12
13
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