signup.vue 1.9 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 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
<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>
import {
	reactive,
	watch
} from "vue"
import {
	signup,
	user
} from "../service";
const data = reactive({
	username: "",
	password: "",
	password1: ''
})
watch(user, (ov, nv) => {
	console.log({ ov, nv })
	if (nv?._id) {
		uni.reLaunch({
			url: '/pages/index/index'
		});
	}
}, {
	imediate: true
})
</script>

<style scoped="" lang="scss">

.input-list {
	padding: 50upx 70upx;
}

.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);

	input {
		width: 100%;
	}
}

.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;
}

.dlbutton-hover {
	background: linear-gradient(
		-90deg,
		rgba(63, 205, 235, 0.9),
		rgba(188, 226, 158, 0.9)
	);
}

.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;
}
</style>