From c34e1ebbabaec123d735149e47df856c4cf837c5 Mon Sep 17 00:00:00 2001
From: 叶松 <2217086471@qq.com>
Date: 星期一, 27 十一月 2023 16:30:45 +0800
Subject: [PATCH] 扫码跳转小程序部分完成需要测试,隐患地点改为下拉框
---
xcx/pages/loginIndex/index.vue | 132 +++++++++++++++++----------------
xcx/robePages/safeManage/addHidden.vue | 64 ++++++++++++++--
xcx/pages/labourHome/index.vue | 2
3 files changed, 125 insertions(+), 73 deletions(-)
diff --git a/xcx/pages/labourHome/index.vue b/xcx/pages/labourHome/index.vue
index e2a4ece..4b4daba 100644
--- a/xcx/pages/labourHome/index.vue
+++ b/xcx/pages/labourHome/index.vue
@@ -222,7 +222,7 @@
}
}
.home_footer_menu{
- height: 35vh;
+ height: 42vh;
position: absolute;
bottom: 30rpx;
left: 10rpx;
diff --git a/xcx/pages/loginIndex/index.vue b/xcx/pages/loginIndex/index.vue
index 2f25e41..a194043 100644
--- a/xcx/pages/loginIndex/index.vue
+++ b/xcx/pages/loginIndex/index.vue
@@ -40,7 +40,8 @@
</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"
@@ -92,69 +93,72 @@
},
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);
diff --git a/xcx/robePages/safeManage/addHidden.vue b/xcx/robePages/safeManage/addHidden.vue
index edcf63d..330b144 100644
--- a/xcx/robePages/safeManage/addHidden.vue
+++ b/xcx/robePages/safeManage/addHidden.vue
@@ -25,10 +25,13 @@
<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>
@@ -39,17 +42,18 @@
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>
@@ -60,10 +64,12 @@
export default{
data(){
return{
- showUser: false,//整改人弹框显隐
+ value:null,
+ positionUser: false,//隐患地点弹框显隐
+ positionColumns: [],//所有隐患地点
formCheck:{
imageList:[],//上传图片
- userId:'',//整改人
+ positionId:'',//隐患地点
},
rulesCkeck: {
dangerLocation: [{
@@ -79,9 +85,51 @@
}
}
},
- 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) => {
--
Gitblit v1.9.3