teamph.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. <template>
  2. <view class="content">
  3. <view class="nav flex">
  4. <view class="nav-item" v-for="(item,index) in navList" @click="navClick(index)"
  5. :class="{'action': index == currentIndex}">
  6. {{item.title}}
  7. </view>
  8. </view>
  9. <view class="ph-top">
  10. <view class="ph-m"></view>
  11. <view class="ph flex">
  12. <view class="ph-item flex">
  13. <view class="item-logo yj-logo">
  14. <image :src="navList[currentIndex].list[1].avatar" mode="" class="avt"></image>
  15. </view>
  16. <view class="item-name">
  17. {{navList[currentIndex].list[1].nickname}}
  18. </view>
  19. <view class="item-id">
  20. ID: {{navList[currentIndex].list[1].uid}}
  21. </view>
  22. <view class="item-tit">
  23. 团队数
  24. </view>
  25. <view class="item-val">
  26. {{navList[currentIndex].list[1].count}}
  27. </view>
  28. </view>
  29. <view class="ph-item flex">
  30. <view class="item-logo gj-logo">
  31. <image :src="navList[currentIndex].list[0].avatar" mode="" class="avt"></image>
  32. </view>
  33. <view class="item-name">
  34. {{navList[currentIndex].list[0].nickname}}
  35. </view>
  36. <view class="item-id">
  37. ID: {{navList[currentIndex].list[0].uid}}
  38. </view>
  39. <view class="item-tit">
  40. 团队数
  41. </view>
  42. <view class="item-val">
  43. {{navList[currentIndex].list[0].count}}
  44. </view>
  45. </view>
  46. <view class="ph-item flex">
  47. <view class="item-logo jj-logo">
  48. <image :src="navList[currentIndex].list[2].avatar" mode="" class="avt"></image>
  49. </view>
  50. <view class="item-name">
  51. {{navList[currentIndex].list[2].nickname}}
  52. </view>
  53. <view class="item-id">
  54. ID: {{navList[currentIndex].list[2].uid}}
  55. </view>
  56. <view class="item-tit">
  57. 团队数
  58. </view>
  59. <view class="item-val">
  60. {{navList[currentIndex].list[2].count}}
  61. </view>
  62. </view>
  63. </view>
  64. <image src="../../static/icon/yy.png" mode="" class="yy"></image>
  65. </view>
  66. <scroll-view scroll-y="true" class="grop-list" :style="{'height': max_height}">
  67. <view class="grop-item flex" v-for="item in 10">
  68. <view class="item-xh">
  69. 4
  70. </view>
  71. <image src="" mode="" class="item-logo"></image>
  72. <view class="item-info">
  73. <view class="info-name">
  74. 李淡淡
  75. </view>
  76. <view class="info-id">
  77. ID: 09124
  78. </view>
  79. </view>
  80. <view class="item-tg">
  81. <view class="tg-val">
  82. 233
  83. </view>
  84. <view class="tg-tit">
  85. 团队数
  86. </view>
  87. </view>
  88. </view>
  89. </scroll-view>
  90. </view>
  91. </template>
  92. <script>
  93. import { getInviterRanking } from '@/api/user.js'
  94. export default {
  95. data() {
  96. return {
  97. max_height: '',
  98. navList: [{
  99. title: '周排行',
  100. time: ((new Date().setHours(0, 0, 0) - (new Date().getDay() - 1) *24 * 60 * 60 *1000)/1000).toFixed(0),
  101. times: ((new Date().setHours(0, 0, 0) + (7 - new Date().getDay()) *24 * 60 * 60 *1000)/1000).toFixed(0),
  102. list: [],
  103. page: 1,
  104. limit: 10,
  105. loadingType: 'more',
  106. loaded: false
  107. }, {
  108. title: '月排行',
  109. time: (new Date(new Date(new Date().getFullYear(), new Date().getMonth(), 1).setHours(0, 0, 0)).getTime()/1000).toFixed(0),
  110. times: ((new Date(new Date().getFullYear(), new Date().getMonth()+ 1, 0).setHours(23, 59, 59, 59))/1000).toFixed(0),
  111. list: [],
  112. page: 1,
  113. limit: 10,
  114. loadingType: 'more',
  115. loaded: false
  116. }],
  117. currentIndex: 0,
  118. }
  119. },
  120. onLoad() {
  121. this.getInviterRanking()
  122. },
  123. computed: {
  124. showList() {
  125. return this.navList[this.currentIndex].list
  126. }
  127. },
  128. onShow() {
  129. },
  130. onReachBottom() {
  131. },
  132. onReady() {
  133. var obj = this;
  134. uni.getSystemInfo({
  135. success: resu => {
  136. const query = uni.createSelectorQuery();
  137. query.select('.grop-list').boundingClientRect();
  138. query.exec(function(res) {
  139. obj.max_height = resu.windowHeight - res[0].top + 'px';
  140. });
  141. },
  142. fail: res => {}
  143. });
  144. },
  145. methods: {
  146. navClick(index) {
  147. this.currentIndex = index
  148. this.getInviterRanking()
  149. },
  150. getInviterRanking() {
  151. let that = this
  152. let navitem = that.navList[that.currentIndex]
  153. if(navitem.loadingType == 'loading' || navitem.loadingType == 'noMore') {
  154. return
  155. }
  156. if(navitem.loaded) {
  157. return
  158. }
  159. navitem.loadingType = 'loading'
  160. getInviterRanking({
  161. time: navitem.time,
  162. times: navitem.times,
  163. page: navitem.page,
  164. pageSize: navitem.pageSize
  165. }).then(res => {
  166. console.log(res);
  167. navitem.list = navitem.list.concat(res.data.list)
  168. if(navitem.limit == res.data.list.length) {
  169. navitem.loadingType = 'more'
  170. }else {
  171. navitem.loadingType = 'noMore'
  172. }
  173. navitem.loaded = true
  174. }).catch(err => {
  175. navitem.loaded = false
  176. })
  177. }
  178. }
  179. }
  180. </script>
  181. <style lang="scss" scoped>
  182. .nav {
  183. width: 750rpx;
  184. height: 88rpx;
  185. .nav-item {
  186. line-height: 88rpx;
  187. width: 50%;
  188. text-align: center;
  189. font-size: 30rpx;
  190. font-weight: 500;
  191. color: #333333;
  192. height: 100%;
  193. }
  194. .action {
  195. font-weight: bold;
  196. position: relative;
  197. &::after {
  198. content: '';
  199. width: 50rpx;
  200. height: 6rpx;
  201. background: #FE5B38;
  202. border-radius: 3rpx;
  203. position: absolute;
  204. left: 0;
  205. right: 0;
  206. bottom: 6rpx;
  207. margin: auto;
  208. }
  209. }
  210. background-color: #fff;
  211. }
  212. .ph-top {
  213. width: 750rpx;
  214. height: 555rpx;
  215. background-color: #fc6795;
  216. position: relative;
  217. .yy {
  218. width: 261rpx;
  219. height: 195rpx;
  220. position: absolute;
  221. top: 131rpx;
  222. left: 0;
  223. right: 0;
  224. margin: auto;
  225. }
  226. .ph-m {
  227. width: 233rpx;
  228. height: 100rpx;
  229. border-radius: 20rpx 20rpx 0 0;
  230. background-color: #fff;
  231. position: absolute;
  232. top: 70rpx;
  233. left: 0;
  234. right: 0;
  235. margin: auto;
  236. }
  237. .ph {
  238. height: 360rpx;
  239. width: 702rpx;
  240. background-color: #fff;
  241. border-radius: 20rpx;
  242. align-items: flex-end;
  243. position: absolute;
  244. bottom: 65rpx;
  245. left: 0;
  246. right: 0;
  247. margin: auto;
  248. .ph-item {
  249. flex-grow: 1;
  250. flex-direction: column;
  251. justify-content: flex-end;
  252. padding-bottom: 30rpx;
  253. .item-logo {
  254. width: 90rpx;
  255. height: 90rpx;
  256. position: relative;
  257. .avt {
  258. width: 100%;
  259. height: 100%;
  260. border-radius: 50%;
  261. background-color: #eee;
  262. }
  263. }
  264. .gj-logo {
  265. width: 120rpx;
  266. height: 120rpx;
  267. background-color: #eee;
  268. border-radius: 50%;
  269. &::after {
  270. content: '';
  271. width: 51rpx;
  272. height: 49rpx;
  273. position: absolute;
  274. top: -15rpx;
  275. right: -15rpx;
  276. background: url($base-url + '/resource/icon/gj.png') no-repeat;
  277. background-size: 100% 100%;
  278. }
  279. }
  280. .yj-logo {
  281. &::after {
  282. content: '';
  283. width: 37rpx;
  284. height: 35rpx;
  285. position: absolute;
  286. top: -12rpx;
  287. right: -12rpx;
  288. background: url($base-url + '/resource/icon/yj.png') no-repeat;
  289. background-size: 100% 100%;
  290. }
  291. }
  292. .jj-logo {
  293. &::after {
  294. content: '';
  295. width: 37rpx;
  296. height: 35rpx;
  297. position: absolute;
  298. top: -12rpx;
  299. right: -12rpx;
  300. background: url($base-url + '/resource/icon/jj.png') no-repeat;
  301. background-size: 100% 100%;
  302. }
  303. }
  304. .item-name {
  305. font-size: 28rpx;
  306. font-weight: bold;
  307. color: #3F454B;
  308. margin: 15rpx 0 10rpx;
  309. }
  310. .item-id {
  311. font-size: 24rpx;
  312. font-weight: 400;
  313. color: #606972;
  314. }
  315. .item-tit {
  316. font-size: 24rpx;
  317. font-weight: 500;
  318. color: #999999;
  319. margin: 25rpx 0 15rpx;
  320. }
  321. .item-val {
  322. font-size: 30rpx;
  323. font-weight: 500;
  324. color: #FA2740;
  325. }
  326. }
  327. }
  328. }
  329. .grop-item {
  330. margin: auto;
  331. width: 702rpx;
  332. height:150rpx;
  333. border-bottom: 1px solid #F0F0F0;
  334. .item-logo {
  335. width: 90rpx;
  336. height: 90rpx;
  337. border-radius: 50%;
  338. background-color: #eee;
  339. margin: 0 20rpx;
  340. }
  341. .item-info {
  342. flex-grow: 1;
  343. }
  344. .item-info {
  345. .info-name {
  346. margin-bottom: 10rpx;
  347. font-size: 28rpx;
  348. font-weight: bold;
  349. color: #3F454B;
  350. }
  351. .info-id {
  352. font-size: 24rpx;
  353. font-weight: 400;
  354. color: #606972;
  355. }
  356. }
  357. .item-tg {
  358. flex-shrink: 0;
  359. .tg-tit {
  360. font-size: 24rpx;
  361. font-weight: 500;
  362. color: #999999;
  363. }
  364. .tg-val {
  365. font-size: 28rpx;
  366. font-weight: 500;
  367. color: #FA2740;
  368. margin-bottom: 10rpx;
  369. }
  370. }
  371. }
  372. </style>