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

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