mechanism.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view class="bg-white">
  3. <picker class="" @change="PickerChange" 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. if (res.status == 0) {
  68. this.mechanismList = res.data.data
  69. }
  70. },
  71. getareaList: async function() {
  72. let res = await this.$request.post("/api/v1/common/areaList")
  73. console.log(res)
  74. if (res.status == 0) {
  75. this.options1 = res.data
  76. }
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. .main {}
  83. </style>