扫码跳转小程序部分完成需要测试,隐患地点改为下拉框
| | |
| | | } |
| | | } |
| | | .home_footer_menu{ |
| | | height: 35vh; |
| | | height: 42vh; |
| | | position: absolute; |
| | | bottom: 30rpx; |
| | | left: 10rpx; |
| | |
| | | </template> |
| | | </u-input> |
| | | </u-form-item> |
| | | <u-text type="primary" text="立即注册" @click="navGotoRegister()"></u-text> |
| | | <!-- <u-text type="primary" text="立即注册" @click="navGotoRegister()"></u-text> --> |
| | | <u-text type="primary" text="管理员电话:13800138008"></u-text> |
| | | <view class="login_content_button"> |
| | | <u-button |
| | | type="primary" |
| | |
| | | }, |
| | | onShow() { |
| | | const that = this; |
| | | uni.clearStorage(); |
| | | uni.clearStorageSync(); |
| | | wx.getSetting({ |
| | | complete: (info) => { |
| | | if(!info.authSetting['scope.userInfo']) { |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '是否授权获取您的信息,该信息仅用于确认身份信息', |
| | | success: function (res) { |
| | | if (res.confirm) { |
| | | wx.login({ |
| | | success(res) { |
| | | uni.$u.toast('授权成功!'); |
| | | that.$api.system.getUserInfo(res.code).then((res) => { |
| | | if(res.success) { |
| | | uni.setStorageSync('openId', res.data.openid); |
| | | that.$api.system.changeWChartUser({ |
| | | openId: res.data.openid |
| | | }).then((reslut) => { |
| | | console.log(reslut); |
| | | that.switchUserInfo(reslut.data.regstatus, reslut.data.reginfo); |
| | | }) |
| | | } else { |
| | | uni.$u.toast(res.statusMsg); |
| | | } |
| | | }) |
| | | }, |
| | | fail: (err) => { |
| | | console.log(err,'---'); |
| | | } |
| | | }) |
| | | } else if (res.cancel) { |
| | | wx.exitMiniProgram({ |
| | | success: (res) => { |
| | | console.log(res,'--'); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | wx.login({ |
| | | success(res) { |
| | | that.$api.system.getUserInfo(res.code).then((res) => { |
| | | if(res.success) { |
| | | uni.setStorageSync('openId', res.data.openid); |
| | | that.$api.system.changeWChartUser({ |
| | | openId: res.data.openid |
| | | }).then((reslut) => { |
| | | that.switchUserInfo(reslut.data.regstatus, reslut.data.reginfo); |
| | | }) |
| | | } else { |
| | | uni.$u.toast(res.statusMsg); |
| | | } |
| | | }) |
| | | }, |
| | | fail: (err) => { |
| | | console.log(err,'---'); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | // uni.clearStorage(); |
| | | // uni.clearStorageSync(); |
| | | // wx.getSetting({ |
| | | // complete: (info) => { |
| | | // if(!info.authSetting['scope.userInfo']) { |
| | | // uni.showModal({ |
| | | // title: '提示', |
| | | // content: '是否授权获取您的信息,该信息仅用于确认身份信息', |
| | | // success: function (res) { |
| | | // if (res.confirm) { |
| | | // wx.login({ |
| | | // success(res) { |
| | | // uni.$u.toast('授权成功!'); |
| | | // that.$api.system.getUserInfo(res.code).then((res) => { |
| | | // if(res.success) { |
| | | // uni.setStorageSync('openId', res.data.openid); |
| | | // that.$api.system.changeWChartUser({ |
| | | // openId: res.data.openid |
| | | // }).then((reslut) => { |
| | | // console.log(reslut); |
| | | // that.switchUserInfo(reslut.data.regstatus, reslut.data.reginfo); |
| | | // }) |
| | | // } else { |
| | | // uni.$u.toast(res.statusMsg); |
| | | // } |
| | | // }) |
| | | // }, |
| | | // fail: (err) => { |
| | | // console.log(err,'---'); |
| | | // } |
| | | // }) |
| | | // } else if (res.cancel) { |
| | | // wx.exitMiniProgram({ |
| | | // success: (res) => { |
| | | // console.log(res,'--'); |
| | | // } |
| | | // }) |
| | | // } |
| | | // } |
| | | // }); |
| | | // } else { |
| | | // wx.login({ |
| | | // success(res) { |
| | | // that.$api.system.getUserInfo(res.code).then((res) => { |
| | | // if(res.success) { |
| | | // uni.setStorageSync('openId', res.data.openid); |
| | | // that.$api.system.changeWChartUser({ |
| | | // openId: res.data.openid |
| | | // }).then((reslut) => { |
| | | // that.switchUserInfo(reslut.data.regstatus, reslut.data.reginfo); |
| | | // // uni.navigateTo({ |
| | | // // url: '../../robePages/safeManage/addHidden' |
| | | // // }) |
| | | // }) |
| | | // } else { |
| | | // uni.$u.toast(res.statusMsg); |
| | | // } |
| | | // }) |
| | | // }, |
| | | // fail: (err) => { |
| | | // console.log(err,'---'); |
| | | // } |
| | | // }) |
| | | // } |
| | | // } |
| | | // }) |
| | | }, |
| | | onReady() { |
| | | this.$refs.form.setRules(this.rulesLogin); |
| | |
| | | <u-form-item |
| | | label="隐患地点" |
| | | prop="dangerLocation" |
| | | @click="changePosition()" |
| | | borderBottom> |
| | | <u-input |
| | | v-model="formCheck.dangerLocation" |
| | | placeholder="请输入隐患地点" |
| | | disabled |
| | | disabledColor="#FFFFFF" |
| | | border="none"> |
| | | </u-input> |
| | | </u-form-item> |
| | |
| | | borderBottom> |
| | | <u--textarea v-model="formCheck.title" placeholder="请输入隐患标题" height="100"></u--textarea> |
| | | </u-form-item> |
| | | <div>{{value}}</div> |
| | | </view> |
| | | </u-form> |
| | | <view class="submit_bnt"> |
| | | <u-button type="primary" color="#1976FF" text="提交" @click="submitInsertForm()"></u-button> |
| | | </view> |
| | | <u-picker |
| | | :show="showUser" |
| | | :columns="userColumns" |
| | | keyName="realName" |
| | | @cancel="showUser = false" |
| | | @confirm="selectCompany"> |
| | | :show="positionUser" |
| | | :columns="positionColumns" |
| | | keyName="dictName" |
| | | @cancel="positionUser = false" |
| | | @confirm="selectPosition"> |
| | | </u-picker> |
| | | </view> |
| | | </template> |
| | |
| | | export default{ |
| | | data(){ |
| | | return{ |
| | | showUser: false,//整改人弹框显隐 |
| | | value:null, |
| | | positionUser: false,//隐患地点弹框显隐 |
| | | positionColumns: [],//所有隐患地点 |
| | | formCheck:{ |
| | | imageList:[],//上传图片 |
| | | userId:'',//整改人 |
| | | positionId:'',//隐患地点 |
| | | }, |
| | | rulesCkeck: { |
| | | dangerLocation: [{ |
| | |
| | | } |
| | | } |
| | | }, |
| | | onLoad(option) { |
| | | onShow() { |
| | | let phone = uni.getStorageSync('telphone'); |
| | | if(!phone){ |
| | | uni.navigateTo({ |
| | | url: '../../pages/loginIndex/index' |
| | | }) |
| | | } |
| | | }, |
| | | onLoad(query) { |
| | | const q = decodeURIComponent(query.q) |
| | | this.value = q |
| | | console.log(q,'*****') |
| | | this.getPositionData() |
| | | }, |
| | | methods:{ |
| | | // 获取隐患地点信息 |
| | | getPositionData() { |
| | | let arrUser = [] |
| | | this.$api.reboSystem.getDatnmSafeType({dictType: 'danger_region',pageNum: 1,pageSize: 1000000000}).then(res=>{ |
| | | console.log(res,'******') |
| | | if(res.statusMsg === 'ok'){ |
| | | res.data.list.map(item=>{ |
| | | arrUser.push({ |
| | | dictName:item.dictName, |
| | | positionId:item.dictId |
| | | }) |
| | | }) |
| | | }else{ |
| | | uni.$u.toast(res.statusMsg); |
| | | } |
| | | }) |
| | | this.positionColumns = [arrUser] |
| | | }, |
| | | // 打开隐患地点选择 |
| | | changePosition() { |
| | | this.positionUser = true; |
| | | this.$set(this.formCheck, 'positionId', ''); |
| | | this.$set(this.formCheck, 'dangerLocation',''); |
| | | }, |
| | | // 确认选择隐患地点 |
| | | selectPosition({ value }) { |
| | | this.$set(this.formCheck, 'positionId', value[0].positionId); |
| | | this.$set(this.formCheck, 'dangerLocation', value[0].dictName); |
| | | this.positionUser = false; |
| | | }, |
| | | //提交按钮 |
| | | submitInsertForm: throttle(function() { |
| | | this.$refs.form.validate().then((valid) => { |