agreePopup.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view>
  3. <u-popup
  4. :show="agreeShow"
  5. @close="$emit('close')"
  6. :safeAreaInsetBottom="false"
  7. mode="center"
  8. round="10"
  9. >
  10. <view class="popup-content">
  11. <view class="title"> {{ title }} </view>
  12. <u--input
  13. v-if="title == '请确认是否退款'"
  14. placeholder="请输入退款金额"
  15. border="surround"
  16. type="number"
  17. v-model="value"
  18. ></u--input>
  19. <view class="btn-list">
  20. <button class="btn-2" @click="$emit('close')">取消</button>
  21. <button class="btn-1" @click="submit">提交</button>
  22. </view>
  23. </view>
  24. </u-popup>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. props: {
  30. agreeShow: {
  31. typeof: Boolean,
  32. default: false,
  33. },
  34. title: {
  35. typeof: String,
  36. default: "",
  37. },
  38. },
  39. watch: {
  40. agreeShow() {
  41. console.log(111);
  42. },
  43. },
  44. data() {
  45. return {
  46. value: "",
  47. };
  48. },
  49. methods: {
  50. submit() {
  51. if (this.title == "请确认是否退款") {
  52. if (!this.value) {
  53. uni.showToast({
  54. title: "请输入退款金额",
  55. icon: "none",
  56. });
  57. return;
  58. }
  59. this.$emit("close", 1, this.value);
  60. } else {
  61. this.$emit("close", 1);
  62. }
  63. },
  64. },
  65. };
  66. </script>
  67. <style lang="scss" scoped>
  68. .popup-content {
  69. padding: 36rpx 28rpx;
  70. width: 450rpx;
  71. .title {
  72. font-size: 32rpx;
  73. color: #333;
  74. font-weight: 600;
  75. text-align: center;
  76. margin-bottom: 28rpx;
  77. }
  78. .btn-list {
  79. display: flex;
  80. justify-content: space-around;
  81. margin-top: 20rpx;
  82. .btn-1 {
  83. background-color: #f83224;
  84. color: #fff;
  85. margin-top: 40rpx;
  86. border-radius: 38rpx;
  87. margin: 0;
  88. width: 188rpx;
  89. height: 76rpx;
  90. line-height: 76rpx;
  91. font-size: 32rpx;
  92. }
  93. .btn-2 {
  94. background-color: #fff;
  95. color: #f83224;
  96. margin-top: 40rpx;
  97. border-radius: 38rpx;
  98. border: 2rpx solid #f83224;
  99. margin: 0;
  100. width: 188rpx;
  101. height: 76rpx;
  102. line-height: 76rpx;
  103. font-size: 32rpx;
  104. }
  105. }
  106. }
  107. </style>