xuhaolan 4 years ago
parent
commit
0614b7f617
6 changed files with 327 additions and 17 deletions
  1. 19 3
      pages.json
  2. 79 5
      pages/collection/bank.vue
  3. 13 2
      pages/collection/collection.vue
  4. 212 0
      pages/money/withdraw.vue
  5. 1 1
      pages/user/jifen.vue
  6. 3 6
      pages/user/yongjin.vue

+ 19 - 3
pages.json

@@ -635,18 +635,34 @@
         }
         ,{
             "path" : "pages/user/yongjin",
+                                                                                             
+           "style": {
+           	"navigationBarTitleText": "我的佣金",
+           	"navigationBarBackgroundColor": "transparent",
+           	"navigationBarTextStyle": "white",
+           		"app-plus": {
+           			"titleNView": {
+           				"type": "float",
+           				"titleText": "我的佣金"
+           			}
+           		}
+           }
+            
+        }
+        ,{
+            "path" : "pages/user/balance",
             "style" :                                                                                    
             {
-                "navigationBarTitleText": "我的佣金",
+                "navigationBarTitleText": "我的余额",
                 "enablePullDownRefresh": false
             }
             
         }
         ,{
-            "path" : "pages/user/balance",
+            "path" : "pages/money/withdraw",
             "style" :                                                                                    
             {
-                "navigationBarTitleText": "我的余额",
+                "navigationBarTitleText": "",
                 "enablePullDownRefresh": false
             }
             

+ 79 - 5
pages/collection/bank.vue

@@ -3,27 +3,101 @@
 		<view class="box">
 			<view class="item ">
 				<text>姓名</text>
-				<input type="text" value="" placeholder="请输入真实姓名" />
+				<input type="text" value="" v-model="name" placeholder="请输入真实姓名" />
 			</view>
 			<view class="item top">
 				<text>银行卡号</text>
-				<input type="text" value="" placeholder="请输入银行卡账号" />
+				<input type="text" value="" v-model="id" placeholder="请输入银行卡账号" />
 			</view>
 			<view class="item">
 				<text>所属银行</text>
-				<input type="text" value="" placeholder="请输入银行" />
+				<input type="text" value="" v-model="idName" placeholder="请输入银行" />
 			</view>
 		</view>
-		<button class="button" type="default">确认</button>
+		<button class="button"  @click="confirm()">确认</button>
+		
 	</view>
 </template>
 
 <script>
+	import { userEdit } from '@/api/set.js';
+	import { orderData,getUserInfo } from '@/api/user.js';
+	import { mapState, mapMutations } from 'vuex';
 	export default {
+		computed: {
+			...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
+		},
 		data() {
 			return {
-				
+				name:'',
+				id:'',
+				idName:''
 			};
+		},
+		onLoad() {
+			console.log(this.userInfo,'1111')
+			if(this.userInfo.bank_code != null){
+				this.id = this.userInfo.bank_code
+			}
+			if(this.userInfo.bank_name != null){
+				this.idName = this.userInfo.bank_name
+			}
+			if(this.userInfo.bank_user_name != null){
+				this.name = this.userInfo.bank_user_name
+			}
+		},
+		methods:{
+			...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
+			confirm(){
+				let obj = this;
+				console.log(obj,'112');
+				if(!obj.name){
+					return this.$api.msg('请输入提款人姓名');
+				}
+				if(!obj.id){
+					return  this.$api.msg('请输入银行卡号')
+				}
+				if(!obj.idName){
+					return this.$api.msg('请输入所属银行')
+				}
+				userEdit({
+					bank_user_name:obj.name,
+					bank_name:obj.idName,
+					bank_code:obj.id
+				}).then(e=>{
+					return this.$api.msg('修改成功')
+					obj.getUserInfo();
+				})
+				
+			},
+			// 更新用户信息
+			getUserInfo() {
+				getUserInfo({})
+					.then(({ data }) => {
+						console.log(data)
+						this.setUserInfo(data);
+						// 获取用户数据完毕后在获取订单数据防止多次跳转到登录页
+						orderData({})
+							.then(({ data }) => {
+								this.setOrderInfo(data);
+								uni.navigateBack({
+									delta: 1
+								});
+							})
+							.catch(e => {
+								this.setOrderInfo({
+									complete_count: 0, //完成
+									received_count: 0, //待收货
+									unshipped_count: 0, //待发货
+									order_count: 0, //订单总数
+									unpaid_count: 0 //待付款
+								});
+							});
+					})
+					.catch(e => {
+						console.log(e);
+					});
+			},
 		}
 	}
 </script>

+ 13 - 2
pages/collection/collection.vue

@@ -11,7 +11,10 @@
 					</view>
 				</view>
 				<view class="gg">
-					<view class="status">
+					<view class="status" v-if="bankData.fullname!= null">
+						{{bankData.fullname}}
+					</view>
+					<view class="status" v-else>
 						未添加
 					</view>
 					
@@ -61,12 +64,20 @@
 </template>
 
 <script>
+	import { mapState, mapMutations } from 'vuex';
 	export default {
 		data() {
 			return {
-
+				bankData:{fullname:'',bank:'',bankno:''}
 			};
 		},
+		computed:{
+			...mapState('user',['userInfo','orderInfo','hasLogin'])
+		},
+		onShow(){
+			console.log(this.userInfo)
+			this.bankData.fullname = this.userInfo.bank_user_name;
+		},
 		methods:{
 			navTo(url){
 				console.log(url);

+ 212 - 0
pages/money/withdraw.vue

@@ -0,0 +1,212 @@
+<template>
+	<view class="exchangeIntegral">
+		<view class="integral">
+			<view class="">
+				可提现金额
+			</view>
+			<view class="num">
+				{{integral}}
+			</view>
+		</view>
+		<view class="applyIntegral">
+			<view class="">
+				申请提现金额
+			</view>
+			
+			<input type="number" class="num" v-model="num"/>
+		</view>
+		<view class="all" @click="all"> <text>满100可提现</text><text>全部转换</text></view>
+		<view class="between">
+			
+		</view>
+		<view class="bottom">
+			<view class="box">
+				<view class="title">
+					提现到
+				</view>
+				<radio-group name="">
+					
+				
+				<view class="box-content">
+					<view class="box-left">
+						<view class="img">
+							<image src="../../static/user/wx.png" mode=""></image>
+						</view>
+						<text>微信支付</text>
+					</view>
+					<label class="radio">
+						<radio value="" style="transform:scale(0.7)" />
+					</label>
+				</view>
+				<view class="box-content">
+					<view class="box-left">
+						<view class="img1 img">
+							<image src="../../static/user/bank.png" mode=""></image>
+						</view>
+						<text>银行账户</text>
+					</view>
+					<label class="radio">
+						<radio value="" style="transform:scale(0.7)" />
+					</label>
+				</view>
+				</radio-group>
+			</view>
+			<view class="button" @click="submit">提交申请</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				integral: 1000,
+				num: ''
+			}
+		},
+		methods: {
+			all() {
+				this.num = this.integral
+			},
+			submit() {
+				if(this.integral < this.num) {
+					this.all()
+				}
+			}
+		},
+		watch: {
+			num() {
+				if(this.integral < this.num) {
+					this.all()
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	page,.exchangeIntegral {
+		background-color: #FFFFFF;
+		height: 100%;
+		.integral,.applyIntegral{
+			display: flex;
+			justify-content: space-between;
+			padding: 30rpx;
+			background-color: #FFFFFF;
+			margin-bottom: 5rpx;
+			font-size: 30rpx;
+			.num {
+				font-size: 40rpx;
+				text-align: right;
+				max-width: 400rpx;
+			}
+		}
+		.between{
+			width: 100%;
+			height: 20rpx;
+			background-color: #F7F7F7
+		}
+		.all {
+			display: flex;
+			justify-content: space-between;
+			width: 100%;
+			height: 80rpx;
+			line-height: 80rpx;
+			margin-top: 2rpx;
+			background-color: #fff;
+			padding: 0 30rpx;
+			margin-bottom: 20rpx;
+			text:nth-child(1) {
+				
+				font-size: 24rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #999999;
+				
+			}
+			text:nth-child(2){
+				font-size: 26rpx;
+				font-family: SourceHanSansCN;
+				font-weight: 400;
+				color: #438BED;
+				
+			}
+		}
+	
+		.bottom{
+			width: 750rpx;
+			
+			
+			background: #FFFFFF;
+			padding: 20rpx;
+			.box{
+				margin-bottom: 120rpx;
+				display: flex;
+				flex-direction: column;
+				.title{
+					display: flex;
+					margin-bottom: 10rpx;
+					font-size: 30rpx;
+					font-family: SourceHanSansCN;
+					font-weight: 400;
+					color: #333333;
+				}
+				.box-content{
+					padding: 20rpx;
+					border-bottom: 1rpx solid #E6E6E6;
+					
+					display: flex;
+					justify-content: space-between;
+					.box-left{
+						display: flex;
+						.img{
+							
+							width: 40rpx;
+							height: 40rpx;
+							image{
+								width: 100%;
+								height: 100%;
+							}
+						}
+						text{
+							margin-left: 30rpx;
+							font-size: 26rpx;
+							font-family: SourceHanSansCN;
+							font-weight: 400;
+							color: #515151;
+						}
+					}
+					.radio{
+						    width: 20rpx;
+						    height: 20rpx;
+							radio{
+								
+									    width: 20rpx;
+									    height: 20rpx;
+							}
+						    
+					}
+				}
+			}
+		}
+		// .img1{
+		// 	width: 40rpx;
+		// 	height: 30rpx;
+		// 	image{
+		// 		width: 100%;
+		// 		height: 100%;
+		// 	}
+		// }
+		.button {
+			
+			background: linear-gradient(90deg, #438BED 0%,  #44BFEC 100%);
+			color: #fff;
+			width: 670rpx;
+			padding: 20rpx;
+			font-size: 30rpx;
+			border-radius: 10rpx;
+			text-align: center;
+			margin: 0 auto;
+		}
+	}
+</style>

+ 1 - 1
pages/user/jifen.vue

@@ -8,7 +8,7 @@
 			<view class="integral">
 				{{ integral || '0.00' }}
 			</view>
-			<navigator url="/pages/money/conversionIntegral"><view class="right">转换USDT</view></navigator>
+			<!-- <navigator url="/pages/money/conversionIntegral"><view class="right">转换USDT</view></navigator> -->
 		</view>
 		<view class="navbar">
 			<view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>

+ 3 - 6
pages/user/yongjin.vue

@@ -1,14 +1,10 @@
 <template>
 	<view class="content">
-		<!-- <view class="navbar">
-			<view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
-		</view> -->
 		<view class="header">
 			<image src="../../static/user/yongjin.png" mode=""></image>
 			<view class="integral">
 				{{ integral || '0.00' }}
 			</view>
-			<!-- <navigator url="/pages/money/conversionIntegral"><view class="right">转换USDT</view></navigator> -->
 		</view>
 		<view class="navbar">
 			<view v-for="(item, index) in navList" :key="index" class="nav-item" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
@@ -41,7 +37,7 @@
 			<navigator url="/pages/user/integralTransforms" class="b-left">积分转账</navigator>
 			<navigator url="/pages/user/exchangeIntegral" class="b-right">转换购物积分</navigator>
 		</view> -->
-		<button type="default" class="button">立即提现</button>
+		<button type="default" class="button" @click="navto('/pages/money/withdraw')">立即提现</button>
 	</view>
 </template>
 
@@ -63,7 +59,7 @@ export default {
 			tabCurrentIndex: 0,
 			navList: [
 				{
-					state: 0,
+					state: 0, 
 					text: '收入',
 					loadingType: 'more',
 					orderList: [],
@@ -139,6 +135,7 @@ export default {
 
 		//swiper 切换
 		changeTab(e) {
+			console.log(e,'1111')
 			this.tabCurrentIndex = e.target.current;
 			this.loadData('tabChange');
 		},