index.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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" @click="handleCancelOrder">取消订单</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. import { cancelOrder } from '@/api/pc/enterprise/order';
  75. const handleCancelOrder = () => {
  76. cancelOrder({ id: orderId.value, orderStatus: '7' }).then((res) => {
  77. if (res.code == 200) {
  78. onPath('/cart');
  79. }
  80. });
  81. };
  82. </script>
  83. <style lang="scss" scoped>
  84. .pay-pages {
  85. width: 100%;
  86. background-color: #ffffff;
  87. .pay-bos {
  88. width: 1200px;
  89. margin: 0 auto;
  90. .create-title {
  91. font-size: 16px;
  92. color: #101828;
  93. padding-top: 20px;
  94. }
  95. .pay-bos {
  96. width: 1200px;
  97. height: 230px;
  98. border: 1px solid #e5e7eb;
  99. margin-top: 30px;
  100. padding: 30px 0 20px 0;
  101. .pay-box {
  102. width: 1180px;
  103. border-bottom: 1px solid #dfe9f1;
  104. margin: 0 10px;
  105. padding-bottom: 20px;
  106. img {
  107. width: 27px;
  108. height: 27px;
  109. }
  110. .pay-text1 {
  111. font-weight: 600;
  112. font-size: 14px;
  113. color: #101828;
  114. margin: 8px 0;
  115. }
  116. .pay-text2 {
  117. font-weight: 400;
  118. font-size: 14px;
  119. color: #364153;
  120. }
  121. }
  122. .pay-bnt {
  123. width: 428px;
  124. height: 68px;
  125. background: #f2f3f5;
  126. border-radius: 10px 10px 10px 10px;
  127. margin: 0 auto;
  128. cursor: pointer;
  129. .bnt1 {
  130. font-weight: 400;
  131. font-size: 14px;
  132. color: #000000;
  133. }
  134. .bnt2 {
  135. font-weight: 600;
  136. font-size: 20px;
  137. color: #e7000b;
  138. }
  139. }
  140. }
  141. .pay-head1 {
  142. font-weight: 600;
  143. font-size: 16px;
  144. color: #101828;
  145. margin: 30px 0 20px 0;
  146. }
  147. .pay-for {
  148. display: flex;
  149. gap: 0 18px;
  150. .pay-list {
  151. width: 180px;
  152. height: 60px;
  153. border-radius: 10px;
  154. border: 1px solid #e5e7eb;
  155. font-size: 14px;
  156. color: #000000;
  157. cursor: pointer;
  158. &.hig {
  159. background: #ffe5e5;
  160. border: 1px solid #e7000b;
  161. }
  162. img {
  163. height: 18px;
  164. width: 18px;
  165. margin-right: 12px;
  166. }
  167. }
  168. }
  169. .pay-head2 {
  170. font-size: 13px;
  171. color: #364153;
  172. padding: 20px 0 12px 0;
  173. }
  174. }
  175. .pay-foot {
  176. width: 100%;
  177. height: 82px;
  178. background: #ffffff;
  179. box-shadow: 0px -2px 13px 0px rgba(0, 0, 0, 0.05);
  180. margin-top: 47px;
  181. .foot-bos {
  182. width: 1200px;
  183. margin: 0 auto;
  184. padding-top: 16px;
  185. .bnt1 {
  186. width: 198px;
  187. height: 50px;
  188. background: #f7f8fa;
  189. }
  190. .bnt2 {
  191. width: 156px;
  192. height: 50px;
  193. }
  194. }
  195. }
  196. }
  197. </style>