wangfei 6 年 前
コミット
de02dc18f4

+ 8
- 6
app.json ファイルの表示

@@ -1,5 +1,6 @@
1 1
 {
2
-  "pages":[
2
+  "pages": [
3
+    "pages/map/testmap",
3 4
     "pages/index/index",
4 5
     "pages/EstateDetail/index",
5 6
     "pages/AppointmentTime/index",
@@ -14,17 +15,18 @@
14 15
     "pages/SelfServiceTool/Cyclopedia/Detail",
15 16
     "pages/SelfServiceTool/MortgageCalculator/index",
16 17
     "pages/SelfServiceTool/IntegralSettlementPolicy/index",
17
-    "pages/SelfServiceTool/AboutYinCheng/index"
18
+    "pages/SelfServiceTool/AboutYinCheng/index",
19
+    "pages/MyWelfare/index"
18 20
   ],
19
-  "window":{
20
-    "backgroundTextStyle":"light",
21
+  "window": {
22
+    "backgroundTextStyle": "light",
21 23
     "navigationBarBackgroundColor": "#bb9c79",
22 24
     "navigationBarTitleText": "",
23
-    "navigationBarTextStyle":"white"
25
+    "navigationBarTextStyle": "white"
24 26
   },
25 27
   "permission": {
26 28
     "scope.userLocation": {
27 29
       "desc": "您的位置将用于效果展示"
28 30
     }
29 31
   }
30
-}
32
+}

バイナリ
assets/images/icon41.png ファイルの表示


バイナリ
assets/images/img4.jpg ファイルの表示


+ 4
- 0
config/api.js ファイルの表示

@@ -52,6 +52,10 @@ const $api = {
52 52
     }
53 53
   },
