index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. <template>
  2. <view :style="colorStyle">
  3. <view class="PromoterRank">
  4. <view class="redBg bg-color">
  5. <view class="header">
  6. <view class="rank acea-row row-bottom row-around">
  7. <view class="item one">
  8. <view class="pictrue">
  9. <image :src="rankInfo.avatar"></image>
  10. </view>
  11. </view>
  12. </view>
  13. <view class="extension">
  14. <view class="item">
  15. <view class="num">{{rankInfo.rank}}</view>
  16. <view class="text">排名</view>
  17. </view>
  18. <view class="item">
  19. <view class="num">{{rankInfo.week}}</view>
  20. <view class="text">周推广人</view>
  21. </view>
  22. <view class="item">
  23. <view class="num">{{rankInfo.month}}</view>
  24. <view class="text">月推广人</view>
  25. </view>
  26. </view>
  27. <view class="nav acea-row row-center-wrapper">
  28. <view class="item" :class="active == 0 ? 'select' : ''" @click="switchTap(0)">
  29. <view class="">
  30. 周榜
  31. </view>
  32. <view class="line-btn" :class="active == 0 ? 'line-sel' : ''"></view>
  33. </view>
  34. <view class="line">
  35. </view>
  36. <view class="item" :class="active == 1 ? 'select' : ''" @click="switchTap(1)">
  37. <view class="">
  38. 月榜
  39. </view>
  40. <view class="line-btn" :class="active == 1 ? 'line-sel' : ''"></view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="time">
  46. 统计时间:{{rankInfo.start}} ~ {{rankInfo.end}}
  47. </view>
  48. <view class="list" v-if="rankList.length">
  49. <view class="item acea-row row-between-wrapper" v-for="(item,index) in rankList" :key="index">
  50. <view class="no" v-if="index == 0">
  51. <image src="../static/no1.png" mode=""></image>
  52. </view>
  53. <view class="no" v-if="index == 1">
  54. <image src="../static/no2.png" mode=""></image>
  55. </view>
  56. <view class="no" v-if="index == 2">
  57. <image src="../static/no3.png" mode=""></image>
  58. </view>
  59. <view class="num" v-if="index>2">{{index+1}}</view>
  60. <view class="picTxt acea-row row-between-wrapper">
  61. <view class="pictrue">
  62. <image :src="item.avatar"></image>
  63. </view>
  64. <view class="text line1">{{item.nickname}}</view>
  65. </view>
  66. <view class="people font-color">{{item.count}}人</view>
  67. </view>
  68. </view>
  69. <view v-else>
  70. <emptyPage title="暂无排行数据~"></emptyPage>
  71. </view>
  72. </view>
  73. <home v-if="navigation"></home>
  74. <!-- #ifdef MP -->
  75. <!-- <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize> -->
  76. <!-- #endif -->
  77. </view>
  78. </template>
  79. <script>
  80. import {
  81. getRankList
  82. } from '@/api/user.js';
  83. import {
  84. toLogin
  85. } from '@/libs/login.js';
  86. import emptyPage from '@/components/emptyPage.vue'
  87. import {
  88. mapGetters
  89. } from "vuex";
  90. import home from '@/components/home';
  91. import colors from '@/mixins/color.js';
  92. export default {
  93. components: {
  94. home,
  95. emptyPage
  96. },
  97. mixins: [colors],
  98. data() {
  99. return {
  100. navList: ["周榜", "月榜"],
  101. active: 0,
  102. page: 1,
  103. limit: 20,
  104. type: 'week',
  105. loading: false,
  106. loadend: false,
  107. rankList: [],
  108. Two: {},
  109. One: {},
  110. Three: {},
  111. rankInfo: {
  112. list: []
  113. },
  114. isShowAuth: false
  115. };
  116. },
  117. computed: mapGetters(['isLogin']),
  118. watch: {
  119. isLogin: {
  120. handler: function(newV, oldV) {
  121. if (newV) {
  122. this.getRanklist();
  123. }
  124. },
  125. deep: true
  126. }
  127. },
  128. onLoad() {
  129. if (this.isLogin) {
  130. this.rankList = [];
  131. let obj = []
  132. this.getRanklist();
  133. } else {
  134. toLogin()
  135. }
  136. },
  137. onShow() {
  138. uni.removeStorageSync('form_type_cart');
  139. },
  140. methods: {
  141. onLoadFun() {
  142. this.getRanklist();
  143. this.isShowAuth = false;
  144. },
  145. // 授权关闭
  146. authColse: function(e) {
  147. this.isShowAuth = e
  148. },
  149. getRanklist: function() {
  150. let that = this;
  151. if (that.loadend) return;
  152. if (that.loading) return;
  153. that.loading = true;
  154. getRankList({
  155. page: that.page,
  156. limit: that.limit,
  157. type: that.type
  158. }).then(res => {
  159. let list = res.data.list;
  160. that.rankInfo = res.data;
  161. that.rankList.push.apply(that.rankList, list);
  162. // if (that.page == 1) {
  163. // that.One = that.rankList.shift() || {};
  164. // that.Two = that.rankList.shift() || {};
  165. // that.Three = that.rankList.shift() || {};
  166. // }
  167. that.loadend = list.length < that.limit;
  168. that.loading = false;
  169. that.$set(that, 'rankList', that.rankList);
  170. // that.One = that.One;
  171. // that.Two = that.Two;
  172. // that.Three = that.Three;
  173. that.page = that.page + 1;
  174. }).catch(err => {
  175. that.loading = false;
  176. })
  177. },
  178. switchTap: function(index) {
  179. if (this.active === index) return;
  180. this.active = index;
  181. this.type = index ? 'month' : 'week';
  182. this.page = 1;
  183. this.loadend = false;
  184. this.$set(this, 'rankList', []);
  185. this.Two = {};
  186. this.One = {};
  187. this.Three = {};
  188. this.getRanklist();
  189. },
  190. },
  191. onReachBottom: function() {
  192. this.getRanklist();
  193. }
  194. }
  195. </script>
  196. <style scoped lang="scss">
  197. .PromoterRank .redBg {
  198. background-image: url('../static/ranking.png');
  199. background-repeat: no-repeat;
  200. background-size: 100% 100%;
  201. }
  202. .PromoterRank .header {
  203. // background: url("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAoHBwkHBgoJCAkLCwoMDxkQDw4ODx4WFxIZJCAmJSMgIyIoLTkwKCo2KyIjMkQyNjs9QEBAJjBGS0U+Sj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/Qv6C0qNdzLOpYWlpQoUKFDcZnQzOhmdDN6Gb0Np7TauzybV2eTauzybV2eTauzybV2eTauzybV2eTauzybV2eTauzybV2eTauzybV2eTae3ybT2mf2mb0LypXikJWi0IWJzFJPU5JDxOWqc6+i3fS4ytE09dz5l8i589bdESnX6am0Rmn7zmkOTl9QU2hYie8XsvESHNv6qpyIuuhug5sq3wj//EACMRAAMAAgIBAwUAAAAAAAAAAAABERIgAmAwA1FwEFCAkLD/2gAIAQIBAT8A/mZ0pSlKXqt8l+NaUv47VGSKt1oujQhN3yLdLBctl06IxIxvwJzwrpz4Ifp+w+D24vVdUiH6aMGR/VaJMhOrPgmP0/YSaIzFfuapSlKUyMjIyMjIyMjIyKUpS/GU6vOwTxTq02n2n//EACQRAAMAAgICAgIDAQAAAAAAAAABERIgAjBQYAMQQFExQZCw/9oACAEDAQE/AP8AmZ5GRWVlZkUvqlL1UT9Qpe5OCfpre9RTIpVun6W3rS9FE9U/SW9W+xPVPxdKUpSmRkUpSlKZFRUVfgN9yeq8HSlL+RWVmTMjJFX29G98kZoyW6ei8BfC16PZ8/0Nt6JtC5/vZenz65cm+jjygtFovTnwTH8f6Hwa24P+tV9oqMkZGRWV9lKXzrSY/jQ/jaI198XVoil/IpfOvgmP42cE1/Pgr56E8DS/5/QhCEIQhCEIQhCEIQhCEIQhNqZGRkZFMjIyMi7YmJiYmJiYmJiYGBgYmJiYmJiQnlmtoTaE2S9La6IRE6EvTp3QXqEJ1JCXqs2S8T//2Q==") no-repeat;
  204. width: 100%;
  205. height: 378rpx;
  206. position: relative;
  207. }
  208. .PromoterRank .header {
  209. .extension {
  210. display: flex;
  211. justify-content: space-around;
  212. position: absolute;
  213. width: 100%;
  214. bottom: 90rpx;
  215. padding: 15rpx 0;
  216. color: #fff;
  217. .item {
  218. width: 100%;
  219. text-align: center;
  220. .num {
  221. font-size: 32rpx;
  222. font-weight: bold;
  223. margin-bottom: 10rpx;
  224. }
  225. .text {
  226. font-size: 24rpx;
  227. font-weight: 400;
  228. }
  229. }
  230. }
  231. }
  232. .PromoterRank .nav {
  233. width: 100%;
  234. height: 90rpx;
  235. background: rgba(0, 0, 0, 0.1);
  236. font-size: 30rpx;
  237. color: #fff;
  238. margin: 0 auto;
  239. position: absolute;
  240. bottom: 0;
  241. .line {
  242. width: 1px;
  243. height: 42rpx;
  244. background: #FFFFFF;
  245. opacity: 0.3;
  246. }
  247. .line-sel {
  248. width: 58rpx;
  249. height: 4rpx;
  250. background: #FFFFFF;
  251. border-radius: 4rpx;
  252. margin: 0 auto;
  253. }
  254. }
  255. .PromoterRank .nav .item {
  256. flex: 1;
  257. display: flex;
  258. align-items: center;
  259. justify-content: center;
  260. flex-direction: column;
  261. height: 100%;
  262. text-align: center;
  263. color: #F2F2F2;
  264. .line-btn {
  265. margin-top: 10rpx;
  266. }
  267. }
  268. .PromoterRank .nav .item.select {
  269. color: #fff;
  270. font-weight: bold;
  271. }
  272. .PromoterRank .header .rank {
  273. padding: 54rpx 0rpx;
  274. }
  275. .PromoterRank .header .rank .item .pictrue {
  276. background-repeat: no-repeat;
  277. background-size: 100% 100%;
  278. position: relative;
  279. margin: 0 auto;
  280. }
  281. .PromoterRank .header .rank .item .pictrue image {
  282. position: absolute;
  283. display: block;
  284. bottom: 2rpx;
  285. border-radius: 50%;
  286. left: 50%;
  287. margin-left: -50rpx;
  288. }
  289. .PromoterRank .header .rank .item.one .pictrue {
  290. width: 100rpx;
  291. height: 100rpx;
  292. }
  293. .PromoterRank .header .rank .item.one .pictrue image {
  294. width: 100rpx;
  295. height: 100rpx;
  296. margin-left: -50rpx;
  297. margin-top: 10rpx;
  298. }
  299. .time {
  300. padding: 34rpx 30rpx;
  301. color: #999999;
  302. background-color: #fff;
  303. }
  304. .PromoterRank .list {
  305. // width: 710rpx;
  306. background-color: #fff;
  307. // border-radius: 20rpx;
  308. // margin: -60rpx auto 0 auto;
  309. padding: 0 30rpx;
  310. .no {
  311. width: 52rpx;
  312. height: 52rpx;
  313. image {
  314. width: 100%;
  315. height: 100%;
  316. }
  317. }
  318. }
  319. .PromoterRank .list .item {
  320. border-bottom: 1px solid #f3f3f3;
  321. height: 101rpx;
  322. font-size: 28rpx;
  323. }
  324. .PromoterRank .list .item .num {
  325. color: #666;
  326. width: 52rpx;
  327. text-align: center;
  328. }
  329. .PromoterRank .list .item .picTxt {
  330. width: 350rpx;
  331. }
  332. .PromoterRank .list .item .picTxt .pictrue {
  333. width: 68rpx;
  334. height: 68rpx;
  335. }
  336. .PromoterRank .list .item .picTxt .pictrue image {
  337. width: 100%;
  338. height: 100%;
  339. display: block;
  340. border-radius: 50%;
  341. }
  342. .PromoterRank .list .item .picTxt .text {
  343. width: 262rpx;
  344. color: #333;
  345. }
  346. .PromoterRank .list .item .people {
  347. width: 175rpx;
  348. text-align: right;
  349. }
  350. </style>