index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <route lang="json5">
  2. {
  3. style: {
  4. navigationBarTitleText: '品质商城',
  5. navigationBarBackgroundColor: '#fff',
  6. },
  7. }
  8. </route>
  9. <script setup lang="ts">
  10. import TiltedButton from '@/components/tilted-button.vue'
  11. import Product from '../components/product.vue'
  12. import { shoppingBag } from '@designer-hub/assets/src/assets/svgs/index'
  13. import InvertedTrapezoidButton from '@/components/inverted-trapezoid-button.vue'
  14. import TrapeziumButton from '@/components/trapezium-button.vue'
  15. import { useRouter } from '../../../../core/utils/router'
  16. import { getProduct } from '../../../../core/libs/requests'
  17. const router = useRouter()
  18. const id = ref()
  19. // const data = ref(['https://via.placeholder.com/347x128'])
  20. const products = ref([{}, {}, {}])
  21. const show = ref(false)
  22. const a = ref(1)
  23. const { data, run: setData } = useRequest(() => getProduct(id.value))
  24. onLoad(async (query: { id: string }) => {
  25. id.value = query.id
  26. await setData()
  27. })
  28. </script>
  29. <template>
  30. <view class="flex-grow flex flex-col">
  31. <div class="aspect-[1.34/1] relative">
  32. <div class="absolute aspect-[1.26/1] top-0 w-full">
  33. <wd-img width="100%" height="100%" :src="data?.productCoverImgUrl" />
  34. </div>
  35. </div>
  36. <div class="relative flex-1 bg-white p-4 flex flex-col gap-4 rounded-tl-2xl rounded-tr-2xl">
  37. <div class="flex items-center gap-1">
  38. <div class="text-[#ef4343] text-[26px] font-normal font-['D-DIN Exp'] leading-normal">
  39. <!-- 1000 -->
  40. {{ data?.points }}
  41. </div>
  42. <div class="text-black/60 text-base font-normal font-['PingFang SC'] leading-[34px]">
  43. 积分
  44. </div>
  45. <div
  46. class="w-[66px] text-black/30 text-xs font-normal font-['PingFang SC'] line-through leading-normal"
  47. >
  48. <!-- ¥60 -->
  49. ¥{{ data?.productPrice }}
  50. </div>
  51. <div class="flex-1"></div>
  52. <div class="text-[#999999] text-xs font-normal font-['PingFang SC'] leading-[10.18px]">
  53. <!-- 已售5件 -->
  54. 已售{{ data?.exchangeCount || 0 }}件
  55. </div>
  56. </div>
  57. <div
  58. class="w-[90px] h-4 text-black text-xl font-normal font-['PingFang SC'] leading-[10.18px]"
  59. >
  60. <!-- 阿芙佳朵 -->
  61. {{ data?.prodcutName }}
  62. </div>
  63. <div class="h-0.25 bg-[#f6f6f6]"></div>
  64. <div class="text-black/90 text-base font-normal font-['PingFang SC'] leading-normal">
  65. 积分兑换说明:
  66. </div>
  67. <div
  68. class="w-[346px] h-[95px] text-black/40 text-xs font-normal font-['PingFang SC'] leading-[23px]"
  69. >
  70. · 不限制兑换个数
  71. <br />
  72. · 兑换后不支持退换货,如有问题可联系官方客户
  73. <br />
  74. · 规格:件
  75. <br />
  76. · 配送方式:到店自取
  77. </div>
  78. <div class="mx--4 h-2.5 bg-neutral-100"></div>
  79. <wd-divider>
  80. <div
  81. class="text-center text-black/40 text-xs font-normal font-['PingFang SC'] leading-normal"
  82. >
  83. 商品详情
  84. </div>
  85. </wd-divider>
  86. <wd-img width="100%" mode="widthFix" :src="data?.productDetailsImgUrl"></wd-img>
  87. </div>
  88. <div class="h-[63px] bg-white backdrop-blur-[20px] flex px-3.5 items-center justify-between">
  89. <div @click="show = true">
  90. <InvertedTrapezoidButton>
  91. <div
  92. class="w-20 h-[22px] text-black text-base font-normal font-['PingFang SC'] leading-tight"
  93. >
  94. 加入购物车
  95. </div>
  96. </InvertedTrapezoidButton>
  97. </div>
  98. <div class="" @click="show = true">
  99. <TrapeziumButton size="large">
  100. <div
  101. class="w-[49px] h-[22px] text-white text-base font-normal font-['PingFang SC'] leading-tight"
  102. >
  103. <div
  104. class="w-[65px] h-[22px] text-white text-base font-normal font-['PingFang SC'] leading-tight"
  105. >
  106. 立即兑换
  107. </div>
  108. </div>
  109. </TrapeziumButton>
  110. </div>
  111. </div>
  112. <wd-action-sheet v-model="show">
  113. <view class="px-7 py-11">
  114. <div class="flex gap-3 mb-13.5">
  115. <div class="w-[110px] h-[110px] bg-[#f6f6f6] rounded-2xl"></div>
  116. <div class="flex flex-col justify-between flex-1">
  117. <div class="text-black/40 text-base font-normal font-['PingFang SC'] leading-normal">
  118. 阿芙佳朵
  119. </div>
  120. <div class="flex items-center">
  121. <div class="text-[#ef4343] text-[22px] font-normal font-['D-DIN Exp'] leading-normal">
  122. 1000
  123. </div>
  124. <div class="text-black/40 text-sm font-normal font-['PingFang SC'] leading-[34px]">
  125. 积分
  126. </div>
  127. <div class="flex-1"></div>
  128. <wd-input-number v-model="a" />
  129. </div>
  130. </div>
  131. </div>
  132. <wd-button
  133. block
  134. :round="false"
  135. @click="router.push('/pages/home/mall/confirm-order/index')"
  136. >
  137. 确认
  138. </wd-button>
  139. </view>
  140. </wd-action-sheet>
  141. </view>
  142. </template>
  143. <style scoped lang="scss"></style>