Commit 7ac938ae71fe4bb81afb129d947cb28491a14359

Authored by wangfan
1 parent da7718ec

cookbook

  1 +/**app.wxss**/
  2 +@import "icon.wxss";
  3 +
  4 +
  5 +.hidden {
  6 + display: none;
  7 +}
  8 +
  9 +page {
  10 + font-size: 16px;
  11 + line-height: 150%;
  12 + font-family: 'PingFang SC','sans-serif','Helvetica Neue','Helvetica','Arial';
  13 + height: 100%;
  14 +}
  15 +.section{ margin-left:4%;margin-right:4%; width:92%;}
  16 +.sectionA{ margin-left:8%;margin-right:8%; width:84%; overflow: hidden; }
  17 +.sectionW{margin-left:2%;margin-right:2%;width:96%;overflow: hidden;}
  18 +.section_p{ padding-left:4%;padding-right:4%; width:92%; overflow: hidden; }
  19 +.white{
  20 + color: #fff;
  21 +}
  22 +.green{
  23 + color: #22ab39;
  24 +}
  25 +.black{
  26 + color: #000;
  27 +}
  28 +.gray{
  29 + color:#666;
  30 +}
  31 +.liggray{
  32 + color:#9E9A9A;
  33 +}
  34 +.bg{
  35 + background-color:#efeef3;
  36 +}
  37 +.bg_green{
  38 + background-color: #1AAD19;
  39 +}
  40 +.bg_liggreen{
  41 + background-color: #ECF8EE;
  42 +}
  43 +.bg_red{
  44 + background-color: #E14553;
  45 +}
  46 +.bg_gray{
  47 + background-color: #f3f3f3;
  48 +}
  49 +.bg_white{
  50 + background-color: white;
  51 +}
  52 +.bg_blue{
  53 + background-color: #EEF2FB;
  54 +}
  55 +.bg_pink{
  56 + background-color: #FEEFF0;
  57 +}
  58 +.bg_ligblack{
  59 + background-color: #4C4E4F;
  60 +}
  61 +.mtop10{
  62 + margin-top: 10px;
  63 +}
  64 +.mtop12{
  65 + margin-top: 12px;
  66 +}
  67 +.mtop15{
  68 + margin-top: 15px;
  69 +}
  70 +.mtop20{
  71 + margin-top: 20px;
  72 +}
  73 +.mtop25{
  74 + margin-top: 25px;
  75 +}
  76 +.mtop30{
  77 + margin-top: 30px;
  78 +}
  79 +.mbottom5{
  80 + margin-bottom:5px;
  81 +}
  82 +.mbottom10{
  83 + margin-bottom: 10px;
  84 +}
  85 +.mbottom15{
  86 + margin-bottom: 15px;
  87 +}
  88 +.mbottom20{
  89 + margin-bottom: 20px;
  90 +}
  91 +.mbottom30{
  92 + margin-bottom: 30px;
  93 +}
  94 +.ptop5{
  95 + padding-top:5px;
  96 +}
  97 +.pbottom5{
  98 + padding-bottom:5px;
  99 +}
  100 +.ptop8{
  101 + padding-top:8px;
  102 +}
  103 +.pbottom8{
  104 + padding-bottom:8px;
  105 +}
  106 +.ptop10{
  107 + padding-top:10px;
  108 +}
  109 +.pbottom10{
  110 + padding-bottom:10px;
  111 +}
  112 +.ptop12{
  113 + padding-top:12px;
  114 +}
  115 +.pbottom12{
  116 + padding-bottom:12px;
  117 +}
  118 +.ptop13{
  119 + padding-top:13px;
  120 +}
  121 +.pbottom13{
  122 + padding-bottom:13px;
  123 +}
  124 +.ptop15{
  125 + padding-top:15px;
  126 +}
  127 +.pbottom15{
  128 + padding-bottom:15px;
  129 +}
  130 +.ptop18{
  131 + padding-top:18px;
  132 +}
  133 +.pbottom18{
  134 + padding-bottom:18px;
  135 +}
  136 +.ptop20{
  137 + padding-top:20px;
  138 +}
  139 +.pbottom20{
  140 + padding-bottom:20px;
  141 +}
  142 +.mleft{
  143 + margin-left:4%;
  144 +}
  145 +.mleft6{
  146 + margin-left:6px;
  147 +}
  148 +.mleft10{
  149 + margin-left: 10px;
  150 +}
  151 +.mleft14{
  152 + margin-left: 14px;
  153 + height: 60px;
  154 +}
  155 +.mleft16{
  156 + margin-left: 16px;
  157 +}
  158 +.mright20{
  159 + margin-right: 20px;
  160 +}
  161 +.strong,.bold{
  162 + font-weight: bold;
  163 +}
  164 +.overflow{
  165 + overflow:hidden;
  166 +}
  167 +.textoverflow{
  168 + display: block;
  169 + overflow: hidden;
  170 + white-space: nowrap;
  171 + text-overflow: ellipsis;
  172 +}
  173 +.fsize11{
  174 + font-size: 22rpx;
  175 + height:11px;
  176 + line-height:11px;
  177 +}
  178 +.fsize12{
  179 + font-size: 24rpx;
  180 +}
  181 +.fsize13{
  182 + font-size: 26rpx;
  183 +}
  184 +.fsize14{
  185 + font-size: 28rpx;
  186 +}
  187 +.fsize15{
  188 + font-size: 30rpx;
  189 +}
  190 +.fsize16{
  191 + font-size: 32rpx;
  192 +}
  193 +.fsize17{
  194 + font-size: 34rpx;
  195 +}
  196 +.fsize18{
  197 + font-size: 36rpx;
  198 +}
  199 +.fsize20{
  200 + font-size: 40rpx;
  201 +}
  202 +.fsize24{
  203 + font-size: 48rpx;
  204 +}
  205 +.black-font{
  206 + color:#353535;
  207 +}
  208 +.white-font{
  209 + color:#fff;
  210 +}
  211 +.gray-light-font{
  212 + color:#999;
  213 +}
  214 +.gray-deenpen-font{
  215 + color:#666;
  216 +}
  217 +
  218 +.hr-one{
  219 + background: #efeef3;
  220 + height: 1px;
  221 + width:auto;
  222 +}
  223 +.nowrap{white-space:nowrap;}
  224 +
  225 +/*水平方向左右分布*/
  226 +.flex-lr{
  227 + display: flex;
  228 + display: -webkit-flex;
  229 + justify-content: space-between;
  230 + align-items:center;
  231 + flex-direction: row;
  232 + -webkit-flex-direction: row;
  233 +}
  234 +.flex-ll{
  235 +
  236 + display: flex;
  237 + display: -webkit-flex;
  238 + flex-direction:row;
  239 + justfy-content: flex-start;
  240 + align-items: center;
  241 + -webkit-flex-direction: row;
  242 +}
  243 +.flex-ll-top{
  244 + display: flex;
  245 + display: -webkit-flex;
  246 + flex-direction:row;
  247 + -webkit-flex-direction: row;
  248 +}
  249 +.flex-ll-bottom{
  250 + display: flex;
  251 + display: -webkit-flex;
  252 + flex-direction:row;
  253 + -webkit-flex-direction: row;
  254 + justfy-content: flex-end;
  255 + align-items: flex-end;
  256 +}
  257 +
  258 +.flex-rr{
  259 + display: flex;
  260 + display: -webkit-flex;
  261 + justify-content: flex-end;
  262 + align-items: center;
  263 + flex-direction: row;
  264 + -webkit-flex-direction: row;
  265 +}
  266 +/*垂直方向居中分布*/
  267 +.flex-vc{
  268 + display: flex;
  269 + display: -webkit-flex;
  270 + justify-content: center;
  271 + align-items: center;
  272 + flex-direction: column;
  273 + -webkit-flex-direction: column;
  274 +}
  275 +/*垂直方向居左分布*/
  276 +.flex-vl{
  277 + display: flex;
  278 + display: -webkit-flex;
  279 + justify-content: flex-start;
  280 + align-items: left;
  281 + flex-direction: column;
  282 + -webkit-flex-direction: column;
  283 +}
  284 +/*垂直方向居右分布*/
  285 +.flex-vr{
  286 + display: flex;
  287 + display: -webkit-flex;
  288 + justify-content: flex-end;
  289 + align-items: center;
  290 + flex-direction: column;
  291 + -webkit-flex-direction: column;
  292 + }
  293 +/*水平方向居中分布*/
  294 +.flex-cc{
  295 + display: flex;
  296 + display: -webkit-flex;
  297 + justify-content: center;
  298 + align-items: center;
  299 + flex-direction: row;
  300 + -webkit-flex-direction: row;
  301 +}
  302 +/*基准线对齐*/
  303 +.flex-bc{
  304 + display: flex;
  305 + display: -webkit-flex;
  306 + justify-content: center;
  307 + align-items: baseline;
  308 + flex-direction: row;
  309 + -webkit-flex-direction: row;
  310 +}
  311 +/*流式布局*/
  312 +.flex-auto{
  313 + display: flex;
  314 + display: -webkit-flex;
  315 + justify-content: space-around;
  316 + align-content: flex-start;
  317 + flex-flow:wrap;
  318 +}
  319 +.div-v-center {
  320 + -webkit-transform: translateY(-50%);
  321 + -moz-transform: translateY(-50%);
  322 + -ms-transform: translateY(-50%);
  323 + -o-transform: translateY(-50%);
  324 + transform: translateY(-50%);
  325 +}
  326 +.div-h-center {
  327 + -webkit-transform: translateX(-50%);
  328 + -moz-transform: translateX(-50%);
  329 + -ms-transform: translateX(-50%);
  330 + -o-transform: translateX(-50%);
  331 + transform: translateX(-50%);
  332 +}
  333 +.t-align-c{
  334 + text-align: center;
  335 +}
  336 +.t-align-r{
  337 + text-align: right;
  338 +}
  339 +.t-align-j{
  340 + text-align: justify;
  341 +}
  342 +.displaysan{
  343 + word-break:break-all;
  344 + text-overflow:ellipsis;
  345 + display:-webkit-box;
  346 + -webkit-box-orient:vertical;
  347 + -webkit-line-clamp:2;
  348 + overflow:hidden;
  349 +}
  350 +.linethrough{
  351 + text-decoration:line-through
  352 +}
  353 +image{
  354 + background-color: #f4f4f4;
  355 + background-repeat: no-repeat;
  356 + background-size: 68px 24px;
  357 + background-position: center;
  358 +}
  359 +.opacity{
  360 + opacity: 0.4;
  361 +}
  362 +.opacity2{
  363 + opacity: 0.2;
  364 +}
  365 +.avater{width:50px;height:50px;border-radius:50%;}
  366 +.fixed{position:fixed}
  367 +.inline{
  368 + display:inline-block;
  369 +}
  370 +.width{
  371 + width:50%;
  372 +}
  373 +.width100{
  374 + width:100%;
  375 +}
  376 +.height100{
  377 + height:100px;
  378 +}
  379 +/*点餐人数 选择口味*/
  380 +.choose{
  381 + height:32px;
  382 +}
  383 +.choose .normal{
  384 + width:76px;
  385 + height:30px;
  386 + line-height:30px;
  387 + text-align:center;
  388 + color:#E14553;
  389 + border:1px solid #FB848F;
  390 + border-radius:15px;
  391 +}
  392 +.mleft30{
  393 + margin-left:30px;
  394 +}
  395 +.mleft50{
  396 + margin-left:50px;
  397 +}
  398 +.choose .active{
  399 + background-color:#F93E85;
  400 + color:#fff;
  401 +}
  402 +.beginorder{
  403 + width:67%;
  404 + margin:0 16.5%;
  405 + height:40px;
  406 + line-height:40px;
  407 + border-radius:8px;
  408 + bottom:40px;
  409 +}
  410 +/* 会员卡样式调整 */
  411 +
  412 +.cardSection{ margin: 0 auto; width:84%; overflow: hidden; }
  413 +.cardBox {
  414 + width: 100%;
  415 + background: #EFEEF3;
  416 + padding: 30rpx 0;
  417 +}
  418 +.innerBox {
  419 + position: relative;
  420 + width: 84%; height: 0;
  421 + padding-top: 48%;
  422 +}
  423 +.cardTitle {
  424 + position: absolute;
  425 + top:15rpx;
  426 +}
  427 +.cardInfo {
  428 + position: absolute;
  429 + bottom:26rpx;
  430 +}
  431 +.fsizeTitle{
  432 + font-size: 30rpx;
  433 +}
  434 +.fsizeInfo {
  435 + font-size: 26rpx;
  436 +}
  437 +.rightsArea {
  438 + padding-top: 25rpx;
  439 +}
  440 +.imageSize {
  441 + width: 44rpx;
  442 + height: 44rpx;
  443 + overflow: hidden;
  444 + margin-right: 15rpx;
  445 + float: left;
  446 +}
  447 +.rightsTitle {
  448 + margin: 0 5%;
  449 + margin-bottom: 50rpx;
  450 +}
  451 +.infoSize {
  452 + color: #060606;
  453 + font-size: 30rpx;
  454 +}
  455 +.rightsItem {
  456 + margin-bottom: 35rpx;
  457 + height: 100%;
  458 +}
  459 +.itemInfo {
  460 + flex: 1;
  461 +}
  462 +.orderSize {
  463 + width: 222rpx;
  464 + height: 71rpx;
  465 + line-height: 71rpx;
  466 + font-size: 30rpx;
  467 +}
  468 +.disabledSize {
  469 + bottom: 80rpx;
  470 + margin: 0 100rpx;
  471 +}
  472 +.btnArea {
  473 + width: 100%;
  474 + display: flex;
  475 + justify-content: center;
  476 + position: absolute;
  477 + bottom: 80rpx;
  478 +}
  479 +.page {
  480 + height: 100%;
  481 +}
  482 +.fwhite {
  483 + color: #fff;
  484 +}
  485 +.fgray {
  486 + color: #efedec;
  487 +}
  488 +.b-radius{border-radius:6px;}
  489 +.bradius8{border-radius:8px;}
  490 +.bradius50{border-radius:50%;}
  491 +.smooth{
  492 + -webkit-font-smoothing: antialiased;
  493 + -moz-osx-font-smoothing: grayscale;
  494 +}
  495 +image{
  496 + display:block;
  497 + background:transparent;
  498 +}
  499 +button:after{
  500 + border:0;
  501 +}
  502 +button{
  503 + background:transparent;
  504 +}
  505 +.button-hover {
  506 + background-color: transparent;
  507 +}
  508 +.food-clear-num{
  509 + height:20px;
  510 + position:absolute;
  511 + right:0;
  512 +}
  513 +.food-clear-content{
  514 + height:100%;
  515 + font-size:22rpx;
  516 + padding:0 10rpx;
  517 + background:rgba(216,30,6,.9);
  518 + line-height:40rpx;
  519 +}
  520 +.food-clear-angel{
  521 + width:14rpx;
  522 + height:36rpx;
  523 + position:relative;
  524 + left:1rpx;
  525 +}
  526 +.angel-reat{
  527 + width:12px;
  528 + height:100%;
  529 + overflow:hidden;
  530 + position:relative;
  531 +}
  532 +.common-angle {
  533 + width: 0;
  534 + height: 0;
  535 + border-top: 12px solid transparent;
  536 + border-right: 12px solid rgba(216,30,6,.9);
  537 + border-bottom: 12px solid transparent;
  538 + position:absolute;
  539 +}
  540 +.top-angel{
  541 + top:-12px;
  542 + left:2px;
  543 +}
  544 +.bottom-angel{
  545 + bottom:-12px;
  546 + left:2px;
  547 +}
  548 +.font-bold,.Semibold{
  549 + font-weight:bold;
  550 +}
  551 +
  552 +.Medium{
  553 + font-weight: 400;
  554 +}
  1 +Component({
  2 + properties:{
  3 + cooklist:Array,
  4 + hasListModel:{
  5 + type:Boolean,
  6 + value:false
  7 + },
  8 + },
  9 + data:{
  10 + menuHidden:true,
  11 + activeMenuID:'',
  12 + },
  13 + attached(){
  14 + let obj={
  15 + menuHidden:!this.data.hasListModel,
  16 + };
  17 + this.setData(obj)
  18 + },
  19 + methods:{
  20 + changeList:function(e){
  21 + var _target=e.currentTarget.dataset;
  22 + console.log(_target);
  23 + this.setData({
  24 + activeMenuID:_target.id
  25 + })
  26 + this.triggerEvent("changeList",_target);
  27 + if(!this.data.hasListModel){
  28 + this.close();
  29 + }
  30 + },
  31 + show:function(){
  32 + let obj={
  33 + menuHidden:false
  34 + };
  35 + if(!this.data.activeMenuID){
  36 + obj.activeMenuID=this.data.cooklist[0].id||'';
  37 + }
  38 + this.setData(obj)
  39 + },
  40 + close:function () {
  41 + this.setData({
  42 + menuHidden:true
  43 + })
  44 + }
  45 + }
  46 +})
  1 +{
  2 + "component": true,
  3 + "usingComponents": {
  4 + "formids": "/components/formids/formids"
  5 + }
  6 +}
  1 +<view class="cook-class {{hasListModel?'hasListModel':''}}" hidden="{{menuHidden}}">
  2 + <block wx:for="{{cooklist}}" wx:key="cooklist-key">
  3 + <view class="flex-cc">
  4 + <formids bindclick="changeList" data-id="{{item.id}}">
  5 + <view class="white fsize24 smooth cook-class-single {{item.id==activeMenuID || (!activeMenuID && index==0) ? 'cook-class-single-active' : ''}}"
  6 + data-id="{{item.id}}">
  7 + <view wx:if="{{hasListModel}}" class="line2more" >
  8 + <view style="width: 100%;text-align: center">{{item.class_name}}</view>
  9 + </view>
  10 + <block wx:else="">{{item.class_name}}</block>
  11 + </view>
  12 + </formids>
  13 + </view>
  14 + </block>
  15 + <formids bindclick="close" class="menu-fixed">
  16 + <view>
  17 + <image src="http://qn.colorcun.com/custom/lite/image/menu-close-new.png" background-size="cover" class="menu-fixed-image-close"></image>
  18 + </view>
  19 + </formids>
  20 +</view>
  21 +<slot></slot>
  1 +/* component/cook-class/cook-class.wxss */
  2 +@import '../../app.wxss';
  3 +.cook-class{
  4 + width:100%;
  5 + top:0;
  6 + left:0;
  7 + bottom:0;
  8 + background:#e14553;
  9 + z-index:1000;
  10 + padding-top:80rpx;
  11 + box-sizing:border-box;
  12 + overflow-y: auto;
  13 + padding-bottom: 160rpx;
  14 +}
  15 +.menu-list{
  16 + width:100%;
  17 + height:100%;
  18 +}
  19 +.cook-class-single{
  20 + padding:0 20rpx;
  21 + padding-top:40rpx;
  22 + padding-bottom:10rpx;
  23 +}
  24 +.cook-class-single-active{
  25 + border-bottom:2px solid #fff;
  26 + font-weight:bold;
  27 +
  28 +}
  29 +.menu-fixed{
  30 + position:absolute;
  31 + bottom:10px;
  32 + left:10px;
  33 + width:80rpx;
  34 + height:80rpx;
  35 + padding:5rpx;
  36 + box-sizing:border-box;
  37 +}
  38 +.menu-fixed-image-close{
  39 + width:70rpx;
  40 + height:70rpx;
  41 + border-radius:50%;
  42 + position: fixed;
  43 + bottom: 40rpx;
  44 + left: 40rpx;
  45 +}
  46 +
  47 +
  48 +.hasListModel{
  49 + width: 180rpx;
  50 + padding-top:0rpx;
  51 + padding-left: 0;
  52 + background-color: #F5F5F5;
  53 +}
  54 +.hasListModel .cook-class-single{
  55 + width: 180rpx;
  56 + color: #999999;
  57 + font-size: 30rpx;
  58 + padding:18rpx 0rpx;
  59 + border-width:0 ;
  60 +}
  61 +.hasListModel .menu-fixed{
  62 + display: none;
  63 +}
  64 +.hasListModel .cook-class-single-active{
  65 + border-bottom-width:0 ;
  66 + background-color:#FEFEFE;
  67 + color:#353535;
  68 + font-weight: 400;
  69 +}
  70 +.hasListModel .cook-class-single-active:before{
  71 + position: absolute;
  72 + content: '';
  73 + top:0;
  74 + left:0;
  75 + width: 4rpx;
  76 + height: 100%;
  77 + background-color: #E14553;
  78 +}
  79 +.hasListModel .line2more{
  80 + height: 84rpx;
  81 + width:140rpx;
  82 + vertical-align: middle;
  83 + overflow: hidden;
  84 + text-align: center;
  85 + margin: auto;
  86 + text-overflow:ellipsis;
  87 + display: -webkit-box;
  88 + /*-webkit-box-orient: vertical;*/
  89 + /*-webkit-line-clamp: 2;*/
  90 + -webkit-box-align: center;
  91 +}
  1 +// component/menu/addDelete.js
  2 +import util from '../../../utils/util';
  3 +import App from '../../../utils/api';
  4 +const {regeneratorRuntime} = global
  5 +Component({
  6 + /**
  7 + * 组件的属性列表
  8 + */
  9 + properties: {
  10 + item: {
  11 + type: Object, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
  12 + },
  13 + sellerid:{
  14 + type:Number
  15 + },
  16 + orderid:{
  17 + type:Number
  18 + },
  19 + fromSoucre:{
  20 + type:Number,
  21 + value:0
  22 + },
  23 + request_uri:{
  24 + type:Boolean,
  25 + value:false,
  26 + },
  27 + hasListModel:{
  28 + type:Boolean,
  29 + value:false,
  30 + },
  31 + },
  32 +
  33 + /**
  34 + * 组件的初始数据
  35 + */
  36 + data: {
  37 + item_clear_num:null,
  38 + hasIPhone:false,
  39 + },
  40 + attached () {
  41 + console.log('food-card-ready',this.data.orderid,this.data.fromSoucre)
  42 + let item=this.data.item;
  43 + let item_clear_num;
  44 + if(typeof item.item_clear_num!='undefined'){
  45 + item_clear_num=item.item_clear_num;
  46 + }else{
  47 + item_clear_num=item.clear_num;
  48 + if(item.spec){
  49 + let clear_num=null;
  50 + item.spec.forEach(spec=>{
  51 + if(spec.clear_num==0){
  52 + clear_num=0;
  53 + }else{
  54 + clear_num=null;
  55 + }
  56 + })
  57 + if(clear_num==0){
  58 + item_clear_num=0;
  59 + }
  60 + }
  61 + }
  62 +
  63 + this.setData({
  64 + item_clear_num:item_clear_num,
  65 + hasIPhone:getApp().system.model.indexOf('iPhone')>-1
  66 + });
  67 + },
  68 + detached(){
  69 +
  70 + },
  71 + /**
  72 + * 组件的方法列表
  73 + */
  74 + methods: {
  75 + //规格 增加/减少 回调
  76 + foodSpecCallback(e){
  77 + let opt=e.detail;
  78 + console.log('foodSpecCallback',opt);
  79 + if(opt.type=='specWin'){
  80 + return this.triggerEvent('foodCardCallback',opt);
  81 + }
  82 + let item=this.data.item;
  83 + let oldNum=(item.num||0);
  84 + item.num=(item.num||0)+opt.type;
  85 + let rotateFlag=(oldNum==0 || item.num==0);
  86 + console.log('num_rotate',rotateFlag);
  87 + this.setData({item:item,rotate_id:rotateFlag?item.id:''});
  88 + opt.num=item.num;
  89 + this.triggerEvent('foodCardCallback',opt);
  90 + },
  91 +
  92 + //清除订单下某菜品所有数量
  93 + delOrderCook:function(){
  94 + this.selectComponent("#foodSpecDel").clean();
  95 + },
  96 + //triggerAdd
  97 + triggerAdd(e){
  98 + console.log('triggerAdd',e)
  99 + if(this.data.item_clear_num==0) return;
  100 + this.selectComponent("#foodSpecAddOne").addCook();
  101 + },
  102 + //viewIMage
  103 + viewImage(){
  104 + wx.previewImage({
  105 + current: this.data.item.image, // 当前显示图片的http链接
  106 + urls: [this.data.item.image], // 需要预览的图片http链接列表
  107 + })
  108 + }
  109 + }
  110 +})
  1 +{
  2 + "component": true,
  3 + "usingComponents": {
  4 + "foodSpec": "../food-spec/food-spec"
  5 + }
  6 +}
  1 +<view class="flex-ll-top hasListModel" style="width:100%;">
  2 + <view class="avatar">
  3 + <image mode="aspectFill" lazy-load="true" src="{{item.image}}"/>
  4 + </view>
  5 + <view class="content">
  6 + <view class="name Semibold">
  7 + {{item.name}}
  8 + </view>
  9 + <view class="desc">
  10 + {{item.desc||''}}
  11 + </view>
  12 + <view class="label">
  13 + <block wx:if="{{item.labelList}}">
  14 + <view class="menu-ptop-mark">
  15 + <block wx:for="{{item.labelList}}" wx:for-item="son" wx:key="labelList-key">
  16 + <image class="labelListImg" src="{{son.icon}}" mode="aspectFit"></image>
  17 + </block>
  18 + </view>
  19 + </block>
  20 + </view>
  21 + <view class="flex-lr price">
  22 + <view class="flex-ll">
  23 + <view class="rmb">¥</view>
  24 + <view class="money">{{item.spec[0].price>0 ? item.spec[0].price : item.price}}</view>
  25 + </view>
  26 + <view class="opt flex-ll">
  27 + <block wx:if="{{item_clear_num==0}}">
  28 + <image
  29 + class="avater"
  30 + src="http://qn.colorcun.com/custom/lite/image/clear.png"
  31 + style="width:41px;height:26px;margin-top:3px;position:relative;top:-2px;float:right;"
  32 + class="{{item.image?bg_white:bg_pink}}"/>
  33 + </block>
  34 + <block wx:else="">
  35 + <block wx:if="{{item.num>0}}">
  36 + <foodSpec item="{{item}}" type="-" id="foodSpecDel"
  37 + sellerid="{{sellerid}}" orderid="{{orderid}}"
  38 + fromSoucre="{{fromSoucre}}" request_uri="{{request_uri}}"
  39 + bindfoodSpecCallback="foodSpecCallback">
  40 + <view class='jian'></view>
  41 + </foodSpec>
  42 + <view class="t-align-c">{{item.num}}</view>
  43 + </block>
  44 + <foodSpec item="{{item}}" type="+"
  45 + sellerid="{{sellerid}}" orderid="{{orderid}}"
  46 + fromSoucre="{{fromSoucre}}" request_uri="{{request_uri}}"
  47 + bindfoodSpecCallback="foodSpecCallback">
  48 + <view class='add'></view>
  49 + </foodSpec>
  50 + </block>
  51 + </view>
  52 + </view>
  53 + <view wx:if="{{item_clear_num>0}}" style="padding:0rpx 10rpx;">
  54 + <text class="food-clear-content">剩{{item_clear_num}}份</text>
  55 + </view>
  56 + </view>
  57 +</view>
  58 +
  1 +@import '../../app.wxss';
  2 +.cookWapper{
  3 + border-radius:4px;
  4 + position: relative;
  5 + transform-style: preserve-3d;
  6 +}
  7 +.rotate{
  8 + transition: transform .5s;
  9 +}
  10 +.true {
  11 + transform: rotateY(-180deg);
  12 +}
  13 +.fanWapper,.zhengWapper{
  14 + width: 100%;
  15 + height: 100%;
  16 + box-sizing: border-box;
  17 + position: absolute;
  18 + backface-visibility: hidden;
  19 + -webkit-backface-visibility: hidden;
  20 + -moz-backface-visibility: hidden;
  21 + border-radius:4px;
  22 + overflow: hidden;
  23 +}
  24 +.fanWapper{
  25 + background-color: #FEEFF0;
  26 + transform: rotateY(-180deg);
  27 +}
  28 +.food-name-box{
  29 + width:100%;padding-left:8px;box-sizing:border-box;
  30 +}
  31 +.food-name{
  32 + font-weight:bold;text-overflow:ellipsis;white-space: nowrap;
  33 + width:100%;
  34 + overflow:hidden;
  35 +}
  36 +.food-card-opt{
  37 + padding:0 12px;
  38 + margin-top: -50px;
  39 + position: relative;
  40 + height: 50px;
  41 +}
  42 +
  43 +.del-close-image{
  44 + width:13px;
  45 + height:13px;
  46 +}
  47 +
  48 +.jiazhengwapper{
  49 + margin-left: 10rpx;
  50 + margin-top: 30rpx;
  51 + width: 250rpx;
  52 + padding: 5rpx 0;
  53 + border-radius: 40rpx;
  54 + border:1px solid #999;
  55 + display: flex;
  56 + align-items: center;
  57 + justify-content: space-around;
  58 +}
  59 +.t-align-c{
  60 + padding: 0 10rpx;
  61 +}
  62 +
  63 +.jian,.add{
  64 + width: 60rpx;
  65 + height: 60rpx;
  66 + position: relative;
  67 +}
  68 +.jian::after{
  69 + position: absolute;
  70 + content: '';
  71 + top: 0;
  72 + left: 0;
  73 + right: 0;
  74 + bottom: 0;
  75 + margin: auto;
  76 + width: 60%;
  77 + height: 6rpx;
  78 + background-color: #999;
  79 + border-radius: 10rpx;
  80 +}
  81 +.add::after{
  82 + position: absolute;
  83 + content: '';
  84 + top: 0;
  85 + left: 0;
  86 + right: 0;
  87 + bottom: 0;
  88 + margin: auto;
  89 + width: 60%;
  90 + height: 6rpx;
  91 + background-color: red;
  92 + border-radius: 10rpx;
  93 +}
  94 +.add::before{
  95 + position: absolute;
  96 + content: '';
  97 + top: 0;
  98 + left: 0;
  99 + right: 0;
  100 + bottom: 0;
  101 + margin: auto;
  102 + width: 6rpx;
  103 + height: 60%;
  104 + background-color: red;
  105 + border-radius: 10rpx;
  106 +}
  107 +
  108 +.ptop5 {
  109 + padding-top:5px;
  110 +}
  111 +.menu-mask-image{
  112 + position:absolute;
  113 + top:0px;
  114 + right:0px;
  115 + width:13px;
  116 + height:13px;
  117 + padding:7px 7px 10px 10px;
  118 + z-index:10;
  119 +}
  120 +
  121 +.menu-ptop-mark{ width:100%; height: 13px; padding-top:0; display: flex}
  122 +.labelListImg{
  123 + width: 50rpx; height: 30rpx; margin-right: 10rpx;
  124 +}
  125 +
  126 +.hasListModel{
  127 + /*列表模式*/
  128 +}
  129 +.hasListModel .avatar{
  130 + width: 138rpx;
  131 + min-width: 138rpx;
  132 + height: 140rpx;
  133 + margin-right: 18rpx;
  134 + border-radius: 10rpx;
  135 + overflow: hidden;
  136 + background-color: #D8D8D8;
  137 + margin-top: 10rpx;
  138 +}
  139 +.hasListModel .avatar image{
  140 + width: 100%;
  141 + height: 100%;
  142 +
  143 +}
  144 +
  145 +.hasListModel .content{
  146 + overflow: hidden;
  147 + width: 100%;
  148 +}
  149 +.hasListModel .name{
  150 + height: 48rpx;
  151 + line-height:48rpx;
  152 + font-size: 34rpx;
  153 + overflow: hidden;
  154 + text-overflow:ellipsis;
  155 + white-space: nowrap;
  156 +}
  157 +.hasListModel .desc{
  158 + height: 34rpx;
  159 + line-height:34rpx;
  160 + font-size: 24rpx;
  161 + overflow: hidden;
  162 + text-overflow:ellipsis;
  163 + white-space: nowrap;
  164 +}
  165 +.hasListModel .label{
  166 + height: 22rpx;
  167 + line-height:22rpx;
  168 + overflow: hidden;
  169 + margin-top: 12rpx;
  170 + margin-bottom: 4rpx;
  171 +}
  172 +.hasListModel .label .menu-ptop-mark,.hasListModel .label .labelListImg{
  173 + height: 100%;
  174 + margin-right: 4rpx;
  175 +}
  176 +.hasListModel .price{
  177 + height: 40rpx;
  178 + overflow: hidden;
  179 + padding:0 10rpx;
  180 + line-height: 40rpx;
  181 + font-size: 28rpx;
  182 +}
  183 +.hasListModel .price .flex-ll-bottom{
  184 + height: 40rpx;
  185 +}
  186 +.hasListModel .price .rmb{
  187 + /*line-height:26rpx;
  188 + height:26rpx;
  189 + font-size: 24rpx;*/
  190 + margin-right: 10rpx;
  191 +}
  192 +.hasListModel .price .money{
  193 + /*height: 30rpx;
  194 + font-size: 28rpx;
  195 + line-height:30rpx;*/
  196 +}
  197 +
  198 +.hasListModel .food-clear-content{
  199 + color:#DA331D;
  200 + background-color: #F4DCD9;
  201 + padding: 4rpx 10rpx;
  202 +}
  203 +
  204 +.hasListModel .jian,.hasListModel .add{
  205 + width:36rpx;
  206 + height: 36rpx;
  207 + border-radius: 50%;
  208 +}
  209 +.hasListModel .jian{
  210 + border: 2rpx solid #B4B2B2;
  211 +
  212 +}
  213 +.hasListModel .jian:after{
  214 + width: 75%;
  215 + height: 4rpx;
  216 + background-color: #B4B2B2;
  217 +}
  218 +.hasListModel .add{
  219 + border: 2rpx solid #E14553;
  220 + background-color:#E14553;
  221 +}
  222 +.hasListModel .add:after,.hasListModel .add:before{
  223 + background-color: #fff;
  224 +}
  225 +.hasListModel .add:after{
  226 + width: 75%;
  227 + height: 4rpx;
  228 +}
  229 +.hasListModel .add:before{
  230 + height: 75%;
  231 + width: 4rpx;
  232 +}
  233 +.hasListModel .t-align-c{
  234 + margin: 0 10rpx;
  235 + font-size: 36rpx;
  236 + font-weight: bold;
  237 + padding: 0;
  238 + width: 50rpx;
  239 + overflow: hidden;
  240 +}
  1 +// component/menu/addDelete.js
  2 +import util from '../../../utils/util';
  3 +import App from '../../../utils/api';
  4 +const {regeneratorRuntime} = global
  5 +Component({
  6 + /**
  7 + * 组件的属性列表
  8 + */
  9 + properties: {
  10 + item:{
  11 + type:Object // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
  12 + },
  13 + type:{
  14 + type:String,
  15 + default:'+'
  16 + },
  17 + sellerid:{
  18 + type:Number
  19 + },
  20 + orderid:{
  21 + type:Number
  22 + },
  23 + fromSoucre:{
  24 + type:Number,
  25 + value:0
  26 + },
  27 + request_uri:{
  28 + type:Boolean,
  29 + value:false,
  30 + }
  31 +
  32 + },
  33 +
  34 + /**
  35 + * 组件的初始数据
  36 + */
  37 + data: {
  38 + hiddenFoodSpec:true,//加菜规格
  39 + hiddenFoodSpecReduce:true,//减菜规格
  40 + selectKind:[{title:'xxxxx'},{title:'yyyyy'}],
  41 + },
  42 + ready () {
  43 +
  44 + },
  45 + detached(){
  46 +
  47 + },
  48 + /**
  49 + * 组件的方法列表
  50 + */
  51 + methods: {
  52 + init(){
  53 + console.log('food-spec init');
  54 + this.setData({
  55 + hiddenFoodSpec:false
  56 + })
  57 + },
  58 + //关闭规格框
  59 + close:function(){
  60 + this.setData({
  61 + hiddenFoodSpec:true,
  62 + hiddenFoodSpecReduce:true,
  63 + })
  64 + //关闭了规格窗口
  65 + this.triggerEvent('foodSpecCallback',{
  66 + type:'specWin',
  67 + value:'hide'
  68 + });
  69 + },
  70 + //构造KindMenu
  71 + initKindMenu(){
  72 + return new Promise((success,fail)=>{
  73 + let price=this.data.item.price;
  74 + let hasSpec = this.data.item.spec.length>0;
  75 + let hasPractice = this.data.item.practice.length>0;
  76 + if(hasSpec || hasPractice){
  77 + var specs = this.data.item.spec//规格
  78 + var practice = this.data.item.practice//做法
  79 + var kind = []
  80 + var foodMenu=[]
  81 + if(this.data.type=='-'){
  82 + if(specs){
  83 + specs.map(function(r,n){
  84 + if(r.id){//某规格卖光了 就不显示 && r.clear_num>1
  85 + kind.push({id:r.id,price:r.price,title:r.specs,iskind:false})
  86 + }
  87 + })
  88 + }
  89 +
  90 + if(practice) {
  91 + practice.map(function (r, n) {
  92 + if (r.id) {
  93 + foodMenu.push({id: r.id, price: r.price, title: r.name, iskind: false})
  94 + }
  95 + })
  96 + }
  97 + util.rpc(uri.CGI__USER_GETCOOKBOOKSELBYSPECSID,{
  98 + sellerid:this.data.sellerid,
  99 + orderid: this.data.orderid,
  100 + cookbookid: this.data.item.id,
  101 + status:this.data.fromSoucre!=''?2:'',//只查没有下单的
  102 + }).then(res=>{
  103 + this.setData({
  104 + selectKind:res.data[0],
  105 + hiddenFoodSpecReduce:false,
  106 + kind:kind?kind:'',
  107 + foodMenu:foodMenu,
  108 + })
  109 + })
  110 + }else{
  111 + specs.map(function(r,n){
  112 + if ((r.id && r.clear_num > 0) || r.clear_num==null){//某规格卖光了 就不显示 && r.clear_num>1
  113 + kind.push({id:r.id,price:r.price,title:r.specs,iskind:false})
  114 + }
  115 + })
  116 + if(kind.length>0){
  117 + kind[0].iskind=true;
  118 + var kindPrice=kind[0].price;
  119 + var specs_id=kind[0].id;
  120 + }
  121 +
  122 + practice.map(function(r,n){
  123 + if(r.id){
  124 + foodMenu.push({id:r.id,price:price,title:r.name,iskind:false})
  125 + }
  126 + })
  127 +
  128 + if(foodMenu.length>0){
  129 + foodMenu[0].iskind=true;
  130 + var foodMenuPrice=foodMenu[0].price;
  131 + var practice_id=foodMenu[0].id;
  132 + }
  133 + util.rpc(uri.CGI__USER_GETCOOKBOOKSELBYSPECSID,{
  134 + sellerid:this.data.sellerid,
  135 + orderid: this.data.orderid,
  136 + cookbookid: this.data.item.id,
  137 + status:this.data.fromSoucre!=''?2:'',//只查没有下单的
  138 + }).then(res=>{
  139 + this.setData({
  140 + selectKind:res.data[0],
  141 + hiddenFoodSpec:false,
  142 + kind:kind,
  143 + foodMenu:foodMenu,
  144 + showSpecsPrice:false,
  145 + cookbook_name:this.data.item.name,
  146 + cookbook_id:this.data.item.id,
  147 + specs_id:specs_id ? specs_id :'',
  148 + practice_id:practice_id ? practice_id : '',
  149 + selectPrice:kindPrice>0 ? kindPrice : foodMenuPrice,
  150 + add_target:''
  151 + })
  152 + })
  153 + }
  154 + success();
  155 + }else{
  156 + fail();
  157 + }
  158 + });
  159 + },
  160 + //选择规格
  161 + kindSelect: function (e) {
  162 + var index = e.currentTarget.dataset.key
  163 + var specsid = e.currentTarget.id
  164 + var price = e.currentTarget.dataset.price
  165 + for (var i = 0; i < this.data.kind.length; i++) {
  166 + if (i == index) {
  167 + this.data.kind[i].iskind = true;
  168 + } else {
  169 + this.data.kind[i].iskind = false;
  170 + }
  171 + }
  172 + var is_show = ''
  173 + if(this.data.foodMenu==''){
  174 + is_show=1
  175 + }else if(specsid && this.data.practice_id){
  176 + is_show=1
  177 + }
  178 + this.setData({
  179 + kind: this.data.kind,
  180 + selectPrice:price,
  181 + specs_id:specsid,
  182 + foodMenu:this.data.foodMenu?this.data.foodMenu:'',
  183 + showSpecsPrice:price?false:true,
  184 + showAdd:is_show?false:true//showAdd:specsid?false:true
  185 + });
  186 + },
  187 + //选择做法
  188 + menuSelect: function (e) {
  189 + var index = e.currentTarget.dataset.key
  190 + var practiceid = e.currentTarget.id
  191 + var price = e.currentTarget.dataset.price
  192 + for (var i = 0; i < this.data.foodMenu.length; i++) {
  193 + if (i == index) {
  194 + this.data.foodMenu[i].iskind = true;
  195 + } else {
  196 + this.data.foodMenu[i].iskind = false;
  197 + }
  198 + }
  199 + var is_show = ''
  200 + if(this.data.kind==''){
  201 + is_show=1
  202 + }else if(this.data.specs_id && practiceid){
  203 + is_show=1
  204 + }
  205 + this.setData({
  206 + foodMenu: this.data.foodMenu,
  207 + foodMenuPrice:price,
  208 + practice_id:practiceid,
  209 + showAdd:is_show?false:true
  210 + });
  211 + },
  212 + //加菜面板
  213 + addCook:function(e){
  214 + console.log('addCook',this.data.item,e);
  215 + var cookbookid = this.data.item.id
  216 + var price=this.data.item.price;
  217 +
  218 + this.initKindMenu().then(res=>{
  219 + //打开了规格窗口
  220 + this.triggerEvent('foodSpecCallback',{
  221 + type:'specWin',
  222 + value:'show'
  223 + });
  224 + }).catch(res=>{
  225 + console.log('initKindMenu',res);
  226 + if( this.data.item.clear_num && this.data.item.clear_num>0
  227 + && this.data.item.num+1 > this.data.item.clear_num){
  228 + wx.showToast({
  229 + title:'该菜品最多能点'+this.data.item.clear_num+'份',
  230 + duration:2000,
  231 + mask:true,
  232 + icon:'none'
  233 + });
  234 + return;
  235 + }
  236 + //通知
  237 + this.triggerEvent('foodSpecCallback',{
  238 + cookbookid:cookbookid,
  239 + type:1,
  240 + });
  241 + //this.matchArray(cookbookid,1,countTotal,countPirce)
  242 + util.post(uri.CGI__USER_ADDCRAT,{
  243 + orderid: this.data.orderid,
  244 + openid:util.cache('openid'),
  245 + cookbookid:cookbookid,
  246 + price: price,
  247 + source: 1,
  248 + request_uri: this.data.request_uri == true ? 1 : '',//服务员通过消息通知进来 又加菜的标识
  249 + fromSoucre:this.data.fromSoucre?this.data.fromSoucre:'',
  250 + identity:util.cache('identity')
  251 + },uri.CGI__USER_ADDCRAT__CODE,'0','0');
  252 + });
  253 + },
  254 + //减菜面板
  255 + subtractCook(){
  256 + console.log('addFunction',this.data.item);
  257 + var cookbookid = this.data.item.id
  258 + var price=this.data.item.price;
  259 + this.initKindMenu().then(res=>{
  260 + //打开了规格窗口
  261 + this.triggerEvent('foodSpecCallback',{
  262 + type:'specWin',
  263 + value:'show'
  264 + });
  265 + }).catch(res=>{
  266 + //通知
  267 + this.triggerEvent('foodSpecCallback',{
  268 + cookbookid:cookbookid,
  269 + type:-1,
  270 + });
  271 +
  272 + util.post(uri.CGI__USER_REDUCEORDER, {
  273 + orderid: this.data.orderid,
  274 + openid: getApp().openid,
  275 + cookbookid: cookbookid,
  276 + //specid: specid ? specid : '',
  277 + //practiceid: specid ? specid : '',
  278 + fromSoucre: this.data.fromSoucre ? this.data.fromSoucre : '',
  279 + request_uri: this.data.request_uri == true ? 1 : '',//服务员通过消息通知进来 又加菜的标识
  280 + status:this.data.fromSoucre!=''?2:'',//只查没有下单的
  281 + source: 2,
  282 + }, uri.CGI__USER_REDUCEORDER__CODE, '0', '0');
  283 + });
  284 + },
  285 + //减菜面板加菜按钮
  286 + add:function(e){
  287 + console.log('add',util.attr(e,'cookbookid'),e);
  288 + let index=util.attr(e,'index');
  289 + let selectKind=this.data.selectKind;
  290 +
  291 + console.log('selectKind',selectKind,index);
  292 + let specs=this.data.item.spec;
  293 + let clear_num=null;
  294 + specs.forEach(spec=>{
  295 + if(spec.id==selectKind[index].specid){
  296 + clear_num=spec.clear_num;
  297 + }
  298 + })
  299 + if( clear_num && clear_num>0
  300 + && selectKind[index].foodNum+1 > clear_num){
  301 + wx.showToast({
  302 + title:'该菜品最多能点'+clear_num+'份',
  303 + duration:2000,
  304 + mask:true,
  305 + icon:'none'
  306 + });
  307 + return;
  308 + }
  309 +
  310 + selectKind[index].foodNum=parseInt(selectKind[index].foodNum)+1;
  311 + this.setData({selectKind:selectKind});
  312 + this.formSubmit(e,true);
  313 + },
  314 + //减菜面板减菜按钮
  315 + reduce(e){
  316 + console.log('reduce',util.attr(e,'cookbookid'),e);
  317 + var cookbookid = util.attr(e,'cookbookid')
  318 + var specid = util.attr(e,'specid')
  319 + var practice_id = util.attr(e,'practiceid')
  320 + var price = util.attr(e,'price')
  321 +
  322 + let index=util.attr(e,'index');
  323 + let selectKind=this.data.selectKind;
  324 + selectKind[index].foodNum-=1;
  325 + if(selectKind[index].foodNum<=0){
  326 + selectKind.splice(index,1);
  327 + }
  328 + this.setData({selectKind:selectKind});
  329 + if(selectKind.length<1){
  330 + this.close();
  331 + }
  332 +
  333 + this.triggerEvent('foodSpecCallback',{
  334 + cookbookid:cookbookid,
  335 + type:-1
  336 + });
  337 +
  338 + //执行删除操作
  339 + let params={
  340 + orderid: this.data.orderid,
  341 + openid: getApp().openid,
  342 + cookbookid: cookbookid,
  343 + fromSoucre: this.data.fromSoucre ? this.data.fromSoucre : '',
  344 + status:this.data.fromSoucre?2:'',//只查没有下单的
  345 + request_uri: this.data.request_uri == true ? 1 : '',//服务员通过消息通知进来 又加菜的标识
  346 + source: 2,
  347 + };
  348 + if(specid>0){
  349 + params.specid=specid;
  350 + }
  351 + if(practice_id>0){
  352 + params.practiceid=practice_id;
  353 + }
  354 + util.post(uri.CGI__USER_REDUCEORDER, params, uri.CGI__USER_REDUCEORDER__CODE, '0', '0');
  355 + },
  356 + /**
  357 + *
  358 + * @param e
  359 + * @param subtractCook 减菜面板
  360 + */
  361 + formSubmit(e,subtractCook=false){
  362 + if(subtractCook){//减菜面板
  363 + var cookbookid = util.attr(e,'cookbookid')
  364 + var specid = util.attr(e,'specid')
  365 + var practice_id = util.attr(e,'practiceid')
  366 + var price = util.attr(e,'price')
  367 + }else{
  368 + var cookbookid = util.val(e,'cookbookid')
  369 + var specid = util.val(e,'specs_id')
  370 + var practice_id = util.val(e,'practice_id')
  371 + var price = util.val(e,'price')
  372 + if(this.data.selectPrice){
  373 + console.log(666666,this.data.selectPrice)
  374 + price=this.data.selectPrice
  375 + }else{
  376 + console.log('yyyyyy',this.data.foodMenuPrice)
  377 + price=this.data.foodMenuPrice
  378 + }
  379 + this.close();
  380 + }
  381 + console.log('formSubmit',specid,practice_id,price)
  382 +
  383 +
  384 + let selectKindNum=0;
  385 + if(this.data.selectKind){
  386 + this.data.selectKind.forEach((kind)=>{
  387 + if(kind.specid==specid){
  388 + selectKindNum=kind.foodNum
  389 + }
  390 + })
  391 + }
  392 + console.log('selectKindNum',this.data.selectKind,selectKindNum);
  393 + if(selectKindNum>0){
  394 + let clear_num=null;
  395 + let specs=this.data.item.spec;
  396 + specs.forEach(spec=>{
  397 + if(spec.id==specid){
  398 + clear_num=spec.clear_num;
  399 + }
  400 + })
  401 + if( clear_num && clear_num>0
  402 + && selectKindNum+1 > clear_num){
  403 + wx.showToast({
  404 + title:'该菜品最多能点'+clear_num+'份',
  405 + duration:2000,
  406 + mask:true,
  407 + icon:'none'
  408 + });
  409 + return;
  410 + }
  411 + }
  412 +
  413 +
  414 + this.triggerEvent('foodSpecCallback',{
  415 + cookbookid:cookbookid,
  416 + type:1
  417 + });
  418 + let param={
  419 + orderid: this.data.orderid,
  420 + openid:util.cache('openid'),
  421 + cookbookid:this.data.item.id,
  422 + price: price,
  423 + source: 1,
  424 + request_uri: this.data.request_uri==true?1:'',//服务员通过消息通知进来 又加菜的标识
  425 + fromSoucre:this.data.fromSoucre?this.data.fromSoucre:'',
  426 + identity:util.cache('identity')
  427 + }
  428 + if(specid>0){
  429 + param.specid=specid;
  430 + }
  431 + if(practice_id>0){
  432 + param.practiceid=practice_id;
  433 + }
  434 + util.post(uri.CGI__USER_ADDCRAT,param,uri.CGI__USER_ADDCRAT__CODE,'0','0');
  435 + },
  436 + //清除订单下某菜品所有数量
  437 + clean(){
  438 + let cookbookid=this.data.item.id
  439 + this.triggerEvent('foodSpecCallback',{
  440 + cookbookid:cookbookid,
  441 + type:this.data.item.num*-1
  442 + });
  443 + util.post(uri.CGI__USER_CLEARCOOKBYID,{
  444 + orderid: this.data.orderid,
  445 + sellerid: this.data.sellerid,
  446 + cookbookid:cookbookid
  447 + },uri.CGI__USER_CLEARCOOKBYID__CODE,'0','0');
  448 + }
  449 + }
  450 +})
  1 +{
  2 + "component": true,
  3 + "usingComponents": {}
  4 +}
  1 +<view bindtap="{{type=='-'?'subtractCook':(item.clear_num==0 ? '' : 'addCook')}}">
  2 + <slot></slot>
  3 +</view>
  4 +<view hidden="{{hiddenFoodSpec}}" class="hiddenFoodSpec">
  5 + <view class="toast-mask"></view>
  6 + <view class="toast-content">
  7 + <form bindsubmit="formSubmit">
  8 + <input value="{{cookbook_id}}" name="cookbookid" hidden="true"/>
  9 + <view class="toast-content-title">{{cookbook_name}}</view>
  10 + <block wx:if="{{kind.length>0}}">
  11 + <view class="toast-content-kind" style="margin-bottom:{{foodMenu.length==0 ? '80rpx' : '0rpx'}}">
  12 + <view class="toast-kind-title">规格</view>
  13 + <view class="toast-kind-menu">
  14 + <view class="toast-kind-single {{item.iskind==true?'kind-active':''}}" wx:for="{{kind}}" wx:key="kind-key" data-key="{{index}}" id="{{item.id}}" data-price="{{item.price}}" bindtap="kindSelect">{{item.title}}</view>
  15 + <input value="{{specs_id}}" name="specs_id" hidden="true"/>
  16 + <input value="{{selectPrice}}" name="price" hidden="true"/>
  17 + </view>
  18 + </view>
  19 + </block>
  20 + <block wx:if="{{foodMenu.length>0}}">
  21 + <view class="toast-content-kind" style="margin-bottom:{{kind.length==0 ? '235rpx' : '40rpx'}};">
  22 + <view class="toast-kind-title">做法</view>
  23 + <view class="toast-kind-menu">
  24 + <view class="toast-kind-single {{item.iskind==true?'kind-active':''}}" wx:for="{{foodMenu}}" wx:key="foodmenu-key" data-key="{{index}}" id="{{item.id}}" data-price="{{item.price}}" bindtap='menuSelect'>{{item.title}}</view>
  25 + <input value="{{practice_id}}" name="practice_id" hidden="true"/>
  26 + </view>
  27 + </view>
  28 + </block>
  29 + <block wx:else>
  30 + <view class="toast-content-kind" style="height:73px;">
  31 + </view>
  32 + </block>
  33 + <view class="toast-content-end">
  34 + <view class="toast-content-money" hidden="{{showSpecsPrice}}">¥{{selectPrice}}</view>
  35 + <button class="toast-content-add" formType="submit" hidden="{{showAdd}}">确定</button>
  36 + </view>
  37 + </form>
  38 + <image class="toast-content-close" bindtap="close" src="http://qn.colorcun.com/custom/lite/image/close.png" background-size="cover"></image>
  39 + </view>
  40 +</view>
  41 +<view hidden="{{hiddenFoodSpecReduce}}" class="hiddenFoodSpec">
  42 + <view class="reduce-mask"></view>
  43 + <view class="reduce-conent">
  44 + <view class="reduce-content-title">{{item.name}}</view>
  45 + <view class="reduce-content-list">
  46 + <view class='reduce-content-large' wx:for="{{selectKind}}" wx:key="selectKind-key" wx:for-item="kindItem">
  47 + <view class="reduce-list-title">{{kindItem.title?kindItem.title:''}}{{kindItem.title?':':''}}{{kindItem.ptitle?kindItem.ptitle:''}}</view>
  48 + <view class="reduce-list-info flex-rr">
  49 + <image class="reduce-list-reduce reduce-list-first" data-index="{{index}}" data-cookbookid="{{kindItem.cookbookid}}" data-practiceid="{{kindItem.practiceid}}" data-specid="{{kindItem.specid}}" data-price="{{kindItem.price}}" bindtap="reduce" src="http://qn.colorcun.com/custom/lite/image/subtractCook.png" style="padding-right:18rpx;"></image>
  50 + <view class="reduce-list-reduce">{{kindItem.foodNum}}</view>
  51 + <image class="reduce-list-reduce reduce-list-last" data-index="{{index}}" data-cookbookid="{{kindItem.cookbookid}}" data-practiceid="{{kindItem.practiceid}}" data-specid="{{kindItem.specid}}" data-price="{{kindItem.price}}" bindtap='add' src="http://qn.colorcun.com/custom/lite/image/add.png"></image>
  52 + </view>
  53 + </view>
  54 + </view>
  55 + <image src="http://qn.colorcun.com/custom/lite/image/close.png" class="reduce-close" bindtap="close"></image>
  56 + </view>
  57 +</view>
  1 +@import '../../app.wxss';
  2 +.hiddenFoodSpec{
  3 +
  4 +}
  5 +.toast-mask{
  6 + position: fixed;
  7 + z-index: 9998;
  8 + top: 0;
  9 + right: 0;
  10 + left: 0;
  11 + bottom: 0;
  12 + background: rgba(0, 0, 0, 0.7);
  13 +}
  14 +.toast-content{
  15 + width:542rpx;
  16 + min-height: 300px;
  17 + height:auto;
  18 + background: #fff;
  19 + border-radius: 10rpx;
  20 + position: fixed;
  21 + top: 35%;
  22 + left:0;
  23 + right:0;
  24 + margin:0 auto;
  25 + margin-top:-150px;
  26 + z-index: 9999;
  27 + /* overflow: hidden; */
  28 +}
  29 +.toast-content-title{
  30 + width: 100%;
  31 + padding-top: 20px;
  32 + color:#353535;
  33 + font-size:16px;
  34 + text-align: center;
  35 +}
  36 +.toast-content-kind{
  37 + width: 100%;
  38 + height: auto;
  39 + padding:0 19rpx;
  40 + box-sizing: border-box;
  41 + padding-top: 20px;
  42 +}
  43 +.toast-kind-title{
  44 + width: 100%;
  45 + color:#353535;
  46 + font-size:16px;
  47 + padding-left:19rpx;
  48 + box-sizing:border-box;
  49 +}
  50 +.toast-kind-menu{
  51 + width: 100%;
  52 + height: auto;
  53 + box-sizing: border-box;
  54 + padding-bottom:10px;
  55 +}
  56 +.toast-kind-menu:after{
  57 + width:0;
  58 + height:0;
  59 + content:'';
  60 + display:block;
  61 + clear:both;
  62 +}
  63 +.toast-kind-single{
  64 + float:left;
  65 + width: 130rpx;
  66 + height: 25px;
  67 + border:1px solid #ccc;
  68 + box-sizing: border-box;
  69 + color:#353535;
  70 + font-size:14px;
  71 + line-height: 23px;
  72 + text-align: center;
  73 + margin:0 19rpx;
  74 + margin-top: 10px;
  75 +}
  76 +.toast-kind-single:last-child{
  77 + margin-right: 0;
  78 +}
  79 +.toast-content-end{
  80 + width: 100%;
  81 + height: 57px;
  82 + padding:15px 38rpx;
  83 + box-sizing: border-box;
  84 + margin-top: 22px;
  85 + background: #f2f2f2;
  86 + border-bottom-left-radius: 6px;
  87 + border-bottom-right-radius: 6px;
  88 +}
  89 +.toast-content-money{
  90 + float: left;
  91 + color: #e14553;
  92 + font-size:17px;
  93 + line-height: 28px;
  94 +}
  95 +.toast-content-add{
  96 + float: right;
  97 + width: 95px;
  98 + height: 28px;
  99 + background: #e14553;
  100 + border-radius:28px;
  101 + color: #fff;
  102 + font-size:13px;
  103 + line-height: 28px;
  104 + text-align: center;
  105 +}
  106 +.toast-kind-single.kind-active{
  107 + border:1px solid #e14553;
  108 + color:#e14553;
  109 +}
  110 +.toast-content-close{
  111 + width: 60rpx;
  112 + height: 60rpx;
  113 + position: absolute;
  114 + left: 0;
  115 + right: 0;
  116 + bottom:-140rpx;
  117 + margin:0 auto;
  118 + background: transparent;
  119 +}
  120 +
  121 +/*删除规格遮罩*/
  122 +.reduce-mask{
  123 + position: fixed;
  124 + z-index: 9998;
  125 + top: 0;
  126 + right: 0;
  127 + left: 0;
  128 + bottom: 0;
  129 + background: rgba(0, 0, 0, 0.7);
  130 +}
  131 +.reduce-conent{
  132 + width:570rpx;
  133 + min-height: 430rpx;
  134 + height:auto;
  135 + background: #fff;
  136 + padding-bottom:40rpx;
  137 + border-radius: 10rpx;
  138 + position: fixed;
  139 + top: 50%;
  140 + left:0;
  141 + right:0;
  142 + margin:0 auto;
  143 + margin-top:-400rpx;
  144 + z-index: 9999;
  145 + /* overflow: hidden; */
  146 +}
  147 +.reduce-content-title{
  148 + width: 100%;
  149 + padding-top: 40rpx;
  150 + color:#353535;
  151 + font-size:16px;
  152 + text-align: center;
  153 +}
  154 +.reduce-content-list{
  155 + width: 100%;
  156 + height: auto;
  157 + padding:0 38rpx;
  158 + box-sizing: border-box;
  159 +
  160 +}
  161 +.reduce-content-large{
  162 + width: 100%;
  163 + height: 25px;
  164 + padding-top: 50rpx;
  165 +}
  166 +.reduce-list-title{
  167 + float:left;
  168 + padding:0 26rpx;
  169 + height: 25px;
  170 + border:1rpx solid #ccc;
  171 + box-sizing: border-box;
  172 + color:#353535;
  173 + font-size:14px;
  174 + line-height: 25px;
  175 + text-align: center;
  176 +}
  177 +.reduce-list-info{
  178 + height: 25px;
  179 + line-height: 25px;
  180 +}
  181 +.reduce-list-reduce{
  182 + padding:0 10rpx;
  183 + font-size:32rpx;
  184 + line-height: 25px;
  185 + text-align: center;
  186 +}
  187 +.reduce-list-first{
  188 + width:15px;
  189 + height:2px;
  190 + background:#fff;
  191 +}
  192 +.reduce-list-last{
  193 + width:15px;
  194 + height:15px;
  195 + background:#fff;
  196 +}
  197 +.reduce-close{
  198 + width: 60rpx;
  199 + height: 60rpx;
  200 + position: absolute;
  201 + left: 0;
  202 + right: 0;
  203 + bottom:-140rpx;
  204 + margin:0 auto;
  205 + background: transparent;
  206 +}
  1 +.icon,.icon-s,.icon-m,.icon-l{
  2 + background-repeat: no-repeat;
  3 + height: 16px;
  4 + width:16px;
  5 + display: block;
  6 + margin: 5px;
  7 + background-size: 100%; background-repeat: no-repeat;
  8 +}
  9 +.icon-jiantou{
  10 + width:8px;
  11 + height:13px;
  12 + margin:0;
  13 + margin-left:5px;
  14 +}
  15 +.icon-12{
  16 + height: 12px;
  17 + width: 12px;
  18 +}
  19 +.icon14{
  20 + height: 14px;
  21 + width: 14px;
  22 +}
  23 +.icon15{
  24 + height: 15px;
  25 + width: 15px;
  26 +}
  27 +.subtractCook{
  28 + height: 3px;
  29 + width: 15px;
  30 +}
  31 +.icon-s{
  32 + height: 18px;
  33 + width:18px;
  34 +}
  35 +.icon24{
  36 + height: 24px;
  37 + width:24px;
  38 +}
  39 +.icon28{
  40 + height: 28px;
  41 + width:28px;
  42 +}
  43 +.icon-ml{
  44 + height: 26px;
  45 + width:26px;
  46 +}
  47 +.icon-l{
  48 + height: 32px;
  49 + width:32px;
  50 +}
  51 +.icon64{
  52 + height: 64px;
  53 + width:64px;
  54 +}
  55 +.icon-membercard{
  56 + background: url(http://qn.colorcun.com/wechat/app/images/icon_card.jpg);
  57 + background-size: 100%; background-repeat: no-repeat;
  58 + height:100%;
  59 +}
1 // cookbook/index.js 1 // cookbook/index.js
  2 +import util from '../../utils/util';
  3 +import App from '../../utils/api';
  4 +const {regeneratorRuntime} = global
2 Page({ 5 Page({
3 6
4 /** 7 /**
5 * 页面的初始数据 8 * 页面的初始数据
6 */ 9 */
7 data: { 10 data: {
8 - 11 + scrollTop:0,
  12 + isloading:true,
  13 + toView:"",
  14 + hasEnter:false,
  15 +
  16 + totalWidth:getApp().system.windowWidth,
  17 + singleWidth:parseInt((getApp().system.windowWidth*0.92-16)/2),
  18 + totalHeight:getApp().system.windowHeight,
  19 + kindHeight:getApp().system.windowHeight-68,
  20 + hasListModel:true,
  21 +
  22 + cookbooklist:[{},{},{},{},{},{},{},],
  23 + showSkeleton: true
9 }, 24 },
10 25
11 /** 26 /**
12 * 生命周期函数--监听页面加载 27 * 生命周期函数--监听页面加载
13 */ 28 */
14 onLoad: function (options) { 29 onLoad: function (options) {
15 - 30 + this.getCookList();
16 }, 31 },
17 32
18 /** 33 /**
@@ -26,7 +41,12 @@ Page({ @@ -26,7 +41,12 @@ Page({
26 * 生命周期函数--监听页面显示 41 * 生命周期函数--监听页面显示
27 */ 42 */
28 onShow: function () { 43 onShow: function () {
29 - 44 + this.setData({
  45 + totalWidth:getApp().system.windowWidth,
  46 + singleWidth:parseInt((getApp().system.windowWidth*0.92-16)/2),
  47 + totalHeight:getApp().system.windowHeight,
  48 + kindHeight:getApp().system.windowHeight-68
  49 + })
30 }, 50 },
31 51
32 /** 52 /**
@@ -62,5 +82,110 @@ Page({ @@ -62,5 +82,110 @@ Page({
62 */ 82 */
63 onShareAppMessage: function () { 83 onShareAppMessage: function () {
64 84
  85 + },
  86 + formatCookList(list){
  87 + //原栏目下显示
  88 + let hasShowClass=false;
  89 +
  90 + //菜单中展示沽清的菜品
  91 + let hasClearCookbook=false;
  92 +
  93 + //十道必选菜
  94 + let has10CaiOpen=false;
  95 + let flist=[];
  96 + if(list.length>0) {
  97 + has10CaiOpen=list[0].status==1;
  98 + list.forEach(function (cate, i) {
  99 + if (cate.status == 1 && cate.cookbooklist[0].length > 0) {
  100 + let cooks=[];
  101 + //let cooks_order=[];
  102 + cate.cookbooklist[0].forEach(function(cook,n){
  103 + if(cook.status==1){
  104 + let flag=true;
  105 + if(has10CaiOpen){
  106 + if(cate.class_type==2 && !hasShowClass && flist.length>0 && flist[0].class_type==1){
  107 + for(let fi=0;fi<flist[0].cookbooklist[0].length;fi++){
  108 + if(flist[0].cookbooklist[0][fi].id==cook.id){
  109 + flag=false;
  110 + break;
  111 + }
  112 + }
  113 + }
  114 + }
  115 + cook.item_clear_num=cook.clear_num;
  116 + if(!hasClearCookbook){//不显示卖光了
  117 + let item_clear_num=cook.clear_num;
  118 + if(cook.spec){
  119 + let clear_num=null;
  120 + cook.spec.forEach(spec=>{
  121 + if(spec.clear_num==0){
  122 + clear_num=0;
  123 + }else{
  124 + clear_num=null;
  125 + }
  126 + })
  127 + if(clear_num==0){
  128 + item_clear_num=0;
  129 + }
  130 + }
  131 + cook.item_clear_num=item_clear_num;
  132 + if(item_clear_num==0){
  133 + flag=false;
  134 + }
  135 + }
  136 +
  137 + if(flag){
  138 + cooks.push(cook);
  139 + //cooks_order.push(cook.order_o);
  140 + }
  141 +
  142 + }
  143 + })
  144 + if(cooks.length>0){
  145 + //cooks 排序...
  146 +
  147 + cate.cookbooklist[0]=cooks;
  148 + flist.push(cate)
  149 + }
  150 + }
  151 + })
  152 + }
  153 + return flist;
  154 + },
  155 + getCookList:function(orderid){
  156 + let param={
  157 + sellerid: 80,
  158 + //status:this.data.fromSoucre!=''?1:'',
  159 + identity:1
  160 + };
  161 + if(orderid){
  162 + param.orderid=orderid;
65 } 163 }
  164 + App.Cookbook.GetCookbookByClass(param).then(json=>{
  165 + //菜单分类添加修饰
  166 + let cookbooklist = this.formatCookList(json.data[0].list);
  167 + setTimeout(()=>{
  168 + this.setData({
  169 + cookbooklist: cookbooklist,
  170 + countPirce:json.data[0].countPirce ? json.data[0].countPirce : 0,
  171 + countTotal:json.data[0].countTotal ? json.data[0].countTotal : 0,
  172 + isloading:false,
  173 + showSkeleton:false,
  174 + })
  175 + },1000)
  176 +
  177 + }).catch(res=>{
  178 + console.log('getCookList-catch',res);
  179 + this.selectComponent("#network").show('网络不给力,请检查网络后重试');
  180 + });
  181 + },
  182 + //菜品分类操作
  183 + changeList: function (e) {
  184 + var _id=e.detail.id;
  185 + console.log('changeList','inToView' + _id)
  186 + this.setData({
  187 + toView: 'inToView' + _id,
  188 + });
  189 +
  190 + },
66 }) 191 })
1 -{}  
  1 +{
  2 + "backgroundTextStyle": "light",
  3 + "navigationBarBackgroundColor": "#4c4e4f",
  4 + "navigationBarTextStyle": "black",
  5 + "usingComponents": {
  6 + "foodCard": "../components/food-card/food-card",
  7 + "cookClass": "../components/cook-class/cook-class",
  8 + "nav":"/components/nav/nav"
  9 + }
  10 +}
1 <!--cookbook/index.wxml--> 1 <!--cookbook/index.wxml-->
2 -<text>cookbook/index.wxml</text> 2 +<nav>提前点菜</nav>
  3 +<loading wx:if="{{isloading}}">数据加载中</loading>
  4 +<view class="{{hasListModel?'page-list flex-ll-top':'page'}}" wx:if="{{!isloading}}">
  5 + <!--第四部分 原始菜无图或有图展示-->
  6 + <scroll-view
  7 + scroll-y class = "partfour list-model"
  8 + style = "height:{{totalHeight}}px;width:100%;z-index:{{scrollZindex}}; position: fixed;"
  9 + scroll-into-view = "{{toView}}"
  10 + scroll-with-animation
  11 + >
  12 + <view style = "padding-left:180rpx;">
  13 + <view class="section" wx:for="{{cookbooklist}}" wx:key="cookbooklist-key">
  14 + <view id="{{'inToView'+item.id}}"></view>
  15 + <view class="list-model-masonry" >
  16 + <view class="list-model-column">
  17 + <block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.id}}" wx:for-index="itemIndex" >
  18 + <view class="item">
  19 + <foodCard item="{{item}}"
  20 + sellerid="{{sellerid}}" orderid="{{orderid}}"
  21 + fromSoucre="{{fromSoucre}}" request_uri="{{request_uri}}"
  22 + bindfoodCardCallback="foodCardCallback"
  23 + hasListModel="{{hasListModel}}"
  24 + ></foodCard>
  25 + </view>
  26 + </block>
  27 + </view>
  28 + </view>
  29 + </view>
  30 + <view style="height: 80px;width: 100%;"></view>
  31 + </view>
  32 + </scroll-view>
  33 + <view class="white flex-lr" style="position:fixed;bottom:0px;width:100%;padding:5px 0;z-index:2000;height:58px;">
  34 +
  35 + <view class="body-view">
  36 +
  37 + </view>
  38 + <view class="shopping-total flex-vc list-layout-buttom-opt">
  39 +
  40 + <image src="http://qn.colorcun.com/custom/lite/image/cook-list-gwc.png" class="icon" />
  41 + <view style="color:#fff;font-size:24rpx;margin-top:-2px;text-align:center;" class="smooth">下单</view>
  42 + <block wx:if="{{countTotal>0}}">
  43 + <view class="show-num fwhite flex-cc smooth">{{countTotal}}</view>
  44 + </block>
  45 + <button bindgetuserinfo="bindChooseOk" open-type="getUserInfo" class="shop-button"></button>
  46 + <bubble id="bubble"></bubble>
  47 + </view>
  48 +
  49 + <!--只有点菜后才显示点好了按钮-->
  50 + </view>
  51 +</view>
  52 +
  53 +<cookClass id="menu" bind:changeList="changeList"
  54 + cooklist="{{cookbooklist}}" hasListModel="{{hasListModel}}">
  55 +</cookClass>
