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

241 lines
6.8 KiB

  1. <template>
  2. <view class="tipping-page">
  3. <!-- 顶部导航栏 -->
  4. <navbar title="读者亲密值榜单" bgColor="#ac4b2c" color="#fff" leftClick @leftClick="$utils.navigateBack" />
  5. <!-- 榜单前三名 -->
  6. <view class="top-three">
  7. <view class="top-item second" v-if="topList[1]">
  8. <view class="avatar-frame">
  9. <image class="frame-img" src="/pages_order/static/top/top1.png" mode="aspectFit"></image>
  10. <image class="avatar" :src="topList[1].avatar" mode="aspectFill"></image>
  11. </view>
  12. <view class="badge">
  13. <image class="badge-img" src="/pages_order/static/book/dj.png" mode="aspectFit"></image>
  14. </view>
  15. <view class="name">{{ topList[1].name }}</view>
  16. <view class="score">{{ topList[1].num }} 亲密值</view>
  17. <view class="level">护书使者 四级</view>
  18. </view>
  19. <view class="top-item first" v-if="topList[0]">
  20. <view class="avatar-frame">
  21. <image class="frame-img" src="/pages_order/static/top/top1.png" mode="aspectFit"></image>
  22. <image class="avatar" :src="topList[0].avatar" mode="aspectFill"></image>
  23. </view>
  24. <view class="badge">
  25. <image class="badge-img" :src="topList[0].icon" mode="aspectFit"></image>
  26. </view>
  27. <view class="name">{{ topList[0].name }}</view>
  28. <view class="score">{{ topList[0].num }} 亲密值</view>
  29. <view class="level">护书使者 五级</view>
  30. </view>
  31. <view class="top-item third" v-if="topList[2]">
  32. <view class="avatar-frame">
  33. <image class="frame-img" src="/pages_order/static/top/top1.png" mode="aspectFit"></image>
  34. <image class="avatar" :src="topList[2].avatar" mode="aspectFill"></image>
  35. </view>
  36. <view class="badge">
  37. <image class="badge-img" src="/pages_order/static/book/dj.png" mode="aspectFit"></image>
  38. </view>
  39. <view class="name">{{ topList[2].name }}</view>
  40. <view class="score">{{ topList[2].num }} 亲密值</view>
  41. <view class="level">护书使者 三级</view>
  42. </view>
  43. </view>
  44. <!-- 榜单列表 -->
  45. <view class="rank-list"
  46. v-if="topList.length > 3">
  47. <RankListItem v-for="(item, idx) in topList"
  48. v-if="idx > 2"
  49. :key="item.id" />
  50. </view>
  51. <!-- 底部按钮 -->
  52. <view class="bottom-btn-area">
  53. <button class="tipping-btn"
  54. @click="$utils.navigateTo('pages_order/novel/Giftbox?id=' + bookId)"
  55. >互动打赏</button>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. import RankListItem from '../components/novel/RankListItem.vue'
  61. export default {
  62. components: {
  63. RankListItem
  64. },
  65. data() {
  66. return {
  67. topList: [],
  68. rankList: [],
  69. bookId: 0,
  70. }
  71. },
  72. onLoad(options) {
  73. this.bookId = options.id;
  74. },
  75. onShow() {
  76. this.getTopList();
  77. },
  78. methods: {
  79. getTopList() {
  80. this.$fetch('getIntimacyRankList', {
  81. bookId: this.bookId,
  82. pageNo: 1,
  83. pageSize: 10
  84. }).then(res => {
  85. this.topList = res.records;
  86. });
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. .tipping-page {
  93. min-height: 100vh;
  94. // background: linear-gradient(180deg, #b86e3b 0%, #e6b07c 100%);
  95. background-color: #ac4b2c;
  96. padding-bottom: 40rpx;
  97. }
  98. .top-three {
  99. display: flex;
  100. justify-content: center;
  101. align-items: flex-end;
  102. margin: 80rpx 0 200rpx 0;
  103. padding: 0 30rpx;
  104. gap: 20rpx;
  105. .top-item {
  106. display: flex;
  107. flex-direction: column;
  108. align-items: center;
  109. position: relative;
  110. border-top-left-radius: 110rpx;
  111. border-top-right-radius: 110rpx;
  112. gap: 10rpx;
  113. padding-bottom: 20rpx;
  114. &.first {
  115. z-index: 3;
  116. margin-top: -50rpx;
  117. background: linear-gradient(to bottom, #F8DA87, #F8DA8700);
  118. border: 1px solid #fff;
  119. }
  120. &.second {
  121. z-index: 2;
  122. background: linear-gradient(to bottom, #C2C9CD, #C2C9CD00);
  123. border: 1px solid #fff;
  124. top: 80rpx;
  125. }
  126. &.third {
  127. z-index: 2;
  128. background: linear-gradient(to bottom, #834941, #83494100);
  129. border: 1px solid #fff;
  130. top: 80rpx;
  131. }
  132. .avatar-frame {
  133. position: relative;
  134. width: 220rpx;
  135. height: 220rpx;
  136. margin-top: -50rpx;
  137. .frame-img {
  138. position: absolute;
  139. width: 120%;
  140. height: 120%;
  141. z-index: 2;
  142. top: 50%;
  143. left: 50%;
  144. transform: translate(-50%, -50%);
  145. }
  146. .avatar {
  147. position: absolute;
  148. top: 50%;
  149. left: 50%;
  150. transform: translate(-50%, -50%);
  151. width: 80%;
  152. height: 80%;
  153. border-radius: 50%;
  154. z-index: 1;
  155. }
  156. }
  157. .badge {
  158. width: 100rpx;
  159. height: 100rpx;
  160. z-index: 3;
  161. .badge-img {
  162. width: 100%;
  163. height: 100%;
  164. }
  165. }
  166. .name {
  167. margin-top: 10rpx;
  168. font-size: 36rpx;
  169. color: #FFFFFF;
  170. font-weight: bold;
  171. }
  172. .score {
  173. font-size: 28rpx;
  174. color: #FFFFFF;
  175. margin-top: 6rpx;
  176. }
  177. .level {
  178. position: absolute;
  179. bottom: -40rpx;
  180. width: 102%;
  181. text-align: center;
  182. padding: 6rpx 20rpx;
  183. background-color: #FFCC33;
  184. border-radius: 6rpx;
  185. font-size: 26rpx;
  186. color: #8B4513;
  187. font-weight: bold;
  188. box-sizing: border-box;
  189. }
  190. }
  191. }
  192. .rank-list {
  193. background: #FAE5BE;
  194. margin: 0 24rpx;
  195. padding: 20rpx;
  196. border-radius: 20rpx;
  197. display: flex;
  198. flex-direction: column;
  199. gap: 20rpx;
  200. }
  201. .bottom-btn-area {
  202. margin: 40rpx 24rpx 90rpx 24rpx;
  203. display: flex;
  204. flex-direction: column;
  205. gap: 24rpx;
  206. .tipping-btn {
  207. width: 100%;
  208. height: 80rpx;
  209. background: #fffbe6;
  210. color: #b86e3b;
  211. font-size: 32rpx;
  212. border-radius: 40rpx;
  213. font-weight: bold;
  214. letter-spacing: 2rpx;
  215. box-shadow: 0 4rpx 16rpx 0 rgba(184, 110, 59, 0.12);
  216. border: none;
  217. }
  218. }
  219. </style>