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

131 lines
2.9 KiB

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