Sfoglia il codice sorgente

ws-土地出让样式修改

ws 1 anno fa
parent
commit
6ded1c9f7b

+ 51 - 6
nnzwminiapp/pagesPublic/pages/tdcr/details/detail.js

@@ -95,15 +95,23 @@ Page({
       }],
       surroundingFacilities: [
         {
-          name: '重庆市第11中学', type: '教育'
+          id: 1, name: '重庆市第11中学', type: '教育',
+          longitude: 106.599916, latitude: 29.582458
         }, {
-          name: '弹子石老街景区', type: '商业'
+          id: 2, name: '弹子石老街景区', type: '商业',
+          longitude: 106.587890, latitude: 29.579806
         }, {
-          name: '泽科弹子石中心', type: '商业'
+          id: 3, name: '泽科弹子石中心', type: '商业',
+          longitude: 106.591454, latitude: 29.583796
         }
       ]
     }],
-	  peripherytabsindex:0,
+    peripherytabsindex:0,
+    markers: [],
+    centerPoint: {
+      longitude: 106.596361,
+      latitude: 29.579387,
+    }
   },
 
   /**
@@ -111,15 +119,40 @@ Page({
    */
   onLoad(options) {
     const _this = this
+    let markers = []
+    _this.data.list.forEach(item => {
+      item.surroundingFacilities.forEach(map => {
+        markers.push({
+          id: map.id,
+          latitude: map.latitude,
+          longitude: map.longitude,
+          callout: {
+            content: map.name,
+            fontSize: 11,
+            padding: 5,
+            borderRadius: 5,
+            display: 'ALWAYS'
+          },
+          iconPath: imgUrl + '/location.png',
+          width: 20,
+          height: 25,
+        })
+      })
+    })
     this.setData({
       headerStyle: wx.getMenuButtonBoundingClientRect(),
       dataIndex: options.index,
+      markers,
       polygons: [{
         dashArray: [10, 10],
         strokeColor: '#ffe20063',
         fillColor: '#ffe20063',
         points: _this.data.list[options.index].polygon
-      }]
+      }],
+      centerPoint: {
+        longitude: _this.data.list[options.index].longitude,
+        latitude: _this.data.list[options.index].latitude,
+      }
     })
   },
 
