hot.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view v-if="show">
  3. <view v-if="url" class="yuan" @click="getImg">
  4. 预览大图
  5. </view>
  6. <scroll-view class="scroll-view_H" scroll-x="true" >
  7. <image src="https://api.jiuweiyun.cn/public/uploads/hotList-bg.png" mode="heightFix" style="height: 100vh; overflow-y: hidden;" class="bg">
  8. <view class="box-text">
  9. 大卫博士卖货学位争霸赛第{{ userServerInfo.season | numToZh}}季
  10. </view>
  11. <view class="nav">
  12. <view class="box-fix">
  13. <view class="fix-item" v-for="(item,index) in list" :key="index">
  14. <image :src="item" mode="widthFix" style="width: 160rpx;" @click="getID(index+3)"></image>
  15. </view>
  16. </view>
  17. <view class="right">
  18. <view class="right-box" v-for="(item,index) in headerList" :key="index">
  19. <view class="right-text">学霸</view>
  20. <view class="right-image">
  21. <image :src="item" mode="widthFix" style="width: 160rpx;" @click="getID(index)"></image>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </scroll-view>
  27. </view>
  28. </template>
  29. <script>
  30. import { GetWall } from "@/api.js"
  31. export default {
  32. data() {
  33. return {
  34. url: false,
  35. show: false,
  36. urlData: '',
  37. imgs: [],
  38. headerList: [],
  39. list: [],
  40. lists: [],
  41. }
  42. },
  43. onShow() {
  44. this.toGetWall()
  45. },
  46. computed: {
  47. userServerInfo() {
  48. return this.$store.state.userServerInfo
  49. }
  50. },
  51. methods: {
  52. // 判断荣誉榜单
  53. toGetWall() {
  54. this.$ajax.get(`${GetWall}`).then(([, { data: res }]) => {
  55. if(res.code === 200) {
  56. this.show = true
  57. this.list = res.data.honor_list
  58. this.headerList = res.data.honor_list_top
  59. if (res.data.url) {
  60. this.url = true
  61. this.urlData = res.data.url
  62. }
  63. } else {
  64. uni.showModal({
  65. title: '提示',
  66. content: res.msg || '暂未生成',
  67. showCancel: false,
  68. success: function (res) {
  69. if (res.confirm) {
  70. uni.navigateBack({
  71. delta: 1
  72. })
  73. }
  74. }
  75. })
  76. }
  77. })
  78. },
  79. // 预览整张图片
  80. getImg() {
  81. // this.imgs = [this.urlData]
  82. uni.previewImage({ urls: [this.urlData] })
  83. // uni.previewImage({
  84. // urls: this.imgs,
  85. // })
  86. },
  87. // 预览单张图片
  88. getID(i) {
  89. this.imgs = this.headerList.concat(this.list)
  90. uni.previewImage({
  91. urls: this.imgs,
  92. current: this.imgs[i],
  93. })
  94. }
  95. }
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. page {
  100. height: 100%;
  101. }
  102. .yuan {
  103. position: fixed;
  104. top: 85rpx;
  105. left: 30rpx;
  106. z-index: 5;
  107. width: 228rpx;
  108. height: 79rpx;
  109. background: linear-gradient(92deg, #FF580E 0%, #FFBB18 100%);
  110. border-radius: 5rpx;
  111. text-align: center;
  112. line-height: 79rpx;
  113. color: #fff;
  114. font-size: 38rpx;
  115. }
  116. .scroll-view_H {
  117. height: 100vh;
  118. }
  119. .bgk {
  120. width:100%;
  121. min-height:100%;
  122. background-size:100% 100%;
  123. }
  124. .bg{
  125. width:4236rpx!important;
  126. max-width: none!important;
  127. }
  128. .yulan {
  129. background-color: #F0AD4E;
  130. width: 150rpx;
  131. height: 50rpx;
  132. }
  133. .nav {
  134. position: absolute;
  135. height: 100vh;
  136. left: 109rpx;
  137. top: 8%;
  138. display: flex;
  139. align-items: center;
  140. }
  141. .box {
  142. position: relative;
  143. &-text {
  144. position: absolute;
  145. width: 960rpx;
  146. top: 12%;
  147. left: 1748rpx;
  148. color: #997CEF;
  149. font-size: 46rpx;
  150. // font-weight: bold;
  151. }
  152. // width: 3542rpx;
  153. // height: 1594rpx;
  154. &-fix {
  155. width: 3825rpx;
  156. // width: 146rpx;
  157. // height: 176rpx;
  158. // background-color: #808080;
  159. display: flex;
  160. flex-wrap:wrap;
  161. .fix-item {
  162. width: 159rpx;
  163. height: 190rpx;
  164. background-color: #808080;
  165. margin-right: 32rpx;
  166. margin-bottom: 0.5%;
  167. }
  168. }
  169. }
  170. .right {
  171. display: flex;
  172. flex-direction: column;
  173. &-box {
  174. display: flex;
  175. align-items: center;
  176. margin-bottom: 65rpx;
  177. }
  178. &-text {
  179. width: 30rpx;
  180. color: #D90D18;
  181. font-size: 36rpx;
  182. white-space:pre-wrap;
  183. font-weight: bold;
  184. margin-right: 20rpx;
  185. }
  186. &-image {
  187. width: 146rpx;
  188. height: 176rpx;
  189. background-color: #808080;
  190. }
  191. }
  192. </style>