123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387 |
- <template>
- <view class="center">
- <view class="content-money">
- <view class="money-box">
- <view class="body-title">
- <view class="goback-box" @click="toBack"><image class="goback" src="../../static/icon/fanhui.png" mode=""></image></view>
- <view class="header">排行榜</view>
- </view>
- <view class="ranking-box flex">
- <view class="ranking-bg"><image src="../../static/img/turnover1.png" mode=""></image></view>
- <view class="other-item ">
- <view v-if="list.length >= 2">
- <view class="other-avatar two">
- <view class="huangg"><image src="../../static/img/turnover3.png" mode=""></image></view>
- <image :src="list[1].avatar" mode=""></image>
- </view>
- <view class="other-name clamp">{{ list[1].nickname }}</view>
- <view class="other-price">
- <text>¥</text>
- {{ list[1].sum_pay_price || 0 }}
- </view>
- </view>
- </view>
- <view class="first-item">
- <view class="first-avatar">
- <view class="huangg"><image src="../../static/img/turnover2.png" mode=""></image></view>
- <image :src="list[0].avatar" mode=""></image>
- </view>
- <view class="first-name clamp">{{ list[0].nickname }}</view>
- <view class="first-price">
- <text>¥</text>
- {{ list[0].sum_pay_price || 0 }}
- </view>
- </view>
- <view class="other-item ">
- <view v-if="list.length >= 3">
- <view class="other-avatar three">
- <view class="huangg"><image src="../../static/img/turnover4.png" mode=""></image></view>
- <image :src="list[2].avatar" mode=""></image>
- </view>
- <view class="other-name clamp">{{ list[2].nickname }}</view>
- <view class="other-price">
- <text>¥</text>
- {{ list[2].sum_pay_price || 0 }}
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="list">
- <view class="list-title flex">
- <view class="list-title-item left">排名</view>
- <view class="list-title-item zj">会员名</view>
- <view class="list-title-item right">销售金额</view>
- </view>
- <scroll-view scroll-y="true" class="list-main" :style="{ height: maxheight + 'px' }" @scrolltolower="loadData()">
- <view class="list-main-item flex" v-for="(item, index) in list" :key="index">
- <view class="list-main-num left">{{ index + 1 }}</view>
- <view class="list-main-name zj">
- <image :src="item.avatar" mode=""></image>
- <view class="list-main-name-font clamp">{{ item.nickname }}</view>
- </view>
- <view class="list-main-price right">{{ item.sum_pay_price || 0 }}</view>
- </view>
- </scroll-view>
- </view>
- </view>
- </template>
- <script>
- import { waiter_rank } from '@/api/info.js';
- import { mapState, mapMutations } from 'vuex';
- export default {
- data() {
- return {
- maxheight: '',
- list: [],
- pages: 1,
- limit: 1000,
- loadType: 'more',
- store_id: ''
- };
- },
- onLoad(option) {
- if (option.id) {
- this.store_id = option.id;
- } else {
- this.store_id = this.userInfo.store_id;
- }
- this.loadData();
- },
- computed: {
- ...mapState(['userInfo'])
- },
- onReady(res) {
- var _this = this;
- uni.getSystemInfo({
- success: resu => {
- const query = uni.createSelectorQuery();
- query.select('.list-main').boundingClientRect();
- query.exec(function(res) {
- _this.maxheight = resu.windowHeight - res[0].top;
- console.log('打印页面的剩余高度', _this.maxheight);
- });
- },
- fail: res => {}
- });
- },
- methods: {
- toBack() {
- uni.navigateBack({});
- },
- loadData() {
- const obj = this;
- if (obj.loadType == 'nomore' || obj.loadType == 'loading') {
- return;
- }
- obj.loadType = 'loading';
- waiter_rank({
- pages: obj.pages,
- limit: obj.limit,
- store_id: obj.store_id
- }).then(({ data }) => {
- console.log(data);
- this.list = this.list.concat(data.list);
- if (data.list.length == obj.limit) {
- obj.loadType = 'more';
- } else {
- obj.loadType = 'nomore';
- }
- });
- }
- }
- };
- </script>
- <style lang="scss">
- .center,
- page {
- min-height: 100%;
- // height: auto;
- background: #f6f6f6;
- }
- .content-money {
- padding-bottom: 30rpx;
- background: linear-gradient(0deg, #ff8e00, #fe762f);
- }
- .money-box {
- padding-top: var(--status-bar-height);
- height: 468rpx;
- color: #ffffff;
- text-align: center;
- justify-content: center;
- position: relative;
- .body-title {
- height: 80rpx;
- text-align: center;
- font-size: 35rpx;
- position: relative;
- .header {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #fffeff;
- height: 80rpx;
- font-size: 32rpx;
- font-weight: 700;
- z-index: 9;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- .goback-box {
- position: absolute;
- z-index: 10;
- left: 24rpx;
- top: 0;
- height: 80rpx;
- display: flex;
- align-items: center;
- }
- .goback {
- width: 30rpx;
- height: 36rpx;
- }
- }
- .ranking-box {
- margin: 64rpx auto 0;
- width: 720rpx;
- height: 286rpx;
- position: relative;
- align-items: flex-end;
- padding-bottom: 30rpx;
- .ranking-bg {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- width: 720rpx;
- height: 286rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .other-item {
- width: 216rpx;
- display: flex;
- flex-direction: column;
- justify-content: flex-end;
- align-items: center;
- line-height: 1;
- .two {
- border: #c8d2de 3px solid;
- }
- .three {
- border: #f2aa70 3px solid;
- }
- .other-avatar {
- position: relative;
- width: 84rpx;
- height: 84rpx;
- border-radius: 50%;
- image {
- width: 100%;
- height: 100%;
- }
- .huangg {
- position: absolute;
- width: 40rpx;
- height: 40rpx;
- top: -26rpx;
- left: -26rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- .other-name {
- position: relative;
- z-index: 2;
- margin-top: 15rpx;
- font-size: 22rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #000000;
- }
- .other-price {
- margin-top: 14rpx;
- text-align: center;
- position: relative;
- z-index: 2;
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ef041f;
- text {
- font-size: 24rpx;
- }
- }
- }
- .first-item {
- width: 290rpx;
- display: flex;
- flex-direction: column;
- justify-content: flex-end;
- align-items: center;
- line-height: 1;
- .first-avatar {
- position: relative;
- width: 126rpx;
- height: 126rpx;
- border-radius: 50%;
- border: #ffd010 3px solid;
- image {
- width: 100%;
- height: 100%;
- }
- .huangg {
- position: absolute;
- z-index: 2;
- width: 52rpx;
- height: 52rpx;
- top: -28rpx;
- left: -28rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- .first-name {
- position: relative;
- z-index: 2;
- margin-top: 14rpx;
- font-size: 29rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #000000;
- }
- .first-price {
- margin-top: 14rpx;
- text-align: center;
- position: relative;
- z-index: 2;
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ef041f;
- text {
- font-size: 24rpx;
- }
- }
- }
- }
- }
- .list {
- width: 690rpx;
- background: #ffffff;
- border-radius: 10rpx;
- margin: 20rpx auto 0;
- padding: 20rpx 42rpx 0;
- .list-title {
- background: linear-gradient(90deg, #ff8e00, #fe762f);
- border-radius: 42rpx;
- padding: 16rpx 0;
- .list-title-item {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ffffff;
- text-align: center;
- }
- }
- .list-main {
- margin-top: 20rpx;
- }
- .list-main-item {
- border-bottom: 1px solid #e8e8e8;
- padding: 30rpx 0;
- .list-main-num {
- text-align: center;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- .list-main-name {
- display: flex;
- justify-content: center;
- image {
- width: 44rpx;
- height: 44rpx;
- }
- .list-main-name-font {
- margin-left: 12rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- }
- .list-main-price {
- text-align: center;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ef041f;
- }
- }
- }
- .left {
- width: 120rpx;
- }
- .zj {
- width: 316rpx;
- }
- .right {
- width: 184rpx;
- }
- </style>
|