diff --git a/common/request.js b/common/request.js
index 8da988c..f25c4b0 100644
--- a/common/request.js
+++ b/common/request.js
@@ -3,7 +3,7 @@ import store from "@/store"
function host(host='default'){
return(
process.env.NODE_ENV === 'development'?{
- default:"http://tishia.natappfree.cc/plant_manage"
+ default:"http://qv6mj8.natappfree.cc/plant_manage"
}:{
default:"http://vtm3hk.natappfree.cc/plant_manage"
}
@@ -32,8 +32,8 @@ const request=async function(url,param={}){
if(param.file){
var res=await uni.uploadFile({
url:`${param.host||host()}${('/'+url).replace(/\/{2}/,'/').replace(/\?.+/,"")}?${pathData}`,
- files:param.file,
- // name:"file",
+ file:param.file,
+ name:"file",
formData:param.body||{},
timeout:param.timeout||60*1000,
header,
diff --git a/components/form.vue b/components/form.vue
index e99ad1b..f556940 100644
--- a/components/form.vue
+++ b/components/form.vue
@@ -48,18 +48,27 @@
color:rgb(48,49,51);
}
}
- .upImg{
- width:100%;
+ .u-upload{
background:#F7F7F7;
border-radius: 8rpx;
padding:20rpx;
min-height:260rpx;
margin-top:14rpx;
- display:flex;
- flex-wrap: wrap;
- &>.album{
+ align-content: flex-start;
+ &/deep/ .u-upload__wrap__preview{
+ border-radius: 10rpx;
+ &>.u-upload__wrap__preview__image{
+ height:170rpx!important;
+ width:170rpx!important;
+ }
+ &>.u-upload__deletable{
+ width:30rpx;
+ height:30rpx;
+ }
+ }
+ .album{
background:#fff;
- border-radius: 24rpx;
+ border-radius: 20rpx;
width:170rpx;
height:170rpx;
text{
@@ -122,7 +131,7 @@
font-size:20rpx;
color:#FBA83C;
}
- &/deep/>.u-form-item__body__right__message{
+ &/deep/ .u-form-item__body__right__message{
margin-left:0!important;
}
}
@@ -138,11 +147,11 @@
{{/^\d+$/.test(value)&&columns[0][value][keyName]||placeholder||`请选择${label}`}}
-
-
+
+
添加照片
-
+
{{value[0]||startPlaceholder||'开始时间'}}
@@ -173,6 +182,8 @@
:show="show"
mode="date"
:value="date"
+ :maxDate="maxDate"
+ :minDate="minDate"
closeOnClickOverlay
@close="show=false"
@cancel="show=false"
@@ -250,37 +261,49 @@ import request from '@/common/request'
downValue:[],
show:false,
dateType:"start",
+ imgList:[],
}
},
computed:{
date(){
if(this.dateType=='start')return this.value[0]||new Date().format('yyyy-MM-dd');
else return this.value[1]||new Date().format('yyyy-MM-dd');
+ },
+ maxDate(){
+ if(this.type=='dateRange' && this.dateType=='start' && this.value[1])return new Date(this.value[1]).getTime();
+ },
+ minDate(){
+ if(this.type=='dateRange' && this.dateType=='end' && this.value[0])return new Date(this.value[0]).getTime();
}
},
methods:{
- async selectImg(){
- var res=await uni.chooseImage({
- count:this.num-this.value.length,
- sizeType:['compressed'],
- })
- if(/ok/.test(res[1].errMsg)){
- console.log(res[1].tempFiles.map(v=>v.name),'---asfd-----')
- var upImg=await request("/sys/common/uploadBatch",{
- file:res[1].tempFiles,
- body:{
- name:res[1].tempFiles.map(v=>v.name)
+ async afterRead(e){
+ this.imgList=this.imgList.concat(e.file.map(v=>Object.assign(v,{
+ status: 'uploading',
+ message:"上传中",
+ })))
+ for(var i=0; i{
+ if(v==e.file[i]){
+ v.status='success'
+ v.message=''
+ this.$set(this.imgList,k,this.imgList[k])
+ return true
}
+ return false
})
- console.log(upImg,"-----333333------------")
- }else{
- uni.showModal({
- title:"提示",
- content:res.msg||"选取图片失败!",
- showCancel:false,
- })
+ }else{
+ this.imgList=this.imgList.filter(v=>!v==e.file[i])
+ }
}
},
+ delImg(e){
+ console.log(e,'------------delImg----------')
+ },
},
}
\ No newline at end of file
diff --git a/pages/massif/index.vue b/pages/massif/index.vue
index d86a21d..31ce817 100644
--- a/pages/massif/index.vue
+++ b/pages/massif/index.vue
@@ -120,7 +120,6 @@ import request from '@/common/request'
},
onLoad(){
this.search()
- console.log(new FormData())
},
methods:{
clean(){
diff --git a/pages/massif/info.vue b/pages/massif/info.vue
index c701c86..717c996 100644
--- a/pages/massif/info.vue
+++ b/pages/massif/info.vue
@@ -16,7 +16,7 @@
:field="k"
:value="({dateRange:fields.date.value})[v.type||'text']||formData[k]"
@input="formData[k]=$event"
- @selectDate="selectDate"/>
+ @selectRDate="selectDate"/>
@@ -68,7 +68,6 @@ import dForm from '@/components/form.vue'
},
methods:{
selectDate(e){
- console.log(e,'-----e---------')
switch(e.type){
case "start":this.fields.date.value[0]=e.value;break;
case 'end':this.fields.date.value[1]=e.value;break;