login-accont.vue 5.9 KB

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