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

137 lines
2.4 KiB

  1. <template>
  2. <uv-popup ref="popup" :round="30">
  3. <view class="vote-sheet">
  4. <view class="sheet-header">
  5. <text class="sheet-title">投推荐票</text>
  6. </view>
  7. <view class="vote-options">
  8. <text class="option-label">推荐投票</text>
  9. <view class="quick-options">
  10. <view class="option-btn" @click="setVotes(1)">1</view>
  11. <view class="option-btn" @click="setVotes(5)">5</view>
  12. <view class="option-btn" @click="setVotes(10)">10</view>
  13. </view>
  14. <text class="option-label">手动设置</text>
  15. <view class="manual-input">
  16. <view class="minus-btn" @click="decreaseVotes">-</view>
  17. <view class="vote-count">
  18. <text>x{{voteCount}}</text>
  19. </view>
  20. <view class="plus-btn" @click="increaseVotes">+</view>
  21. </view>
  22. </view>
  23. <button class="submit-btn" @click="submitVote">投票</button>
  24. </view>
  25. </uv-popup>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. }
  32. },
  33. methods: {
  34. open() {
  35. this.$refs.popup.open('bottom')
  36. },
  37. close() {
  38. this.$refs.popup.close()
  39. },
  40. }
  41. }
  42. </script>
  43. <style scoped lang="scss">
  44. .vote-sheet {
  45. background-color: #fff;
  46. border-radius: 20rpx 20rpx 0 0;
  47. padding: 30rpx;
  48. }
  49. .sheet-header {
  50. text-align: center;
  51. margin-bottom: 40rpx;
  52. }
  53. .sheet-title {
  54. font-size: 32rpx;
  55. font-weight: 500;
  56. }
  57. .vote-options {
  58. margin-bottom: 40rpx;
  59. }
  60. .option-label {
  61. font-size: 28rpx;
  62. color: #666;
  63. margin-bottom: 20rpx;
  64. }
  65. .quick-options {
  66. display: flex;
  67. gap: 20rpx;
  68. margin-top: 30rpx;
  69. margin-bottom: 40rpx;
  70. }
  71. .option-btn {
  72. flex: 1;
  73. height: 80rpx;
  74. background-color: #f5f5f5;
  75. display: flex;
  76. align-items: center;
  77. justify-content: center;
  78. border-radius: 8rpx;
  79. font-size: 28rpx;
  80. }
  81. .manual-input {
  82. margin-top: 30rpx;
  83. display: flex;
  84. align-items: center;
  85. justify-content: center;
  86. gap: 20rpx;
  87. }
  88. .minus-btn,
  89. .plus-btn {
  90. width: 220rpx;
  91. height: 80rpx;
  92. background-color: #f5f5f5;
  93. display: flex;
  94. align-items: center;
  95. justify-content: center;
  96. border-radius: 8rpx;
  97. font-size: 32rpx;
  98. }
  99. .vote-count {
  100. width: 220rpx;
  101. height: 82rpx;
  102. background-color: #f5f5f5;
  103. display: flex;
  104. align-items: center;
  105. justify-content: center;
  106. border-radius: 8rpx;
  107. font-size: 28rpx;
  108. }
  109. .submit-btn {
  110. width: 100%;
  111. height: 88rpx;
  112. background-color: #000033;
  113. color: #fff;
  114. border-radius: 8rpx;
  115. font-size: 32rpx;
  116. display: flex;
  117. align-items: center;
  118. justify-content: center;
  119. }
  120. </style>