123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- <template>
- <view class="container" :style="{paddingTop:CustomBar+'px'}">
- <view class="tui-page-title">登录</view>
- <view class="tui-form">
- <view class="tui-view-input">
- <tui-list-cell :hover="false" :lineLeft="false" backgroundColor="transparent">
- <view class="tui-cell-input">
- <tui-icon name="mobile" color="#6d7a87" :size="20"></tui-icon>
- <input
- :adjust-position="false"
- v-model="param.mobile"
- placeholder="请输入账号/手机号"
- placeholder-class="tui-phcolor"
- type="text"
- maxlength="11"
- />
- <view class="" v-show="mobile" @tap="clearInput(1)">
- <tui-icon name="close-fill" :size="16" color="#bfbfbf"></tui-icon>
- </view>
- </view>
- </tui-list-cell>
- <tui-list-cell :hover="false" :lineLeft="false" backgroundColor="transparent">
- <view class="tui-cell-input">
- <tui-icon name="pwd" color="#6d7a87" :size="20"></tui-icon>
- <input
- v-if="isShowEye"
- :adjust-position="false"
- v-model="param.password"
- placeholder="请输入密码"
- placeholder-class="tui-phcolor"
- type="text"
- maxlength="36"
- />
- <input
- v-if="!isShowEye"
- :adjust-position="false"
- v-model="param.password"
- placeholder="请输入密码"
- placeholder-class="tui-phcolor"
- type="password"
- maxlength="36"
- />
- <view class="" v-show="param.password" style="margin: 0 20rpx 0 0;" @click.stop="changInputType">
- <tui-icon :name="isShowEye ? 'unseen' : 'eye'" :size="22" color="#bfbfbf"></tui-icon>
- </view>
- <view class="" v-show="param.password" @click.stop="clearInput(2)">
- <tui-icon name="close-fill" :size="16" color="#bfbfbf" ></tui-icon>
- </view>
- </view>
- </tui-list-cell>
- </view>
- <view class="tui-btn-box">
- <tui-button type="primary" :disabledGray="true" :disabled="disabled" :shadow="true" shape="circle" @click="hanldeClick">登录</tui-button>
- </view>
- </view>
- </view>
- </template>
- <script>
- import { mapMutations } from 'vuex'
- export default {
- computed: {
- disabled: function() {
- let bool = true
- if (this.param.mobile && this.param.password) {
- bool = false
- }
- return bool
- }
- },
- data() {
- return {
- CustomBar:this.CustomBar,// 顶部导航栏高度
- param:{
- mobile: '',
- password: '',
- },
- popupShow: false,
- passwordType:'password',
- isShowEye:true
- }
- },
- onLoad(options) {
-
- },
- methods: {
- ...mapMutations(['login', 'logout']),
- back() {
- uni.navigateBack()
- },
- changInputType(){
- console.log('222222222222')
- this.isShowEye = !this.isShowEye
- },
- hanldeClick(){
-
- this.$api.navigateTo('/pages/collection/sms')
- },
- AdminInfo:function(){
- this.UserService.AccountAdminInfo({}).then(admin =>{
- this.UserService.AccountFindMerchant(admin.data.id).then(response =>{
- this.$store.commit('updateStatus',response.data)
- this.login(response.data)
- this.$api.switchTabTo('/pages/tabBar/statistics/index')
- }).catch(err =>{
- this.$util.msg(err.message,2000)
- })
- }).catch(err =>{
- this.$util.msg(err.message,2000)
- })
- },
- clearInput(type) {
- if (type == 1) {
- this.mobile = ''
- } else {
- this.password = ''
- }
- },
- href(type) {
- let url = '/pages/forgetPwd/forgetPwd'
- if (type == 2) {
- url = '/pages/login/login-phone'
- }
- this.$api.navigateTo(url)
- },
- showOtherLogin() {
- //打开后 不再关闭
- this.popupShow = true
- }
- }
- }
- </script>
- <style lang="scss">
- .container {
- .tui-status-bar {
- width: 100%;
- height: var(--status-bar-height);
- }
- .tui-header {
- width: 100%;
- padding: 40rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- box-sizing: border-box;
- }
- .tui-page-title {
- width: 100%;
- font-size: 48rpx;
- font-weight: bold;
- color: $uni-text-color;
- line-height: 42rpx;
- padding: 40rpx;
- box-sizing: border-box;
- }
- .tui-form {
- padding-top: 50rpx;
- .tui-view-input {
- width: 100%;
- box-sizing: border-box;
- padding: 0 40rpx;
- .tui-cell-input {
- width: 100%;
- display: flex;
- align-items: center;
- padding-top: 48rpx;
- padding-bottom: $uni-spacing-col-base;
- input {
- flex: 1;
- padding-left: $uni-spacing-row-base;
- }
- .tui-icon-close {
- margin-left: auto;
- }
- }
- }
- .tui-cell-text {
- width: 100%;
- padding: $uni-spacing-col-lg $uni-spacing-row-lg;
- box-sizing: border-box;
- font-size: $uni-font-size-sm;
- color: $uni-text-color-grey;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .tui-color-primary {
- color: $uni-color-primary;
- }
- }
- .tui-btn-box {
- width: 100%;
- padding: 0 $uni-spacing-row-lg;
- box-sizing: border-box;
- margin-top: 80rpx;
- }
- }
- .tui-login-way {
- width: 100%;
- font-size: 26rpx;
- color: $uni-color-primary;
- display: flex;
- justify-content: center;
- position: fixed;
- left: 0;
- bottom: 80rpx;
- view {
- padding: 12rpx 0;
- }
- }
- .tui-auth-login {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- padding-bottom: 80rpx;
- padding-top: 20rpx;
- .tui-icon-platform {
- width: 90rpx;
- height: 90rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- position: relative;
- margin-left: 40rpx;
- &::after {
- content: '';
- position: absolute;
- width: 200%;
- height: 200%;
- transform-origin: 0 0;
- transform: scale(0.5, 0.5) translateZ(0);
- box-sizing: border-box;
- left: 0;
- top: 0;
- border-radius: 180rpx;
- border: 1rpx solid $uni-text-color-placeholder;
- }
- }
- .tui-login-logo {
- width: 60rpx;
- height: 60rpx;
- }
- }
- }
- </style>
|