mechanism.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view class="bg-white">
  3. <picker class="" @change="PickerChange" mode="multiSelector" range-key="name" :value="index" :range="options1">
  4. <view class="text-xl">
  5. {{picker[index].name}}
  6. <text class="cuIcon-unfold lg text-gray margin-left-xs"></text>
  7. </view>
  8. </picker>
  9. <view class="margin-sm">
  10. <view v-for="(item,index) in mechanismList" :key="index" @click="xuanzephone(item)" class="padding bg-white margin-top-sm flex justify-between align-center"
  11. style="border-radius: 16rpx;box-shadow: 0 0 50rpx 0 rgba(0, 0, 0, 0.1);">
  12. <view class="">
  13. <view class="text-bold" style="color: #333333;font-size: 30rpx;">
  14. {{item.name}}
  15. </view>
  16. <view class="margin-top-sm" style="color: #999999; font-size: 26rpx;">
  17. 地址:<text style="color: #666666;">{{item.address}}</text>
  18. </view>
  19. <view class="margin-top-sm" style="color: #999999; font-size: 26rpx;">
  20. 距离:<text style="color: #666666;">{{parseInt(item.distance/1000)}}km</text>
  21. </view>
  22. </view>
  23. <view class="">
  24. <u-radio-group v-model="value">
  25. <u-radio @change="radioChange" :key="index" :name="item.id">
  26. </u-radio>
  27. </u-radio-group>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="cu-tabbar-height"></view>
  32. <view class="cu-tabbar-height"></view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. onLoad() {
  38. },
  39. onShow() {
  40. },
  41. mounted() {
  42. this.getMechanismList()
  43. this.getareaList()
  44. },
  45. data() {
  46. return {
  47. value: "",
  48. value1: 1,
  49. mechanismList: [],
  50. options1: [],
  51. pageindex: 1
  52. }
  53. },
  54. methods: {
  55. xuanzephone(item) {
  56. this.value = item.id
  57. },
  58. PickerChange(value) {
  59. this.value1 = value
  60. },
  61. getMechanismList: async function() {
  62. let res = await this.$request.post("/api/v1/organization/organizationList", {
  63. page: this.pageindex,
  64. latitude: uni.getStorageSync('latitude'),
  65. longitude: uni.getStorageSync('longitude')
  66. })
  67. console.log(res)
  68. if (res.status == 0) {
  69. this.mechanismList = res.data.data
  70. }
  71. },
  72. getareaList: async function() {
  73. let res = await this.$request.post("/api/v1/common/areaList")
  74. console.log(res)
  75. if (res.status == 0) {
  76. this.options1 = res.data
  77. }
  78. }
  79. }
  80. }
  81. </script>
  82. <style lang="scss">
  83. page{
  84. background-color: #fff;
  85. }
  86. .main {}
  87. </style>