StepOne.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <div class="step-1">
  3. <div class="ptc-block">
  4. <p class="ptc-label">Choose a version</p>
  5. <PtcRadioGroup v-model="state.product" style="display: flex">
  6. <PtcRadio class="version" value="lite">
  7. <i class="icon-lite"></i>
  8. <span class="mt18">Lite</span>
  9. </PtcRadio>
  10. <PtcRadio class="version" value="pro">
  11. <i class="icon-pro"></i>
  12. <span class="mt18">Pro</span>
  13. </PtcRadio>
  14. </PtcRadioGroup>
  15. <div class="version-desc" :class="{ pro: state.product === 'pro' }">
  16. Introduction of member products,Introduction of member products
  17. </div>
  18. </div>
  19. <div class="ptc-block">
  20. <p class="ptc-label">Choose a subscription method</p>
  21. <PtcRadioGroup v-model="state.type">
  22. <PtcRadio class="method" :value="1">
  23. <span class="cost">$99</span>
  24. <span class="name">Annual</span>
  25. <span class="ptc-tag">-25% OFF</span>
  26. </PtcRadio>
  27. <PtcRadio class="method" :value="2">
  28. <span class="cost">$12.5</span>
  29. <span class="name"> Monthly&nbsp; Activation fee $20</span>
  30. </PtcRadio>
  31. </PtcRadioGroup>
  32. </div>
  33. <div class="ptc-block">
  34. <p class="ptc-label">Do you have a discount code?</p>
  35. <div v-if="!showCoupon" class="input-wrap pr">
  36. <input
  37. v-model="state.couponCode"
  38. class="ptc-input"
  39. placeholder="Enter promotional code"
  40. />
  41. <button class="input-btn" @click="showCoupon = true">sbumit</button>
  42. </div>
  43. <div v-else class="coupon-wrap">
  44. <div class="coupon">
  45. <p class="p1">PTC CARE PLUS</p>
  46. <p class="p2">NEWCOMER DISCOUNT</p>
  47. <p class="p3">- $10</p>
  48. </div>
  49. <div class="action">
  50. <span class="code">87889122</span>
  51. <span class="ptc-text" @click="showCoupon = false">Revise</span>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="total">
  56. <p>total<strong>$99</strong></p>
  57. <p class="highlight">($10 discounted)</p>
  58. </div>
  59. <div class="ptc-wrap">
  60. <button class="ptc-button" @click="$emit('next')">NEXT</button>
  61. </div>
  62. </div>
  63. </template>
  64. <script setup lang="ts">
  65. import { ref } from 'vue'
  66. import { PtcRadioGroup, PtcRadio } from '@/components/radio'
  67. import { state } from './store'
  68. defineEmits<{
  69. (e: 'next'): void
  70. }>()
  71. const showCoupon = ref(false)
  72. </script>
  73. <style lang="scss" scoped>
  74. .version {
  75. display: flex;
  76. flex-direction: column;
  77. justify-content: center;
  78. align-items: center;
  79. margin-right: 64px;
  80. width: 212px;
  81. height: 212px;
  82. font-size: 56px;
  83. font-weight: bold;
  84. .mt18 {
  85. margin-top: 18px;
  86. }
  87. &-desc {
  88. position: relative;
  89. margin-top: 32px;
  90. padding: 28px 24px;
  91. line-height: 40px;
  92. font-size: 28px;
  93. color: #193059;
  94. background: #f2f5fb;
  95. &::before {
  96. content: '';
  97. position: absolute;
  98. left: 88px;
  99. top: 0;
  100. transform: translateY(-100%);
  101. border-style: solid;
  102. border-width: 0 12px 14px;
  103. border-color: #f2f5fb transparent;
  104. }
  105. &.pro::before {
  106. left: 88px + 276px;
  107. }
  108. }
  109. }
  110. .method {
  111. display: flex;
  112. align-items: center;
  113. padding: 0 38px;
  114. height: 130px;
  115. + .method {
  116. margin-top: 48px;
  117. }
  118. .cost {
  119. font-size: 56px;
  120. font-weight: bold;
  121. }
  122. .name {
  123. margin-left: 20px;
  124. font-size: 32px;
  125. }
  126. }
  127. .ptc-input {
  128. padding-right: 154px;
  129. }
  130. .input-btn {
  131. position: absolute;
  132. top: 0;
  133. right: 0;
  134. height: 100%;
  135. width: 154px;
  136. background: #1a3059;
  137. border-radius: 0px 8px 8px 0px;
  138. color: #fff;
  139. font-size: 32px;
  140. &:active {
  141. background: $primary-color-lighten;
  142. }
  143. }
  144. .total {
  145. margin-bottom: 48px;
  146. padding-left: 36px;
  147. font-size: 32px;
  148. color: #333;
  149. strong {
  150. margin-left: 8px;
  151. font-size: 40px;
  152. }
  153. }
  154. .coupon {
  155. @include icon('@img/coupon-s.png', 488px, 224px);
  156. margin-bottom: 48px;
  157. padding-top: 22px;
  158. text-align: center;
  159. font-size: 28px;
  160. font-weight: bold;
  161. .p1 {
  162. color: #9aa8c5;
  163. }
  164. .p2 {
  165. margin: 16px 0 34px;
  166. color: $primary-color;
  167. }
  168. .p3 {
  169. font-size: 56px;
  170. color: $primary-color;
  171. }
  172. }
  173. .action {
  174. font-size: 32px;
  175. color: #666;
  176. .code {
  177. margin-right: 64px;
  178. }
  179. }
  180. .highlight {
  181. margin-top: 4px;
  182. color: $danger-color;
  183. }
  184. </style>