index_new.wxml 9.44 KB
<!--pack-cookbook/pages/index_new.wxml-->
<nav backgroundColor="rgba({{themeColor}})" color="rgba({{navColor}})">{{options.sellerName||'提前点菜'}}</nav>
<loading wx:if="{{isloading}}">数据加载中</loading>
<scroll-view style="height:100vh;background: rgba({{themeColor}});" class="content" 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}}">
			<block>
				<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>
			<block wx:for="{{item.cookbooklist[0]}}" wx:key="{{item.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.index}}" 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}}">
								{{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}}">
									{{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>
					<image wx:if="{{item.image}}" src="{{item.image}}" class="dishImg" mode="aspectFill" />
					<view class="greens" wx:if="{{item.desc}}">
						<view class="news" style="color:rgba({{textColor}})">{{item.desc}}</view>
					</view>
					<view wx:for="{{item.norms}}" 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-norms="{{normsIndex}}" data-key="{{index}}" data-indexs="{{indexs}}" />
						<view class="box flex-cc">
							<view class="num flex-cc">
								{{item.quantum}}<view style="color:rgba({{textColor}})">{{item.unitName}}</view>
							</view>
							<view class="practice" style="color:rgba({{textColor}})">{{item.practiceName}}</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-norms="{{normsIndex}}" 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-norms="{{normsIndex}}" data-type="1" data-item="{{item}}" data-key="{{index}}" data-indexs="{{indexs}}" />
					</view>
				</view>
				<view wx:else class="twoBox" data-idx="{{item.index}}" data-nameType="{{item.name_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}}">
							<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}}">
								{{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 src="{{item.image}}" mode="aspectFill" />
						<view class="greens" wx:if="{{item.desc}}">
							<view class="news" style="color:rgba({{textColor}})">{{item.desc}}</view>
						</view>
						<view wx:for="{{item.norms}}" 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-norms="{{normsIndex}}" data-key="{{index}}" data-indexs="{{indexs}}" />
							<view class="box flex-cc">
								<view class="num flex-cc">
									{{item.quantum}}<view style="color:rgba({{textColor}})">{{item.unitName}}</view>
								</view>
								<view class="practice" style="color:rgba({{textColor}})">{{item.practiceName}}</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-norms="{{normsIndex}}" 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 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-norms="{{normsIndex}}" 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>
	<view class="right flex-cmc" bindtap="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="{{normsLen}}">{{normsLen}}</view>
		</view>
		<view class="fixedName" style="color:rgba({{textColor}})">
			已选菜品
		</view>
	</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">做法</view>
			<view class="itemBox">
				<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"></view>
			<view class="textSty">规格</view>
			<view class="itemBox">
				<view class="single {{checkItem.check2==item.id?'active':''}}" bindtap="checkSingle2" wx:for="{{checkItem.specArr}}" 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%">
	<view slot="modalContent" class="assortModel">
		<scroll-view scroll-y="true" style="height: 70%;">
			<view class="boxs">
				<view wx:for="{{assortArr}}" 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="https://qn.colorcun.com/WechatIMG807.png" mode="" />
	</view>
</my-modal>