cmy 1 year ago
parent
commit
f83f4c9781

+ 6 - 0
api/user.js

@@ -216,6 +216,12 @@ export function getIntegralListActionOut(q) {
 export function energyImport(q) {
 	return request.post(`energy/import`,q);
 }
+/*
+ * 佣金互转
+ * */
+export function brokerageTrade(q) {
+	return request.post(`brokerage/trade`,q);
+}
 
 /**
  * 获取分销海报图片

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "神英优选",
     "appid" : "__UNI__3F43051",
     "description" : "神英优选商城",
-    "versionName" : "2.9.8",
-    "versionCode" : 298,
+    "versionName" : "2.9.9",
+    "versionCode" : 299,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 1 - 8
pages.json

@@ -88,13 +88,6 @@
 			"style": {
 				"navigationBarTitleText": ""
 			}
-		},
-		{
-			"path" : "pages/goods/order_confirm/111/111",
-			"style" : 
-			{
-				"navigationBarTitleText" : ""
-			}
 		}
 		//#endif
 	],
@@ -512,7 +505,7 @@
 				{
 					"path": "user_cash/index",
 					"style": {
-						"navigationBarTitleText": "提",
+						"navigationBarTitleText": "提",
 						"navigationBarBackgroundColor": "#FFFFFF"
 							// #ifdef MP || APP-PLUS
 							,

+ 24 - 24
pages/users/user_cash/index.vue

@@ -54,21 +54,21 @@
 							</view>
 						</view>
 						<view class='item acea-row row-between-wrapper'>
-							<view class='name'>提</view>
-							<view class='input'><input v-model="allMoney" @input='inputNum' :maxlength="moneyMaxLeng" :placeholder='"最低提金额:¥"+minPrice' placeholder-class='placeholder'
+							<view class='name'>提</view>
+							<view class='input'><input v-model="allMoney" @input='inputNum' :maxlength="moneyMaxLeng" :placeholder='"最低提金额:¥"+minPrice' placeholder-class='placeholder'
 									name="money" type='digit'></input></view>
 						</view>
 						<view class='tip'>
-							当前可提金额: <text
+							当前可提金额: <text
 								class="price">¥{{userInfo.commissionCount}}</text>,冻结佣金:¥{{userInfo.broken_commission}}
 						</view>
 						<view class='tip'>
-							提手续费: <text class="price">¥{{withdraw_fee}}</text>,实际到账:<text class="price">¥{{true_money}}</text>
+							提手续费: <text class="price">¥{{withdraw_fee}}</text>,实际到账:<text class="price">¥{{true_money}}</text>
 						</view>
 						<view class='tip'>
-							说明: 每笔佣金的冻结期为{{userInfo.broken_day}}天,到期后可提
+							说明: 每笔佣金的冻结期为{{userInfo.broken_day}}天,到期后可提
 						</view>
-						<button formType="submit" class='bnt bg-color'>提</button>
+						<button formType="submit" class='bnt bg-color'>提</button>
 					</form>
 				</view>
 				<view :hidden='currentTab != 1' class='list'>
@@ -79,8 +79,8 @@
 									name="name" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;"></input></view>
 						</view>
 						<view class='item acea-row row-between-wrapper'>
-							<view class='name'>提</view>
-							<view class='input'><input @input='inputNum' :maxlength="moneyMaxLeng" :placeholder='"最低提金额:¥"+minPrice' placeholder-class='placeholder'
+							<view class='name'>提</view>
+							<view class='input'><input @input='inputNum' :maxlength="moneyMaxLeng" :placeholder='"最低提金额:¥"+minPrice' placeholder-class='placeholder'
 									name="money" type='digit'></input></view>
 						</view>
 						<view class='item acea-row row-top row-between' v-if="extract_wechat_type == 0">
@@ -98,16 +98,16 @@
 							</view>
 						</view>
 						<view class='tip'>
-							当前可提金额: <text
+							当前可提金额: <text
 								class="price">¥{{userInfo.commissionCount}}</text>,冻结佣金:¥{{userInfo.broken_commission}}
 						</view>
 						<view class='tip'>
-							提手续费: <text class="price">¥{{withdraw_fee}}</text>,实际到账:<text class="price">¥{{true_money}}</text>
+							提手续费: <text class="price">¥{{withdraw_fee}}</text>,实际到账:<text class="price">¥{{true_money}}</text>
 						</view>
 						<view class='tip'>
-							说明: 每笔佣金的冻结期为{{userInfo.broken_day}}天,到期后可提
+							说明: 每笔佣金的冻结期为{{userInfo.broken_day}}天,到期后可提
 						</view>
-						<button formType="submit" class='bnt bg-color'>提</button>
+						<button formType="submit" class='bnt bg-color'>提</button>
 					</form>
 				</view>
 				<view :hidden='currentTab != 2' class='list'>
@@ -118,8 +118,8 @@
 									name="name" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;"></input></view>
 						</view>
 						<view class='item acea-row row-between-wrapper'>
-							<view class='name'>提</view>
-							<view class='input'><input @input='inputNum' :maxlength="moneyMaxLeng" :placeholder='"最低提金额:¥"+minPrice' placeholder-class='placeholder'
+							<view class='name'>提</view>
+							<view class='input'><input @input='inputNum' :maxlength="moneyMaxLeng" :placeholder='"最低提金额:¥"+minPrice' placeholder-class='placeholder'
 									name="money" type='digit'></input></view>
 						</view>
 						<view class='item acea-row row-top row-between'>
@@ -137,16 +137,16 @@
 							</view>
 						</view>
 						<view class='tip'>
-							当前可提金额: <text
+							当前可提金额: <text
 								class="price">¥{{userInfo.commissionCount}}</text>,冻结佣金:¥{{userInfo.broken_commission}}
 						</view>
 						<view class='tip'>
-							提手续费: <text class="price">¥{{withdraw_fee}}</text>,实际到账:<text class="price">¥{{true_money}}</text>
+							提手续费: <text class="price">¥{{withdraw_fee}}</text>,实际到账:<text class="price">¥{{true_money}}</text>
 						</view>
 						<view class='tip'>
-							说明: 每笔佣金的冻结期为{{userInfo.broken_day}}天,到期后可提
+							说明: 每笔佣金的冻结期为{{userInfo.broken_day}}天,到期后可提
 						</view>
-						<button formType="submit" class='bnt bg-color'>提</button>
+						<button formType="submit" class='bnt bg-color'>提</button>
 					</form>
 				</view>
 			</view>
@@ -187,7 +187,7 @@
 				navList: [],
 				currentTab: '',
 				index: 0,
-				array: [], //提银行
+				array: [], //提银行
 				typeIndex:0,
 				typeMoney: [{
 					name:'个人',
@@ -195,8 +195,8 @@
 				},{
 					name:'企业',
 					value:1
-				}], //提银行
-				minPrice: 0.00, //最低提金额
+				}], //提银行
+				minPrice: 0.00, //最低提金额
 				userInfo: [],
 				isClone: false,
 				isAuto: false, //没有授权的不会自动授权
@@ -209,7 +209,7 @@
 				withdraw_fee: '0',
 				true_money: 0,
 				extract_wechat_type:0,
-				allMoney:'',//保存当前提金额
+				allMoney:'',//保存当前提金额
 			};
 		},
 		computed: mapGetters(['isLogin']),
@@ -414,10 +414,10 @@
 					value.qrcode_url = that.qrcodeUrlZ;
 				}
 				if (value.money.length == 0) return that.$util.Tips({
-					title: '请填写提金额'
+					title: '请填写提金额'
 				});
 				if (Number(value.money) < Number(that.minPrice)) return that.$util.Tips({
-					title: '提金额不能低于:¥' + that.minPrice
+					title: '提金额不能低于:¥' + that.minPrice
 				});
 				if (that.prevent) {
 					that.prevent = false

+ 133 - 78
pages/users/user_payment/user_spread.vue

@@ -9,19 +9,30 @@
 			</view>
 			<view class="payment">
 				<view class="nav acea-row row-around row-middle">
-					<view class="item" :class="active==index?'on':''" v-for="(item,index) in navRecharge" :key="index"
-						@click="navRecharges(index)">{{item}}</view>
+					<view class="item" :class="active==index?'on':''" v-if="showBroker[item.key]"
+						v-for="(item,index) in navRecharge" :key="index" @click="navRecharges(index)">{{item.title}}
+					</view>
 				</view>
-				<view class='tip picList' v-if='!active'>
-					<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>
-				<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='tip picList' v-if='!active'>
+					<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> -->
+				<!-- <view class="tip picList" v-else> -->
+				<view class="tip picList">
+					<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='to_uid acea-row row-between' v-if="active==2">
+						<view class="title">用户UID</view>
+						<input class="uidbox" placeholder-class='placeholderUid' placeholder="请输入转入的用户uid" type='number' :value="uid" name="uid"></input>
+					</view>
 				</view>
+
 				<view class="tips-title">
 					<view style="font-weight: bold; font-size: 26rpx;">提示:</view>
 					<view style="margin-top: 10rpx;">当前可转佣金为 <text
@@ -44,7 +55,9 @@
 		getUserInfo,
 		rechargeRoutine,
 		rechargeWechat,
-		energyImport
+		energyImport,
+		extractBank,
+		brokerageTrade
 	} from '@/api/user.js';
 	import {
 		toLogin
@@ -69,9 +82,22 @@
 			let that = this;
 			return {
 				now_money: 0,
-				navRecharge: ['佣金转能量', '佣金转余额'],
+				navRecharge: [{
+					title: '佣金转能量',
+					key: "brokerage_to_energy_switch",
+					bool: true,
+				}, {
+					title: '佣金转余额',
+					key: "brokerage_to_money_switch",
+					bool: true,
+				}, {
+					title: '佣金互转',
+					key: "brokerage_trade_switch",
+					bool: true,
+				}],
 				active: 0,
 				number: '',
+				uid: '', //转入用户UID
 				userinfo: {},
 				placeholder: "0.00",
 				from: '',
@@ -112,7 +138,12 @@
 				// #endif
 				type: '',
 				rechargeAttention: [],
-				moneyMaxLeng: 8
+				moneyMaxLeng: 8,
+				showBroker: {
+					brokerage_to_energy_switch: false,
+					brokerage_to_money_switch: false,
+					brokerage_trade_switch: false,
+				}
 			};
 		},
 		computed: mapGetters(['isLogin']),
@@ -184,6 +215,14 @@
 				let that = this;
 				getUserInfo().then(res => {
 					that.$set(that, 'userinfo', res.data);
+
+				})
+				extractBank().then(({
+					data
+				}) => {
+					that.showBroker.brokerage_to_energy_switch = !!(+data.brokerage_to_energy_switch);
+					that.showBroker.brokerage_to_money_switch = !!(+data.brokerage_to_money_switch);
+					that.showBroker.brokerage_trade_switch = !!(+data.brokerage_trade_switch);
 				})
 			},
 			submitSub: function(e) {
@@ -194,8 +233,9 @@
 						title: '请输入转换金额'
 					});
 				}
+				const type = that.navRecharge[that.active].key;
 				// 转入余额
-				if (that.active) {
+				if (type == "brokerage_to_money_switch") {
 					uni.showModal({
 						title: '转入余额',
 						content: '转入余额后无法再次转出,确认是否转入余额',
@@ -235,37 +275,67 @@
 							}
 						},
 					})
-				} else {
-						uni.showModal({
-							title: '转入能量',
-							content: '转入能量后无法再次转出,确认是否转入能量',
-							success(res) {
-								if (res.confirm) {
-									energyImport({
-										price: parseFloat(value),
-									}).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/user/index'
-										});
-									}).catch(err => {
-										return that.$util.Tips({
-											title: err
-										})
+				} else if (type == "brokerage_to_energy_switch") {
+					uni.showModal({
+						title: '转入能量',
+						content: '转入能量后无法再次转出,确认是否转入能量',
+						success(res) {
+							if (res.confirm) {
+								energyImport({
+									price: parseFloat(value),
+								}).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/user/index'
 									});
-									
-								} else if (res.cancel) {
+								}).catch(err => {
 									return that.$util.Tips({
-										title: '已取消'
+										title: err
+									})
+								});
+
+							} else if (res.cancel) {
+								return that.$util.Tips({
+									title: '已取消'
+								});
+							}
+						},
+					})
+				} else if (type == "brokerage_trade_switch") {
+					uni.showModal({
+						title: '佣金互转',
+						content: '佣金转出后无法撤回,确认是否转出佣金',
+						success(res) {
+							if (res.confirm) {
+								brokerageTrade({
+									to_uid: '',
+									num: parseFloat(value),
+								}).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/user/index'
 									});
-								}
-							},
-						})
-					
+								}).catch(err => {
+									return that.$util.Tips({
+										title: err
+									})
+								});
+
+							} else if (res.cancel) {
+								return that.$util.Tips({
+									title: '已取消'
+								});
+							}
+						},
+					})
 				}
 			}
 		}
@@ -381,42 +451,7 @@
 	}
 
 	.picList {
-		display: flex;
-		flex-wrap: wrap;
 		margin: 30rpx 0;
-
-		.pic-box {
-			width: 32%;
-			height: auto;
-			border-radius: 20rpx;
-			margin-top: 21rpx;
-			padding: 20rpx 0;
-			margin-right: 12rpx;
-
-			&:nth-child(3n) {
-				margin-right: 0;
-			}
-		}
-
-		.pic-box-color {
-			background-color: #f4f4f4;
-			color: #656565;
-		}
-
-		.pic-number {
-			font-size: 22rpx;
-		}
-
-		.pic-number-pic {
-			font-size: 38rpx;
-			margin-right: 10rpx;
-			text-align: center;
-		}
-
-		.pic-box-color-active {
-			background-color: var(--view-theme) !important;
-			color: #fff !important;
-		}
 	}
 
 	.tips-box {
@@ -445,4 +480,24 @@
 		font-size: 24rpx;
 		color: #333;
 	}
+
+	.to_uid {
+		padding: 20rpx;
+		width: 100%;
+		line-height: 1;
+		font-size: 28rpx;
+		align-items: center;
+
+			border-bottom:1px solid #dddddd;
+		.title {
+			font-weight: bold;
+		}
+		.uidbox{
+			flex-grow: 1;
+			text-align: right;
+		}
+		.placeholderUid{
+			text-align: right;
+		}
+	}
 </style>

+ 5 - 5
pages/users/user_spread_user/index.vue

@@ -50,11 +50,11 @@
 			<view class="price-box" :class="!headerStatus ? 'header-height':''">
 				<view class="box-top">
 					<view class="" @click="jumbPath(0)">
-						可提金额
+						可提金额
 						<text class="iconfont icon-xiangyou"></text>
 					</view>
 					<view class="" @click="jumbPath(7)">
-						提记录
+						提记录
 						<text class="iconfont icon-xiangyou"></text>
 					</view>
 				</view>
@@ -70,7 +70,7 @@
 				<view class="box-btn">
 					<view class="item">
 						<view class="text">
-							待提佣金
+							待提佣金
 						</view>
 						<view class="num">
 							{{userInfo.brokerage_price || 0.00}}
@@ -79,7 +79,7 @@
 					<view class="item in">
 						<view class="item-cn">
 							<view class="text">
-								已提佣金
+								已提佣金
 							</view>
 							<view class="num">
 								{{userInfo.extract_price || 0.00}}
@@ -99,7 +99,7 @@
 					</view>
 				</view>
 				<view class="btn" @click="jumbPath(0)">
-					立即提
+					立即提
 				</view>
 			</view>
 			<view class="price-box">