AI销管
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

77 regels
1.4 KiB

  1. <template>
  2. <view class="selectBuilding">
  3. <view class="searchStyle">
  4. <u-search placeholder="输入楼盘名称" v-model="search" @search="s" @custom="s"></u-search>
  5. </view>
  6. <view class="searchResultStyle">
  7. <view class="searchList" v-for="(item,index) in list" :key="index" @click="okSelect(item.id,item.propertyName)">
  8. {{item.propertyName}}
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. var config = require("@/config");
  15. export default {
  16. name: "selectBuilding",
  17. data() {
  18. return {
  19. search: "",
  20. list: [],
  21. };
  22. },
  23. methods:{
  24. s(e){
  25. this.init(e)
  26. },
  27. okSelect(id,name){
  28. let lopan = {
  29. id,
  30. name
  31. }
  32. uni.setStorageSync("buildingID", lopan);
  33. uni.navigateBack({
  34. delta:-1
  35. })
  36. },
  37. init(e){
  38. let data = {houseName:decodeURI(e)||''}
  39. uni.request({
  40. url: config.service.getUser,
  41. method: "GET",
  42. data,
  43. header: {
  44. 'content-type': 'application/json',
  45. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  46. },
  47. success: (res) => {
  48. this.list = res.data.data.houseList
  49. }
  50. })
  51. }
  52. },
  53. onLoad() {
  54. this.init("")
  55. }
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .selectBuilding {
  60. .searchStyle {
  61. padding: 20rpx;
  62. }
  63. .searchResultStyle {
  64. padding: 0 30rpx;
  65. .searchList{
  66. border-bottom: 1rpx solid #E0E0E0;
  67. padding: 30rpx 0;
  68. font-size: 30rpx;
  69. }
  70. }
  71. }
  72. </style>