index.vue 1.7 KB
Newer Older
DCloud_JSON's avatar
DCloud_JSON 已提交
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
<template>
	<view class="content">
		<button @click="toUserInfoPage">个人资料</button>
		<uni-forms-item label="登录方式">
			<uni-data-checkbox :multiple="false" v-model="loginType" :localdata="loginTypeOption"></uni-data-checkbox>
		</uni-forms-item>
		<button @click="toLogin">前往登录</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				loginType: "weixin",
				loginTypeOption: [{
					"value": "weixin",
					"text": "微信"
				}, {
					"value": "univerify",
					"text": "一键登录"
				}, {
					"value": "username",
					"text": "账号密码"
				}, {
					"value": "smsCode",
					"text": "手机验证码"
				}, {
					"value": "apple",
					"text": "苹果登录"
				}]
			}
		},
		onLoad() {},
		methods: {
			toLogin() {
				if (this.loginType == 'username') {
					uni.navigateTo({
						url: "/uni_modules/uni-id-pages/pages/login/login-withpwd"
					})
				} else {
					uni.navigateTo({
						url: "/uni_modules/uni-id-pages/pages/login/login-withoutpwd?type=" + this.loginType
					})
				}
			},
			toUserInfoPage() {
				uni.navigateTo({
					url: "/uni_modules/uni-id-pages/pages/userinfo/userinfo"
				})
			}
		}
	}
</script>

<style lang="scss">
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 6rpx;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 18px;
		color: #8f8f94;
	}
</style>