Commit 4c0e79fc by 前端

设备编码

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