@ -1 +0,0 @@
|
||||
Subproject commit 8bf8671abfd7e034c559507dd85b7918b3d4666f
|
@ -0,0 +1,14 @@
|
||||
# Windows
|
||||
[Dd]esktop.ini
|
||||
Thumbs.db
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# macOS
|
||||
.DS_Store
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
|
||||
# Node.js
|
||||
node_modules/
|
@ -0,0 +1,55 @@
|
||||
import Init from '/utils/init.js'
|
||||
|
||||
//app.js
|
||||
App({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
...Init.data,},
|
||||
onLaunch: function () {
|
||||
|
||||
wx.getSystemInfo({
|
||||
success: e => {
|
||||
this.globalData.StatusBar = e.statusBarHeight;
|
||||
let custom = wx.getMenuButtonBoundingClientRect();
|
||||
this.globalData.Custom = custom;
|
||||
this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
|
||||
}
|
||||
})
|
||||
Init.init(true);//初始化meal
|
||||
// 展示本地存储能力
|
||||
var logs = wx.getStorageSync('logs') || []
|
||||
logs.unshift(Date.now())
|
||||
wx.setStorageSync('logs', logs)
|
||||
// 登录
|
||||
wx.login({
|
||||
success: res => {
|
||||
// 发送 res.code 到后台换取 openId, sessionKey, unionId
|
||||
}
|
||||
})
|
||||
// 获取用户信息
|
||||
wx.getSetting({
|
||||
success: res => {
|
||||
if (res.authSetting['scope.userInfo']) {
|
||||
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
|
||||
wx.getUserInfo({
|
||||
success: res => {
|
||||
// 可以将 res 发送给后台解码出 unionId
|
||||
this.globalData.userInfo = res.userInfo
|
||||
|
||||
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
|
||||
// 所以此处加入 callback 以防止这种情况
|
||||
if (this.userInfoReadyCallback) {
|
||||
this.userInfoReadyCallback(res)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
globalData: {
|
||||
userInfo: null
|
||||
},
|
||||
})
|
@ -0,0 +1,68 @@
|
||||
{
|
||||
"pages": [
|
||||
|
||||
"pages/index/index",
|
||||
"pages/shop/shop",
|
||||
"pages/build/build",
|
||||
"pages/search/search",
|
||||
"pages/search-food/search",
|
||||
"pages/details/details",
|
||||
"pages/confirmOrder/confirmOrder",
|
||||
"pages/user/home",
|
||||
"pages/diary/diary",
|
||||
"pages/home/home",
|
||||
"pages/logs/logs",
|
||||
"pages/meals/index",
|
||||
"pages/foods/index",
|
||||
"pages/searchresult/searchresult",
|
||||
"pages/body/body",
|
||||
"pages/calendar/calendar",
|
||||
"pages/help/help",
|
||||
"pages/mode/mode",
|
||||
"pages/Recipe_details/index"
|
||||
],
|
||||
"window": {
|
||||
"navigationStyle": "custom"
|
||||
},
|
||||
"usingComponents": {
|
||||
"cu-custom": "/colorui/components/cu-custom"
|
||||
},
|
||||
"tabBar": {
|
||||
"backgroundColor": "#fff",
|
||||
"selectedColor": "#0e9eda",
|
||||
"color": "#8a8a8a",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"text": "搜索",
|
||||
"iconPath": "images/search.png",
|
||||
"selectedIconPath": "images/search-blue.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/build/build",
|
||||
"text": "制作",
|
||||
"iconPath": "images/build.png",
|
||||
"selectedIconPath": "images/build-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/diary/diary",
|
||||
"text": "日记",
|
||||
"iconPath": "images/diary.png",
|
||||
"selectedIconPath": "images/diary-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/shop/shop",
|
||||
"text": "推荐",
|
||||
"iconPath": "images/shop.png",
|
||||
"selectedIconPath": "images/shop-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/user/home",
|
||||
"text": "用户",
|
||||
"iconPath": "images/self.png",
|
||||
"selectedIconPath": "images/self-active.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sitemapLocation": "sitemap.json"
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
@import 'weui.wxss';
|
||||
@import 'common.wxss';
|
||||
@import "colorui/main.wxss";
|
||||
@import "colorui/icon.wxss";
|
||||
|
||||
/**app.wxss**/
|
||||
.container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 200rpx 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.bc_red{
|
||||
background-color:dodgerblue;
|
||||
}
|
||||
.bc_white{
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.new_padd{
|
||||
padding: 0rpx 30rpx 15rpx 30rpx;
|
||||
}
|
||||
.color_white{
|
||||
color: #fff;
|
||||
}
|
||||
.bg_white{
|
||||
color:#ffffff;
|
||||
}
|
||||
|
@ -0,0 +1,184 @@
|
||||
/*
|
||||
Animation 微动画
|
||||
基于ColorUI组建库的动画模块 by 文晓港 2019年3月26日19:52:28
|
||||
*/
|
||||
|
||||
/* css 滤镜 控制黑白底色gif的 */
|
||||
.gif-black{
|
||||
mix-blend-mode: screen;
|
||||
}
|
||||
.gif-white{
|
||||
mix-blend-mode: multiply;
|
||||
}
|
||||
|
||||
|
||||
/* Animation css */
|
||||
[class*=animation-] {
|
||||
animation-duration: .5s;
|
||||
animation-timing-function: ease-out;
|
||||
animation-fill-mode: both
|
||||
}
|
||||
|
||||
.animation-fade {
|
||||
animation-name: fade;
|
||||
animation-duration: .8s;
|
||||
animation-timing-function: linear
|
||||
}
|
||||
|
||||
.animation-scale-up {
|
||||
animation-name: scale-up
|
||||
}
|
||||
|
||||
.animation-scale-down {
|
||||
animation-name: scale-down
|
||||
}
|
||||
|
||||
.animation-slide-top {
|
||||
animation-name: slide-top
|
||||
}
|
||||
|
||||
.animation-slide-bottom {
|
||||
animation-name: slide-bottom
|
||||
}
|
||||
|
||||
.animation-slide-left {
|
||||
animation-name: slide-left
|
||||
}
|
||||
|
||||
.animation-slide-right {
|
||||
animation-name: slide-right
|
||||
}
|
||||
|
||||
.animation-shake {
|
||||
animation-name: shake
|
||||
}
|
||||
|
||||
.animation-reverse {
|
||||
animation-direction: reverse
|
||||
}
|
||||
|
||||
@keyframes fade {
|
||||
0% {
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes scale-up {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: scale(.2)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: scale(1)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes scale-down {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: scale(1.8)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: scale(1)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slide-top {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(-100%)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slide-bottom {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(100%)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes shake {
|
||||
|
||||
0%,
|
||||
100% {
|
||||
transform: translateX(0)
|
||||
}
|
||||
|
||||
10% {
|
||||
transform: translateX(-9px)
|
||||
}
|
||||
|
||||
20% {
|
||||
transform: translateX(8px)
|
||||
}
|
||||
|
||||
30% {
|
||||
transform: translateX(-7px)
|
||||
}
|
||||
|
||||
40% {
|
||||
transform: translateX(6px)
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: translateX(-5px)
|
||||
}
|
||||
|
||||
60% {
|
||||
transform: translateX(4px)
|
||||
}
|
||||
|
||||
70% {
|
||||
transform: translateX(-3px)
|
||||
}
|
||||
|
||||
80% {
|
||||
transform: translateX(2px)
|
||||
}
|
||||
|
||||
90% {
|
||||
transform: translateX(-1px)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slide-left {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateX(-100%)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateX(0)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slide-right {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateX(100%)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateX(0)
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
const app = getApp();
|
||||
Component({
|
||||
/**
|
||||
* 组件的一些选项
|
||||
*/
|
||||
options: {
|
||||
addGlobalClass: true,
|
||||
multipleSlots: true
|
||||
},
|
||||
/**
|
||||
* 组件的对外属性
|
||||
*/
|
||||
properties: {
|
||||
bgColor: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
isCustom: {
|
||||
type: [Boolean, String],
|
||||
default: false
|
||||
},
|
||||
isBack: {
|
||||
type: [Boolean, String],
|
||||
default: false
|
||||
},
|
||||
bgImage: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
},
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
StatusBar: app.globalData.StatusBar,
|
||||
CustomBar: app.globalData.CustomBar,
|
||||
Custom: app.globalData.Custom
|
||||
},
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
BackPage() {
|
||||
wx.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
},
|
||||
toHome(){
|
||||
wx.reLaunch({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<view class="cu-custom" style="height:{{CustomBar}}px">
|
||||
<view class="cu-bar fixed {{bgImage!=''?'none-bg text-white bg-img':''}} {{bgColor}}" style="height:{{CustomBar}}px;padding-top:{{StatusBar}}px;{{bgImage?'background-image:url(' + bgImage+')':''}}">
|
||||
<view class="action" bindtap="BackPage" wx:if="{{isBack}}">
|
||||
<text class="cuIcon-back"></text>
|
||||
<slot name="backText"></slot>
|
||||
</view>
|
||||
<view class="action border-custom" wx:if="{{isCustom}}" style="width:{{Custom.width}}px;height:{{Custom.height}}px;margin-left:calc(750rpx - {{Custom.right}}px)">
|
||||
<text class="cuIcon-back" bindtap="BackPage"></text>
|
||||
<text class="cuIcon-homefill" bindtap="toHome"></text>
|
||||
</view>
|
||||
<view class="content" style="top:{{StatusBar}}px">
|
||||
<slot name="content"></slot>
|
||||
</view>
|
||||
<slot name="right"></slot>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1 @@
|
||||
/* colorui/components/cu-custom.wxss */
|
@ -0,0 +1,34 @@
|
||||
|
||||
|
||||
|
||||
/*icon图标 */
|
||||
@font-face {
|
||||
font-family: 'iconfont';
|
||||
src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAXcAA0AAAAACFgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAFwAAAABoAAAAcf7+j60dERUYAAAWkAAAAHAAAAB4AJwAMT1MvMgAAAaAAAABCAAAAVlbmSABjbWFwAAAB/AAAAE4AAAFKy8chmmdhc3AAAAWcAAAACAAAAAj//wADZ2x5ZgAAAlwAAAHLAAACLGyxjtFoZWFkAAABMAAAADAAAAA2DrhOw2hoZWEAAAFgAAAAHQAAACQH0gOGaG10eAAAAeQAAAAWAAAAFg1MADZsb2NhAAACTAAAAA4AAAAOAYwAvm1heHAAAAGAAAAAHwAAACABFQBdbmFtZQAABCgAAAFJAAACiCnmEVVwb3N0AAAFdAAAACgAAAA7ElgeUHicY2BkYGAA4jNbVWvj+W2+MnCzMIDA1bOtSXCa638P8xfmMiCXg4EJJAoATAQL9XicY2BkYGBu+N/AEMPCAALMXxgYGVABKwBZEwNhAAAAeJxjYGRgYGBjCGRgZQABJiDmAkIGhv9gPgMAEUgBcwB4nGNgZP7BOIGBlYGBqZPpDAMDQz+EZnzNYMTIARRlYGVmwAoC0lxTGBwYKp6JMTf8b2CIYW5gaAAKM4LkACKWDHoAAAQAAAAAAAAAAVUAAAPpACwEAAAKAA4AAHicY2BgYGaAYBkGRgYQcAHyGMF8FgYNIM0GpBkZmBgqnon9/w/kVzwT/f//f7fke6h6IGBkY4BzGJmABBMDKmBkoBlgpp3RJAEAQpQKSAAAAAAAAAAAAAAAdgC+ARYAAHicfZC/btNQFMbPuTfXsXMdp7Hj/00Tx9QGtUQiccNQtR1g4c9QiYmRBwCkDu3C0AWJoUN5BYTEA2TtlOQNnEgMLAiidmRgtG64JsDI1dHV90m/o/OdAwx2V1/pFfXAgttwDx7CMQAqO9gzSBujNOuTHbQjZrstg6ZxGlXjXp8eoNtTWs5glCWuUlUaaOAWDqPBKO2TFPeyQ7KPA6eN6IfBM3N706SXWPPSrbfiMfmAdifebBzeFY92j1qDrqWe6abpm+aFqjCmElJpGPjSdTSm1RTxkTUC+6pzh3RQ99Pg6fN6NzRfvMtetbddDfH8HK2wa3w6agZNWW8CxzL96kZd9YJ6fKuFZ9+5Z+nt5BvIR6G2uqA/6SlwcCEu94SqA+4I7idAE0ilkFYBKyq3K/fJElzNxVJRMJwvMGRMLBdTUTCGlekMK9IXTLxWdV3F9/KnpyWwEEsJhAvZUDyQ5OwPOZuJAr9wk8ta5zFWl/QHPfmdZ/ifPPFelvSUNsZlrn20y9Mf4HCdLxc3Mp+Xz9GTU27mEyHkeDKZIpFeVMa8ycca59pfQU+YuM5zcS0xP8/RL56U/GTNT2Q/fh6rnKtjfUP/J+AXSs57JgB4nH2QPU4DMRCFn/MHJBJCIKhdUQDa/JQpEyn0CKWjSDbekGjXXnmdSDkBLRUHoOUYHIAbINFyCl6WSZMia+3o85uZ57EBnOMbCv/fJe6EFY7xKFzBETLhKvUX4Rr5XbiOFj6FG9R/hJu4VQPhFi7UGx1U7YS7m9JtywpnGAhXcIon4Sr1lXCN/CpcxxU+hBvUv4SbGONXuIVrZakM4WEwQWCcQWOKDeMCMRwskjIG1qE59GYSzExPN3oRO5s4GyjvV2KXAx5oOeeAKe09t2a+Sif+YMuB1JhuHgVLtimNLiJ0KBtfLJzV3ahzsP2e7ba02L9rgTXH7FENbNT8Pdsz0khsDK+QkjXyMrekElOPaGus8btnKdbzXgiJTrzL9IjHmjR1OvduaeLA4ufyjBx9tLmSPfeoHD5jWQh5v91OxCCKXYY/k9hxGQAAAHicY2BigAAuBuyADYgZGZgYohmZGJnZcjPzSouNWAtySosNASgNBNYAAAAB//8AAnicY2BkYGDgAWIxIGZiYARCViBmAfMYAAPVADR4nGNgYGBkAIIrKjPVQPTVs61JMBoAQ08GywAA) format('woff'),
|
||||
url('iconfont.ttf') format('truetype');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
.iconfont {
|
||||
font-family:"iconfont" !important;
|
||||
font-size:16px;
|
||||
font-style:normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-minus2:before { content: "\e615"; }
|
||||
|
||||
.icon-plus1:before { content: "\e616"; }
|
||||
/*公共头部 */
|
||||
.posi_fiexd {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 100;
|
||||
}
|
||||
/*店铺图片圆角 */
|
||||
.bd_radius {
|
||||
border-radius: 50%;
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
<view class="header">
|
||||
<view class="iconfont" data-id="0" bindtap='dataBefor'>
|
||||
<image class='iconimage' src='/images/roundleft.png'></image>
|
||||
</view>
|
||||
<view class="btn flex-center" bindtap="dateSelection">
|
||||
<view class="text">{{selectDay}}</view>
|
||||
</view>
|
||||
<view class="iconfont" data-id="1" bindtap='dataBefor'>
|
||||
<image class='iconimage' src='/images/roundright.png'></image>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if='{{!calShow}}' class="{{isOpen?'':'calendar-box'}} {{dateShow?'active':''}}">
|
||||
<view class="calendar-wrapper {{dateShow?'active':''}}">
|
||||
<view class="calendar-panel">
|
||||
<view class="date-befor" data-id="0" data-type="month" bindtap='dataBefor'>
|
||||
<text class="iconfont">
|
||||
<text class='left color'></text>
|
||||
</text>
|
||||
</view>
|
||||
<view class="calendar-panel-box">
|
||||
<view>{{canlender.year}}年</view>
|
||||
<view>{{canlender.month}}月</view>
|
||||
</view>
|
||||
<view class="date-after" data-id="1" data-type="month" bindtap='dataBefor'>
|
||||
<text class="iconfont">
|
||||
<text class='right color'></text>
|
||||
</text>
|
||||
</view>
|
||||
<view class='backtoday' bindtap='backtoday'>
|
||||
回到今天
|
||||
</view>
|
||||
</view>
|
||||
<view class="calendar-header">
|
||||
<view>日</view>
|
||||
<view>一</view>
|
||||
<view>二</view>
|
||||
<view>三</view>
|
||||
<view>四</view>
|
||||
<view>五</view>
|
||||
<view>六</view>
|
||||
</view>
|
||||
<view class="calendar-body">
|
||||
<block wx:for="{{canlender.weeks}}" wx:for-item="weeks" wx:for-index="week" wx:key="weeks">
|
||||
<view class="calender-body-date-week">
|
||||
<block wx:for="{{weeks}}" wx:for-item="day" wx:key="day">
|
||||
<view class="date {{canlender.month === day.month? '' : 'placeholder'}} {{(day.date==canlender.date||day.checked) && canlender.month == day.month?'date-current': ''}} " data-week="{{week}}" data-index="{{index}}" data-ischeck="{{canlender.month === day.month}}"
|
||||
bindtap='selectDay'>
|
||||
{{day.date}}
|
||||
<view wx:if="{{day.have}}" class="data-circle"></view>
|
||||
|
||||
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="packup" bindtap='packup'>确定</view>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,195 @@
|
||||
/* pages/calendar/calendar.wxss */
|
||||
|
||||
.calendar-box {
|
||||
position: absolute;
|
||||
top: 50rpx;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
z-index: 999;
|
||||
padding-top: 100rpx;
|
||||
box-sizing: border-box;
|
||||
transition: all 0.3s;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.calendar-box.active {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.calendar-wrapper {
|
||||
width: 100%;
|
||||
border-top: 1px #f5f5f5 solid;
|
||||
box-sizing: border-box;
|
||||
font-size: 26rpx;
|
||||
background: #fff;
|
||||
transition: all 0.3s;
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
|
||||
.calendar-wrapper.active {
|
||||
transform: translateY(0%);
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
height: 100rpx;
|
||||
/* width: 100%; */
|
||||
background:#fff;
|
||||
/* padding: 0 30rpx; */
|
||||
z-index: 10000;
|
||||
}
|
||||
|
||||
.top-jiantou {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
line-height: 100rpx;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
width: 53rpx;
|
||||
height: 53rpx;
|
||||
color:#0e9eda;
|
||||
}
|
||||
.iconimage{
|
||||
width:40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 0 30rpx;
|
||||
width: 150rpx;
|
||||
height: 53rpx;
|
||||
color: #0e9eda;
|
||||
font-size: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.calendar-panel {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 32rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.backtoday {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 15rpx;
|
||||
padding: 0 10rpx;
|
||||
padding-left: 20rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
border: 1px #0e9eda solid;
|
||||
border-right: none;
|
||||
font-size: 28rpx;
|
||||
border-top-left-radius: 50rpx;
|
||||
border-bottom-left-radius: 50rpx;
|
||||
color: #0e9eda;
|
||||
background: rgba(82, 184, 245, 0.1);
|
||||
}
|
||||
|
||||
.date-befor, .date-after {
|
||||
/* border: 1px red solid; */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 80rpx;
|
||||
width: 80rpx;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
/* margin-right: 20rpx; */
|
||||
}
|
||||
|
||||
/* .date-after {
|
||||
margin-left: 20rpx;
|
||||
} */
|
||||
|
||||
.calendar-panel-box {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.calendar-header {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.calendar-header view {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
color: #0e9eda;
|
||||
}
|
||||
|
||||
.calendar-body {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.calender-body-date-week {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
border-bottom: 1px #f5f5f5 solid;
|
||||
}
|
||||
|
||||
.date {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #1c1c1c;
|
||||
background: #fff;
|
||||
line-height: 100rpx;
|
||||
}
|
||||
|
||||
.date.active {
|
||||
background: red;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
color: #a4a4a4;
|
||||
}
|
||||
|
||||
.date-current {
|
||||
background: #0e9eda;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.data-circle {
|
||||
position: absolute;
|
||||
bottom: 25.5rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: auto;
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
border-radius: 50%;
|
||||
border:1px solid #0e9eda;
|
||||
background: #0e9eda;
|
||||
z-index: 2;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.packup {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
color: #0e9eda;
|
||||
}
|
||||
|
||||
.flex-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 643 B |
After Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 8.5 KiB |
After Width: | Height: | Size: 60 KiB |
After Width: | Height: | Size: 158 KiB |
After Width: | Height: | Size: 8.7 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 87 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 97 KiB |
@ -0,0 +1,186 @@
|
||||
import Data from '../../utils/data.js'
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
recommendList:[],
|
||||
foods: [{ name: '鸡蛋', quantity: '5个' }, { name: '番茄', quantity: '5个' }, { name: '葱', quantity: '1根' }, { name: '盐', quantity: '1勺' }, { name: '油', quantity: '适量' }, { name: '砂糖', quantity: '少许' },],
|
||||
steps: [{
|
||||
image:'http://i2.chuimg.com/5bcd1e1f8acb4179a73231b37783b80b_2048w_1722h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "选择比较成熟的番茄,捏着比较软,这样的番茄多汁,味道好一些,然后用刀划十字,放入开水里面烫一下,过入凉水,去皮"
|
||||
}, {
|
||||
image: 'http://i2.chuimg.com/38fbba613b844b198311dbd43f5c6683_2022w_2048h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "番茄切成小块儿,喜欢多汁的就切碎一点"
|
||||
}, {
|
||||
image: 'http://i2.chuimg.com/2fd03bec614a46ab841d8208d3e28bf9_2000w_2668h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "大蒜去皮切成蒜末"
|
||||
}, {
|
||||
image: 'http://i2.chuimg.com/c0b9dea31a90433092d43dea7ea54363_2208w_1536h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "小葱切碎"
|
||||
}, {
|
||||
image: 'http://i2.chuimg.com/d539ffda408d4214ae22d57b2d1d4bd5_2048w_1804h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "鸡蛋加少许盐打散"
|
||||
}, {
|
||||
image: 'http://i2.chuimg.com/b683696efb95484c90500761b491a8b7_2668w_2668h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "锅里放油烧热,倒入蛋液,用筷子划,凝固就可以出锅备用"
|
||||
}, {
|
||||
image: 'http://i2.chuimg.com/7797e400f6c345dcb27e05fa2dfafaa8_2668w_2668h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "就着炒鸡蛋的油,可以不再放油,锅里放入番茄翻炒,加入盐"
|
||||
}, {
|
||||
image: 'http://i2.chuimg.com/295a0a61d7f64641b1e709cb04ed16bb_2000w_2668h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "汤汁比较浓厚时,放入炒好的鸡蛋"
|
||||
}, {
|
||||
image: 'http://i2.chuimg.com/c96a27ef3e1c45c0910d920c2c281cf8_1000w_1000h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "翻炒一下,就可以出锅了,最后撒上葱花。"
|
||||
},],
|
||||
Tab:['营养成分','烹饪方法'],
|
||||
build:false,
|
||||
id:1,
|
||||
carts: [], // 购物车列表
|
||||
delFlag: true,
|
||||
buiFlag: true,
|
||||
fat:10,
|
||||
carbs:10,
|
||||
protein:42,
|
||||
TabCur: 0,
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onShow: function (options) {
|
||||
|
||||
},
|
||||
onLoad: function (options) {
|
||||
var id = options.id;
|
||||
var build = options.build || false;
|
||||
var value = wx.getStorageSync('meal2') || [];
|
||||
var diary = wx.getStorageSync('diary') || [];
|
||||
var temp = value[id];
|
||||
var tab = ['营养成分','推荐食谱']
|
||||
if(temp.cata.indexOf("food")!=-1){
|
||||
this.setData({
|
||||
buiFlag: false,
|
||||
Tab:tab
|
||||
});
|
||||
}
|
||||
var carts = [];
|
||||
carts.push(temp);
|
||||
this.getRecommend(temp);
|
||||
for (var i = 0; i < diary.length; i++) {
|
||||
if(diary[i].id == carts[0].id){
|
||||
this.setData({
|
||||
delFlag:false
|
||||
});};
|
||||
}
|
||||
this.setData({
|
||||
build:build,
|
||||
carts:carts
|
||||
});
|
||||
},
|
||||
add: function () {
|
||||
this.setData({
|
||||
delFlag: false
|
||||
});
|
||||
|
||||
var value = wx.getStorageSync('diary') || [];
|
||||
var id = this.data.remarks;
|
||||
var carts = this.data.carts;
|
||||
value.push(carts[0]);
|
||||
wx.setStorageSync('diary', value);
|
||||
|
||||
var meal2 = wx.getStorageSync('meal2');
|
||||
console.log(meal2[carts[0].id].name)
|
||||
meal2[carts[0].id].add=true;
|
||||
wx.setStorageSync('meal2', meal2);
|
||||
|
||||
|
||||
wx.showToast({
|
||||
title: '已加入今日食谱',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
},
|
||||
|
||||
del: function () {//删除diary中的食谱
|
||||
|
||||
this.setData({
|
||||
delFlag: true
|
||||
});
|
||||
var diary = wx.getStorageSync('diary');
|
||||
var carts = this.data.carts;
|
||||
var index = 0;
|
||||
for (var i = 0; i < diary.length; i++) {
|
||||
if (diary[i].id == carts[0].id) {
|
||||
index = i;
|
||||
};
|
||||
}
|
||||
diary.splice(index, 1);
|
||||
wx.setStorageSync('diary', diary)
|
||||
var meal2 = wx.getStorageSync('meal2');
|
||||
meal2[carts[0].id].add = false;
|
||||
wx.setStorageSync('meal2', meal2);
|
||||
wx.showToast({
|
||||
title: '已移出今日食谱!',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
},
|
||||
|
||||
bui: function () {//跳转到home
|
||||
var cart = wx.getStorageSync('cart') || [];
|
||||
var tcarts = this.data.carts;
|
||||
var build = this.data.build;
|
||||
for(var i=0;i<cart.length;i++){
|
||||
if(tcarts[0].id == cart[i].id){
|
||||
cart[i].quantity+=1;
|
||||
tcarts[0].quantity += 1;
|
||||
}
|
||||
}
|
||||
if (tcarts[0].quantity < 1) { tcarts[0].quantity += 1;cart.push(tcarts[0]);}
|
||||
wx.setStorageSync('cart', cart);
|
||||
if(build){
|
||||
wx.navigateBack()
|
||||
}else{
|
||||
wx.redirectTo({
|
||||
url: '../home/home'
|
||||
})}
|
||||
},
|
||||
|
||||
tabSelect(e) {
|
||||
this.setData({
|
||||
TabCur: e.currentTarget.dataset.id,
|
||||
})
|
||||
},
|
||||
|
||||
getRecommend(tmp) {
|
||||
var meal2 = wx.getStorageSync('meal2') || [];
|
||||
var swiperList = []
|
||||
var food = tmp
|
||||
for (var j = Data.getFoodNum(); j < meal2.length; j++) {
|
||||
var m = meal2[j]
|
||||
m.foodscore = m.foodscore || parseInt(m.score)
|
||||
var list = m.list
|
||||
for (var k = 0; k < list.length; k++) {
|
||||
if (list[k] == food.id) {
|
||||
console.log(m.name)
|
||||
m.foodscore += 10
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
console.log(meal2)
|
||||
meal2.sort(function (a, b) {
|
||||
return (a.foodscore || 0) - (b.foodscore || 0)
|
||||
})
|
||||
console.log(meal2)
|
||||
for (var i = meal2.length - 1; i > meal2.length - 6; i--) {
|
||||
swiperList.push(meal2[i])
|
||||
}
|
||||
console.log(swiperList)
|
||||
this.setData({
|
||||
recommendList: swiperList
|
||||
})
|
||||
}
|
||||
})
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
|
||||
"navigationBarTitleText": "菜谱详情"
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
<cu-custom bgColor="bg-gradual-blue" isBack="{{true}}">
|
||||
<view slot="backText">返回</view>
|
||||
<view slot="content">菜谱详情</view>
|
||||
</cu-custom>
|
||||
<view class="cart-list" wx:for="{{carts}}" wx:key="{{index}}">
|
||||
<view class="cart-thumb-box">
|
||||
<image class="cart-thumb" src="{{item.image}}"></image>
|
||||
</view>
|
||||
<text class="cart-pro-name">{{item.name}}</text>
|
||||
<text class="cart-pro-info">{{item.cal}}kcal·{{item.amount}}g</text>
|
||||
<view class="cart-pro-score" style='border-color:{{item.color}}'><text>{{item.score}}</text></view>
|
||||
<text class="cart-pro-eva">{{item.eva}}</text>
|
||||
<button class="add" bindtap="add"><text class="cuIcon-roundadd"> </text> 加入今日份食谱</button>
|
||||
<button hidden="{{delFlag}}" class="del" bindtap="del"><text class="cuIcon-roundclose"> </text> 移出今日份食谱</button>
|
||||
<button hidden="{{buiFlag}}" class="bui" bindtap="bui"><text class="cuIcon-roundadd"> </text> 制作膳食</button>
|
||||
|
||||
|
||||
<view class="more-info-bg">
|
||||
|
||||
<scroll-view scroll-x class="bg-white nav">
|
||||
<view class="flex text-center">
|
||||
<view class="cu-item flex-sub {{index==TabCur?'text-blue cur':''}}" wx:for="{{2}}" wx:key bindtap="tabSelect" data-id="{{index}}">
|
||||
{{Tab[index]}}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view class="more-info shadow-warp" wx:if="{{TabCur==0}}">
|
||||
<view class="padding flex text-center text-grey bg-white">
|
||||
<view class="flex flex-sub flex-direction solid-right">
|
||||
<view class="flex align-end justify-center">
|
||||
<view class="text-xxl text-blue ">{{item.nutrition[0]}}</view>
|
||||
<view class="text-s text-blue padding-left-xs padding-bottom-xs" >g</view>
|
||||
</view>
|
||||
<view class="margin-top-sm">糖</view>
|
||||
</view>
|
||||
<view class="flex flex-sub flex-direction solid-right">
|
||||
<view class="flex align-end justify-center">
|
||||
<view class="text-xxl text-blue ">{{item.nutrition[1]}}</view>
|
||||
<view class="text-s text-blue padding-left-xs padding-bottom-xs" >g</view>
|
||||
</view>
|
||||
<view class="margin-top-sm">蛋白质</view>
|
||||
</view>
|
||||
<view class="flex flex-sub flex-direction">
|
||||
<view class="flex align-end justify-center">
|
||||
<view class="text-xxl text-blue ">{{item.nutrition[2]}}</view>
|
||||
<view class="text-s text-blue padding-left-xs padding-bottom-xs" >g</view>
|
||||
</view>
|
||||
<view class="margin-top-sm">脂肪</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail-info-box text-xl">
|
||||
<text class="left">膳食纤维</text>
|
||||
<text class="right">{{item.nutrition[3]}}g</text>
|
||||
<text class="left">\n胆固醇</text>
|
||||
<text class="right">{{item.nutrition[4]}}mg</text>
|
||||
<text class="left">\n维生素A</text>
|
||||
<text class="right">{{item.nutrition[5]}}ug</text>
|
||||
<text class="left">\n维生素B1</text>
|
||||
<text class="right">{{item.nutrition[6]}}mg</text>
|
||||
<text class="left">\n维生素B2</text>
|
||||
<text class="right">{{item.nutrition[7]}}mg</text>
|
||||
<text class="left">\n维生素C</text>
|
||||
<text class="right">{{item.nutrition[8]}}mg</text>
|
||||
<text class="left">\n维生素E</text>
|
||||
<text class="right">{{item.nutrition[9]}}mg</text>
|
||||
<text class="left">\n叶酸</text>
|
||||
<text class="right">{{item.nutrition[10]}}ug</text>
|
||||
<text class="left">\n钙</text>
|
||||
<text class="right">{{item.nutrition[11]}}ug</text>
|
||||
<text class="left">\n铁</text>
|
||||
<text class="right">{{item.nutrition[12]}}mg</text>
|
||||
<text class="left">\n钾</text>
|
||||
<text class="right">{{item.nutrition[13]}}mg</text>
|
||||
<text class="left">\n锌</text>
|
||||
<text class="right">{{item.nutrition[14]}}mg</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="more-info shadow-warp" wx:if="{{TabCur==1 && buiFlag}}">
|
||||
<view class="detail-info-box">
|
||||
<view class='text-blue text-xl'>用料:</view>
|
||||
<view class="infood" wx:for="{{foods}}" wx:key="{{index}}">
|
||||
<text class="left">{{item.name}}</text>
|
||||
<text class="right">{{item.quantity}}</text>
|
||||
</view>
|
||||
<view class='margin-top text-blue text-xl'>步骤:</view>
|
||||
<view class="infood" wx:for="{{steps}}" wx:key="{{index}}">
|
||||
<text class="">第 {{index+1}} 步:</text>
|
||||
<image class='steps radius shadow-wrap' src='{{item.image}}'></image>
|
||||
<text>{{item.text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="more-info shadow-warp" wx:if="{{TabCur==1 && !buiFlag}}">
|
||||
<view class="cu-list menu-avatar">
|
||||
<view class="solid-bottom cu-item" wx:for="{{recommendList}}" wx:key="{{index}}">
|
||||
<navigator url="../details/details?id={{item.id}}">
|
||||
<image class="thumb" src="{{item.image}}" mode="widthFix"></image></navigator>
|
||||
<view class="content">
|
||||
<view class="text-black">{{item.name}}</view>
|
||||
<view class="text-gray text-sm">{{item.cal}}kcal·{{item.amount}}g</view>
|
||||
</view>
|
||||
<view class="right-box" style="text-align:center;padding:10rpx;width:100rpx">
|
||||
<view class="text-black text-xxl" style='border:1px solid {{item.color}};border-radius:15rpx;'>
|
||||
{{item.score}}</view>
|
||||
<view class="text-grey text-xs">{{item.eva}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
@ -0,0 +1,144 @@
|
||||
page{
|
||||
background-color: #fff;
|
||||
}
|
||||
.cart-list{
|
||||
background-color: #fff;
|
||||
position: relative;
|
||||
border-bottom: 1rpx solid #e9e9e9;
|
||||
}
|
||||
.cart-list .cart-thumb-box{
|
||||
|
||||
border-bottom: 1rpx solid #e9e9e9;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 400rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.cart-list .cart-thumb{
|
||||
|
||||
position: absolute;
|
||||
top:-100rpx;
|
||||
width:100%;
|
||||
height:600rpx;
|
||||
|
||||
}
|
||||
.cart-list .cart-pro-name{
|
||||
position:absolute;
|
||||
top:410rpx;
|
||||
left:20rpx;
|
||||
padding: 20rpx 20rpx 20rpx 20rpx;
|
||||
width: 60%;
|
||||
height: 100rpx;
|
||||
text-align: left;
|
||||
font-size: 80rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.cart-list .cart-pro-info{
|
||||
color:#999;
|
||||
font-size: 40rpx;
|
||||
position:absolute;
|
||||
top:540rpx;
|
||||
left:20rpx;
|
||||
padding: 20rpx 20rpx 20rpx 20rpx;
|
||||
width: 60%;
|
||||
line-height: 50rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.cart-list .cart-pro-score{
|
||||
border:lightgray;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-radius: 10px;
|
||||
position: absolute;
|
||||
font-size: 75rpx;
|
||||
top: 440rpx;
|
||||
right: 30rpx;
|
||||
display: flex; justify-content: center;align-items: center;
|
||||
padding: 10rpx 10rpx 10rpx 10rpx;
|
||||
width: 150rpx;
|
||||
height: 130rpx;
|
||||
}
|
||||
.cart-list .cart-pro-eva{
|
||||
color:#999;
|
||||
position: absolute;
|
||||
font-size: 30rpx;
|
||||
top: 570rpx;
|
||||
right: 30rpx;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
width: 150rpx;
|
||||
}
|
||||
|
||||
.add{
|
||||
position: absolute;
|
||||
top:325px;
|
||||
left:2.5%;
|
||||
border-radius: 30px;
|
||||
border-bottom: 1rpx solid #e9e9e9;
|
||||
background-image: linear-gradient(45deg, #0081ff, #1cbbb4);
|
||||
width: 95%;
|
||||
color:#fff;
|
||||
}
|
||||
.del{
|
||||
position: absolute;
|
||||
top:325px;
|
||||
left:2.5%;
|
||||
border-radius: 30px;
|
||||
border-bottom: 1rpx solid #e9e9e9;
|
||||
background-image: linear-gradient(45deg, #f43f3b, #ec008c);
|
||||
width: 95%;
|
||||
color:#fff;
|
||||
}
|
||||
.bui{
|
||||
position: absolute;
|
||||
top:325px;
|
||||
left:2.5%;
|
||||
border-radius: 30px;
|
||||
border-bottom: 1rpx solid #e9e9e9;
|
||||
background-image: linear-gradient(45deg, #0081ff, #1cbbb4);
|
||||
width: 95%;
|
||||
color:#fff;
|
||||
}
|
||||
.more-info-bg{
|
||||
position: absolute;
|
||||
top:400px;
|
||||
border-top: 1rpx solid #e9e9e9;
|
||||
width: 100%;
|
||||
height:100%;
|
||||
}
|
||||
.more-info-bg .more-info{
|
||||
position: absolute;
|
||||
top:120rpx;
|
||||
left:3%;
|
||||
background-color:#fff;
|
||||
width: 94%;
|
||||
|
||||
}
|
||||
.detail-info-box{
|
||||
font-size:28rpx;
|
||||
line-height: 40px;
|
||||
padding: 20px 20px 20px 20px;
|
||||
}
|
||||
.right{
|
||||
float: right;
|
||||
}
|
||||
|
||||
.steps{
|
||||
width:600rpx;
|
||||
}
|
||||
|
||||
|
||||
.thumb{
|
||||
border: lightgrey;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-top-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
left: 30rpx;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
@ -0,0 +1,230 @@
|
||||
// page/component/new-pages/user/user.js
|
||||
import Data from '../../utils/data.js'
|
||||
|
||||
Page({
|
||||
data: {
|
||||
array1: ['男', '女'],
|
||||
array2: [],
|
||||
array3: [],
|
||||
array4: [],
|
||||
array5: [],
|
||||
array6: ['低','中','高'],
|
||||
sports:1,
|
||||
multiArray:[[],[]],
|
||||
gender:0,
|
||||
birthday: "1996-08-03",
|
||||
place: ["四川省", "成都市", "郫都区"],
|
||||
height:170,
|
||||
weight:60,
|
||||
tnb:false,
|
||||
gxy:false,
|
||||
xieya: [115, 75],
|
||||
fatrate:17,
|
||||
xietang:50,
|
||||
thumb: '',
|
||||
nickname: '',
|
||||
},
|
||||
onLoad() {
|
||||
wx.showLoading({
|
||||
title: '数据加载中',
|
||||
})
|
||||
var array2=this.data.array2;
|
||||
var array3 =this.data.array3;
|
||||
var array4 = this.data.array4;
|
||||
var array5 = this.data.array5;
|
||||
var multiArray = this.data.multiArray;
|
||||
for (var i = 100; i <= 250; i++) {
|
||||
array2.push(i);
|
||||
}
|
||||
for (var i = 0; i <= 200; i++) {
|
||||
array3.push(i);
|
||||
multiArray[0].push(i);
|
||||
multiArray[1].push(i);
|
||||
}
|
||||
for (var i = 0; i <= 50; i++) {
|
||||
array4.push(i);
|
||||
}
|
||||
for (var i = 0; i <= 15; i+=0.1) {
|
||||
array5.push(i.toFixed(1));
|
||||
}
|
||||
var self = this;
|
||||
/**
|
||||
* 获取用户信息
|
||||
*/
|
||||
wx.getUserInfo({
|
||||
success: function (res) {
|
||||
self.setData({
|
||||
thumb: res.userInfo.avatarUrl,
|
||||
nickname: res.userInfo.nickName
|
||||
})
|
||||
}
|
||||
})
|
||||
var user =wx.getStorageSync("user");
|
||||
var gender = user.gender;
|
||||
var height = user.height;
|
||||
var weight = user.weight;
|
||||
var birthday = user.birthday;
|
||||
var place = user.place;
|
||||
var xieya = user.xieya;
|
||||
var fatrate = user.fatrate;
|
||||
var xietang = user.xietang;
|
||||
var tnb = user.tnb;
|
||||
var gxy = user.gxy;
|
||||
var sports = user.sports;
|
||||
this.setData({
|
||||
height: height,
|
||||
weight: weight,
|
||||
gender: gender,
|
||||
birthday:birthday,
|
||||
place:place,
|
||||
tnb: tnb,
|
||||
gxy: gxy,
|
||||
xieya:xieya,
|
||||
xietang: xietang,
|
||||
fatrate: fatrate,
|
||||
sports: sports,
|
||||
array2:array2,
|
||||
array3:array3,
|
||||
array4: array4,
|
||||
array5: array5,
|
||||
multiArray: multiArray,
|
||||
})
|
||||
wx.hideLoading()
|
||||
},
|
||||
genderChange: function (e) {
|
||||
var t = e.detail.value;
|
||||
this.setData({
|
||||
gender: t,
|
||||
})
|
||||
},
|
||||
sportsChange: function (e) {
|
||||
var t = e.detail.value;
|
||||
this.setData({
|
||||
sports: t,
|
||||
})
|
||||
},
|
||||
birthdayChange: function (e) {
|
||||
var t = e.detail.value;
|
||||
this.setData({
|
||||
birthday: t,
|
||||
})
|
||||
},
|
||||
placeChange: function (e) {
|
||||
var t = e.detail.value;
|
||||
this.setData({
|
||||
place: t,
|
||||
})
|
||||
},
|
||||
heightChange: function (e) {
|
||||
var t = e.detail.value;
|
||||
this.setData({
|
||||
height: t,
|
||||
})
|
||||
},
|
||||
weightChange: function (e) {
|
||||
var t = e.detail.value;
|
||||
this.setData({
|
||||
weight: t,
|
||||
})
|
||||
},
|
||||
gxyChange: function (e) {
|
||||
var t = e.detail.value;
|
||||
this.setData({
|
||||
gxy: t,
|
||||
})
|
||||
},
|
||||
tnbChange: function (e) {
|
||||
var t = e.detail.value;
|
||||
this.setData({
|
||||
tnb: t,
|
||||
})
|
||||
},
|
||||
xieyaChange(e) {
|
||||
this.setData({
|
||||
xieya: e.detail.value
|
||||
})
|
||||
},
|
||||
xietangChange(e) {
|
||||
this.setData({
|
||||
xietang: e.detail.value
|
||||
})
|
||||
},
|
||||
fatrateChange(e) {
|
||||
this.setData({
|
||||
fatrate: e.detail.value
|
||||
})
|
||||
},
|
||||
confirm:function(){
|
||||
var that = this
|
||||
wx.showLoading({
|
||||
title: '数据提交中',
|
||||
})
|
||||
var u = wx.getStorageSync('user') || {}
|
||||
var m = wx.getStorageSync('meal') || []
|
||||
u.gender = this.data.gender;
|
||||
u.birthday = this.data.birthday;
|
||||
u.place = this.data.place;
|
||||
u.height = this.data.height;
|
||||
u.weight = this.data.weight;
|
||||
u.gxy = this.data.gxy;
|
||||
u.tnb = this.data.tnb;
|
||||
u.xieya = this.data.xieya;
|
||||
u.xietang = this.data.xietang;
|
||||
u.fatrate = this.data.fatrate;
|
||||
u.sports = this.data.sports;
|
||||
var score = Data.getScore(u)
|
||||
console.log(u);
|
||||
//更新健康指数
|
||||
wx.setStorageSync("healthy", score)
|
||||
wx.setStorageSync("user", u)
|
||||
|
||||
wx.request({
|
||||
url: Data.getUrl() + 'score',
|
||||
data: {
|
||||
'meal':m,
|
||||
'user':u,
|
||||
'all':m
|
||||
},
|
||||
method: 'POST',
|
||||
header: {
|
||||
'content-type': 'application/json' // 默认值
|
||||
},
|
||||
success: function (res) {
|
||||
console.log(res.data)
|
||||
|
||||
for(var i=0;i<res.data.length;i++){
|
||||
var m=res.data[i]
|
||||
var s=m.score
|
||||
m.eva = that.getEva(s)
|
||||
m.color = that.getColor(s)
|
||||
}
|
||||
wx.setStorageSync('meal', res.data)
|
||||
wx.hideLoading();
|
||||
wx.switchTab({
|
||||
url: '../user/home',
|
||||
})
|
||||
wx.showToast({
|
||||
title: '数据提交成功!',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
getEva: function (s) {
|
||||
var eva = "Bad";
|
||||
if (s >= 2) { eva = "Limit" }
|
||||
if (s >= 4) { eva = "Normal" }
|
||||
if (s >= 6) { eva = "Good" }
|
||||
if (s >= 9) { eva = "Excellent" }
|
||||
return eva;
|
||||
},
|
||||
getColor: function (s) {
|
||||
var c = "#e54d42";
|
||||
if (s >= 2) { c = "#fbbd08" }
|
||||
if (s >= 4) { c = "#666666" }
|
||||
if (s >= 6) { c = "#8dc63f" }
|
||||
if (s >= 9) { c = "#39b54a" }
|
||||
return c;
|
||||
},
|
||||
})
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "身体数据"
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
.confirm{
|
||||
font-size:35rpx;
|
||||
position: relative;
|
||||
top:10px;
|
||||
border-radius: 30px;
|
||||
border-bottom: 1rpx solid #e9e9e9;
|
||||
background-image: linear-gradient(45deg, #0081ff, #1cbbb4);
|
||||
width: 95%;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
.upload{
|
||||
font-size:35rpx;
|
||||
position: relative;
|
||||
top:10px;
|
||||
border-radius: 5px;
|
||||
border-bottom: 1rpx solid #e9e9e9;
|
||||
background-image: linear-gradient(45deg, #39b54a, #8dc63f);
|
||||
width: 97.5%;
|
||||
color:#fff;
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
updown:false,
|
||||
carts: [], // 购物车列表
|
||||
hasList: false, // 列表是否有数据
|
||||
selected: [],
|
||||
totalPrice:9.9,
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
//查找那些时间已经打过卡了
|
||||
wx.showLoading({
|
||||
title: '加载中',
|
||||
})
|
||||
var selected = wx.getStorageSync('selected')
|
||||
this.setData({
|
||||
selected:selected
|
||||
})
|
||||
wx.hideLoading();
|
||||
},
|
||||
/**
|
||||
* 日历是否被打开
|
||||
*/
|
||||
bindselect(e) {
|
||||
console.log(e.detail.ischeck)
|
||||
},
|
||||
/**
|
||||
* 获取选择日期
|
||||
*/
|
||||
bindgetdate(e) {
|
||||
wx.showLoading({
|
||||
title: '加载中',
|
||||
})
|
||||
let time = e.detail;
|
||||
let today = time.year +"-"+ time.month + "-" + time.date;
|
||||
console.log(today)
|
||||
var carts = wx.getStorageSync(today);
|
||||
if (carts.length) {
|
||||
this.setData({
|
||||
hasList: true,
|
||||
carts: carts,
|
||||
});
|
||||
} else {
|
||||
this.setData({
|
||||
hasList: false,
|
||||
});
|
||||
}
|
||||
this.getScore();
|
||||
wx.hideLoading()
|
||||
|
||||
},
|
||||
getScore() {
|
||||
let carts = this.data.carts; // 获取购物车列表
|
||||
let total = 0;
|
||||
let updown = true;
|
||||
let h = wx.getStorageSync("healthy") || 0
|
||||
for (let i = 0; i < carts.length; i++) { // 循环列表得到每个数据
|
||||
total += carts[i].score / carts.length;
|
||||
}
|
||||
if(total>=h){updown =true;}else{updown=false;}
|
||||
this.setData({ // 最后赋值到data中渲染到页面
|
||||
carts: carts,
|
||||
updown:updown,
|
||||
totalPrice: total.toFixed(1)
|
||||
});
|
||||
},
|
||||
})
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"calendar": "/components/calendar/calendar"
|
||||
},
|
||||
"navigationBarTitleText": "打卡记录"
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
<cu-custom bgColor="bg-gradual-blue" isBack="{{true}}">
|
||||
<view slot="backText">返回</view>
|
||||
<view slot="content">打卡记录</view>
|
||||
</cu-custom>
|
||||
|
||||
<calendar selected="{{selected}}" bindselect="bindselect" bindgetdate="bindgetdate" />
|
||||
<view wx:if="{{hasList}}">
|
||||
|
||||
<view class='box'>当日得分:<view class='totalPrice'>{{totalPrice}}</view>
|
||||
<view class='updown'><image src='/images/up.png' hidden='{{!updown}}' class='up'></image>
|
||||
<image src='/images/down.png' hidden='{{updown}}' class='down'></image></view>
|
||||
</view>
|
||||
<view class="cart-title">
|
||||
<text>当日份食谱:</text>
|
||||
</view>
|
||||
<view class="cu-list menu-avatar">
|
||||
<view class="solid-bottom cu-item {{modalName=='move-box-'+ index?'move-cur':''}}" wx:for="{{carts}}" wx:key="{{index}}" data-target="move-box-{{index}}">
|
||||
<navigator url="../details/details?id={{item.id}}">
|
||||
<image class="thumb" src="{{item.image}}"></image></navigator>
|
||||
<view class="content">
|
||||
<view class="text-black">{{item.name}}</view>
|
||||
<view class="text-gray text-sm">{{item.cal}}kcal·{{item.amount}}g</view>
|
||||
</view>
|
||||
<view class="right-box" style="text-align:center;padding:10rpx;width:100rpx">
|
||||
<view class="text-black text-xxl" style='border:1px solid {{item.color}};border-radius:15rpx;'>
|
||||
{{item.score}}</view>
|
||||
<view class="text-grey text-xs">{{item.eva}}</view>
|
||||
</view>
|
||||
<view class="move">
|
||||
<view class="bg-red" bindtap='deleteList'>删除</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view wx:else>
|
||||
<view class="cart-no-data">这一天没有打卡~</view>
|
||||
</view>
|
@ -0,0 +1,65 @@
|
||||
/**index.wxss**/
|
||||
|
||||
.box {
|
||||
border-top: 1px solid #e9e9e9;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items:baseline;
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
background: #fff;
|
||||
font-size: 30rpx;
|
||||
color: #666;
|
||||
padding-bottom: 10rpx;
|
||||
}
|
||||
.box .totalPrice{
|
||||
font-size:50px;
|
||||
color:#0e9eda;
|
||||
}
|
||||
.box .updown{
|
||||
width:20px;
|
||||
height:40px;
|
||||
}
|
||||
.box .up{
|
||||
position: absolute;
|
||||
right:25%;
|
||||
width:20px;
|
||||
height: 40px;
|
||||
}
|
||||
.box .down{
|
||||
position: absolute;
|
||||
right:25%;
|
||||
width:20px;
|
||||
height: 40px;
|
||||
}
|
||||
.cart-title{
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
padding:0 100rpx 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
background: ghostwhite;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.cart-no-data{
|
||||
padding:40rpx 0;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
}
|
||||
.thumb{
|
||||
border: lightgrey;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-top-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
left: 30rpx;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "制作膳食"
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
<cu-custom bgColor="bg-gradual-blue" isBack="{{true}}">
|
||||
<view slot="backText">返回</view>
|
||||
<view slot="content">制作膳食</view>
|
||||
</cu-custom>
|
||||
<!--头部 -->
|
||||
|
||||
|
||||
<view class="cu-bar bg-white margin-top">
|
||||
<view class="action">
|
||||
<text class="cuIcon-title text-blue"></text> 根据您所选的食材,我们为您推荐以下膳食
|
||||
</view>
|
||||
</view>
|
||||
<view class='swp solid-bottom'>
|
||||
<swiper class="card-swiper {{DotStyle?'square-dot':'round-dot'}}" indicator-dots="true" circular="true" autoplay="true" interval="5000" duration="500" bindchange="cardSwiper" indicator-color="#8799a3" indicator-active-color="#0081ff">
|
||||
|
||||
<swiper-item wx:for="{{swiperList}}" wx:key class="{{cardCur==index?'cur':''}}">
|
||||
<navigator url="../details/details?id={{item.id}}" class="swiper-item">
|
||||
<image src="{{item.image}}" mode="aspectFill"></image>
|
||||
</navigator>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
|
||||
<!--内容 -->
|
||||
<view class="">
|
||||
<view class="weui-panel__hd weui_titleBox">已选食材</view>
|
||||
<view class="weui-panel__bd">
|
||||
<view class="weui-media-box weui-media-box_small-appmsg">
|
||||
<view class="weui-cells weui-cells_in-small-appmsg" wx:for="{{cartList}}" wx:key="">
|
||||
<view class="weui-cell weui-cell_access weui_orderBox" hover-class="weui-cell_active">
|
||||
<view class="weui-cell__hd">
|
||||
<image src="{{item.image}}" style="width: 26px;height: 26px;margin-right: 15px;" />
|
||||
</view>
|
||||
<view class="weui-cell__bd weui-cell_primary">
|
||||
<view>{{item.name}}</view>
|
||||
</view>
|
||||
<view class="weui-cell__ft order_price">{{item.quantity}}x{{item.amount}}g</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fenxi"></view>
|
||||
<!--输入用餐人数 -->
|
||||
<view class="guest_numInput">请选择烹调方式:</view>
|
||||
<view class='rggg_view solid-bottom'>
|
||||
<radio-group class='rggg' bindchange='radiochange'><!-- 事件绑定 -->
|
||||
<view class="class_r_g" wx:for="{{classes_array}}">
|
||||
<radio id="{{item.name}}" hidden value="{{item.id}}" checked="{{item.checked}}" data-id='item.index'></radio>
|
||||
<label class="label-2__text" for="{{item.name}}">
|
||||
<text class='{{item.checked?"checkedt":"normalt"}}'>{{item.name}}</text><!-- 根据每一项的checked属性来切换点击radio中的文本的点击效果 -->
|
||||
</label>
|
||||
</view>
|
||||
</radio-group>
|
||||
</view>
|
||||
<!--备注 -->
|
||||
<view class="cu-form-group margin-top">
|
||||
<input class="Remark" bindinput="getRemark" value="{{remarks}}" placeholder="给你的膳食起个名吧~"></input>
|
||||
</view>
|
||||
<view class="cu-form-group">
|
||||
<view class="grid col-4 grid-square flex-sub margin-top">
|
||||
<view class="bg-img" wx:for="{{imgList}}" wx:key="{{index}}" bindtap="ViewImage" data-url="{{imgList[index]}}">
|
||||
<image src='{{imgList[index]}}' mode='aspectFill'></image>
|
||||
<view class="cu-tag bg-red" catchtap="DelImg" data-index="{{index}}">
|
||||
<text class="cuIcon-close"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="solids" bindtap="ChooseImage" wx:if="{{imgList.length<1}}">
|
||||
<text class="cuIcon-cameraadd"></text>
|
||||
</view>
|
||||
<view class="solids" bindtap="SearchImg">
|
||||
<text class="cuIcon-search"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="weui-panel__hd order_sum">评分:<span class="order_sumMoney">{{displayPrice}}</span></view>
|
||||
|
||||
|
||||
<view class='fenxi2'></view>
|
||||
<!--付款方式 -->
|
||||
<view class="footer_box">
|
||||
<button class="complete" size="{{primarySize}}" bindtap="complete">制作完成!</button>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,186 @@
|
||||
import Data from '../../utils/data.js'
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
recommendList:[],
|
||||
foods: [{ name: '鸡蛋', quantity: '5个' }, { name: '番茄', quantity: '5个' }, { name: '葱', quantity: '1根' }, { name: '盐', quantity: '1勺' }, { name: '油', quantity: '适量' }, { name: '砂糖', quantity: '少许' },],
|
||||
steps: [{
|
||||
image:'http://i2.chuimg.com/5bcd1e1f8acb4179a73231b37783b80b_2048w_1722h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "选择比较成熟的番茄,捏着比较软,这样的番茄多汁,味道好一些,然后用刀划十字,放入开水里面烫一下,过入凉水,去皮"
|
||||
}, {
|
||||
image: 'http://i2.chuimg.com/38fbba613b844b198311dbd43f5c6683_2022w_2048h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "番茄切成小块儿,喜欢多汁的就切碎一点"
|
||||
}, {
|
||||
image: 'http://i2.chuimg.com/2fd03bec614a46ab841d8208d3e28bf9_2000w_2668h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "大蒜去皮切成蒜末"
|
||||
}, {
|
||||
image: 'http://i2.chuimg.com/c0b9dea31a90433092d43dea7ea54363_2208w_1536h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "小葱切碎"
|
||||
}, {
|
||||
image: 'http://i2.chuimg.com/d539ffda408d4214ae22d57b2d1d4bd5_2048w_1804h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "鸡蛋加少许盐打散"
|
||||
}, {
|
||||
image: 'http://i2.chuimg.com/b683696efb95484c90500761b491a8b7_2668w_2668h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "锅里放油烧热,倒入蛋液,用筷子划,凝固就可以出锅备用"
|
||||
}, {
|
||||
image: 'http://i2.chuimg.com/7797e400f6c345dcb27e05fa2dfafaa8_2668w_2668h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "就着炒鸡蛋的油,可以不再放油,锅里放入番茄翻炒,加入盐"
|
||||
}, {
|
||||
image: 'http://i2.chuimg.com/295a0a61d7f64641b1e709cb04ed16bb_2000w_2668h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "汤汁比较浓厚时,放入炒好的鸡蛋"
|
||||
}, {
|
||||
image: 'http://i2.chuimg.com/c96a27ef3e1c45c0910d920c2c281cf8_1000w_1000h.jpg?imageView2/2/w/300/interlace/1/q/90',
|
||||
text: "翻炒一下,就可以出锅了,最后撒上葱花。"
|
||||
},],
|
||||
Tab:['营养成分'],
|
||||
build:false,
|
||||
id:1,
|
||||
carts: [], // 购物车列表
|
||||
delFlag: true,
|
||||
buiFlag: true,
|
||||
fat:10,
|
||||
carbs:10,
|
||||
protein:42,
|
||||
TabCur: 0,
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onShow: function (options) {
|
||||
|
||||
},
|
||||
onLoad: function (options) {
|
||||
var id = options.id;
|
||||
var build = options.build || false;
|
||||
var value = wx.getStorageSync('meal') || [];
|
||||
var diary = wx.getStorageSync('diary') || [];
|
||||
var temp = value[id];
|
||||
var tab = ['营养成分','推荐食谱']
|
||||
if(temp.cata.indexOf("food")!=-1){
|
||||
this.setData({
|
||||
buiFlag: false,
|
||||
Tab:tab
|
||||
});
|
||||
}
|
||||
var carts = [];
|
||||
carts.push(temp);
|
||||
this.getRecommend(temp);
|
||||
for (var i = 0; i < diary.length; i++) {
|
||||
if(diary[i].id == carts[0].id){
|
||||
this.setData({
|
||||
delFlag:false
|
||||
});};
|
||||
}
|
||||
this.setData({
|
||||
build:build,
|
||||
carts:carts
|
||||
});
|
||||
},
|
||||
add: function () {
|
||||
this.setData({
|
||||
delFlag: false
|
||||
});
|
||||
|
||||
var value = wx.getStorageSync('diary') || [];
|
||||
var id = this.data.remarks;
|
||||
var carts = this.data.carts;
|
||||
value.push(carts[0]);
|
||||
wx.setStorageSync('diary', value);
|
||||
|
||||
var meal = wx.getStorageSync('meal');
|
||||
console.log(meal[carts[0].id].name)
|
||||
meal[carts[0].id].add=true;
|
||||
wx.setStorageSync('meal', meal);
|
||||
|
||||
|
||||
wx.showToast({
|
||||
title: '已加入今日食谱',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
},
|
||||
|
||||
del: function () {//删除diary中的食谱
|
||||
|
||||
this.setData({
|
||||
delFlag: true
|
||||
});
|
||||
var diary = wx.getStorageSync('diary');
|
||||
var carts = this.data.carts;
|
||||
var index = 0;
|
||||
for (var i = 0; i < diary.length; i++) {
|
||||
if (diary[i].id == carts[0].id) {
|
||||
index = i;
|
||||
};
|
||||
}
|
||||
diary.splice(index, 1);
|
||||
wx.setStorageSync('diary', diary)
|
||||
var meal = wx.getStorageSync('meal');
|
||||
meal[carts[0].id].add = false;
|
||||
wx.setStorageSync('meal', meal);
|
||||
wx.showToast({
|
||||
title: '已移出今日食谱!',
|
||||
icon: 'success',
|
||||
duration: 2000
|
||||
})
|
||||
},
|
||||
|
||||
bui: function () {//跳转到home
|
||||
var cart = wx.getStorageSync('cart') || [];
|
||||
var tcarts = this.data.carts;
|
||||
var build = this.data.build;
|
||||
for(var i=0;i<cart.length;i++){
|
||||
if(tcarts[0].id == cart[i].id){
|
||||
cart[i].quantity+=1;
|
||||
tcarts[0].quantity += 1;
|
||||
}
|
||||
}
|
||||
if (tcarts[0].quantity < 1) { tcarts[0].quantity += 1;cart.push(tcarts[0]);}
|
||||
wx.setStorageSync('cart', cart);
|
||||
if(build){
|
||||
wx.navigateBack()
|
||||
}else{
|
||||
wx.redirectTo({
|
||||
url: '../home/home'
|
||||
})}
|
||||
},
|
||||
|
||||
tabSelect(e) {
|
||||
this.setData({
|
||||
TabCur: e.currentTarget.dataset.id,
|
||||
})
|
||||
},
|
||||
|
||||
getRecommend(tmp) {
|
||||
var meal = wx.getStorageSync('meal') || [];
|
||||
var swiperList = []
|
||||
var food = tmp
|
||||
for (var j = Data.getFoodNum(); j < meal.length; j++) {
|
||||
var m = meal[j]
|
||||
m.foodscore = m.foodscore || parseInt(m.score)
|
||||
var list = m.list
|
||||
for (var k = 0; k < list.length; k++) {
|
||||
if (list[k] == food.id) {
|
||||
console.log(m.name)
|
||||
m.foodscore += 10
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
console.log(meal)
|
||||
meal.sort(function (a, b) {
|
||||
return (a.foodscore || 0) - (b.foodscore || 0)
|
||||
})
|
||||
console.log(meal)
|
||||
for (var i = meal.length - 1; i > meal.length - 6; i--) {
|
||||
swiperList.push(meal[i])
|
||||
}
|
||||
console.log(swiperList)
|
||||
this.setData({
|
||||
recommendList: swiperList
|
||||
})
|
||||
}
|
||||
})
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "食物详情"
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
<cu-custom bgColor="bg-gradual-blue" isBack="{{true}}">
|
||||
<view slot="backText">返回</view>
|
||||
<view slot="content">食物详情</view>
|
||||
</cu-custom>
|
||||
<view class="cart-list" wx:for="{{carts}}" wx:key="{{index}}">
|
||||
<view class="cart-thumb-box">
|
||||
<image class="cart-thumb" src="{{item.image}}"></image>
|
||||
</view>
|
||||
<text class="cart-pro-name">{{item.name}}</text>
|
||||
<text class="cart-pro-info">{{item.cal}}kcal·{{item.amount}}g</text>
|
||||
<view class="cart-pro-score" style='border-color:{{item.color}}'><text>{{item.score}}</text></view>
|
||||
<text class="cart-pro-eva">{{item.eva}}</text>
|
||||
<button class="add" bindtap="add"><text class="cuIcon-roundadd"> </text> 加入今日份食谱</button>
|
||||
<button hidden="{{delFlag}}" class="del" bindtap="del"><text class="cuIcon-roundclose"> </text> 移出今日份食谱</button>
|
||||
<button hidden="{{buiFlag}}" class="bui" bindtap="bui"><text class="cuIcon-roundadd"> </text> 制作膳食</button>
|
||||
|
||||
|
||||
<view class="more-info-bg">
|
||||
|
||||
<scroll-view scroll-x class="bg-white nav">
|
||||
<view class="flex text-center">
|
||||
<view class="cu-item flex-sub {{index==TabCur?'text-blue cur':''}}" wx:for="{{2}}" wx:key bindtap="tabSelect" data-id="{{index}}">
|
||||
{{Tab[index]}}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<view style="width:100vw;">
|
||||
<view class="padding flex text-center text-grey bg-white">
|
||||
<view class="flex flex-sub flex-direction solid-right">
|
||||
<view class="flex align-end justify-center">
|
||||
<view class="text-xxl text-blue ">{{item.nutrition[0]}}</view>
|
||||
<view class="text-s text-blue padding-left-xs padding-bottom-xs" >g</view>
|
||||
</view>
|
||||
<view class="margin-top-sm">糖</view>
|
||||
</view>
|
||||
<view class="flex flex-sub flex-direction solid-right">
|
||||
<view class="flex align-end justify-center">
|
||||
<view class="text-xxl text-blue ">{{item.nutrition[1]}}</view>
|
||||
<view class="text-s text-blue padding-left-xs padding-bottom-xs" >g</view>
|
||||
</view>
|
||||
<view class="margin-top-sm">蛋白质</view>
|
||||
</view>
|
||||
<view class="flex flex-sub flex-direction">
|
||||
<view class="flex align-end justify-center">
|
||||
<view class="text-xxl text-blue ">{{item.nutrition[2]}}</view>
|
||||
<view class="text-s text-blue padding-left-xs padding-bottom-xs" >g</view>
|
||||
</view>
|
||||
<view class="margin-top-sm">脂肪</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail-info-box text-xl">
|
||||
<text class="left">膳食纤维</text>
|
||||
<text class="right">{{item.nutrition[3]}}g</text>
|
||||
<text class="left">\n胆固醇</text>
|
||||
<text class="right">{{item.nutrition[4]}}mg</text>
|
||||
<text class="left">\n维生素A</text>
|
||||
<text class="right">{{item.nutrition[5]}}ug</text>
|
||||
<text class="left">\n维生素B1</text>
|
||||
<text class="right">{{item.nutrition[6]}}mg</text>
|
||||
<text class="left">\n维生素B2</text>
|
||||
<text class="right">{{item.nutrition[7]}}mg</text>
|
||||
<text class="left">\n维生素C</text>
|
||||
<text class="right">{{item.nutrition[8]}}mg</text>
|
||||
<text class="left">\n维生素E</text>
|
||||
<text class="right">{{item.nutrition[9]}}mg</text>
|
||||
<text class="left">\n叶酸</text>
|
||||
<text class="right">{{item.nutrition[10]}}ug</text>
|
||||
<text class="left">\n钙</text>
|
||||
<text class="right">{{item.nutrition[11]}}ug</text>
|
||||
<text class="left">\n铁</text>
|
||||
<text class="right">{{item.nutrition[12]}}mg</text>
|
||||
<text class="left">\n钾</text>
|
||||
<text class="right">{{item.nutrition[13]}}mg</text>
|
||||
<text class="left">\n锌</text>
|
||||
<text class="right">{{item.nutrition[14]}}mg</text>
|
||||
</view>
|
||||
</view>
|
||||
<!--
|
||||
<view class="more-info shadow-warp" wx:if="{{TabCur==1 && buiFlag}}">
|
||||
<view class="detail-info-box">
|
||||
<view class='text-blue text-xl'>用料:</view>
|
||||
<view class="infood" wx:for="{{foods}}" wx:key="{{index}}">
|
||||
<text class="left">{{item.name}}</text>
|
||||
<text class="right">{{item.quantity}}</text>
|
||||
</view>
|
||||
<view class='margin-top text-blue text-xl'>步骤:</view>
|
||||
<view class="infood" wx:for="{{steps}}" wx:key="{{index}}">
|
||||
<text class="">第 {{index+1}} 步:</text>
|
||||
<image class='steps radius shadow-wrap' src='{{item.image}}'></image>
|
||||
<text>{{item.text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- <view class="more-info shadow-warp" wx:if="{{TabCur==1 && !buiFlag}}">
|
||||
<view class="cu-list menu-avatar">
|
||||
<view class="solid-bottom cu-item" wx:for="{{recommendList}}" wx:key="{{index}}">
|
||||
<navigator url="../details/details?id={{item.id}}">
|
||||
<image class="thumb" src="{{item.image}}" mode="widthFix"></image></navigator>
|
||||
<view class="content">
|
||||
<view class="text-black">{{item.name}}</view>
|
||||
<view class="text-gray text-sm">{{item.cal}}kcal·{{item.amount}}g</view>
|
||||
</view>
|
||||
<view class="right-box" style="text-align:center;padding:10rpx;width:100rpx">
|
||||
<view class="text-black text-xxl" style='border:1px solid {{item.color}};border-radius:15rpx;'>
|
||||
{{item.score}}</view>
|
||||
<view class="text-grey text-xs">{{item.eva}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
|
@ -0,0 +1,144 @@
|
||||
page{
|
||||
background-color: #fff;
|
||||
}
|
||||
.cart-list{
|
||||
background-color: #fff;
|
||||
position: relative;
|
||||
border-bottom: 1rpx solid #e9e9e9;
|
||||
}
|
||||
.cart-list .cart-thumb-box{
|
||||
|
||||
border-bottom: 1rpx solid #e9e9e9;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 400rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.cart-list .cart-thumb{
|
||||
|
||||
position: absolute;
|
||||
top:-100rpx;
|
||||
width:100%;
|
||||
height:600rpx;
|
||||
|
||||
}
|
||||
.cart-list .cart-pro-name{
|
||||
position:absolute;
|
||||
top:410rpx;
|
||||
left:20rpx;
|
||||
padding: 20rpx 20rpx 20rpx 20rpx;
|
||||
width: 60%;
|
||||
height: 100rpx;
|
||||
text-align: left;
|
||||
font-size: 80rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.cart-list .cart-pro-info{
|
||||
color:#999;
|
||||
font-size: 40rpx;
|
||||
position:absolute;
|
||||
top:540rpx;
|
||||
left:20rpx;
|
||||
padding: 20rpx 20rpx 20rpx 20rpx;
|
||||
width: 60%;
|
||||
line-height: 50rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.cart-list .cart-pro-score{
|
||||
border:lightgray;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-radius: 10px;
|
||||
position: absolute;
|
||||
font-size: 75rpx;
|
||||
top: 440rpx;
|
||||
right: 30rpx;
|
||||
display: flex; justify-content: center;align-items: center;
|
||||
padding: 10rpx 10rpx 10rpx 10rpx;
|
||||
width: 150rpx;
|
||||
height: 130rpx;
|
||||
}
|
||||
.cart-list .cart-pro-eva{
|
||||
color:#999;
|
||||
position: absolute;
|
||||
font-size: 30rpx;
|
||||
top: 570rpx;
|
||||
right: 30rpx;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
width: 150rpx;
|
||||
}
|
||||
|
||||
.add{
|
||||
position: absolute;
|
||||
top:325px;
|
||||
left:2.5%;
|
||||
border-radius: 30px;
|
||||
border-bottom: 1rpx solid #e9e9e9;
|
||||
background-image: linear-gradient(45deg, #0081ff, #1cbbb4);
|
||||
width: 95%;
|
||||
color:#fff;
|
||||
}
|
||||
.del{
|
||||
position: absolute;
|
||||
top:325px;
|
||||
left:2.5%;
|
||||
border-radius: 30px;
|
||||
border-bottom: 1rpx solid #e9e9e9;
|
||||
background-image: linear-gradient(45deg, #f43f3b, #ec008c);
|
||||
width: 95%;
|
||||
color:#fff;
|
||||
}
|
||||
.bui{
|
||||
position: absolute;
|
||||
top:325px;
|
||||
left:2.5%;
|
||||
border-radius: 30px;
|
||||
border-bottom: 1rpx solid #e9e9e9;
|
||||
background-image: linear-gradient(45deg, #0081ff, #1cbbb4);
|
||||
width: 95%;
|
||||
color:#fff;
|
||||
}
|
||||
.more-info-bg{
|
||||
position: absolute;
|
||||
top:400px;
|
||||
border-top: 1rpx solid #e9e9e9;
|
||||
width: 100%;
|
||||
height:100%;
|
||||
}
|
||||
.more-info-bg .more-info{
|
||||
position: absolute;
|
||||
top:120rpx;
|
||||
left:3%;
|
||||
background-color:#fff;
|
||||
width: 94%;
|
||||
|
||||
}
|
||||
.detail-info-box{
|
||||
font-size:28rpx;
|
||||
line-height: 40px;
|
||||
padding: 20px 20px 20px 20px;
|
||||
}
|
||||
.right{
|
||||
float: right;
|
||||
}
|
||||
|
||||
.steps{
|
||||
width:600rpx;
|
||||
}
|
||||
|
||||
|
||||
.thumb{
|
||||
border: lightgrey;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-top-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
left: 30rpx;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "今日得分"
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
|
||||
.canvasBox{
|
||||
height: 600rpx;
|
||||
position: relative;
|
||||
background-image: linear-gradient(45deg, #0081ff, #1cbbb4);
|
||||
}
|
||||
.title{
|
||||
position: relative;
|
||||
top:50rpx;
|
||||
font-size:35rpx;
|
||||
text-align: center;
|
||||
color:#fff;
|
||||
}
|
||||
.biggerCircle{
|
||||
border:2px solid springgreen;
|
||||
width: 435rpx;
|
||||
height: 435rpx;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top:100rpx;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: auto auto;
|
||||
background-image: linear-gradient(45deg, #0081ff, #1cbbb4);
|
||||
}
|
||||
.bigCircle{
|
||||
width: 415rpx;
|
||||
height: 415rpx;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top:100rpx;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: auto auto;
|
||||
background-color: #ddd;
|
||||
}
|
||||
.littleCircle{
|
||||
width: 392rpx;
|
||||
height: 392rpx;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top:100rpx;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: auto auto;
|
||||
background-image: linear-gradient(45deg, #0081ff, #1cbbb4);
|
||||
}
|
||||
.canvas{
|
||||
width: 420rpx;
|
||||
height: 420rpx;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top:100rpx;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
margin: auto auto;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
|
||||
.cart-title{
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
|
||||
padding:20rpx 30rpx 20rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
background: ghostwhite;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.cart-no-data{
|
||||
padding:40rpx 0;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.daka{
|
||||
position: relative;
|
||||
float: right;
|
||||
top: 0rpx;
|
||||
right:0rpx;
|
||||
text-align: center;
|
||||
color: #0e9eda;
|
||||
width:120rpx;
|
||||
height: 50rpx;
|
||||
border: 1px solid #0e9eda;
|
||||
border-radius: 10rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
.daka2{
|
||||
position: relative;
|
||||
float: right;
|
||||
top: 0rpx;
|
||||
right:0rpx;
|
||||
text-align: center;
|
||||
color: #e9e9e9;
|
||||
width:120rpx;
|
||||
height: 50rpx;
|
||||
border: 1px solid #e9e9e9;
|
||||
border-radius: 10rpx;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.thumb{
|
||||
border: lightgrey;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-top-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
left: 30rpx;
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
//index.js
|
||||
//获取应用实例
|
||||
const app = getApp()
|
||||
|
||||
Page({
|
||||
data: {
|
||||
},
|
||||
onLoad: function () {
|
||||
},
|
||||
search: function (e) {
|
||||
wx.navigateTo({
|
||||
url: '../search/search?cata=food',
|
||||
})
|
||||
},
|
||||
})
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"navigationBarTitleText": "膳食"
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
<cu-custom bgColor="bg-gradual-blue" isBack="{{true}}">
|
||||
<view slot="backText">返回</view>
|
||||
<view slot="content">食材</view>
|
||||
</cu-custom>
|
||||
<!--index.wxml-->
|
||||
<view class="container">
|
||||
<view class='main-block'>
|
||||
<view class="weui-search-bar">
|
||||
<view class="weui-search-bar__form">
|
||||
<view class="weui-search-bar__box">
|
||||
<icon class="weui-icon-search_in-box" type="search" size="14"></icon>
|
||||
<view bindtap="search"class="weui-search-bar__input">今天你想吃什么?</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class='list'>
|
||||
<view class='list-row'>
|
||||
<view class='list1' >
|
||||
|
||||
<view class='list-img'><navigator url="../searchresult/searchresult?cata=grain"><image src='../../images/grain.jpg'></image></navigator> </view>
|
||||
<view class='list-type'><text class='xxl'>五谷杂粮</text></view>
|
||||
|
||||
</view>
|
||||
<view class='list1' >
|
||||
|
||||
<view class='list-img'><navigator url="../searchresult/searchresult?cata=vegetable"><image src='../../images/vegetables.jpg'></image></navigator> </view>
|
||||
<view class='list-type'><text class='xxl'>蔬菜</text></view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class='list-row'>
|
||||
<view class='list1' >
|
||||
|
||||
<view class='list-img'><navigator url="../searchresult/searchresult?cata=fruit"><image src='../../images/fruit.jpg'></image></navigator> </view>
|
||||
<view class='list-type'><text class='xxl'>水果</text></view>
|
||||
|
||||
</view>
|
||||
<view class='list1' >
|
||||
|
||||
<view class='list-img'><navigator url="../searchresult/searchresult?cata=meat"><image src='../../images/meat.jpg'></image></navigator> </view>
|
||||
<view class='list-type'><text class='xxl'>肉、蛋和水产</text></view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
@ -0,0 +1,31 @@
|
||||
/**index.wxss**/
|
||||
page{
|
||||
background-color: #fff;
|
||||
}
|
||||
.main-block{
|
||||
height: 50px;
|
||||
width: 100%;
|
||||
background-color: rgba(153, 153, 153, 0.103);
|
||||
margin-top: -100px;
|
||||
}
|
||||
.list{
|
||||
position: relative;
|
||||
left:-3%;
|
||||
}
|
||||
.list-img image{
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
.list1{
|
||||
margin-left: 20px;
|
||||
margin-top: 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.weui-search-bar__input {
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
font-size: 14px;
|
||||
color:#999;
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "帮助中心"
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
<cu-custom bgColor="bg-gradual-blue" isBack="{{true}}">
|
||||
<view slot="backText">返回</view>
|
||||
<view slot="content">帮助中心</view>
|
||||
</cu-custom>
|
||||
<view class="cells">
|
||||
<view class="item" wx:for="{{memberList}}" wx:for-index="idx" wx:for-item="item" wx:key="idx">
|
||||
<view bindtap="isOpen" class="cdn" data-index="{{item.id}}">
|
||||
<view>
|
||||
<image class="img" src="/images/helphelp.png" mode="aspectFill"/><text class="content">{{item.cont}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<image class="icon_img" src="{{item.hiddena ? '/images/dow.png' : '/images/upp.png'}}" mode="aspectFill"/>
|
||||
</view>
|
||||
</view>
|
||||
<view hidden="{{item.hiddena}}" class="hidden">
|
||||
<block wx:for="{{item.invalidActivty}}" wx:for-index="index" wx:for-item="items" wx:key="index">
|
||||
<view class="help">{{items.help}}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,115 @@
|
||||
page{
|
||||
background: #fff;
|
||||
}
|
||||
.swiper-img{
|
||||
width: 750rpx;
|
||||
height: 300rpx;
|
||||
}
|
||||
.cells .item .cdn{
|
||||
position: relative;
|
||||
box-sizing:border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20rpx 30rpx;
|
||||
/*border-bottom: 1rpx solid #f0f0f0;*/
|
||||
background-color: #fff;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.cells .item .cdn::after{
|
||||
content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border-bottom:0 solid #f0f0f0;border-width:1px
|
||||
}
|
||||
|
||||
.img{
|
||||
height: 50rpx;
|
||||
width: 50rpx;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
line-height: 82rpx;
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
.icon_img{
|
||||
height:30rpx;
|
||||
width:30rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.content{
|
||||
font-size:30rpx;
|
||||
margin-left: 15rpx;
|
||||
line-height: 82rpx;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.video-item{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.buys{
|
||||
width:750rpx;
|
||||
height: 141.6rpx;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
padding: 20rpx 30rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background-color:#FAFAFA;
|
||||
}
|
||||
.buys::after {
|
||||
content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;
|
||||
border-bottom:0 solid #DCDCDC;border-width:1px;
|
||||
}
|
||||
.v1{
|
||||
width: 35%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.new-price{
|
||||
font-size: 32rpx;
|
||||
color: #3B3B3B;
|
||||
}
|
||||
.oldPrice{
|
||||
text-decoration:line-through;
|
||||
font-size: 24rpx;
|
||||
color: #B0B0B0;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.buy{
|
||||
font-size: 24rpx;
|
||||
color: #2DAF73;
|
||||
text-align: center;
|
||||
width: 80rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.buy::after{
|
||||
content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #2DAF73;border-width:1px;border-radius:8rpx
|
||||
}
|
||||
|
||||
.shopping{
|
||||
width: 128rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
font-size: 28rpx;
|
||||
color: #2DAF73;
|
||||
text-align: center;
|
||||
}
|
||||
.shopping::after{
|
||||
content:'';position:absolute;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #2DAF73;border-width:1px;border-radius:16rpx
|
||||
}
|
||||
|
||||
.help{
|
||||
font-size:30rpx;
|
||||
padding: 35rpx 35rpx 35rpx 35rpx;
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"navigationBarTitleText": "制作膳食"
|
||||
}
|