| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <template>
- <view class="uni-app">
- <view class="status-bar" />
- <view class="main-container">
- <view class="logo-box">
- <image :src="$static('images/logo.png')" alt="" class="logo" />
- </view>
- <view class="app-name">
- {{ appName }}
- </view>
- <view class="subhead">
- 实现企业『销售+管理』全流程
- </view>
-
- <login-form v-model="form" />
- <view
- class="form-btn linear-gradient"
- @click="loginByUsername">
- 登 录
- </view>
-
- <view class="law">
- <text class="wk wk-check-fill icon" :class="{active: agreeLaw}" />
- 我已阅读并同意
- <text class="special" @click.stop="handleTo('/pages_law/service')">
- 《用户协议》
- </text>
- 与
- <text class="special" @click.stop="handleTo('/pages_law/privacy')">
- 《隐私声明》
- </text>
- </view>
- </view>
- </view>
- </template>
- <script>
- import LoginForm from './components/loginForm.vue'
- import {
- appName,
- appVersion
- } from '@/config'
- import {
- mapActions
- } from 'vuex'
- import request from 'UTIL/request'
-
- export default {
- name: 'LoginIndex',
- components: {
- LoginForm
- },
- data() {
- return {
- appName: appName,
- form: {
- username: '',
- password: ''
- },
- agreeLaw: true
- }
- },
- onLoad() {
- this.$clearStorage()
- const username = uni.getStorageSync('username') || ''
- this.$set(this.form, 'username', username)
- },
- onShow() {
- this.$clearStorage()
- },
- methods: {
- ...mapActions({
- login: 'user/login'
- }),
- /**
- * 账号登陆
- */
- loginByUsername() {
- // const mobileReg = /1[1-9]\d{9}$/
- if (!this.form.username || this.form.username == '') {
- this.$toast('登录账号不能为空')
- return
- }
- if (!this.form.password || this.form.password == '') {
- this.$toast('密码不能为空')
- return
- }
- this.login(this.form).then(res => {
- console.log('ok')
- if (res === 1) {
- this.$Router.reLaunch('/pages/home/index')
- } else if (res === 2) {
- // this.$router.push('/choose')
- }
- }).catch(() => {})
- },
- /**
- * 短信验证码
- */
- toSmsCode(type) {
- // type login 短信登录 forget 忘记密码 register 注册新企业
- },
-
- handleTo(url, query) {
- this.$Router.navigateTo({
- url,
- query
- })
- },
- clearSite() {}
- }
- }
- </script>
- <style scoped lang="scss">
- @import "./style/style.scss";
-
- .placehoder {
- font-size: 30rpx;
- }
-
- .status-bar {
- background: white;
- }
-
- .main-container {
- width: 100%;
- height: 100%;
- padding: 0 40rpx;
- font-size: 32rpx;
- background-color: white;
-
- .logo-box {
- margin: 66rpx auto 0;
- }
- }
- </style>
|