| | |
| | | 服务器设置
|
| | | </view>
|
| | | <view class="uni-form-item uni-column">
|
| | | <view class="title">IP</view>
|
| | | <!-- <input class="uni-input" focus placeholder="IP地址" /> -->
|
| | | <IPInput :ip="sys_ip" @on-blur="sys_ip= arguments[0]"></IPInput>
|
| | | <view class="title">地址:</view>
|
| | | <input class="uni-input" v-model="mq_ip"/>
|
| | | <!-- <IPInput :ip="sys_ip" @on-blur="sys_ip= arguments[0]"></IPInput> -->
|
| | | </view>
|
| | | <view class="uni-form-item uni-column">
|
| | | <view class="title">端口</view>
|
| | | <input class="uni-input" v-model="port" placeholder="" />
|
| | | <view class="title">端口:</view>
|
| | | <input class="uni-input" v-model="mq_port" />
|
| | | </view>
|
| | | </view>
|
| | | <view class="setting-content">
|
| | | <view class="title">
|
| | | 视频及图片服务设置
|
| | | </view>
|
| | | <view class="uni-form-item uni-column">
|
| | | <view class="title">地址:</view>
|
| | | <!-- <input class="uni-input" focus placeholder="IP地址" /> --><input class="uni-input" v-model="pic_ip"/>
|
| | | <!-- <IPInput :ip="pic_ip" @on-blur="pic_ip= arguments[0]"></IPInput> -->
|
| | | </view>
|
| | | <view class="uni-form-item uni-column">
|
| | | <view class="title">端口:</view>
|
| | | <input class="uni-input" v-model="pic_port" placeholder="" />
|
| | | </view>
|
| | | </view>
|
| | | <button type="default" @tap="commit">确认</button>
|
| | | <!-- <uni-popup ref="popup" type="center" background-color="#fff" :animation="false">中间弹出 Popup</uni-popup> -->
|
| | | <uni-popup ref="popup" type="message"> |
| | | <uni-popup-message type="success" message="修改成功" :duration="2000"></uni-popup-message> |
| | | </uni-popup>
|
| | | <uni-popup ref="popup" type="message">
|
| | | <uni-popup-message type="success" message="修改成功" :duration="2000"></uni-popup-message>
|
| | | </uni-popup>
|
| | | <uni-popup ref="popup1" type="message">
|
| | | <uni-popup-message type="error" message="连接失败" :duration="2000"></uni-popup-message>
|
| | | </uni-popup>
|
| | | </view>
|
| | | </template>
|
| | |
|
| | |
| | | },
|
| | | data() {
|
| | | return {
|
| | | sys_ip: "",
|
| | | port: ""
|
| | | mq_ip: "",
|
| | | pic_ip: "",
|
| | | mq_port: "",
|
| | | pic_port:""
|
| | | }
|
| | | },
|
| | | mounted() {},
|
| | | onShow() {
|
| | | [this.mq_ip, this.mq_port] = getApp().globalData.mqUrl.split(":");
|
| | | console.log(this.mq_ip, this.mq_port);
|
| | | [this.pic_ip, this.pic_port] = getApp().globalData.resourseUrl.split(":");
|
| | | console.log(this.pic_ip, this.pic_port);
|
| | | },
|
| | | mounted() {
|
| | | |
| | | uni.$on("connectStatus", (data) => {
|
| | | console.log('connectStatus')
|
| | | // data.status ? this.$refs.popup.open('top') :
|
| | | // this.$refs.popup1.open('top')
|
| | | })
|
| | | },
|
| | | onBackPress(e) {
|
| | | console.log(e);
|
| | | uni.navigateTo({
|
| | |
| | | })
|
| | | },
|
| | | commit() {
|
| | | // console.log(`${this.sys_ip}`,`${this.port}`)
|
| | | // this.$mqtt.options.host = `${this.sys_ip}:${this.port}` |
| | | // this.$mqtt.options.href = "ws://192.168.20.189:15672/ws";
|
| | | // this.$mqtt.options.hostname = `${this.sys_ip}`
|
| | | // this.$mqtt.options.port = `${this.port}`;
|
| | | // this.$mqtt.reconnect()
|
| | | |
| | | |
| | | this.$refs.popup.open('top')
|
| | | // setImmediate(()=>{
|
| | | // console.log(this.$mqtt)
|
| | | // },1000)
|
| | | uni.$emit('changeClientIP', {
|
| | | host: `${this.mq_ip}:${this.mq_port}`
|
| | | })
|
| | | getApp().globalData.resourseUrl = `${this.pic_ip}:${this.pic_port}`
|
| | | getApp().globalData.requestVideoUrl = `${this.pic_ip}:9000`
|
| | | uni.setStorage({
|
| | | key:"mqUrl",
|
| | | data: `${this.mq_ip}:${this.mq_port}`,
|
| | | success: () => {
|
| | | console.log("mqUrl存入数据库")
|
| | | }
|
| | | })
|
| | | uni.setStorage({
|
| | | key: 'resourseUrl',
|
| | | data:`${this.pic_ip}:${this.pic_port}`,
|
| | | success: function () {
|
| | | console.log('resourseUrl存入数据库');
|
| | | }
|
| | | });
|
| | | uni.setStorage({
|
| | | key: 'requestVideoUrl',
|
| | | data:`${this.pic_ip}:9000`,
|
| | | success: function () {
|
| | | console.log('requestVideoUrl存入数据库');
|
| | | }
|
| | | });
|
| | | this.$refs.popup.open('top')
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | .uni-input {
|
| | | border: 1px solid black;
|
| | | }
|
| | | page { |
| | | background-color: rgba(243, 244, 246, 1); |
| | |
|
| | | page {
|
| | | background-color: rgba(243, 244, 246, 1);
|
| | | }
|
| | |
|
| | | .uni-form-item {
|
| | | display: flex;
|
| | | align-items: center;
|
| | | // justify-content: space-around;
|
| | | margin-top: 20px;
|
| | | align-items: center;
|
| | | // justify-content: space-around;
|
| | | margin-top: 20px;
|
| | | }
|
| | | .setting-content{
|
| | |
|
| | | .setting-content {
|
| | | padding: 40rpx 40rpx;
|
| | | .title{
|
| | | min-width: 80rpx;
|
| | |
|
| | | .title {
|
| | | min-width: 80rpx;
|
| | | }
|
| | | .uni-input[data-v-9543fcb0] {
|
| | | border: 1px solid #dcdfe6;
|
| | | background: #fff;
|
| | |
|
| | | .uni-input {
|
| | | border: 1px solid #dcdfe6;
|
| | | background: #fff;padding:0 20rpx; width: 72%;
|
| | |
|
| | | }
|
| | | |
| | |
|
| | | uni-input {
|
| | | display: block;
|
| | | font-size: 16px;
|
| | | line-height: 1.8em;
|
| | | height: 1.8em;
|
| | | min-height: 1.8em;
|
| | | overflow: hidden;
|
| | | display: block;
|
| | | font-size: 16px;
|
| | | line-height: 1.8em;
|
| | | height: 1.8em;
|
| | | min-height: 1.8em;
|
| | | overflow: hidden;
|
| | | }
|
| | | .uni-input-input{
|
| | |
|
| | | .uni-input-input {
|
| | | padding-left: 20rpx;
|
| | | }
|
| | | }
|
| | |
|
| | | uni-button[type=default] {
|
| | | color: #fff;
|
| | |
|