Skip to content

Commit

Permalink
carte page
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangxiaode committed Jan 9, 2019
1 parent ba331e4 commit e6cf87b
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 13 deletions.
12 changes: 6 additions & 6 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"pages": [
"pages/userCenter/index",

"pages/carte/index",
"pages/myCart/index",
"pages/hot/index",
"pages/dishOrders/index",

"pages/vip/index",
"pages/myGrade/index",
"pages/getGrade/index",
Expand All @@ -13,13 +17,9 @@
"pages/activities/index",
"pages/userInfo/index",

"pages/carte/index",
"pages/myCart/index",
"pages/hot/index",
"pages/dishOrders/index",

"pages/welcome/index",
"pages/index/index",
"pages/userCenter/index",
"pages/detail/index",
"pages/evaluate/index"
],
Expand Down
1 change: 1 addition & 0 deletions assets/openMenusIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions pages/carte/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ const app = getApp()

Page({
data: {
showMenu: false
},
openMenus(event) {
if (event.currentTarget.dataset.close) {
this.setData({
showMenu: false
})
} else {
this.setData({
showMenu: !this.data.showMenu
})
}
},
onLoad() {
},
Expand Down
18 changes: 17 additions & 1 deletion pages/carte/index.wxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
<!--index.wxml-->
<view class="carte">
carte
<scroll-view class="carteWrap">
<view class="carteBtns"></view>
<view class="carteList"></view>
<view class="copyRight">金风凝香 提供技术支持</view>
</scroll-view>
<view class="carteMenusMask {{showMenu ? 'showMenuMask' : ''}}" data-close="{{true}}" bindtap='openMenus'></view>
<view class="carteMenus {{showMenu ? 'showMenu' : ''}}">
<view class="menuList"></view>
<view class="openMenus" bindtap='openMenus'>
<image src="../../assets/openMenusIcon.svg"></image>
<text>菜单</text>
</view>
</view>
<view class="basket">
<image src="../../assets/cart.svg"></image>
<text>购物车</text>
</view>
</view>
104 changes: 99 additions & 5 deletions pages/carte/index.wxss
Original file line number Diff line number Diff line change
@@ -1,7 +1,101 @@
/**index.wxss**/
page{
height:100%;

page {
height: 100%;
}

.carte {
background: #dbd1de;
position: relative;
height: 100%;
}

.carteWrap {
}

.carteMenusMask {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 9;
background: rgba(0, 0, 0, 0.65);
transition: all 0.3s;
opacity: 0;
}

.showMenuMask {
opacity: 1;
}

.carteMenus {
position: absolute;
left: 0;
top: 0;
bottom: 0;
z-index: 10;
}

.carteMenus .menuList {
background: #e3e2e2;
width: 0;
height: 100%;
transition: all 0.3s;
}

.showMenu .menuList {
width: 290rpx;
}

.carteMenus .openMenus {
background: #e3e2e2;
width: 60rpx;
height: 100rpx;
padding-right: 15rpx;
position: absolute;
top: 50%;
right: -74rpx;
transform: translateY(-50%);
border-top-right-radius: 50%;
border-bottom-right-radius: 50%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.carteMenus .openMenus image {
width: 35rpx;
height: 35rpx;
}

.carteMenus .openMenus text {
font-size: 22rpx;
color: #8e8c8f;
}

.basket {
border-radius: 63rpx;
border: solid 5rpx #fff;
background: rgba(220, 80, 50, 1);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 116rpx;
height: 116rpx;
position: fixed;
bottom: 40rpx;
right: 30rpx;
}

.basket image {
width: 42rpx;
height: 42rpx;
}

.basket text {
font-size: 24rpx;
color: #fff;
}
.carte{
height:100%;
}
2 changes: 1 addition & 1 deletion pages/index/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@
<view class="evalsTotal" bindtap="goEvaluate">共有{{evalsInfo.total}}条评价 查看全部评价 <image src="../../assets/right.svg"></image></view>
</view>
<view class="copyRight">金风凝香 提供技术支持</view>
<view class="goPay" bindtap="goCarte"><image src="../../assets/carteIcon.svg"></image> 去点菜</view>
<!-- <view class="goPay" bindtap="goCarte"><image src="../../assets/carteIcon.svg"></image> 去点菜</view> -->
</scroll-view>
</view>

0 comments on commit e6cf87b

Please sign in to comment.