MONSTER-ygh 2 месяцев назад
Родитель
Сommit
3bc9008164
4 измененных файлов с 68 добавлено и 39 удалено
  1. 28 23
      pages/bankCard/index.vue
  2. 34 9
      pages/cash/index.vue
  3. 5 5
      pages/distributor/index.vue
  4. 1 2
      pages/me/index.vue

+ 28 - 23
pages/bankCard/index.vue

@@ -3,28 +3,34 @@
 		<view class="index-content-info">
 			<!-- 头部主要内容 开始 -->
 			<view class="index-content-header">
-				<customNavbar :title="title" bgColor="rgba(0,0,0,0)" :is-left="true" :customNavbarInfo='{}'>
+				<customNavbar 
+				:title="title" 
+				bgColor="rgba(0,0,0,0)" 
+				:is-left="true" 
+				:customNavbarInfo='{}'
+				:leftStyle="{ color: '#fff' }"
+				>
 				</customNavbar>
 			</view>
 			<!-- 头部主要内容 结束 -->
-			<view>
-				<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm">
-					<u-form-item label="真实姓名" prop="name" borderBottom ref="item1">
+			<view style="padding: 30rpx;">
+				<u--form labelPosition="left" :model="form" :rules="rules" labelWidth='100' ref="uForm">
+					<u-form-item label="真实姓名" prop="name" borderBottom>
 						<u--input v-model="form.name" border="none"></u--input>
 					</u-form-item>
-					<u-form-item label="开户行" prop="bankName" borderBottom ref="item1">
+					<u-form-item label="开户行" prop="bankName" borderBottom>
 						<u--input v-model="form.bankName" border="none"></u--input>
 					</u-form-item>
-					<u-form-item label="银行卡号" prop="bankNo" borderBottom ref="item1">
+					<u-form-item label="银行卡号" prop="bankNo" borderBottom>
 						<u--input v-model="form.bankNo" border="none"></u--input>
 					</u-form-item>
-					<u-form-item label="开户行" prop="openBankName" borderBottom ref="item1">
+					<u-form-item label="开户行" prop="openBankName" borderBottom>
 						<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 style="padding: 30rpx;">
+				<u-button type="primary" @click="insertOrUpdateFun()" text="提交"></u-button>
 			</view>
 		</view>
 	</view>
@@ -54,28 +60,24 @@
 					},
 					'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']
@@ -84,7 +86,7 @@
 			}
 		},
 		onLoad() {
-
+			this.getRetailQrcode()
 		},
 		onShow() {
 			this.statusBarHeight = getApp().globalData.statusBarHeight
@@ -123,22 +125,29 @@
 			/**
 			 * 提交 我的银行卡
 			 */
-			async getRetailQrcode() {
+			async insertOrUpdateFun() {
 				this.$refs.uForm.validate().then(async res => {
 					try {
 						uni.showLoading({
 							title: "提交数据中..."
 						})
-						let res = await this.$u.api.insertOrUpdateApi({...this.form})				
+						let res = await this.$u.api.insertOrUpdateApi({...this.form})	
+						uni.hideLoading()
 						if (res && res.code === 200) {
-							uni.hideLoading()
 							uni.showToast({
-								title: "绑定成功!!!"
+								title: "绑定成功!!!",
+								duration: 2000
 							})
-							this.getRetailQrcode()
+							setTimeout(()=>{
+								this.getRetailQrcode()
+							},2000)
 						}
 						this.loading = false
 					} catch (e) {
+						uni.hideLoading()
+						uni.showToast({
+							title: "绑定失败!!!"
+						})
 						//TODO handle the exception
 						console.error("e===", e)
 						this.loading = false
@@ -158,9 +167,6 @@
 		align-items: center;
 		justify-content: center;
 		box-sizing: border-box;
-
-		--header-h: 170rpx;
-
 		// background-color: 
 		.index-content-info {
 			width: 100%;
@@ -171,7 +177,6 @@
 	/** 头部主要内容 开始 */
 	.index-content-header {
 		width: 100%;
-		height: var(--header-h);
 		box-sizing: border-box;
 		background-color: var(--gd-bgm-color);
 

+ 34 - 9
pages/cash/index.vue

@@ -47,12 +47,11 @@
 							</view>
 						</view>
 
-						<!-- <view class="cash-content-cash-card">
+						<view class="cash-content-cash-card">
 							<u-cell-group :border="false">
-								<u-cell :border="false" title="提现至" :isLink="false" :value="'微信钱包'"
-									@click="openPopup()"></u-cell>
+								<u-cell :border="false" title="提现至" :isLink="false" :value="'银行卡'"></u-cell>
 							</u-cell-group>
-						</view> -->
+						</view>
 
 						<view class="cash-content-cash-submit">
 							<view @click="openModal">提现</view>
@@ -221,7 +220,7 @@
 					console.error("e===", e)
 				}
 			},
-			openModal() {
+			async openModal() {
 				// if (!this.moneyValue || this.moneyValue < this.withdrawInfo.minAmount) {
 				// 	uni.showToast({
 				// 		title: '最小提现金额' + this.withdrawInfo.minAmount,
@@ -246,10 +245,36 @@
 
 				//   }
 				// })
-				this.showModal = true
-				// #ifdef H5
-				window.history.replaceState(null, null, document.URL)
-				// #endif
+				/**
+				 * 获取 我的银行卡
+				 */
+				try {
+					uni.showLoading({
+						title: "获取银行卡中..."
+					})
+					let res = await this.$u.api.getPersonsBankApi({
+						userid: this.distribution_user_info.userId
+					})	
+					uni.hideLoading()
+					if (res && res.code === 200 && res.data.bankNo) {
+						this.showModal = true
+						// #ifdef H5
+						window.history.replaceState(null, null, document.URL)
+						// #endif
+					}else {
+						navigateTo('/pages/bankCard/index')
+					}
+				} catch (e) {
+					//TODO handle the exception
+					console.error("e===", e)
+					uni.showToast({
+						title: "绑定成功!!!",
+						duration: 2000
+					})
+					uni.hideLoading()
+				}
+				
+				
 			},
 			/**  关闭 */
 			clearOverlay() {

+ 5 - 5
pages/distributor/index.vue

@@ -121,17 +121,17 @@
 						key: 0,
 					}, 
 					{
-						name: '提现中',
+						name: '申请中',
 						key: 3,
 					},
 					{
 						name: '提现成功',
 						key: 1,
 					},
-					{
-						name: '提现失败',
-						key: 2,
-					},
+					// {
+					// 	name: '提现失败',
+					// 	key: 2,
+					// },
 				],
 				serialType: 0,
 				orderId: '',

+ 1 - 2
pages/me/index.vue

@@ -82,7 +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/yijian1.png', url: '/pages/bankCard/index' },
 					// { title: "提现记录",icon: this.$commonConfig.staticUrl + 'me/beifeng.png', url: '/pages/cashList/index' },
 				],
 				userInfo: {},
@@ -126,7 +126,6 @@
 					})
 					this.isShowQrcode = res.data.unionFlag
 					if(this.isShowQrcode === 0) {
-						
 						this.show = true
 					}else {
 						this.getRetailQrcode()