loginOther.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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. var that = this
  113. if (this.phone.length == 11 && /^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.phone)) {
  114. that.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', {
  115. phone: this.phone,
  116. }).then(res => {
  117. if (res.data.authenticationStatus == '已禁用') {
  118. that.$refs.uToast.show({
  119. type: 'error',
  120. message: "账号审核中!"
  121. })
  122. } else {
  123. uni.navigateTo({
  124. url: '/pages/public/code?phone=' + this.phone
  125. })
  126. }
  127. })
  128. } else if (this.phone.length == 0) {
  129. uni.showToast({
  130. title: '手机号不能为空',
  131. icon: 'none'
  132. })
  133. } else {
  134. uni.showToast({
  135. title: '请输入正确的手机号',
  136. icon: 'none'
  137. })
  138. }
  139. },
  140. goregister() {
  141. uni.navigateTo({
  142. url: '/pages/public/register'
  143. })
  144. },
  145. ...mapMutations(['login']),
  146. navBack() {
  147. uni.navigateBack();
  148. },
  149. },
  150. }
  151. </script>
  152. <style lang='scss' scoped>
  153. .apple {
  154. background: #000;
  155. width: 35px;
  156. height: 35px;
  157. padding: 8px;
  158. border-radius: 50%;
  159. vertical-align: middle;
  160. }
  161. page {
  162. background: #fff;
  163. }
  164. .cuIcon-weixin {
  165. background: #F5BA3C;
  166. color: #fff;
  167. font-size: 18px;
  168. padding: 9px;
  169. border-radius: 50%;
  170. vertical-align: middle;
  171. margin-right: 5px;
  172. }
  173. .close {
  174. width: 20px;
  175. height: 20px;
  176. position: absolute;
  177. right: 30px;
  178. }
  179. .container {
  180. /* padding-top: 223rpx; */
  181. position: relative;
  182. width: 100vw;
  183. height: 100vh;
  184. overflow: hidden;
  185. background: url('~@/static/images/mine/bg@2x.png');
  186. background-size: cover;
  187. }
  188. .wrapper {
  189. position: relative;
  190. z-index: 90;
  191. padding-bottom: 40upx;
  192. height: 100%;
  193. padding: 0 30px;
  194. }
  195. .back-btn {
  196. position: absolute;
  197. left: 40upx;
  198. z-index: 9999;
  199. padding-top: var(--status-bar-height);
  200. top: 40upx;
  201. font-size: 40upx;
  202. color: red;
  203. }
  204. .verificationCode {
  205. margin-top: 20px;
  206. background: #F5F6F9;
  207. color: #AFB3BF;
  208. }
  209. .verificationCode.active {
  210. background: #F5BA3C;
  211. color: #fff;
  212. }
  213. .verificationCode:after {
  214. border: none;
  215. }
  216. .register {
  217. position: absolute;
  218. bottom: 136rpx;
  219. left: 50%;
  220. transform: translateX(-50%);
  221. color: #333333;
  222. border-radius: 43rpx;
  223. border: 1px solid #444444;
  224. font-size: 28rpx;
  225. padding: 0rpx 49rpx;
  226. }
  227. .register:after {
  228. border: none;
  229. }
  230. .title {
  231. font-size: 46rpx;
  232. }
  233. .phone-before-num {
  234. font-size: 34rpx;
  235. font-family: DINPro-Medium, DINPro;
  236. font-weight: 500;
  237. color: #333333;
  238. }
  239. .use-password {
  240. margin-top: 31rpx;
  241. }
  242. </style>