<template>
	<view class="page">
		<view class="list_info">
			<view class="name">支付宝姓名：</view>
			<view class="item">
				<input type="text" class="input" placeholder="请输入真实姓名" v-model="info.realname" maxlength="30" />
			</view>
			<view class="name">支付宝收款账户：</view>
			<view class="item">
				<input type="text" class="input" placeholder="请输入支付宝收款账户" v-model="info.alipay" maxlength="50" />
			</view>

			<view class="blankHeight"></view>
		</view>

		<view class="btn_submit" @click="submitData">提交</view>


		<!-- 提示框 -->
		<DialogBox ref="DialogBox"></DialogBox>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				title: '',
				sel: 1,
				info: {},
				realname: '',
				alipay: '',
			}
		},
		onLoad() {

		},
		onShow() {
			this.getInfoData();
		},
		methods: {
			onBack() {},
			chkSel() {
				if (this.sel == 1) {
					this.sel = 0;
				} else {
					this.sel = 1;
				}
			},
			getInfoData() {
				uni.request({
					url: this.$apiHost + '/Member/getinfoData', //仅为示例，并非真实接口地址。
					data: {
						uuid: getApp().globalData.uuid
					},
					header: {
						'content-type': 'application/json' //自定义请求头信息
					},
					success: (res) => {
						console.log("res", res.data)
						this.info = res.data;
					}
				});
			},
			submitData() {
				if (this.info.realname == "") {
					uni.showToast({
						title: "请输入支付宝姓名",
						icon: 'none'
					});
					return;
				}
				if (this.info.alipay == "") {
					uni.showToast({
						title: "请输入支付宝账户",
						icon: 'none'
					});
					return;
				}
				uni.request({
					url: this.$apiHost + '/Member/alipaySet', //仅为示例，并非真实接口地址。
					data: {
						uuid: getApp().globalData.uuid,
						realname: this.info.realname,
						alipay: this.info.alipay
					},
					header: {
						'content-type': 'application/json' //自定义请求头信息
					},
					success: (res) => {
						console.log("----", res.data);
						uni.showToast({
							title: res.data.str,
							icon: 'none'
						});
						if (res.data.success == "yes") {

						}
					}
				});

			},
		}
	}
</script>

<style scoped lang="scss">
	@import 'normal.scss';
</style>