├── php-api/ # 改造后的PHP接口层 ├── java-ad-service/ # 若依框架微服务(广告+VIP+分账) ├── uniapp-reader/ # UniApp前端项目 │ ├── pages/ # 各端页面 │ └──
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

apply.vue 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view class="apply-container">
  3. <view class="form-title">成为签约作家</view>
  4. <form @submit="submitForm">
  5. <view class="form-item">
  6. <text class="form-label">真实姓名</text>
  7. <input v-model="form.realName" placeholder="请输入真实姓名" />
  8. </view>
  9. <view class="form-item">
  10. <text class="form-label">联系方式</text>
  11. <input v-model="form.contact" placeholder="手机号/微信/QQ" />
  12. </view>
  13. <!-- 添加作品类型选择器 -->
  14. <view class="form-item">
  15. <text class="form-label">作品类型</text>
  16. <picker @change="bindTypeChange" :value="typeIndex" :range="novelTypes">
  17. <view class="picker">
  18. {{ form.type || '请选择作品类型' }}
  19. </view>
  20. </picker>
  21. </view>
  22. <view class="form-item">
  23. <text class="form-label">作品名称</text>
  24. <input v-model="form.novelTitle" placeholder="请输入作品名称" />
  25. </view>
  26. <view class="form-item">
  27. <text class="form-label">作品简介</text>
  28. <textarea
  29. v-model="form.description"
  30. placeholder="请简要描述你的作品内容"
  31. maxlength="500"
  32. auto-height
  33. />
  34. </view>
  35. <view class="form-item">
  36. <text class="form-label">作品示例</text>
  37. <textarea
  38. v-model="form.sampleContent"
  39. placeholder="请提供1-3章示例内容"
  40. maxlength="5000"
  41. auto-height
  42. />
  43. </view>
  44. <!-- 添加提交按钮状态 -->
  45. <button
  46. form-type="submit"
  47. class="submit-btn"
  48. :disabled="submitting"
  49. >
  50. {{ submitting ? '提交中...' : '提交申请' }}
  51. </button>
  52. </form>
  53. <view class="agreement">
  54. 提交申请即表示同意
  55. <text class="link" @click="viewAgreement">《作家签约协议》</text>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. form: {
  64. realName: '',
  65. contact: '',
  66. type: '',
  67. novelTitle: '',
  68. description: '',
  69. sampleContent: ''
  70. },
  71. novelTypes: ['都市言情', '玄幻奇幻', '武侠仙侠', '历史军事', '科幻灵异', '游戏竞技', '其他'],
  72. submitting: false,
  73. typeIndex: -1
  74. }
  75. },
  76. methods: {
  77. bindTypeChange(e) {
  78. this.typeIndex = e.detail.value;
  79. this.form.type = this.novelTypes[this.typeIndex];
  80. },
  81. async submitForm() {
  82. this.submitting = true;
  83. // 表单验证
  84. if (!this.form.realName || !this.form.contact || !this.form.type ||
  85. !this.form.novelTitle || !this.form.description) {
  86. uni.showToast({ title: '请填写完整信息', icon: 'none' });
  87. return;
  88. }
  89. try {
  90. // 调用API
  91. await this.$api.applyAuthor(this.form);
  92. uni.showToast({ title: '提交成功,请等待审核' });
  93. setTimeout(() => {
  94. uni.navigateBack();
  95. }, 1500);
  96. } catch (e) {
  97. uni.showToast({ title: e.message || '提交失败', icon: 'none' });
  98. } finally {
  99. this.submitting = false;
  100. }
  101. },
  102. viewAgreement() {
  103. uni.navigateTo({
  104. url: '/pages/agreement/author'
  105. });
  106. }
  107. }
  108. }
  109. </script>
  110. <style scoped>
  111. .apply-container {
  112. padding: 40rpx;
  113. }
  114. .form-title {
  115. font-size: 40rpx;
  116. font-weight: bold;
  117. text-align: center;
  118. margin-bottom: 40rpx;
  119. }
  120. .form-item {
  121. margin-bottom: 30rpx;
  122. padding-bottom: 20rpx;
  123. border-bottom: 1rpx solid #eee;
  124. }
  125. .form-label {
  126. display: block;
  127. font-size: 30rpx;
  128. margin-bottom: 15rpx;
  129. color: #333;
  130. }
  131. input, textarea, .picker {
  132. width: 100%;
  133. font-size: 28rpx;
  134. min-height: 60rpx;
  135. }
  136. textarea {
  137. min-height: 200rpx;
  138. }
  139. .submit-btn {
  140. background-color: #3cc51f;
  141. color: white;
  142. margin-top: 40rpx;
  143. border-radius: 50rpx;
  144. }
  145. .agreement {
  146. text-align: center;
  147. margin-top: 30rpx;
  148. font-size: 24rpx;
  149. color: #888;
  150. }
  151. .link {
  152. color: #3cc51f;
  153. }
  154. </style>