Browse Source

7.10日晚提交

李万涛 2 năm trước cách đây
mục cha
commit
2364f53760
2 tập tin đã thay đổi với 101 bổ sung110 xóa
  1. 3 1
      pages/tusk/tuskDetail/index.vue
  2. 98 109
      pages/user/commission/withdraw.vue

+ 3 - 1
pages/tusk/tuskDetail/index.vue

xqd
@@ -97,7 +97,9 @@
 
 			let res1 = await myTaskOrder()
 			if (res1.code == 0) {
-				this.taskOrderList = res1.data
+				this.taskOrderList = res1.data.filter((item, index) => {
+					return item.audit_status == 1
+				})
 				console.log('任务详情----全部任务返回值', res1, this.taskOrderList.length);
 			}
 		},

+ 98 - 109
pages/user/commission/withdraw.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -145,12 +145,16 @@
 								v-model="bankName"></u--input></view>
 					</view>
 
-					<view class="" v-else>
-						<view class="kf_qrcode tn-flex justify-center">
-							<u--image :showLoading="true" :src="paymentcode" width="100px" height="100px"
+					<view class="">
+						<view class="kf_qrcode tn-flex justify-center" v-if="selectedWithdrawType==2">
+							<u--image :showLoading="true" :src="wx_qrcode_url" width="100px" height="100px"
+								@click="clickuimage()"></u--image>
+						</view>
+						<view class="kf_qrcode tn-flex justify-center" v-if="selectedWithdrawType==3">
+							<u--image :showLoading="true" :src="ali_qrcode_url" width="100px" height="100px"
 								@click="clickuimage()"></u--image>
 						</view>
-						<view class="u-text-center">
+						<view class="u-text-center" v-if="selectedWithdrawType!=1">
 							点击上传{{selectedWithdrawType==2?"微信":'支付宝'}}收款码
 						</view>
 					</view>
@@ -194,6 +198,7 @@
 	import {
 		taskCount,
 		recommendCount,
+		userInfo
 
 	} from '@/api/my/index.js'
 	export default {
@@ -262,11 +267,14 @@
 				cardNum: '',
 				bankName: '',
 
-				withDrawInfo: {}
+				withDrawInfo: {},
+				userInfo: {},
+				wx_qrcode_url: '',
+				ali_qrcode_url: ''
 			};
 		},
 		computed: {
-			...mapGetters(['appInfo', 'userInfo'])
+			// ...mapGetters(['appInfo', 'userInfo'])
 		},
 		async onShow() {
 			if (this.withDrawType == 1) {
@@ -284,6 +292,20 @@
 					console.log('推广-可提现金额', this.enableMoney);
 				}
 			}
+
+			let res66 = await userInfo()
+			if (res66.code == 0) {
+				this.userInfo = res66.data
+
+				this.bankName = this.userInfo.bank_name
+				this.cardNum = this.userInfo.card_num
+				this.realname = this.userInfo.real_name
+
+				this.wx_qrcode_url = this.userInfo.wx_qrcode_url
+				this.ali_qrcode_url = this.userInfo.ali_qrcode_url
+
+				console.log('提现-用户个人信息', this.userInfo);
+			}
 		},
 		async onLoad(o) {
 			// let ress6 = await withDrawInfo()
@@ -306,6 +328,8 @@
 				this.dayCash = ress.data[4].value.rule.day
 				this.methods = ress.data[4].value.method
 
+				this.selectedWithdrawType = Number(this.methods[0])
+
 
 				this.methods.forEach((item, index) => {
 					if (item == 2) {
@@ -340,17 +364,17 @@
 				this.showWithdrawList = false;
 				this.showBindForm = true
 				this.selectedWithdrawType = i
-
-
 				// if (i == 1) {
-				// 	this.bankName = '123'
-				// } else if (i == 1) {
-
+				// 	this.bankName = this.userInfo.bank_name
+				// 	this.cardNum = this.userInfo.card_num
+				// 	this.realname = this.userInfo.real_name
+				// } else if (i == 2) {
+				// 	this.realname = this.userInfo.real_name
+				// 	this.paymentcode = this.userInfo.wx_qrcode_url
 				// } else {
-
+				// 	this.realname = this.userInfo.real_name
+				// 	this.paymentcode = this.userInfo.ali_qrcode_url
 				// }
-
-
 			},
 
 
@@ -387,8 +411,14 @@
 						this.showBindForm = true
 						return;
 					}
+				} else if (this.selectedWithdrawType == 2) {
+					if (!this.wx_qrcode_url || !this.realname) {
+						this.$u.toast('请上传提现信息');
+						this.showBindForm = true
+						return;
+					}
 				} else {
-					if (!this.paymentcode || !this.realname) {
+					if (!this.ali_qrcode_url || !this.realname) {
 						this.$u.toast('请上传提现信息');
 						this.showBindForm = true
 						return;
@@ -398,9 +428,12 @@
 					type: this.withDrawType,
 					method: this.selectedWithdrawType,
 					amount: this.money,
+					wx_qrcode_url: this.wx_qrcode_url,
+					ali_qrcode_url: this.ali_qrcode_url,
 
 					real_name: this.realname,
-					qrcode_url: this.paymentcode,
+
+
 					card_num: this.cardNum,
 					bank_name: this.bankName
 				});
@@ -415,6 +448,15 @@
 						card_num: this.cardNum,
 						bank_name: this.bankName
 					}
+				} else if (this.selectedWithdrawType == 2) {
+					parms = {
+						type: this.withDrawType,
+						method: this.selectedWithdrawType,
+						amount: this.money,
+
+						real_name: this.realname,
+						wx_qrcode_url: this.wx_qrcode_url
+					}
 				} else {
 					parms = {
 						type: this.withDrawType,
@@ -422,16 +464,33 @@
 						amount: this.money,
 
 						real_name: this.realname,
-						qrcode_url: this.paymentcode
+						ali_qrcode_url: this.ali_qrcode_url
 					}
 				}
 				let ress = await applyWithdraw(parms)
 				console.log('申请提现返回值', ress, ress.msg);
 				// if (ress.code == 0) {
