diff --git a/前端/miniprogram/pages/dishes/dishes.js b/前端/miniprogram/pages/dishes/dishes.js new file mode 100644 index 0000000..b10f9fd --- /dev/null +++ b/前端/miniprogram/pages/dishes/dishes.js @@ -0,0 +1,68 @@ +const app = getApp(); +Page({ + data: { + time_type:0, + upperbound:null, + lowerbound:null, + userInfo: {}, + hasUserInfo: false, + detailedmenu:null, + loading:true + }, + onLoad:function(options){ + var time_type + this.setData({ + upperbound:Number(options.upperbound), + lowerbound:Number(options.lowerbound), + }) + if (this.data.upperbound == 30){ + time_type = 0 + } + if (this.data.upperbound == 60){ + time_type = 1 + } + if (this.data.upperbound == 9999){ + time_type = 2 + } + this.setData({ + time_type:time_type, + }) + }, + get_menu(){ + var that = this + wx.cloud.callContainer({ + "config": { + "env": "prod-2g058voqbea31ecb" + }, + "path": "menu/menus/", + "header": { + "X-WX-SERVICE": "django-5198", + 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' + }, + "method": "GET", + data:{upper_bound:that.data.upperbound,lower_bound:that.data.lowerbound}, + success(res){ + let arr = app.parse_json(res) + that.setData({ + detailedmenu:arr, + loading:false + }) + } + }) + }, + onShow(){ + this.get_menu() + }, + onTapMenu(e){ + var item = JSON.stringify(e.currentTarget.dataset.product) + wx.navigateTo({ + url: '../menu/menu?item='+item + }) + }, + back(){ + wx.navigateBack({ + delta: 0, + }) + }, + }) + \ No newline at end of file diff --git a/前端/miniprogram/pages/dishes/dishes.json b/前端/miniprogram/pages/dishes/dishes.json new file mode 100644 index 0000000..e02aef2 --- /dev/null +++ b/前端/miniprogram/pages/dishes/dishes.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/前端/miniprogram/pages/dishes/dishes.wxml b/前端/miniprogram/pages/dishes/dishes.wxml new file mode 100644 index 0000000..7a49e1e --- /dev/null +++ b/前端/miniprogram/pages/dishes/dishes.wxml @@ -0,0 +1,37 @@ + +加载中 + + + + 随便吃吃(少于30分钟) + + + 吃点好的(30到60分钟) + + + 吃个大餐(多于60分钟) + + + + < + + + + + + + + {{item.name}} {{item.time}}分钟 + + + + + + + SOMETHING!! + + + need to be here... + + + \ No newline at end of file diff --git a/前端/miniprogram/pages/dishes/dishes.wxss b/前端/miniprogram/pages/dishes/dishes.wxss new file mode 100644 index 0000000..09bf98c --- /dev/null +++ b/前端/miniprogram/pages/dishes/dishes.wxss @@ -0,0 +1,79 @@ +/**dishes.wxss**/ +.page{ + /* background: #F0E68C; */ + min-height:100vh; + background-image: linear-gradient(to right, #ffc3a0 0%, #fcd4da 100%); +} +.profile{ + padding: 30rpx; + padding-top: 70rpx; + margin: 0 auto; + text-align: center; + font-weight: bold; + font-size: 120%; + color: #B8860B ; + border-radius: 0rpx 0rpx 40rpx 40rpx; + background-color: rgba(255, 255, 255, 0.75); +} +.page-body{ + margin-top: 20rpx; + /* margin-bottom: 20rpx; */ + margin-left: 20rpx; + margin-right: 20rpx; + /* background-image: linear-gradient(to top, #ace0f9 0%, #fff1eb 100%); */ + border-radius: 20px 20px 20px 20px; + box-shadow: 4px 4px 4px rgba(26, 77, 160, 0.16),inset 3px 3px 3px rgba(255, 255, 255, 0.15); +} + +.menu{ + background:rgba(255, 254, 252, 0.733); + width:85%; + height:8%; + margin: auto; + font-weight:normal; + font-size: 17px; + padding-left: 5%; + padding-right: 5%; + padding-top: 5%; + padding-bottom: 5%; + margin-bottom: 20rpx; + box-shadow: 0 0px 5px 0 rgba( 31, 38, 135, 0.37 ); + -webkit-backdrop-filter: blur( 14px ); + border-radius: 10px; + border: 1px solid rgba( 255, 255, 255, 0.18 ); + z-index: 1; +} + +.back{ + background-color: rgb(255, 255, 255); + border-radius: 20%; + } + +.add-something{ + font-size: xx-large; + font-style: inherit; + font-weight: bolder; + text-align: center; + color:white; +} + +.need{ + font-size: large; + font-style: inherit; + font-weight: normal; + text-align: right; + color:lightyellow; +} + +.loading{ + text-align: center; + width: 100%; + padding-top:40%; + z-index: 2; + margin: auto; + position: fixed; + font-weight:bold; + font-size: 20px; + color: white; + height: 100%; +} \ No newline at end of file