Commit 4c0e79fc by 前端

设备编码

1 parent c7a9c461
......@@ -5,60 +5,39 @@
<view class="title">登录</view>
<view class="sub-title">手机号码登录</view>
<view class="input">
<input
type="tel"
:value="mobile"
placeholder="请输入手机号"
maxlength="11"
@blur="input($event, 'mobile')"
:key="dateKey.mobile"
/>
<input type="tel" :value="mobile" placeholder="请输入手机号" maxlength="11" @blur="input($event, 'mobile')" :key="dateKey.mobile" />
<template v-if="mobile">
<view class="icon" @click="mobile = ''">
<icon type="clear" size="16" color="#000"> </icon>
<icon type="clear" size="16" color="#000"></icon>
</view>
</template>
</view>
<view class="input" >
<input
type="number"
:value="code"
placeholder="请输入验证码"
maxlength="4"
@blur="input($event, 'code')"
:key="dateKey.code"
/>
<view class="input">
<input type="number" :value="code" placeholder="请输入验证码" maxlength="4" @blur="input($event, 'code')" :key="dateKey.code" />
<template v-if="code">
<view class="icon" @click="code = ''">
<icon type="clear" size="16" color="#000"> </icon>
<icon type="clear" size="16" color="#000"></icon>
</view>
</template>
<view
:class="['code-btn', `${count ? 'code-disabled' : ''}`]"
@click="getSmsCode"
>{{ count ? `重新发送(${count}s)` : "获取验证码" }}</view
>
<view :class="['code-btn', `${count ? 'code-disabled' : ''}`]" @click="getSmsCode">{{ count ? `重新发送(${count}s)` : '获取验证码' }}</view>
</view>
<button class="btn" @click="login">登录</button>
<view class="form-footer">
<view class="autoLogin" @click="readingStatus = !readingStatus">
<uni-icons
:type="`${readingStatus ? 'checkbox-filled' : 'circle'}`"
:size="18"
:color="`${readingStatus ? '#2C66F7' : '#858A94'}`"
></uni-icons>
我已阅读并同意<text @click.stop="jumpUrl()">《用户隐私协议》</text>
<uni-icons :type="`${readingStatus ? 'checkbox-filled' : 'circle'}`" :size="18" :color="`${readingStatus ? '#2C66F7' : '#858A94'}`"></uni-icons>
我已阅读并同意
<text @click.stop="jumpUrl()">《用户隐私协议》</text>
</view>
<view class="autoLogin" @click="noSignIn = !noSignIn">
<uni-icons
:type="`${noSignIn ? 'checkbox-filled' : 'circle'}`"
:size="18"
:color="`${noSignIn ? '#2C66F7' : '#858A94'}`"
></uni-icons>
<uni-icons :type="`${noSignIn ? 'checkbox-filled' : 'circle'}`" :size="18" :color="`${noSignIn ? '#2C66F7' : '#858A94'}`"></uni-icons>
30天内免登录
</view>
</view>
</view>
<view class="app-code flex">
APP编码:{{ deviceId }}
<view class="sprite-icon icon-clone" @click="copyText"></view>
</view>
<update-box />
</view>
</template>
......@@ -83,8 +62,23 @@ export default {
if (options.mobile) this.mobile = options.mobile
const noSignInUuid = uni.$storage.get('noSignInUuid')
if (noSignInUuid) this.autoLogin(noSignInUuid)
},
methods: {
const {
deviceId
} = uni.getDeviceInfo()
this.deviceId = deviceId
},
methods: {
copyText() {
uni.setClipboardData({
data: this.deviceId,
success: function() {
uni.showToast({
title: '复制成功',
icon: 'success'
});
}
});
},
async autoLogin (noSignInUuid) {
uni.showLoading({
mask: true
......@@ -213,7 +207,7 @@ export default {
height: 100%;
left: 0;
top: 0;
background-image: url("../../assets/images/login/bg.webp");
background-image: url('../../assets/images/login/bg.webp');
background-size: 100% 100%;
}
.login {
......@@ -281,7 +275,7 @@ export default {
color: #ffffff;
}
.btn[disabled]:not([type]),
.btn[disabled][type="default"] {
.btn[disabled][type='default'] {
background: #c9c9c9 !important;
}
.form-footer {
......@@ -305,4 +299,19 @@ export default {
}
}
}
.app-code {
position: fixed;
bottom: 20rpx;
left: 50%;
transform: translate(-50%);
font-size: 24rpx;
color: #999999;
line-height: 40rpx;
.icon-clone {
width: 24rpx;
height: 24rpx;
margin-left: 20rpx;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!