lhl 1 年間 前
コミット
c225edb3cb
4 ファイル変更109 行追加19 行削除
  1. 4 0
      api/user.js
  2. 8 0
      pages/user/index.vue
  3. 97 19
      pages/users/user_spread_money/index.vue
  4. BIN
      static/images/myyj.png

+ 4 - 0
api/user.js

@@ -773,4 +773,8 @@ export function getStaffInfo(data) {
 //股权提现
 export function equityWithdrawal(data) {
 	return request.post('equityWithdrawal',data);
+}
+
+export function getYjList(data) {
+	return request.get('getPerformanceList',data);
 }

+ 8 - 0
pages/user/index.vue

@@ -428,6 +428,14 @@
 			    <view class="iconfont icon-xiangyou"></view>
 			  </view>
 			</view>
+			<view class="item acea-row row-between-wrapper" hover-class="none"
+			  @click="goMenuPage('/pages/users/user_spread_money/index?type=6', '我的业绩')">
+			  <image src="/static/images/myyj.png"></image>
+			  <view class="text acea-row row-between-wrapper">
+			    <view>我的业绩</view>
+			    <view class="iconfont icon-xiangyou"></view>
+			  </view>
+			</view>
 			<view class="item acea-row row-between-wrapper" hover-class="none"
 			  @click="goMenuPage('/pages/users/user_spread_money/index?type=4', '我的提现')">
 			  <image src="/static/images/staffTarget.png"></image>

+ 97 - 19
pages/users/user_spread_money/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view :style="colorStyle">
 		<view class='commission-details'>
-			<view class='search acea-row row-between-wrapper' v-if="recordType != 1 && recordType != 4 && recordType!=5">
+			<view class='search acea-row row-between-wrapper' v-if="recordType != 1 && recordType != 4 && recordType!=5 && recordType!= 6">
 				<view class='input'>
 					<text class="iconfont icon-sousuo4"></text>
 					<input placeholder='搜索用户名称' placeholder-class='placeholder' v-model="keyword" @confirm="submitForm"
@@ -10,7 +10,7 @@
 			</view>
 			<timeSlot @changeTime="changeTime" v-if="recordType!=5"></timeSlot>
 			<view class='sign-record'>
-				<view class="top_num" v-if="recordType != 4 && recordList.length && recordType!=5">
+				<view class="top_num" v-if="recordType != 4 && recordList.length && recordType!=5 && recordType!=6">
 					支出:¥{{expend || 0}} &nbsp;&nbsp;&nbsp; 收入:¥{{income || 0}}
 				</view>
 				<view class="top_num top_num_2" v-if="recordType == 5">
@@ -30,7 +30,7 @@
 										<view>
 											<view class='name line1'>
 												
-												 <text v-if="recordType!=5">{{item.title}}</text>
+												 <text v-if="recordType!=5 && recordType!=6">{{item.title}}</text>
 												 <text v-else>{{item.content}}</text>
 												<!-- <text class="status_badge success" v-if="recordType == 4 && item.status == 1">审核通过</text> -->
 												<text class="status_badge default" v-if="recordType == 4 && item.status == 0">待审核</text>
@@ -38,17 +38,21 @@
 												<!-- 提现记录: 0 待审核 1 通过 2 未通过 -->
 											 </view>
 											 <view class="mark" v-if="recordType == 4 && item.mark && item.status !== 1">{{item.mark}}</view>
-											<view v-if="recordType!=5">{{item.add_time}}</view>
+											<view v-if="recordType!=5 && recordType!=6">{{item.add_time}}</view>
 											<view v-else>{{item.create_time}}</view>
 										</view>
-										<template v-if="recordType!=5">
+										<template v-if="recordType!=5 && recordType!=6">
 											<view class='num font-color' v-if="item.pm == 1">+{{item.number}}</view>
 											<view class='num' v-else>-{{item.number}}</view>
 										</template>
-										<template v-else>
+										<template v-if="recordType == 5">
 											<view class='num font-color' v-if="item.pm == 1">+{{item.shareholding}}</view>
 											<view class='num' v-else>-{{item.shareholding}}</view>
 										</template>
+										<template v-if="recordType == 6">
+											<view class='num font-color' v-if="item.pm == 1">+{{item.performance}}</view>
+											<view class='num' v-else>-{{item.performance}}</view>
+										</template>
 									</view>
 									<!-- </block> -->
 								</view>
@@ -78,7 +82,8 @@
 		getSpreadInfo,
 		getGqList,
 		getStaffInfo,
-		getUserInfo
+		getUserInfo,
+		getYjList
 	} from '@/api/user.js';
 	import {
 		toLogin
@@ -99,6 +104,7 @@
 		mixins: [colors],
 		data() {
 			return {
+				timer: '',
 				userInfo: {},
 				staffInfo: {},
 				name: '',
@@ -163,6 +169,15 @@
 				this.name = '股权明细';
 				
 				this.getStaffInfo()
+			}else if(type == 6) {
+				uni.setNavigationBarTitle({
+					title: "业绩记录"
+				});
+				this.recordType = 6;
+				this.name = '业绩明细';
+				
+				this.getStaffInfo()
+				// this.getYjList()
 			} else {
 				uni.showToast({
 					title: '参数错误',
@@ -186,6 +201,35 @@
 			}
 		},
 		methods: {
+			getYjList(time,type) {
+				let that = this;
+				let page = that.page;
+				let limit = that.limit;
+				if(type = 're') {
+					page = 1
+					that.loading = false
+					that.loadend = false
+					this.recordList = []
+				}
+				if (that.loading) return;
+				if (that.loadend) return;
+				getYjList({
+					page: page,
+					limit: limit,
+					create_time: that.timer,
+					member_id: that.staffInfo.id
+				}).then(res => {
+					this.recordList = this.recordList.concat(res.data.list)
+					let loadend = res.data.list.length < that.limit;
+					that.loadend = loadend;
+					that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
+					that.page += 1;
+					that.loading = false;
+				}).catch(err => {
+					that.loading = false;
+					that.loadTitle = '加载更多';
+				})
+			},
 			// 显示详细
 			showDetail(item){
 				uni.showModal({
@@ -215,14 +259,40 @@
 				this.$set(this, 'times', []);
 				this.getRecordList();
 			},
+			getTimeStr(timestamp) {
+				let date;
+				if(timestamp) {
+					date = new Date(timestamp*1000);
+				}else {
+					date = new Date();
+				}
+				const year = date.getFullYear();
+				const month = date.getMonth() + 1; // 月份从 0 开始,所以需要加 1
+				const day = date.getDate();
+				return year + '/' + (month>9?month: '0' + month) + '/' + (day>9?day: '0' + day)
+			},
 			changeTime(time) {
-				this.start = time.start
-				this.stop = time.stop
-				this.page = 1;
-				// this.loading = false;
-				this.loadend = false;
-				this.$set(this, 'recordList', []);
-				this.getRecordList();
+				console.log(time,'time')
+				if(this.recordType == 6) {
+					let times = ''
+					if(time.start == 0 && time.stop == 0 ) {
+						console.log('全部')
+						this.timer = '2020/01/01-' + this.getTimeStr()
+					}else {
+						this.timer = this.getTimeStr(time.start) + '-' + this.getTimeStr(time.stop)
+					}
+					console.log(this.timer,'timer')
+					this.getYjList()
+				}else {
+					this.start = time.start
+					this.stop = time.stop
+					this.page = 1;
+					// this.loading = false;
+					this.loadend = false;
+					this.$set(this, 'recordList', []);
+					this.getRecordList();
+				}
+				
 			},
 			getGqList() {
 				let that = this;
@@ -250,14 +320,16 @@
 				let that = this
 				getUserInfo().then(res => {
 					that.userInfo = res.data
-					that.getGqList();
+					if(this.recordType == 5) {
+						that.getGqList();
+					}
 					getStaffInfo({
 						uid: res.data.uid
 					}).then(ress => {
-						console.log(ress)
-						
 						that.staffInfo = ress.data.list[0]
-						
+						if(this.recordType == 6) {
+							that.getYjList()
+						}
 					})
 				})
 				
@@ -317,7 +389,13 @@
 			}
 		},
 		onReachBottom: function() {
-			this.getRecordList();
+			if(this.recordType == 5) {
+				this.getGqList()
+			}else if(this.recordType == 6){
+				this.getYjList()
+			}else {
+				this.getRecordList();
+			}
 		}
 	}
 </script>

BIN
static/images/myyj.png