achao пре 3 година
родитељ
комит
be13d32b0f

+ 68 - 33
pages/goodSource/cargoOwnerSee.vue

@@ -1,7 +1,5 @@
 <template>
 	<view class="center">
-		
-				<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" class="mescroll">
 		<view class="center_top">
 			<view class="flex">
 				<u--image
@@ -15,17 +13,21 @@
 			</view>
 		</view>
 		<view class="pf-row flex">
+			<view class="flex">
+				<view class="text">评分</view>
+				<view class="number">{{dataObj.zong}}</view>
+			</view>
 			<view class="flex">
 				<view class="text">发运次数</view>
 				<view class="number">{{dataObj.countFa}}</view>
 			</view>
-			<view class="flex">
+			<!-- <view class="flex">
 				<view class="text">好评率</view>
 				<view class="number">{{dataObj.haoPingLv}}</view>
-			</view>
+			</view> -->
 			<view class="flex">
-				<view class="text">评</view>
-				<view class="number">{{list.length}}</view>
+				<view class="text">评</view>
+				<view class="number">{{totalPL}}</view>
 			</view>
 		</view>
 
@@ -43,12 +45,33 @@
 			</view>
 		</view>
 		<!-- 评价信息 -->
-			<view v-if="indexBtn == 2" class="pl-style">
+		<view v-if="indexBtn == 2" class="pl-style">
+			<view class="pf flex-space-between flex">
+				<view class="left flex align-center" style="margin-right: 20rpx;">
+					<view class="pf-number">
+						{{dataObj.zong}}
+					</view>
+					<view>
+						<view>
+							<start count="5" v-model="dataObj.zong" size="35" activeColor="#ffaa00" :size="18" :allowHalf='true'
+								:readonly='true'>
+							</start>
+						</view>
+						<view class="gray fontsize-24">累计发运{{dataObj.countFa}}次</view>
+					</view>
+				</view>
+				<view class="right">
+					<view>{{dataObj.haoPingLv}}%</view>
+					<view class="gray fontsize-24">好评率</view>
+				</view>
+			</view>
+			<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
+				class="mescroll">
 				<view class="flex flex-space-between">
-					<view :class="btnData == 1 ? 'btn-active':'btn'" @click="btnChange(1)">全部(1)</view>
-					<view :class="btnData == 2 ? 'btn-active':'btn'" @click="btnChange(2)">最新(1)</view>
-					<view :class="btnData == 3 ? 'btn-active':'btn'" @click="btnChange(3)">好评(1)</view>
-					<view :class="btnData == 4 ? 'btn-active':'btn'" @click="btnChange(4)">差评(1)</view>
+					<view :class="btnData == 1 ? 'btn-active':'btn'" @click="btnChange(1)">全部({{totalPL}})</view>
+					<view :class="btnData == 2 ? 'btn-active':'btn'" @click="btnChange(2)">最新</view>
+					<view :class="btnData == 3 ? 'btn-active':'btn'" @click="btnChange(3)">好评({{dataObj.haoPing}})</view>
+					<view :class="btnData == 4 ? 'btn-active':'btn'" @click="btnChange(4)">差评({{dataObj.chaPing}})</view>
 				</view>
 				<view class="evaluate_css" v-for="(item,index) in list">
 					<view class="flex">
@@ -58,7 +81,7 @@
 								width='70rpx' height='70rpx' shape="circle">
 							</u--image>
 							<view class="right">
-								<view class="evaluate_name">{{objectInfo.driverName}}</view>
+								<view class="evaluate_name">{{item.driverName}}</view>
 								<view class="evaluate_date m-top10">{{objectInfo.createDate.split(' ')[0]}}</view>
 								<view class="flex m-top10">
 									<view class="branch_css ">{{item.count}}</view>
@@ -72,27 +95,26 @@
 									{{item.driverContent}}
 								</view>
 								<view>
-									<u--image
-										:src="objectInfo.cargoOwnerPortrait?objectInfo.cargoOwnerPortrait:'../../static/images/mine/tx.png'"
-										width='70rpx' height='70rpx'>
+									<u--image v-for="(item,index) in item.imgList" :src="item" width='170rpx'
+										height='170rpx'>
 									</u--image>
 								</view>
 							</view>
 						</view>
 					</view>
 				</view>
