index_new.wxml 10.7 KB
<!--pack-cookbook/pages/index_new.wxml-->
<view class="page" style="background: rgba({{themeColor}});">
	<nav backgroundColor="rgba({{themeColor}})" color="rgba({{navColor}})">{{options.sellerName||'提前点菜'}}</nav>
	<loading wx:if="{{isloading}}">数据加载中</loading>
	<scroll-view style="background: rgba({{themeColor}});" class="contentBox" scroll-into-view="{{toView}}" scroll-y="true" scroll-with-animation="true">
		<block wx:for="{{cookbooklist}}" wx:key="cookbooklist-key" wx:for-index="indexs">
			<view class="dishWrap" id="{{ 'inToView'+item.id}}">
				<view class="heand flex-vc flex-cc">
					<view class="style_round flex-vc flex-cc">
						<view class="round"></view>
						<view class="line"></view>
					</view>
					<view class="title" style="color:rgba({{navColor}})">{{item.class_name}}</view>
					<view class="style_round flex-vc flex-cc">
						<view class="line"></view>
						<view class="round"></view>
					</view>
				</view>
				<block wx:for="{{item.cookbooklist[0]}}" wx:key="id" wx:for-index="index">
					<!-- name_type  1左侧,2右侧,3顶部分开  image_type  1大图,2小图 -->
					<view wx:if="{{item.image_type=='1'}}" class="oneBox" data-idx="{{item.image_type}}" data-nameType="{{item.name_type}}">
						<block wx:if="{{item.name_type!='3'}}">
							<view class="dishItem {{item.name_type=='2'?'typeB':''}}">
								<view class="dishLeft dishTexts" style="color:rgba({{textColor}})">
									{{item.name}}
								</view>
								<view class="dishTexts dishRight" style="color:rgba({{textColor}})">
									<text wx:if="{{item.taste}}" class="texts">味型:{{item.taste}}</text>
									<text wx:if="{{item.cooks}}">烹调:{{item.cooks}}</text>
								</view>
							</view>
							<view wx:if="{{item.specArr.length>0}}" class="norms {{item.name_type=='2'?'normsB':''}}" style="color:rgba({{navColor}})">
								<view wx:for="{{item.specArr}}" wx:key="id">
									{{item.str}}
									{{item.member_str}}
								</view>
							</view>
							<view wx:else class="norms {{item.name_type=='2'?'normsB':''}}">
								{{'¥'+item.price+'/'+item.unit}}
								{{item.member_price?'会员 ¥'+item.member_price+'/'+item.unit:''}}
							</view>
						</block>
						<view wx:else class="names">
							<view class="dishItem flex-lr">
								<view class="dishLeft dishTexts" style="color:rgba({{textColor}})">
									{{item.name}}
								</view>
								<view wx:if="{{item.specArr.length>0}}" style="color:rgba({{textColor}})" class="norms {{item.name_type=='2'?'normsB':''}}" style="color:rgba({{navColor}})">
									<view wx:for="{{item.specArr}}" wx:key="id">
										{{item.str}}
										{{item.member_str}}
									</view>
								</view>
								<view wx:else class="norms {{item.name_type=='2'?'normsB':''}}" style="color:rgba({{textColor}})">
									{{'¥'+item.price+'/'+item.unit}}
									{{item.member_price?'会员 ¥'+item.member_price+'/'+item.unit:''}}
								</view>
							</view>
							<view class="dishTexts dishRight bottom" style="color:rgba({{textColor}})">
								<text wx:if="{{item.taste}}" class="texts">味型:{{item.taste}}</text>
								<text wx:if="{{item.cooks}}">烹调:{{item.cooks}}</text>
							</view>
						</view>
						<view class="imgOneBox">
							<image wx:if="{{item.image}}" catch:tap="preview" style="height: {{item.imageHeight>height?height+'px':item.imageHeight+'px'}};width: {{item.imageHeight>height?'':item.imageHeight==height?'100%':'100%'}}" mode="{{(item.imageHeight>height || item.imageHeight==height)?'aspectFit':''}}"  src="{{item.image}}" bindload="imageLoad" data-item="{{item}}" data-index="{{index}}" data-indexs="{{indexs}}" />
						</view>
						<view class="greens" wx:if="{{item.desc}}">
							<view class="news" style="color:rgba({{textColor}})">{{item.desc}}</view>
						</view>
						<view wx:for="{{item.norms}}" wx:key="id" wx:for-index="normsIndex" class="algorithmImg flex-lr calculate">
							<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG697.png':'https://qn.colorcun.com/Line2.png'}}" mode="aspectFill" class="reduceImg" bindtap="subtraction" data-item="{{item}}" />
							<view class="box flex-cc">
								<view class="num flex-cc">
									{{item.count}}<view wx:if="{{item.specs || item.unit}}" style="color:rgba({{textColor}})">{{item.specs?item.specs:item.unit}}</view>
								</view>
								<view class="practice" wx:if="{{item.name}}" style="color:rgba({{textColor}})">{{item.name}}</view>
							</view>
							<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG696.png':'https://qn.colorcun.com/Line1.png'}}" mode="aspectFill" class="imgs" data-type="0" bindtap="addition" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" />
						</view>
						<view wx:if="{{(item.specArr.length>1 || item.practice.length>1) || item.norms.length=='0'}}" class="algorithmImg flex-rr imgbox">
							<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG696.png':'https://qn.colorcun.com/Line1.png'}}" class="imgs" mode="aspectFill" bindtap="addition" data-type="1" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" />
						</view>
					</view>
					<view wx:else class="twoBox" data-idx="{{item.image_type}}">
						<view class="{{item.boderNone?'borderNone twoItem':'twoItem'}}">
							<view class="twoTitle" style="color:rgba({{textColor}})">{{item.name}}</view>
							<view class="twoInfo dishTexts" wx:if="{{item.taste}}" style="color:rgba({{textColor}})">
								<text wx:if="{{item.taste}}" class="texts">味型:{{item.taste}}</text>
								<text wx:if="{{item.cooks}}">烹调:{{item.cooks}}</text>
							</view>
							<view wx:if="{{item.specArr.length>0}}" class="twoInfo twoSingle" style="color:rgba({{textColor}})">
								<view wx:for="{{item.specArr}}" wx:key="id">
									{{item.str}}
									{{item.member_str}}
								</view>
							</view>
							<view wx:else class="twoInfo twoSingle">
								{{item.price?'¥'+item.price+'/'+item.unit:''}}
								{{item.member_price?'会员 ¥'+item.member_price+'/'+item.unit:''}}
							</view>
							<image wx:if="{{item.image}}" catch:tap="preview" style="height: {{item.imageHeight>height2?height2+'px':item.imageHeight+'px'}};width: {{item.imageHeight>height2?height2+'px':item.imageHeight==height2?'100%':'100%'}}" mode="{{(item.imageHeight>height2 || item.imageHeight==height2)?'aspectFit':'aspectFill'}}"  src="{{item.image}}" bindload="imageLoad" data-item="{{item}}" data-index="{{index}}" data-indexs="{{indexs}}" />
							<view class="greens" wx:if="{{item.desc}}">
								<view class="news" style="color:rgba({{textColor}})">{{item.desc}}</view>
							</view>
							<view wx:for="{{item.norms}}" wx:key="unit" wx:for-index="normsIndex" class="algorithmImg flex-lr calculate">
								<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG697.png':'https://qn.colorcun.com/Line2.png'}}" mode="aspectFill" class="reduceImg" bindtap="subtraction" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" />
								<view class="box flex-cc">
									<view class="num flex-cc">
										{{item.count}}<view wx:if="{{item.name}}" style="color:rgba({{textColor}})">{{item.name}}</view>
									</view>
									<view class="practice" wx:if="{{item.specs || item.unit}}" style="color:rgba({{textColor}})">{{item.specs?item.specs:item.unit}}</view>
								</view>
								<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG696.png':'https://qn.colorcun.com/Line1.png'}}" mode="aspectFill" class="imgs" data-type="0" bindtap="addition" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" />
							</view>
							<view wx:if="{{(item.spec.length>1 || item.practice.length>1) || item.norms.length=='0'}}" class="algorithmImg flex-rr imgbox">
								<image wx:if="{{item.id}}" src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG696.png':'https://qn.colorcun.com/Line1.png'}}" class="imgs" mode="aspectFill" bindtap="addition" data-type="1" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" />
							</view>
						</view>
					</view>
				</block>
			</view>
		</block>
	</scroll-view>
	<view class="fixedBox flex-lr" style="background: rgba({{themeColor}});">
		<view class="left flex-cmc" bindtap="showClassifyModal">
			<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG700.png':'https://qn.colorcun.com/s1.png'}}" mode="" />
			<view class="fixedName" style="color:rgba({{textColor}})">
				菜品分类
			</view>
		</view>
		<userinfo class="right flex-cmc" style="color:rgba({{textColor}})" binduserinfo="gotoShoppingCart">
			<view class="rightBox">
				<image src="{{themeColor!='251,246,241,1'?'https://qn.colorcun.com/WechatIMG701.png':'https://qn.colorcun.com/s2.png'}}" mode="" />
				<view class="num" wx:if="{{orderItemCount*1>0}}">{{orderItemCount}}</view>
			</view>
			<view class="fixedName" style="color:rgba({{textColor}})">
				已选菜品
			</view>
		</userinfo>
	</view>
