index_new.wxml
10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!--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>