-			</view>
+			</mescroll-body>
+		</view>
 		<u-picker :show="show" :columns="columns" :closeOnClickOverlay='true' @close='selectTypeClose'
 			@cancel='selectTypeClose' @confirm='confirmBtn'></u-picker>
 		<u-toast ref="uToast"></u-toast>
-		</mescroll-body>
 	</view>
 </template>
 
 <script>
 	var that
-		import start from '../../common/components/uni-rate.vue'
-		import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+	import start from '../../common/components/uni-rate.vue'
+	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
 	import {
 		mapState
 	} from 'vuex';
@@ -103,8 +125,9 @@
 		},
 		data() {
 			return {
-				list:[],
-				dataObj:{},
+				zhpf: '5',
+				list: [],
+				dataObj: {},
 				show: false,
 				columns: [
 					['反馈', '举报']
@@ -112,7 +135,8 @@
 				id: "",
 				objectInfo: {},
 				indexBtn: 1,
-				btnData: 1
+				btnData: 1,
+				totalPL:'0'
 			}
 		},
 		computed: {
@@ -126,6 +150,8 @@
 			that = this
 			this.objectInfo = options
 			console.log(options)
+
+			this.getList()
 		},
 		onNavigationBarButtonTap(e) {
 			console.log("success")
@@ -136,8 +162,6 @@
 				this.show = false
 			},
 			upCallback(page) {
-				
-				this.getList()
 				that.$request.baseRequest('get', '/evaluateInfo/selectEvaluateInfo', {
 						ownerId: this.objectInfo.commonId,
 						flag: 1,
@@ -147,14 +171,15 @@
 						debugger
 						if (page.num == 1) that.list = [];
 						that.list = that.list.concat(res.data.records); //追加新数据
+						that.totalPL = res.data.total
 						for (let i = 0; i < that.list.length; i++) {
-							if(that.list[i].driverUrl){
+							if (that.list[i].driverUrl) {
 								that.list[i].imgList = that.list[i].driverUrl.split(',')
 							}
-							
-							that.list[i].count = (Number(that.list[i].driverCredit) + Number(that.list[i]
-								.tranEfficiency) + Number(that.list[i].tranSafety) + Number(that.list[i]
-								.serviceQuality) + Number(that.list[i].satisfaction)) / 25 * 5
+
+							that.list[i].count = (Number(that.list[i].ownerCredit) + Number(that.list[i]
+								.tranEfficiency) + Number(that.list[i].freightPayment) + Number(that.list[i]
+								.serviceQuality) + Number(that.list[i].comprehensiveSatisfaction)) / 15 * 5
 						}
 						that.mescroll.endBySize(res.data.records.length, res.data.total);
 						uni.hideLoading()
@@ -166,11 +191,11 @@
 			getList() {
 				this.$request.baseRequest('get', '/orderInfo/selectHaoPing', {
 						commonId: this.userInfo.id,
-						haoType:''
+						haoType: ''
 					}).then(res => {
 						if (res.code == 200) {
-								this.dataObj = res.data
-							
+							this.dataObj = res.data
+
 						} else {
 							this.$refs.uToast.show({
 								type: 'error',
@@ -320,7 +345,7 @@
 	}
 
 	.pl-style {
-		margin-top: 80rpx;
+		margin-top: 40rpx;
 	}
 
 	.btn-active {
@@ -342,4 +367,14 @@
 		justify-content: center;
 		padding: 10rpx 20rpx;
 	}
+
+	.pf-number {
+		color: #363636;
+		font-size: 60rpx;
+		margin-right: 30rpx;
+	}
+
+	.pf {
+		margin-bottom: 20rpx;
+	}
 </style>

+ 302 - 49
pages/mine/evaluate.vue

@@ -1,74 +1,327 @@
 <template>
-	<view class="center">
-		<view class="">
-			<view class="">
-				<u-radio-group v-model="radiovalue1" placement="column" @change="groupChange">
-					<u-radio :customStyle="{marginBottom: '8px'}" 
-						label="张先生" name="张先生" >
-					</u-radio>
-				</u-radio-group>
+	<view class="page_pingjia4">
+		<view class="kuang">
+			<view class="order-row flex flex-space-between">
+				<view class="flex align-center">
+					<view>张先生</view>
+					<view>匿名评价</view>
+				</view>
+				
+				<view class="flex align-center">
+					<!-- <image :src="objData.driverPortrait" mode="widthFix" class="tx-img"></image> -->
+					<!-- <view>{{objData.driverName}}</view> -->
+					<view>2022-04-21</view>
+				</view>
+			</view>
+			<view class="xkuang">
+				<view style="display: flex;" class="flex-space-between" v-for="(item,index) in rate"
+					@click="clickStar(index)">
+					<view class="flex" style="margin: 10rpx 0;">
+						<view class="ziti">{{item.name}}</view>
+						<start :count="item.count" style="" size="35" activeIcon="heart-fill" inactiveIcon="heart"
+							activeColor="#ffaa00" v-model="item.value1" @change="getVal" :size="22">
+						</start>
+					</view>
+
+					<view class="">
+						{{item.level}}
+					</view>
+				</view>
 			</view>
-			<u-form labelPosition="left" :model="modelData" labelWidth="80">
-				<u-form-item label="货主信用" prop="modelData.value" borderBottom width="600">
-					<u-radio-group v-model="radiovalue1" placement="column" @change="groupChange">
-					</u-radio-group>
-				</u-form-item>
-				<u-form-item label="货主信用" prop="modelData.value" borderBottom width="600">
-					<u-rate :count="count" v-model="modelData.value"></u-rate>
-				</u-form-item>
-				<u-form-item label="运输效率" prop="modelData.value" borderBottom width="600">
-					<u-rate :count="count" v-model="modelData.value"></u-rate>
-				</u-form-item>
-				<u-form-item label="运输安全" prop="modelData.value" borderBottom width="600">
-					<u-rate :count="count" v-model="modelData.value"></u-rate>
-				</u-form-item>
-				<u-form-item label="服务质量" prop="modelData.value" borderBottom width="600">
-					<u-rate :count="count" v-model="modelData.value"></u-rate>
-				</u-form-item>
-				<u-form-item label="满意度" prop="modelData.value" borderBottom width="600">
-					<u-rate :count="count" v-model="modelData.value"></u-rate>
-				</u-form-item>
-			</u-form>
+			<view>
+				<!-- <u--textarea style="margin-top: 20px;" background-color="#6d6d6d" v-model="value3"
+					placeholder="评价一下这单发运任务~">
+				</u--textarea> -->
+				<view>是否点击可浪费啊据了解SD卡见风使舵是否点击拉分手的距离看拉圣诞节福利发送到节流防抖拉三级分类库山东假的李开复加空间撒的卢卡斯的房间里快递费</view>
+			</view>
+		<!-- 	<u-upload class="uview-upload" :fileList="fileList1" @afterRead="afterRead($event)" @delete="deletePic"
+				name="1" multiple :maxCount="9" style="margin-bottom: 80rpx;"></u-upload> -->
+				<div class="imgShow">
+					<image src='https://cdn.uviewui.com/uview/album/1.jpg' class="img img_item" v-for="(item,index) in 9" :key='index'></image>
+				 </div>
+			<!-- <u-line></u-line> -->
 		</view>
-		
+		<!-- <view class="anniu" v-for="(item,index) in button">
+			<u-button type="warning">{{item.name}}</u-button>
+		</view> -->
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
 <script>
+	var that
+	import {
+		mapState
+	} from 'vuex';
+	import start from '../../common/components/uni-rate.vue'
+	import uploadImage from '@/components/ossutil/uploadFile.js';
+	
 	export default {
+		components: {
+			start
+		},
+		computed: {
+			...mapState(['hasLogin', 'userInfo', 'firstAuthentication'])
+		},
 		data() {
 			return {
-				count: 5,
-				modelData: {
-					value: 4
-				},
-				radiovalue1: ""
+				imageList :[],
+					objData:{},
+				starIndex: '',
+				checkboxValue1: [],
+				checkboxList1: [{
+					name: '匿名评论',
+					disabled: false
+				}],
+				count: "5",
+				value: '',
+				value3: '',
+				fileList1: [],
+				por: [{
+					title: '"无可挑剔"',
+				}],
+				rate: [{
+						name: "司机信用",
+						count: "5",
+						value1: '5',
+						level: '非常好'
+					},
+					{
+						name: "运输效率",
+						count: "5",
+						value1: '5',
+						level: '非常好'
+					},
+					{
+						name: "运输安全",
+						count: "5",
+						value1: '5',
+						level: '非常好'
+					},
+					{
+						name: "运输安全",
+						count: "5",
+						value1: '5',
+						level: '非常好'
+					},
+					{
+						name: "满意度",
+						count: "5",
+						value1: '5',
+						level: '非常满意'
+					}
+				],
+				button: [{
+					name: '提交'
+				}],
 
+				hidden: [{
+					name: '匿名评论',
+					disabled: false
+				}],
 			}
 		},
-		onShow() {
-
+		onNavigationBarButtonTap() {debugger
+			let _data = {
+				 driverId: this.objData.commonId,
+				 ownerName:this.checkboxValue1?this.objData.cargoOwner:'',
+				 ownerPortrait:this.checkboxValue1?this.userInfo.avatarUrl:'',
+				 orderId:this.objData.id,
+				 orderNumber:this.objData.orderNo,
+				 driverCredit:this.rate[0].value1,
+				 tranEfficiency:this.rate[1].value1,
+				 tranSafety:this.rate[2].value1,
+				 serviceQuality:this.rate[3].value1,
+				 satisfaction:this.rate[4].value1,
+				 ownerContent:this.value3,
+				 ownerUrl:this.imageList.toString(),
+				 ownerAnonymous:this.checkboxValue1.length!=0?1:0
+				 
+			}
+			that.$request.baseRequest('post', '/evaluateInfo/api/addEvaluateInfo', _data).then(res => {
+				if (res.code==200) {
+					this.$refs.uToast.show({
+						type: 'success',
+						message: "评价成功",
+						complete() {
+							uni.navigateTo({
+								url: '/pages/order/index'
+							})
+						}
+					})
+				}else{
+					this.$refs.uToast.show({
+						type: 'error',
+						message: "评价失败",
+					})
+				}
+			})
 		},
-		onLoad() {
-			this.getList()
+		onLoad(options) {
+			that = this
+			this.objData = JSON.parse(options.val)
+			console.log(this.objData)
+			that.imageList = []
 		},
 		methods: {
-			getList() {
+			clickStar(index) {
+				console.log(index)
+				this.selectStar = index
+				if (index == 0 || index == 1|| index == 2|| index == 3) {
+					if (this.starIndex == '1') {
+						this.rate[index].level = '极差'
+					} else if (this.starIndex == '2') {
+						this.rate[index].level = '差'
+					} else if (this.starIndex == '3') {
+						this.rate[index].level = '一般'
+					} else if (this.starIndex == '4') {
+						this.rate[index].level = '较好'
+					} else if (this.starIndex == '5') {
+						this.rate[index].level = '非常好'
+					}
+
+				} else {
+					if (this.starIndex == '1') {
+						this.rate[index].level = '极不满意'
+					} else if (this.starIndex == '2') {
+						this.rate[index].level = '不满意'
+					} else if (this.starIndex == '3') {
+						this.rate[index].level = '尚可'
+					} else if (this.starIndex == '4') {
+						this.rate[index].level = '满意'
+					} else if (this.starIndex == '5') {
+						this.rate[index].level = '非常满意'
+					}
+				}
+
+
 
 			},
-			// radioChange(){
-				
-			// },
-			groupChange(e) {
-				
+			getVal(e) {
+				debugger
+				this.starIndex = e.value
+				console.log(e)
+			},
+			checkboxChange(n) {
+				console.log('change', n);
+			},
+			// 删除图片
+			deletePic(event) {
+				this[`fileList${event.name}`].splice(event.index, 1)
+			},
+			// 新增图片
+			async afterRead(event) {
+				// console.log(this[`fileList${event.name}`])
+				// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
+				let lists = [].concat(event.file)
+				let fileListLen = this[`fileList${event.name}`].length
+				lists.map((item) => {
+					this[`fileList${event.name}`].push({
+						...item,
+						status: 'uploading',
+						message: '上传中'
+					})
+				})
+				for (let i = 0; i < lists.length; i++) {
+					const result = await this.uploadFilePromise(lists[i], lists[i].url)
+					// console.log(result)
+					let item = this[`fileList${event.name}`][fileListLen]
+					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
+						status: 'success',
+						message: '',
+						url: result
+					}))
+					fileListLen++
+				}
+			},
+			uploadFilePromise(file, url) {
+				debugger
+				uploadImage('image', url, 'appData/',
+					result => {
+						debugger
+						// 上传成功回调函数
+						console.log('图片地址', result)
+						that.imageList.push(result)
+						// this.dataDetails.certificateAddressUrl=this.dataDetails.certificateAddressUrl +',' +result
+
+					}
+				)
+			},
+			// 删除图片
+			deletePic(event) {
+				this[`fileList${event.name}`].splice(event.index, 1)
 			},
-			
 		}
 	}
 </script>
 
-<style lang="scss" scoped>
-	.center {
-		padding: 30rpx;
+<style lang="scss">
+	.page_pingjia4 {
+		background-color: #ffffff;
+		padding: 20rpx;
+
+		.anniu {
+			margin-top: 48px;
+			margin-left: 20px;
+		}
+
+		.niming {
+			margin-top: 20px;
+		}
+
+		.ziti {
+			color: #909090;
+			margin-right: 20rpx;
+			width: 160rpx;
+		}
+
+		.xkuang {
+			margin-top: 20px;
+		}
+
+		.xx {
+			margin-left: 24%;
+			padding-top: 10px;
+		}
+
+		.biaoti {
+			width: 80%;
+			margin: 0 auto;
+			text-align: center;
+			margin-top: 20px;
+		}
+
+		.kuang {
+			background-color: #ffffff;
+		}
+	}
+
+	.tx-img {
+		width: 40rpx;
+		margin-right: 20rpx;
+	}
+	// .img-content{
+	// 	// display: flex;
+	// 	// justify-content: center;
+		
+	// 	// display: inline-block;
+	// 	.img{
+	// 		width: 160rpx;
+	// 		height: 160rpx;
+	// 	}
+	// }
+	.imgShow{
+	 width: 100%;
+	 display: flex;
+	 flex-wrap: wrap;
+	 margin-top: 20rpx;
+	}
+	.img_item{
+	 // height:0px;
+	 height: 85px!important;
+	 width: 30%;
+	 background-color: #f1f1f1;
+	 margin: 2px 1.66%;
+	 border-radius: 10rpx;
 	}
 </style>

+ 3 - 3
pages/mine/index.vue

@@ -36,7 +36,7 @@
 					<image class="sfrz-icon" src="@/static/images/mine/pingjia@2x.png" mode='widthFix'>
 					</image>
 				</view>
-				<view class="right-text">
+				<view class="right-text" @click="goDetailPage('/pages/mine/evaluate')">
 					<view class="top">货主评价</view>
 					<view class="bottom">看看货主对你的评价吧</view>
 				</view>
@@ -94,7 +94,7 @@
 					<image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
 				</view>
 			</view>
-			<view class="flex flex-space-between" @click="goDetailPage('/pages/mine/evaluate')">
+		<!-- 	<view class="flex flex-space-between" @click="goDetailPage('/pages/mine/evaluate')">
 				<view class="flex align-center">
 					<image class="img" src="@/static/images/mine/set.png" mode='widthFix'>
 					</image>
@@ -103,7 +103,7 @@
 				<view>
 					<image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
 				</view>
-			</view>
+			</view> -->
 		</view>
 		<u-modal :show="isShowAlert" :title="alertTitle" :closeOnClickOverlay='true' :confirmText='confirmText'
 			:showCancelButton='showCancelButton' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"

+ 5 - 3
pages/order/addEvaluation.vue

@@ -112,7 +112,9 @@
 		onNavigationBarButtonTap() {
 			debugger
 			let _data = {
-				ownerId: this.objData.cargoCommonId,
+				evaluatoredId: this.objData.cargoCommonId,
+				evaluatorId: this.objData.commonId,
+				ownerName: this.objData.cargoOwner,
 				driverName: this.checkboxValue1 ? this.objData.driverName : '',
 				driverPortrait: this.checkboxValue1 ? this.userInfo.avatarUrl : '',
 				orderId: this.objData.id,
@@ -145,8 +147,8 @@
 			})
 		},
 		onLoad(options) {
-		that = this
-			this.objData = JSON.parse(options.val)
+			that = this
+			// this.objData = JSON.parse(options.val)
 			console.log(this.objData)
 		},
 		methods: {

+ 57 - 43
pages/order/confirmLoading.vue

@@ -60,8 +60,8 @@
 			<view class='row-between'>
 				<view class="">运费总额(元)</view>
 				<!-- {{detailData.carrierInfo.estimatedFreight}} -->
-				<view class=""><input class="input" type="text" value=""
-						v-model="detailData.carrierInfo.freight" placeholder="请输入运费"></view>
+				<view class=""><input class="input" type="text" value="" v-model="detailData.carrierInfo.freight"
+						placeholder="请输入运费"></view>
 			</view>
 			<view class='row-between'>
 				<view class="">定位</view>
@@ -72,10 +72,8 @@
 			</view>
 			<view class='s-flex'>
 				<view class="" style="margin:20rpx 0;">上传装车照片</view>
-				<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="3"
-					:size-type="['compressed']" @on-success="getImgUrl" @on-remove="onRemove"
-					@on-uploaded="isAdd = true" :sourceType='sourceType' :before-upload="filterFileType"
-					@on-progress="onProgress"></upload>
+				<u-upload class="uview-upload" :fileList="fileList1" @afterRead="afterRead($event)" @delete="deletePic"
+					name="1" multiple :maxCount="3"></u-upload>
 			</view>
 			<!-- 			<view class='s-flex'>
 				<view class="">上传装车磅单</view>
@@ -101,13 +99,12 @@
 
 <script>
 	let that;
-	import upload from '@/components/upload.vue';
+	import uploadImage from '@/components/ossutil/uploadFile.js';
 	export default {
-		components: {
-			upload
-		},
 		data() {
 			return {
+				imgList: [],
+				fileList1: [],
 				showDate: false,
 				mode: 'single',
 				id: '',
@@ -124,7 +121,7 @@
 				alertTitle: '',
 				keyShow: false,
 				carNumber: '',
-				gjList:[]
+				gjList: []
 			}
 		},
 		onLoad(options) {
@@ -298,29 +295,43 @@
 			cancelClick() {
 				this.isShowAlert = false
 			},
-			getImgUrl(res) {
-				this.detailData.carrierInfo.loadingImg += res + ','
-				console.log(res)
-				console.log('------------res-----------')
+			// 删除图片
+			deletePic(event) {
+				this[`fileList${event.name}`].splice(event.index, 1)
 			},
-			// onError(error) {
-			// 	alert(error)
-			// 	console.log('------------error-----------')
-			// 	console.log(error)
-			// },
-			onRemove(index) {},
-			filterFileType(index, lists) {
-				if (lists[index].fileType != 'jpg' && lists[index].fileType != 'png' && lists[index].fileType != 'gif') {
-					lists.splice(index, 1);
-					// 当前文件不支持
-					uni.showModal({
-						title: '暂不支持当前图片类型',
-						showCancel: false
-					});
-				} else {
-					this.isAdd = false;
+			// 新增图片
+			async afterRead(event) {debugger
+				// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
+				let lists = [].concat(event.file)
+				let fileListLen = this[`fileList${event.name}`].length
+				lists.map((item) => {
+					this[`fileList${event.name}`].push({
+						...item,
+						status: 'uploading',
+						message: '上传中'
+					})
+				})
+				for (let i = 0; i < lists.length; i++) {
+					const result = await this.uploadFilePromise(lists[i].url)
+					let item = this[`fileList${event.name}`][fileListLen]
+					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
+						status: 'success',
+						message: '',
+						url: result
+					}))
+					fileListLen++
 				}
 			},
+			uploadFilePromise(url) {
+				uploadImage('image', url, 'appData/',
+					result => {
+						// 上传成功回调函数
+						console.log('图片地址', result)
+						this.imgList.push(result)
+
+					}
+				)
+			},
 			onProgress(e) {
 				console.log(e)
 			},
@@ -395,6 +406,7 @@
 			},
 			confirmClick() {
 				this.validate()
+				debugger
 				this.isShowAlert = false
 				//1暂存
 				if (this.detailData.statusFlag == 1) {
@@ -404,6 +416,7 @@
 					delete this.detailData.carrierInfo.sendArea;
 				}
 				this.detailData.carrierInfo.statusFlag = this.detailData.statusFlag
+				this.detailData.carrierInfo.loadingImg = this.imgList.toString()
 				this.$request.baseRequest('post', '/carrierInfo/loadingAdd', this.detailData.carrierInfo).then(res => {
 						if (res.code == 200) {
 							// debugger
@@ -433,26 +446,27 @@
 									console.log('====确认装车开启连续定位====');
 									console.log(res)
 									let _data = {
-										orderId:that.id,
-										longitude:res.longitude,
-										 latitude:res.latitude,
-										 province:res.province,
-										 city:res.city,
-										 area:res.district
+										orderId: that.id,
+										longitude: res.longitude,
+										latitude: res.latitude,
+										province: res.province,
+										city: res.city,
+										area: res.district
 									}
 									this.$helper.gjList.push(_data)
-									uni.setStorageSync('mapGJ',this.$helper.gjList);
+									uni.setStorageSync('mapGJ', this.$helper.gjList);
 									console.log('this.$helper.gjList')
 									console.log(this.$helper.gjList)
-									if(uni.getStorageSync('mapGJ').length>100){
+									if (uni.getStorageSync('mapGJ').length > 100) {
 										console.log(uni.getStorageSync('mapGJ'))
-										this.$request.baseRequest('post', '/vehicleTrajectoryInfo/api/addInfo', {vehicleTrajectoryInfos:uni.getStorageSync('mapGJ')}
-											).then(res => {
+										this.$request.baseRequest('post', '/vehicleTrajectoryInfo/api/addInfo', {
+												vehicleTrajectoryInfos: uni.getStorageSync('mapGJ')
+											}).then(res => {
 												this.$helper.gjList = []
-													uni.setStorageSync('mapGJ',[]);
+												uni.setStorageSync('mapGJ', []);
 											})
 											.catch(res => {
-											uni.$u.toast( res.message);
+												uni.$u.toast(res.message);
 											});
 									}
 									//判断缓存数据条数,超过reportInterval时清空缓存,重新存入缓存

+ 41 - 8
pages/order/confirmUnloading.vue

@@ -68,10 +68,8 @@
 			</view>
 			<view class='s-flex'>
 				<view class="row-left-text" style="margin:20rpx 0;">上传卸车照片(1-3张)</view>
-				<upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="3"
-					:size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
-					@on-uploaded="isAdd = true" :before-upload="filterFileType" :sourceType='sourceType'
-					@on-progress="onProgress"></upload>
+				<u-upload class="uview-upload" :fileList="fileList1" @afterRead="afterRead($event)" @delete="deletePic"
+					name="1" multiple :maxCount="3"></u-upload>
 			</view>
 		</view>
 		<view class="bottom-btn">
@@ -89,13 +87,13 @@
 </template>
 
 <script>
-	import upload from '@/components/upload.vue';
+	let that;
+	import uploadImage from '@/components/ossutil/uploadFile.js';
 	export default {
-		components: {
-			upload
-		},
 		data() {
 			return {
+				imgList: [],
+				fileList1: [],
 				isShowValidity: false,
 				validityPeriod: [],
 				sourceType: ['camera'],
@@ -237,6 +235,40 @@
 					this.isAdd = false;
 				}
 			},
+			// 新增图片
+			async afterRead(event) {
+				debugger
+				// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
+				let lists = [].concat(event.file)
+				let fileListLen = this[`fileList${event.name}`].length
+				lists.map((item) => {
+					this[`fileList${event.name}`].push({
+						...item,
+						status: 'uploading',
+						message: '上传中'
+					})
+				})
+				for (let i = 0; i < lists.length; i++) {
+					const result = await this.uploadFilePromise(lists[i].url)
+					let item = this[`fileList${event.name}`][fileListLen]
+					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
+						status: 'success',
+						message: '',
+						url: result
+					}))
+					fileListLen++
+				}
+			},
+			uploadFilePromise(url) {
+				uploadImage('image', url, 'appData/',
+					result => {
+						// 上传成功回调函数
+						console.log('图片地址', result)
+						this.imgList.push(result)
+
+					}
+				)
+			},
 			onProgress(e) {
 				console.log(e)
 			},
@@ -259,6 +291,7 @@
 					delete this.detailData.carrierInfo.unloadArea;
 				}
 				this.detailData.carrierInfo.statusFlag = this.detailData.statusFlag
+				this.detailData.carrierInfo.unloadingImg = this.imgList.toString()
 				if (!this.detailData.carrierInfo.totalFreight) {
 					uni.showToast({
 						title: '运费不能为空!',