| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228 |
- <!-- 登录 -->
- <template>
- <view class="login">
- <view class="flex-null-1"></view>
- <img class="logo-img" src="@/static/logo.png" alt="">
- <view class="logo-text">(积分兑换)</view>
- <view class="input-max-box">
- <view class="input-max-box-one">
- <view class="input-box">
- <img src="@/static/img_log_in_account.png">
- <input type="text" v-model="username" @confirm="login()" placeholder="请输入手机号" maxlength="30">
- </view>
- </view>
- <view class="input-max-box-two">
- <view class="input-box">
- <img src="@/static/img_log_in_password.png">
- <input type="password" v-model="password" @confirm="login()" placeholder="请输入密码" maxlength="30">
- </view>
- </view>
- <view class="button-box" @click="login()">登录</view>
- </view>
- <view class="flex-null-2"></view>
- </view>
- </template>
- <script>
- import {
- hex_md5
- } from '@/utils/md5.js';
- import {
- login
- } from '@/api/indexAKY';
- import {
- browserDetection
- } from '@/utils/auth';
- export default {
- data() {
- return {
- username: "",
- password: "",
- }
- },
- onLoad() {
- },
- onShow() {
- browserDetection();
- },
- methods: {
- //登录
- async login() {
- let self = this;
- if (!this.username) {
- uni.showToast({
- mask: true,
- icon: "none",
- position: "center",
- title: "请输入手机号",
- duration: 2000
- });
- return
- }
- if (!this.password) {
- uni.showToast({
- mask: true,
- icon: "none",
- position: "center",
- title: "请输入密码",
- duration: 2000
- });
- return
- }
- let obj = {
- // account: this.username,
- // password: hex_md5(this.password),
- mob : this.username,
- pwd : this.password,
- // password: hex_md5(this.password),
- }
- const {
- data
- } = await login(obj)
- if (data.code == 1) {
- console.log('data',data);
- uni.setStorageSync('token', data.data.token);
- uni.redirectTo({
- url: '/pages/home',
- });
- }
- },
- }
- }
- </script>
- <style lang="stylus" scoped>
- .login {
- flex: 1;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- background: url(../static/back.png);
- background-size: 100% 100%;
- .flex-null-1 {
- flex: 2;
- }
- .flex-null-2 {
- flex: 3;
- }
- .logo-img {
- width: 448rpx;
- height: 187rpx;
- margin: 0 auto 0;
- }
- .logo-text {
- margin-top:40rpx;
- /* 1. 字体设置:必须够粗 */
- font-family: "Microsoft YaHei", "SimHei", sans-serif;
- font-weight: 900;
- /* 最粗 */
- font-size: 52rpx;
- /* 根据实际需要调整大小 */
- letter-spacing: 2rpx;
- color: #ffffff;
- text-shadow:
- -1rpx -1rpx 0 #7cb9e8,
- 1rpx -1rpx 0 #7cb9e8,
- -1rpx 1rpx 0 #7cb9e8,
- 1rpx 1rpx 0 #7cb9e8,
- -2rpx 0rpx 0 #7cb9e8,
- 2rpx 0rpx 0 #7cb9e8,
- 0rpx -2rpx 0 #7cb9e8,
- 0rpx 2rpx 0 #7cb9e8,
- 0rpx 0rpx 4rpx rgba(124, 185, 232, 0.6);
- padding: 15rpx 40rpx;
- display: inline-block;
- text-align: center;
- }
- .input-max-box {
- .input-max-box-one {
- overflow: hidden;
- // margin-top: 68rpx;
- .input-box {
- display flex;
- width: 600rpx;
- height: 80rpx;
- border: 1rpx solid #0183FA;
- border-radius: 40rpx;
- margin: 147rpx auto 0;
- img {
- width: 28rpx;
- height: 32rpx;
- margin: 24rpx 31rpx;
- }
- input {
- flex: 1;
- font-size: 24rpx;
- height: 80rpx;
- line-height: 80rpx;
- margin-right: 31rpx;
- }
- }
- .text-box {
- height: 59rpx;
- line-height: 59rpx;
- color: #DC1616;
- font-size: 24rpx;
- margin-left: 102rpx;
- }
- }
- .input-max-box-two {
- margin-top: 40rpx;
- .input-box {
- display flex;
- width: 600rpx;
- height: 80rpx;
- border: 1rpx solid #0183FA;
- border-radius: 40rpx;
- margin: 0 auto 0;
- img {
- width: 30rpx;
- height: 32rpx;
- margin: 24rpx 30rpx;
- }
- input {
- flex: 1;
- font-size: 24rpx;
- height: 80rpx;
- line-height: 80rpx;
- margin-right: 31rpx;
- }
- }
- .text-box {
- height: 59rpx;
- line-height: 59rpx;
- color: #DC1616;
- font-size: 24rpx;
- margin-left: 102rpx;
- }
- }
- }
- .button-box {
- width: 600rpx;
- line-height: 80rpx;
- background: #0183FA;
- border-radius: 40rpx;
- font-size: 36rpx;
- color: #fff;
- text-align center;
- margin: 140rpx auto 0;
- }
- }
- </style>
|