lhl пре 1 година
родитељ
комит
2fc2adb990

+ 12 - 0
api/user.js

@@ -761,4 +761,16 @@ export function orderSubscribe(data) {
 	return request.get('store/order/subscribe',data);
 }
 
+//获取股权记录
+export function getGqList(data) {
+	return request.get('recordList',data);
+}
+
+export function getStaffInfo(data) {
+	return request.get('userShareholding',data);
+}
 
+//股权提现
+export function equityWithdrawal(data) {
+	return request.post('equityWithdrawal',data);
+}

+ 1 - 0
pages/admin/store/index.vue

@@ -349,6 +349,7 @@
 				uni.scanCode({
 					scanType: ["qrCode", "barCode"],
 					success(res) {
+						console.log('res',res)
 						self.verify_code = res.result
 						self.codeChange();
 					},

+ 8 - 0
pages/user/index.vue

@@ -420,6 +420,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=5', '我的股权')">
+			  <image src="/static/images/guquan.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>

+ 150 - 95
pages/users/user_payment/index.vue

@@ -1,73 +1,80 @@
 <template>
 	<view>
 		<form @submit="submitSub" :style="colorStyle">
-			<view class="payment-top acea-row row-column row-center-wrapper">
+			<view class="payment-top acea-row row-column row-center-wrapper" v-if="is_gq !=1">
 				<span class="name">我的余额</span>
 				<view class="pic">
 					¥<span class="pic-font">{{ userinfo.now_money || 0 }}</span>
 				</view>
 			</view>
+			<view class="payment-top acea-row row-column row-center-wrapper" v-else>
+				<span class="name">我的股权</span>
+				<view class="pic">
+					¥<span class="pic-font">{{ staffInfo.shareholding || 0 }}</span>
+				</view>
+			</view>
 			<view class="payment">
-				<view class="nav acea-row row-around row-middle">
+				<view class="nav acea-row row-around row-middle" v-if="is_gq !=1">
 					<view class="item" :class="active==index?'on':''" v-for="(item,index) in navRecharge" :key="index"
 						@click="navRecharges(index)">{{item}}</view>
 				</view>
-				<view class='tip picList' v-if='!active'>
-					<view class="pic-box pic-box-color acea-row row-center-wrapper row-column"
-						:class="activePic == index ? 'pic-box-color-active' : ''" v-for="(item, index) in picList"
-						:key="index" @click="picCharge(index, item)" v-if="item.price">
-						<view class="pic-number-pic">
-							{{ item.price }}<span class="pic-number"> 元</span>
+					<view class='tip picList' v-if='!active'>
+						<view class="pic-box pic-box-color acea-row row-center-wrapper row-column"
+							:class="activePic == index ? 'pic-box-color-active' : ''" v-for="(item, index) in picList"
+							:key="index" @click="picCharge(index, item)" v-if="item.price">
+							<view class="pic-number-pic">
+								{{ item.price }}<span class="pic-number"> 元</span>
+							</view>
+							<view class="pic-number">赠送:{{ item.give_money }} 元</view>
 						</view>
-						<view class="pic-number">赠送:{{ item.give_money }} 元</view>
-					</view>
-					<view class="pic-box pic-box-color acea-row row-center-wrapper"
-						:class="activePic == picList.length ? 'pic-box-color-active' : ''"
-						@click="picCharge(picList.length)">
-						<input type="digit" placeholder="其他" v-model="money" class="pic-box-money pic-number-pic"
-							:class="activePic == picList.length ? 'pic-box-color-active' : ''" />
-					</view>
-
-					<view class="flex share-user">
-						<view class="title">
-							邀请人:
+						<view class="pic-box pic-box-color acea-row row-center-wrapper"
+							:class="activePic == picList.length ? 'pic-box-color-active' : ''"
+							@click="picCharge(picList.length)">
+							<input type="digit" placeholder="其他" v-model="money" class="pic-box-money pic-number-pic"
+								:class="activePic == picList.length ? 'pic-box-color-active' : ''" />
 						</view>
-						<view class="input-box">
-							<input type="text" placeholder="请输入邀请人会员码" v-model="verify_code" class="input-user" />
+					
+						<view class="flex share-user">
+							<view class="title">
+								邀请人:
+							</view>
+							<view class="input-box">
+								<input type="text" placeholder="请输入邀请人会员码" v-model="verify_code" class="input-user" />
+							</view>
+							<!-- #ifdef H5 -->
+							<view class="iconfont icon-saoma" @click="scanCode"></view>
+							<!-- #endif -->
+							<!-- #ifdef MP || MP-WEIXIN || APP -->
+							<view class="iconfont icon-saoma" @click="scanCode">
+							</view>
+							<!-- #endif -->
 						</view>
-						<!-- #ifdef H5 -->
-						<view class="iconfont icon-saoma" @click="scanCode"></view>
-						<!-- #endif -->
-						<!-- #ifdef MP || MP-WEIXIN || APP -->
-						<view class="iconfont icon-saoma" @click="scanCode">
+						<view class="tips-box">
+							<view class="tips mt-30">注意事项:</view>
+							<view class="tips-samll" v-for="item in rechargeAttention" :key="item">
+								{{ item }}
+							</view>
 						</view>
-						<!-- #endif -->
 					</view>
-					<view class="tips-box">
-						<view class="tips mt-30">注意事项:</view>
-						<view class="tips-samll" v-for="item in rechargeAttention" :key="item">
-							{{ item }}
+					<view class="tip" v-else>
+						<view class='input'><text>¥</text><input @input='inputNum' :maxlength="moneyMaxLeng"
+								placeholder="0.00" type='digit' placeholder-class='placeholder' :value="number"
+								name="number"></input></view>
+						<view class="tips-title" v-if="is_gq != 1">
+							<view style="font-weight: bold; font-size: 26rpx;">提示:</view>
+							<view style="margin-top: 10rpx;">当前可转入佣金为 <text
+									class='font-color'>¥{{userinfo.commissionCount || 0}}</text>,冻结佣金为<text
+									class='font-color'>¥{{userinfo.broken_commission}}</text></view>
 						</view>
-					</view>
-				</view>
-				<view class="tip" v-else>
-					<view class='input'><text>¥</text><input @input='inputNum' :maxlength="moneyMaxLeng"
-							placeholder="0.00" type='digit' placeholder-class='placeholder' :value="number"
-							name="number"></input></view>
-					<view class="tips-title">
-						<view style="font-weight: bold; font-size: 26rpx;">提示:</view>
-						<view style="margin-top: 10rpx;">当前可转入佣金为 <text
-								class='font-color'>¥{{userinfo.commissionCount || 0}}</text>,冻结佣金为<text
-								class='font-color'>¥{{userinfo.broken_commission}}</text></view>
-					</view>
-					<view class="tips-box">
-						<view class="tips mt-30">注意事项:</view>
-						<view class="tips-samll" v-for="item in rechargeAttention" :key="item">
-							{{ item }}
+						<view class="tips-box" v-if="is_gq != 1">
+							<view class="tips mt-30">注意事项:</view>
+							<view class="tips-samll" v-for="item in rechargeAttention" :key="item">
+								{{ item }}
+							</view>
 						</view>
 					</view>
-				</view>
-				<button class='but bg-color' formType="submit"> {{active ? '立即转入': '立即充值' }}</button>
+					<button class='but bg-color' formType="submit" v-if="is_gq != 1"> {{active ? '立即转入': '立即充值' }}</button>
+					<button class='but bg-color' formType="submit" v-else>提现</button>
 			</view>
 		</form>
 		<payment :payMode="payMode" :pay_close="pay_close" :is-call="true" @changePayType="changePayType"
@@ -87,7 +94,9 @@
 		rechargeRecharge,
 		rechargeWechat,
 		getRechargeApi,
-		memberCardCreate
+		memberCardCreate,
+		getStaffInfo,
+		equityWithdrawal
 	} from '@/api/user.js';
 	import payment from '@/components/payment';
 	import {
@@ -113,6 +122,8 @@
 		data() {
 			let that = this;
 			return {
+				staffInfo: {},
+				is_gq: 0,
 				now_money: 0,
 				navRecharge: ['账户充值', '佣金转入'],
 				active: 0,
@@ -185,11 +196,18 @@
 			} else {
 				toLogin();
 			}
+			if(options.is_gq) {
+				this.is_gq = options.is_gq
+				this.active = 1
+			}
 		},
 		onShow() {
 			uni.removeStorageSync('form_type_cart');
 		},
 		methods: {
+			goTx() {
+				console.log(this.number)
+			},
 			scanCode() {
 				var self = this;
 				// #ifdef MP || APP
@@ -301,6 +319,18 @@
 				let that = this;
 				getUserInfo().then(res => {
 					that.$set(that, 'userinfo', res.data);
+					if(that.is_gq == 1) {
+						that.getStaffInfo()
+					}
+				})
+			},
+			getStaffInfo() {
+				let that =this
+				getStaffInfo({
+					uid: that.userinfo.uid
+				}).then(res => {
+					that.staffInfo = res.data.list[0]
+					
 				})
 			},
 			changePayType: function(e) {
@@ -463,63 +493,88 @@
 			submitSub: function(e) {
 				let that = this
 				let value = e.detail.value.number;
-				// 转入余额
-				if (that.active) {
+				if(that.is_gq == 1) {
+					console.log(value)
 					if (parseFloat(value) < 0 || parseFloat(value) == NaN || value == undefined || value == "") {
 						return that.$util.Tips({
 							title: '请输入金额'
 						});
 					}
-					uni.showModal({
-						title: '转入余额',
-						content: '转入余额后无法再次转出,确认是否转入余额',
-						success(res) {
-							if (res.confirm) {
-								// #ifdef MP || APP-PLUS
-								rechargeRoutine({
-									price: parseFloat(value),
-									type: 1,
-									bar_code:that.verify_code
-								})
-								// #endif
-								// #ifdef H5
-								rechargeWechat({
+					if(parseFloat(value) >parseFloat(that.staffInfo.shareholding)) {
+						return that.$util.Tips({
+							title: '您当前的股权不足'
+						});
+					}
+					equityWithdrawal({
+						shareholding:value,
+						uid: that.userinfo.uid
+					}).then(res => {
+						that.$util.Tips({
+							title: '提交成功',
+							icon: 'success'
+						})
+						that.getStaffInfo()
+					})
+				}else {
+					// 转入余额
+					if (that.active) {
+						if (parseFloat(value) < 0 || parseFloat(value) == NaN || value == undefined || value == "") {
+							return that.$util.Tips({
+								title: '请输入金额'
+							});
+						}
+						uni.showModal({
+							title: '转入余额',
+							content: '转入余额后无法再次转出,确认是否转入余额',
+							success(res) {
+								if (res.confirm) {
+									// #ifdef MP || APP-PLUS
+									rechargeRoutine({
 										price: parseFloat(value),
-										from: that.from,
 										type: 1,
 										bar_code:that.verify_code
 									})
 									// #endif
-									.then(res => {
-										// that.$set(that, 'userinfo.now_money', that.$util.$h.Add(value, that.userinfo.now_money))
-										return that.$util.Tips({
-											title: '转入成功',
-											icon: 'success'
-										}, {
-											tab: 5,
-											url: '/pages/users/user_money/index'
-										});
-									}).catch(err => {
-										return that.$util.Tips({
-											title: err
+									// #ifdef H5
+									rechargeWechat({
+											price: parseFloat(value),
+											from: that.from,
+											type: 1,
+											bar_code:that.verify_code
 										})
+										// #endif
+										.then(res => {
+											// that.$set(that, 'userinfo.now_money', that.$util.$h.Add(value, that.userinfo.now_money))
+											return that.$util.Tips({
+												title: '转入成功',
+												icon: 'success'
+											}, {
+												tab: 5,
+												url: '/pages/users/user_money/index'
+											});
+										}).catch(err => {
+											return that.$util.Tips({
+												title: err
+											})
+										});
+								} else if (res.cancel) {
+									return that.$util.Tips({
+										title: '已取消'
 									});
-							} else if (res.cancel) {
-								return that.$util.Tips({
-									title: '已取消'
-								});
-							}
-						},
-					})
-				} else {
-					// #ifdef MP
-					this.pay_close = true;
-					// #endif
-					// #ifndef MP
-					this.pay_close = true;
-					// #endif
-					this.totalPrice = this.rechar_id == 0 ? parseFloat(this.money) : parseFloat(this.numberPic);
+								}
+							},
+						})
+					} else {
+						// #ifdef MP
+						this.pay_close = true;
+						// #endif
+						// #ifndef MP
+						this.pay_close = true;
+						// #endif
+						this.totalPrice = this.rechar_id == 0 ? parseFloat(this.money) : parseFloat(this.numberPic);
+					}
 				}
+				
 			}
 		}
 	}

+ 89 - 8
pages/users/user_spread_money/index.vue

@@ -1,18 +1,24 @@
 <template>
 	<view :style="colorStyle">
 		<view class='commission-details'>
-			<view class='search acea-row row-between-wrapper' v-if="recordType != 1 && recordType != 4">
+			<view class='search acea-row row-between-wrapper' v-if="recordType != 1 && recordType != 4 && recordType!=5">
 				<view class='input'>
 					<text class="iconfont icon-sousuo4"></text>
 					<input placeholder='搜索用户名称' placeholder-class='placeholder' v-model="keyword" @confirm="submitForm"
 						confirm-type='search' name="search"></input>
 				</view>
 			</view>
-			<timeSlot @changeTime="changeTime"></timeSlot>
+			<timeSlot @changeTime="changeTime" v-if="recordType!=5"></timeSlot>
 			<view class='sign-record'>
-				<view class="top_num" v-if="recordType != 4 && recordList.length">
+				<view class="top_num" v-if="recordType != 4 && recordList.length && recordType!=5">
 					支出:¥{{expend || 0}} &nbsp;&nbsp;&nbsp; 收入:¥{{income || 0}}
 				</view>
+				<view class="top_num top_num_2" v-if="recordType == 5">
+					当前股权:{{staffInfo.shareholding}}
+					<view class="tx" @click="navto('/pages/users/user_payment/index?is_gq=1')">
+						提现
+					</view>
+				</view>
 				<view class="box">
 					<block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
 						<view class='list'>
@@ -23,17 +29,26 @@
 									<view class='itemn1 acea-row row-between-wrapper'>
 										<view>
 											<view class='name line1'>
-												{{item.title}}
+												
+												 <text v-if="recordType!=5">{{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>
 												<text class="status_badge error" v-if="recordType == 4 && item.status == 2">未通过</text>
 												<!-- 提现记录: 0 待审核 1 通过 2 未通过 -->
 											 </view>
 											 <view class="mark" v-if="recordType == 4 && item.mark && item.status !== 1">{{item.mark}}</view>
-											<view>{{item.add_time}}</view>
+											<view v-if="recordType!=5">{{item.add_time}}</view>
+											<view v-else>{{item.create_time}}</view>
 										</view>
-										<view class='num font-color' v-if="item.pm == 1">+{{item.number}}</view>
-										<view class='num' v-else>-{{item.number}}</view>
+										<template v-if="recordType!=5">
+											<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>
+											<view class='num font-color' v-if="item.pm == 1">+{{item.shareholding}}</view>
+											<view class='num' v-else>-{{item.shareholding}}</view>
+										</template>
 									</view>
 									<!-- </block> -->
 								</view>
@@ -60,7 +75,10 @@
 <script>
 	import {
 		moneyList,
-		getSpreadInfo
+		getSpreadInfo,
+		getGqList,
+		getStaffInfo,
+		getUserInfo
 	} from '@/api/user.js';
 	import {
 		toLogin
@@ -81,6 +99,8 @@
 		mixins: [colors],
 		data() {
 			return {
+				userInfo: {},
+				staffInfo: {},
 				name: '',
 				keyword: '',
 				type: 0,
@@ -135,6 +155,14 @@
 				this.recordType = 4;
 				this.getRecordList();
 				// this.getRecordListCount();
+			} else if(type == 5) {
+				uni.setNavigationBarTitle({
+					title: "股权记录"
+				});
+				this.recordType = 5;
+				this.name = '股权明细';
+				
+				this.getStaffInfo()
 			} else {
 				uni.showToast({
 					title: '参数错误',
@@ -158,6 +186,11 @@
 			}
 		},
 		methods: {
+			navto(url) {
+				uni.navigateTo({
+					url
+				})
+			},
 			onLoadFun(){
 				this.isShowAuth = false
 			},
@@ -183,6 +216,44 @@
 				this.$set(this, 'recordList', []);
 				this.getRecordList();
 			},
+			getGqList() {
+				let that = this;
+				let page = that.page;
+				let limit = that.limit;
+				if (that.loading) return;
+				if (that.loadend) return;
+				getGqList({
+					page: page,
+					limit: limit,
+					uid: that.userInfo.uid
+				}).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 = '加载更多';
+				})
+			},
+			getStaffInfo() {
+				let that = this
+				getUserInfo().then(res => {
+					that.userInfo = res.data
+					that.getGqList();
+					getStaffInfo({
+						uid: res.data.uid
+					}).then(ress => {
+						console.log(ress)
+						
+						that.staffInfo = ress.data.list[0]
+						
+					})
+				})
+				
+			},
 			getRecordList: function() {
 				let that = this;
 				let page = that.page;
@@ -304,6 +375,16 @@
 		font-size: 26rpx;
 		color: #666;
 	}
+	.top_num_2 {
+		display: flex;
+		justify-content: space-between;
+	}
+	.tx {
+		padding: 5rpx 15rpx;
+		background-color:#1890FF;
+		color: #fff;
+		border-radius: 10rpx;
+	}
 
 	.radius15 {
 		border-radius: 14rpx 14rpx 0 0;

BIN
static/images/guquan.png