login-accont.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <view class="container login">
  3. <view class="login-main">
  4. <image class="logo" src="../../static/login-logo@3x.png" mode=""></image>
  5. <text class="logo-text">生美/医美采购服务平台</text>
  6. </view>
  7. <view class="login-form">
  8. <view class="login-input">
  9. <input type="number"
  10. v-model="accountNumber"
  11. maxlength="30"
  12. class="input"
  13. placeholder="请输入邮箱/手机号"
  14. />
  15. </view>
  16. <view class="login-input">
  17. <input v-show="isShowEye" type="text" v-model="password" maxlength="18" class="input" placeholder="请输入密码" autocomplete="new-password"/>
  18. <input v-show="!isShowEye" type="password" v-model="password" :password="true" maxlength="18" class="input" placeholder="请输入密码" autocomplete="new-password"/>
  19. <view class="iconfont" :class="isShowEye ? iconEyen : iconEyes" @click="passwordClick"></view>
  20. </view>
  21. <view class="login-input link">
  22. <view class="login-reg" @click.stop="this.$api.navigateTo('/pages/user-module/register')">免费注册</view>
  23. <view class="login-pwd" @click.stop="this.$api.navigateTo('/pages/user-module/password')">忘记密码?</view>
  24. </view>
  25. </view>
  26. <view class="login-btn" @click="confirmLogin">登录</view>
  27. <view class="login-btn-last" @click.stop="this.$api.navigateTo('/pages/user-module/login')">授权登录</view>
  28. </view>
  29. </template>
  30. <script>
  31. import { mapMutations } from 'vuex';
  32. import authorize from '@/common/config/authorize.js'
  33. import { organizationLogin } from '@/api/use.js'
  34. var self;
  35. export default{
  36. data() {
  37. return{
  38. isShowEye:false,
  39. iconEyes:'icon-yanjing_yincang_o',
  40. iconEyen:'icon-yanjing_xianshi_o',
  41. accountNumber:'', //用户登录账号
  42. password:'', //用户登录密码
  43. toestText:'',
  44. telPhone:'',
  45. loginType:'', //跳转类型
  46. alertText:'',
  47. listType: '',
  48. listVal: '',
  49. detilType:'',
  50. id:'', //商品ID
  51. option:'' //页面传递参数
  52. }
  53. },
  54. onLoad(option) {
  55. console.log(option)
  56. this.option = option
  57. },
  58. methods:{
  59. ...mapMutations(['login']),
  60. confirmLogin(){
  61. let params ={
  62. mobileOrEmail:this.accountNumber,
  63. password:this.password,
  64. source:'www',
  65. }
  66. organizationLogin(params).then(res =>{
  67. if(res.code == '0' ){
  68. this.storeUpdataeStatus(res.data)
  69. this.$api.navigateTo(`/pages/user-module/bindwechat?data=${this.option}&codeType=${res.code}`)
  70. }else if(res.code == '4'){
  71. this.storeUpdataeStatus(res.data)
  72. this.$api.navigateTo(`/pages/user-module/bindemail?data=${this.option}&codeType=${res.code}`)
  73. }else if(res.code == '-3'){
  74. this.storeUpdataeStatus(res.data)
  75. this.$util.modal('',res.msg,'前往修改',true,() =>{
  76. this.$api.navigateTo('/pages/user-module/apply')
  77. })
  78. }else{
  79. this.$util.msg(res.msg,2000);
  80. }
  81. })
  82. },
  83. storeUpdataeStatus(data){
  84. let user_key = {
  85. clubID:data.clubID,
  86. shopID:data.shopID,
  87. userID:data.userID,
  88. bindMobile:data.bindMobile
  89. }
  90. this.$store.commit('updateStatus',user_key)
  91. },
  92. passwordClick() { //密码显隐操作
  93. this.isShowEye = !this.isShowEye;
  94. },
  95. }
  96. }
  97. </script>
  98. <style lang="scss">
  99. .login{
  100. width: 100%;
  101. height: auto;
  102. .model-warp.none{
  103. display: none;
  104. }
  105. .model-warp.show{
  106. display: block;
  107. }
  108. .login-main{
  109. width: 100%;
  110. display: flex;
  111. flex-direction: column;
  112. align-items: center;
  113. height: 198rpx;
  114. padding: 170rpx 0 60rpx 0;
  115. .logo{
  116. width: 138rpx;
  117. height: 118rpx;
  118. display: block;
  119. }
  120. .logo-text{
  121. font-size: 30rpx;
  122. line-height: 44rpx;
  123. color: $color-system;
  124. font-weight: 600;
  125. margin-top: 20rpx;
  126. }
  127. }
  128. .login-input{
  129. width: 654rpx;
  130. height: 40rpx;
  131. padding: 24rpx;
  132. margin: 0 auto;
  133. margin-bottom: 20rpx;
  134. background: #F7F7F7;
  135. border-radius: 14rpx;
  136. position: relative;
  137. .input{
  138. width: 100%;
  139. height: 100%;
  140. background: #F7F7F7;
  141. font-size: $font-size-28;
  142. line-height: 40rpx;
  143. color: #333333;
  144. border-radius: 14rpx;
  145. }
  146. .iconfont{
  147. position: absolute;
  148. right: 0;
  149. top: 0;
  150. font-size: 46rpx;
  151. color: $color-system;
  152. font-weight: bold;
  153. z-index: 99;
  154. width: 96rpx;
  155. height: 96rpx;
  156. line-height: 96rpx;
  157. text-align: center;
  158. }
  159. &.link{
  160. background: #FFFFFF;
  161. margin-bottom: 40rpx;
  162. padding: 0 24rpx;
  163. line-height: 40rpx;
  164. font-size: $font-size-28;
  165. .login-reg{
  166. float: left;
  167. color: $color-system;
  168. }
  169. .login-pwd{
  170. float: right;
  171. color: $text-color;
  172. }
  173. }
  174. }
  175. .login-btn{
  176. width: 702rpx;
  177. height: 88rpx;
  178. border-radius: 14rpx;
  179. font-size: $font-size-28;
  180. line-height: 88rpx;
  181. color: #FFFFFF;
  182. margin: 0 auto;
  183. text-align: center;
  184. background: $btn-confirm;
  185. }
  186. .login-btn-last{
  187. width: 702rpx;
  188. font-size: $font-size-28;
  189. line-height: 160rpx;
  190. margin: 0 auto;
  191. color: $text-color;
  192. text-align: center;
  193. }
  194. .model-authorization{
  195. width: 100%;
  196. height: 100%;
  197. position: fixed;
  198. top: 0;
  199. left: 0;
  200. z-index: 999;
  201. .authorization{
  202. width: 518rpx;
  203. height: 320rpx;
  204. position: absolute;
  205. background: rgba(255,255,255,.7);
  206. left: 0;
  207. right: 0;
  208. bottom: 0;
  209. top: 0;
  210. margin: auto;
  211. .to-btn{
  212. position: absolute;
  213. top: 0;
  214. left: 0;
  215. right: 0;
  216. bottom: 0;
  217. margin: auto;
  218. width: 70%;
  219. height: 88rpx;
  220. font-size: $font-size-28;
  221. line-height: 88rpx;
  222. color: #FFFFFF;
  223. text-align: center;
  224. border-radius: 44rpx;
  225. }
  226. }
  227. }
  228. }
  229. </style>