</view> 
<my-modal id="checkModal" height="410px" fadeStyle="center">
	<view slot="modalContent" class="normsModel">
		<scroll-view scroll-y style="height: 78%;overflow: auto;">
			<view class="textSty" wx:if="{{checkItem.practice.length>0}}">做法</view>
			<view class="itemBox" wx:if="{{checkItem.practice.length>0}}">
				<block wx:for="{{checkItem.practice}}">
					<view class="single {{checkItem.check1==item.id?'active':''}}" data-item="{{item}}" data-item="{{item}}" bindtap="checkSingle1">
						{{item.name}}</view>
				</block>
			</view>
			<view class="checkLine" wx:if="{{checkItem.practice.length>0}}"></view>
			<view class="textSty">规格</view>
			<view class="itemBox">
				<view class="single {{checkItem.check2==item.id?'active':''}}" bindtap="checkSingle2" wx:for="{{checkItem.specArr}}" wx:key="id" data-item="{{item}}">
					{{item.specs}}</view>
			</view>
		</scroll-view>
		<view class="btns">
			<button class="font32r cancellation btn" bindtap="closeModal">取消</button>
			<button class="font32r determine btn" bindtap="determineFun">确定</button>
		</view>
	</view>
</my-modal>
<my-modal id="classifyModal" fadeStyle="slideDown" height="100%" opacity="0">
	<view slot="modalContent" class="assortModel" style="background: rgba({{themeColor}});color:rgba({{textColor}})">
		<scroll-view scroll-y="true" style="height: 70%;">
			<view class="boxs">
				<view wx:for="{{assortArr}}" wx:key="id" class="assortItem font48r {{toView==('inToView'+item.id)?'underline':''}}" data-item="{{item}}" bindtap="checkItem">
					{{item.class_name}}
				</view>
			</view>
		</scroll-view>
		<image class="assortImg" bindtap="closeClassifyModal" src="{{textColor=='0,0,0,1'?'https://qn.colorcun.com/GroupBottom.png':'https://qn.colorcun.com/WechatIMG807.png'}}" mode="" />
	</view>
</my-modal>