Browse Source

联调接口

master
邓宏 2 years ago
parent
commit
acb9e4af4d
  1. 4
      common/request.js
  2. 1
      pages/massif/info.vue
  3. 30
      pages/purchase/specs.vue
  4. 43
      uni_modules/d-form/components/d-form/d-form.vue

4
common/request.js

@ -2,8 +2,8 @@ import store from "@/store"
export function host(host='default',suffix='/plant_manage'){ export function host(host='default',suffix='/plant_manage'){
var url=process.env.NODE_ENV === 'development'?{ var url=process.env.NODE_ENV === 'development'?{
// default:`http://zrxsae.natappfree.cc` //陈 default:`http://zrxsae.natappfree.cc` //陈
default:`http://uq5pak.natappfree.cc` //马 // default:`http://uq5pak.natappfree.cc` //马
}:{ }:{
default:`http://qv6mj8.natappfree.cc` default:`http://qv6mj8.natappfree.cc`
} }

1
pages/massif/info.vue

@ -73,7 +73,6 @@ import request from '@/common/request'
} }
}, },
onLoad(options){ onLoad(options){
window.the=this
this.init() this.init()
if(options.id)this.getDetail(options.id); if(options.id)this.getDetail(options.id);
this.eventChannel=this.getOpenerEventChannel() this.eventChannel=this.getOpenerEventChannel()

30
pages/purchase/specs.vue

@ -263,20 +263,22 @@ export default{
}, },
async submit(){ async submit(){
if(this.check()){ if(this.check()){
var res=await request("/purchaseMain/purchaseMain/addPlantPurchaseSub",{ uni.navigateBack()
method:"post", this.eventChannel.emit("submit", this.formData)
body: this.formData // var res=await request("/purchaseMain/purchaseMain/addPlantPurchaseSub",{
}) // method:"post",
if(res.statu){ // body: this.formData
uni.navigateBack() // })
this.eventChannel.emit("submit", this.formData) // if(res.statu){
}else{ // uni.navigateBack()
uni.showModal({ // this.eventChannel.emit("submit", this.formData)
title:"提示", // }else{
content:res.msg||"保存失败!", // uni.showModal({
showCancel:false, // title:"",
}) // content:res.msg||"",
} // showCancel:false,
// })
// }
} }
}, },
async searchGoods(){ async searchGoods(){

43
uni_modules/d-form/components/d-form/d-form.vue

@ -164,15 +164,14 @@
height:100%; height:100%;
z-index: -1; z-index: -1;
background:rgba(0, 0, 0, 0.4); background:rgba(0, 0, 0, 0.4);
transition: all .5s;
opacity: 0;
transform: scale(0.8);
&.show{ &.show{
opacity: 1;
transform: scale(1);
z-index: 100; z-index: 100;
map{
top:0;
}
} }
map{ map{
top:100%;
width:100%; width:100%;
height:100%; height:100%;
} }
@ -247,7 +246,7 @@
@confirm="$emit('input',$event.fulldate)"/> @confirm="$emit('input',$event.fulldate)"/>
<view v-if="type=='map'" class="amap" :class="{show:showMap}"> <view v-if="type=='map'" class="amap" :class="{show:showMap}">
<map /> <map id="amap"/>
</view> </view>
</view> </view>
</template> </template>
@ -380,6 +379,38 @@ import {dataType} from 'black-knight/lib/config/tools'
}) })
} }
}, },
mounted(){
/* #ifdef APP-PLUS */
this.$nextTick(()=>{
if(this.type=='amp'){
var a=uni.createMapContext("amap",this)
var maps=a.$getAppMap()
maps.setMapType(plus.maps.MapType.MAPTYPE_SATELLITE)
maps.onclick=(e)=>{
console.log(e,'-------maps--click---------')
}
var polygon=new plus.maps.Polygon([
new plus.maps.Point(116.39524,39.925301),
new plus.maps.Point(116.400444,39.925285),
new plus.maps.Point(116.400558,39.923282),
new plus.maps.Point(116.395502,39.923082),
])
polygon.setLineWidth(2)
polygon.setStrokeColor("#10C176")
polygon.setFillColor("#10C176")
polygon.setFillOpacity(0.3)
maps.addOverlay(polygon)
var marker=new plus.maps.Marker(new plus.maps.Point(116.396137,39.924055));
marker.setIcon("/static/tab_home.png");
marker.bringToTop()
marker.setDraggable(true)
maps.addOverlay(marker);
}
})
/* #endif */
},
methods:{ methods:{
async afterRead(e){ async afterRead(e){
this.imgList=this.imgList.concat(e.file.map(v=>Object.assign(v,{ this.imgList=this.imgList.concat(e.file.map(v=>Object.assign(v,{

Loading…
Cancel
Save