54 54
   building: {
55
+    mainlist: {
56
+      method: 'GET',
57
+      url: `${BaseAPIURl}wx/building/mian`
58
+    },
55 59
     list: {
56 60
       method: 'GET',
57 61
       url: `${BaseAPIURl}wx/building/list`

+ 7
- 8
pages/EstateDetail/index.wxml ファイルの表示

@@ -16,17 +16,16 @@
16 16
             </block>
17 17
           </swiper>
18 18
         </view>
19
-        <view class="remark">
20
-          <view class="centerLabel">
21
-            <view class="flex-h">
22
-              <text class="name flex-item">{{EstateDetail.buildingName}}</text>
23
-              <text class="price">均价:{{EstateDetail.price}}</text>
24
-            </view>
25
-            <text>别名:{{EstateDetail.name || ''}}</text>
19
+      </view>
20
+      <view class="remark subContent">
21
+        <view class="centerLabel">
22
+          <view class="flex-h">
23
+            <text class="name flex-item">{{EstateDetail.buildingName}}</text>
24
+            <text class="price">均价:{{EstateDetail.price}}</text>
26 25
           </view>
26
+          <text>别名:{{EstateDetail.name || ''}}</text>
27 27
         </view>
28 28
       </view>
29
-
30 29
       <!-- 基本信息 -->
31 30
       <view class="mainInfo subContent">
32 31
         <text class="title">基本信息</text>

+ 41
- 4
pages/EstateDetail/index.wxss ファイルの表示

@@ -56,14 +56,51 @@
56 56
 
57 57
 .banner {
58 58
   width: 100%;
59
-  height: 0;
59
+  height:420rpx;
60 60
   position: relative;
61 61
   overflow: hidden;
62 62
   background: #eee;
63
-  padding-bottom: 120%;
63
+  /* padding-bottom: 120%; */
64 64
 }
65 65
 
66
-.banner .remark {
66
+.remark{
67
+  width: 100%;
68
+  height: 148rpx;
69
+  overflow: hidden;
70
+  position: absolute;
71
+}
72
+.remark > view {
73
+  width: 100%;
74
+}
75
+
76
+.remark .name {
77
+  font-size: 30rpx;
78
+  line-height: 44rpx;
79
+  margin-left: 40rpx;
80
+  overflow: hidden;
81
+  white-space: nowrap;
82
+  text-overflow: ellipsis;
83
+  font-weight: bold;
84
+}
85
+
86
+.remark .price {
87
+  font-size: 24rpx;
88
+  line-height: 44rpx;
89
+  margin-right: 40rpx;
90
+  margin-left: 20rpx;
91
+}
92
+
93
+.remark > view > text {
94
+  display: block;
95
+  padding: 0 40rpx;
96
+  font-size: 24rpx;
97
+  line-height: 38rpx;
98
+  white-space: nowrap;
99
+  overflow: hidden;
100
+  text-overflow: ellipsis;
101
+}
102
+
103
+/* .banner .remark {
67 104
   width: 100%;
68 105
   height: 200rpx;
69 106
   position: absolute;
@@ -107,7 +144,7 @@
107 144
   white-space: nowrap;
108 145
   overflow: hidden;
109 146
   text-overflow: ellipsis;
110
-}
147
+} */
111 148
 
112 149
 .banner .wx-swiper-dots {
113 150
   bottom: 200rpx;

+ 136
- 0
pages/MyWelfare/index.js ファイルの表示

@@ -0,0 +1,136 @@
1
+import store from '../../store'
2
+import create from '../../utils/create'
3
+import fetch from '../../utils/http'
4
+import {
5
+  get as getApi
6
+} from '../../config/api'
7
+
8
+const app = getApp()
9
+
10
+create(store, {
11
+  onShow() {
12
+    wx.setNavigationBarTitle({
13
+      title: '我的福利社'
14
+    })
15
+  },
16
+  onLoad() {
17
+    let _self = this
18
+    wx.getSystemInfo({
19
+      success(res) {
20
+        _self.setData({
21
+          WindowHeight: res.windowHeight
22
+        })
23
+      }
24
+    })
25
+    this.GetList()
26
+  },
27
+  data: {
28
+    list: [],
29
+    DeleteIndex: null,
30
+    IsNull: false,
31
+    WindowHeight: 0,
32
+    PostData: {
33
+      pageNum: 1,
34
+      pageSize: 10
35
+    },
36
+    IsLock: false,
37
+    Total: 1
38
+  },
39
+  GetList() {
40
+    if (!this.data.IsLock && this.data.list.length < this.data.Total) {
41
+      this.setData({
42
+        IsLock: true
43
+      })
44
+      let userInfo = app.globalData.UserInfo
45
+      fetch({
46
+        ...getApi('user.signUpList', {
47
+          openid: userInfo.openid
48
+        }),
49
+        query: {
50
+          ...this.data.PostData
51
+        },
52
+      }).then((res) => {
53
+        let list = res.data.records || []
54
+        let aArr = this.data.list || []
55
+        list.map((item) => {
56
+          aArr.push(item)
57
+        })
58
+        this.setData({
59
+          list: aArr,
60
+          Total: res.data.total,
61
+          PostData: {
62
+            ...this.data.PostData,
63
+            pageNum: this.data.PostData.pageNum + 1
64
+          }
65
+        })
66
+        this.setData({
67
+          IsNull: !this.data.list.length
68
+        })
69
+        setTimeout(() => {
70
+          this.setData({
71
+            IsLock: false
72
+          })
73
+        }, 300)
74
+      }).catch((err) => {
75
+        wx.showToast({
76
+          title: '获取列表失败',
77
+          icon: 'none',
78
+        })
79
+        setTimeout(() => {
80
+          this.setData({
81
+            IsLock: false
82
+          })
83
+        }, 300)
84
+      })
85
+    }
86
+  },
87
+  ShowDeleteItem(e) { // 长按显示删除
88
+    this.setData({
89
+      DeleteIndex: e.target.dataset.index
90
+    })
91
+  },
92
+  ResetDeleteIndex() { // 重置删除状态
93
+    this.setData({
94
+      DeleteIndex: null
95
+    })
96
+  },
97
+  DeleteItem() { // 确认删除逻辑
98
+    const delId = this.data.DeleteIndex
99
+    this.ResetDeleteIndex()
100
+
101
+    const _self = this
102
+
103
+    wx.showModal({
104
+      title: '确认',
105
+      content: '确认要删除当前记录?',
106
+      success(res) {
107
+        if (res.confirm) {
108
+
109
+          fetch({
110
+            ...getApi('user.delAppointment', {
111
+              id: delId
112
+            }),
113
+          }).then(() => {
114
+            const list = _self.data.list.filter(x => x.appointmentId !== delId)
115
+
116
+            _self.setData({
117
+              list
118
+            })
119
+          }).catch((err) => {
120
+            wx.showToast({
121
+              title: '删除失败',
122
+              icon: 'none',
123
+            })
124
+          })
125
+
126
+
127
+        } else if (res.cancel) {
128
+          console.log('用户点击取消')
129
+        }
130
+      }
131
+    })
132
+  },
133
+  onShareAppMessage: function () {
134
+    return app.globalData.ShareDate
135
+  }
136
+})

+ 3
- 0
pages/MyWelfare/index.json ファイルの表示

@@ -0,0 +1,3 @@
1
+{
2
+  "usingComponents": { }
3
+}

+ 28
- 0
pages/MyWelfare/index.wxml ファイルの表示

@@ -0,0 +1,28 @@
1
+<!--index.wxml-->
2
+<view class="MainPage" bindtouchmove="ResetDeleteIndex">
3
+  <scroll-view scroll-y style="height: {{WindowHeight}}px;" bindscrolltolower="GetList">
4
+    <view class="isNull centerLabel" hidden="{{!IsNull}}">
5
+      <text>暂无数据</text>
6
+    </view>
7
+    <view class="list">
8
+      <view class="flex-h" wx:for="{{list}}" wx:for-item="item" wx:key="item.activityId">
9
+
10
+        <!-- 左侧图片 -->
11
+        <view class="img">
12
+          <image mode="aspectFill" src="{{item.imgUrl}}" class="centerLabel cover"></image>
13
+        </view>
14
+
15
+        <!-- 右侧内容 -->
16
+        <view class="flex-item">
17
+          <view>
18
+            <text>{{item.title}}</text>
19
+            <text>{{item.desc}}</text>
20
+            <text class="price">活动时间:<text>{{item.activityDate}}</text></text>
21
+          </view>
22
+        </view>
23
+
24
+      </view>
25
+    </view>
26
+    <text class="noMore" wx:if="{{!IsNull}}">{{list.length < Total ? '正在加载更多...' : '已加载全部'}}</text>
27
+  </scroll-view>
28
+</view>

+ 84
- 0
pages/MyWelfare/index.wxss ファイルの表示

@@ -0,0 +1,84 @@
1
+/**index.wxss**/
2
+@import '../../app.wxss';
3
+
4
+.list {
5
+  padding: 30rpx;
6
+  position: relative;
7
+  overflow: hidden;
8
+}
9
+
10
+.list > view {
11
+  padding: 20rpx;
12
+  position: relative;
13
+  overflow: hidden;
14
+  background: #fff;
15
+  margin-top: 30rpx;
16
+  box-shadow: 0 0 20rpx 10rpx rgba(0, 0, 0, 0.05);
17
+}
18
+
19
+.list > view:first-child {
20
+  margin-top: 0;
21
+}
22
+
23
+.img {
24
+  width: 140rpx;
25
+  height: 186rpx;
26
+  position: relative;
27
+  overflow: hidden;
28
+  background: #eee;
29
+  border-radius: 10rpx;
30
+}
31
+
32
+.list > view > .flex-item {
33
+  margin-left: 30rpx;
34
+}
35
+
36
+.list .delete {
37
+  width: 100%;
38
+  position: relative;
39
+  overflow: hidden;
40
+  text-align: right;
41
+  margin-top: -10rpx;
42
+}
43
+
44
+.list .delete image {
45
+  width: 24rpx;
46
+  display: inline-block;
47
+}
48
+
49
+.list text {
50
+  width: 100%;
51
+  display: block;
52
+  line-height: 40rpx;
53
+  font-size: 26rpx;
54
+  color: #999;
55
+}
56
+
57
+.list .delete + text {
58
+  font-size: 30rpx;
59
+  font-weight: bold;
60
+  color: #000;
61
+  line-height: 44rpx;
62
+}
63
+
64
+.list text.price {
65
+  text-align: right;
66
+  color: red;
67
+}
68
+
69
+.list text.price text {
70
+  display: inline;
71
+  color: red;
72
+  font-size: 30rpx;
73
+  font-weight: bold;
74
+}
75
+
76
+.noMore {
77
+  width: 100%;
78
+  display: block;
79
+  text-align: center;
80
+  color: #666;
81
+  font-size: 24rpx;
82
+  line-height: 40rpx;
83
+  margin: 0 20rpx;
84
+}

+ 9
- 26
pages/SelfServiceTool/MortgageCalculator/index.js ファイルの表示

@@ -83,19 +83,11 @@ Page({
83 83
       id: '30'
84 84
     }],
85 85
     ShowCommercialLoanRateList: false,
86
-    CommercialLoanRateList: [{ // 商业贷款利率选项
87
-      value: '基准利率(4.9%)',
88
-      id: '0.049'
89
-    }, {
90
-      value: '基准利率7折(3.43%)',
91
-      id: '0.0343'
92
-    }, {
93
-      value: '基准利率75折(3.68%)',
94
-      id: '0.0368'
95
-    }, {
86
+    CommercialLoanRateList: [{
96 87
       value: '基准利率8折(3.92%)',
97 88
       id: '0.0392'
98
-    }, {
89
+    },
90
+    {
99 91
       value: '基准利率85折(4.17%)',
100 92
       id: '0.0417'
101 93
     }, {
@@ -104,6 +96,9 @@ Page({
104 96
     }, {
105 97
       value: '基准利率95折(4.66%)',
106 98
       id: '0.0466'
99
+    },{ // 商业贷款利率选项
100
+        value: '基准利率(4.9%)',
101
+        id: '0.049'
107 102
     }, {
108 103
       value: '基准利率1.05倍(5.15%)',
109 104
       id: '0.0515'
@@ -113,21 +108,9 @@ Page({
113 108
     }, {
114 109
       value: '基准利率1.2倍(5.88%)',
115 110
       id: '0.0588'
116
-    }, {
117
-      value: '基准利率1.3倍(6.37%)',
118
-      id: '0.0637'
119 111
     }],
120 112
     ShowPublicHousingFundLoanRateList: false,
121 113
     PublicHousingFundLoanRateList: [{ // 公积金贷款利率选项
122
-      value: '基准利率(3.25%)',
123
-      id: '0.0325'
124
-    }, {
125
-      value: '基准利率7折(2.27%)',
126
-      id: '0.0227'
127
-    }, {
128
-      value: '基准利率75折(2.44%)',
129
-      id: '0.0244'
130
-    }, {
131 114
       value: '基准利率8折(2.60%)',
132 115
       id: '0.026'
133 116
     }, {
@@ -139,6 +122,9 @@ Page({
139 122
     }, {
140 123
       value: '基准利率95折(3.09%)',
141 124
       id: '0.0309'
125
+    }, {
126
+      value: '基准利率(3.25%)',
127
+      id: '0.0325'
142 128
     }, {
143 129
       value: '基准利率1.05倍(3.41%)',
144 130
       id: '0.0341'
@@ -148,9 +134,6 @@ Page({
148 134
     }, {
149 135
       value: '基准利率1.2倍(3.90%)',
150 136
       id: '0.039'
151
-    }, {
152
-      value: '基准利率1.3倍(4.23%)',
153
-      id: '0.0423'
154 137
     }],
155 138
     Options: {
156 139
       RepaymentType: '2', // 还款方式: 1-等额本金;2-等额本息(123)

+ 2
- 2
pages/SelfServiceTool/QualifyingTest/index.js ファイルの表示

@@ -129,7 +129,7 @@ Page({
129 129
               this.setData({
130 130
                 CanSubmit: true
131 131
               })
132
-            }, 1000)
132
+            }, 300)
133 133
           }
134 134
         }
135 135
       })
@@ -142,7 +142,7 @@ Page({
142 142
           ActiveIndex: aIndex,
143 143
           TapOff: true
144 144
         })
145
-      }, 1000)
145
+      }, 300)
146 146
     }
147 147
   },
148 148
   PrevQuestion() { // 上一题

+ 33
- 0
pages/UserCenter/UserInfo/index.js ファイルの表示

@@ -15,6 +15,39 @@ create(store, {
15 15
     })
16 16
   },
17 17
   SaveUserInfo() { // 提交表单数据
18
+    if (this.store.data.userInfo.name === '') {
19
+      wx.showToast({
20
+        title: '昵称不能为空!',
21
+        icon: 'none',
22
+      })
23
+      return false
24
+    }
25
+    if (!this.store.data.userInfo.phone || this.store.data.userInfo.phone == '') {
26
+      wx.showToast({
27
+        title: '手机号不能为空!',
28
+        icon: 'none',
29
+      })
30
+      return false
31
+    }
32
+    var myreg = /^[1][3,4,5,7,8,9][0-9]{9}$/;
33
+    if (!myreg.test(this.store.data.userInfo.phone)) {
34
+      wx.showToast({
35
+        title: '手机号格式不正确!',
36
+        icon: 'none',
37
+      })
38
+      return false
39
+    }
40
+    if (this.store.data.userInfo.idNum && this.store.data.userInfo.idNum!='') {
41
+      var idreg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
42
+      if (!idreg.test(this.store.data.userInfo.idNum)) {
43
+        wx.showToast({
44
+          title: '身份证格式不正确!',
45
+          icon: 'none',
46
+        })
47
+        return false
48
+      }
49
+    }
50
+
18 51
     fetch({ ...getApi('user.update'), data: this.store.data.userInfo }).then(() => {
19 52
       // 同步到 globalData
20 53
       app.globalData.UserInfo = { ...this.store.data.userInfo }

+ 1
- 1
pages/components/Concessions/index.js ファイルの表示

@@ -10,7 +10,7 @@ Component({
10 10
   data: {
11 11
     UserInfo: app.globalData.UserInfo,
12 12
     NavList: [{
13
-      value: '项目动态',
13
+      value: '楼盘资讯',
14 14
       id: ''
15 15
     }, {
16 16
       value: '精彩活动',

+ 3
- 1
pages/components/Estate/index.js ファイルの表示

@@ -11,7 +11,9 @@ Component({
11 11
   properties: {},
12 12
   data: {
13 13
     UserInfo: app.globalData.UserInfo,
14
-    EstateList: []
14
+    EstateList: [],
15
+    x: 1,
16
+    y: 1
15 17
   },
16 18
   lifetimes: {},
17 19
   ready: function() {

+ 13
- 7
pages/components/Estate/index.wxml ファイルの表示

@@ -2,8 +2,8 @@
2 2
 <view class="SubContainer">
3 3
   <view class="map">
4 4
     <movable-area style="height: 100%; width: 100%; background: #eee;position:absolute;left:0;top:0;">
5
-      <movable-view scale="{{true}}" scale-min="1" scale-max="2.5" x="{{x}}" y="{{y}}" direction="all">
6
-        <image mode="aspectFit" src="/assets/images/img4.jpg" class="centerLabel contian bg"></image>
5
+      <movable-view scale="{{true}}" scale-min="1.3" scale-max="2.5" x="{{x}}" y="{{y}}" direction="all">
6
+        <image mode="aspectFill" src="https://whole-estate.oss-cn-beijing.aliyuncs.com/img4-new.jpg" class="centerLabel cover bg"></image>
7 7
       </movable-view>
8 8
     </movable-area>
9 9
     <!-- <image mode="widthFix" src="/assets/images/img4.jpg" class="centerLabel cover bg"></image>
@@ -14,13 +14,19 @@
14 14
     <text>附近楼盘</text>
15 15
     <view class="list">
16 16
       <view wx:for="{{EstateList}}" wx:for-item="item" wx:for-index="index" wx:key="key" data-id="{{item.buildingId}}" bindtap="ListTap">
17
-        <image mode="aspectFill" src="{{item.buildingImg}}" class="centerLabel cover"></image>
18
-        <text class="price">均价:{{item.price}}</text>
19
-        <text class="name">{{item.buildingName}}</text>
20
-        <view class="address flex-h">
21
-          <image mode="widthFix" src="/assets/images/icon8.png"></image>
17
+        <image mode="aspectFill" src="{{item.buildingImg}}" class="cover"></image>
18
+        <view class="estateDetail">
19
+          <text class="name">{{item.buildingName}}</text>
20
+          <view class="address">
21
+            <image mode="widthFix" src="/assets/images/icon41.png" style="width: 12rpx;"></image>{{item.address}} 距您{{item.distance}}km
22
+          </view>
23
+          <view class="price">均价:<text>{{item.price}}</text></view>
24
+        </view>
25
+        <!-- <view class="address flex-h">
26
+          <image mode="widthFix" src="/assets/images/icon41.png"></image>
22 27
           <text class="flex-item">{{item.address}} 距您{{item.distance}}km</text>
23 28
         </view>
29
+        <text class="price">均价:{{item.price}}</text> -->
24 30
       </view>
25 31
     </view>
26 32
   </view>

+ 64
- 21
pages/components/Estate/index.wxss ファイルの表示

@@ -41,14 +41,14 @@
41 41
 .EstateList > text {
42 42
   width: 100%;
43 43
   display: block;
44
-  text-indent: 48rpx;
44
+  text-indent: 34rpx;
45 45
   font-size: 32rpx;
46 46
   font-weight: bold;
47 47
   line-height: 42rpx;
48 48
   position: relative;
49 49
 }
50 50
 
51
-.EstateList > text::after {
51
+/* .EstateList > text::after {
52 52
   content: '';
53 53
   width: 6rpx;
54 54
   height: 32rpx;
@@ -57,7 +57,7 @@
57 57
   position: absolute;
58 58
   left: 30rpx;
59 59
   top: 8rpx;
60
-}
60
+} */
61 61
 
62 62
 .EstateList .list {
63 63
   width: 100%;
@@ -77,8 +77,8 @@
77 77
 
78 78
 .EstateList .list > view {
79 79
   display: inline-block;
80
-  width: 285rpx;
81
-  height: 380rpx;
80
+  width: 380rpx;
81
+  height: 390rpx;
82 82
   position: relative;
83 83
   overflow: hidden;
84 84
   border-radius: 10rpx;
@@ -92,16 +92,69 @@
92 92
 }
93 93
 
94 94
 .EstateList .list > view > image {
95
-  border-radius: 10rpx;
95
+  border-radius: 10rpx 10rpx 0 0;
96
+  width: 100%;
97
+  height: 212rpx;
98
+  top: 0;
96 99
   z-index: 1;
97 100
 }
98 101
 
99 102
 .EstateList .list > view > text {
100 103
   position: absolute;
101 104
   z-index: 2;
102
-  color: #fff;
103 105
 }
104 106
 
107
+.EstateList .estateDetail{
108
+  padding: 0 22rpx;
109
+  display: block;
110
+}
111
+
112
+.EstateList .estateDetail .name{
113
+  display: block;
114
+  font-size: 32rpx;
115
+  line-height: 48rpx;
116
+  margin-top: 30rpx;
117
+  overflow: hidden;
118
+  color: #333333;
119
+  white-space: nowrap;
120
+  text-overflow: ellipsis;
121
+  font-weight: 600;
122
+}
123
+
124
+.EstateList .estateDetail .address{
125
+  color: #666666;
126
+  font-size: 22rpx;
127
+  line-height: 36rpx;
128
+}
129
+
130
+.EstateList .estateDetail .address image {
131
+  display: inline-block;
132
+  width: 12rpx;
133
+  margin-right: 10rpx;
134
+  vertical-align: middle;
135
+}
136
+
137
+.EstateList .estateDetail .address text {
138
+  color: #666666;
139
+  font-size: 22rpx;
140
+  line-height: 36rpx;
141
+  display: inline-block;
142
+  vertical-align: middle;
143
+}
144
+
145
+.EstateList .estateDetail .price{
146
+  font-size: 22rpx;
147
+  color: #666666;
148
+  padding-top: 10rpx;
149
+  line-height: 30rpx;
150
+  vertical-align: middle;
151
+}
152
+
153
+.EstateList .estateDetail .price text{
154
+  color: red;
155
+}
156
+
157
+/* 
105 158
 .EstateList .price {
106 159
   display: inline-block;
107 160
   padding: 0 15rpx;
@@ -116,35 +169,25 @@
116 169
 .EstateList .name {
117 170
   display: block;
118 171
   padding: 0 20rpx;
119
-  font-size: 24rpx;
172
+  font-size: 32rpx;
120 173
   line-height: 34rpx;
121 174
   white-space: nowrap;
122 175
   overflow: hidden;
123 176
   text-overflow: ellipsis;
124 177
   left: 0;
125
-  bottom: 46rpx;
178
+  bottom: 110rpx;
126 179
 }
127 180
 
128 181
 .EstateList .address{
129 182
   padding: 0 20rpx;
130 183
   position: absolute;
131 184
   left: 0;
132
-  bottom: 16rpx;
185
+  bottom: 72rpx;
133 186
   z-index: 2;
134 187
   align-items: center;
135 188
 }
136 189
 
137
-.EstateList .address image {
138
-  display: inline-block;
139
-  width: 12rpx;
140
-  margin-right: 10rpx;
141
-}
142
-
143
-.EstateList .address text {
144
-  color: #fff;
145
-  font-size: 17rpx;
146
-  line-height: 30rpx;
147
-}
190
+ */
148 191
 
149 192
 movable-view {
150 193
   position: relative;

+ 6
- 7
pages/components/Mine/index.js ファイルの表示

@@ -13,7 +13,7 @@ create({
13 13
       icon: '/assets/images/icon16.png',
14 14
       router: ''
15 15
     }, {
16
-      value: '我的福利社',
16
+      value: '我报名的活动',
17 17
       icon: '/assets/images/icon17.png',
18 18
       router: ''
19 19
     }, {
@@ -24,10 +24,6 @@ create({
24 24
       value: '收藏的楼盘',
25 25
       icon: '/assets/images/icon19.png',
26 26
       router: ''
27
-    }, {
28
-      value: '楼盘展示',
29
-      icon: '/assets/images/icon20.png',
30
-      router: ''
31 27
     }, {
32 28
       value: '购房工具',
33 29
       icon: '/assets/images/icon21.png',
@@ -58,8 +54,11 @@ create({
58 54
           url: '/pages/UserCenter/UserInfo/index'
59 55
         })
60 56
       } else if (e.target.dataset.type === 1) { // 我的福利社
61
-        this.triggerEvent('myevent', {
62
-          index: 2
57
+        if (!this.checkUserLogin()) {
58
+          return
59
+        }
60
+        wx.navigateTo({
61
+          url: '/pages/MyWelfare/index'
63 62
         })
64 63
       } else if (e.target.dataset.type === 2) { // 预约记录
65 64
         if (!this.checkUserLogin()) {

+ 54
- 17
pages/components/SubIndex/index.js ファイルの表示

@@ -43,32 +43,69 @@ Component({
43 43
       })
44 44
     })
45 45
 
46
-    fetch({
47
-      url: $api.dynamic.list.url,
48
-      method: $api.dynamic.list.method,
49
-      data: {
50
-        pageNum: 1,
51
-        pageSize: 10
52
-      }
53
-    }).then((dynamics) => {
54
-      const records = dynamics.data.records.map(x => {
55
-        return {
56
-          ...x,
57
-          createDate: x.createDate.slice(2, 10)
46
+    wx.getSetting({
47
+      success(res) {
48
+        if (!res.authSetting['scope.userLocation']) {
49
+          wx.authorize({
50
+            scope: 'scope.userLocation',
51
+            success() {
52
+              _that.GetBuildingList()
53
+            }
54
+          })
55
+        } else {
56
+          _that.GetBuildingList()
58 57
         }
59
-      })
60
-      _that.setData({
61
-        EstateList: records
62
-      })
58
+      }
63 59
     })
64 60
   },
65 61
   pageLifetimes: {
66 62
     show: function() {},
67 63
   },
68 64
   methods: {
65
+    GetBuildingList() {
66
+      const _that = this
67
+      wx.getLocation({
68
+        type: 'wgs84',
69
+        success(res) {
70
+          fetch({
71
+            url: $api.building.mainlist.url,
72
+            method: $api.building.mainlist.method,
73
+            data: {
74
+              pageNum: 1,
75
+              pageSize: 10
76
+            }
77
+          }).then((buildings) => {
78
+            const records = buildings.data.map(x => {
79
+              const distance = parseInt(_that.GetGreatCircleDistance(res.latitude, res.longitude, x.coordinate.split(',')[0], x.coordinate.split(',')[1] || res.longitude))
80
+              return {
81
+                ...x,
82
+                distance: distance / 10
83
+              }
84
+            })
85
+            _that.setData({
86
+              EstateList: records
87
+            })
88
+          })
89
+        }})
90
+    },
91
+    GetGreatCircleDistance(lat1, lng1, lat2, lng2) {
92
+      if (lat1 === lat2 && lng1 === lng2) {
93
+        return 0
94
+      }
95
+      var EARTH_RADIUS = 6378137.0//单位M
96
+      var PI = Math.PI
97
+      var radLat1 = lat1 * PI / 180.0
98
+      var radLat2 = lat2 * PI / 180.0
99
+      var a = radLat1 - radLat2
100
+      var b = lng1 * PI / 180.0 - lng2 * PI / 180.0
101
+      var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)))
102
+      s = s * EARTH_RADIUS
103
+      s = Math.round(s * 10000) / 10000.0
104
+      return s / 100
105
+    },
69 106
     ItemTap(e) {
70 107
       wx.navigateTo({
71
-        url: '/pages/ActivityDetail/index?type=1&id=' + e.target.dataset.id
108
+        url: '/pages/EstateDetail/index?id=' + e.target.dataset.id
72 109
       })
73 110
     },
74 111
     TopNavTap(e) { // topnav点击事件

+ 8
- 5
pages/components/SubIndex/index.wxml ファイルの表示

@@ -34,15 +34,18 @@
34 34
     </view>
35 35
   </view>
36 36
   <view class="projectList">
37
-    <text>项目动态</text>
37
+    <text>精选楼盘</text>
38 38
     <view class="list">
39 39
       <view wx:for="{{EstateList}}" wx:for-item="item" wx:for-index="index" wx:key="key">
40
-        <text class="name">{{item.title}}</text>
41
-        <text class="date">{{item.createDate}}</text>
40
+        <text class="name">{{item.buildingName}}</text>
41
+        <view class="address flex-h">
42
+          <image mode="widthFix" src="/assets/images/icon41.png"></image>
43
+          <text class="flex-item">{{item.address}} 距您{{item.distance}}km</text>
44
+        </view>
42 45
         <view class="listImg">
43 46
           <view>
44
-            <image mode="aspectFill" src="{{item.imgUrl}}" class="centerLabel cover" data-id="{{item.dynamicId}}" bindtap="ItemTap"></image>
45
-            <text>{{item.building.buildingName}}</text>
47
+            <image mode="aspectFill" src="{{item.buildingImg[0].url}}" class="centerLabel cover" data-id="{{item.buildingId}}" bindtap="ItemTap"></image>
48
+            <text class="price">均价:{{item.price}}</text>
46 49
           </view>
47 50
         </view>
48 51
       </view>

+ 16
- 3
pages/components/SubIndex/index.wxss ファイルの表示

@@ -157,9 +157,22 @@
157 157
   font-weight: bold;
158 158
 }
159 159
 
160
-.projectList .date {
160
+.projectList .address {
161 161
   font-size: 20rpx;
162
-  line-height: 32rpx;
162
+  line-height: 34rpx;
163
+  color: #666666;
164
+  padding: 0 20rpx;
165
+}
166
+
167
+.projectList .address image {
168
+  display: inline-block;
169
+  width: 18rpx;
170
+  margin-right: 5rpx;
171
+  margin-top: 4rpx;
172
+}
173
+
174
+.projectList .address text{
175
+  padding: 0 5rpx;
163 176
 }
164 177
 
165 178
 .projectList .listImg {
@@ -187,7 +200,7 @@
187 200
   background: #bb9c79;
188 201
   border-radius: 36rpx;
189 202
   position: absolute;
190
-  left: 20rpx;
203
+  right: 20rpx;
191 204
   bottom: 20rpx;
192 205
   z-index: 2;
193 206
 }

+ 1
- 1
pages/index/index.js ファイルの表示

@@ -40,7 +40,7 @@ create(store, {
40 40
       })
41 41
     } else if (index === 2) {
42 42
       wx.setNavigationBarTitle({
43
-        title: '项目动态'
43
+        title: '楼盘资讯'
44 44
       })
45 45
     } else if (index === 3) {
46 46
       wx.setNavigationBarTitle({

+ 113
- 0
pages/map/testmap.js ファイルの表示

@@ -0,0 +1,113 @@
1
+// pages/map/testmap.js
2
+var QQMapWX = require('../../utils/qqmap-wx-jssdk.js');
3
+var qqmapsdk;
4
+
5
+Page({
6
+
7
+  /**
8
+   * 页面的初始数据
9
+   */
10
+  data: {
11
+    height: 'auto',
12
+    markers: []
13
+  },
14
+
15
+  /**
16
+   * 生命周期函数--监听页面加载
17
+   */
18
+  onLoad: function (options) {
19
+    qqmapsdk = new QQMapWX({
20
+      key: 'KJCBZ-G2MKX-DB443-Z4CBR-7E6K2-GJF5D'
21
+    });
22
+
23
+    //保证wx.getSystemInfo的回调函数中能够使用this
24
+    var that = this
25
+
26
+    //调用wx.getSystemInfo接口,然后动态绑定组件高度
27
+    wx.getSystemInfo({
28
+      success: function (res) {
29
+        that.setData({
30
+          height: res.windowHeight
31
+        })
32
+      }
33
+    })
34
+  },
35
+
36
+  /**
37
+   * 生命周期函数--监听页面初次渲染完成
38
+   */
39
+  onReady: function () {
40
+  },
41
+
42
+  /**
43
+   * 生命周期函数--监听页面显示
44
+   */
45
+  onShow: function () {
46
+    const _this = this
47
+    qqmapsdk.search({
48
+      keyword: '教育',  //搜索关键词
49
+      page_size: 20,
50
+      location: '39.980014,116.313972',  //设置周边搜索中心点
51
+      filter: 'category=大学,中学,小学,幼儿园',
52
+      success: function (res) { //搜索成功后的回调
53
+        console.log(res)
54
+        var mks = []
55
+        for (var i = 0; i < res.data.length; i++) {
56
+          mks.push({ // 获取返回结果,放到mks数组中
57
+            title: res.data[i].title,
58
+            id: res.data[i].id,
59
+            latitude: res.data[i].location.lat,
60
+            longitude: res.data[i].location.lng,
61
+            iconPath: "/resources/my_marker.png", //图标路径
62
+            width: 20,
63
+            height: 20
64
+          })
65
+        }
66
+        _this.setData({ //设置markers属性,将搜索结果显示在地图中
67
+          markers: mks
68
+        })
69
+      },
70
+      fail: function (res) {
71
+        console.log(res);
72
+      },
73
+      complete: function (res) {
74
+        console.log(res);
75
+      }
76
+    });
77
+  },
78
+
79
+  /**
80
+   * 生命周期函数--监听页面隐藏
81
+   */
82
+  onHide: function () {
83
+
84
+  },
85
+
86
+  /**
87
+   * 生命周期函数--监听页面卸载
88
+   */
89
+  onUnload: function () {
90
+
91
+  },
92
+
93
+  /**
94
+   * 页面相关事件处理函数--监听用户下拉动作
95
+   */
96
+  onPullDownRefresh: function () {
97
+
98
+  },
99
+
100
+  /**
101
+   * 页面上拉触底事件的处理函数
102
+   */
103
+  onReachBottom: function () {
104
+
105
+  },
106
+
107
+  /**
108
+   * 用户点击右上角分享
109
+   */
110
+  onShareAppMessage: function () {
111
+
112
+  }
113
+})

+ 3
- 0
pages/map/testmap.json ファイルの表示

@@ -0,0 +1,3 @@
1
+{
2
+  "usingComponents": {}
3
+}

+ 1
- 0
pages/map/testmap.wxml ファイルの表示

@@ -0,0 +1 @@
1
+<map id="map" markers="{{markers}}" longitude="116.313972" latitude="39.980014" scale="14" style="width: 100%; height: {{height}}px;"></map>

+ 1
- 0
pages/map/testmap.wxss ファイルの表示

@@ -0,0 +1 @@
1
+/* pages/map/testmap.wxss */

+ 1123
- 0
utils/qqmap-wx-jssdk.js
ファイル差分が大きすぎるため省略します
ファイルの表示