| | |
| | | <view class="scroll-item" v-for="net in network"> |
| | | <view class="item-title" style="">{{net.name}}</view> |
| | | <view style="display: flex;align-items: center;"> |
| | | <input class="settings-input1" type="text" v-model="net.ip"> |
| | | <input class="settings-input1" type="text" v-model="net.ip" placeholder="请输入ip"> |
| | | <text style="font-weight: 900;">:</text> |
| | | <input class="settings-input2" type="text" v-model="net.port"> |
| | | <input class="settings-input2" type="text" v-model="net.port" placeholder="请输入端口"> |
| | | <text style="font-weight: 900;">/</text> |
| | | <input class="settings-input3" type="text" v-model="net.address"> |
| | | <input class="settings-input3" type="text" v-model="net.address" placeholder="请输入地址"> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | |
| | | username: '', |
| | | password: '' |
| | | }, |
| | | network: [{ |
| | | name: 'wms', |
| | | ip: '192.168.1.1', |
| | | port: '8080', |
| | | address: 'pswms' |
| | | }, |
| | | { |
| | | name: 'wcs', |
| | | ip: '192.168.1.1', |
| | | port: '9090', |
| | | address: 'pswcs' |
| | | } |
| | | ], |
| | | network: [{}], |
| | | load: { |
| | | loading: false, |
| | | btnText: '登录' |
| | |
| | | this.$refs.settings.close() |
| | | }, |
| | | async login() { |
| | | uni.reLaunch({ |
| | | url: `/pages/project/jmAGV/home`, |
| | | }); |
| | | return |
| | | // uni.reLaunch({ |
| | | // url: `/pages/project/jmAGV/home`, |
| | | // }); |
| | | // return |
| | | if (!uni.getStorageSync('Network')) { |
| | | uni.showToast({ icon: 'error', title: '请配置网络信息' }) |
| | | return |
| | |
| | | } |
| | | this.load.loading = true; |
| | | this.load.btnText = '登录中'; |
| | | uni.setStorageSync('user', this.user); |
| | | let res = await common.onLogin(this.user) |
| | | console.log(res); |
| | | if (res.code === 200) { |
| | | setTimeout(() => { |
| | | uni.showToast({ |
| | |
| | | }) |
| | | setTimeout(() => { |
| | | uni.reLaunch({ |
| | | url: `/pages/home/home`, |
| | | url: `/pages/project/jmAGV/home`, |
| | | }); |
| | | }, 300) |
| | | if (!this.remberPassword) { |
| | | this.user.password = '' |
| | | } |
| | | uni.setStorageSync('user', this.user); |
| | | // uni.setStorageSync('user', this.user); |
| | | }, 700) |
| | | } else if (res.code === 0) { |
| | | this.load.loading = false; |