1 -/* cookbook/index.wxss */  
  1 +/* cookbook/index.wxss */
  2 +@import "../components/food-card/food-card.wxss";
  3 +.page{
  4 + background:#4c4e4f;
  5 +}
  6 +
  7 +.ptop3{
  8 + padding-top:3px;
  9 +}
  10 +.menu-operation{
  11 + width: 100%;
  12 + height: 57rpx;
  13 + padding:0 45rpx;
  14 + padding-top: 20rpx;
  15 + box-sizing: border-box;
  16 +}
  17 +/*菜品标签*/
  18 +.menu-ptop-mark{ width:100%; height: 13px; padding-top:12px;}
  19 +.menu-recommand-image{ float:left; width:36px; height:18px; margin-right:8rpx;}
  20 +.menu-descration-circle{
  21 + width:10rpx;
  22 + height:10rpx;
  23 + border-radius:50%;
  24 + background:#fff;
  25 +}
  26 +.menu-descration-line{
  27 + width:65rpx;
  28 + height:3rpx;
  29 + background:#fff;
  30 +}
  31 +/*菜单分类*/
  32 +.menu{
  33 + position: fixed;
  34 + top:0;
  35 + left:0;
  36 + bottom:0;
  37 + right:0;
  38 + background:#e14553;
  39 + z-index:1000;
  40 +}
  41 +.menu-active{
  42 + padding-bottom:10rpx;
  43 + border-bottom:4rpx solid #fff;
  44 + font-weight: bold;
  45 +}
  46 +
  47 +
  48 +.shopping-total{
  49 + width:110rpx;
  50 + height:99rpx;
  51 + position:relative;
  52 +}
  53 +.shop-button{
  54 + position:absolute;
  55 + width:100%;
  56 + height:100%;
  57 + left:0;
  58 + top:0;
  59 + background:transparent;
  60 +}
  61 +.show-num{
  62 + width:36rpx;
  63 + height:36rpx;
  64 + position:absolute;
  65 + right:10rpx;
  66 + top:2rpx;
  67 + background:#e14553;
  68 + font-size:20rpx;
  69 + border-radius:50%;
  70 +}
  71 +.menu-fixed{
  72 + position:fixed;
  73 + bottom:12px;
  74 + left:10px;
  75 + width:80rpx;
  76 + height:80rpx;
  77 + padding:5rpx;
  78 + box-sizing:border-box;
  79 + z-index:1001;
  80 +}
  81 +.menu-fixed-image{
  82 + width:48rpx;
  83 + height:48rpx;
  84 + margin-right:4%;
  85 +}
  86 +.menu-fixed-taomei{
  87 + width:68rpx;
  88 + height:68rpx;
  89 + margin-right:4%;
  90 +}
  91 +.menu-fixed-image-close{
  92 + width:70rpx;
  93 + height:70rpx;
  94 +}
  95 +.countTotal{
  96 + width:48rpx;
  97 + height:48rpx;
  98 + background-color:#4C4E4F;
  99 + margin-right:5px;
  100 +}
  101 +.flex-cc text{
  102 + font-size:32rpx;
  103 + color:#fff;
  104 +}
  105 +
  106 +
  107 +
  108 +.masonry { display: flex; flex-direction: row; }
  109 +.section:last-child{
  110 + margin-bottom: 60px;
  111 +}
  112 +.column { display: flex; flex-direction: column; width: 50%; max-width:50%; }
  113 +.column-space { width: 20px; }
  114 +.column .item{margin-bottom: 20px;width:100%; overflow: hidden; border-radius: 10rpx;}
  115 +
  116 +/**
  117 + 列表模式
  118 + */
  119 +.page-list{
  120 + background-color: #FEFEFE;
  121 +}
  122 +.list-model{
  123 + position: static;
  124 +}
  125 +.list-model .item{
  126 + border-radius: 0rpx;
  127 + border-bottom: 2rpx solid #F5F5F5;
  128 + padding-bottom: 28rpx;
  129 + margin-top: 14rpx;
  130 +}
  131 +.list-layout-buttom-opt{
  132 + background-color: #353535;
  133 + border-radius: 50%;
  134 + width: 120rpx;
  135 + height: 120rpx;
  136 + min-width: 120rpx;
  137 + margin: 0 80rpx 40rpx;
  138 + box-shadow: 0rpx 4rpx 8rpx #353535;
  139 +}
  140 +.list-layout-buttom-opt .icon{
  141 + width: 44rpx;
  142 + height: 44rpx;
  143 +}
  144 +
  145 +
  146 +/**index.wxss**/
  147 +.skeleton .left{
  148 + width: 180rpx;
  149 +}
  150 +.skeleton .right{
  151 + width: 100%;
  152 + padding-left: 20rpx;
  153 +}
  154 +.skeleton .left .left-menu{
  155 + width: 180rpx;
  156 + height: 160rpx;
  157 + margin-bottom: 2rpx;
  158 +}
  159 +.skeleton .right .right-card{
  160 + width: 100%;
  161 + height: 300rpx;
  162 + margin-bottom: 10rpx;
  163 +}
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 "list": [] 30 "list": []
31 }, 31 },
32 "miniprogram": { 32 "miniprogram": {
33 - "current": 6, 33 + "current": 25,
34 "list": [ 34 "list": [
35 { 35 {
36 "id": 0, 36 "id": 0,
@@ -222,6 +222,11 @@ @@ -222,6 +222,11 @@
222 "pathName": "pages/book/setting/sms_buy", 222 "pathName": "pages/book/setting/sms_buy",
223 "query": "", 223 "query": "",
224 "scene": "1001" 224 "scene": "1001"
  225 + },
  226 + {
  227 + "id": -1,
  228 + "name": "pack-cookbook/pages/index",
  229 + "pathName": "pack-cookbook/pages/index"
225 } 230 }
226 ] 231 ]
227 } 232 }
@@ -95,4 +95,7 @@ export default { @@ -95,4 +95,7 @@ export default {
95 alias:'App.Pay.WxPaySub', 95 alias:'App.Pay.WxPaySub',
96 }, 96 },
97 97
  98 + //菜品列表
  99 + 'App.Cookbook.GetCookbookByClass':null,
  100 +
98 } 101 }