InputIsbn.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <u-popup v-model="showPopup" @close="closePopup" @open="openPopup" mode="center" border-radius="20" width ="85%">
  3. <view class="popup-content">
  4. <view class="popup-title">请输入图书ISBN编码</view>
  5. <view class="desc-text">请输入不含“-”符号的13位或10位ISBN编码</view>
  6. <image src="/static/img/barcode.png" alt="ISBN Barcode" style="height:200rpx;margin-bottom: 20rpx"
  7. mode="heightFix" />
  8. <u-input v-model="isbn" placeholder="在此输入ISBN编码" class="popup-input" input-align="center"
  9. :custom-style="{'border-radius': '10rpx',height:'80rpx'}" border />
  10. <view class="buttons">
  11. <button @click="cancel">取消</button>
  12. <button @click="submit">提交</button>
  13. </view>
  14. </view>
  15. </u-popup>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. showPopup: false,
  22. isbn: '',
  23. };
  24. },
  25. methods: {
  26. openPopup() {
  27. this.showPopup = true;
  28. },
  29. closePopup() {
  30. this.showPopup = false;
  31. },
  32. cancel() {
  33. this.isbn = '';
  34. this.closePopup();
  35. },
  36. submit() {
  37. // Handle ISBN submission
  38. console.log('Submitted ISBN:', this.isbn);
  39. this.closePopup();
  40. },
  41. },
  42. };
  43. </script>
  44. <style lang="scss">
  45. .popup-content {
  46. text-align: center;
  47. padding: 40rpx;
  48. .desc-text {
  49. font-family: PingFang SC;
  50. font-weight: 400;
  51. font-size: 26rpx;
  52. color: #333333;
  53. margin: 20rpx 0;
  54. }
  55. .popup-title {
  56. font-family: PingFang SC;
  57. font-weight: bold;
  58. font-size: 32rpx;
  59. color: #38C148;
  60. }
  61. .buttons {
  62. display: flex;
  63. justify-content: space-between;
  64. margin-top: 20px;
  65. gap: 30rpx;
  66. button {
  67. flex: 1;
  68. height: 80rpx;
  69. line-height: 80rpx;
  70. font-size: 32rpx;
  71. border-radius: 10rpx;
  72. border: none;
  73. &:first-child {
  74. background-color: #F5F5F5;
  75. color: #333333;
  76. }
  77. &:last-child {
  78. background-color: #38C148;
  79. color: #FFFFFF;
  80. }
  81. }
  82. }
  83. }
  84. </style>