MONSTER-ygh 1 сар өмнө
parent
commit
0520ca83bd

+ 10 - 0
common/apiurl.js

@@ -104,6 +104,16 @@ const apiurl = {
 		url: '/member/marketPersons/getUnionAccessUrl',
 		type: 'get'
 	},
+	// 添加修改银行卡号
+	insertOrUpdateApi: {
+		url: '/member/marketPersonsBank/insertOrUpdate',
+		type: 'post'
+	},
+	// 获取用户绑定银行卡
+	getPersonsBankApi: {
+		url: '/member/marketPersonsBank/getPersonsBank',
+		type: 'get'
+	},
 }
 
 

+ 7 - 0
pages.json

@@ -100,6 +100,13 @@
 				"navigationBarTitleText": "银联支付入网签约认证",
 				"navigationStyle": "custom"
 			}
+		},
+		{
+			"path": "pages/bankCard/index",
+			"style": {
+				"navigationBarTitleText": "我的银行卡",
+				"navigationStyle": "custom"
+			}
 		}
 	],
 	"globalStyle": {

+ 188 - 0
pages/bankCard/index.vue

@@ -0,0 +1,188 @@
+<template>
+	<view class="index-content" :style="{'--status-bar-': statusBarHeight}">
+		<view class="index-content-info">
+			<!-- 头部主要内容 开始 -->
+			<view class="index-content-header">
+				<customNavbar :title="title" bgColor="rgba(0,0,0,0)" :is-left="true" :customNavbarInfo='{}'>
+				</customNavbar>
+			</view>
+			<!-- 头部主要内容 结束 -->
+			<view>
+				<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm">
+					<u-form-item label="真实姓名" prop="name" borderBottom ref="item1">
+						<u--input v-model="form.name" border="none"></u--input>
+					</u-form-item>
+					<u-form-item label="开户行" prop="bankName" borderBottom ref="item1">
+						<u--input v-model="form.bankName" border="none"></u--input>
+					</u-form-item>
+					<u-form-item label="银行卡号" prop="bankNo" borderBottom ref="item1">
+						<u--input v-model="form.bankNo" border="none"></u--input>
+					</u-form-item>
+					<u-form-item label="开户行" prop="openBankName" borderBottom ref="item1">
+						<u--input v-model="form.openBankName" border="none"></u--input>
+					</u-form-item>
+				</u--form>
+			</view>
+			<view>
+				<u-button type="primary" @click="getRetailQrcode()" text="提交"></u-button>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				title: '我的银行卡',
+				loading: false,
+				statusBarHeight: 0, // 状态栏安全距离
+				form: {
+					"id": "",
+					"name": "",
+					"moblie": "",
+					"bankName": "",
+					"bankNo": "",
+					"openBankName": ""
+				},
+				rules: {
+					'name': {
+						type: 'string',
+						required: true,
+						message: '请输入姓名',
+						trigger: ['blur', 'change']
+					},
+					'moblie': {
+						type: 'string',
+						max: 1,
+						required: true,
+						message: '请输入手机号',
+						trigger: ['blur', 'change']
+					},
+					'bankName': {
+						type: 'string',
+						max: 1,
+						required: true,
+						message: '请输入银行名称',
+						trigger: ['blur', 'change']
+					},
+					'bankNo': {
+						type: 'string',
+						max: 1,
+						required: true,
+						message: '请输入银行卡号',
+						trigger: ['blur', 'change']
+					},
+					'openBankName': {
+						type: 'string',
+						max: 1,
+						required: true,
+						message: '请输入开户行',
+						trigger: ['blur', 'change']
+					},
+				},
+			}
+		},
+		onLoad() {
+
+		},
+		onShow() {
+			this.statusBarHeight = getApp().globalData.statusBarHeight
+			//this.load()
+		},
+		methods: {
+			/**
+			 * 获取 我的银行卡
+			 */
+			async getRetailQrcode() {
+				try {
+					uni.showLoading({
+						title: "获取银行卡中..."
+					})
+					let res = await this.$u.api.getPersonsBankApi({
+						userid: this.distribution_user_info.userId
+					})	
+					uni.hideLoading()
+					if (res && res.code === 200) {
+						this.form = {
+							"id":  res.data.id,
+							"name": res.data.name,
+							"moblie": res.data.moblie,
+							"bankName": res.data.bankName,
+							"bankNo": res.data.bankNo,
+							"openBankName": res.data.openBankName
+						}
+					}
+				
+				} catch (e) {
+					//TODO handle the exception
+					console.error("e===", e)
+					uni.hideLoading()
+				}
+			},
+			/**
+			 * 提交 我的银行卡
+			 */
+			async getRetailQrcode() {
+				this.$refs.uForm.validate().then(async res => {
+					try {
+						uni.showLoading({
+							title: "提交数据中..."
+						})
+						let res = await this.$u.api.insertOrUpdateApi({...this.form})				
+						if (res && res.code === 200) {
+							uni.hideLoading()
+							uni.showToast({
+								title: "绑定成功!!!"
+							})
+							this.getRetailQrcode()
+						}
+						this.loading = false
+					} catch (e) {
+						//TODO handle the exception
+						console.error("e===", e)
+						this.loading = false
+					}
+				}).catch(errors => {
+					
+				})
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.index-content {
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		box-sizing: border-box;
+
+		--header-h: 170rpx;
+
+		// background-color: 
+		.index-content-info {
+			width: 100%;
+			box-sizing: border-box;
+		}
+	}
+
+	/** 头部主要内容 开始 */
+	.index-content-header {
+		width: 100%;
+		height: var(--header-h);
+		box-sizing: border-box;
+		background-color: var(--gd-bgm-color);
+
+		::v-deep .u-search {
+			padding: 0 30rpx !important;
+		}
+
+		::v-deep .u-search__action {
+			color: #fff !important;
+		}
+	}
+
+	/** 头部主要内容 结束  **/
+</style>

+ 1 - 1
pages/cash/index.vue

@@ -303,7 +303,7 @@
 					})
 
 					if (res && res.code == 200) {
-						this.contentModel = "提现申请提交成功,佣金将会在1-2个工作日内发放到银行卡,请耐心等待!"
+						this.contentModel = "提现申请提交成功,佣金将会在5个工作日内发放到银行卡,请耐心等待!"
 						this.confirmText = '返回'
 						this.showStatus = 0
 						this.showModel = true

+ 1 - 0
pages/me/index.vue

@@ -82,6 +82,7 @@
 					{ title: "邀请统计",icon: this.$commonConfig.staticUrl + 'me/yijian2.png', url: '/pages/invitationStatistics/index' },
 					{ title: "余额提现",icon: this.$commonConfig.staticUrl + 'me/beifeng.png', url: '/pages/balance/index' },
 					{ title: "我的推广码",icon: this.$commonConfig.staticUrl + 'me/yijian1.png', url: '' },
+					{ title: "我的银行卡",icon: this.$commonConfig.staticUrl + 'me/yijian1.png', url: 'pages/bankCard/index' },
 					// { title: "提现记录",icon: this.$commonConfig.staticUrl + 'me/beifeng.png', url: '/pages/cashList/index' },
 				],
 				userInfo: {},