index.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <div class="p-pay-result">
  3. <div
  4. v-if="$route.params.status === 'success' && info"
  5. class="pay-success ptc-inner"
  6. >
  7. <div class="alert">
  8. <i class="alert-icon icon-success"></i>
  9. <p class="alert-message">
  10. Your membership service is successfully purchased
  11. </p>
  12. </div>
  13. <div class="info">
  14. <p class="info-item">
  15. <span class="info-label">Version: </span>
  16. <span class="info-value">{{ info.product_name }}</span>
  17. </p>
  18. <p class="info-item">
  19. <span class="info-label">Duration: </span>
  20. <span class="info-value"
  21. >1 year ({{ info.start_time }}-{{ info.end_time }})</span
  22. >
  23. </p>
  24. <p class="info-item">
  25. <span class="info-label">Phone brand: </span>
  26. <span class="info-value">{{ info.phone_info.split(' ')[0] }}</span>
  27. </p>
  28. <p class="info-item">
  29. <span class="info-label">Phone model: </span>
  30. <span class="info-value">{{ phoneModel }}</span>
  31. </p>
  32. </div>
  33. <div class="button-group">
  34. <button
  35. v-if="!info.phone_imei"
  36. class="ptc-button"
  37. @click="$router.push(`/imei/bind?id=${$route.query.id}`)"
  38. >
  39. BIND IMEI
  40. </button>
  41. <button
  42. class="ptc-button ptc-button--stroke"
  43. @click="$router.push(`/order/${$route.query.id}`)"
  44. >
  45. CHECK ORDER
  46. </button>
  47. <button class="ptc-button ptc-button--stroke" @click="toHomePage">
  48. HOMEPAGE
  49. </button>
  50. </div>
  51. </div>
  52. <div
  53. v-else-if="$route.params.status === 'success'"
  54. class="pay-success ptc-inner"
  55. >
  56. <div class="alert">
  57. <i class="alert-icon icon-success"></i>
  58. <p class="alert-message">
  59. Payment Successful And Thank You For Joining PTC Care Plus
  60. </p>
  61. </div>
  62. <div class="button-group">
  63. <button
  64. class="ptc-button"
  65. @click="$router.push(`/imei/bind?id=${$route.query.id}`)"
  66. >
  67. BIND IMEI
  68. </button>
  69. <button class="ptc-button ptc-button--stroke" @click="toHomePage">
  70. HOMEPAGE
  71. </button>
  72. </div>
  73. <p class="tip">
  74. Your Login Details Has Sent To Your Email, Please Login to Bind IMEI and
  75. Start Enjoy PTC Care Plus
  76. </p>
  77. </div>
  78. <div v-else class="pay-fail ptc-inner">
  79. <div class="alert">
  80. <i class="alert-icon icon-warn"></i>
  81. <p class="alert-message">Your membership service purchase failed</p>
  82. </div>
  83. <!-- <p class="reason">Insufficient bank card balance</p> -->
  84. <div class="button-group">
  85. <button class="ptc-button" @click="customerService">
  86. CUSTOMER SERVICE
  87. </button>
  88. <button class="ptc-button ptc-button--stroke" @click="toHomePage">
  89. HOMEPAGE
  90. </button>
  91. </div>
  92. </div>
  93. </div>
  94. </template>
  95. <script>
  96. import { defineComponent } from 'vue'
  97. import { state, getCurrentOrder } from '@/store'
  98. export default defineComponent({
  99. name: 'PayResult',
  100. async beforeRouteEnter(to) {
  101. if (to.params.status === 'success' && state.userInfo) {
  102. await getCurrentOrder(to.query.id)
  103. }
  104. },
  105. computed: {
  106. info() {
  107. return state.currentOrder
  108. },
  109. phoneModel() {
  110. return (this.info.phone_info || '').split(' ').slice(1).join(' ')
  111. },
  112. },
  113. created() {
  114. state.bgWhite = true
  115. },
  116. methods: {
  117. toHomePage() {
  118. location.href = '/ptc/'
  119. },
  120. customerService() {
  121. Beacon('open')
  122. },
  123. },
  124. })
  125. </script>
  126. <style lang="scss">
  127. .p-pay-result {
  128. padding-left: 48px;
  129. padding-right: 48px;
  130. .icon-success {
  131. background-image: url(@img/success.png);
  132. }
  133. .icon-warn {
  134. background-image: url(@img/warn.png);
  135. }
  136. .alert {
  137. margin: 64px 0;
  138. &-icon {
  139. display: block;
  140. margin: auto;
  141. width: 96px;
  142. height: 96px;
  143. background-size: 100% 100%;
  144. }
  145. &-message {
  146. margin-top: 32px;
  147. text-align: center;
  148. line-height: 56px;
  149. font-size: 40px;
  150. font-weight: bold;
  151. color: #333;
  152. }
  153. }
  154. .info {
  155. margin: 64px 0;
  156. &-item {
  157. display: flex;
  158. line-height: 64px;
  159. font-size: 32px;
  160. color: #333;
  161. }
  162. &-label {
  163. margin-right: 12px;
  164. color: #999;
  165. }
  166. }
  167. .reason {
  168. margin: 64px 0;
  169. text-align: center;
  170. line-height: 64px;
  171. font-size: 32px;
  172. color: #333;
  173. }
  174. .ptc-button--stroke {
  175. margin: 36px 0 64px;
  176. }
  177. .tip {
  178. margin: 40px 0 64px;
  179. line-height: 40px;
  180. text-align: center;
  181. font-size: 28px;
  182. color: #505050;
  183. }
  184. }
  185. </style>