Commit 62386fb80e8cdaa8ab605bdb5108f7512e79ad12

Authored by wangfan
1 parent 39ab8579

C端调整

@@ -75,6 +75,15 @@ @@ -75,6 +75,15 @@
75 align-content: flex-start; 75 align-content: flex-start;
76 flex-flow:wrap; 76 flex-flow:wrap;
77 } 77 }
  78 +/*流式布局--左对齐*/
  79 +.flex-auto-ll{
  80 + display:flex;
  81 + display:-webkit-flex;
  82 + justify-content:space-between;
  83 + align-content:space-around;
  84 + flex-flow:wrap;
  85 + align-items:stretch;
  86 +}
78 .font34r{ 87 .font34r{
79 font-size:34rpx; 88 font-size:34rpx;
80 } 89 }
  1 +// components/reserve/caixi.js
  2 +import util from '../../utils/util';
  3 +Component({
  4 + /**
  5 + * 组件的属性列表
  6 + */
  7 + properties: {
  8 + multiArray:{
  9 + type:Array,
  10 + value:[],
  11 + },
  12 + multiIndex:{
  13 + type:Array,
  14 + value:[],
  15 + },
  16 + },
  17 +
  18 + /**
  19 + * 组件的初始数据
  20 + */
  21 + data: {
  22 + hidden:true
  23 + },
  24 +
  25 + /**
  26 + * 组件的方法列表
  27 + */
  28 + methods: {
  29 + hide(){
  30 + this.setData({
  31 + hidden:true,
  32 + })
  33 + },
  34 + active(e){
  35 + this.triggerEvent('active',util.attr(e,'index'));
  36 + this.hide();
  37 + },
  38 + show(){
  39 + this.setData({
  40 + hidden:false,
  41 + })
  42 + },
  43 + }
  44 +})
  1 +{
  2 + "component": true,
  3 + "usingComponents": {}
  4 +}
  1 +<!--components/reserve/caixi.wxml-->
  2 +<cover-view class="mask" catchtap="hide" hidden="{{hidden}}">
  3 + <cover-view class="caixi" catchtap="">
  4 + <cover-view class="caixi-title flex-lr" catchtap="hide">
  5 + <cover-view class="close"></cover-view>
  6 + <cover-view class="title Semibold">选择菜系</cover-view>
  7 + <cover-view class="close">
  8 + <cover-image src="http://qn.colorcun.com/reserve/images/%E5%85%B3%20%20%E9%97%AD.png"></cover-image>
  9 + </cover-view>
  10 + </cover-view>
  11 + <cover-view class="caixi-view flex-auto-ll">
  12 + <cover-view class="item {{index==multiIndex[0]?'active':''}}"
  13 + bindtap="active" data-index="{{index}}"
  14 + wx:for="{{multiArray[0]}}" wx:key="multiArray.key">
  15 + {{item}}
  16 + </cover-view>
  17 + </cover-view>
  18 + </cover-view>
  19 +</cover-view>
  1 +/* components/reserve/caixi.wxss */
  2 +@import "../../app.wxss";
  3 +.caixi{
  4 + background-color: #fefefe;
  5 + position: fixed;
  6 + bottom: 0;
  7 + width: 90%;
  8 + border-radius: 10rpx 10rpx 0 0;
  9 + padding: 40rpx 5% 10rpx;
  10 + color: #353535;
  11 +}
  12 +.caixi-title{
  13 + height: 44rpx;
  14 + line-height: 44rpx;
  15 + font-size: 32rpx;
  16 + margin-bottom: 34rpx;
  17 +}
  18 +.close{
  19 + width: 32rpx;
  20 + height: 32rpx;
  21 + min-width: 32rpx;
  22 +}
  23 +.close cover-image{
  24 + width: 100%;
  25 + height: 100%;
  26 +}
  27 +.item{
  28 + background-color: #F0F0F9;
  29 + width: 150rpx;
  30 + height: 70rpx;
  31 + overflow: hidden;
  32 + white-space:nowrap;
  33 + border-radius: 4rpx;
  34 + line-height: 70rpx;
  35 + font-size: 24rpx;
  36 + text-align: center;
  37 + margin-bottom: 30rpx;
  38 +}
  39 +.item.active{
  40 + background-color: #ECC49C;
  41 + color:#8B5318;
  42 + font-weight: 900;
  43 +}
