Просмотр исходного кода

Merge branch 'master' of http://116.63.33.55/git/nazw

elis 2 лет назад
Родитель
Сommit
189d0a6035
3 измененных файлов с 41 добавлено и 8 удалено
  1. 25 4
      nnzwminiapp/pages/map/map.js
  2. 4 2
      nnzwminiapp/pages/map/map.wxml
  3. 12 2
      nnzwminiapp/pages/map/quert.wxml

+ 25 - 4
nnzwminiapp/pages/map/map.js

@@ -57,11 +57,14 @@ Page({
     ],
     popData:[],
     showIndex: false,
-    isSearch: false,
+    showTraffic: true,
     height: 0,
     searchVal: '',
-    trafficStart:'',
-    trafficEnd:'',
+    trafficStart: '',
+    trafficEnd: '',
+    navigateArr: ['百度地图导航', '高德地图导航'],
+    showSection: true,
+    index: 0,
     isList:true,
     showSet:false
   },
@@ -145,6 +148,7 @@ Page({
     },
 
     searchTap(e) {
+        const that = this;
         let searchVal = this.data.searchVal;
         if (!searchVal) {
             wx.showToast({
@@ -154,6 +158,10 @@ Page({
             return;
         }
         console.info(searchVal)
+        // 搜索结果
+        that.setData({
+            showTraffic: false
+        });
     },
 
     getTrafficStart(e) {
@@ -168,15 +176,28 @@ Page({
     },
 
     searchTrafficTap(e) {
+        const that = this;
         let trafficStart = this.data.trafficStart;
         let trafficEnd = this.data.trafficEnd;
         if (!trafficStart || !trafficEnd) {
+            that.setData({
+                showSection: true
+            });
             wx.showToast({
                 title: '请输入起点和终点',
                 icon: 'none'
-            })
+            });
             return;
+        } else {
+            that.setData({
+                showSection: false
+            });
         }
+        console.info(trafficStart, trafficEnd);
+    },
+
+    bindPickerChange(e){
+        console.info(e)
     },
 
     backSearch(){

+ 4 - 2
nnzwminiapp/pages/map/map.wxml

@@ -32,7 +32,8 @@
     <view class="right-map" id="right-map">
       <map id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="14" show-location="true" markers="{{markers}}" bindmarkertap="makertap" class="map"></map>
     </view>
-    <view wx:if="{{false}}">
+
+    <view wx:if="{{showTraffic}}">
       <view class="right-search" style="position: absolute; left: 22rpx; top: 257px; width: 708rpx; height: 300rpx; display: block; box-sizing: border-box; padding-top: 10rpx;">
         <t-tabs defaultValue="{{0}}" theme="tag" style="height: 292rpx; ">
           <t-tab-panel label="公交" value="0" style=" height: 180rpx; ">
@@ -43,6 +44,7 @@
           </t-tab-panel>
         </t-tabs>
       </view>
+
       <view class="left-map">
         <view class="bttom-tab show-first">
           <t-grid wx:for="{{type}}" wx:index="{{index}}" wx:for-item="typeitem" wx:key="index" class="block">
@@ -80,4 +82,4 @@
       </scroll-view>
     </view>
   </view>
-</view>
+</view>

+ 12 - 2
nnzwminiapp/pages/map/quert.wxml

@@ -16,5 +16,15 @@
       <input class="go_input" placeholder="请输入终点" value="{{trafficEnd}}" bindinput="getTrafficEnd" />
     </view>
   </view>
-  <view><image src="{{imgUrl}}/ss3.png" class="inp-icon1" bindtap="searchTrafficTap"></image></view>
-</view>
+  <!-- <view><image src="{{imgUrl}}/ss3.png" class="inp-icon1" bindtap="searchTrafficTap"></image></view> -->
+ 
+    <view class="section">
+        <picker mode="selector" bindchange="bindPickerChange" value="{{index}}" range="{{navigateArr}}" disabled="{{showSection}}">
+            <view class="picker">
+                <image src="{{imgUrl}}/ss3.png" class="inp-icon1" bindtap="searchTrafficTap"></image>
+            </view>
+        </picker>
+    </view>
+
+</view>
+