loginOther.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <view class="container">
  3. <u-icon class="back-btn" name="arrow-left" color="black" size="20" @click="navBack"></u-icon>
  4. <!-- 设置白色背景防止软键盘把下部绝对定位元素顶上来盖住输入框等 -->
  5. <view class="wrapper">
  6. <image style='width:38px;height:38px;margin:223rpx 0 20px 0;' src='@/static/logo.png'></image>
  7. <h2 class="title Semibold">欢迎使用智运货主端</h2>
  8. <view style='width:100%;margin-top:50px;border-bottom:1px solid #E8E9ED;padding:10px;' class="flex">
  9. <view class="phone-before-num NumberMedium">+86</view>
  10. <view style='width:85%;'>
  11. <!-- <u--input style='padding-left:10px;' class="NumberMedium" v-model='phone' @input='changephone' placeholder="请输入手机号码" type="number" maxlength="11" :clearable='true'></u--input> -->
  12. <input style='padding-left:10px;' class="NumberMedium" v-model='phone' @input='changephone'
  13. placeholder="请输入手机号码" type="number" maxlength="11">
  14. </view>
  15. <!-- <image v-if='phone!=""' @click='phone=""' class='close' src='../../static/img/login/guanbi@2x.png'></image> -->
  16. </view>
  17. <button @click='gocode' :class='codestatus?"active":""' class='verificationCode'>获取验证码</button>
  18. <view @click='gonumber' class="Regular use-password" style='text-align:center;color:#6A6A6A;'>使用账号密码登录
  19. </view>
  20. <button v-if='tabbar' @click='goregister' class='Regular register active'>手机号一键注册</button>
  21. </view>
  22. <view v-if="loginType === 'phone'" class="register-section">
  23. 还没有账号?
  24. <text @click="toRegist">马上注册</text>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import {
  30. mapMutations
  31. } from 'vuex';
  32. import {
  33. openFSqlite,
  34. createFSQL,
  35. selectFSQL,
  36. addFSQL
  37. } from '../../util/f.js'
  38. import {
  39. queryData,
  40. upData,
  41. initData
  42. } from '../../util/dbUtil.js'
  43. import {
  44. mapState
  45. } from 'vuex';
  46. export default {
  47. data() {
  48. return {
  49. inputContent: null,
  50. loginType: "wechat",
  51. phone: '',
  52. password: '',
  53. logining: false,
  54. isPhone: false,
  55. isApple: true,
  56. accessToken: '',
  57. phone: '',
  58. params: {
  59. encryptedData: '',
  60. session_key: '',
  61. iv: '',
  62. },
  63. userInfo: {
  64. nickName: '',
  65. avatarUrl: '',
  66. gender: '',
  67. phone: ''
  68. },
  69. inputStatus: 'none',
  70. verifyCode: null,
  71. sendText: '获取验证码',
  72. sendDisabled: false,
  73. system: '',
  74. platform: '',
  75. userData: undefined,
  76. tabbar: true,
  77. windowHeight: '',
  78. canIUseProfile: false,
  79. codestatus: false
  80. }
  81. },
  82. computed: {
  83. ...mapState(['clientId'])
  84. },
  85. onShow() {
  86. // this.loginType = "wechat"
  87. this.$api.logout()
  88. },
  89. onLoad(options) {
  90. },
  91. methods: {
  92. changephone(e) {
  93. if (e.detail.value.length > 11) {
  94. this.codestatus = true
  95. } else if (e.detail.value.length < 11) {
  96. this.codestatus = false
  97. } else {
  98. this.codestatus = true
  99. }
  100. },
  101. gonumber() {
  102. uni.navigateTo({
  103. url: '/pages/public/login'
  104. })
  105. },
  106. forgetpass() {
  107. uni.navigateTo({
  108. url: '/pages/public/reset'
  109. })
  110. },
  111. gocode() {
  112. if (this.phone.length == 11 && /^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.phone)) {
  113. uni.navigateTo({
  114. url: '/pages/public/code?phone=' + this.phone
  115. })
  116. } else if (this.phone.length == 0) {
  117. uni.showToast({
  118. title: '手机号不能为空',
  119. icon: 'none'
  120. })
  121. } else {
  122. uni.showToast({
  123. title: '请输入正确的手机号',
  124. icon: 'none'
  125. })
  126. }
  127. },
  128. goregister() {
  129. uni.navigateTo({
  130. url: '/pages/public/register'
  131. })
  132. },
  133. ...mapMutations(['login']),
  134. navBack() {
  135. uni.navigateBack();
  136. },
  137. },
  138. }
  139. </script>
  140. <style lang='scss' scoped>
  141. .apple {
  142. background: #000;
  143. width: 35px;
  144. height: 35px;
  145. padding: 8px;
  146. border-radius: 50%;
  147. vertical-align: middle;
  148. }
  149. page {
  150. background: #fff;
  151. }
  152. .cuIcon-weixin {
  153. background: #2772FB;
  154. color: #fff;
  155. font-size: 18px;
  156. padding: 9px;
  157. border-radius: 50%;
  158. vertical-align: middle;
  159. margin-right: 5px;
  160. }
  161. .close {
  162. width: 20px;
  163. height: 20px;
  164. position: absolute;
  165. right: 30px;
  166. }
  167. .container {
  168. /* padding-top: 223rpx; */
  169. position: relative;
  170. width: 100vw;
  171. height: 100vh;
  172. overflow: hidden;
  173. background: url('~@/static/images/mine/bg@2x.png');
  174. background-size: cover;
  175. }
  176. .wrapper {
  177. position: relative;
  178. z-index: 90;
  179. padding-bottom: 40upx;
  180. height: 100%;
  181. padding: 0 30px;
  182. }
  183. .back-btn {
  184. position: absolute;
  185. left: 40upx;
  186. z-index: 9999;
  187. padding-top: var(--status-bar-height);
  188. top: 40upx;
  189. font-size: 40upx;
  190. color: red;
  191. }
  192. .verificationCode {
  193. margin-top: 20px;
  194. background: #F5F6F9;
  195. color: #AFB3BF;
  196. }
  197. .verificationCode.active {
  198. background: #2772FB;
  199. color: #fff;
  200. }
  201. .verificationCode:after {
  202. border: none;
  203. }
  204. .register {
  205. position: absolute;
  206. bottom: 136rpx;
  207. left: 50%;
  208. transform: translateX(-50%);
  209. color: #333333;
  210. border-radius: 43rpx;
  211. border: 1px solid #444444;
  212. font-size: 28rpx;
  213. padding: 0rpx 49rpx;
  214. }
  215. .register:after {
  216. border: none;
  217. }
  218. .title {
  219. font-size: 46rpx;
  220. }
  221. .phone-before-num {
  222. font-size: 34rpx;
  223. font-family: DINPro-Medium, DINPro;
  224. font-weight: 500;
  225. color: #333333;
  226. }
  227. .use-password {
  228. margin-top: 31rpx;
  229. }
  230. </style>