123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389 |
- <template>
- <view class="content">
- <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">
- {{userInfo.order_count || '0'}}
- </view>
- <view class="top-tit">
- 本月销售金额
- </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="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.title }}</view>
- </view> -->
- <swiper :current="tabCurrentIndex" :style="{ height: height }" class="swiper-box" duration="300" disable-touch>
- <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">
- <image src="https://api.junhailan.com/img/admin/ywc.png" mode="" class="logo" v-if="userInfo.order_count*1 >= item.number*1"></image>
- <image src="https://api.junhailan.com/img/admin/dwc.png" mode="" class="logo" v-else></image>
- <!-- <image src="" mode="" class="logo"></image> -->
- <view class="title-box">
- <view class="title">
- <!-- <text>{{ item.mark }}</text> -->
- {{item.name}}
- </view>
- <view class="time">
- <!-- <text>{{ item.create_time }}</text> -->
- <!-- 2022-12-1 09:30 -->
- 奖股权{{item.lj}}
- </view>
- </view>
- <view class="money">
- {{(userInfo.order_count*1 >= item.number*1 )? "已完成": '未完成'}}
- <!-- <view>{{ (item.pm == 0 ? '-' : '+') + 1500 }}</view>
- <image src="../../static/img/downright.png" mode=""></image> -->
- </view>
- </view>
- <u-loadmore :status="tabItem.loadingType" v-if="tabItem.loaded && tabItem.list.length > 0"/>
- </scroll-view>
- </swiper-item>
- </swiper>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- userInfo: {},
- showdate: '',
- tabCurrentIndex: 0,
- height: '',
- id: '',
- navlist: [{
- status: 0,
- title: '收入',
- list: [],
- page: 1,
- pageSize: 1000,
- loaded: false,
- loadingType: 'loadmore'
- },
- {
- status: 1,
- title: '扣除',
- list: [],
- page: 1,
- pageSize: 1000,
- loaded: false,
- loadingType: 'loadmore'
- }
- ]
- }
- },
- onLoad(opt) {
-
- },
- onShow() {
- this.getCustomerInfo()
- },
- 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')
- },
- // 获取当前年月
- 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'
- this.$u.api.StaffLadder({
- page: item.page,
- pageSize: item.pageSize
- }).then(({data})=> {
- console.log(data,'返回');
- let arr = []
- let len = data.length - 1
- data.forEach((item,index) => {
- // arr.push(item.stock*1)
- // console.log(index);
- item.lj = 0
-
- for(let i = index;i<=len;i++) {
- item.lj = item.lj + data[i].stock*1
- }
- arr.push(item)
- console.log('item.lj:',item.lj);
- })
- console.log(data,arr,'arr+++');
- item.list = arr
- item.loaded = true
- item.loadingType = 'nomore'
- })
- },
- getCustomerInfo() {
- this.$u.api.getYgdetail({
- request_id: this.$store.state.userInfo.staffId
- }).then(({
- data
- }) => {
- this.userInfo = data
- console.log(data,'userInfo');
- this.loadData()
- })
-
- },
- }
- }
- </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;
- }
- }
- }
- .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;
- }
- }
- }
- .navbar {
- margin-top: 20rpx;
- display: flex;
- height: 88rpx;
- padding: 0 5px;
- background: #fff;
- box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
- position: relative;
- z-index: 10;
- .nav-item {
- flex: 1;
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100%;
- font-size: 15px;
- color: #999999;
- position: relative;
- &.current {
- color: #000;
- &:after {
- content: '';
- position: absolute;
- left: 50%;
- bottom: 0;
- transform: translateX(-50%);
- width: 44px;
- height: 0;
- border-bottom: 2px solid #fe5b38;
- }
- }
- }
- }
- //列表
- .swiper-box {
- margin-top: 20rpx;
- padding: 0 20rpx;
- background-color: #fff;
- .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;
- border-bottom: 1rpx solid #F0F0F0;
- .logo {
- flex-shrink: 0;
- margin-right: 20rpx;
- width: 45rpx;
- height: 45rpx;
- border-radius: 50%;
- background-color: #eee;
- }
- .title-box {
- flex-grow: 1;
- padding-right: 50rpx;
- .title {
- font-size: 30rpx;
- color: #333333;
- }
- .time {
- font-size: 26rpx;
- color: #AEAEAE;
- }
- }
- .money {
- color: #AEAEAE;
- min-width: 150rpx;
- font-size: 26rpx;
- text-align: right;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- image {
- width: 10rpx;
- height: 20rpx;
- margin-left: 15rpx;
- }
- .status {
- color: #AEAEAE;
- }
- }
- }
- }
- .list-scroll-content {
- background: #ffffff;
- height: 100%;
- }
- </style>
|