forked from shen100/wemall
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
218 additions
and
24 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,37 @@ | ||
var config = require('../../config/config.js'); | ||
|
||
Page({ | ||
data: { | ||
name: 'test' | ||
appName: config.name, | ||
carts: [] | ||
}, | ||
onLoad: function() { | ||
var carts = [ | ||
{ | ||
id: 1, | ||
name: "【爱宝宝母婴微商城】防腹泻奶粉——赋儿嘉", | ||
image: { | ||
url: "/upload/img/2017/05/28/4ad4c6f6-fc95-4a1e-940b-81f2e6bceaee.jpg" | ||
}, | ||
price: 198, | ||
count: 2 | ||
}, | ||
{ | ||
id: 2, | ||
name: "【爱宝宝母婴微商城】防腹泻奶粉", | ||
image: { | ||
url: "/upload/img/2017/05/28/4ad4c6f6-fc95-4a1e-940b-81f2e6bceaee.jpg" | ||
}, | ||
price: 298, | ||
count: 3 | ||
} | ||
] | ||
for (var i = 0; i < carts.length; i++) { | ||
carts[i].image.url = config.static.imageDomain + carts[i].image.url; | ||
carts[i].checked = true; | ||
} | ||
this.setData({ | ||
name: 'xxx' | ||
}) | ||
carts: carts | ||
}); | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"navigationBarTitleText": "购物车" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,35 @@ | ||
<!--购物车--> | ||
<view class="container log-list"> | ||
<text class="log-item">我的购物车</text> | ||
<view class="cart-box"> | ||
<scroll-view class="cart-box-scroll"> | ||
<view class="cart-wemall-header"> | ||
<view class="wemall-checkbox-container"> | ||
<image wx:if="{{allChecked}}" mode="aspectFit" src="../../icons/check.png" class="wemall-checkbox"></image> | ||
<image wx:else mode="aspectFit" src="../../icons/uncheck.png" class="wemall-checkbox"></image> | ||
</view> | ||
<view class="cart-wemall-logo-name"> | ||
<view> | ||
<image mode="aspectFit" src="../../icons/cart_logo.png" class="cart-wemall-logo"></image> | ||
</view> | ||
<view class="cart-wemall-name">{{appName}}</view> | ||
</view> | ||
<view class="wemall-action"> | ||
<view class="wemall-action-edit">编辑</view> | ||
</view> | ||
</view> | ||
<view class="cart-item" wx:for="{{carts}}" wx:key="{{item.id}}"> | ||
<view class="wemall-checkbox-container" style="margin-top: 70rpx;"> | ||
<image wx:if="{{item.checked}}" mode="aspectFit" src="../../icons/check.png" class="wemall-checkbox"></image> | ||
<image wx:else mode="aspectFit" src="../../icons/uncheck.png" class="wemall-checkbox"></image> | ||
</view> | ||
<view> | ||
<image class="product-image" mode="aspectFit" src="{{item.image.url}}"></image> | ||
</view> | ||
<view class="product-info"> | ||
<text class="product-name">{{item.name}}</text> | ||
<view class="product-price-box"> | ||
<view class="product-price">¥ {{item.price}}</view> | ||
<view class="product-count">X{{item.count}}</view> | ||
</view> | ||
</view> | ||
</view> | ||
</scroll-view> | ||
</view> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
page { | ||
width: 100%; | ||
height: 100%; | ||
font-size: 0; | ||
} | ||
|
||
.cart-box { | ||
background-color: #f9f9f9; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.cart-box-scroll { | ||
width: 100%; | ||
padding-bottom: 120rpx; | ||
background-color: #fff; | ||
} | ||
|
||
.cart-wemall-header { | ||
font-size: 0; | ||
margin-top: 30rpx; | ||
height: 80rpx; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
background-color: #fff; | ||
} | ||
|
||
.cart-wemall-logo-name { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
} | ||
|
||
.cart-wemall-logo { | ||
width: 40rpx; | ||
height: 40rpx; | ||
display: inline-block; | ||
vertical-align: top; | ||
} | ||
|
||
.cart-wemall-name { | ||
padding-left: 10rpx; | ||
font-size: 40rpx; | ||
line-height: 40rpx; | ||
color: #222; | ||
} | ||
|
||
.wemall-action { | ||
display: flex; | ||
flex: 1; | ||
text-align: right; | ||
padding-right: 30rpx; | ||
} | ||
|
||
.wemall-action-edit { | ||
flex: 1; | ||
color: #666; | ||
font-size: 32rpx; | ||
line-height: 32rpx; | ||
} | ||
|
||
.wemall-checkbox-container { | ||
text-align: center; | ||
width: 90rpx; | ||
height: 90rpx; | ||
} | ||
|
||
.wemall-checkbox { | ||
width: 48rpx; | ||
height: 48rpx; | ||
} | ||
|
||
.cart-item { | ||
padding-top: 20rpx; | ||
display: flex; | ||
flex-direction: row; | ||
margin-bottom: 36rpx; | ||
background-color: #f9f9f9; | ||
} | ||
|
||
.product-image { | ||
width: 200rpx; | ||
height: 200rpx; | ||
} | ||
|
||
.product-info { | ||
margin-left: 20rpx; | ||
flex: 1; | ||
display: flex; | ||
flex-direction: column; | ||
margin-right: 30rpx; | ||
} | ||
|
||
.product-name { | ||
font-size: 36rpx; | ||
color: #222; | ||
line-height: 50rpx; | ||
} | ||
|
||
.product-price-box { | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
|
||
.product-price { | ||
font-size: 36rpx; | ||
} | ||
|
||
.product-count { | ||
font-size: 36rpx; | ||
flex: 1; | ||
text-align: right; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters