login-account.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <template>
  2. <view class="container" :style="{paddingTop:CustomBar+'px'}">
  3. <view class="tui-page-title">登录</view>
  4. <view class="tui-form">
  5. <view class="tui-view-input">
  6. <tui-list-cell :hover="false" :lineLeft="false" backgroundColor="transparent">
  7. <view class="tui-cell-input">
  8. <tui-icon name="mobile" color="#6d7a87" :size="20"></tui-icon>
  9. <input
  10. :adjust-position="false"
  11. v-model="param.mobile"
  12. placeholder="请输入账号/手机号"
  13. placeholder-class="tui-phcolor"
  14. type="text"
  15. maxlength="11"
  16. />
  17. <view class="" v-show="mobile" @tap="clearInput(1)">
  18. <tui-icon name="close-fill" :size="16" color="#bfbfbf"></tui-icon>
  19. </view>
  20. </view>
  21. </tui-list-cell>
  22. <tui-list-cell :hover="false" :lineLeft="false" backgroundColor="transparent">
  23. <view class="tui-cell-input">
  24. <tui-icon name="pwd" color="#6d7a87" :size="20"></tui-icon>
  25. <input
  26. v-if="isShowEye"
  27. :adjust-position="false"
  28. v-model="param.password"
  29. placeholder="请输入密码"
  30. placeholder-class="tui-phcolor"
  31. type="text"
  32. maxlength="36"
  33. />
  34. <input
  35. v-if="!isShowEye"
  36. :adjust-position="false"
  37. v-model="param.password"
  38. placeholder="请输入密码"
  39. placeholder-class="tui-phcolor"
  40. type="password"
  41. maxlength="36"
  42. />
  43. <view class="" v-show="param.password" style="margin: 0 20rpx 0 0;" @click.stop="changInputType">
  44. <tui-icon :name="isShowEye ? 'unseen' : 'eye'" :size="22" color="#bfbfbf"></tui-icon>
  45. </view>
  46. <view class="" v-show="param.password" @click.stop="clearInput(2)">
  47. <tui-icon name="close-fill" :size="16" color="#bfbfbf" ></tui-icon>
  48. </view>
  49. </view>
  50. </tui-list-cell>
  51. </view>
  52. <view class="tui-btn-box">
  53. <tui-button type="primary" :disabledGray="true" :disabled="disabled" :shadow="true" shape="circle" @click="hanldeClick">登录</tui-button>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. import { mapMutations } from 'vuex'
  60. export default {
  61. computed: {
  62. disabled: function() {
  63. let bool = true
  64. if (this.param.mobile && this.param.password) {
  65. bool = false
  66. }
  67. return bool
  68. }
  69. },
  70. data() {
  71. return {
  72. CustomBar:this.CustomBar,// 顶部导航栏高度
  73. param:{
  74. mobile: '',
  75. password: '',
  76. },
  77. popupShow: false,
  78. passwordType:'password',
  79. isShowEye:true
  80. }
  81. },
  82. onLoad(options) {
  83. },
  84. methods: {
  85. ...mapMutations(['login', 'logout']),
  86. back() {
  87. uni.navigateBack()
  88. },
  89. changInputType(){
  90. console.log('222222222222')
  91. this.isShowEye = !this.isShowEye
  92. },
  93. hanldeClick(){
  94. this.$api.navigateTo('/pages/collection/sms')
  95. },
  96. AdminInfo:function(){
  97. this.UserService.AccountAdminInfo({}).then(admin =>{
  98. this.UserService.AccountFindMerchant(admin.data.id).then(response =>{
  99. this.$store.commit('updateStatus',response.data)
  100. this.login(response.data)
  101. this.$api.switchTabTo('/pages/tabBar/statistics/index')
  102. }).catch(err =>{
  103. this.$util.msg(err.message,2000)
  104. })
  105. }).catch(err =>{
  106. this.$util.msg(err.message,2000)
  107. })
  108. },
  109. clearInput(type) {
  110. if (type == 1) {
  111. this.mobile = ''
  112. } else {
  113. this.password = ''
  114. }
  115. },
  116. href(type) {
  117. let url = '/pages/forgetPwd/forgetPwd'
  118. if (type == 2) {
  119. url = '/pages/login/login-phone'
  120. }
  121. this.$api.navigateTo(url)
  122. },
  123. showOtherLogin() {
  124. //打开后 不再关闭
  125. this.popupShow = true
  126. }
  127. }
  128. }
  129. </script>
  130. <style lang="scss">
  131. .container {
  132. .tui-status-bar {
  133. width: 100%;
  134. height: var(--status-bar-height);
  135. }
  136. .tui-header {
  137. width: 100%;
  138. padding: 40rpx;
  139. display: flex;
  140. align-items: center;
  141. justify-content: space-between;
  142. box-sizing: border-box;
  143. }
  144. .tui-page-title {
  145. width: 100%;
  146. font-size: 48rpx;
  147. font-weight: bold;
  148. color: $uni-text-color;
  149. line-height: 42rpx;
  150. padding: 40rpx;
  151. box-sizing: border-box;
  152. }
  153. .tui-form {
  154. padding-top: 50rpx;
  155. .tui-view-input {
  156. width: 100%;
  157. box-sizing: border-box;
  158. padding: 0 40rpx;
  159. .tui-cell-input {
  160. width: 100%;
  161. display: flex;
  162. align-items: center;
  163. padding-top: 48rpx;
  164. padding-bottom: $uni-spacing-col-base;
  165. input {
  166. flex: 1;
  167. padding-left: $uni-spacing-row-base;
  168. }
  169. .tui-icon-close {
  170. margin-left: auto;
  171. }
  172. }
  173. }
  174. .tui-cell-text {
  175. width: 100%;
  176. padding: $uni-spacing-col-lg $uni-spacing-row-lg;
  177. box-sizing: border-box;
  178. font-size: $uni-font-size-sm;
  179. color: $uni-text-color-grey;
  180. display: flex;
  181. align-items: center;
  182. justify-content: space-between;
  183. .tui-color-primary {
  184. color: $uni-color-primary;
  185. }
  186. }
  187. .tui-btn-box {
  188. width: 100%;
  189. padding: 0 $uni-spacing-row-lg;
  190. box-sizing: border-box;
  191. margin-top: 80rpx;
  192. }
  193. }
  194. .tui-login-way {
  195. width: 100%;
  196. font-size: 26rpx;
  197. color: $uni-color-primary;
  198. display: flex;
  199. justify-content: center;
  200. position: fixed;
  201. left: 0;
  202. bottom: 80rpx;
  203. view {
  204. padding: 12rpx 0;
  205. }
  206. }
  207. .tui-auth-login {
  208. width: 100%;
  209. display: flex;
  210. align-items: center;
  211. justify-content: center;
  212. padding-bottom: 80rpx;
  213. padding-top: 20rpx;
  214. .tui-icon-platform {
  215. width: 90rpx;
  216. height: 90rpx;
  217. display: flex;
  218. align-items: center;
  219. justify-content: center;
  220. position: relative;
  221. margin-left: 40rpx;
  222. &::after {
  223. content: '';
  224. position: absolute;
  225. width: 200%;
  226. height: 200%;
  227. transform-origin: 0 0;
  228. transform: scale(0.5, 0.5) translateZ(0);
  229. box-sizing: border-box;
  230. left: 0;
  231. top: 0;
  232. border-radius: 180rpx;
  233. border: 1rpx solid $uni-text-color-placeholder;
  234. }
  235. }
  236. .tui-login-logo {
  237. width: 60rpx;
  238. height: 60rpx;
  239. }
  240. }
  241. }
  242. </style>