login-accont.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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="text"
  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?data=${getOption}`)">邀请码登录</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. getOption:'' //页面传递参数
  52. }
  53. },
  54. onLoad(option) {
  55. console.log(option)
  56. this.getOption = JSON.stringify(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(response =>{
  67. if(response.code == '0' ){
  68. this.storeUpdataeStatus(response.data)
  69. this.$api.navigateTo(`/pages/user-module/bindwechat?data=${JSON.stringify(this.getOption)}&codeType=${response.code}`)
  70. }else if(response.code == '4'){
  71. this.storeUpdataeStatus(response.data)
  72. this.$api.navigateTo(`/pages/user-module/bindemail?data=${JSON.stringify(this.getOption)}&codeType=${response.code}`)
  73. }else if(response.code == '-3'){
  74. this.storeUpdataeStatus(response.data)
  75. this.$util.modal('',response.msg,'前往修改','',false,() =>{
  76. this.$api.navigateTo('/pages/user-module/apply')
  77. })
  78. }else{
  79. this.$util.msg(response.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. uni.setStorageSync('token',data.token)
  91. this.$store.commit('updateStatus',user_key)
  92. this.login(data);
  93. },
  94. passwordClick() { //密码显隐操作
  95. this.isShowEye = !this.isShowEye;
  96. },
  97. },
  98. onShow() {
  99. }
  100. }
  101. </script>
  102. <style lang="scss">
  103. .login{
  104. width: 100%;
  105. height: auto;
  106. .model-warp.none{
  107. display: none;
  108. }
  109. .model-warp.show{
  110. display: block;
  111. }
  112. .login-main{
  113. width: 100%;
  114. display: flex;
  115. flex-direction: column;
  116. align-items: center;
  117. height: 198rpx;
  118. padding: 170rpx 0 60rpx 0;
  119. .logo{
  120. width: 138rpx;
  121. height: 118rpx;
  122. display: block;
  123. }
  124. .logo-text{
  125. font-size: 30rpx;
  126. line-height: 44rpx;
  127. color: $color-system;
  128. font-weight: 600;
  129. margin-top: 20rpx;
  130. }
  131. }
  132. .login-input{
  133. width: 654rpx;
  134. height: 40rpx;
  135. padding: 24rpx;
  136. margin: 0 auto;
  137. margin-bottom: 20rpx;
  138. background: #F7F7F7;
  139. border-radius: 14rpx;
  140. position: relative;
  141. .input{
  142. width: 100%;
  143. height: 100%;
  144. background: #F7F7F7;
  145. font-size: $font-size-28;
  146. line-height: 40rpx;
  147. color: #333333;
  148. border-radius: 14rpx;
  149. }
  150. .iconfont{
  151. position: absolute;
  152. right: 0;
  153. top: 0;
  154. font-size: 46rpx;
  155. color: $color-system;
  156. font-weight: bold;
  157. z-index: 99;
  158. width: 96rpx;
  159. height: 96rpx;
  160. line-height: 96rpx;
  161. text-align: center;
  162. }
  163. &.link{
  164. background: #FFFFFF;
  165. margin-bottom: 40rpx;
  166. padding: 0 24rpx;
  167. line-height: 40rpx;
  168. font-size: $font-size-28;
  169. .login-reg{
  170. float: left;
  171. color: $color-system;
  172. }
  173. .login-pwd{
  174. float: right;
  175. color: $text-color;
  176. }
  177. }
  178. }
  179. .login-btn{
  180. width: 702rpx;
  181. height: 88rpx;
  182. border-radius: 14rpx;
  183. font-size: $font-size-28;
  184. line-height: 88rpx;
  185. color: #FFFFFF;
  186. margin: 0 auto;
  187. text-align: center;
  188. background: $btn-confirm;
  189. }
  190. .login-btn-last{
  191. width: 702rpx;
  192. font-size: $font-size-28;
  193. line-height: 160rpx;
  194. margin: 0 auto;
  195. color: $text-color;
  196. text-align: center;
  197. }
  198. .model-authorization{
  199. width: 100%;
  200. height: 100%;
  201. position: fixed;
  202. top: 0;
  203. left: 0;
  204. z-index: 999;
  205. .authorization{
  206. width: 518rpx;
  207. height: 320rpx;
  208. position: absolute;
  209. background: rgba(255,255,255,.7);
  210. left: 0;
  211. right: 0;
  212. bottom: 0;
  213. top: 0;
  214. margin: auto;
  215. .to-btn{
  216. position: absolute;
  217. top: 0;
  218. left: 0;
  219. right: 0;
  220. bottom: 0;
  221. margin: auto;
  222. width: 70%;
  223. height: 88rpx;
  224. font-size: $font-size-28;
  225. line-height: 88rpx;
  226. color: #FFFFFF;
  227. text-align: center;
  228. border-radius: 44rpx;
  229. }
  230. }
  231. }
  232. }
  233. </style>