| | |
| | | <switch :checked='remberPassword' color="#FFCC33" style="zoom:.5" @change="remberChange"/> |
| | | </view> |
| | | </view> |
| | | <view class="button" @click="login" :loading="load.loading"> |
| | | {{load.btnText}} |
| | | </view> |
| | | <!-- <view class="button" @click="login" :loading="load.loading"> |
| | | {{load.btnText}} |
| | | </view> --> |
| | | <button class="button" @click="onLogin()" :loading="load.loading">{{load.btnText}}</button> |
| | | </view> |
| | | <!-- 设置弹窗区域 --> |
| | | <uni-popup ref="settings" type="dialog"> |
| | |
| | | uni.setStorageSync('Network', this.network); |
| | | this.$refs.settings.close() |
| | | }, |
| | | login() { |
| | | onLogin() { |
| | | let _this = this,path = 'demo',network = uni.getStorageSync('Network'); |
| | | if(network) { |
| | | path = network[0].address |
| | | path = path.substring(0, path.length - 3); |
| | | if(!network) { |
| | | uni.showToast({ |
| | | icon: 'error', |
| | | title: '请配置网络信息' |
| | | }) |
| | | } |
| | | path = network[0].address |
| | | path = path.substring(0, path.length - 3); |
| | | let baseUrl = `http://${network[0].ip}:${network[0].port}/${network[0].address}` |
| | | uni.request({ |
| | | url: `${baseUrl}/login.action`, |
| | |
| | | success(res) { |
| | | res = res.data |
| | | if (res.code === 200) { |
| | | _this.load.loading = true; |
| | | _this.load.btnText = '登录中'; |
| | | uni.setStorageSync('token', res.data.token); |
| | | _this.load.btnText = '登录中'; |
| | | setTimeout(() => { |
| | |
| | | inset -4px -4px 4px rgba(255,255,255,.4), |
| | | -4px -4px 5px rgba(0,0,0,.4); |
| | | } |
| | | .button:active { |
| | | transform: translateY(5px) scale(0.99, 0.99); |
| | | box-shadow: inset 4px 4px 4px rgba(0, 0, 0, .3), |
| | | inset -4px -4px 8px rgba(255, 255, 255, .7), |
| | | -5px -5px 5px rgba(0, 0, 0, .3); |
| | | } |
| | | @media screen and (orientation: portrait) { |
| | | /* 竖屏 */ |
| | | .main { |