employee.vue 8.2 KB

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