Commit 35db713cd7fb09e3a3f4862e28bd939fcd26d350

Authored by wangfan
1 parent 4b93fe98

c端预定

@@ -28,6 +28,7 @@ Page({ @@ -28,6 +28,7 @@ Page({
28 sellers:[], 28 sellers:[],
29 multiArray: [['不确定'].concat(renNum()), ['全部菜系'].concat(DA.caixi)], 29 multiArray: [['不确定'].concat(renNum()), ['全部菜系'].concat(DA.caixi)],
30 multiIndex: [6, 0], 30 multiIndex: [6, 0],
  31 + scrollIntoView:'',
31 }, 32 },
32 transverseViewHeight:170,//横向滚动高度 33 transverseViewHeight:170,//横向滚动高度
33 //qqmapsdk:null, 34 //qqmapsdk:null,
@@ -227,17 +228,20 @@ Page({ @@ -227,17 +228,20 @@ Page({
227 }, 228 },
228 markertap(e){ 229 markertap(e){
229 console.log(e) 230 console.log(e)
230 - let seller = {  
231 - id: e.markerId  
232 - };  
233 - this.sellers.forEach(se => {  
234 - if (se.id == seller.id) {  
235 - seller = se;  
236 - return false;  
237 - } 231 + // let seller = {
  232 + // id: e.markerId
  233 + // };
  234 + // this.sellers.forEach(se => {
  235 + // if (se.id == seller.id) {
  236 + // seller = se;
  237 + // return false;
  238 + // }
  239 + // })
  240 + //this.selectComponent('#seller-box').show(seller);
  241 + //wx.hideTabBar();
  242 + this.setData({
  243 + scrollIntoView:'seller-'+e.markerId
238 }) 244 })
239 - this.selectComponent('#seller-box').show(seller);  
240 - wx.hideTabBar();  
241 }, 245 },
242 getMarkers(){ 246 getMarkers(){
243 let cmap=this.data.map; 247 let cmap=this.data.map;
@@ -249,6 +253,7 @@ Page({ @@ -249,6 +253,7 @@ Page({
249 },300) 253 },300)
250 } 254 }
251 let markers = []; 255 let markers = [];
  256 + let sellers=[];
252 App.Reserve.SellerList({ 257 App.Reserve.SellerList({
253 lat: cmap.latitude, 258 lat: cmap.latitude,
254 lng: cmap.longitude, 259 lng: cmap.longitude,
@@ -266,8 +271,10 @@ Page({ @@ -266,8 +271,10 @@ Page({
266 return; 271 return;
267 } 272 }
268 this.sellersIds=sellersIds; 273 this.sellersIds=sellersIds;
269 - this.sellers = res.data;  
270 - res.data.forEach(seller => { 274 + sellers=res.data;
  275 + this.sellers = sellers;
  276 +
  277 + sellers.forEach(seller => {
271 if(this.mapData.scale<13){ 278 if(this.mapData.scale<13){
272 markers.push({ 279 markers.push({
273 id: seller.id, 280 id: seller.id,
@@ -329,7 +336,7 @@ Page({ @@ -329,7 +336,7 @@ Page({
329 } 336 }
330 this.setData({ 337 this.setData({
331 markers: markers, 338 markers: markers,
332 - sellers:this.sellers, 339 + sellers:sellers,
333 }) 340 })
334 }) 341 })
335 342
@@ -14,6 +14,10 @@ @@ -14,6 +14,10 @@
14 enable-rotate 14 enable-rotate
15 show-compass 15 show-compass
16 style="width: 100%; height: {{map.height}}px;"></map> 16 style="width: 100%; height: {{map.height}}px;"></map>
  17 + <cover-view class="searchAddr flex-ll">
  18 + <cover-image class="icon" src="http://qn.colorcun.com/custom/lite-online/image/search.png"></cover-image>
  19 + 请输入位置
  20 + </cover-view>
17 </view> 21 </view>
18 <view class="transverse-view"> 22 <view class="transverse-view">
19 <cover-view class="transverse-view-top"></cover-view> 23 <cover-view class="transverse-view-top"></cover-view>
@@ -35,9 +39,10 @@ @@ -35,9 +39,10 @@
35 <scroll-view 39 <scroll-view
36 scroll-x 40 scroll-x
37 class="scroll-view_H" 41 class="scroll-view_H"
  42 + scroll-into-view="{{scrollIntoView}}"
38 > 43 >
39 <view class="flex-ll"> 44 <view class="flex-ll">
40 - <view class="seller" wx:for="{{sellers}}" wx:key="{{sellers.key}}"> 45 + <view class="seller" wx:for="{{sellers}}" wx:key="{{sellers.key}}" id="seller-{{item.id}}">
41 <sb-tr seller="{{item}}"></sb-tr> 46 <sb-tr seller="{{item}}"></sb-tr>
42 </view> 47 </view>
43 <view wx:if="{{sellers.length>1}}" style="min-width: 2rpx;min-height: 40rpx;"> </view> 48 <view wx:if="{{sellers.length>1}}" style="min-width: 2rpx;min-height: 40rpx;"> </view>
@@ -36,18 +36,19 @@ @@ -36,18 +36,19 @@
36 background-color: #fefefe; 36 background-color: #fefefe;
37 } 37 }
38 .transverse-view-top{ 38 .transverse-view-top{
39 - border-radius: 20rpx 20rpx 0 0; 39 + border-radius: 20rpx 20rpx 0rpx 0rpx;
40 background-color: #fefefe; 40 background-color: #fefefe;
41 position: absolute; 41 position: absolute;
42 top:-20rpx; 42 top:-20rpx;
43 left: 0; 43 left: 0;
44 width: 100%; 44 width: 100%;
45 - height: 20rpx; 45 + height: 0rpx;
46 } 46 }
47 .transverse-search{ 47 .transverse-search{
48 background-color: #fefefe; 48 background-color: #fefefe;
49 height: 60rpx; 49 height: 60rpx;
50 width: 100%; 50 width: 100%;
  51 + padding-top: 20rpx;
51 } 52 }
52 .transverse-list{ 53 .transverse-list{
53 background-color: #fefefe; 54 background-color: #fefefe;
@@ -55,7 +56,7 @@ @@ -55,7 +56,7 @@
55 width: 100%; 56 width: 100%;
56 } 57 }
57 .transverse-list .seller{ 58 .transverse-list .seller{
58 - margin: 16rpx 20rpx 12rpx; 59 + margin: 16rpx 20rpx 0rpx;
59 box-sizing: content-box; 60 box-sizing: content-box;
60 min-width: 710rpx; 61 min-width: 710rpx;
61 width: 100%; 62 width: 100%;
@@ -84,4 +85,23 @@ @@ -84,4 +85,23 @@
84 width: 24rpx; 85 width: 24rpx;
85 height: 12rpx; 86 height: 12rpx;
86 min-width:24rpx; 87 min-width:24rpx;
  88 +}
  89 +
  90 +.searchAddr {
  91 + position: fixed;
  92 + top: 50rpx;
  93 + left: 38rpx;
  94 + width: 500rpx;
  95 + height: 60rpx;
  96 + background-color: #fefefe;
  97 + border-radius: 30rpx;
  98 + line-height: 60rpx;
  99 + color:#999999;
  100 + line-height: 60rpx;
  101 + font-size: 28rpx;
  102 +}
  103 +.searchAddr .icon{
  104 + width: 42rpx;
  105 + height: 40rpx;
  106 + margin: 0 20rpx;
87 } 107 }