|
@@ -36,13 +36,13 @@
|
|
|
<view class="form-data qyImg">
|
|
|
<view> 上传图片 <text style="color: #a6a6a6;">(最多3张,单张10MB以内)</text></view>
|
|
|
<view class="info-main">
|
|
|
- <view v-if="photograph.length<3 && !isView" class="camera-btn">
|
|
|
+ <view v-if="photograph.length<3" class="camera-btn">
|
|
|
<view @click="goPhotograph" class="photograph-camera">
|
|
|
<u-icon name="camera" color="#bfbfbf" size="60" ></u-icon>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-show="photograph.length" v-for="(item,index) in photograph" :key="index" class="photograph-con">
|
|
|
- <u-icon v-show="!isView" name="close-circle-fill" color="#fa3534" size="50" class="close-circle-icon" @click="cancelPhotograph(index)"></u-icon>
|
|
|
+ <u-icon name="close-circle-fill" color="#fa3534" size="50" class="close-circle-icon" @click="cancelPhotograph(index)"></u-icon>
|
|
|
<u-image width="100%" height="100%" :src="item" @click="previewPictures(item)"></u-image>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -60,6 +60,7 @@
|
|
|
import {searchRider} from '@/api/index.js'
|
|
|
import {saveImgToAliOss} from '@/libs/tools.js'
|
|
|
import { getLookUpDatas,userDetail,yuyueInfoSave } from '@/api/data'
|
|
|
+ import moment from 'moment'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -78,16 +79,14 @@
|
|
|
timeType:'', // 上午、下午
|
|
|
reserveDateBegin:'', // 预约开始时间
|
|
|
reserveDateEnd:'', // 预约结束时间
|
|
|
- time: '', // 其它垃圾
|
|
|
+ time: '', // 预约时间
|
|
|
rubbishTypeListData:[],
|
|
|
userDetailInfo:{}, // 用户信息
|
|
|
- nowDate:'',
|
|
|
form: {
|
|
|
- info: '', // 厨余垃圾
|
|
|
+ info: '',
|
|
|
},
|
|
|
rubbishTypeList:[], // 垃圾类型
|
|
|
reserveWeight:'',
|
|
|
- isView: false ,// 是否是查看详情
|
|
|
hasRider:true, // 是否有骑手
|
|
|
currentTime:'', // 当前时间戳
|
|
|
itemId:'',
|
|
@@ -170,6 +169,8 @@
|
|
|
this.photograph=[]
|
|
|
this.rubbishTypeList=[]
|
|
|
this.rubbishTypeListData=[]
|
|
|
+ this.reserveDateBegin=''
|
|
|
+ this.reserveDateEnd=''
|
|
|
this.latitude='' // 当前位置经度
|
|
|
this.longitude='' // 当前位置维度
|
|
|
this.userLatitude='' // 用户位置经度
|
|
@@ -278,48 +279,33 @@
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
- console.log(this.list,'--------------时间数组')
|
|
|
- // return
|
|
|
this.show=true
|
|
|
},
|
|
|
confirm(e) {
|
|
|
- const date=new Date
|
|
|
- const year=date.getFullYear()
|
|
|
- const month = date.getMonth() + 1
|
|
|
- const day = date.getDate()
|
|
|
if(e){
|
|
|
this.time=e[0].label + e[1].label
|
|
|
this.day=e[0].label
|
|
|
this.timeType=e[1].label.substr(0, e[1].label.indexOf("(")) // 上午、下午
|
|
|
+ let nowDay=''
|
|
|
if(e[0].label=='今天'){
|
|
|
- if(this.timeType=='上午'){
|
|
|
- this.reserveDateBegin=this.nowDate = year + "-" +( month<10? '0'+month:month ) + "-" + (day<10? '0'+day:day)+' 08:00:00';
|
|
|
- this.reserveDateEnd=this.nowDate = year + "-" +( month<10? '0'+month:month ) + "-" + (day<10? '0'+day:day)+' 12:59:59';
|
|
|
- }else{
|
|
|
- this.reserveDateBegin=this.nowDate = year + "-" +( month<10? '0'+month:month ) + "-" + (day<10? '0'+day:day)+' 13:00:00';
|
|
|
- this.reserveDateEnd=this.nowDate = year + "-" +( month<10? '0'+month:month ) + "-" + (day<10? '0'+day:day)+' 18:00:00';
|
|
|
- }
|
|
|
+ nowDay=moment().format("YYYY-MM-DD")
|
|
|
}
|
|
|
if(e[0].label=='明天'){
|
|
|
- if(this.timeType=='上午'){
|
|
|
- this.reserveDateBegin=this.nowDate = year + "-" +( month<10? '0'+month:month ) + "-" + (day<10? '0'+(day+1):day+1)+' 08:00:00';
|
|
|
- this.reserveDateEnd=this.nowDate = year + "-" +( month<10? '0'+month:month ) + "-" + (day<10? '0'+(day+1):day+1)+' 12:59:59';
|
|
|
- }else{
|
|
|
- this.reserveDateBegin=this.nowDate = year + "-" +( month<10? '0'+month:month ) + "-" + (day<10? '0'+(day+1):day+1)+' 13:00:00';
|
|
|
- this.reserveDateEnd=this.nowDate = year + "-" +( month<10? '0'+month:month ) + "-" + (day<10? '0'+(day+1):day+1)+' 18:00:00';
|
|
|
- }
|
|
|
+ nowDay=moment().subtract(-1, "days").format("YYYY-MM-DD")
|
|
|
}
|
|
|
if(e[0].label=='后天'){
|
|
|
+ nowDay=moment().subtract(-2, "days").format("YYYY-MM-DD")
|
|
|
+ }
|
|
|
if(this.timeType=='上午'){
|
|
|
- this.reserveDateBegin=this.nowDate = year + "-" +( month<10? '0'+month:month ) + "-" + (day<10? '0'+(day+2):day+2)+' 08:00:00';
|
|
|
- this.reserveDateEnd=this.nowDate = year + "-" +( month<10? '0'+month:month ) + "-" + (day<10? '0'+(day+2):day+2)+' 12:59:59';
|
|
|
+ this.reserveDateBegin=moment(nowDay).format("YYYY-MM-DD 08:00:00");
|
|
|
+ this.reserveDateEnd=moment(nowDay).format("YYYY-MM-DD 12:59:59");
|
|
|
}else{
|
|
|
- this.reserveDateBegin=this.nowDate = year + "-" +( month<10? '0'+month:month ) + "-" + (day<10? '0'+(day+2):day+2)+' 13:00:00';
|
|
|
- this.reserveDateEnd=this.nowDate = year + "-" +( month<10? '0'+month:month ) + "-" + (day<10? '0'+(day+2):day+2)+' 18:00:00';
|
|
|
+ this.reserveDateBegin=moment(nowDay).format("YYYY-MM-DD 13:00:00");
|
|
|
+ this.reserveDateEnd=moment(nowDay).format("YYYY-MM-DD 18:00:00");
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- },
|
|
|
+
|
|
|
+ },
|
|
|
// 选择用户信息
|
|
|
selectUserInfo(){
|
|
|
uni.navigateTo({
|
|
@@ -351,7 +337,7 @@
|
|
|
},
|
|
|
// 拍照或从相册选图片
|
|
|
goPhotograph() {
|
|
|
- uni.chooseImage({
|
|
|
+ wx.chooseImage({
|
|
|
count: 1, //默认9
|
|
|
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
sourceType: ['album','camera'], //从相册选择
|
|
@@ -366,7 +352,7 @@
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- uni.showLoading({
|
|
|
+ wx.showLoading({
|
|
|
title:'正在保存图片...',
|
|
|
mask: true
|
|
|
})
|
|
@@ -440,7 +426,7 @@
|
|
|
params.reserveWeight=this.checkWeightType
|
|
|
}
|
|
|
if(this.photograph){
|
|
|
- params.imageList=this.photograph
|
|
|
+ params.imageHeaderList=this.photograph
|
|
|
}
|
|
|
console.log(params,'------------参数')
|
|
|
yuyueInfoSave(params).then(res=>{
|