選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

paymentSucess.vue 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <view class="container">
  3. <image class='bg-image' mode="widthFix"
  4. src="https://qtzl.etcjz.cn/default-bucket/20240324/3eba2095f5204798a1f8101b_beijing.jpg"></image>
  5. <view class="content-re">
  6. <custom-header :back="false" title="下单"></custom-header>
  7. <view style="padding: 20rpx" class="content">
  8. <icon type="success" size="80" class="icon-sucess" color="#1AAC1B" />
  9. <view class="sucess-txt">下单成功</view>
  10. <button @click="handleFinish" class='nav-bg btn btn-text as-gravity-center' v-if='isShow'>办理完成</button>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script setup lang="ts">
  16. import CustomHeader from '@/components/CustomHeader.vue';
  17. import {
  18. handleToTypes,
  19. isWeb,
  20. handleToZhifubao,
  21. handleTonei
  22. } from '@/utils/utils';
  23. import { ref } from 'vue';
  24. import { unifyTemplate } from '@/hooks/unifyTemplate';
  25. import { onLoad } from '@dcloudio/uni-app';
  26. import { request } from '@/utils/network/request';
  27. const {
  28. initData, //初始化数据
  29. isShow,
  30. qdOrderVal //qdOrder中数据 ref
  31. } = unifyTemplate(); //初始化数据
  32. //获取页面配置
  33. onLoad((opin) => {
  34. initData(opin, 5).then(data => {
  35. if (data.qdOrder.returnUrl) {
  36. isShow.value = true
  37. }
  38. });
  39. });
  40. const handleOther = (returnUrl) => {
  41. const type = handleToTypes();
  42. if (type === 'alipaymini') {
  43. handleToZhifubao(returnUrl);
  44. } else if (type === 'wechatmini') {
  45. handleTonei(returnUrl);
  46. }
  47. };
  48. const handleFinish = () => {
  49. console.log(qdOrderVal.value, '获取的qdorder');
  50. const returnUrl = qdOrderVal.value.returnUrl || '';
  51. if (!returnUrl) {
  52. return;
  53. }
  54. if (isWeb(returnUrl)) {
  55. window.open(returnUrl, '_self');
  56. } else if (returnUrl.toLowerCase() === 'app') {
  57. console.log(Android.goBackToApp, '安卓跳转方法');
  58. Android.goBackToApp();
  59. } else {
  60. handleOther(returnUrl);
  61. }
  62. };
  63. </script>
  64. <style lang="scss" scoped>
  65. .content {
  66. display: flex;
  67. flex-direction: column;
  68. justify-content: center;
  69. align-items: center;
  70. }
  71. .sucess-txt {
  72. font-size: 30rpx;
  73. margin-top: 15px;
  74. color: #1aac1b;
  75. font-weight: bold;
  76. }
  77. .sig-manage {
  78. height: 100vh;
  79. width: 100%;
  80. display: flex;
  81. justify-content: center;
  82. align-items: center;
  83. }
  84. .btn {
  85. height: 80rpx;
  86. opacity: 1;
  87. border-radius: 100rpx;
  88. margin: 30rpx 20rpx 20rpx 20rpx;
  89. width: 250rpx;
  90. }
  91. .btn-text {
  92. color: #ffffff;
  93. font-size: 28rpx;
  94. }
  95. .nav-bg {
  96. /* background: linear-gradient(to right, #13E7C1, #43A1E0); */
  97. border: 1px solid #ffffff;
  98. background: #1aac1b;
  99. }
  100. </style>