-				if (ress.code == '提交成功') {
+				if (ress.code == 0) {
 					uni.showToast({
 						title: '提现申请成功'
 					})
+
+					this.selectedWithdrawType = Number(this.methods[0])
+					this.money = ''
+					this.realname = ''
+					this.cardNum = ''
+					this.bankName = ''
+					this.paymentcode = ''
+					console.log('提现参数重置后', {
+						type: this.withDrawType,
+						method: this.selectedWithdrawType,
+						amount: this.money,
+
+						real_name: this.realname,
+						card_num: this.cardNum,
+						bank_name: this.bankName,
+						qrcode_url: this.paymentcode
+					});
 					setTimeout(() => {
 						uni.navigateTo({
 							url: '/pages/user/commission/withdraw-log'
@@ -472,14 +531,7 @@
 			},
 			// 确认提现方式
 			onSaveWithdrawType() {
-				// this.withdrawType = this.selectedWithdrawType;
 				this.showWithdrawList = false;
-				this.paymentcode = ''
-				this.cardNum = ''
-				this.bankName = ''
-				console.log('this.paymentcode----------------', this.paymentcode);
-				console.log('this.selectedWithdrawType', this.selectedWithdrawType);
-				// this.getWithdrawInfo();
 			},
 			async bindThirdOauth() {
 				let that = this;
@@ -504,10 +556,18 @@
 						})
 						return;
 					}
+				} else if (this.selectedWithdrawType == 2) {
+					if (!that.wx_qrcode_url) {
+						uni.showToast({
+							title: '请上传微信收款码',
+							icon: 'none'
+						})
+						return;
+					}
 				} else {
-					if (!that.paymentcode) {
+					if (!that.ali_qrcode_url) {
 						uni.showToast({
-							title: '请上传收款码',
+							title: '请上传支付宝收款码',
 							icon: 'none'
 						})
 						return;
@@ -522,96 +582,21 @@
 					return;
 				}
 
-				console.log('添加提现信息传递的参数', {
-					real_name: that.realname,
-					qrcode_wechat: that.paymentcode
-				});
-
 				if (this.selectedWithdrawType == 1) {
-					if (that.realname && that.cardNum) {
-						// uni.showToast({
-						// 	title: '保存成功'
-						// })
+					if (that.realname && that.cardNum && that.bankName) {
+						that.showBindForm = false
+					}
+				} else if (this.selectedWithdrawType == 2) {
+					if (that.realname && that.wx_qrcode_url) {
 						that.showBindForm = false
 					}
 				} else {
-					if (that.realname && that.paymentcode) {
-						// uni.showToast({
-						// 	title: '保存成功'
-						// })
+					if (that.realname && that.ali_qrcode_url) {
 						that.showBindForm = false
 					}
 				}
-
 				this.confirmWithdraw()
-				this.selectedWithdrawType = 2
-				this.money = ''
-				this.realname = ''
-				this.cardNum = ''
-				this.bankName = ''
-				this.paymentcode = ''
-				console.log('提现参数重置后', {
-					type: this.withDrawType,
-					method: this.selectedWithdrawType,
-					amount: this.money,
-
-					real_name: this.realname,
-					card_num: this.cardNum,
-					bank_name: this.bankName,
-					qrcode_url: this.paymentcode
-				});
-
-				// let res7 = await saveWithDrawInfo({
-				// 	real_name: this.realname,
-				// 	card_num: this.cardNum,
-				// 	bank_name: this.bankName,
-				// 	qrcode_url: this.paymentcode
-				// })
-				// console.log('提交保存的提现信息', {
-				// 	real_name: this.realname,
-				// 	card_num: this.cardNum,
-				// 	bank_name: this.bankName,
-				// 	qrcode_url: this.paymentcode
-				// });
-				// if (res7.code == 0) {
-				// 	this.confirmWithdraw()
-				// 	this.selectedWithdrawType = 2
-				// 	this.money = ''
-				// 	this.realname = ''
-				// 	this.cardNum = ''
-				// 	this.bankName = ''
-				// 	this.paymentcode = ''
-				// 	console.log('提现参数重置后', {
-				// 		type: this.withDrawType,
-				// 		method: this.selectedWithdrawType,
-				// 		amount: this.money,
-
-				// 		real_name: this.realname,
-				// 		card_num: this.cardNum,
-				// 		bank_name: this.bankName,
-				// 		qrcode_url: this.paymentcode
-				// 	});
-				// }
-
-
 				return
-				that.$http('commission.update', {
-					real_name: that.realname,
-					qrcode_wechat: that.paymentcodeid
-				}).then(res => {
-					if (res.code === 0) {
-						uni.showToast({
-							title: '保存成功'
-						})
-						that.showBindForm = false
-						that.getCheck()
-					} else {
-						uni.showToast({
-							title: '保存失败',
-							icon: 'none'
-						})
-					}
-				});
 			},
 			//上传收款码
 			clickuimage() {
@@ -637,7 +622,11 @@
 								uni.hideLoading();
 								let a = JSON.parse(res2.data);
 								if (a.code == 0) {
-									that.paymentcode = a.data.url
+									if (that.selectedWithdrawType == 2) {
+										that.wx_qrcode_url = a.data.url
+									} else {
+										that.ali_qrcode_url = a.data.url
+									}
 									// that.paymentcodeid = a.data.id
 								} else {
 									uni.showToast({