AI销管
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

80 lines
1.5 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. this.sendLog({houseId: id, houseName: name})
  33. uni.setStorageSync("buildingID", lopan);
  34. uni.setStorageSync("updatebuildingID", 'updatebuildingID');
  35. uni.navigateBack({
  36. delta:-1
  37. })
  38. },
  39. init(e){
  40. let data = {houseName:decodeURI(e)||''}
  41. uni.request({
  42. url: config.service.getUser,
  43. method: "GET",
  44. data,
  45. header: {
  46. 'content-type': 'application/json',
  47. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  48. },
  49. success: (res) => {
  50. this.list = res.data.data.houseList
  51. }
  52. })
  53. }
  54. },
  55. onLoad() {
  56. this.init("")
  57. }
  58. }
  59. </script>
  60. <style lang="scss" scoped>
  61. .selectBuilding {
  62. .searchStyle {
  63. padding: 20rpx;
  64. }
  65. .searchResultStyle {
  66. padding: 0 30rpx;
  67. .searchList{
  68. border-bottom: 1rpx solid #E0E0E0;
  69. padding: 30rpx 0;
  70. font-size: 30rpx;
  71. }
  72. }
  73. }
  74. </style>