diff --git a/common/request.js b/common/request.js index 067297f..f02fc6f 100644 --- a/common/request.js +++ b/common/request.js @@ -2,8 +2,8 @@ import store from "@/store" export function host(host='default',suffix='/plant_manage'){ var url=process.env.NODE_ENV === 'development'?{ - // default:`http://zrxsae.natappfree.cc` //陈 - default:`http://k3megd.natappfree.cc` //马 + default:`http://zrxsae.natappfree.cc` //陈 + // default:`http://k3megd.natappfree.cc` //马 }:{ default:`http://qv6mj8.natappfree.cc` } diff --git a/pages/massif/info.vue b/pages/massif/info.vue index bb10714..0c4a24a 100644 --- a/pages/massif/info.vue +++ b/pages/massif/info.vue @@ -15,6 +15,7 @@ :required="!!rules[k]" :field="k" :value="(/^dateRange$|^select$/.test(v.type)?fields[k].value:formData[k])" + ref="dForm" @input="formData[k]=$event" @selectRDate="selectDate" @select="fields[k].value=$event.value.map(v=>v.value);formData[k]=$event.value[0].value" @@ -36,7 +37,7 @@ import request from '@/common/request' realityArea:{label:"实际面积",type:'digit'}, image:{label:"地块图片",type:"upImg",num:3,value:''}, date:{label:"使用日期",type:"dateRange",value:[]}, - jw:{label:"经/纬度"}, + jw:{label:"经/纬度",type:"map"}, address:{label:"详细地址",type:"textarea"}, }, formData:{ @@ -72,6 +73,7 @@ import request from '@/common/request' } }, onLoad(options){ + window.the=this this.init() if(options.id)this.getDetail(options.id); this.eventChannel=this.getOpenerEventChannel() @@ -141,8 +143,13 @@ import request from '@/common/request' }, }, onBackPress(e){ - console.log(e) - return false + var dForm=this.$refs.dForm.find(v=>v.field=='jw') + if(dForm?.showMap){//是否开启地图 + dForm.showMap=false + return true + }else{ + return false + } }, } \ No newline at end of file diff --git a/uni_modules/d-form/components/d-form/d-form.vue b/uni_modules/d-form/components/d-form/d-form.vue index 0fcc526..4bf7d5f 100644 --- a/uni_modules/d-form/components/d-form/d-form.vue +++ b/uni_modules/d-form/components/d-form/d-form.vue @@ -18,12 +18,25 @@ margin-left:30rpx; } } - .u-input,textarea{ + .map,.u-input,textarea{ background:#F7F7F7; margin-top:14rpx; border-radius: 24rpx; width:100%; } + .map{ + height:80rpx; + display:flex; + align-items: center; + padding:0 20rpx; + &.noData{ + color:#999; + } + &:before{ + margin-right:26rpx; + color:#999; + } + } textarea{ height:auto; min-height:160rpx; @@ -143,6 +156,27 @@ } } } + .amap{ + position:fixed; + top:0; + left:0; + width:100%; + height:100%; + z-index: -1; + background:rgba(0, 0, 0, 0.4); + transition: all .5s; + opacity: 0; + transform: scale(0.8); + &.show{ + opacity: 1; + transform: scale(1); + z-index: 100; + } + map{ + width:100%; + height:100%; + } + } } @@ -221,7 +259,7 @@ import {dataType} from 'black-knight/lib/config/tools' function setPickerCol(columns, value, n){ if(columns.length<=0)return var v=value[n-1]||0 - if(columns[v].children){ + if(columns[v]?.children){ this.setColumnValues(n,columns[v].children) setPickerCol(columns[v].children, value, ++n) } @@ -295,6 +333,7 @@ import {dataType} from 'black-knight/lib/config/tools' show:false, dateType:"start", imgList:[], + showMap:false, } }, watch:{