123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392 |
- <template>
- <view class="content" :class="['qn-page-' + theme]">
- <!-- <view class="user-top">
- <view class="select-time">
- <picker mode="date" @change="bindDateChange" fields="month">
- <view class="uni-input">{{showdate}}</view>
- </picker>
- <image src="../../static/img/downjian.png" mode="widthFix"></image>
- </view>
- <view class="top-val">
- 当前股权
- </view>
- <view class="top-tit">
- 当前股权
- </view>
- <view class="top-btn">
- <view class="left">
-
- </view>
- <view class="center">
-
- </view>
- <view class="right" @click="goPage('/pagesS/yg/gqtx')">
- 股权提现
- </view>
- </view>
- </view>
- <view class="sz-wrap">
- <view class="sz-item">
- <view class="sz-tit">
- 累计总股权
- </view>
- <view class="sz-val">
- 200
- </view>
- </view>
- <view class="jg"></view>
- <view class="sz-item">
- <view class="sz-tit">
- 业绩股权
- </view>
- <view class="sz-val">
- 200
- </view>
- </view>
- </view> -->
- <view class="navbar">
- <view v-for="(item, index) in navlist" :key="index" class="nav-item" :class="[tabCurrentIndex === index ? 'current' : '']" @click="tabClick(index)">
- {{item.title}}({{ tabCurrentIndex == 0? (dends*1).toFixed(2):(shares*1).toFixed(2)}})
- <view class="current-line primary-btn"></view>
- </view>
- </view>
- <!-- <view class="navbar">
- <view v-for="(item, index) in navlist" :key="index" class="nav-item"
- :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{item.title}}({{ tabCurrentIndex == 0? (dends*1).toFixed(2):(shares*1).toFixed(2)}})</view>
- </view> -->
- <swiper :current="tabCurrentIndex" :style="{ height: height }" class="swiper-box" duration="300" @change="changeTab">
- <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navlist" :key="tabIndex">
- <scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData">
- <!-- 空白页 -->
- <u-empty text="暂无数据" mode="list" v-if="tabItem.loaded && tabItem.list.length == 0"></u-empty>
- <!-- 订单列表 -->
- <view class="order-item" v-for="(item, index) in tabItem.list" :key="index">
- <view class="title-box">
- <view class="title">
- <!-- <text>{{ item.mark }}</text> -->
- {{tabCurrentIndex == 0? item.mark : item.remarks}}
- </view>
- <view class="time">
- <!-- <text>{{ item.create_time }}</text> -->
- {{$_utils.formatDate(item.createTime)}}
- </view>
- </view>
- <view class="money">
- <!-- <view>{{ (item.pm == 0 ? '-' : '+') + item.number }}</view> -->
- +{{item.number}}
- </view>
- </view>
- <u-loadmore :status="tabItem.loadingType" />
- </scroll-view>
- </swiper-item>
- </swiper>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- // showdate: '',
- tabCurrentIndex: 0,
- height: '',
- id: '',
- navlist: [{
- status: 'getFh',
- title: '分红股份',
- list: [],
- page: 1,
- pageSize: 10,
- loaded: false,
- loadingType: 'loadmore',
- },
- {
- status: 'getBsGf',
- title: '原始股份',
- list: [],
- page: 1,
- pageSize: 10,
- loaded: false,
- loadingType: 'loadmore'
- }
- ],
- dends: 0,
- shares: 0,
- }
- },
- onLoad(opt) {
- // this.getTime()
- },
- onShow() {
- this.getGq()
- this.loadData()
- },
- onReachBottom() {
- },
- onReady() {
- var _this = this;
- uni.getSystemInfo({
- success: resu => {
- const query = uni.createSelectorQuery();
- query.select('.swiper-box').boundingClientRect();
- query.exec(function(res) {
- _this.height = resu.windowHeight - res[0].top + 'px';
- console.log('打印页面的剩余高度', _this.height);
- });
- },
- fail: res => {}
- });
- },
- methods: {
- //顶部tab点击
- tabClick(index) {
- this.tabCurrentIndex = index;
- // this.loadData('tab')
- },
- // 选择年月
- bindDateChange(e) {
- let time = e.detail.value.split('-')
- this.showdate = time[0] + '年' + time[1] + '月'
- this.loadData('reload')
- },
- changeTab(e) {
- console.log(e)
- this.tabCurrentIndex = e.detail.current;
- this.loadData('tab')
- },
- // 获取当前年月
- // getTime() {
- // let date = new Date()
- // this.showdate = date.getFullYear() + '年' + (date.getMonth() + 1) + '月'
- // this.loadData()
- // },
- // 获取数据
- loadData(type) {
- let that = this
- let index = that.tabCurrentIndex
- let item = that.navlist[index]
- if (type == 'reload') {
- item.loaded = false
- item.loadingType = 'more'
- item.page = 1
- item.list = []
- }
- if (type == 'tab' && item.loaded) {
- return
- }
- if (item.loadingType == 'loading' || item.loadingType == 'noMore') {
- return
- }
- item.loadingType = 'loading'
- that.$u.api[item.status]().then(({data})=> {
- item.list = item.list.concat(data)
- item.page++
- if(data.length == item.pageSize) {
- item.loadingType = 'loadmore'
- }else {
- item.loadingType = 'nomore'
- }
- item.loaded = true
- })
- },
- getGq() {
- this.$u.api.getGq({}).then(res=> {
- this.dends = data.dends
- this.shares = data.shares
- })
- }
- }
- }
- </script>
- <style lang="scss">
- .user-top {
- width: 100%;
- height: 400rpx;
- background-color: #4075d6;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding-bottom: 60rpx;
- // position: relative;
- .top-tit {
- font-size: 30rpx;
- font-weight: bold;
- color: #FFFFFF;
- }
- .top-val {
- font-size: 72rpx;
- font-weight: 500;
- color: #FFFFFF;
- }
- .select-time {
- position: absolute;
- top: 30rpx;
- right: 30rpx;
- font-size: 26rpx;
- font-weight: 500;
- color: #fff;
- display: flex;
- align-items: center;
- image {
- width: 17rpx;
- margin-left: 10rpx;
- }
- }
- .top-btn {
- margin-top: 20rpx;
- width: 100%;
- display: flex;
- justify-content: space-between;
- padding: 0 50rpx;
- font-size: 30rpx;
- font-weight: bold;
- color: #FFFFFF;
- .right {
- text-align: right;
- }
- .left {
- text-align: left;
- }
- .center {
- text-align: center;
- }
- view {
- width: 33.3%;
- }
- }
- }
- .sz-wrap {
- width: 670rpx;
- height: 186rpx;
- background: #FFFFFF;
- box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
- border-radius: 20rpx;
- margin: -90rpx auto 20rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- .jg {
- width: 2rpx;
- height: 74rpx;
- background: #DCDFE6;
- }
- .sz-item {
- width: 330rpx;
- height: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- font-size: 30rpx;
- font-weight: bold;
- .sz-tit {
- color: #999999;
- }
- .sz-val {
- margin-top: 30rpx;
- color: #181818;
- }
- }
- }
-
- //列表
- .swiper-box {
- .order-item:last-child {
- margin-bottom: 60rpx;
- }
- .order-item {
- width: 100%;
- // background-color: red;
- padding: 20rpx 30rpx;
- line-height: 1.5;
- display: flex;
- align-items: center;
- .title-box {
- flex-grow: 1;
- padding-right: 50rpx;
- .title {
- font-size: 30rpx;
- color: #333333;
- }
- .time {
- font-size: 26rpx;
- color: #AEAEAE;
- }
- }
- .money {
- color: #fd5b23;
- font-size: 26rpx;
- text-align: right;
- .status {
- color: #AEAEAE;
- }
- }
- }
- }
- .list-scroll-content {
- background: #ffffff;
- height: 100%;
- }
- .navbar {
- display: flex;
- height: 88upx;
- background: #fff;
- position: relative;
- z-index: 10;
- border-bottom: 1upx solid #eee;
-
- .nav-item {
- flex: 1;
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100%;
- font-size: 28upx;
- color: #666666;
- position: relative;
- font-weight: 300;
-
- &.current {
- font-weight: 500;
- .current-line {
- content: '';
- position: absolute;
- left: 50%;
- bottom: 10upx;
- transform: translateX(-50%);
- width: 40upx;
- height: 6upx;
- background: $base-btn-bg;
- border-radius: 6upx;
- /*border-bottom: 2px solid #F53C28;*/
- }
- }
- }
- }
- </style>
|