index.vue 1.8 KB
Newer Older
DCloud_JSON's avatar
DCloud_JSON 已提交
1 2 3
<template>
	<view class="content">
		<button @click="toUserInfoPage">个人资料</button>
study夏羽's avatar
1.0.37  
study夏羽 已提交
4
		<uni-forms-item label="登录方式" labelWidth="70">
DCloud_JSON's avatar
DCloud_JSON 已提交
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
			<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": "手机验证码"
				}, {
study夏羽's avatar
1.0.37  
study夏羽 已提交
29 30 31 32 33 34
					"value": "apple",
					"text": "苹果登录"
				}, {
					"value": "weixinMobile",
					"text": "微信手机号登录"
				}]
DCloud_JSON's avatar
DCloud_JSON 已提交
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
			}
		},
		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({
DCloud_JSON's avatar
1.0.12  
DCloud_JSON 已提交
52
					url: "/uni_modules/uni-id-pages/pages/userinfo/userinfo?showLoginManage=true"
DCloud_JSON's avatar
DCloud_JSON 已提交
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
				})
			}
		}
	}
</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;
	}
C
chenruilong 已提交
86
</style>