123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- <template>
- <view class="content">
- <view class="background">
- <image src="../../static/merchant/vipbackground.png" mode=""></image>
- <view class="title">
- {{ number }}
- <text class="ren">人</text>
- </view>
- </view>
- <scroll-view scroll-y="true" class="scroll-wrapper" :style="{ height: height }">
- <!-- 空白页 -->
- <!-- <empty v-if=" loaded && vipList.length == 0"></empty> -->
- <view class="vip-wrapper">
- <view class="vip" v-for="item in vipList">
- <view class="img"><image :src="item.avatar" mode=""></image></view>
- <view class="vip-content">
- <view class="left">
- <view class="top">
- <view class="name">{{ item.nickname }}</view>
- <view class="nameplate"></view>
- </view>
- <view class="bottom">{{ item.phone }}</view>
- </view>
- <view class="right">消费:¥{{ item.consume_sum }}</view>
- </view>
- </view>
- </view>
- <uni-load-more :status="loadingType"></uni-load-more>
- </scroll-view>
- <!-- <view class="vip-box">
-
- </view> -->
- </view>
- </template>
- <script>
- import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
- import empty from '@/components/empty';
- import { member } from '@/api/merchant.js'
- export default {
- components: {
- empty,
- uniLoadMore
- },
- data() {
- return {
- loadingType: 'more',
- page: 1,
- limit: 10,
- height: '',
- number: 0, //人数
- vipList: []
- };
- },
- onReady(res) {
- var _this = this;
- uni.getSystemInfo({
- success: resu => {
- const query = uni.createSelectorQuery();
- query.select('.scroll-wrapper').boundingClientRect();
- query.exec(function(res) {
- console.log(res, 'ddddddddddddd');
- _this.height = resu.windowHeight - res[0].top + 'px';
- console.log('打印页面的剩余高度', _this.height);
- });
- },
- fail: res => {}
- });
- },
- onLoad() {
- this.loadData();
- },
- methods: {
- loadData() {
- let obj = this;
- console.log('加载数据');
- if (obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
- return;
- }
- obj.loadingType = 'loading'
- member({}).then(({data}) =>{
- console.log(data)
- this.number = data.count
- this.vipList = this.vipList.concat(data.data)
- obj.page ++
- if (data.data.length == obj.limit) {
- obj.loadingType = 'more';
- } else {
- obj.loadingType = 'noMore';
- }
- })
- }
- }
- };
- </script>
- <style lang="scss">
- .background {
- display: flex;
- justify-content: center;
- position: relative;
- width: 100%;
- height: 360rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .title {
- position: absolute;
- text-align: center;
- line-height: 360rpx;
- font-size: 72rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ffffff;
- .ren {
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ffffff;
- line-height: 43rpx;
- }
- }
- .scroll-wrapper {
- margin-top: 20rpx;
- }
- .vip-wrapper {
- padding: 0 26rpx 0 23rpx;
- background-color: #fff;
- }
- .vip {
- border-top: 1rpx solid #e3e3e3;
- display: flex;
- align-items: center;
- .img {
- margin: 0 20rpx;
- width: 80rpx;
- height: 80rpx;
- border-radius: 50%;
- image {
- border-radius: 50%;
- width: 100%;
- height: 100%;
- }
- }
- .vip-content {
- margin: 30rpx 0;
- display: flex;
- justify-content: space-between;
- width: 580rpx;
- display: flex;
- align-items: center;
- .left {
- display: flex;
- flex-direction: column;
- .top {
- display: flex;
- .name {
- font-size: 30rpx;
- font-family: PingFangSC;
- font-weight: 500;
- color: #3f454b;
- }
- .nameplate {
- }
- }
- .bottom {
- font-size: 22rpx;
- font-family: PingFang SC;
- font-weight: 400;
- color: #999999;
- }
- }
- .right {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ff6f0f;
- }
- }
- }
- </style>
|