小说小程序前端代码仓库(小程序)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
2.5 KiB

  1. <template>
  2. <view class="creator-page">
  3. <uv-navbar title="请成为创作者" fixed placeholder></uv-navbar>
  4. <view class="form-card">
  5. <view class="form-item">
  6. <text class="required">*</text>
  7. <text class="label">笔名</text>
  8. <input v-model="penName" placeholder="请输入" class="input" placeholder-class="input-placeholder" />
  9. </view>
  10. <view class="form-item">
  11. <text class="required">*</text>
  12. <text class="label">简介</text>
  13. <textarea v-model="intro" placeholder="请输入" class="textarea" placeholder-class="input-placeholder" />
  14. </view>
  15. </view>
  16. <view class="footer-btn-area">
  17. <button class="submit-btn" @click="submit">成为创作者</button>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. penName: '',
  26. intro: ''
  27. }
  28. },
  29. methods: {
  30. submit() {
  31. if (!this.penName) {
  32. uni.showToast({ title: '请输入笔名', icon: 'none' })
  33. return
  34. }
  35. if (!this.intro) {
  36. uni.showToast({ title: '请输入简介', icon: 'none' })
  37. return
  38. }
  39. // 这里可以添加提交逻辑
  40. uni.showToast({ title: '申请成功', icon: 'success' })
  41. setTimeout(() => {
  42. uni.navigateBack()
  43. }, 800)
  44. }
  45. }
  46. }
  47. </script>
  48. <style scoped lang="scss">
  49. .creator-page {
  50. min-height: 100vh;
  51. background: #f7f8fa;
  52. display: flex;
  53. flex-direction: column;
  54. }
  55. .form-card {
  56. background: #fff;
  57. border-radius: 20rpx;
  58. margin: 40rpx 32rpx 0 32rpx;
  59. padding: 32rpx 24rpx;
  60. box-shadow: 0 4rpx 24rpx 0 rgba(0,0,0,0.04);
  61. }
  62. .form-item {
  63. display: flex;
  64. flex-direction: column;
  65. margin-bottom: 32rpx;
  66. position: relative;
  67. }
  68. .required {
  69. color: #e23d3d;
  70. font-size: 28rpx;
  71. margin-right: 4rpx;
  72. }
  73. .label {
  74. font-size: 28rpx;
  75. color: #222;
  76. font-weight: bold;
  77. margin-bottom: 12rpx;
  78. }
  79. .input, .textarea {
  80. width: 100%;
  81. height: 80rpx;
  82. border: none;
  83. border-bottom: 1.5rpx solid #ececec;
  84. font-size: 28rpx;
  85. background: transparent;
  86. padding: 18rpx 0 12rpx 0;
  87. margin-bottom: 2rpx;
  88. }
  89. .input-placeholder {
  90. color: #d2d2d2;
  91. font-size: 26rpx;
  92. }
  93. .textarea {
  94. min-height: 120rpx;
  95. resize: none;
  96. }
  97. .footer-btn-area {
  98. margin-top: auto;
  99. padding: 48rpx 32rpx 32rpx 32rpx;
  100. background: transparent;
  101. margin-bottom: 80rpx;
  102. }
  103. .submit-btn {
  104. width: 100%;
  105. height: 88rpx;
  106. background: #0a2e6d;
  107. color: #fff;
  108. font-size: 32rpx;
  109. border-radius: 44rpx;
  110. font-weight: bold;
  111. letter-spacing: 2rpx;
  112. transition: background 0.2s;
  113. }
  114. </style>