25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

236 lines
4.2 KiB

  1. <template>
  2. <view>
  3. <view class="head">
  4. <image class="head-immg" src="https://qufang.oss-cn-beijing.aliyuncs.com/zkgj/xcx/login.png" mode=""></image>
  5. </view>
  6. <view class="input">
  7. <view class="cwjs-cells item-flex">
  8. <view class="cwjs-item center">
  9. <input type="text" v-model="username" placeholder="请输入手机号码" maxlength="11"
  10. placeholder-style='color:#AAAAAA' />
  11. </view>
  12. </view>
  13. <view class="textbox">
  14. <view class="textbox-1" @tap="bindVerification">密码登录</view>
  15. <view class="textbox-2"></view>
  16. <view class="textbox-11"></view>
  17. </view>
  18. </view>
  19. <view class="button" @tap="bindWxBLogin">获取验证码</view>
  20. </view>
  21. </template>
  22. <script>
  23. var util = require("../../utils/util.js");
  24. var config = require("../../config");
  25. var app = getApp();
  26. export default {
  27. data() {
  28. return {
  29. username: '',
  30. role: ''
  31. };
  32. },
  33. onLoad: function(options) {
  34. this.role=options.role;
  35. },
  36. methods: {
  37. //账号密码登录
  38. bindVerification() {
  39. uni.navigateTo({
  40. url: '/pages/login/index',
  41. })
  42. },
  43. //获取验证码
  44. bindWxBLogin: function(e) {
  45. if (!(/^1[34578]\d{9}$/.test(this.username))) {
  46. util.showNone("手机号码错误");
  47. this.username='';
  48. return false;
  49. } else {
  50. uni.request({
  51. url: config.service.sendCode + "?mobile=" + this.username,
  52. method: "GET",
  53. header: {
  54. 'content-type': 'application/json',
  55. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  56. },
  57. success: (data) => {
  58. console.log(data)
  59. // 成功地响应会话信息
  60. if (data.data.code == 10000) {
  61. util.showSuccess('发送成功');
  62. if(this.role==1){
  63. uni.navigateTo({
  64. url: '/pages/login/yinzhongmalogin?username=' + this.username +
  65. '&role=' + this.role,
  66. })
  67. }else{
  68. uni.navigateTo({
  69. url: '/pages/login/Verifythelogin?username=' + this.username +
  70. '&role=' + this.role,
  71. })
  72. }
  73. // 没有正确响应会话信息
  74. } else {
  75. util.showNone(data.data.message);
  76. return false;
  77. }
  78. },
  79. })
  80. }
  81. },
  82. }
  83. };
  84. </script>
  85. <style lang="scss">
  86. .cwjs-logo {
  87. display: block;
  88. width: 219rpx;
  89. height: 158rpx;
  90. margin: 54rpx auto 66rpx;
  91. }
  92. .cwjs-tips {
  93. font-size: 24rpx;
  94. padding: 80rpx 0;
  95. color: #8a8a8a;
  96. }
  97. .cwjs-form {
  98. position: relative;
  99. margin: 0;
  100. background-color: #fff;
  101. border-radius: 10px;
  102. padding: 20rpx 40rpx 113rpx;
  103. }
  104. .cwjs-cells {
  105. width: 569rpx;
  106. display: flex;
  107. flex-direction: row;
  108. justify-content: space-between;
  109. align-items: center;
  110. margin: 0 auto;
  111. height: 88rpx;
  112. overflow: hidden;
  113. border-bottom: 1rpx solid #BFC7D3;
  114. position: relative;
  115. }
  116. .center {
  117. flex: 1;
  118. }
  119. .cwjs-input {
  120. height: 48rpx;
  121. line-height: 48rpx;
  122. padding: 23rpx 23rpx 23rpx 78rpx;
  123. font-size: 28rpx;
  124. font-family: PingFangSC-Regular, PingFang SC;
  125. color: #000;
  126. }
  127. .images {
  128. display: block;
  129. width: 40rpx;
  130. height: 21rpx;
  131. margin-right: 30rpx;
  132. margin-top: 33.5rpx;
  133. }
  134. /* 头部 */
  135. .head {
  136. width: 750rpx;
  137. height: 500rpx;
  138. position: relative;
  139. .head-immg{
  140. width: 118rpx;
  141. height: 61rpx;
  142. position: absolute;
  143. top: 300rpx;
  144. left: 100rpx;
  145. }
  146. }
  147. .logo {
  148. width: 248upx;
  149. height: 248upx;
  150. display: block;
  151. position: absolute;
  152. top: 134rpx;
  153. left: 240.5rpx;
  154. }
  155. /* 输入框 */
  156. .input {
  157. width: 100%;
  158. height: auto;
  159. padding: 0 105rpx;
  160. box-sizing: border-box;
  161. }
  162. .logo_input {
  163. width: 34rpx;
  164. height: 38rpx;
  165. position: absolute;
  166. top: 25rpx;
  167. left: 0;
  168. }
  169. /* 登录 */
  170. .button {
  171. width: 630rpx;
  172. height: 86rpx;
  173. background: #2671E2;
  174. box-shadow: 0px 2rpx 20rpx 0px rgba(38, 113, 226, 0.5);
  175. border-radius: 49rpx;
  176. text-align: center;
  177. line-height: 89rpx;
  178. color: #fff;
  179. margin: 0 auto;
  180. margin-top: 239rpx;
  181. font-size: 34rpx;
  182. }
  183. .login {
  184. text-decoration: underline;
  185. text-align: center;
  186. margin-top: 40px;
  187. color: #88909E;
  188. font-size: 28rpx;
  189. }
  190. .textbox {
  191. width: 569rpx;
  192. display: flex;
  193. margin-top: 40rpx;
  194. }
  195. .textbox-1 {
  196. width: 30%;
  197. font-size: 30rpx;
  198. color: #999999;
  199. }
  200. .textbox-11 {
  201. width: 30%;
  202. text-align: right;
  203. font-size: 30rpx;
  204. color: #999999;
  205. }
  206. .textbox-2 {
  207. width: 40%;
  208. }
  209. </style>