group.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. <template>
  2. <view class="center">
  3. <view class="content-money">
  4. <view class="money-box" v-if="list.length != 0">
  5. <view class="body-title">
  6. <view class="goback-box" @click="toBack"><image class="goback" src="../../static/icon/fanhui.png" mode=""></image></view>
  7. <view class="header">小组销售排行榜</view>
  8. </view>
  9. <view class="ranking-box flex">
  10. <view class="ranking-bg"><image src="../../static/img/turnover1.png" mode=""></image></view>
  11. <view class="other-item ">
  12. <view v-if="list.length >= 2">
  13. <view class="other-avatar two">
  14. <view class="huangg"><image src="../../static/img/turnover3.png" mode=""></image></view>
  15. <image :src="list[1].image" mode=""></image>
  16. </view>
  17. <view class="other-name clamp">{{ list[1].group_name }}{{ list[1].store.name }}</view>
  18. <view class="other-price">
  19. <text>¥</text>
  20. {{ list[1].sum_pay_price || 0 }}
  21. </view>
  22. </view>
  23. </view>
  24. <view class="first-item">
  25. <view class="first-avatar">
  26. <view class="huangg"><image src="../../static/img/turnover2.png" mode=""></image></view>
  27. <image :src="list[0].image" mode=""></image>
  28. </view>
  29. <view class="first-name clamp">{{ list[0].group_name }}({{ list[0].store.name }})</view>
  30. <view class="first-price">
  31. <text>¥</text>
  32. {{ list[0].sum_pay_price || 0 }}
  33. </view>
  34. </view>
  35. <view class="other-item ">
  36. <view v-if="list.length >= 3">
  37. <view class="other-avatar three">
  38. <view class="huangg"><image src="../../static/img/turnover4.png" mode=""></image></view>
  39. <image :src="list[2].image" mode=""></image>
  40. </view>
  41. <view class="other-name clamp">{{ list[2].group_name }}({{ list[2].store.name }})</view>
  42. <view class="other-price">
  43. <text>¥</text>
  44. {{ list[2].sum_pay_price || 0 }}
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="list">
  52. <view class="list-title flex">
  53. <view class="list-title-item left">排名</view>
  54. <view class="list-title-item zj">组名</view>
  55. <view class="list-title-item right">销售金额</view>
  56. </view>
  57. <scroll-view scroll-y="true" class="list-main" :style="{ height: maxheight + 'px' }" @scrolltolower="loadData()">
  58. <view class="list-main-item flex" v-for="(item, index) in list" :key="index">
  59. <view class="list-main-num left">{{ index + 1 }}</view>
  60. <view class="list-main-name zj">
  61. <!-- <image :src="item.image" mode=""></image> -->
  62. <view class="list-main-name-font clamp">{{ item.group_name }}({{ item.store.name }})</view>
  63. </view>
  64. <view class="list-main-price right">{{ item.sum_pay_price || 0 }}</view>
  65. </view>
  66. </scroll-view>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. import { groupList } from '@/api/info.js';
  72. export default {
  73. data() {
  74. return {
  75. maxheight: '',
  76. list: [],
  77. pages: 1,
  78. limit: 1000
  79. };
  80. },
  81. onReady(res) {
  82. var _this = this;
  83. uni.getSystemInfo({
  84. success: resu => {
  85. const query = uni.createSelectorQuery();
  86. query.select('.list-main').boundingClientRect();
  87. query.exec(function(res) {
  88. _this.maxheight = resu.windowHeight - res[0].top;
  89. console.log('打印页面的剩余高度', _this.maxheight);
  90. });
  91. },
  92. fail: res => {}
  93. });
  94. },
  95. onLoad() {
  96. this.loadData();
  97. },
  98. methods: {
  99. toBack() {
  100. uni.navigateBack({});
  101. },
  102. loadData() {
  103. const obj = this;
  104. if (obj.loadType == 'nomore' || obj.loadType == 'loading') {
  105. return;
  106. }
  107. obj.loadType = 'loading';
  108. groupList({
  109. pages: obj.pages,
  110. limit: obj.limit
  111. }).then(({ data }) => {
  112. console.log(data);
  113. this.list = this.list.concat(data.list);
  114. if (data.list.length == obj.limit) {
  115. obj.loadType = 'more';
  116. } else {
  117. obj.loadType = 'nomore';
  118. }
  119. });
  120. }
  121. }
  122. };
  123. </script>
  124. <style lang="scss">
  125. .center,
  126. page {
  127. min-height: 100%;
  128. // height: auto;
  129. background: #f6f6f6;
  130. }
  131. .content-money {
  132. padding-bottom: 30rpx;
  133. background: linear-gradient(0deg, #fe6f61 0%, #ff4343 100%);
  134. }
  135. .money-box {
  136. padding-top: var(--status-bar-height);
  137. height: 468rpx;
  138. color: #ffffff;
  139. text-align: center;
  140. justify-content: center;
  141. position: relative;
  142. .body-title {
  143. height: 80rpx;
  144. text-align: center;
  145. font-size: 35rpx;
  146. position: relative;
  147. .header {
  148. position: absolute;
  149. left: 0;
  150. top: 0;
  151. width: 100%;
  152. font-size: 36rpx;
  153. font-family: PingFang SC;
  154. font-weight: bold;
  155. color: #fffeff;
  156. height: 80rpx;
  157. font-size: 32rpx;
  158. font-weight: 700;
  159. z-index: 9;
  160. display: flex;
  161. justify-content: center;
  162. align-items: center;
  163. }
  164. .goback-box {
  165. position: absolute;
  166. z-index: 10;
  167. left: 24rpx;
  168. top: 0;
  169. height: 80rpx;
  170. display: flex;
  171. align-items: center;
  172. }
  173. .goback {
  174. width: 30rpx;
  175. height: 36rpx;
  176. }
  177. }
  178. .ranking-box {
  179. margin: 64rpx auto 0;
  180. width: 720rpx;
  181. height: 286rpx;
  182. position: relative;
  183. align-items: flex-end;
  184. padding-bottom: 30rpx;
  185. .ranking-bg {
  186. position: absolute;
  187. top: 0;
  188. left: 0;
  189. right: 0;
  190. width: 720rpx;
  191. height: 286rpx;
  192. image {
  193. width: 100%;
  194. height: 100%;
  195. }
  196. }
  197. .other-item {
  198. width: 216rpx;
  199. display: flex;
  200. flex-direction: column;
  201. justify-content: flex-end;
  202. align-items: center;
  203. line-height: 1;
  204. .two {
  205. border: #c8d2de 3px solid;
  206. }
  207. .three {
  208. border: #f2aa70 3px solid;
  209. }
  210. .other-avatar {
  211. position: relative;
  212. width: 84rpx;
  213. height: 84rpx;
  214. border-radius: 50%;
  215. image {
  216. width: 100%;
  217. height: 100%;
  218. }
  219. .huangg {
  220. position: absolute;
  221. width: 40rpx;
  222. height: 40rpx;
  223. top: -26rpx;
  224. left: -26rpx;
  225. image {
  226. width: 100%;
  227. height: 100%;
  228. }
  229. }
  230. }
  231. .other-name {
  232. position: relative;
  233. z-index: 2;
  234. margin-top: 15rpx;
  235. font-size: 22rpx;
  236. font-family: PingFang SC;
  237. font-weight: 500;
  238. color: #000000;
  239. }
  240. .other-price {
  241. margin-top: 14rpx;
  242. text-align: center;
  243. position: relative;
  244. z-index: 2;
  245. font-size: 36rpx;
  246. font-family: PingFang SC;
  247. font-weight: 500;
  248. color: #ef041f;
  249. text {
  250. font-size: 24rpx;
  251. }
  252. }
  253. }
  254. .first-item {
  255. width: 290rpx;
  256. display: flex;
  257. flex-direction: column;
  258. justify-content: flex-end;
  259. align-items: center;
  260. line-height: 1;
  261. .first-avatar {
  262. position: relative;
  263. width: 126rpx;
  264. height: 126rpx;
  265. border-radius: 50%;
  266. border: #ffd010 3px solid;
  267. image {
  268. width: 100%;
  269. height: 100%;
  270. }
  271. .huangg {
  272. position: absolute;
  273. z-index: 2;
  274. width: 52rpx;
  275. height: 52rpx;
  276. top: -28rpx;
  277. left: -28rpx;
  278. image {
  279. width: 100%;
  280. height: 100%;
  281. }
  282. }
  283. }
  284. .first-name {
  285. position: relative;
  286. z-index: 2;
  287. margin-top: 14rpx;
  288. font-size: 29rpx;
  289. font-family: PingFang SC;
  290. font-weight: 500;
  291. color: #000000;
  292. }
  293. .first-price {
  294. margin-top: 14rpx;
  295. text-align: center;
  296. position: relative;
  297. z-index: 2;
  298. font-size: 36rpx;
  299. font-family: PingFang SC;
  300. font-weight: 500;
  301. color: #ef041f;
  302. text {
  303. font-size: 24rpx;
  304. }
  305. }
  306. }
  307. }
  308. }
  309. .list {
  310. width: 690rpx;
  311. background: #ffffff;
  312. border-radius: 10rpx;
  313. margin: 20rpx auto 0;
  314. padding: 20rpx 42rpx 0;
  315. .list-title {
  316. background: linear-gradient(90deg, #fe6f61 0%, #ff4343 100%);
  317. border-radius: 42rpx;
  318. padding: 16rpx 0;
  319. .list-title-item {
  320. font-size: 24rpx;
  321. font-family: PingFang SC;
  322. font-weight: 500;
  323. color: #ffffff;
  324. text-align: center;
  325. }
  326. }
  327. .list-main {
  328. margin-top: 20rpx;
  329. }
  330. .list-main-item {
  331. border-bottom: 1px solid #e8e8e8;
  332. padding: 30rpx 0;
  333. .list-main-num {
  334. text-align: center;
  335. font-size: 30rpx;
  336. font-family: PingFang SC;
  337. font-weight: 500;
  338. color: #333333;
  339. }
  340. .list-main-name {
  341. display: flex;
  342. justify-content: center;
  343. image {
  344. width: 44rpx;
  345. height: 44rpx;
  346. }
  347. .list-main-name-font {
  348. margin-left: 12rpx;
  349. font-size: 28rpx;
  350. font-family: PingFang SC;
  351. font-weight: 500;
  352. color: #333333;
  353. }
  354. }
  355. .list-main-price {
  356. text-align: center;
  357. font-size: 30rpx;
  358. font-family: PingFang SC;
  359. font-weight: 500;
  360. color: #ef041f;
  361. }
  362. }
  363. }
  364. .left {
  365. width: 120rpx;
  366. }
  367. .zj {
  368. width: 316rpx;
  369. }
  370. .right {
  371. width: 184rpx;
  372. }
  373. </style>