| 
						 | 
						- <template>
 - 	<view class="page">
 - 		<navbar title="发布" leftClick @leftClick="$utils.navigateBack" />
 - 		
 - 		<view class="form">
 - 			
 - 			<view class="form-sheet-cell">
 - 				<view class="label">
 - 					师傅头像
 - 				</view>
 - 				<view class="images box">
 - 					<uv-upload 
 - 					:fileList="imageTitle" 
 - 					:maxCount="1" 
 - 					multiple 
 - 					width="150rpx" 
 - 					height="150rpx"
 - 					name="imageTitle"
 - 					@delete="deleteImage"
 - 					@afterRead="afterRead"
 - 					:previewFullImage="true"></uv-upload>
 - 				</view>
 - 			</view>
 - 			
 - 			<view class="form-sheet-cell">
 - 				<view class="label">
 - 					师傅名称
 - 				</view>
 - 				<input placeholder="请输入师傅名称" v-model="form.title" />
 - 			</view>
 - 			
 - 			<view class="form-sheet-cell">
 - 				<view class="label">
 - 					起点
 - 				</view>
 - 				<input placeholder="请输入起点" v-model="form.startAddress" />
 - 			</view>
 - 			
 - 			<view class="form-sheet-cell">
 - 				<view class="label">
 - 					终点
 - 				</view>
 - 				<input placeholder="请输入终点" v-model="form.endAddress" />
 - 			</view>
 - 			
 - 			<view class="form-sheet-cell"
 - 			@click="$refs.datetimePicker.open()">
 - 				<view class="label">
 - 					出发时间
 - 				</view>
 - 				<input placeholder="请选择出发时间" 
 - 				disabled
 - 				v-model="form.startTime" />
 - 			</view>
 - 			
 - 			<view class="form-sheet-cell">
 - 				<view class="label">
 - 					车辆座位
 - 				</view>
 - 				<!-- <input placeholder="请输入车辆座位" v-model="form.num" /> -->
 - 				<uv-number-box v-model="form.num"></uv-number-box>
 - 			</view>
 - 			
 - 			
 - 			
 - 			<view class="form-sheet-cell">
 - 				<view class="label">
 - 					师傅电话
 - 				</view>
 - 				<input placeholder="请输入师傅电话" v-model="form.phone" />
 - 			</view>
 - 			
 - 			
 - 			<!-- <view class="form-sheet-cell">
 - 				<view class="label">
 - 					网约证书
 - 				</view>
 - 				<view class="images box">
 - 					<uv-upload 
 - 					:fileList="titleDetails" 
 - 					:maxCount="1" 
 - 					multiple 
 - 					width="150rpx" 
 - 					height="150rpx"
 - 					name="titleDetails"
 - 					@delete="deleteImage"
 - 					@afterRead="afterRead"
 - 					:previewFullImage="true"></uv-upload>
 - 				</view>
 - 			</view> -->
 - 			
 - 			<view class="form-sheet-cell">
 - 				<view class="label">
 - 					车型
 - 				</view>
 - 				<input placeholder="请输入车型" v-model="form.catType" />
 - 			</view>
 - 			
 - 			<view class="form-sheet-cell">
 - 				<view class="label">
 - 					车牌号
 - 				</view>
 - 				<input placeholder="请输入车牌号" v-model="form.catNo" />
 - 			</view>
 - 			
 - 			<view class="form-sheet-cell">
 - 				<view class="label">
 - 					车辆照片与网约证书
 - 				</view>
 - 				<view class="images box">
 - 					<uv-upload 
 - 					:fileList="catImage" 
 - 					:maxCount="2"
 - 					multiple 
 - 					width="150rpx" 
 - 					height="150rpx"
 - 					name="catImage"
 - 					@delete="deleteImage"
 - 					@afterRead="afterRead"
 - 					:previewFullImage="true"></uv-upload>
 - 				</view>
 - 			</view>
 - 			
 - 			<view class="content-input">
 - 				<uv-textarea 
 - 				v-model="form.titleDetails" 
 - 				:maxlength="200" 
 - 				autoHeight
 - 				count
 - 				style="min-height: 400rpx;"
 - 				placeholder="途径地点说明"></uv-textarea>
 - 			</view>
 - 			
 - 			
 - 			<view class="uni-color-btn"
 - 			@click="submit">
 - 				发布
 - 			</view>
 - 		</view>
 - 		
 - 		<uv-datetime-picker 
 - 		ref="datetimePicker" 
 - 		v-model="dateTime" 
 - 		mode="datetime" 
 - 		@confirm="confirmTime">
 - 		</uv-datetime-picker>
 - 		
 - 		
 - 	</view>
 - </template>
 - 
 - <script>
 - 	import Position from '@/utils/position.js'
 - 	import { mapState } from 'vuex'
 - 	export default {
 - 		data() {
 - 			return {
 - 				imageTitle : [],//师傅头像
 - 				titleDetails : [],//网约证书
 - 				catImage : [],//车辆照片
 - 				form : {
 - 					num : 2,
 - 					startTime : '',
 - 				},
 - 				dateTime : new Date().getTime(),
 - 			}
 - 		},
 - 		onLoad() {
 - 		},
 - 		computed : {
 - 			...mapState(['cityList', 'category']),
 - 		},
 - 		methods: {
 - 			deleteImage(e){
 - 				this[e.name].splice(e.index, 1)
 - 			},
 - 			afterRead(e){
 - 				let self = this
 - 				e.file.forEach(file => {
 - 					self.$Oss.ossUpload(file.url).then(url => {
 - 						self[e.name].push({
 - 							url
 - 						})
 - 					})
 - 				})
 - 			},
 - 			// 提交
 - 			submit(){
 - 				
 - 				this.form.imageTitle = this.imageTitle.map(n => n.url).join(',')
 - 				this.form.catImage = this.catImage.map(n => n.url).join(',')
 - 				
 - 				if (this.$utils.verificationAll(this.form, {
 - 						imageTitle: '请上传师傅头像',
 - 						title : '请输入师傅名称',
 - 						startAddress : '请输入起点',
 - 						endAddress : '请输入终点',
 - 						startTime : '请选择出发时间',
 - 						num : '请选择车辆座位',
 - 						phone : '请输入师傅电话',
 - 						catType : '请输入车型',
 - 						catNo : '请输入车牌号',
 - 						catImage : '请上传车辆照片与网约证书',
 - 						titleDetails : '请输入途径地点说明',
 - 					})) {
 - 					return
 - 				}
 - 				
 - 				
 - 				this.$api('publishCar', this.form, res => {
 - 					if(res.code == 200){
 - 						uni.showToast({
 - 							title: '发布成功!',
 - 							icon: 'none'
 - 						})
 - 						
 - 						setTimeout(uni.navigateBack, 1000, -1)
 - 					}
 - 				})
 - 			},
 - 			confirmTime(e){
 - 				this.form.startTime = this.$dayjs(e.value).format('YYYY-MM-DD HH:mm:ss')
 - 			},
 - 		}
 - 	}
 - </script>
 - 
 - <style scoped lang="scss">
 - .page{
 - 	background-color: #fff;
 - 	min-height: 100vh;
 - 	box-sizing: border-box;
 - 	color: #333333;
 - 	font-size: 28rpx;
 - 	/deep/ text{
 - 		font-size: 28rpx !important;
 - 	}
 - 	input{
 - 		width: 450rpx;
 - 	}
 - 	.form{
 - 		padding: 30rpx;
 - 		.help-issue {
 - 			margin: 20rpx;
 - 		}
 - 		.title-input{
 - 			border: 1px solid $uni-color;
 - 			width: 100%;
 - 			border-radius: 10rpx;
 - 			padding: 10rpx 20rpx;
 - 			box-sizing: border-box;
 - 			height: 65rpx;
 - 		}
 - 		.form-sheet-cell{
 - 			display: flex;
 - 			background-color: #fff;
 - 			padding: 20rpx 30rpx;
 - 			align-items: center;
 - 			.label{
 - 				width: 160rpx;
 - 			}
 - 			.price{
 - 				display: flex;
 - 				text-align: center;
 - 				input{
 - 					width: 150rpx;
 - 					border: 1px solid $uni-color;
 - 					margin: 0 10rpx;
 - 				}
 - 			}
 - 			.right-icon{
 - 				margin-left: auto;
 - 			}
 - 		}
 - 	}
 - 	
 - 	.category{
 - 		padding: 20rpx;
 - 		.title{
 - 			// font-weight: 900;
 - 			// font-size: 30rpx;
 - 		}
 - 		.tagList{
 - 			display: flex;
 - 			flex-wrap: wrap;
 - 			padding: 10rpx 0;
 - 			view{
 - 				background: rgba($uni-color, 0.1);
 - 				padding: 10rpx 20rpx;
 - 				margin: 10rpx;
 - 				border-radius: 10rpx;
 - 				font-size: 26rpx;
 - 			}
 - 			.act{
 - 				color: #fff;
 - 				background: $uni-color;
 - 			}
 - 		}
 - 	}
 - }
 - </style>
 
 
  |