小说小程序前端代码仓库(小程序)
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.

126 lines
2.7 KiB

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