123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
- <member-base :show="false"><view style="position: absolute;top:0;right:0;left:0;bottom:0" class="scroll-view-wrapper div container">
- <view class="div common-header-wrap">
- <view class="status-holder"></view>
- <view :style="'height:'+navHeight+'px'"></view>
- <view class="common-header-holder"></view>
- <view class="common-header-fixed">
- <title-header />
- <uni-nav-bar title="红包领取记录" class="common-header" left-icon="back" @clickLeft="goBack()">
- </uni-nav-bar>
- </view>
- </view>
- <view class="scroll-view div" style="position:relative">
- <scroll-view style="position: absolute;top:0;right:0;left:0;bottom:0" class="div" @scrolltolower="loadMore" scroll-y="true">
- <view
- class="div list-wrapper"
- v-if="log_list && log_list.length"
- >
- <view
- class="div point-list"
- v-for="(item, index) in log_list"
- :key="item.bonusreceive_id"
- >
- <view class="div info">
- <view class="div title"></view>
- <view class="div time">{{ $moment.unix(item.bonusreceive_time).format('YYYY年MM月DD日') }}</view>
- </view>
- <view class="div number">+{{ item.bonusreceive_price }}</view>
- </view>
- </view>
- <empty-record v-else-if="log_list && !log_list.length"></empty-record>
- </scroll-view>
- </view>
- </view></member-base>
- </template>
- <script>
- import {getFontSize} from '@/util/common'
- import TitleHeader from '../../TitleHeader'
- import MemberBase from '../MemberBase'
- import { getReceiveList } from '../../../api/homeBonus'
- import EmptyRecord from '../../EmptyRecord'
- export default {
- components:{
- TitleHeader,
- MemberBase,
- EmptyRecord
- },
- computed:{
- fontSize(){
- return getFontSize()
- },
- },
- data(){
- return {
- navHeight: 0,
- params: { 'page': 0, 'per_page': 10 },
- loading: false, // 是否加载更多
- isMore: true, // 是否有更多
- wrapperHeight: 0,
- log_list: false
- }
- },
- created () {
- this.loadMore()
- },
- mounted(){
- // #ifdef MP-WEIXIN
- this.navHeight = uni.getMenuButtonBoundingClientRect().top
- // #endif
- this.wrapperHeight = uni.getSystemInfoSync().windowHeight - 130
- },
- methods: {
- goBack () {
- uni.navigateBack({delta:1})
- },
- loadMore () {
- this.loading = true
- this.params.page = ++this.params.page
- if (this.isMore) {
- this.loading = false
- this.getReceiveList(true)
- }
- },
- getReceiveList () {
- uni.showLoading({ title: '加载中' })
- getReceiveList(this.params).then(res => {
- uni.hideLoading()
- if (res.result.hasmore) {
- this.isMore = true
- } else {
- this.isMore = false
- }
- let temp = res.result.log_list
- if (temp) {
- if (!this.log_list) {
- this.log_list = temp
- } else {
- this.log_list = this.log_list.concat(temp)
- }
- }
- }).catch(function (error) {
- uni.hideLoading()
- uni.showToast({icon:'none',title: error.message})
- })
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .scroll-view-wrapper{display: flex;flex-direction: column;}
- .scroll-view{flex:1}
- .container {
- height: 100%;
- display: flex;
- position: relative;
- flex-direction: column;
- justify-content: flex-start;
- align-items: stretch;
- }
- .header {
- border-bottom: 1px solid #e8eaed;
- }
- .list-wrapper {
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: flex-start;
- align-items: stretch;
- .point-list {
- background-color: #fff;
- border-bottom: 1px solid #e8eaed;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0.55rem 0.75rem;
- .right{width:2.5rem;}
- .info {
- flex:1;
- .title {
- font-size:$subFontSize;
- color: #333;
- }
- .time {
- font-size:$fontSize;
- color: #999;
- margin-top:0.25rem;
- }
- }
- .number {
- font-size:$h1;
- color:$primaryColor;
- }
- .diture {
- font-size:$h1;
- color: rgba(102, 102, 102, 1);
- }
- }
- }
- </style>
|