├── .gitignore ├── api.md ├── app.js ├── app.json ├── app.wxss ├── index ├── index.js ├── index.wxml └── index.wxss ├── login.js ├── pages ├── about │ ├── about.js │ ├── about.json │ ├── about.wxml │ └── about.wxss ├── business │ ├── business.js │ ├── business.json │ ├── business.wxml │ └── business.wxss ├── category │ ├── category.js │ ├── category.wxml │ └── category.wxss ├── favorite │ ├── favorite.js │ ├── favorite.json │ ├── favorite.wxml │ └── favorite.wxss ├── feedback │ ├── feedback.js │ ├── feedback.json │ ├── feedback.wxml │ └── feedback.wxss ├── goods │ ├── goods.js │ ├── goods.wxml │ └── goods.wxss ├── goods_detail │ ├── goods_detail.js │ ├── goods_detail.wxml │ └── goods_detail.wxss ├── history │ ├── history.js │ ├── history.json │ ├── history.wxml │ └── history.wxss ├── img │ ├── home-t.png │ ├── home.png │ ├── home1.png │ ├── home_banner.png │ ├── my.png │ └── my1.png ├── index │ ├── index.js │ ├── index.wxml │ └── index.wxss ├── my │ ├── my.js │ ├── my.wxml │ └── my.wxss └── search │ ├── search.js │ ├── search.json │ ├── search.wxml │ └── search.wxss ├── project.config.json ├── readme.md ├── readme_files ├── 1.jpg ├── 2.jpg └── 3.jpg └── util.js /.gitignore: -------------------------------------------------------------------------------- 1 | .idea -------------------------------------------------------------------------------- /api.md: -------------------------------------------------------------------------------- 1 | # api地址 2 | 3 | ## 房产 4 | 5 | ### https://heiliuer.com 6 | 7 | #### [001] 获取房产列表(分页) 8 | 9 | [GET] /api/wxapp/house 10 | 11 | 12 | #### [002] 获取房产详情 13 | 14 | [GET] /api/wxapp/house/:id 15 | 16 | #### [003] 关于我们 17 | 18 | [GET] /api/wxapp/about 19 | 20 | #### [004] 足迹-增加 21 | 22 | [POST] /api/wxapp/user_track 23 | 24 | request body: 25 | ```json 26 | { 27 | "houseId":"xxxxx" 28 | } 29 | ``` 30 | 31 | #### [005] 足迹-列表 (分页) 32 | 33 | [GET] /api/wxapp/user_track 34 | 35 | 36 | #### [006] 收藏-增加 37 | 38 | [POST] /api/wxapp/favorite 39 | 40 | request body: 41 | ```json 42 | { 43 | "houseId":"xxxxx" 44 | } 45 | ``` 46 | 47 | #### [007] 收藏-列表 (分页) 48 | 49 | [GET] /api/wxapp/favorite 50 | 51 | 52 | #### [008] 反馈-增加 53 | 54 | [POST] /api/wxapp/feedback 55 | 56 | request body: 57 | ```json 58 | { 59 | "content":"反馈内容" 60 | } 61 | ``` 62 | 63 | #### [009] 反馈-列表 (分页) 64 | 65 | [GET] /api/wxapp/feedback 66 | 67 | 68 | #### [009] 房产-搜索 (分页) 69 | 70 | [GET] /api/wxapp/search 71 | 72 | query params: 73 | ```json 74 | { 75 | "key":"关键字" 76 | } 77 | ``` 78 | 79 | 80 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | const {login} = require('./login') 2 | 3 | App({ 4 | onLaunch: function() { 5 | login() 6 | } 7 | }) -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/index/index", 4 | "pages/my/my", 5 | "pages/search/search", 6 | "pages/goods/goods", 7 | "pages/category/category", 8 | "pages/about/about", 9 | "pages/goods_detail/goods_detail", 10 | "pages/feedback/feedback", 11 | "pages/business/business", 12 | "pages/favorite/favorite", 13 | "pages/history/history" 14 | ], 15 | "window": { 16 | "backgroundTextStyle": "light", 17 | "navigationBarBackgroundColor": "#33ba99", 18 | "navigationBarTitleText": "浦悦地产", 19 | "navigationBarTextStyle": "black", 20 | "enablePullDownRefresh":false 21 | }, 22 | "tabBar": { 23 | "color":"#000", 24 | "selectedColor":"#F00", 25 | "list": [ 26 | { 27 | "pagePath": "pages/index/index", 28 | "text": "首页", 29 | "iconPath": "pages/img/home.png", 30 | "selectedIconPath": "pages/img/home1.png" 31 | }, 32 | { 33 | "pagePath": "pages/my/my", 34 | "text": "我的", 35 | "iconPath": "pages/img/my.png", 36 | "selectedIconPath": "pages/img/my1.png" 37 | } 38 | ] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app.wxss: -------------------------------------------------------------------------------- 1 | /**app.wxss 公用css**/ 2 | @font-face { 3 | font-family: 'iconfont'; /* project id 609296 */ 4 | src: url('//at.alicdn.com/t/font_609296_ojp6mdpzy3at6gvi.eot'); 5 | src: url('//at.alicdn.com/t/font_609296_ojp6mdpzy3at6gvi.eot?#iefix') format('embedded-opentype'), 6 | url('//at.alicdn.com/t/font_609296_ojp6mdpzy3at6gvi.woff') format('woff'), 7 | url('//at.alicdn.com/t/font_609296_ojp6mdpzy3at6gvi.ttf') format('truetype'), 8 | url('//at.alicdn.com/t/font_609296_ojp6mdpzy3at6gvi.svg#iconfont') format('svg'); 9 | } 10 | .iconfont { 11 | font-family:"iconfont" !important; 12 | font-size:16px; 13 | font-style:normal; 14 | -webkit-font-smoothing: antialiased; 15 | -moz-osx-font-smoothing: grayscale; 16 | } 17 | .icon-dianhua2:before { content: "\e604"; } 18 | 19 | .icon-huidaodingbu:before { content: "\e600"; } 20 | 21 | .icon-home:before { content: "\e620"; } 22 | 23 | .icon-zuji:before { content: "\e601"; } 24 | 25 | .icon-tubiao102:before { content: "\e629"; } 26 | 27 | .icon-yijianfankui1:before { content: "\e616"; } 28 | 29 | .icon-grid:before { content: "\e64a"; } 30 | 31 | .icon-94:before { content: "\e674"; } 32 | 33 | .icon-dianhua:before { content: "\e6d0"; } 34 | 35 | .icon-shoucang9:before { content: "\e60f"; } 36 | 37 | .icon-caidan:before { content: "\e780"; } 38 | 39 | .icon-sousuo:before { content: "\e617"; } 40 | 41 | .icon-iconset0413:before { content: "\e724"; } 42 | 43 | .icon-iconfontjiantou2:before { content: "\e634"; } 44 | 45 | .icon-weibiaoti12:before { content: "\e61e"; } 46 | 47 | .icon-grid1:before { content: "\e635";} 48 | 49 | .icon-fangzihouse129:before { content: "\e644"; } 50 | 51 | .icon-dianhua1:before { content: "\e6a3"; } 52 | 53 | .icon-xiangxiajiantou:before { content: "\e630"; } 54 | 55 | .icon-zuji1:before { content: "\e638"; } 56 | 57 | .icon-fangzi:before { content: "\e614"; } 58 | 59 | .icon-zufang:before { content: "\e66e"; } 60 | 61 | .icon-listview:before { content: "\e67b"; } 62 | 63 | .icon-shoucang:before { content: "\e65f"; } 64 | 65 | .icon-sanjiaodown:before { content: "\e6b5"; } 66 | 67 | .icon-dianhua3:before { content: "\e74c"; } 68 | 69 | .icon-jiaoyinzujifangke:before { content: "\e87e"; } 70 | 71 | .icon-listview1:before { content: "\e62c"; } 72 | 73 | .icon-fangzi1:before { content: "\e6d3"; } 74 | 75 | .icon-caidan1:before { content: "\e607"; } 76 | 77 | .icon-caidan11:before { content: "\e611"; } 78 | 79 | .icon-haofangtuo400iconfonthaiwaidichan:before { content: "\e681"; } 80 | 81 | .icon-haofangtuo400iconfonthaofangtuo:before { content: "\e683"; } 82 | 83 | .icon-haofangtuo400iconfontjibenxinxi:before { content: "\e685"; } 84 | 85 | .icon-haofangtuo400iconfontshenqingershoufangshikan:before { content: "\e695"; } 86 | 87 | .icon-haofangtuo400iconfontwodeershoufang:before { content: "\e6a1"; } 88 | 89 | .icon-fankuiyijian:before { content: "\e649"; } 90 | 91 | .icon-yijianfankui2:before { content: "\e619"; } 92 | 93 | .icon-sousuo1:before { content: "\e641"; } 94 | 95 | .icon-haofangtuo400iconfontdianhuaanniu:before { content: "\e6c7"; } 96 | 97 | .icon-youjiantou1:before { content: "\e628"; } 98 | 99 | .icon-shoucang1:before { content: "\e631"; } 100 | 101 | .icon-jiatingfang:before { content: "\e632"; } 102 | 103 | .icon-yixingfangchan:before { content: "\e618"; } 104 | 105 | .icon-star:before { content: "\e639"; } 106 | 107 | .icon-fenxiang-1:before { content: "\e60b"; } 108 | 109 | .icon-shoucang2:before { content: "\e62a"; } 110 | 111 | .icon-900caidan_shouye:before { content: "\e680"; } 112 | 113 | .icon-yijianfankui:before { content: "\e60e"; } 114 | 115 | .icon-icon-test:before { content: "\e64e"; } 116 | 117 | .icon-icon-test1:before { content: "\e64f"; } 118 | 119 | .icon-grid2:before { content: "\e624"; } 120 | 121 | .icon-shangjia:before { content: "\e63a"; } 122 | 123 | .icon-zuji2:before { content: "\e61d"; } 124 | 125 | .icon-zufang1:before { content: "\e622"; } 126 | 127 | .icon-fangyuan:before { content: "\e610"; } 128 | 129 | .icon-wodefangjian:before { content: "\e61a"; } 130 | 131 | .icon-guanyuwomen:before { content: "\e68d"; } 132 | 133 | .icon-shangxiajiantou:before { content: "\e6b7"; } 134 | 135 | .icon-haofangtuoiconfont_dianpushoucang:before { content: "\e704"; } 136 | 137 | .icon-haofangtuoiconfont_dianpu:before { content: "\e705"; } 138 | 139 | .icon-haofangtuoiconfont_fangyuanguanli:before { content: "\e706"; } 140 | 141 | .icon-share:before { content: "\e6fb"; } 142 | 143 | .icon-ziyuan:before { content: "\e637"; } 144 | 145 | .icon-shangjiantou:before { content: "\e605"; } 146 | 147 | .icon-xiajiantou:before { content: "\e606"; } 148 | 149 | .icon-laba:before { content: "\e8c1"; } 150 | 151 | .icon-boshiweb_yijianfankui:before { content: "\e62d"; } 152 | 153 | .icon-house:before { content: "\e657"; } 154 | 155 | .icon-zuji3:before { content: "\e602"; } 156 | 157 | .icon-laba1:before { content: "\e62b"; } 158 | 159 | .icon-home1:before { content: "\e69c"; } 160 | 161 | .icon-zuixinfangyuan:before { content: "\e656"; } 162 | 163 | .icon-shoucang3:before { content: "\e7a7"; } 164 | 165 | .icon-laba2:before { content: "\e643"; } 166 | 167 | .icon-huidaodingbu1:before { content: "\e88d"; } 168 | 169 | .icon-xiangxiajiantoucuxiao:before { content: "\e8c8"; } 170 | 171 | .icon-laba3:before { content: "\e621"; } 172 | 173 | .icon-fangzi2:before { content: "\e615"; } 174 | 175 | .icon-arrow-bottom:before { content: "\e765"; } 176 | 177 | .icon-shoucang4:before { content: "\e670"; } 178 | 179 | .icon-shoucang5:before { content: "\e603"; } 180 | 181 | .icon-sousuo2:before { content: "\e633"; } 182 | 183 | .icon-fenxiang:before { content: "\e648"; } 184 | 185 | .icon-loufang:before { content: "\e61b"; } 186 | 187 | .icon-sousuo3:before { content: "\e61c"; } 188 | 189 | .icon-collection-b:before { content: "\e60d"; } 190 | 191 | .icon-shoucang6:before { content: "\e78c"; } 192 | 193 | .icon-icon-:before { content: "\e61f"; } 194 | 195 | .icon-shoucang7:before { content: "\e694"; } 196 | 197 | .icon-fangjian:before { content: "\e613"; } 198 | 199 | .icon-zhuyefangzi:before { content: "\e6a5"; } 200 | 201 | .icon-shoucang8:before { content: "\e623"; } 202 | 203 | .icon-tubiaozhizuomobandefuben-:before { content: "\e612"; } 204 | 205 | .icon-zhcc_xiangshangjiantou:before { content: "\e688"; } 206 | 207 | .icon-zhcc_xiangxiajiantou:before { content: "\e689"; } 208 | 209 | .icon-fangzi3:before { content: "\e8ff"; } 210 | 211 | .icon-xiangxiajiantou1:before { content: "\e98f"; } 212 | 213 | 214 | 215 | 216 | 217 | .weui-tabbar{ 218 | height: 60rpx !important; 219 | } 220 | .index-loading{ 221 | margin:0; 222 | text-align: center; 223 | height: 100rpx; 224 | line-height: 100rpx; 225 | } 226 | button::after { 227 | border-radius: 0; 228 | border: none; 229 | } 230 | .index-f-phone{ 231 | background-color: #fff; 232 | width: 80rpx; 233 | height: 80rpx; 234 | color: #000; 235 | border-radius: 40rpx; 236 | position: fixed; 237 | bottom: 80rpx; 238 | right: 30rpx; 239 | border: 1rpx solid #eee; 240 | line-height: 44rpx; 241 | } 242 | .index-f-phone .iconfont{ 243 | font-size: 58rpx; 244 | position: absolute; 245 | top:14rpx; 246 | left: 10rpx; 247 | color: rgba(99, 91, 102, 0.91); 248 | } 249 | 250 | page{ 251 | font-size:28rpx; 252 | height: 100%; 253 | background-color: #fff; 254 | font-family: -apple-system-font, Helvetica Neue, Helvetica, sans-serif; 255 | } 256 | 257 | .lf { 258 | float: left; 259 | } 260 | .rt { 261 | float: right; 262 | } 263 | .cf:after { 264 | content: ""; 265 | display: table; 266 | height: 0; 267 | clear: both; 268 | visibility: hidden; 269 | } 270 | .index-tc{ 271 | width: 100%; 272 | height: 16rpx; 273 | background-color: #f3f3f3; 274 | } 275 | /*100%列表*/ 276 | .index-con-m,.index-con-new{ 277 | width: 750rpx; 278 | box-sizing: border-box; 279 | padding-left:30rpx; 280 | padding-right: 30rpx; 281 | display: block; 282 | margin-top: 80rpx; 283 | } 284 | .index-con-new{ 285 | margin-top: 110rpx; 286 | } 287 | .index-con-m .index-con-t-con{ 288 | width:100%; 289 | padding: 34rpx 0; 290 | box-sizing: border-box; 291 | } 292 | .index-con-m image{ 293 | width: 210rpx; 294 | height:160rpx ; 295 | } 296 | .index-con-m .index-con-mc{ 297 | width: 480rpx; 298 | height:160rpx ; 299 | box-sizing: border-box; 300 | padding-left: 20rpx; 301 | } 302 | .index-con-m .index-con-mc-title,.index-con-new .index-con-mc-title{ 303 | display: -webkit-box; 304 | font-size:28rpx; 305 | color:#000000; 306 | line-height: 40rpx; 307 | } 308 | .index-con-m .index-con-mc-address,.index-con-new .index-con-mc-address{ 309 | display: block; 310 | color: #666; 311 | font-size: 26rpx; 312 | padding: 6rpx 0; 313 | } 314 | .index-con-m .index-con-mc-price,.index-con-new .index-con-mc-price{ 315 | color: red; 316 | font-size: 24rpx; 317 | } 318 | .index-con-m .index-con-mc-price i,.index-con-new .index-con-mc-price i{ 319 | font-size: 30rpx; 320 | } 321 | /*goods 100%class切换*/ 322 | .index-con-new image{ 323 | width: 330rpx; 324 | height: 300rpx; 325 | } 326 | .index-con-new .index-con-t-con{ 327 | width: 330rpx; 328 | box-sizing: border-box; 329 | padding-top: 20rpx; 330 | } 331 | .index-con-new .index-con-t-con:nth-child(2n-1){ 332 | margin-right: 30rpx; 333 | } 334 | .index-con-new .index-con-mc{ 335 | width: 330rpx; 336 | padding-bottom: 20rpx; 337 | } 338 | 339 | 340 | .ui-border-b:before { 341 | border-bottom: 1px solid #e9e9e9; 342 | content: ''; 343 | display: block; 344 | width: 100%; 345 | position: absolute; 346 | left: 0; 347 | bottom: 0; 348 | -webkit-transform-origin: left bottom 349 | } 350 | 351 | @media screen and (-webkit-min-device-pixel-ratio: 2) { 352 | .ui-border-b:before { 353 | -webkit-transform: scaleY(0.5) 354 | } 355 | } 356 | 357 | @media screen and (-webkit-min-device-pixel-ratio: 3) { 358 | .ui-border-b:before { 359 | -webkit-transform: scaleY(0.3333) 360 | } 361 | } 362 | 363 | .ui-border-t:before { 364 | border-top: 1px solid #e9e9e9; 365 | content: ''; 366 | display: block; 367 | width: 100%; 368 | position: absolute; 369 | left: 0; 370 | top: 0; 371 | -webkit-transform-origin: left top 372 | } 373 | 374 | @media screen and (-webkit-min-device-pixel-ratio: 2) { 375 | .ui-border-t:before { 376 | -webkit-transform: scaleY(0.5) 377 | } 378 | } 379 | 380 | @media screen and (-webkit-min-device-pixel-ratio: 3) { 381 | .ui-border-t:before { 382 | -webkit-transform: scaleY(0.3333) 383 | } 384 | } 385 | 386 | .ui-border-l:before { 387 | border-left: 1px solid #e9e9e9; 388 | content: ''; 389 | display: block; 390 | bottom: 0; 391 | position: absolute; 392 | left: 0; 393 | top: 0; 394 | -webkit-transform-origin: left top 395 | } 396 | 397 | @media screen and (-webkit-min-device-pixel-ratio: 2) { 398 | .ui-border-l:before { 399 | -webkit-transform: scaleX(0.5) 400 | } 401 | } 402 | 403 | @media screen and (-webkit-min-device-pixel-ratio: 3) { 404 | .ui-border-l:before { 405 | -webkit-transform: scaleX(0.3333) 406 | } 407 | } 408 | 409 | .ui-border-r:before { 410 | border-right: 1px solid #e9e9e9; 411 | content: ''; 412 | display: block; 413 | bottom: 0; 414 | position: absolute; 415 | right: 0; 416 | top: 0; 417 | -webkit-transform-origin: right top 418 | } 419 | 420 | @media screen and (-webkit-min-device-pixel-ratio: 2) { 421 | .ui-border-r:before { 422 | -webkit-transform: scaleX(0.5) 423 | } 424 | } 425 | 426 | @media screen and (-webkit-min-device-pixel-ratio: 3) { 427 | .ui-border-r:before { 428 | -webkit-transform: scaleX(0.3333) 429 | } 430 | } 431 | 432 | .ui-border-t, 433 | .ui-border-l, 434 | .ui-border-b, 435 | .ui-border-r, 436 | .ui-border-tb { 437 | position: relative 438 | } 439 | 440 | .ui-border-tb:before { 441 | border-top: 1px solid #e9e9e9; 442 | content: ''; 443 | display: block; 444 | width: 100%; 445 | position: absolute; 446 | left: 0; 447 | top: 0; 448 | -webkit-transform-origin: left top 449 | } 450 | 451 | @media screen and (-webkit-min-device-pixel-ratio: 2) { 452 | .ui-border-tb:before { 453 | -webkit-transform: scaleY(0.5) 454 | } 455 | } 456 | 457 | @media screen and (-webkit-min-device-pixel-ratio: 3) { 458 | .ui-border-tb:before { 459 | -webkit-transform: scaleY(0.3333) 460 | } 461 | } 462 | 463 | .ui-border-tb:after { 464 | border-bottom: 1px solid #e9e9e9; 465 | content: ''; 466 | display: block; 467 | width: 100%; 468 | position: absolute; 469 | left: 0; 470 | bottom: 0; 471 | -webkit-transform-origin: left bottom 472 | } 473 | 474 | @media screen and (-webkit-min-device-pixel-ratio: 2) { 475 | .ui-border-tb:after { 476 | -webkit-transform: scaleY(0.5) 477 | } 478 | } 479 | 480 | @media screen and (-webkit-min-device-pixel-ratio: 3) { 481 | .ui-border-tb:after { 482 | -webkit-transform: scaleY(0.3333) 483 | } 484 | } 485 | 486 | .ui-border:before { 487 | content: ""; 488 | width: 100%; 489 | height: 100%; 490 | position: absolute; 491 | top: 0; 492 | left: 0; 493 | border: 1px solid #e9e9e9; 494 | -webkit-transform-origin: 0 0; 495 | padding: 1px; 496 | -webkit-box-sizing: border-box; 497 | pointer-events: none; 498 | z-index: 10; 499 | pointer-events: none 500 | } 501 | 502 | @media screen and (-webkit-min-device-pixel-ratio: 2) { 503 | .ui-border:before { 504 | width: 200%; 505 | height: 200%; 506 | -webkit-transform: scale(0.5) 507 | } 508 | } 509 | 510 | @media screen and (-webkit-min-device-pixel-ratio: 3) { 511 | .ui-border:before { 512 | width: 300%; 513 | height: 300%; 514 | -webkit-transform: scale(0.3333) 515 | } 516 | } 517 | 518 | 519 | -------------------------------------------------------------------------------- /index/index.js: -------------------------------------------------------------------------------- 1 | const app = getApp() 2 | 3 | Page({ 4 | data: { 5 | 6 | }, 7 | onLoad: function () { 8 | console.log('https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/devtools.html') 9 | }, 10 | }) 11 | -------------------------------------------------------------------------------- /index/index.wxml: -------------------------------------------------------------------------------- 1 | 欢迎使用代码片段,可在控制台查看代码片段的说明和文档 -------------------------------------------------------------------------------- /index/index.wxss: -------------------------------------------------------------------------------- 1 | .intro { 2 | margin: 30px; 3 | text-align: center; 4 | } -------------------------------------------------------------------------------- /login.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by 丸子 on 2018/4/7. 3 | */ 4 | const {relativeurl} = require('./util') 5 | 6 | module.exports.saveToken = function(token) { 7 | try { 8 | wx.setStorageSync('token', token) 9 | } catch (e) {} 10 | } 11 | // 登录 12 | module.exports.login = function () { 13 | wx.login({ 14 | success: function (res) { 15 | if (res.code) { 16 | //发起网络请求 17 | wx.request({ 18 | method: "POST", 19 | url: relativeurl + 'api/wxapp/session/login', 20 | data: { 21 | code: res.code, 22 | }, 23 | success(res){ 24 | if(res.data.status == 0){ 25 | const {token} = res.data.data 26 | exports.saveToken(token) 27 | } 28 | } 29 | }) 30 | } else { 31 | console.log('登录失败!' + res.errMsg) 32 | } 33 | } 34 | }) 35 | } 36 | // 获取存储token 查看用户是否登录 37 | module.exports.getToken = function () { 38 | try { 39 | var token = (wx.getStorageSync('token') || '').trim() 40 | return token 41 | } catch (e) { 42 | } 43 | return '' 44 | } -------------------------------------------------------------------------------- /pages/about/about.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const {requestData} = require('../../util') 4 | 5 | Page({ 6 | requestData, 7 | onLoad(){ 8 | this.requestData() 9 | } 10 | }) 11 | -------------------------------------------------------------------------------- /pages/about/about.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "关于我们" 3 | } -------------------------------------------------------------------------------- /pages/about/about.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 公司简介 4 | 发布时间:2018年1月1日 5 | 6 | {{requestData.desc}} 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /pages/about/about.wxss: -------------------------------------------------------------------------------- 1 | page{ 2 | background-color: #f3f3f3; 3 | } 4 | .about{ 5 | width: 100%; 6 | box-sizing: border-box; 7 | padding: 20rpx 30rpx; 8 | } 9 | .about text:first-child{ 10 | font-weight: bold; 11 | padding: 10rpx 0; 12 | color: #000; 13 | } 14 | .about text:nth-child(2){ 15 | display: block; 16 | color: #aaa; 17 | padding: 20rpx 0 18 | } 19 | .about view{ 20 | background-color: #fff; 21 | color: #000; 22 | padding: 20rpx; 23 | text-indent:56rpx; 24 | line-height: 56rpx; 25 | border-radius: 4rpx; 26 | } -------------------------------------------------------------------------------- /pages/business/business.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const {calling, requestData} = require('../../util') 4 | 5 | 6 | Page({ 7 | requestData, 8 | calling(){ 9 | calling(this.data.pageData.contact.phone[0]) 10 | }, 11 | onLoad(){ 12 | this.requestData() 13 | } 14 | }) -------------------------------------------------------------------------------- /pages/business/business.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "用户反馈" 3 | } -------------------------------------------------------------------------------- /pages/business/business.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{requestData.name}} 4 | 5 | 6 | 店铺介绍 7 | 8 | 9 | 10 | 公司信息 11 | 12 | 13 | 名称:{{requestData.name}} 14 | 15 | 16 | 联系人:{{requestData.contact.personName}} 17 | 18 | 19 | 联系方式: 20 | {{requestData.contact.phone[0]}} 21 | 22 | 23 | 公司地址: 24 | {{requestData.address}} 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /pages/business/business.wxss: -------------------------------------------------------------------------------- 1 | .business{ 2 | width: 100%; 3 | box-sizing: border-box; 4 | } 5 | .business-top{ 6 | width: 100%; 7 | height: 300rpx; 8 | padding-top: 160rpx; 9 | box-sizing: border-box; 10 | font-size: 34rpx; 11 | font-weight: bold; 12 | text-align: center; 13 | } 14 | .business-con-title{ 15 | width: 100%; 16 | box-sizing: border-box; 17 | height: 88rpx; 18 | line-height: 88rpx; 19 | padding: 0 30rpx; 20 | } 21 | .business-con-title text{ 22 | width: 140rpx; 23 | display: inline-block; 24 | } 25 | -------------------------------------------------------------------------------- /pages/category/category.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by 丸子 on 2018-03-31. 3 | */ 4 | const {relativeurl} = require('../../util') 5 | 6 | Page({ 7 | data: { 8 | date: true, 9 | price: null 10 | }, 11 | toggleListActive(event){ 12 | const vm = this 13 | const {type} = event.currentTarget.dataset 14 | if (type == "date") { 15 | vm.setData({ 16 | price: null, 17 | date: !vm.data.date 18 | }) 19 | } else if (type == "price") { 20 | vm.setData({ 21 | date: null, 22 | price: !vm.data.price 23 | }) 24 | } 25 | vm._index_curPage = 1 26 | vm._index_loaded=false 27 | vm.requestSearch() 28 | }, 29 | toggleListStyle(){ 30 | var vm = this 31 | vm.setData({ 32 | isList: !vm.data.isList 33 | }) 34 | }, 35 | requestSearch() { 36 | var vm = this 37 | if (vm.data.loading || vm._index_loaded) { 38 | return 39 | } 40 | vm.setData({ 41 | loading: true 42 | }) 43 | vm._index_curPage = vm._index_curPage || 1 44 | const {date, price} = vm.data 45 | wx.request({ 46 | method: "GET", 47 | url: relativeurl + 'api/wxapp/search', 48 | dataType: 'json', 49 | data: { 50 | sort: { 51 | createTime: date, 52 | averagePrice: price 53 | }, 54 | categoryId: vm.data.id, 55 | page: vm._index_curPage, 56 | limit: 10 57 | }, 58 | header: {}, 59 | success(res) { 60 | if (res.statusCode == 200) { 61 | const {docs, page, pages} = res.data.data 62 | const goodsList = (vm.data.goodsList || []).concat(docs) 63 | if (page >= pages) { 64 | vm._index_loaded = true 65 | vm.setData({ 66 | loaded: true 67 | }) 68 | } 69 | vm.setData({goodsList}) 70 | vm._index_curPage++ 71 | } else { 72 | wx.showModal({ 73 | title: '提示', 74 | content: '请求出错', 75 | showCancel: false, 76 | success: function (res) { 77 | if (res.confirm) { 78 | } 79 | } 80 | }) 81 | } 82 | }, 83 | fail() { 84 | wx.showModal({ 85 | title: '提示', 86 | content: '请求出错', 87 | showCancel: false, 88 | success: function (res) { 89 | if (res.confirm) { 90 | } 91 | } 92 | }) 93 | }, 94 | complete() { 95 | vm.setData({ 96 | loading: false 97 | }) 98 | }, 99 | }) 100 | }, 101 | onShareAppMessage(res) { 102 | const vm = this 103 | return { 104 | title: '蒲悦地产', 105 | path: '/pages/index/index', 106 | form: 'menu', 107 | success: function (res) { 108 | // 转发成功 109 | }, 110 | fail: function (res) { 111 | // 转发失败 112 | } 113 | } 114 | }, 115 | onLoad(param) { 116 | var vm = this 117 | vm.setData({ 118 | id: param.id 119 | }) 120 | vm.requestSearch() 121 | } 122 | }) 123 | -------------------------------------------------------------------------------- /pages/category/category.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 日期 4 | 5 | 6 | 7 | 价格 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | {{item.name}} 20 | {{item.mark}} 21 | 22 | 均价¥ {{item.averagePrice}} 23 | 24 | 25 | 26 | 27 | 正在加载... 28 | 没有更多数据了... 29 | 30 | -------------------------------------------------------------------------------- /pages/category/category.wxss: -------------------------------------------------------------------------------- 1 | .goods-title{ 2 | height: 80rpx; 3 | line-height: 80rpx; 4 | width: 750rpx; 5 | position: fixed; 6 | top: 0; 7 | left: 0; 8 | background-color: #fff; 9 | z-index: 999; 10 | } 11 | .goods-title .toggle-list{ 12 | display: inline-block; 13 | width: 33.333%; 14 | text-align: center; 15 | font-size: 30rpx; 16 | height: 80rpx; 17 | line-height: 80rpx; 18 | position: relative; 19 | } 20 | .iconfont-list{ 21 | display: inline-block; 22 | width: 33.333%; 23 | text-align: center; 24 | height: 80rpx; 25 | line-height: 80rpx; 26 | } 27 | .goods-title .toggle-list .iconfont{ 28 | font-size: 24rpx; 29 | position: absolute; 30 | top:-8rpx; 31 | right: 56rpx; 32 | } 33 | .goods-title .toggle-list .iconfont{ 34 | color: #333; 35 | } 36 | .goods-title .toggle-list.up, .goods-title .toggle-list.up .icon-zhcc_xiangshangjiantou:before{ 37 | color:red; 38 | } 39 | .goods-title .toggle-list.down, .goods-title .toggle-list.down .icon-zhcc_xiangxiajiantou:before{ 40 | color:red; 41 | } 42 | .icon-listview:before { 43 | content:"\e67b"; 44 | font-size: 36rpx; 45 | color: #000; 46 | font-weight: bold; 47 | } 48 | 49 | .icon-grid2:before { 50 | content: "\e624"; 51 | color: #000; 52 | font-size: 34rpx; 53 | } 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /pages/favorite/favorite.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const {relativeurl} = require('../../util') 4 | const {getToken} = require('../../login') 5 | const app = getApp() 6 | Page({ 7 | data: { 8 | currPage: 1,//页码 9 | totalPage: 5,// 总页码 10 | }, 11 | tapName: function (event) { 12 | }, 13 | requestDataList: function () { 14 | var vm = this 15 | //如果全局变量loading(该方法是否执行完毕) 或者是这个方法内的变量_index_loaded(是否最后一页)任意一个不为true的话,直接跳出该方法 16 | if (vm.data.loading || vm._index_loaded) { 17 | return 18 | } 19 | //赋值全部变量的loading为true 20 | vm.setData({ 21 | loading: true 22 | }) 23 | //当前页码值默认为1 24 | vm._index_curPage = vm._index_curPage || 1 25 | wx.request({ 26 | method: "GET", 27 | url: relativeurl + 'api/wxapp/favorite', 28 | dataType: 'json', 29 | header: { 30 | 'Authorization': 'JWT ' + getToken() 31 | }, 32 | data: { 33 | page: vm._index_curPage, 34 | limit: 10 35 | }, 36 | success(res) { 37 | if (res.statusCode == 200) { 38 | const {docs, page, pages} = res.data.data 39 | const dataList = (vm.data.dataList || []).concat(docs) 40 | if (page >= pages) { 41 | vm._index_loaded = true 42 | vm.setData({ 43 | loaded: true 44 | }) 45 | } 46 | vm.setData({dataList}) 47 | vm._index_curPage++ 48 | } else { 49 | wx.showModal({ 50 | title: '提示', 51 | content: '请求出错', 52 | showCancel: false, 53 | success: function (res) { 54 | if (res.confirm) { 55 | } 56 | } 57 | }) 58 | } 59 | }, 60 | fail() { 61 | wx.showModal({ 62 | title: '提示', 63 | content: '请求出错', 64 | showCancel: false, 65 | success: function (res) { 66 | if (res.confirm) { 67 | } 68 | } 69 | }) 70 | }, 71 | complete() { 72 | vm.setData({ 73 | loading: false 74 | }) 75 | } 76 | }) 77 | }, 78 | 79 | onLoad: function () { 80 | this.requestDataList() 81 | }, 82 | }) 83 | -------------------------------------------------------------------------------- /pages/favorite/favorite.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "我的收藏" 3 | } -------------------------------------------------------------------------------- /pages/favorite/favorite.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | {{item.house.name}} 11 | {{item.house.mark}} 12 | 13 | 均价¥ {{item.house.averagePrice}} 14 | 15 | 16 | 17 | 18 | 正在加载... 19 | 没有更多数据了... 20 | 21 | -------------------------------------------------------------------------------- /pages/favorite/favorite.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Meatball-o/pydc-wx_wxapp/0e204d330726798c533521f20a5f7518f800f37e/pages/favorite/favorite.wxss -------------------------------------------------------------------------------- /pages/feedback/feedback.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | const {getToken} = require("../../login.js") 3 | //获取应用实例 4 | const {relativeurl} = require('../../util') 5 | 6 | var app = getApp() 7 | Page({ 8 | data: { 9 | con: '', 10 | wx:'', 11 | email:'' 12 | }, 13 | onLoad: function () { 14 | }, 15 | //事件 16 | bindInputCon(event) { 17 | var vm=this 18 | setTimeout(function () { 19 | vm.setData({ 20 | con:event.detail.value 21 | }) 22 | }) 23 | }, 24 | bindInputEmail(event) { 25 | var vm=this 26 | setTimeout(function () { 27 | vm.setData({ 28 | email:event.detail.value 29 | }) 30 | }) 31 | }, 32 | bindInputWx(event) { 33 | var vm=this 34 | setTimeout(function () { 35 | vm.setData({ 36 | wx:event.detail.value 37 | }) 38 | }) 39 | }, 40 | submitFeedback() { 41 | var vm = this 42 | wx.showLoading({ 43 | title: '加载中', 44 | }) 45 | wx.request({ 46 | method: "GET", 47 | url: relativeurl + 'api/wxapp/feedback', 48 | dataType: 'json', 49 | data: { 50 | con:vm.data.con, 51 | wx:vm.data.wx, 52 | email:vm.data.email, 53 | }, 54 | header: { 55 | 'Authorization': 'JWT ' + getToken() 56 | }, 57 | success(res) { 58 | const {success,msg}=res.data 59 | if(success){ 60 | wx.showModal({ 61 | title: '提示', 62 | cancelText:'回首页', 63 | content: '反馈成功,感谢您的反馈!', 64 | success: function(res) { 65 | if (res.confirm) { 66 | console.log('用户点击确定') 67 | } else if (res.cancel) { 68 | wx.navigateBack({ 69 | delta: 2 70 | }) 71 | } 72 | } 73 | }) 74 | }else{ 75 | wx.showModal({ 76 | title: '提示', 77 | content: msg||'请求出错', 78 | showCancel: false, 79 | success: function (res) { 80 | if (res.confirm) { 81 | } 82 | } 83 | }) 84 | } 85 | }, 86 | complete(){ 87 | wx.hideLoading() 88 | } 89 | }) 90 | }, 91 | }) -------------------------------------------------------------------------------- /pages/feedback/feedback.json: -------------------------------------------------------------------------------- 1 | { 2 | "navigationBarTitleText": "关于商家" 3 | } -------------------------------------------------------------------------------- /pages/feedback/feedback.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |