You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

234 regels
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 + "/" + this.username,
  52. method: "GET",
  53. header: {
  54. 'content-type': 'application/json',
  55. // 'Authorization': 'Bearer '+uni.getStorageSync('weapp_session_login_data').token
  56. },
  57. success: (data) => {
  58. if (data.data.code == 0) {
  59. util.showSuccess('发送成功');
  60. if(this.role==1){
  61. uni.navigateTo({
  62. url: '/pages/login/yinzhongmalogin?username=' + this.username +
  63. '&role=' + this.role,
  64. })
  65. }else{
  66. uni.navigateTo({
  67. url: '/pages/login/Verifythelogin?username=' + this.username +
  68. '&role=' + this.role +'&msg='+data.data.data,
  69. })
  70. }
  71. // 没有正确响应会话信息
  72. } else {
  73. util.showNone(data.data.msg);
  74. return false;
  75. }
  76. },
  77. })
  78. }
  79. },
  80. }
  81. };
  82. </script>
  83. <style lang="scss">
  84. .cwjs-logo {
  85. display: block;
  86. width: 219rpx;
  87. height: 158rpx;
  88. margin: 54rpx auto 66rpx;
  89. }
  90. .cwjs-tips {
  91. font-size: 24rpx;
  92. padding: 80rpx 0;
  93. color: #8a8a8a;
  94. }
  95. .cwjs-form {
  96. position: relative;
  97. margin: 0;
  98. background-color: #fff;
  99. border-radius: 10px;
  100. padding: 20rpx 40rpx 113rpx;
  101. }
  102. .cwjs-cells {
  103. width: 569rpx;
  104. display: flex;
  105. flex-direction: row;
  106. justify-content: space-between;
  107. align-items: center;
  108. margin: 0 auto;
  109. height: 88rpx;
  110. overflow: hidden;
  111. border-bottom: 1rpx solid #BFC7D3;
  112. position: relative;
  113. }
  114. .center {
  115. flex: 1;
  116. }
  117. .cwjs-input {
  118. height: 48rpx;
  119. line-height: 48rpx;
  120. padding: 23rpx 23rpx 23rpx 78rpx;
  121. font-size: 28rpx;
  122. font-family: PingFangSC-Regular, PingFang SC;
  123. color: #000;
  124. }
  125. .images {
  126. display: block;
  127. width: 40rpx;
  128. height: 21rpx;
  129. margin-right: 30rpx;
  130. margin-top: 33.5rpx;
  131. }
  132. /* 头部 */
  133. .head {
  134. width: 750rpx;
  135. height: 500rpx;
  136. position: relative;
  137. .head-immg{
  138. width: 118rpx;
  139. height: 61rpx;
  140. position: absolute;
  141. top: 300rpx;
  142. left: 100rpx;
  143. }
  144. }
  145. .logo {
  146. width: 248upx;
  147. height: 248upx;
  148. display: block;
  149. position: absolute;
  150. top: 134rpx;
  151. left: 240.5rpx;
  152. }
  153. /* 输入框 */
  154. .input {
  155. width: 100%;
  156. height: auto;
  157. padding: 0 105rpx;
  158. box-sizing: border-box;
  159. }
  160. .logo_input {
  161. width: 34rpx;
  162. height: 38rpx;
  163. position: absolute;
  164. top: 25rpx;
  165. left: 0;
  166. }
  167. /* 登录 */
  168. .button {
  169. width: 630rpx;
  170. height: 86rpx;
  171. background: #2671E2;
  172. box-shadow: 0px 2rpx 20rpx 0px rgba(38, 113, 226, 0.5);
  173. border-radius: 49rpx;
  174. text-align: center;
  175. line-height: 89rpx;
  176. color: #fff;
  177. margin: 0 auto;
  178. margin-top: 239rpx;
  179. font-size: 34rpx;
  180. }
  181. .login {
  182. text-decoration: underline;
  183. text-align: center;
  184. margin-top: 40px;
  185. color: #88909E;
  186. font-size: 28rpx;
  187. }
  188. .textbox {
  189. width: 569rpx;
  190. display: flex;
  191. margin-top: 40rpx;
  192. }
  193. .textbox-1 {
  194. width: 30%;
  195. font-size: 30rpx;
  196. color: #999999;
  197. }
  198. .textbox-11 {
  199. width: 30%;
  200. text-align: right;
  201. font-size: 30rpx;
  202. color: #999999;
  203. }
  204. .textbox-2 {
  205. width: 40%;
  206. }
  207. </style>