@@ -131,7 +131,7 @@ Page({ @@ -131,7 +131,7 @@ Page({
131 if(reg.test(systemInfo.system)){ 131 if(reg.test(systemInfo.system)){
132 pt = systemInfo.statusBarHeight; 132 pt = systemInfo.statusBarHeight;
133 h = 44; 133 h = 44;
134 - this.transverseViewHeight=transverseViewHeight+20; 134 + this.transverseViewHeight=transverseViewHeight+30;
135 }else{ 135 }else{
136 if(/xiaomi/i.test(systemInfo.brand)){ 136 if(/xiaomi/i.test(systemInfo.brand)){
137 this.transverseViewHeight=transverseViewHeight+15; 137 this.transverseViewHeight=transverseViewHeight+15;
@@ -690,4 +690,15 @@ Page({ @@ -690,4 +690,15 @@ Page({
690 setTimeout(()=>{this.getMarkers();},0) 690 setTimeout(()=>{this.getMarkers();},0)
691 691
692 }, 692 },
  693 + caixiActive(e){
  694 + console.log('caixiActive',e);
  695 + this.bindMultiPickerChange({
  696 + detail:{
  697 + value:[e.detail]
  698 + }
  699 + })
  700 + },
  701 + caixiShow(){
  702 + this.selectComponent('#caixi').show();
  703 + },
693 }) 704 })
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 "getpos":"/components/userinfo/getpos", 8 "getpos":"/components/userinfo/getpos",
9 "sb-tr":"/components/reserve/seller-box-transverse/seller-box", 9 "sb-tr":"/components/reserve/seller-box-transverse/seller-box",
10 "a2l":"/components/tips/add-to-lite", 10 "a2l":"/components/tips/add-to-lite",
11 - "ds":"/components/tips/discount" 11 + "ds":"/components/tips/discount",
  12 + "caixi":"/components/reserve/caixi"
12 } 13 }
13 } 14 }
@@ -28,12 +28,8 @@ @@ -28,12 +28,8 @@
28 </view> 28 </view>
29 <view class="transverse-view"> 29 <view class="transverse-view">
30 <view class="transverse-search flex-ll"> 30 <view class="transverse-search flex-ll">
31 - <picker  
32 - mode="multiSelector"  
33 - bindchange="bindMultiPickerChange"  
34 - bindcolumnchange="bindMultiPickerColumnChange"  
35 - value="{{multiIndex}}"  
36 - range="{{multiArray}}" 31 + <view
  32 + bindtap="caixiShow"
37 class="tags {{multiIndex[0]>0?'active':''}}" 33 class="tags {{multiIndex[0]>0?'active':''}}"
38 > 34 >
39 <view class="picker flex-lr"> 35 <view class="picker flex-lr">
@@ -43,7 +39,7 @@ @@ -43,7 +39,7 @@
43 </view> 39 </view>
44 <view class="more"></view> 40 <view class="more"></view>
45 </view> 41 </view>
46 - </picker> 42 + </view>
47 <block wx:for="{{tags}}" wx:key="tags.key"> 43 <block wx:for="{{tags}}" wx:key="tags.key">
48 <view class="tags {{item.active?'active':''}}" 44 <view class="tags {{item.active?'active':''}}"
49 bindtap="tagsChange" 45 bindtap="tagsChange"
@@ -86,3 +82,6 @@ @@ -86,3 +82,6 @@
86 <cover-view class="tab-patch"></cover-view> 82 <cover-view class="tab-patch"></cover-view>
87 <ds wx:if="{{hasSetActivity}}" map="{{map}}" id="ds"></ds> 83 <ds wx:if="{{hasSetActivity}}" map="{{map}}" id="ds"></ds>
88 <a2l bindshow="a2lshow" bindhide="a2lshow"></a2l> 84 <a2l bindshow="a2lshow" bindhide="a2lshow"></a2l>
  85 +<caixi multiArray="{{multiArray}}" multiIndex="{{multiIndex}}"
  86 + bindactive="caixiActive" id="caixi"
  87 +></caixi>
@@ -157,5 +157,7 @@ @@ -157,5 +157,7 @@
157 margin-right: 0; 157 margin-right: 0;
158 } 158 }
159 .transverse-search .tags.active{ 159 .transverse-search .tags.active{
160 - background:linear-gradient(to bottom ,#F9E2B9, #FEBF72) 160 + background:linear-gradient(to bottom ,#F4DAB9,#E9BE94);
  161 + color:#8B5318;
  162 + font-weight: 900;
161 } 163 }