codeModel.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <Popup title="兑换码" isClose ref="popRef" mode="center">
  3. <template #content>
  4. <view class="form">
  5. <view class="form_item">
  6. <view class="item_label">
  7. {{ deatil.code }}
  8. </view>
  9. <view class="item_value">
  10. <up-copy :content="deatil.code" :notice="t('复制成功')">
  11. <trans _t="复制" />
  12. </up-copy>
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <!-- footer -->
  18. <template #footer>
  19. <view class="submit_btn">
  20. <trans _t="关闭" />
  21. </view>
  22. </template>
  23. </Popup>
  24. </template>
  25. <script setup>
  26. import { computed, ref, nextTick } from "vue";
  27. import Popup from "@/components/popup.vue";
  28. import { t } from "@/locale";
  29. const props = defineProps({
  30. deatil: { type: Object, default: {} },
  31. });
  32. const emit = defineEmits(["open", "close"]);
  33. const popRef = ref(null);
  34. const open = (type = 0) => {
  35. emit("open");
  36. popRef.value && popRef.value.open();
  37. };
  38. const close = () => {
  39. emit("close");
  40. popRef.value && popRef.value.close();
  41. };
  42. defineExpose({ open, close });
  43. </script>
  44. <style lang="less" scoped>
  45. @import url("@/style.less");
  46. :deep(.conts) {
  47. min-width: 90vw;
  48. max-width: 90vw;
  49. }
  50. .form {
  51. width: 100%;
  52. padding: 40rpx 0;
  53. &_item {
  54. width: 100%;
  55. .flex_position(space-between);
  56. .size(28rpx);
  57. margin-top: 24rpx;
  58. &:first-child {
  59. margin-top: 0;
  60. }
  61. .item_label {
  62. .size(32rpx);
  63. }
  64. .item_value {
  65. color: var(--red);
  66. }
  67. }
  68. .tips {
  69. color: var(--text-01);
  70. .size(24rpx);
  71. margin: 24rpx 0;
  72. }
  73. .total {
  74. text-align: right;
  75. color: var(--black);
  76. .size(28rpx);
  77. .amount {
  78. color: var(--red);
  79. font-weight: 700;
  80. margin-left: 2rpx;
  81. }
  82. }
  83. }
  84. .submit_btn {
  85. height: 38px;
  86. padding: 16rpx 30rpx;
  87. background-color: var(--black);
  88. color: var(--light);
  89. .flex_center();
  90. border-radius: 16rpx;
  91. .size(24rpx);
  92. }
  93. </style>