index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <script setup lang="ts">
  2. import type { CouponInfoAppVo, GasStationDetailVO } from '@/api/globals'
  3. import router from '@/router'
  4. definePage({ name: 'refuelDetaile', islogin: false, style: { navigationBarTitleText: '加油站详情', navigationStyle: 'custom' } })
  5. const StaticUrl = import.meta.env.VITE_STATIC_BASE_URL
  6. const showModel = ref(false)
  7. const storeDetail = ref<GasStationDetailVO>()
  8. const dklist = ref<CouponInfoAppVo[]>([])
  9. const clickItem = ref<CouponInfoAppVo>()
  10. onLoad(async (options: any) => {
  11. await getData(options.id)
  12. })
  13. async function getData(storeId: string) {
  14. const res = await Apis.general.post_smqjh_pms_app_api_v1_product_oil_querystoredetail({ data: { storeId, lat: useUserStore().lat, lon: useUserStore().lng } })
  15. storeDetail.value = res.data
  16. const { data } = await Apis.app.get_smqjh_system_app_api_coupon_findlist()
  17. dklist.value = data || []
  18. }
  19. function handleShowMap() {
  20. console.log('show map')
  21. uni.openLocation({
  22. latitude: useUserStore().lat,
  23. longitude: useUserStore().lng,
  24. success() {
  25. console.log('success')
  26. },
  27. })
  28. }
  29. function handleExchange(item: CouponInfoAppVo) {
  30. console.log('exchange', item)
  31. if (item.receiveSign)
  32. return
  33. if ((Number(item.inventoryActual)) === 0)
  34. return
  35. clickItem.value = item
  36. showModel.value = true
  37. }
  38. function handleKf() {
  39. useUserStore().handleCommonWx('pages/my/index', '')
  40. }
  41. </script>
  42. <template>
  43. <template v-if="storeDetail">
  44. <view class="p24rpx">
  45. <view class="h336rpx">
  46. <wd-swiper :list="storeDetail.storePicList" height="336rpx" />
  47. </view>
  48. <view class="mt20rpx h160rpx flex items-center justify-between rounded-16rpx bg-white bg-cover bg-center px24rpx" :style="{ backgroundImage: `url(${StaticUrl}/djk-shop-nav-bg.png)` }">
  49. <view>
  50. <view class="flex items-center text-36rpx font-semibold">
  51. {{ storeDetail.storeName }}
  52. </view>
  53. <view class="mt20rpx text-#aaa">
  54. {{ storeDetail.address }}
  55. </view>
  56. </view>
  57. <view class="flex flex-shrink-0 items-center">
  58. <view class="mr40rpx flex flex-col items-center justify-center" @click="handleShowMap">
  59. <image
  60. :src="`${StaticUrl}/djk-shop-dh.png`"
  61. class="h40rpx w40rpx"
  62. />
  63. <view class="mt20rpx text-28rpx">
  64. 导航
  65. </view>
  66. </view>
  67. <view class="flex flex-col items-center justify-center" @click="handleKf">
  68. <image
  69. :src="`${StaticUrl}/smqjh-jy-kf.png`"
  70. class="h40rpx w40rpx"
  71. />
  72. <view class="mt20rpx text-28rpx">
  73. 客服
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. <view v-if="dklist" class="mt20rpx rounded-16rpx bg-white px24rpx py28rpx">
  79. <view class="flex items-center">
  80. <template v-if="!storeDetail.allowanceClientScheme">
  81. <wd-icon name="check-circle-filled" size="22px" color="#52C41A" />
  82. <view class="ml20rpx text-28rpx font-semibold">
  83. 本站可用抵扣券
  84. </view>
  85. </template>
  86. <template v-else>
  87. <wd-icon name="close-circle-filled" size="22px" color="#FF4D3A" />
  88. <view class="ml20rpx text-28rpx font-semibold">
  89. 本站暂无抵扣券
  90. </view>
  91. </template>
  92. </view>
  93. <view v-if="!storeDetail.allowanceClientScheme" class="mt24rpx flex overflow-x-scroll">
  94. <view v-for="item in dklist" :key="item.id" :class="[Number(item.inventoryActual) === 0 || item.receiveSign ? 'bg-#F0F0F0' : 'jf-box']" class="mr16rpx flex-shrink-0 rounded-16rpx p20rpx">
  95. <view class="text-center text-36rpx font-semibold" :class="[Number(item.inventoryActual) === 0 || item.receiveSign ? 'text-#aaa' : 'text-#FF4D3A']">
  96. <text class="text-20rpx">
  97. </text> {{ item.discountMoney }}
  98. </view>
  99. <view class="my8rpx text-center" :class="[Number(item.inventoryActual) === 0 || item.receiveSign ? 'text-#aaa' : '']">
  100. {{ item.amountMoney && item.amountMoney > 0 ? `满${item.amountMoney}减${item.discountMoney}` : `无门槛使用` }}
  101. </view>
  102. <view class="rounded-26rpx px24rpx py6rpx text-center" :class="[Number(item.inventoryActual) === 0 || item.receiveSign ? 'bg-#E6E6E6 text-#aaa' : 'bg-#FF4A39 text-white']" @click="handleExchange(item)">
  103. {{ !item.receiveSign ? Number(item.inventoryActual) === 0 ? '已兑完' : '积分兑换' : '已兑换' }}
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. <view v-for="item in storeDetail.itemInfoList" :key="item.itemId" class="mt20rpx rounded-16rpx bg-white px24rpx py28rpx">
  109. <view class="flex items-center justify-between">
  110. <view class="text-32rpx font-semibold">
  111. {{ item.itemName }}
  112. </view>
  113. <view class="text-36rpx text-#FF4D3A">
  114. <text class="text-20rpx">
  115. 平台价:
  116. </text> ¥{{ item.vipPriceShow }}/L
  117. </view>
  118. </view>
  119. <view class="text-end text-#aaa">
  120. 国标价:¥{{ item.cityPriceShow }}/L 门店价:¥{{ item.storePriceShow }}L
  121. </view>
  122. <!-- <view class="mt18rpx text-#aaa">
  123. (加油满200原可享前10升优惠价格)
  124. </view> -->
  125. <view class="mt20rpx">
  126. 枪号:{{ item.gunNos?.join(', ') }}
  127. </view>
  128. </view>
  129. <view class="h200rpx" />
  130. </view>
  131. <FixedLayout>
  132. <wd-button block size="large" @click="router.push({ name: 'confimOrder', params: { storeId: String(storeDetail.storeId) } })">
  133. 立即加油
  134. </wd-button>
  135. </FixedLayout>
  136. <IntegralPopup v-model="showModel" :coupon-id="String(clickItem?.id)" />
  137. </template>
  138. </template>
  139. <style lang="scss" scoped>
  140. .jf-box{
  141. background: linear-gradient( 180deg, #FFC2BC 0%, rgba(255,238,238,0.16) 57.27%, #FFEFEF 100%);
  142. }
  143. </style>