|  |  | 
 |  |  |          <view class="user-info-item shadow-warp"> | 
 |  |  |             <view class="icons"><uni-icons type="person" size="20"></uni-icons></view> | 
 |  |  |             <text>账号:</text> | 
 |  |  |             <input type="text"> | 
 |  |  |             <input type="text" placeholder="请输入账号!" v-model="user.userName" | 
 |  |  |             placeholder-style="font-size:14px;color:#ccc;"> | 
 |  |  |          </view> | 
 |  |  |          <view class="user-info-item shadow-warp"> | 
 |  |  |             <view class="icons"><uni-icons type="locked" size="20"></uni-icons></view> | 
 |  |  |             <text>密码:</text> | 
 |  |  |             <input :password="!showPassword" v-model="password"> | 
 |  |  |             <input :password="!showPassword" v-model="user.password" placeholder="请输入密码!" | 
 |  |  |             placeholder-style="font-size:14px;color:#ccc;"> | 
 |  |  |             <view class="showPassword" v-if="showPassword" @click="changePassword"><uni-icons type="eye" size="20"></uni-icons></view> | 
 |  |  |             <view class="showPassword" v-if="!showPassword" @click="changePassword"><uni-icons type="eye-slash" size="20"></uni-icons></view> | 
 |  |  |          </view> | 
 |  |  |       </view> | 
 |  |  |       <!-- 登录按钮 --> | 
 |  |  |       <view class="loging"> | 
 |  |  |          <button class="button" >登录</button> | 
 |  |  |          <button class="button" @click="onLogin()" :loading="load.loading">{{load.btnText}}</button> | 
 |  |  |       </view> | 
 |  |  |       <!-- #ifdef APP-PLUS --> | 
 |  |  |       <view class="version"> | 
 |  |  | 
 |  |  | </template> | 
 |  |  |  | 
 |  |  | <script> | 
 |  |  |    import md5 from '../../common/md5.js' | 
 |  |  |    export default { | 
 |  |  |       data() { | 
 |  |  |          return { | 
 |  |  |             version:'', | 
 |  |  |             showPassword:false, | 
 |  |  |             password:'', | 
 |  |  |             version: '', | 
 |  |  |             showPassword: false, | 
 |  |  |             user: { | 
 |  |  |                userName: '', | 
 |  |  |                password: '', | 
 |  |  |             }, | 
 |  |  |             load: { | 
 |  |  |                loading: false, | 
 |  |  |                btnText: '登录' | 
 |  |  |             } | 
 |  |  |          } | 
 |  |  |       }, | 
 |  |  |       onLoad:function(){ | 
 |  |  |          this.user.userName = uni.getStorageSync('userName') | 
 |  |  |          // #ifdef APP-PLUS | 
 |  |  |          var that=this | 
 |  |  |          plus.runtime.getProperty( plus.runtime.appid, function ( wgtinfo ) { | 
 |  |  | 
 |  |  |          }); | 
 |  |  |          // #endif | 
 |  |  |           | 
 |  |  | 			 | 
 |  |  |       }, | 
 |  |  |       methods: { | 
 |  |  |          changePassword: function() { | 
 |  |  |              this.showPassword = !this.showPassword; | 
 |  |  |          }, | 
 |  |  |          onLogin() { | 
 |  |  |             let that = this | 
 |  |  |             uni.request({ | 
 |  |  |                url: 'http://localhost:9528/login.action', | 
 |  |  |                fail(result) { | 
 |  |  |                   uni.showToast({title: '请求失败'}) | 
 |  |  |                }, | 
 |  |  |                data: { | 
 |  |  |                  username:that.user.userName, | 
 |  |  |                  password:md5.hex_md5(that.user.password)  | 
 |  |  |                }, | 
 |  |  |                header: { | 
 |  |  |                   "content-type": "application/json" | 
 |  |  |                }, | 
 |  |  |                success(result) { | 
 |  |  |                   let res = result.data | 
 |  |  |                   if (res.code === 200 ){ | 
 |  |  |                      that.load.loading = true; | 
 |  |  |                      that.load.btnText = '登录中'; | 
 |  |  |                      uni.setStorageSync('token', res.data.token); | 
 |  |  |                      uni.setStorageSync('userName', that.user.userName); | 
 |  |  |                      uni.setStorageSync('baseUrl','http://localhost:9528') | 
 |  |  |                      setTimeout(()=> { | 
 |  |  |                         uni.showToast({title: '登录成功'}) | 
 |  |  |                         setTimeout(()=> { | 
 |  |  |                            uni.reLaunch({ | 
 |  |  |                               url: '../index/index' | 
 |  |  |                            }); | 
 |  |  |                         },300) | 
 |  |  |                      },700) | 
 |  |  |                   } else { | 
 |  |  |                      uni.showToast({title: res.msg}) | 
 |  |  |                   } | 
 |  |  |                }, | 
 |  |  | 					 | 
 |  |  | 					 | 
 |  |  |             }) | 
 |  |  |          }, | 
 |  |  |       } | 
 |  |  |    } | 
 |  |  | 
 |  |  |       align-items:center; | 
 |  |  |       background-color: #fff; | 
 |  |  |       margin-bottom: 30rpx; | 
 |  |  |       font-size: 28rpx; | 
 |  |  |       font-weight: 500; | 
 |  |  |    } | 
 |  |  |    .user-info-item input{ | 
 |  |  |       width: 350rpx; | 
 |  |  |    .user-info-item>input{ | 
 |  |  |       width: 400rpx; | 
 |  |  |       color:#606266; | 
 |  |  |       font-weight: 500; | 
 |  |  |       caret-color:#606266; // 光标颜色 | 
 |  |  |    } | 
 |  |  |    .icons { | 
 |  |  |       margin-left: 20rpx; |