successModel.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <Popup ref="popRef" mode="center" closeOnClickOverlay>
  3. <template #content>
  4. <view class="content">
  5. <view class="content_success">
  6. <image src="/static/shop/success.png" class="img"></image>
  7. <trans _t="支付成功"></trans>
  8. </view>
  9. </view>
  10. </template>
  11. <template #footer>
  12. <slot name="footer">
  13. <view class="footer">
  14. <view class="submit_btn submit_shop" @click="toShop">
  15. <trans _t="继续购物" />
  16. </view>
  17. <view class="submit_btn" @click="seeOrder">
  18. <trans _t="查看订单" />
  19. </view>
  20. </view>
  21. </slot>
  22. </template>
  23. </Popup>
  24. </template>
  25. <script setup>
  26. import { ref } from "vue";
  27. import Popup from "@/components/popup.vue";
  28. import { t } from "@/locale";
  29. import { useTabbarStore } from "@/store";
  30. const useTabbar = useTabbarStore();
  31. const popRef = ref(null);
  32. const emit = defineEmits(["complete", "close", "open"]);
  33. const open = () => {
  34. popRef.value && popRef.value.open();
  35. emit("open");
  36. };
  37. const close = () => {
  38. emit("close");
  39. popRef.value && popRef.value.close();
  40. };
  41. const toShop = () => {
  42. uni.navigateTo({ url: "/pages/index/products?channel=1" });
  43. };
  44. const seeOrder = () => {
  45. uni.switchTab({ url: "/pages/order/index" });
  46. useTabbar.getPageCur("order");
  47. };
  48. defineExpose({ open, close });
  49. </script>
  50. <style lang="less" scoped>
  51. @import url("@/style.less");
  52. :deep(.conts) {
  53. min-width: 65vw;
  54. }
  55. .content {
  56. flex: 1;
  57. .flex_center();
  58. &_success {
  59. .flex_center();
  60. flex-direction: column;
  61. gap: 20rpx;
  62. }
  63. .img {
  64. width: 90rpx;
  65. height: 90rpx;
  66. }
  67. }
  68. .footer {
  69. .hor(space-between);
  70. column-gap: 20rpx;
  71. .submit_btn {
  72. height: 76rpx;
  73. padding: 16rpx 30rpx;
  74. background-color: var(--black);
  75. color: var(--light);
  76. .flex_center();
  77. border-radius: 16rpx;
  78. .size(24rpx);
  79. &.submit_shop {
  80. background-color: var(--bg);
  81. border: 1rpx solid var(--black);
  82. color: var(--black);
  83. }
  84. }
  85. }
  86. </style>