successModel.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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="warehouse_tips"></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 orderid = ref(null);
  34. const open = (id) => {
  35. popRef.value && popRef.value.open();
  36. console.log(id);
  37. orderid.value = id;
  38. emit("open");
  39. };
  40. const close = () => {
  41. emit("close");
  42. popRef.value && popRef.value.close();
  43. };
  44. const toShop = () => {
  45. uni.switchTab({ url: "/pages/index/index" });
  46. useTabbar.getPageCur("index");
  47. };
  48. const seeOrder = () => {
  49. uni.navigateTo({
  50. url: `/pages/dashboard/parcel_detail?orderid=${orderid.value}&isOrder=true`,
  51. });
  52. };
  53. defineExpose({ open, close });
  54. </script>
  55. <style lang="less" scoped>
  56. @import url("@/style.less");
  57. :deep(.conts) {
  58. width: 70vw;
  59. }
  60. .content {
  61. flex: 1;
  62. .flex_center();
  63. &_success {
  64. .flex_center();
  65. flex-direction: column;
  66. gap: 20rpx;
  67. }
  68. .img {
  69. width: 90rpx;
  70. height: 90rpx;
  71. }
  72. }
  73. .footer {
  74. .hor(space-between);
  75. column-gap: 20rpx;
  76. .submit_btn {
  77. height: 76rpx;
  78. padding: 16rpx 30rpx;
  79. background-color: var(--black);
  80. color: var(--light);
  81. .flex_center();
  82. border-radius: 16rpx;
  83. .size(24rpx);
  84. &.submit_shop {
  85. background-color: var(--bg);
  86. border: 1rpx solid var(--black);
  87. color: var(--black);
  88. }
  89. }
  90. }
  91. </style>