AI销管
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

selectBuilding.vue 1.5 KiB

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