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

192 lines
4.8 KiB

  1. <template>
  2. <view class="achievement-page">
  3. <uv-navbar title="读者成就设置" fixed placeholder></uv-navbar>
  4. <view class="achievement-card">
  5. <view class="card-title-row">
  6. <view class="card-title">阅读成就设置</view>
  7. <view v-if="isPending" class="pending-tag">设置审核中</view>
  8. </view>
  9. <view class="achievement-list">
  10. <view class="achievement-item">
  11. <image class="badge-img" src="https://tse3-mm.cn.bing.net/th/id/OIP-C.wUsFZgl70iE4tI7b_HKaKgHaHa?w=166&h=180&c=7&r=0&o=5&dpr=1.1&pid=1.7" mode="aspectFill" />
  12. <view class="input-area">
  13. <view class="label-row">
  14. <text class="required">*</text>
  15. <text class="label">一级成就名称</text>
  16. </view>
  17. <input class="input" v-model="level1" placeholder="请输入" placeholder-class="input-placeholder" />
  18. </view>
  19. </view>
  20. <view class="divider"></view>
  21. <view class="achievement-item">
  22. <image class="badge-img" src="https://tse3-mm.cn.bing.net/th/id/OIP-C.wUsFZgl70iE4tI7b_HKaKgHaHa?w=166&h=180&c=7&r=0&o=5&dpr=1.1&pid=1.7" mode="aspectFill" />
  23. <view class="input-area">
  24. <view class="label-row">
  25. <text class="required">*</text>
  26. <text class="label">二级成就名称</text>
  27. </view>
  28. <input class="input" v-model="level2" placeholder="请输入" placeholder-class="input-placeholder" />
  29. </view>
  30. </view>
  31. <view class="divider"></view>
  32. <view class="achievement-item">
  33. <image class="badge-img" src="https://tse3-mm.cn.bing.net/th/id/OIP-C.wUsFZgl70iE4tI7b_HKaKgHaHa?w=166&h=180&c=7&r=0&o=5&dpr=1.1&pid=1.7" mode="aspectFill" />
  34. <view class="input-area">
  35. <view class="label-row">
  36. <text class="required">*</text>
  37. <text class="label">三级成就名称</text>
  38. </view>
  39. <input class="input" v-model="level3" placeholder="请输入" placeholder-class="input-placeholder" />
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="bottom-btn-area">
  45. <button class="submit-btn" :disabled="isPending" :class="{disabled: isPending, pending: isPending}" @click="submit">
  46. {{ isPending ? '设置' : '提交申请' }}
  47. </button>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. data() {
  54. return {
  55. level1: '',
  56. level2: '',
  57. level3: '',
  58. isPending: false
  59. }
  60. },
  61. methods: {
  62. submit() {
  63. if (!this.level1 || !this.level2 || !this.level3) {
  64. uni.showToast({ title: '请填写所有成就名称', icon: 'none' })
  65. return
  66. }
  67. this.isPending = true
  68. // 可根据需要添加实际提交逻辑
  69. }
  70. }
  71. }
  72. </script>
  73. <style scoped lang="scss">
  74. .achievement-page {
  75. min-height: 100vh;
  76. background: #f7f8fa;
  77. display: flex;
  78. flex-direction: column;
  79. }
  80. .achievement-card {
  81. background: #fff;
  82. border-radius: 20rpx;
  83. margin: 40rpx 32rpx 0 32rpx;
  84. padding: 32rpx 24rpx;
  85. box-shadow: 0 4rpx 24rpx 0 rgba(0,0,0,0.04);
  86. }
  87. .card-title-row {
  88. display: flex;
  89. align-items: center;
  90. justify-content: space-between;
  91. }
  92. .card-title {
  93. font-size: 32rpx;
  94. font-weight: bold;
  95. margin-bottom: 32rpx;
  96. }
  97. .achievement-list {
  98. display: flex;
  99. flex-direction: column;
  100. gap: 0;
  101. }
  102. .achievement-item {
  103. display: flex;
  104. align-items: flex-start;
  105. padding: 18rpx 0 10rpx 0;
  106. }
  107. .badge-img {
  108. width: 72rpx;
  109. height: 72rpx;
  110. margin-right: 20rpx;
  111. border-radius: 50%;
  112. background: #f5f5f5;
  113. object-fit: cover;
  114. border: 2rpx solid #fff;
  115. box-shadow: 0 2rpx 8rpx 0 rgba(0,0,0,0.04);
  116. }
  117. .input-area {
  118. margin-top: 15rpx;
  119. flex: 1;
  120. display: flex;
  121. flex-direction: column;
  122. justify-content: flex-start;
  123. }
  124. .label-row {
  125. display: flex;
  126. align-items: center;
  127. margin-bottom: 6rpx;
  128. }
  129. .required {
  130. color: #e23d3d;
  131. font-size: 28rpx;
  132. margin-right: 4rpx;
  133. }
  134. .label {
  135. font-size: 28rpx;
  136. color: #222;
  137. font-weight: bold;
  138. }
  139. .input {
  140. width: 100%;
  141. border: none;
  142. border-bottom: 1.5rpx solid #ececec;
  143. font-size: 28rpx;
  144. background: transparent;
  145. padding: 8rpx 0 6rpx 0;
  146. margin-bottom: 2rpx;
  147. }
  148. .input-placeholder {
  149. color: #d2d2d2;
  150. font-size: 26rpx;
  151. }
  152. .divider {
  153. height: 1rpx;
  154. background: #f3f3f3;
  155. margin: 0 0 0 92rpx;
  156. }
  157. .bottom-btn-area {
  158. margin-top: auto;
  159. padding: 48rpx 32rpx 32rpx 32rpx;
  160. background: transparent;
  161. }
  162. .submit-btn {
  163. width: 100%;
  164. height: 88rpx;
  165. background: #0a2e6d;
  166. color: #fff;
  167. font-size: 32rpx;
  168. border-radius: 44rpx;
  169. font-weight: bold;
  170. letter-spacing: 2rpx;
  171. transition: background 0.2s;
  172. }
  173. .submit-btn.disabled {
  174. background: #807a7a;
  175. color: #fff;
  176. }
  177. .submit-btn.pending {
  178. background: #0a226d;
  179. color: #fff;
  180. }
  181. .pending-tag {
  182. background: #807a7a;
  183. color: #fff;
  184. font-size: 24rpx;
  185. border-radius: 10rpx;
  186. padding: 6rpx 24rpx;
  187. margin-left: 20rpx;
  188. margin-bottom: 32rpx;
  189. }
  190. </style>