index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <div class="pay-pages">
  3. <div class="pay-bos">
  4. <div class="create-title flex-row-start">
  5. <el-icon color="#101828" size="16"><Document /></el-icon>
  6. <div style="margin-left: 6px">支付订单</div>
  7. </div>
  8. <div class="pay-bos flex-column-between">
  9. <div class="pay-box flex-column-center">
  10. <img src="@/assets/images/pay/pay1.png" alt="" />
  11. <div class="pay-text1">订单提交成功!请尽快完成支付。</div>
  12. <div class="pay-text2">请在2小时0分内完成支付,超时后将取消订单</div>
  13. </div>
  14. <div class="pay-bnt flex-row-center">
  15. <span class="bnt1">应付总额:</span>
  16. <span class="bnt2">¥{{ totalAmount }}</span>
  17. </div>
  18. </div>
  19. <div class="pay-head1">选择支付方式</div>
  20. <div class="pay-for">
  21. <div v-for="(item, index) in payList" :key="index" class="pay-list flex-row-center" :class="index == 0 ? 'hig' : ''">
  22. <img v-if="index == 0" src="@/assets/images/pay/pay2.png" alt="" />
  23. <img v-if="index == 1" src="@/assets/images/pay/pay3.png" alt="" />
  24. <img v-if="index == 2" src="@/assets/images/pay/pay4.png" alt="" />
  25. <img v-if="index == 3" src="@/assets/images/pay/pay5.png" alt="" />
  26. <div>{{ item.title }}</div>
  27. </div>
  28. </div>
  29. <div class="pay-head2">选择“暂存订单”,订单将在我的订单中査看,您可以在我的订单中进行完成支付。</div>
  30. <div class="pay-for">
  31. <div class="pay-list flex-row-center">
  32. <img src="@/assets/images/pay/pay6.png" alt="" />
  33. <div>暂存订单</div>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="pay-foot">
  38. <div class="foot-bos">
  39. <el-button class="bnt1">返回购物车修改</el-button>
  40. <el-button class="bnt2" type="primary" @click="onSubmit">提交订单</el-button>
  41. </div>
  42. </div>
  43. </div>
  44. </template>
  45. <script setup lang="ts">
  46. import { onPath } from '@/utils/siteConfig';
  47. import { getOrderInfo, orderPay } from '@/api/pc/enterprise/order';
  48. const payList = ref<any>([{ title: '信用支付' }, { title: '支付宝支付' }, { title: '微信支付' }, { title: '货到付款' }]);
  49. const route = useRoute();
  50. const orderId = ref<any>(null);
  51. const totalAmount = ref<any>(0);
  52. onMounted(() => {
  53. orderId.value = route.query.id;
  54. getInfo();
  55. });
  56. const getInfo = () => {
  57. getOrderInfo(orderId.value).then((res) => {
  58. if (res.code == 200) {
  59. totalAmount.value = res.data.totalAmount;
  60. }
  61. console.log(res);
  62. });
  63. };
  64. const onSubmit = () => {
  65. orderPay({
  66. orderId: orderId.value,
  67. payType: 0
  68. }).then((res) => {
  69. if (res.code == 200) {
  70. onPath('/order/orderManage');
  71. }
  72. });
  73. };
  74. </script>
  75. <style lang="scss" scoped>
  76. .pay-pages {
  77. width: 100%;
  78. background-color: #ffffff;
  79. .pay-bos {
  80. width: 1200px;
  81. margin: 0 auto;
  82. .create-title {
  83. font-size: 16px;
  84. color: #101828;
  85. padding-top: 20px;
  86. }
  87. .pay-bos {
  88. width: 1200px;
  89. height: 230px;
  90. border: 1px solid #e5e7eb;
  91. margin-top: 30px;
  92. padding: 30px 0 20px 0;
  93. .pay-box {
  94. width: 1180px;
  95. border-bottom: 1px solid #dfe9f1;
  96. margin: 0 10px;
  97. padding-bottom: 20px;
  98. img {
  99. width: 27px;
  100. height: 27px;
  101. }
  102. .pay-text1 {
  103. font-weight: 600;
  104. font-size: 14px;
  105. color: #101828;
  106. margin: 8px 0;
  107. }
  108. .pay-text2 {
  109. font-weight: 400;
  110. font-size: 14px;
  111. color: #364153;
  112. }
  113. }
  114. .pay-bnt {
  115. width: 428px;
  116. height: 68px;
  117. background: #f2f3f5;
  118. border-radius: 10px 10px 10px 10px;
  119. margin: 0 auto;
  120. cursor: pointer;
  121. .bnt1 {
  122. font-weight: 400;
  123. font-size: 14px;
  124. color: #000000;
  125. }
  126. .bnt2 {
  127. font-weight: 600;
  128. font-size: 20px;
  129. color: #e7000b;
  130. }
  131. }
  132. }
  133. .pay-head1 {
  134. font-weight: 600;
  135. font-size: 16px;
  136. color: #101828;
  137. margin: 30px 0 20px 0;
  138. }
  139. .pay-for {
  140. display: flex;
  141. gap: 0 18px;
  142. .pay-list {
  143. width: 180px;
  144. height: 60px;
  145. border-radius: 10px;
  146. border: 1px solid #e5e7eb;
  147. font-size: 14px;
  148. color: #000000;
  149. cursor: pointer;
  150. &.hig {
  151. background: #ffe5e5;
  152. border: 1px solid #e7000b;
  153. }
  154. img {
  155. height: 18px;
  156. width: 18px;
  157. margin-right: 12px;
  158. }
  159. }
  160. }
  161. .pay-head2 {
  162. font-size: 13px;
  163. color: #364153;
  164. padding: 20px 0 12px 0;
  165. }
  166. }
  167. .pay-foot {
  168. width: 100%;
  169. height: 82px;
  170. background: #ffffff;
  171. box-shadow: 0px -2px 13px 0px rgba(0, 0, 0, 0.05);
  172. margin-top: 47px;
  173. .foot-bos {
  174. width: 1200px;
  175. margin: 0 auto;
  176. padding-top: 16px;
  177. .bnt1 {
  178. width: 198px;
  179. height: 50px;
  180. background: #f7f8fa;
  181. }
  182. .bnt2 {
  183. width: 156px;
  184. height: 50px;
  185. }
  186. }
  187. }
  188. }
  189. </style>