signup.vue 2.0 KB
Newer Older
yu's avatar
yu 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
<template>
	<view class="fcol cntx">
		<view class="flex-col input-list">
			<view class="list-call">
				<input v-model="data.username" type="text" maxlength="11" placeholder="请输入用户名" />
			</view>
			<view class="list-call">
				<input v-model="data.password" type="text" maxlength="32" placeholder="输入密码" password="true" />
			</view>
			<view class="list-call">
				<input v-model="data.password1" type="text" maxlength="32" placeholder="确认密码" password="true" />
			</view>
		</view>
		<view class="dlbutton" hover-class="dlbutton-hover" @tap="signup(data)">
			<text>登录</text>
		</view>
	</view>
</template>

<script setup>
yu's avatar
yu 已提交
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
	import {
		reactive,
		watch
	} from "vue"
	import {
		signup,
		user,
		account
	} from "../service";
	const data = reactive({
		username: "",
		password: "",
		password1: ''
	})

	watch(() => account.data.state, (nv, ov) => {
		if (nv === 1) {
			uni.reLaunch({
				url: '/pages/index/index'
			});
		}
	}, {
		imediate: true
	})
yu's avatar
yu 已提交
45 46 47
</script>

<style scoped="" lang="scss">
yu's avatar
yu 已提交
48 49 50
	.input-list {
		padding: 50upx 70upx;
	}
yu's avatar
yu 已提交
51

yu's avatar
yu 已提交
52 53 54 55 56 57 58 59
	.list-call {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		height: 100upx;
		color: #333333;
		border-bottom: 1upx solid rgba(230, 230, 230, 1);
yu's avatar
yu 已提交
60

yu's avatar
yu 已提交
61 62 63
		input {
			width: 100%;
		}
yu's avatar
yu 已提交
64 65
	}

yu's avatar
yu 已提交
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
	.dlbutton {
		color: #ffffff;
		font-size: 34upx;
		width: 470upx;
		height: 100upx;
		background: linear-gradient(-90deg,
				rgba(63, 205, 235, 1),
				rgba(188, 226, 158, 1));
		box-shadow: 0upx 0upx 13upx 0upx rgba(164, 217, 228, 0.2);
		border-radius: 50upx;
		line-height: 100upx;
		text-align: center;
		margin-left: auto;
		margin-right: auto;
		margin-top: 100upx;
	}
yu's avatar
yu 已提交
82

yu's avatar
yu 已提交
83 84 85 86 87
	.dlbutton-hover {
		background: linear-gradient(-90deg,
				rgba(63, 205, 235, 0.9),
				rgba(188, 226, 158, 0.9));
	}
yu's avatar
yu 已提交
88

yu's avatar
yu 已提交
89 90 91 92 93 94 95 96 97 98 99 100
	.addition {
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		font-size: 30upx;
		margin-top: 80upx;
		color: #ffa800;
		text-align: center;
		height: 40upx;
		line-height: 40upx;
	}
yu's avatar
yu 已提交
101
</style>