<template>
	<view style="padding: 20rpx;font-size: 30rpx;">
		<view class="tit">手机号</view>
		<input class="srk" placeholder="输入对方手机号" v-model="data.sjh" />
		
		<view class="tit">积分数量</view>
		<input class="srk" placeholder="输入积分数量" v-model="data.price"/>
		
		<view class="tit">交易密码</view>
		<input class="srk" placeholder="输入交易密码确认"  password="true" v-model="data.jymm"/>		
		
		<button type="warn" style="margin-top: 40rpx;" @click="add">确认转出</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: {
					'sjh': '',
					'price': '',
					'jymm':''
				},
				userinfo:[]
			}
		},
		methods: {
			add() {
				var data = this.data;				
				data.uid=this.userinfo.id;				
				this.$api
					.MhGetModel(data, 'user/payjifen')
					.then(res => {
						if(res.data.code==1){
							uni.redirectTo({
								url: 'cg?tel='+this.skr
							});
						}else{
							uni.showModal({
								title: '提示',
								content: res.data.msg,
								showCancel:false,
								success: function (res) {
									if (res.confirm) {
										
									} else if (res.cancel) {
										console.log('用户点击取消');
									}
								}
							});
						}
					})
					.catch(err => {
						// console.log('request fail', JSON.stringify(err));
					});
			}
		},
		onLoad() {
			var user = this.$api.getUserinfo();
			this.userinfo = user;
		}
	}
</script>

<style>
	page {
		padding: 15rpx;
		background:   #98a737;
		background-attachment: fixed !important;
		background-repeat: no-repeat !important;
	}

	.srk {
		color: #000;
		height: 60rpx;
		line-height: 60rpx;
		background: #fff;
		border-radius: 10rpx;
		padding-left: 20rpx;
		font-size: 30rpx;
	}

	.tit {
		color: #fff;
		height: 60rpx;
		line-height: 60rpx;
		margin-top: 10rpx;
	}
</style>
