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.
 
 
 
 

97 lignes
1.9 KiB

  1. <template>
  2. <view class="selectBuilding">
  3. <view class="searchStyle">
  4. <u-search placeholder="输入楼盘名称" v-model="search" :show-action="false"></u-search>
  5. </view>
  6. <view class="searchResultStyle">
  7. <u-radio-group v-model="result" @change="radioGroupChange">
  8. <u-radio v-for="(item, index) in list" :key="index" :name="item.id+'-'+item.propertyName" label-size="34">
  9. {{item.propertyName}}
  10. </u-radio>
  11. </u-radio-group>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. var config = require("@/config");
  17. export default {
  18. name: "selectBuilding",
  19. data() {
  20. return {
  21. search: "",
  22. list: [],
  23. result: ""
  24. };
  25. },
  26. watch:{
  27. search(newState){
  28. this.init(newState)
  29. }
  30. },
  31. methods:{
  32. radioGroupChange(e){
  33. console.log()
  34. let lopan = {
  35. id: e.split('-')[0],
  36. name: e.split('-')[1]
  37. }
  38. uni.setStorageSync("buildingID", lopan);
  39. uni.navigateBack({
  40. delta:-1
  41. })
  42. },
  43. init(e){
  44. let data = {houseName:decodeURI(e)||''}
  45. uni.request({
  46. url: config.service.getUser,
  47. method: "GET",
  48. data,
  49. header: {
  50. 'content-type': 'application/json',
  51. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  52. },
  53. success: (res) => {
  54. this.list = res.data.data.houseList
  55. }
  56. })
  57. }
  58. },
  59. onLoad() {
  60. this.init("")
  61. }
  62. }
  63. </script>
  64. <style lang="scss" scoped>
  65. .selectBuilding {
  66. background: #dedede;
  67. .searchStyle {
  68. padding: 20rpx;
  69. }
  70. .searchResultStyle {
  71. /deep/ .u-radio-group {
  72. display: flex;
  73. flex-direction: column;
  74. }
  75. /deep/ .u-radio {
  76. display: flex;
  77. flex-direction: row-reverse;
  78. width: 100% !important;
  79. justify-content: space-between;
  80. background: #fff;
  81. box-shadow: 0px 4px 5px 3px #ccc;
  82. margin: 15rpx 0;
  83. padding: 20rpx;
  84. }
  85. /deep/ .u-radio__label {
  86. width: 100%;
  87. }
  88. }
  89. }
  90. </style>