detail.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <ay-container :cusStyle="{ padding: 0 }">
  3. <swiper
  4. class="swiper nmb-spac"
  5. circular
  6. :indicator-dots="pics.length > 1"
  7. :autoplay="true"
  8. :interval="3000"
  9. >
  10. <swiper-item v-for="(p, i) in pics" :key="i">
  11. <image mode="aspectFill" :src="p.picPath" />
  12. </swiper-item>
  13. </swiper>
  14. <div class="infos">
  15. <div class="font-bold b-fz mb-spac">
  16. {{ func.convert.nullView(data.detail.gasstationName) }}
  17. </div>
  18. <div class="center justify-between mb-spac">
  19. <div class="flex-1">
  20. <div class="center justify-start mb-spacd2">
  21. <uni-icons type="location-filled" size="16" class="mr-spacd4" />
  22. {{ func.convert.nullView(stationInfo.distance) }}km |
  23. {{ func.convert.nullView(data.detail.address) }}
  24. </div>
  25. <ayb-phone :phone="data.detail.mobile" :center="false"></ayb-phone>
  26. </div>
  27. <div
  28. class="text-center p-color"
  29. :class="{ 'gray-color': !stationInfo.longitude }"
  30. @click="methods.openLocation"
  31. >
  32. <uni-icons type="paperplane-filled" color="" size="24" />
  33. <div>导航</div>
  34. </div>
  35. </div>
  36. <div class="chunk childs-fcjb-mbd2">
  37. <div>
  38. <div class="font-bold bs-fz">今日平台价</div>
  39. <div class="gray-color">价格仅供参考,以当天实际为准</div>
  40. </div>
  41. <div class="mt-spac">
  42. <div class="lng bs-fz">LNG</div>
  43. <div>
  44. <span class="font-bold mr-spacd2 price-color bs-fz">
  45. {{ stationInfo.actualPrice }}
  46. </span>
  47. <span class="s-fz price">元/公斤</span>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="chunk">
  52. <div class="font-bold bs-fz mb-spacd2">简介</div>
  53. <div class="">{{ func.convert.nullView(data.detail.introduce) }}</div>
  54. </div>
  55. <div class="chunk childs-fcjb-mbd2">
  56. <div>
  57. <span>加注机数量</span>
  58. <div>{{ func.convert.nullView(data.detail.fillingMachineNum) }}</div>
  59. </div>
  60. <div>
  61. <span>收银员数量</span>
  62. <div>{{ func.convert.nullView(data.detail.cashierNum) }}</div>
  63. </div>
  64. </div>
  65. </div>
  66. </ay-container>
  67. </template>
  68. <script lang="ts" setup>
  69. import defstation from '@img/defstation.png'
  70. const data = reactive({
  71. detail: {} as DerIStationDetail,
  72. stationInfo: null as GasstationVO对象,
  73. })
  74. const methods = {
  75. openLocation() {
  76. func.native.openLocation({
  77. latitude: Number(stationInfo.value.latitude),
  78. longitude: Number(stationInfo.value.longitude),
  79. name: stationInfo.value.nickName,
  80. address: stationInfo.value.address,
  81. })
  82. },
  83. }
  84. const params = computed(() => {
  85. return store.curPage.pageConfig.params as GasstationVO对象
  86. })
  87. const stationInfo = computed(() => {
  88. return data.stationInfo || params.value
  89. })
  90. const pics = computed(() => {
  91. let rv = []
  92. if (data.detail.orgPics?.length > 0) {
  93. rv = data.detail.orgPics.map((m) => {
  94. return {
  95. picPath: ay.getResourceUrl(m.picPath),
  96. }
  97. })
  98. } else {
  99. rv.push({ picPath: defstation })
  100. }
  101. return rv
  102. })
  103. ay.entrance(async (args) => {
  104. webapi.user.find_3({ gasstationId: params.value.gasstationId }).then((res) => {
  105. data.detail = res
  106. })
  107. if (!Object.hasOwn(params.value, 'distance')) {
  108. const location = await func.native.getLocation()
  109. data.stationInfo = await webapi.strategy.find_for_mini({
  110. gasstationId: params.value.gasstationId,
  111. longitude: location.longitude.toString(),
  112. latitude: location.latitude.toString(),
  113. })
  114. }
  115. })
  116. </script>
  117. <style lang="scss" scoped>
  118. .swiper {
  119. height: 488rpx;
  120. }
  121. ::v-deep .wx-swiper-dots-horizontal,
  122. ::v-deep .uni-swiper-dots-horizontal {
  123. margin-bottom: $p-spac;
  124. }
  125. .infos {
  126. position: relative;
  127. padding: $p-spac;
  128. background-color: $bg-color;
  129. border-radius: $p-spac;
  130. }
  131. .lng {
  132. padding: $p-spacd4 $p-spacd2;
  133. color: $p-recolor;
  134. background-color: #00c48c;
  135. border-radius: $p-spacd4;
  136. }
  137. </style>