@@ -169,7 +202,10 @@ Page({
    * 用户点击右上角分享
    */
   onShareAppMessage() {
-
+    return {
+      title: this.data.list[this.data.dataIndex].name,
+      imageUrl: imgUrl + '/tdcr/share.jpg'
+    }
   },
   tabEvent(e) {
     this.setData({
@@ -192,5 +228,14 @@ Page({
         console.log(e);
       }
     })
+  },
+  mapMarkerEvent(e) {
+    const map = this.data.list[this.data.dataIndex].surroundingFacilities.filter(item => item.id == e.target.dataset.id)
+    this.setData({
+      centerPoint: {
+        longitude: map[0].longitude,
+        latitude: map[0].latitude,
+      }
+    })
   }
 })

+ 1 - 1
nnzwminiapp/pagesPublic/pages/tdcr/details/detail.wxml

@@ -2,7 +2,7 @@
 <view class="main" style="background-image: url({{imgPath}}/index/bg.png);">
   <view class="header" style="height: {{headerStyle.height}}px;line-height: {{headerStyle.height}}px;margin-top: {{headerStyle.top}}px;"><image class="go-back" bindtap="goBack" src="{{imgPath}}/details/back.png" />{{list[dataIndex].name}}</view>
   <view class="map-content" style="background-image: url({{imgPath}}/details/map-border.png);">
-    <map class="map" enable-satellite="true" longitude="{{list[dataIndex].longitude}}" latitude="{{list[dataIndex].latitude}}" polygons="{{polygons}}"></map>
+    <map class="map" enable-satellite="true" longitude="{{centerPoint.longitude}}" latitude="{{centerPoint.latitude}}" polygons="{{polygons}}" markers="{{markers}}"></map>
   </view>
   <view class="tab">
     <view class="tab-item" wx:for="{{tabs}}" style="{{tabActive == index ? 'background-image: url(' + imgPath + '/details/tab-bg.png);' : ''}}" data-index="{{index}}" bindtap="tabEvent">{{item.label}}</view>

+ 1 - 1
nnzwminiapp/pagesPublic/pages/tdcr/details/wxml/periphery.wxml

@@ -7,7 +7,7 @@
 			<!-- <view style="width: 50rpx;height: 50rpx; display: flex; align-items: center;justify-content: center;">
 				<image style="display: block; width: 30rpx; height: 30rpx;" src="{{imgPath}}/other/ohter3.png"></image>
 			</view> -->
-			<view style="width: 100%; text-align: left;margin: 0 15rpx;">{{item.name}}</view>
+			<view style="width: 100%; text-align: left;margin: 0 15rpx;" bindtap="mapMarkerEvent" data-id="{{item.id}}">{{item.name}}</view>
 			<!-- <view style="width: 35%; text-align: right;">直线{{item.distanc}}km</view> -->
 		</view>
 	</view>

+ 18 - 11
nnzwminiapp/pagesPublic/pages/tdcr/index.js

@@ -18,20 +18,20 @@ Page({
       txt: '弹子石组团\nB8-1、B8-3、B9',
       top: -12,
       left: 28,
-      dropTop: -1,
-      dropLeft: 8.5
+      dropTop: 3.5,
+      dropLeft: 12
     }, {
       txt: '四公里\n棚户区地块',
-      top: -21,
+      top: -16,
       left: 20,
-      dropTop: 0,
-      dropLeft: 1
+      dropTop: 5,
+      dropLeft: 5
     }, {
       txt: '茶园组团\nC01-16/02、\nC01-17/02',
-      top: -43,
-      left: 59,
-      dropTop: 1,
-      dropLeft: 2
+      top: -32,
+      left: 61,
+      dropTop: 4,
+      dropLeft: 5
     }],
     list: [{
       icon: 'icon-quyu.png',
@@ -73,7 +73,11 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-    
+    wx.showTabBar({
+      fail: (e) => {
+        console.log(e);
+      }
+    })
   },
 
   /**
@@ -125,7 +129,10 @@ Page({
    * 用户点击右上角分享
    */
   onShareAppMessage() {
-
+    return {
+      title: '2024年土地出让',
+      imageUrl: imgUrl + '/tdcr/share.jpg'
+    }
   },
   handleTouchend() {
     let touchData = this.data.touchData

+ 1 - 1
nnzwminiapp/pagesPublic/pages/tdcr/index.wxml

@@ -14,7 +14,7 @@
       <view class="item-title">
         <text>{{item.txt}}</text>
       </view>
-      <image class="item-img" src="{{imgPath}}/index/cursor2.png" 
+      <image class="item-img" src="{{imgPath}}/index/cursor3.gif" 
       style="left: {{item.dropLeft}}vw;top: {{item.dropTop}}vh;"/>
     </view>
   </view>

+ 2 - 2
nnzwminiapp/pagesPublic/pages/tdcr/index.wxss

@@ -38,8 +38,8 @@
   text-shadow: 1px 1px 2px #EFD7BD;
 }
 .item .item-img {
-  width: 20vw;
-  height: 12vh;
+  width: 80rpx;
+  height: 120rpx;
   position: relative;
 }
 .list {

+ 8 - 2
nnzwminiapp/pagesPublic/pages/tdcr/tdcr-list/index.js

@@ -11,6 +11,7 @@ Page({
    */
   data: {
   imgUrl,
+  headerStyle: {},
   touchData: {
     flag: 0,
     lastX: 0,
@@ -107,7 +108,9 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-
+    this.setData({
+      headerStyle: wx.getMenuButtonBoundingClientRect(),
+    })
   },
 
   /**
@@ -156,7 +159,10 @@ Page({
    * 用户点击右上角分享
    */
   onShareAppMessage() {
-
+    return {
+      title: '2024年土地出让',
+      imageUrl: imgUrl + '/tdcr/share.jpg'
+    }
   },
   handleTouchend() {
     let touchData = this.data.touchData

+ 1 - 0
nnzwminiapp/pagesPublic/pages/tdcr/tdcr-list/index.wxml

@@ -4,6 +4,7 @@
   capture-bind:touchstart="handleTouchstart"
   capture-catch:touchend="handleTouchend"
   class="main" style="background-image: url('{{imgUrl}}tdcrlist/tdcrlist3.png');">
+  <view class="header" style="height: {{headerStyle.height}}px;line-height: {{headerStyle.height}}px;top: {{headerStyle.top}}px;">2024年土地出让</view>
 	<view class="map-block" style="background-image: url('{{imgUrl}}tdcrlist/tdcrlist1.png');">
     <view class="map-block-item" wx:for="{{list}}" style="top: {{item.top}}vh;left: {{item.left}}vw;">
       <view bindtap="gotoDetail" data-index="{{index}}" class="item-name" style="background-image:url('{{imgUrl}}tdcrlist/{{item.nameStyle.img}}');{{item.nameStyle.color ? 'color: ' + item.nameStyle.color + ';' : ''}}{{item.nameStyle.top ? 'top: ' + item.nameStyle.top + 'vh;' : ''}}{{item.nameStyle.left ? 'left: ' + item.nameStyle.left + 'vw;' : ''}}{{item.nameStyle.x ? 'background-position-x: ' + item.nameStyle.x + 'vw;' : ''}}">{{item.nameStyle.txt}}</view>

+ 14 - 1
nnzwminiapp/pagesPublic/pages/tdcr/tdcr-list/index.wxss

@@ -5,7 +5,8 @@
 	height: 100vh;
 	display: flex;
 	align-items: center;
-	justify-content: center;
+  justify-content: center;
+  flex-direction: column;
   background-size: 100% 100%;
 }
 
@@ -40,4 +41,16 @@
 	height: 70rpx;
   background-size: 100%;
   position: relative;
+}
+.header {
+  color: white;
+  text-align: center;
+  font-family: PingFang SC;
+  font-weight: 800;
+  font-size: 42rpx;
+  width: 96vw;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  position: absolute;
 }