瀏覽代碼

前端小程序 认证完成sdy

zhongtianhaoyuan 3 年之前
父節點
當前提交
5bbfa1b515

+ 6 - 1
components/addressBook.vue

@@ -22,7 +22,12 @@
 				<u-index-anchor :index="item.name" v-if="item.members&&item.members.length"/>
 				<view v-for="user in item.members" :key="user.id"  class="list-cell " @tap="linkToCard(user)" hover-class="message-hover-class">
 					<img-cache :src="user.avatar"></img-cache>
-					<view  class="list-cell-name">{{user.nickName}}</view>
+					<view>
+						<view  class="list-cell-name">{{user.nickName}}</view>
+						<u-tag v-if="user.traderFlag == 1" style="margin-left: 10px;font-weight: 500;" text="粮商" size ="mini"type="info" mode="plain"/>
+						<u-tag v-if="user.farmerFlag == 1" style="margin-left: 10px;font-weight: 500;" text="粮农" size ="mini"type="info" mode="plain"/>
+						<u-tag v-if="user.driverFlag == 1" style="margin-left: 10px;font-weight: 500;" text="物流" size ="mini"type="info" mode="plain"/>
+					</view>
 				</view>
 			</view>
 		</u-index-list>

+ 0 - 2
components/chat/footer-input.vue

@@ -28,7 +28,6 @@
 					</view>
 				</view>
 			</view>
-			<!-- #ifndef H5 -->
 			<view v-if='!show' class="more" @tap="showMore">
 				<view class="cuIcon-roundadd"></view>
 			</view>
@@ -36,7 +35,6 @@
 			<!-- <view class='textmsg' v-show='show'>
 				<view @tap="">发送</view>
 			</view> -->
-			<!-- #endif -->
 			<!-- #ifdef H5 -->
 			<view class="send" @tap="sendMsg(0, textMsg)" :class="isVoice?'hidden':''">
 				<view class="iconfont icontuiguang-weixuan"></view>

+ 12 - 4
components/chatItem.vue

@@ -8,10 +8,18 @@
 				<view class="right_top_time ">{{value.lastOperTime || value.lastOpenTime | format}}</view>
 			</view>
 			<view class="right_btm ">
-				<view class="u-line-1">{{value.msgType==0?value.content:message[value.msgType]}}</view>
-				<view class="" v-show="voiceIcon">
-					<u-icon color="#c4c7cf" v-if="index%2==0" name="bell" size="22"></u-icon>
+				
+					<view class="u-line-1" >{{value.msgType==0?value.content:message[value.msgType]}}</view>
+					<view>
+					<u-tag v-if="value.traderFlag == 1" style="margin-left: 10rpx;" text="粮商" size ="mini"type="info" mode="plain"/>
+					<u-tag v-if="value.farmerFlag == 1" style="margin-left: 10rpx;" text="粮农" size ="mini"type="info" mode="plain"/>
+					<u-tag v-if="value.driverFlag == 1" style="margin-left: 10rpx;" text="物流" size ="mini"type="info" mode="plain"/>
 				</view>
+				
+				
+				<!-- <view class="" v-show="voiceIcon">
+					<u-icon color="#c4c7cf" v-if="index%2==0" name="bell" size="22"></u-icon>
+				</view> -->
 			</view>
 		</view>
 	</view>
@@ -97,7 +105,7 @@
 <style lang="scss">
 .item {
 		width: 750rpx;
-		height: 140rpx;
+		height: 160rpx;
 		display: flex;
 		align-items: center;
 		image {

+ 141 - 0
pageA/product/Identity_switching.vue

@@ -0,0 +1,141 @@
+<template>
+	<view class="center">
+		<view v-for="(item , index) in lists" :Key="index">
+			<view>
+				<view class="company">{{item.customerType}}</view>
+				<view class="guess-item" @click="navToDetailPage(item)">
+					<view class="infos">
+
+						<view class="info">{{item.customerName}}
+							<view class='cu-tag radius line-pink but'>{{item.authenticationStatus}}</view>
+						</view>
+						<view class="info">{{item.customerPhone}}</view>
+						<label>
+							<checkbox /><text>设置默认</text>
+						</label>
+						
+					</view>
+
+				</view>
+			</view>
+		</view>
+	</view>
+
+	</view>
+	</view>
+</template>
+
+<script>
+	import {
+		mapState
+	} from 'vuex';
+	export default {
+		name: "buy",
+		data() {
+			return {
+				lists:[],
+				PageCur: "buy",
+				buyInfo: [],
+				pages: 1, //页数
+				limit: 10, //每次取条目数
+				loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
+				isLoadMore: false, //是否加载中
+				showTran: true,
+				scrollTop: 0,
+				TabCur: 0,
+				current: 1,
+				identityAuthenticationInfo: {
+					pageSize: 10,
+					currentPage: 1,
+					commonId: "",
+					
+					
+				},
+			};
+		},
+		onLoad() {
+			this.getList()
+		},
+		computed: {
+			...mapState(['hasLogin', 'userInfo'])
+		},
+		methods: {
+			getList() {
+				this.identityAuthenticationInfo.commonId = this.userInfo.id
+				console.log(12313)
+				this.$api.doRequest('get', '/identityAuthenticationInfo/selectIdentityAuthenticationInfo', {
+						pageSize: 10,
+						currentPage: 1,
+						commonId: this.userInfo.id
+					}, 'application/json;charset=UTF-8').then(res => {
+						console.log("成功连接123")
+						this.lists = res.data.data.records
+					})
+					.catch(res => {
+						uni.showToast({
+							title: res.errmsg,
+							icon: 'none',
+							duration: 2000
+						})
+					});
+			},
+			// adddriver(index) {
+			// 	if (index == 1) {
+			// 		uni.navigateTo({
+			// 			url: `/pageD/identity/companyIdentity`
+			// 		})
+			// 	} else {
+			// 		uni.navigateTo({
+			// 			url: `/pageD/identity/driverIdentity`
+			// 		})
+			// 	}
+			// },
+			navToDetailPage(item) {
+				// if (index == 1) {
+					uni.navigateTo({
+						url: `/pageA/product/business_buy?id=${item.id}&customerName=${item.customerName}`
+					})
+					},
+				// } else {
+				// 	uni.navigateTo({
+				// 		url: `/pageD/identity/driverIdentityLook`
+				// 	})
+				
+
+			// }
+		}
+	}
+</script>
+
+<style>
+	.center {
+		padding: 10px 20px;
+	}
+
+	.title {
+		font-size: 18px;
+		font-weight: 900;
+		margin-right: 20px;
+		display: initial;
+	}
+
+	.company {
+		font-size: 16px;
+		margin-top: 10px;
+	}
+
+	.infos {
+		/* margin: 10px 20px; */
+		width: 100%;
+		display: inline-table;
+	}
+
+	.info {
+		line-height: 20px;
+	}
+
+	.but {
+		right: 3px;
+		float: right;
+	}
+</style>

+ 100 - 61
pageA/product/business_buy.vue

@@ -2,50 +2,59 @@
 	<view class="container">
 		<view  class="cu-form-group">
 			<view class="title">卖方</view>
-			<view class="title">{{seller}}</view>
+			
+			<view class="title" @click="liang">{{purchaseOrder.customerName}}></view>
+			
 		</view>
 		<view  class="cu-form-group">
 			<view class="title">买方</view>
-			<view class="title">{{sellerPhone}}</view>
+			<view class="title">{{purchaseOrder.buyer}}</view>
 		</view>
 		<view   class="cu-form-group margin-top">
 			<view class="title">收货地区</view>
-				<view class="title">{{sellerPhone}}</view>
+				<view class="title">{{purchaseOrder.receivePrivate}}{{purchaseOrder.receiveCity}}{{purchaseOrder.receiveArea}}</view>
 			</picker>
 		</view>
 		<view   class="cu-form-group ">
 			<view class="title">收货库</view>
-				<view class="title">{{sellerPhone}}</view>
+				<view class="title">{{purchaseOrder.receivePrivate}}{{purchaseOrder.receiveCity}}{{purchaseOrder.receiveArea}}{{purchaseOrder.receiveWarehouse}}</view>
 			</picker>
 		</view>
 		<view v-if='companyId!=2' class="cu-form-group">
 			<view class="title">货名</view>
-			<input placeholder="请填写" name="input" @input="addressInput"></input>
+			<text>{{purchaseOrder.goodsName}}</text>
+			<!-- <input placeholder="请填写" name="input" @input="addressInput"></input> -->
 		</view>
 		<view class="cu-form-group">
 			<view class="title">最小成交量(吨)</view>
-			<view class="title">{{minSale}}</view>
+			<text>{{purchaseOrder.minimumVolume}}</text>
 		</view>
-		<view v-if="companyId==2" class="cu-form-group">
+		<view  v-if="invoiceType !=2" class="cu-form-group">
 			<view  class="title">今日基差(元/吨)</view>
 				<view class="picker">
-					{{invoiceTypeIndex1>-1?invoiceType1[invoiceTypeIndex1]:'请选择'}}
+					<text>{{purchaseOrder.basisPrice}}</text>
+					<!-- {{invoiceTypeIndex1>-1?invoiceType1[invoiceTypeIndex1]:'请选择'}} -->
 				</view>
 			
 		</view>
 		<view v-else class="cu-form-group">
-			<view  class="title">采购单价(元/吨)</view>
+			<view   class="title">采购单价(元/吨)</view>
 				<view class="picker">
-					{{invoiceTypeIndex>-1?invoiceType[invoiceTypeIndex]:'请选择'}}
+					<text>{{purchaseOrder.unitPrice}}</text>
+					<!-- {{invoiceTypeIndex>-1?invoiceType[invoiceTypeIndex]:'请选择'}} -->
 				</view>
 		</view>
 		<view class="cu-form-group margin-top">
 			<view class="title">发票类型</view>
-			<input placeholder="请填写" name="input" @input="countInput"></input>
+			<picker @change="packingChange" :value="packingIndex" :range="invoiceType">
+				<view class="picker">
+					{{packingIndex>-1?invoiceType[packingIndex]:'请选择'}}
+				</view>
+			</picker>
 		</view>
 		<view  class="cu-form-group">
 			<view class="title">出售数量(吨)</view>
-			<input placeholder="请填写 例:袋装XX斤/散装" name="input" @input='packingInput'></input>
+			<input placeholder="请填写出售数量" name="input" @input='packingInput'></input>
 		</view>
 		<view  class="cu-form-group">
 			<view class="title">包装方式</view>
@@ -57,26 +66,28 @@
 		</view>
 		<view class="cu-form-group align-start">
 			<view class="title">袋装备注</view>
-			<textarea maxlength="-1" :disabled="modalName!=null" @input="textareaInput" placeholder="请填写包装规格、质量、包装物要求。例:50kg袋装、大粒、彩包"></textarea>
+			<textarea maxlength="-1" :disabled="modalName!=null" @input="textareaInput" placeholder="请填写包装规格、质量、包装物要求。例:50kg袋装、大粒、彩包" ></textarea>
 		</view>
 		<view class="cu-form-group align-start">
 			<view class="title">点价(元/吨)</view>
-			<input placeholder="请填写 例:袋装XX斤/散装" name="input" @input='packingInput'></input>
+			<input placeholder="请填写点价" name="input" @input='packingInput' v-model="purchaseOrder.pointPrice"></input>
 		</view>
 		<view class="cu-form-group align-start">
 			<view class="title">发票费用(元/吨)</view>
-			<input placeholder="请填写 例:袋装XX斤/散装" name="input" @input='packingInput'></input>
+			<input placeholder="请填写发票费用" name="input" @input='packingInput' v-model="purchaseOrder.invoiceFee"></input>
 		</view>
 		<view class="cu-form-group align-start">
 			<view class="title">包装费(元/吨)</view>
-		<input placeholder="请填写 例:袋装XX斤/散装" name="input" @input='packingInput'></input>
+		<input placeholder="请填写包装费" name="input" @input='packingInput' v-model="purchaseOrder.packingFee"></input>
 		</view>
 		<view class="cu-form-group align-start">
 			<view class="title">结算价格</view>
-			<input placeholder="请填写 例:袋装XX斤/散装" name="input" @input='packingInput'></input>
+			<text>{{Number(purchaseOrder.pointPrice)  + Number(purchaseOrder.invoiceFee)  + Number(purchaseOrder.packingFee) + Number(purchaseOrder.basisPrice)  }}</text>
+			
+			<!-- <input placeholder="请填写 例:袋装XX斤/散装" name="input" @input='packingInput' v-model="purchaseOrder.settlementPrice"></input> -->
 		</view>
 		<view class="padding flex flex-direction">
-			<button class="cu-btn bg-red margin-tb-sm lg" @click="commit">提交</button>
+			<button class="cu-btn bg-red margin-tb-sm lg" @click="commit()">提交</button>
 		</view>
 	</view>
 </template>
@@ -103,16 +114,19 @@
 						sellerPhone:'',
 						packingMoney:0,
 						type:0,
+						modalName:"",
 					},
+					purchaseOrder: {},
 					invoiceTypeIndex:0,
 					invoiceTypeIndex1:0,
 					acceptTypeIndex:0,
 					priceTypeIndex:0,
 					bankNameIndex:0,
 					packingIndex:0,
-					packingType: ['散装', '袋装'],
-					invoiceType: ['不开发票', '普通发票', '增值税发票'],
-					invoiceType1: ['不开发票','增值税发票'],
+					// packingChange:['散袋(默认)','大袋','小袋'],
+					packingType: ['散袋(默认)','大袋','小袋'],
+					// invoiceType: ['不开发票', '普通发票', '增值税发票'],
+					invoiceType: ['不开发票','增值税发票'],
 					acceptType: ['第三方检验(国家检验资质)', '交收地库或港出具的检验', '现场看货','其他'],
 					priceType: ['库内价', '到库价', '到港价'],
 					priceTypeIndex1:'库内价',
@@ -150,21 +164,33 @@
 				};
 			},
 			onLoad(options) {
-				this.salebuyId = options.id
-				this.seller = options.seller
-				this.sellerPhone = options.sellerPhone
-				this.isFutures = options.isFutures
-				this.minSale = options.minSale
-				this.companyId=options.companyId
-				this.province = options.province
-				this.city = options.city
-				this.area = options.area
-				this.storeName=options.storeName
-				this.exsitCount = Math.floor(options.exsitCount * 100) / 100
-				this.basis = options.basis
-				this.basisBig = options.basisBig
-				this.basisSmall = options.basisSmall
-				this.unloadingFee = options.unloadingFee
+				// this.salebuyId = options.id
+				// this.seller = options.seller
+				// this.sellerPhone = options.sellerPhone
+				// this.isFutures = options.isFutures
+				// this.minSale = options.minSale
+				// this.companyId=options.companyId
+				// this.province = options.province
+				// this.city = options.city
+				// this.area = options.area
+				// this.storeName=options.storeName
+				// this.exsitCount = Math.floor(options.exsitCount * 100) / 100
+				// this.basis = options.basis
+				// this.basisBig = options.basisBig
+				// this.basisSmall = options.basisSmall
+				// this.unloadingFee = options.unloadingFee
+				this.purchaseOrder.seller = options.seller
+				this.purchaseOrder.goodsName = options.goodsName
+				this.purchaseOrder.receivePrivate = options.receivePrivate
+				this.purchaseOrder.receiveCity = options.receiveCity
+				this.purchaseOrder.receiveArea = options.receiveArea
+				this.purchaseOrder.minimumVolume = options.minimumVolume
+				this.purchaseOrder.buyer = options.buyer
+				this.purchaseOrder.customerName = options.customerName
+				this.purchaseOrder.basisPrice = options.basisPrice
+				this.purchaseOrder.unitPrice = options.unitPrice
+				this.purchaseOrder.receiveWarehouse = options.receiveWarehouse
+				
 			},
 			onShow() {
 				var that=this
@@ -192,6 +218,7 @@
 						uni.hideLoading()
 					}
 				})
+				},
 				// uni.getLocation({
 				//     type: 'wgs84',
 				// 	geocode:true,
@@ -200,8 +227,24 @@
 				//         console.log('当前位置的纬度:' + res.latitude);
 				//     }
 				// });
-			},
+			// },
 			methods: {
+				liang(){
+					uni.navigateTo({
+						url: '/pageA/product/Identity_switching'
+					})
+				},
+				commit(){
+					this.$api.doRequest('post','/purchaseOrder/api/insertPurchaseOrder', this.purchaseOrder).then(res => {
+					console.log("成功123")
+					}).catch(res => {
+						uni.showToast({
+							title: res.data.message,
+							icon: 'none',
+							duration: 2000
+						})
+					})
+				},
 				InvoiceTypeChange(e) {
 					this.invoiceTypeIndex = e.detail.value
 					this.invoice = this.invoiceType[this.invoiceTypeIndex];
@@ -277,49 +320,45 @@
 				},
 				commit(){
 					const that = this
-					if ( that.companyId !=2 && !that.area ) {
-						that.$api.msg('请选择省市区');
-						return
-					}
-					if ( that.companyId !=2&& !that.address) {
-						that.$api.msg('请填写详细交收地址')
-						return
-					}
+					// if ( that.companyId !=2&& !that.address) {
+					// 	that.$api.msg('请填写详细交收地址')
+					// 	return
+					// }
 					if (!that.price) {
-						that.$api.msg('请选择价格类型')
+						that.$api.msg('请选择出售数量')
 						return
 					}
 					if (!that.invoice) {
 						that.$api.msg('请选择发票类型')
 						return
 					}
-					// if(!that.accept&&that.isFutures==0){
-					// 	that.$api.msg('请选择质量验收方式');
-					// 	return
-					// }
-					if(!that.unitPrice){
-						that.$api.msg('请填写协议价格(元/吨)');
-						return
-					}
-					if(!that.count){
-						that.$api.msg('请填写购买数量(吨)');
+						if (!that.packingType) {
+						that.$api.msg('请选择包装类型')
 						return
 					}
-					if(Number(that.count) < Number(that.minSale)){
-						that.$api.msg('购买数量不能小于最小成交量');
+					if(!that.pointPrice){
+						that.$api.msg('请填写点价');
 						return
 					}
-					if(!that.tradeCompanyId){
-						that.$api.msg('请选择公司名头');
+					if (!that.invoiceFee) {
+						that.$api.msg('请填写发票费用')
 						return
 					}
+					// if(Number(that.count) < Number(that.minSale)){
+					// 	that.$api.msg('购买数量不能小于最小成交量');
+					// 	return
+					// }
+					// if(!that.tradeCompanyId){
+					// 	that.$api.msg('请选择公司名头');
+					// 	return
+					// }
 					// if(that.count > that.exsitCount){
 					// 	that.$api.msg('购买数量大于库存量');
 					// 	return
 					// }
 					//this.$api.prePage()获取上一页实例,可直接调用上页所有数据和方法,在App.vue定义
 					
-					//this.$api.msg(`地址${this.manageType=='edit' ? '修改': '添加'}成功`);
+					// this.$api.msg(`地址${this.manageType=='edit' ? '修改': '添加'}成功`);
 					that.tradeInfo.salebuyId = that.salebuyId
 					that.tradeInfo.buyer = that.buyer
 					that.tradeInfo.buyerPhone = that.buyerPhone

+ 21 - 9
pageA/product/detail.vue

@@ -257,7 +257,8 @@
 				   imageUrl:'https://taohaoliang.oss-cn-beijing.aliyuncs.com/shareLogo.png',
 				},
 				reason:"",
-				price:undefined
+				price:undefined,
+				
 
 			};
 		},
@@ -376,7 +377,12 @@
 				})
 			},
 			salegrain(){
-				console.log(this.userInfo)
+				// uni.navigateTo({
+				// 	url: `/pageA/product/business_buy?id=${this.goods.id}&receiveArea=${this.goods.receiveArea}&minimumVolume=${this.goods.minimumVolume}
+				// 			&goodsName=${this.goods.goodsName}&receiveCity=${this.goods.receiveCity}&receivePrivate=${this.goods.receivePrivate}&buyer=${this.goods.buyer}
+				// 			`	
+				// 			})
+				// var that=this
 				if (!this.hasLogin) {
 					uni.showModal({
 						title: '登录提示',
@@ -386,12 +392,7 @@
 						success: (e) => {
 							if (e.confirm) {
 								uni.navigateTo({
-									url: `/pageA/product/trade?id=${that.goods.id}&packing=${that.goods.packing}}&province=${that.goods.province}
-									&city=${that.goods.city}&area=${that.goods.area}&storeName=${that.goods.storeName}&seller=${that.goods.seller}
-									&companyId=${that.goods.companyId}&sellerPhone=${that.goods.sellerPhone}&minSale=${that.goods.minSale}
-									&exsitCount=${that.goods.total}&isFutures=${that.goods.isFutures}
-									&basis=${that.goods.basis}&basisSmall=${that.goods.basisSmall}&basisBig=${that.goods.basisBig}
-								&unloadingFee=${that.goods.unloadingFee}`
+									url: '/pages/public/login'
 								})
 							}
 						},
@@ -403,8 +404,19 @@
 					this.$api.doRequest('get', '/identityAuthenticationInfo/getInfo',{commonId:this.userInfo.id}).then(res => {
 						if(res.data.code==200){
 							uni.navigateTo({
-								url: '/pages/public/login'
+								url: `/pageA/product/business_buy?id=${this.goods.id}&receiveArea=${this.goods.receiveArea}&minimumVolume=${this.goods.minimumVolume}
+										&goodsName=${this.goods.goodsName}&receiveCity=${this.goods.receiveCity}&receivePrivate=${this.goods.receivePrivate}&buyer=${this.goods.buyer}
+										&basisPrice=${this.goods.basisPrice}&unitPrice=${this.goods.unitPrice}&receiveWarehouse=${this.goods.receiveWarehouse}
+										`
+							// 	url: `/pageA/product/business_buy?id=${this.goods.id}&packing=${this.goods.packing}}&province=${this.goods.province}
+							// 	&city=${this.goods.city}&area=${this.goods.area}&storeName=${this.goods.storeName}&seller=${this.goods.seller}
+							// 	&companyId=${this.goods.companyId}&sellerPhone=${this.goods.sellerPhone}&minSale=${this.goods.minSale}
+							// 	&exsitCount=${this.goods.total}&isFutures=${this.goods.isFutures}
+							// 	&basis=${this.goods.basis}&basisSmall=${this.goods.basisSmall}&basisBig=${this.goods.basisBig}
+							// &unloadingFee=${this.goods.unloadingFee}&goodsName=${this.goods.goodsName}&receivePrivate=${this.goods.receivePrivate}&receiveCity=${that.goods.receiveCity}
+							// &receiveArea=${this.goods.receiveArea}&minimumVolume=${this.goods.minimumVolume}&buyer=${this.goods.buyer}`
 							})
+							
 						}else if(res.data.code==11016){
 							uni.showModal({
 								    title: '温馨提示',

+ 127 - 37
pageA/product/trade.vue

@@ -3,7 +3,7 @@
 	<view class="container">
 		<view class="detail-desc">
 			<view class="c-list">
-				<view class="c-row">
+				<view class="c-row b-b">
 					<text class="tit">卖方</text>
 					<view class="con-list">
 						<view v-if='goods.customerTypeFlag==1' class="title">{{goods.customerName}}</view>
@@ -20,35 +20,95 @@
 		</view>
 		<view class="detail-desc">
 			<view class="c-list">
-				<view class="c-row">
-					<text class="tit">卖方</text>
+				<view class="c-row b-b">
+					<text class="tit">收货地区</text>
 					<view class="con-list">
-						<view v-if='goods.customerTypeFlag==1' class="title">{{goods.customerName}}</view>
-						<view v-if='goods.customerTypeFlag==2' class="title">{{goods.compName}}</view>
+						<view  class="title">{{receivePrivate}}{{receiveCity}}{{receiveArea}}</view>
+					</view>
+				</view>
+				<view v-if='pcFlag==1' class="c-row  b-b">
+					<text class="tit">收货库</text>
+					<view class="con-list">
+						<view class="title">{{receiveWarehouse}}</view>
+					</view>
+				</view>
+				<view class="c-row b-b">
+					<text class="tit">货名</text>
+					<view class="con-list">
+						<view class="title">{{goodsName}}</view>
+					</view>
+				</view>
+				<view class="c-row b-b">
+					<text class="tit">最小成交量(吨)</text>
+					<view class="con-list">
+						<view class="title">{{minimumVolume}}</view>
 					</view>
 				</view>
 				<view class="c-row">
-					<text class="tit">买方</text>
+					<text class="tit">今日基差(元/吨)</text>
 					<view class="con-list">
-						<view class="title">{{seller}}</view>
+						<view class="title">{{basisPrice}}</view>
 					</view>
 				</view>
 			</view>
 		</view>
 		<view class="detail-desc">
 			<view class="c-list">
-				<view class="c-row">
-					<text class="tit">卖方</text>
+				<view class="c-row  b-b">
+					<text class="tit">发票类型</text>
+					<picker style="text-align:right;" @change="InvoiceTypeChange1" :value="invoiceTypeIndex1" :range="invoiceType1">
+						<view class="picker">
+							{{invoiceTypeIndex1>-1?invoiceType1[invoiceTypeIndex1]:'请选择'}}
+						</view>
+					</picker>
+				</view>
+				<view class="c-row b-b">
+					<text class="tit">出售数量(吨)<text style='color:#FC3535;'>*</text></text>
 					<view class="con-list">
-						<view v-if='goods.customerTypeFlag==1' class="title">{{goods.customerName}}</view>
-						<view v-if='goods.customerTypeFlag==2' class="title">{{goods.compName}}</view>
+						<input v-model='list.transactionsNumber' type="digit">
 					</view>
 				</view>
-				<view class="c-row">
-					<text class="tit">买方</text>
+				<view class="c-row b-b">
+					<text class="tit">发票类型</text>
+					<picker style="text-align:right;" @change="packingChange" :value="packingIndex" :range="packingType">
+						<view class="picker">
+							{{packingIndex>-1?packingType[packingIndex]:'请选择'}}
+						</view>
+					</picker>
+				</view>
+				<view class='b-b' style='padding:10px 15px;'>
+					<text class="tit">袋装备注</text>
+					<view style='position:relative;' class='con-list'>
+						<textarea maxlength='30' v-model='list.baggingNotes' placeholder="请输入袋装备注,如王中王彩袋,49公斤,大粒" class='textarea' name="" id=""  cols="30" rows="3"></textarea>
+					<text style='position:absolute;right:0;bottom:2px;'>{{list.baggingNotes.length}}/30个字</text>
+					</view>
+				</view>
+				<view class="c-row b-b">
+					<text class="tit">点价(元/吨)<text style='color:#FC3535;'>*</text></text>
 					<view class="con-list">
-						<view class="title">{{seller}}</view>
+						<input v-model='list.pointPrice' placeholder="请输入出售数量" type="digit">
+					</view>
+				</view>
+				<view  v-if='invoiceTypeIndex1==0&&goods.customerTypeFlag==1' class="c-row b-b">
+					<text class="tit">发票费用(元/吨)</text>
+					<view class="con-list">
+						<input disabled value='-20' placeholder="请输入出售数量" type="digit">
+					</view>
+				</view>
+				<view class="c-row b-b">
+					<text class="tit">包装费(元/吨)</text>
+					<view class="con-list">
+						<input v-model='list.packingFee' placeholder="请输入包装费" type="digit">
+					</view>
+				</view>
+				<view  style='padding:10px 15px;'>
+					<view class='flex justify-between'>
+						<text class="tit">结算价格(元/吨)</text>
+						<view class="con-list">
+							<input disabled v-model='list.settlementPrice' placeholder="请输入包装费" type="digit">
+						</view>
 					</view>
+					<view style='font-size:11px;color:#AFB3BF;'>结算价格=点价+基差+发票费用+包装费</view>
 				</view>
 			</view>
 		</view>
@@ -70,40 +130,36 @@
 	export default {
 			data() {
 				return {
-					tradeInfo:{
-						salebuyId:0,
-						packing:'',
-						memo:'',
-						buyer:'',
-						buyerPhone:'',
-						unitPrice:0,
-						address:'',
-						count:0,
-						province:'',
-						area:'',
-						priceType:'',
-						invoiceType:'',
-						acceptType:'',
-						seller:'',
-						sellerPhone:'',
-						packingMoney:0,
-						type:0,
-					},
+					goodsName:'',
 					goods:{},
+					receiveWarehouse:'',
+					receivePrivate:'',
+					receiveCity:'',
+					receiveArea:'',
+					minimumVolume:0,
+					basisPrice:0,
+					pcFlag:0,
+					list:{
+						transactionsNumber:0,
+						baggingNotes:'',
+						pointPrice:0,
+						packingFee:'',
+						settlementPrice:0
+					},
 					invoiceTypeIndex:0,
 					invoiceTypeIndex1:0,
 					acceptTypeIndex:0,
 					priceTypeIndex:0,
 					bankNameIndex:0,
 					packingIndex:0,
-					packingType: ['散装', '袋装'],
+					packingType: ['散装', '大装','小袋'],
 					invoiceType: ['不开发票', '普通发票', '增值税发票'],
 					invoiceType1: ['不开发票','增值税发票'],
 					acceptType: ['第三方检验(国家检验资质)', '交收地库或港出具的检验', '现场看货','其他'],
 					priceType: ['库内价', '到库价', '到港价'],
 					priceTypeIndex1:'库内价',
 					region: [],
-					salebuyId:0,
+					id:0,
 					packing:'',
 					memo:'',
 					buyer:'',
@@ -138,9 +194,16 @@
 				};
 			},
 			onLoad(options) {
-				this.salebuyId = options.id
+				this.receiveWarehouse=options.receiveWarehouse
+				this.receivePrivate=options.receivePrivate
+				this.receiveCity=options.receiveCity
+				this.receiveArea=options.receiveArea
+				this.minimumVolume=options.minimumVolume
+				this.basisPrice=options.basisPrice
+				this.id = options.id
+				this.pcFlag = options.pcFlag
+				this.goodsName = options.goodsName
 				this.seller = options.seller
-				this.sellerPhone = options.sellerPhone
 				this.isFutures = options.isFutures
 				this.minSale = options.minSale
 				this.companyId=options.companyId
@@ -420,6 +483,23 @@
 			}
 		}
 	}
+	.c-list picker .picker {
+	    line-height: 80rpx;
+	    font-size: 24rpx;
+	    text-overflow: ellipsis;
+	    white-space: nowrap;
+	    overflow: hidden;
+	    width: 100%;
+	    text-align: right;
+	}
+	.c-list picker {
+	    -webkit-box-flex: 1;
+	    -webkit-flex: 1;
+	    flex: 1;
+	    padding-right: 10px;
+	    overflow: hidden;
+	    position: relative;
+	}
 	.c-list {
 		font-size: $font-sm + 2upx;
 		color: $font-color-base;
@@ -470,4 +550,14 @@
 			color: $uni-color-primary;
 		}
 	}
+	.textarea{
+		background:#F9F9FA;
+		font-size:12px;
+		text-align:left;
+		width:100%;
+		height:60px;
+		padding:10px;
+		border-radius:5px;
+		margin-top:10px;
+	}
 </style>

+ 114 - 58
pageB/contract/contract.vue

@@ -6,7 +6,7 @@
 		
 		<view class="cu-form-group">
 			<view class="title">采购</view>
-			
+	
 			<text style="margin-left: -30%;">编号{{item.contractNo}}{{item.procurementPlanType}}</text>
 			<text>{{item.status}}</text>
 		</view>
@@ -16,7 +16,7 @@
 			<text></text>
 		</view>
 		<view class="cu-form-group">
-			<view class="title">玉米:<text>{{item.goodsName}}</text></view>
+			<view class="title">{{item.goodsName}}:<text>{{item.goodsName}}</text></view>
 			<view class="title">单价:<text>{{item.unitPrice}}</text></view>
 			<view class="title">基差:<text>{{item.basis}}</text></view>
 		</view>
@@ -26,7 +26,7 @@
 					
 
 			<text><button class="cu-btn commit margin-tb-sm lg" style=" margin-left: 15px; width: 75px;height: 25px;"
-					@click="commit">点价</button></text>
+					@click="someprice(item)">点价</button></text>
 					
 					
 			<text><button class="cu-btn commit margin-tb-sm lg" style=" margin-left: 15px; width: 75px;height: 25px;"
@@ -35,43 +35,29 @@
 		</view>
 		
 		</view>
-		
-		<hr>
-		<!-- <view class="cu-form-group">
-			<view class="title">采购</view>
-			<text style="margin-left: -30%;">编号{{goods.contractNo}}{{goods.procurementPlanType}}</text>
-			<text>{{goods.status}}</text>
-		</view>
-		<view class="cu-form-group">
-			<view class="title">买方</view>
-			<text style="margin-left: -45%;">{{goods.customer}}</text>
-			<text></text>
-		</view>
-		<view class="cu-form-group">
-			<view class="title">玉米:<text>{{goods.goodsName}}</text></view>
-			<view class="title">单价:<text>{{goods.unitPrice}}</text></view>
-			<view class="title">基差:<text>{{goods.basis}}</text></view>
-		</view>
-		<view class="cu-form-group">
-			<view class="title">
-			
-			</view>
-		</view>
-		<view class="c-row b-b">
-			<text><button class="cu-btn commit margin-tb-sm lg" style=" width: 75px;height: 25px; margin-left: 15px;"
-					@click="commit">附件</button>
-					
-					</text>
-
-			<text><button class="cu-btn commit margin-tb-sm lg" style=" margin-left: 15px; width: 75px;height: 25px;"
-					@click="commit">点价</button></text>
-		</view> -->
-		<view class="cu-bar bg-white margin-top">
-			<view class="action">
+        <view v-if='pricestatus' class='shade'>
+        	<view class='shade-content'>
+        		<view class='shade-content-item'>
+        			<input v-model='price' placeholder="请输入点价价格" type="number">元/吨
+        		</view>
+				<view>
+					<button style='width:50%;display:inline-block;' @click='pricestatus=false'>取消</button>
+					<button  style='width:50%;display:inline-block;' @click='amendprice'>确定</button>
+				</view>
 
+        	</view>
+        </view>
+		<view v-if='shadestatus' class='shade'>
+			<view class='shade-content'>
+				<view class='shade-content-item'>
+					<view>请于以下时间段进行点价操作:</view>
+					<view>11:30  ~  12:30</view>
+					<view>15:30  ~  20:00</view>
+					<view>23:00  ~  08:00</view>
+				</view>
+				<button style='width:50%;display:inline-block;' @click='shadestatus=false'>取消</button>
 			</view>
 		</view>
-
 		<view class="padding flex flex-direction">
 			<!-- <button class="cu-btn commit margin-tb-sm lg" @click="commit">提交</button> -->
 		</view>
@@ -90,6 +76,8 @@
 		data() {
 			return {
 				lists:[],
+				shadestatus:false,
+				pricestatus:false,
 				goods: {
 					pageSize:10,
 					currentPage:1,
@@ -123,12 +111,13 @@
 					carNoImg1: ''
 
 				},
+				id:0,
 				PageCur: "trust",
 				TabCur: 0,
 				priceTypeIndex: -1,
 				priceType: ['库内价', '到库价', '到港价'],
 				unitPrice: 0,
-				price: '',
+				price: 0,
 				seller: '',
 				sellerPhone: '',
 				minSale: '',
@@ -177,30 +166,74 @@
 			this.getList()
 		},
 		methods: {
-				commit1(item){
-					uni.navigateTo({
-						url: `/pageB/contract/look?id=${item.id}&contractNo=${item.contractNo}&customer=${item.customer}&goodsName=${item.goodsName}`
-					})
-				},
+			amendprice(){
+				this.$api.doRequest('post','/purchaseOrder/api/pointPrice',{id:this.id,unitPrice:Number(this.price)}).then(res => {
+						if(res.data.code==200){
+							this.pricestatus=false
+						}else{
+							uni.showToast({
+							 title: res.data.message,
+							 icon:'none',
+							 duration: 2000
+							})
+						}
+				    })
+				    .catch(res => {
+				     uni.showToast({
+				      title: res.errmsg,
+				      icon:'none',
+				      duration: 2000
+				     })
+				    });
+			},
+			someprice(item){
+				var time=new Date().getTime()
+				var time1=new Date(new Date(new Date().toLocaleDateString()).getTime()-(1*60*60*1000))
+				var time2=new Date()
+				time2.setHours(8);
+				time2.setMinutes(0);
+				time2.setSeconds(0);
+				var time3=new Date()
+				time3.setHours(11);
+				time3.setMinutes(30);
+				time3.setSeconds(0);
+				var time4=new Date()
+				time4.setHours(12);
+				time4.setMinutes(30);
+				time4.setSeconds(0);
+				var time5=new Date()
+				time5.setHours(15);
+				time5.setMinutes(30);
+				time5.setSeconds(0);
+				var time6=new Date()
+				time6.setHours(20);
+				time6.setMinutes(0);
+				time6.setSeconds(0);
+				if(time<time2.getTime()&&time>time1||time<time4.getTime()&&time>time3.getTime()||time<time6.getTime()&&time>time5.getTime()){
+					this.id=item.id
+					this.pricestatus=true
+				}else{
+					this.shadestatus=true
+				}
+			},
+			commit1(item){
+				uni.navigateTo({
+					url: `/pageB/contract/look?id=${item.id}&contractNo=${item.contractNo}&customer=${item.customer}&goodsName=${item.goodsName}`
+				})
+			},
 			getList(){
 				this.goods.commonId = this.userInfo.id
 	
 			this.$api.doRequest('get','/purchaseOrder/selectPurchaseOrder',this.goods).then(res => {
-			    
-				console.log(res,"fanhuijie")
-				this.lists = res.data.data.records
-				 console.log("调用接口")
-			      that.sendDisabled = true
-			      let sec = 60
-			      let interval = setInterval(() => {
-			       sec--;
-			       that.sendText = sec + 's后重发'
-			       if (sec <= 0) {
-			        that.sendDisabled = false
-			        that.sendText = "获取验证码"
-			        clearInterval(interval)
-			       }
-			      }, 1000)
+					if(res.data.code==200){
+						this.lists = res.data.data.records
+					}else{
+						uni.showToast({
+						 title: res.data.message,
+						 icon:'none',
+						 duration: 2000
+						})
+					}
 			    })
 			    .catch(res => {
 			     uni.showToast({
@@ -661,4 +694,27 @@
 		background: linear-gradient(45deg, #DF331C, #DA611A);
 		color: #fff;
 	}
+	.shade{
+		position:fixed;
+		top:0;
+		left:0;
+		width:100%;background:rgba(0,0,0,0.5);
+		height:100%;
+		z-index:999999;
+	}
+	.shade-content{
+		background:#fff;
+		position:absolute;
+		top:50%;
+		left:50%;
+		transform: translateX(-50%) translateY(-50%);
+		z-index:999999;
+		text-align:center;
+	}
+	.shade-content-item{
+		width: 277px;
+		text-align:center;
+		height:121px;
+		padding:35px 10px;
+	}
 </style>

+ 147 - 352
pageB/contract/contract_detail.vue

@@ -3,15 +3,15 @@
 		<!-- <block v-if="TabCur==2"> -->
 			<view class="cu-form-group">
 				<view class="title">派车编号</view>
-				<input  name="input" v-model="goods.tranCarNo"></input>
+				<input disabled  name="input" v-model="goods.tranCarNo"></input>
 			</view>
 			<view class="cu-form-group">
 				<view class="title">车牌号</view>
-				<input placeholder="请输入车牌号" name="input" v-model="goods.carNo"></input>
+				<input maxlength='7' placeholder="请输入车牌号" name="input" v-model="goods.carNo"></input>
 			</view>
 			<view class="cu-form-group">
 				<view class="title">司机手机号</view>
-				<input placeholder="请输入司机身份认证的手机号" name="input" v-model="goods.driverPhone"></input>
+				<input  maxlength='11' placeholder="请输入司机身份认证的手机号" name="input" v-model="goods.driverPhone"></input>
 			</view>
 			<view class="cu-form-group">
 				<view class="title">毛重(吨)</view>
@@ -23,9 +23,13 @@
 			</view>
 			<view class="cu-form-group">
 				<view class="title">净重(吨)</view>
-				<input placeholder="自动计算" type="mobile" name="input" v-model="goods.netWeight"></input>
+				<input placeholder="自动计算" type="mobile" name="input" v-model="goods.loadNetWeight"></input>
+			</view>
+			<view class="cu-form-group">
+				<view class="title">发货日期</view>
+				<view @click="show = true">{{goods.sendDateStart!=''?goods.sendDateStart:time}}</view>
+				<u-picker  :params='params' :default-time='time' @confirm="DateChange" v-model="show" mode="time"></u-picker>
 			</view>
-			   
 			<view class="cu-bar bg-white margin-top">
 				<view class="action">
 					上传磅单照片
@@ -33,19 +37,13 @@
 			</view>
 			<view class="cu-form-group">
 				<view class="grid col-4 grid-square flex-sub">
-					<view class="bg-img" v-if="personNoImg != ''" @tap="ViewImage" :data-url="personNoImg">
-					 <image :src="personNoImg" mode="aspectFit"></image>
+					<view class="bg-img" v-if="goods.loadPoundImg != ''" @tap="ViewImage" :data-url="goods.loadPoundImg">
+					 <image :src="goods.loadPoundImg" mode="aspectFit"></image>
 						<view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="0">
 							<text class='cuIcon-close'></text>
 						</view>
 					</view>
-					<view class="bg-img" v-if="personNoImg1 != ''" @tap="ViewImage" :data-url="personNoImg1">
-					 <image :src="personNoImg1" mode="aspectFit"></image>
-						<view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="1">
-							<text class='cuIcon-close'></text>
-						</view>
-					</view>
-					<view class="solids" @tap="ChooseImagePerson" v-if="personNoImg == '' || personNoImg1 == ''">
+					<view class="solids" @tap="ChooseImagePerson" v-if="goods.loadPoundImg == ''">
 						<text class='cuIcon-cameraadd'></text>
 					</view>
 				</view>
@@ -71,14 +69,18 @@
 						carNo:'',
 						grossWeight:'',
 						tare:'',
-						netWeight:'',
-						personNoImg:'',
-						personNoImg1:'',
-
+						loadNetWeight:'',
+						loadPoundImg:'',
 						 contractNo:'',
 						 goodsName:'',
+						 sendDateStart:''
 						
 					},
+					params:{
+						year: true,
+						month: true,
+						day: true,
+					},
 					carNo:'',
 					PageCur: "trust",
 					TabCur: 0,
@@ -92,6 +94,7 @@
 					exsitCount:0,
 					origin:'',
 					stock:'',
+					show:false,
 					goodsName:'',
 					verifyCode:'',
 					sendText0:'获取验证码',
@@ -121,21 +124,46 @@
 					driverNoImg1:'',
 					carNoImg:'',
 					carNoImg1:'',
+					goodsName:'',
 					showTran:true
 				};
 			},
 			computed: {
-				...mapState(['hasLogin','userInfo'])
+				...mapState(['hasLogin','userInfo']),
+					time() {
+						var date=new Date()
+						var year=date.getFullYear()
+						var month=date.getMonth()
+						var date1=date.getDate()
+						if(month+1<10){
+							month="0"+(month+1)
+						}
+						return year+'-'+month+"-"+date1
+					},
+					startDate() {
+					//限制开始时间;
+					//也可以直接限定为当天日期 var date= new Date(); return date
+						return new Date(new Date(new Date().toLocaleDateString()).getTime()-(1*60*60*1000))
+					},
+					endDate() {
+						return new Date()
+					}
 				},	
 			onShow() {
 			},
 			onLoad(option) {
-				this.goods.netWeight =option.netWeight
-				
+				this.goodsName=option.goodsName
+				this.contractNo = option.contractNo
+				this.goods.goodsName=option.goodsName
+				this.goods.contractNo = option.contractNo
+				this.goods.tranCarNo=option.tranCarNo
 				
 			},
 			methods: {
-				 
+				 DateChange(e) {
+					 this.goods.sendDateStart=e.year+'-'+e.month+'-'+e.day
+				 	// this.goods.sendDateStart = e.detail.value
+				 },
 				commit1(item){
 					uni.navigateTo({				
 						url: `/pageB/contract/look?id=${item.id}&netWeight=${item.netWeight}&carNo=${item.carNo}&sendDateStart=${item.sendDateStart}`
@@ -143,42 +171,110 @@
 				},
 				grossWeightchange(e) {
 				      if (this.goods.grossWeight && this.goods.tare) {
-				        this.goods.netWeight = Number(
+				        this.goods.loadNetWeight = Number(
 				          this.goods.grossWeight - this.goods.tare
 				        )
 				      }
 				    },
 				tarechange(e) {
 				      if (this.goods.grossWeight && this.goods.tare) {
-				        this.goods.netWeight = Number(
+				        this.goods.loadNetWeight = Number(
 				          this.goods.grossWeight - this.goods.tare
 				        )
 				      }
 				    },
 				getList(){
-					console.log(this.goods,"duixiang")
-				this.$api.doRequest('post','/tranCarInfo/api/addTranTask',this.goods).then(res => {
-				     console.log("调用接口")
-				      that.sendDisabled = true
-				      let sec = 60
-				      let interval = setInterval(() => {
-				       sec--;
-				       that.sendText = sec + 's后重发'
-				       if (sec <= 0) {
-				        that.sendDisabled = false
-				        that.sendText = "获取验证码"
-				        clearInterval(interval)
-				       }
-				      }, 1000)
-				    })
-				    .catch(res => {
-				     uni.showToast({
-				      title: res.errmsg,
-				      icon:'none',
-				      duration: 2000
-				     })
-				    });
-				   },
+					// tranCarNo:'',
+					// carNo:'',
+					// grossWeight:'',
+					// tare:'',
+					// loadNetWeight:'',
+					// loadPoundImg:'',
+					//  contractNo:'',
+					//  goodsName:'',
+					if(this.goods.carNo.length==0){
+						this.$api.msg('车牌号不能为空')
+						return
+					}
+					if(this.goods.carNo.length!=7){
+						this.$api.msg('车牌号输入错误')
+						return
+					}
+					if(this.goods.driverPhone.length==0){
+						this.$api.msg('手机号不能为空')
+						return
+					}
+					if(this.goods.driverPhone.length!=11){
+						this.$api.msg('司机手机号输入错误')
+						return
+					}
+					if(this.goods.grossWeight>100){
+						this.$api.msg('毛重输入错误')
+						return
+					}
+					if(this.goods.tare>50){
+						this.$api.msg('皮重输入错误')
+						return
+					}
+					var that=this
+					uni.showModal({
+						content: '确定提交发车信息?',
+						success: function (res) {
+							if (res.confirm) {
+								that.$api.doRequest('post','/tranCarInfo/api/addTranTask',that.goods).then(res => {
+								    if(res.data.code==200){
+										console.log(that.goods)
+										uni.showModal({
+											content: '提交成功!',
+											success: function (res) {
+												if (res.confirm) {
+													var result = that.goods.tranCarNo.substr(that.goods.tranCarNo.indexOf("C") + 1,that.goods.tranCarNo.length);
+												    var num=Number(result)+1
+													if(num<=9){
+														num='C00'+num
+													}else if(num<100&&num>9){
+														num='C0'+num
+													}else  if(num<1000&&num>99){
+														num='C'+num
+													}
+													that.goods={
+														tranCarNo:num,
+														carNo:'',
+														grossWeight:'',
+														tare:'',
+														loadNetWeight:'',
+														loadPoundImg:'',
+														 contractNo:that.contractNo,
+														 goodsName:that.goodsName,
+														 sendDateStart:''
+														
+													}
+												}else if (res.cancel) {
+													uni.navigateBack();
+												}
+											}
+										});
+									}else if(res.data.code==11015){
+										uni.showToast({
+										 title: '该司机未认证身份,请司机认证后再操作',
+										 icon:'none',
+										 duration: 2000
+										})
+									}
+								    })
+								    .catch(res => {
+								     uni.showToast({
+								      title: res.errmsg,
+								      icon:'none',
+								      duration: 2000
+								     })
+								    });
+							} else if (res.cancel) {
+							
+							}
+						}
+					});
+				},
 				ChooseImagePerson() {
 					uni.chooseImage({
 						count: 1, //默认9
@@ -187,13 +283,11 @@
 						success: (res) => {
 							//上传图片
 							//图片路径可自行修改
-							uploadImage(res.tempFilePaths[0], 'personNoImg/',
+							
+							uploadImage(res.tempFilePaths[0], 'loadPoundImg/',
 								result => {
-								 if (this.personNoImg.length != 0) {
-								 	this.personNoImg1 = result
-								 } else {
-								 	this.personNoImg = result
-								 }
+	
+								 	this.goods.loadPoundImg = result
 								 uni.hideLoading();
 								}
 							)
@@ -281,305 +375,6 @@
 						}
 					})
 				},
-				commit(){
-					if (!this.hasLogin) {
-						uni.showModal({
-							title: '登录提示',
-							content: '您尚未登录,是否立即登录?',
-							showCancel: true,
-							confirmText: '登录',
-							success: (e) => {
-								if (e.confirm) {
-									uni.navigateTo({
-										url: '/pages/public/login'
-									})
-								}
-							},
-							fail: () => {},
-							complete: () => {}
-						})
-					}
-					else{
-						const that = this
-						if(this.TabCur == 0){
-							if(!that.seller){
-								this.$api.msg('请填写车牌号');
-								return;
-							}
-							if(!that.sellerPhone){
-								this.$api.msg('请填写司机手机号码');
-								return;
-							}
-							if(!that.exsitCount){
-								this.$api.msg('请填写毛重');
-								return;
-							}
-							if(!that.minSale){
-								this.$api.msg('请填写皮重');
-								return;
-							}
-							
-							that.saleInfo.seller = that.seller
-							that.saleInfo.sellerPhone = that.sellerPhone
-							that.saleInfo.priceType = that.price
-							that.saleInfo.unitPrice = that.unitPrice
-							that.saleInfo.minSale = that.minSale
-							that.saleInfo.exsitCount = that.exsitCount
-							that.saleInfo.origin = that.origin
-							that.saleInfo.stock = that.stock
-							that.saleInfo.verifyCode = that.verifyCode
-							that.saleInfo.goodsName = that.goodsName
-							that.saleInfo.buyer = that.buyer
-							that.saleInfo.buyerPhone = that.buyerPhone
-							that.saleInfo.level = that.level
-						}else if(this.TabCur == 1){
-							if(!that.buyer){
-								this.$api.msg('请填写买方');
-								return;
-							}
-							if(!that.buyerPhone){
-								this.$api.msg('请填写手机号码');
-								return;
-							}
-							if(!that.goodsName){
-								this.$api.msg('请填写货名');
-								return;
-							}
-							if(!that.verifyCode){
-								this.$api.msg('请填写验证码');
-								return;
-							}
-							
-							if (!that.price) {
-								that.$api.msg('请选择价格类型')
-								return
-							}
-							if(!that.unitPrice){
-								that.$api.msg('请填写协议价格(元/吨)');
-								return
-							}
-							if(!that.origin){
-								this.$api.msg('请填写产地');
-								return;
-							}
-							if(!that.stock){
-								this.$api.msg('请填写库存地');
-								return;
-							}
-							if(!that.level){
-								this.$api.msg('请填写国标等级');
-								return;
-							}
-							that.saleInfo.seller = that.seller
-							that.saleInfo.sellerPhone = that.sellerPhone
-							that.saleInfo.priceType = that.price
-							that.saleInfo.unitPrice = that.unitPrice
-							that.saleInfo.minSale = that.minSale
-							that.saleInfo.exsitCount = that.exsitCount
-							that.saleInfo.origin = that.origin
-							that.saleInfo.stock = that.stock
-							that.saleInfo.verifyCode = that.verifyCode
-							that.saleInfo.goodsName = that.goodsName
-							that.saleInfo.buyer = that.buyer
-							that.saleInfo.buyerPhone = that.buyerPhone
-							that.saleInfo.level = that.level
-						}
-						else if(this.TabCur == 2){
-							if(!that.sender){
-								this.$api.msg('请填写发货方');
-								return;
-							}
-							if(!that.senderPhone){
-								this.$api.msg('请填写发货方手机号码');
-								return;
-							}
-							if(!that.receiver){
-								this.$api.msg('请填写收货方');
-								return;
-							}
-							if(!that.receiverPhone){
-								this.$api.msg('请填写收货方手机号码');
-								return;
-							}
-							if(!that.goodsName){
-								this.$api.msg('请填写货名');
-								return;
-							}
-							if(!that.verifyCode){
-								this.$api.msg('请填写验证码');
-								return;
-							}
-							that.tran.sender = that.sender
-							that.tran.senderPhone = that.senderPhone
-							that.tran.receiver = that.receiver
-							that.tran.receiverPhone = that.receiverPhone
-							that.tran.verifyCode = that.verifyCode
-							that.tran.goodsName = that.goodsName
-							that.tran.total = that.total
-							that.tran.price = that.price
-							that.tran.startPlace = that.startPlace
-							that.tran.endPlace = that.endPlace
-						}
-						else if(this.TabCur == 3){
-							if(!that.startPlace){
-								this.$api.msg('请填写起始地');
-								return;
-							}
-							if(!that.endPlace){
-								this.$api.msg('请填写目的地');
-								return;
-							}
-							if(!that.driver){
-								this.$api.msg('请填写承运人');
-								return;
-							}
-							if(!that.driverPhone){
-								this.$api.msg('请填写承运人手机号码');
-								return;
-							}
-							if(!/(^1[3|4|5|7|8][0-9]{9}$)/.test(that.driverPhone)){
-								that.$api.msg('请输入正确的承运人手机号码');
-								return
-							}
-							if(!that.carNo){
-								this.$api.msg('请填写车牌号');
-								return;
-							}
-							if(!that.verifyCode){
-								this.$api.msg('请填写验证码');
-								return;
-							}
-							if (!that.personNoImg || !that.personNoImg1) {
-								that.$api.msg('请上传磅单');
-								return
-							}
-							if (!that.driverNoImg || !that.driverNoImg1) {
-								that.$api.msg('请上传驾驶证主、副页照片');
-								return
-							}
-							if (!that.carNoImg || !that.carNoImg1) {
-								that.$api.msg('请上传行车证主、副页照片');
-								return
-							}
-							that.tran.driver = that.driver
-							that.tran.driverPhone = that.driverPhone
-							that.tran.verifyCode = that.verifyCode
-							that.tran.price = that.price
-							that.tran.startPlace = that.startPlace
-							that.tran.endPlace = that.endPlace
-							that.tran.carNo = that.carNo
-							that.tran.personNoImg = that.personNoImg
-							that.tran.personNoImg1 = that.personNoImg1
-							that.tran.driverNoImg = that.driverNoImg
-							that.tran.driverNoImg1 = that.driverNoImg1
-							that.tran.carNoImg = that.carNoImg
-							that.tran.carNoImg1 = that.carNoImg1
-						}
-						// 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问”
-						wx.getSetting({
-						 	// withSubscriptions: true,//是否获取用户订阅消息的订阅状态,默认false不返回
-						   success(res){
-						   if(res.authSetting['scope.subscribeMessage']){
-						     uni.openSetting({ // 打开设置页
-						       success(res) {
-									console.log(res.authSetting)
-						       }
-						     });
-						   }else{// 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
-						     uni.requestSubscribeMessage({
-						       tmplIds: ['8cVkckXi_8zfHeScXRHhjN6cgZFYYCWIMPDTiPWagXY'],// 
-						       success (res) {
-						         console.log(res)
-						         if(res['8cVkckXi_8zfHeScXRHhjN6cgZFYYCWIMPDTiPWagXY'] == "accept"){// 字段就是tmplIds模板id
-						            uni.showLoading({
-						            		title: '正在提交',
-											mask:true
-						            	})
-						            	if(that.TabCur == 0){
-						            		that.$api.request('sale', 'addSale',that.saleInfo, failres => {
-						            			uni.hideLoading()
-						            			that.$api.msg(failres.errmsg);
-						            			
-						            		}).then(res => {
-						            			uni.hideLoading()
-						            			uni.showModal({
-						            				title: '提示',
-						            				content: "发布提交成功,工作人员会尽快联系该号码:"+that.sellerPhone,
-						            				showCancel: false,
-						            				confirmText: '确定',
-						            				success: () => {
-						            					uni.navigateBack()
-						            				}
-						            			})
-						            			// that.$api.prePage().refreshList(data, that.manageType);
-						            		})
-						            	}
-						            	else if(that.TabCur == 1){
-						            		that.$api.request('sale', 'addBuy',that.saleInfo, failres => {
-						            			uni.hideLoading()
-						            			that.$api.msg(failres.errmsg);
-						            			
-						            		}).then(res => {
-						            			uni.hideLoading()
-						            			uni.showModal({
-						            				title: '提示',
-						            				showCancel: false,
-						            				content: "发布提交成功,工作人员会尽快联系该号码:"+that.buyerPhone,
-						            				confirmText: '确定',
-						            				success: () => {
-						            					uni.navigateBack()
-						            				}
-						            			})
-						            			// that.$api.prePage().refreshList(data, that.manageType);
-						            		})
-						            	}
-						            	else if(that.TabCur == 2){
-						            		that.$api.request('tran', 'addTran',that.tran, failres => {
-						            			uni.hideLoading()
-						            			that.$api.msg(failres.errmsg);
-						            		}).then(res => {
-						            			uni.hideLoading()
-						            			uni.showModal({
-						            				title: '提示',
-						            				showCancel: false,
-						            				content: "发布提交成功,工作人员会尽快联系该号码:"+that.senderPhone,
-						            				confirmText: '确定',
-						            				success: () => {
-						            					uni.navigateBack()
-						            				}
-						            			})
-						            			// that.$api.prePage().refreshList(data, that.manageType);
-						            		})
-						            		
-						            	}
-						            	else if(that.TabCur == 3){
-						            		that.$api.request('tran', 'addCarDriver',that.tran, failres => {
-						            			uni.hideLoading()
-						            			that.$api.msg(failres.errmsg);
-						            		}).then(res => {
-						            			uni.hideLoading()
-						            			uni.showModal({
-						            				title: '提示',
-						            				showCancel: false,
-						            				content: "发布提交成功,工作人员会尽快联系该号码:"+that.driverPhone,
-						            				confirmText: '确定',
-						            				success: () => {
-						            					uni.navigateBack()
-						            				}
-						            			})
-						            			// that.$api.prePage().refreshList(data, that.manageType);
-						            		})
-						            		
-						            	}
-						            
-						         }
-						       }
-						      })
-						     }
-						   }
-						})
-						}
-				}
 			},
 		}
 </script>

+ 95 - 97
pageB/contract/look.vue

@@ -21,99 +21,64 @@
 				<view class="c-row b-b">
 					<text class="tit">累计收发:</text>
 					<view class="con-list">
-						<text>{{goods.unloadPoundImg}}发&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{{goods.loadPoundImg}}收</text>
+						<text>{{sendout}}发&nbsp&nbsp{{collect}}收</text>
 						<!-- <text>{{goods.level}}收</text> -->
 					</view>
 				</view>
-				<!-- <view v-for="(item , index) in lists" :Key="index"> -->
+				<view v-for="(item , index) in carlist" :Key="index">
 				<view   class="c-row b-b">
-					<text>{{goods.carNo}}</text>
+					<text>{{item.carNo}}</text>
 					
 						<view class="con-list">
-						<text>{{goods.sendDateStart}}发</text>
+						<text>{{item.sendDateStart}}发</text>
 					</view>
 				</view>
 				<view   class="c-row b-b">
 					<text class="tit">结算价(元/吨)</text>
 					<view class="con-list">
-						<text>{{goods.settlementPrice}}</text>
+						<text>{{item.settlementPrice}}</text>
 					</view>
 				</view>
 				<view  class="c-row b-b">
 					<text class="tit">净重(吨)</text>
 					<view class="con-list">
-						<text>{{goods.netWeight}}发&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{{goods.loadPoundImg}}收</text>
+						<text>{{item.loadNetWeight}}发{{item.unloadNetWeight}}收</text>
 					</view>
 				</view>
 				<view class="c-row b-b">
 					<text class="tit">扣款(元/吨)</text>
 					<view class="con-list">
-						<text>{{goods.deductionAmount}}</text>
+						<text>{{item.deductionAmount}}</text>
 					</view>
 				</view>
 				<view class="c-row b-b">
 					<text class="tit">扣款原因</text>
 					<view class="con-list">
-						<text>{{goods.deductionItems}}</text>
+						<text>{{item.deductionItems}}</text>
 					</view>
 				</view>
 				<view class="c-row b-b">
-					<!-- <text class="tit">库存地</text> -->
-					<!-- <view class="con-list"> -->
-					<text><button class="cu-btn commit margin-tb-sm lg" style="background-color:  #4CD964; width: 210rpx;height: 30px; " @click="commit">发货磅单</button></text>
-					
-					<text><button class="cu-btn commit margin-tb-sm lg" style="background-color:  #1CBBB4; margin-left: 15px; width: 210rpx;height: 30px;" @click="commit">收货磅单</button></text>
-						
+					<button v-if='item.loadPoundImg' class="cu-btn commit margin-tb-sm lg" style="background-color:  #4CD964; width: 210rpx;height: 30px; " @click="shipments(item)">发货磅单</button>
+					<button v-if='item.unloadPoundImg' class="cu-btn commit margin-tb-sm lg" style="background-color:  #1CBBB4; margin-left: 15px; width: 210rpx;height: 30px;" @click="unload(item)">收货磅单</button>
 					<!-- </view> -->
 				</view>
-				<view class="padding flex flex-direction">
-					<button class="cu-btn commit margin-tb-sm lg " style="background-color: #EE9900; color: #FFFDEF ; "   @click="getList">确认卸货</button>
+				<view v-if='item.status=="已送达"&&item.confirmFlag==1' class="padding flex flex-direction">
+					<button class="cu-btn commit margin-tb-sm lg " style="background-color: #EE9900; color: #FFFDEF ; "   @click="confirmunload(item)">确认卸货</button>
+				</view>
 				</view>
-				<!-- </view> -->
 			</view>
-			<!-- <view class="d-header">
-				<text>粮食指标</text>
-			</view> -->
 			<view class="c-list">
-				<view  class="c-row b-b">
-					<view class="con-list">
-						<text>{{goods. carNo}}</text>
-						<text>{{goods.sendDateStart}}发</text>
-					</view>
-				</view>
-				<view   class="c-row b-b">
-					<text class="tit">结算价(元/吨)</text>
-					<view class="con-list">
-						<text>{{goods.settlementPrice}}</text>
-					</view>
-				</view>
-				
-				<view  class="c-row b-b">
-					<text class="tit">净重(吨)</text>
-					<view class="con-list">
-						<text>{{goods.netWeight}}发&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{{goods.packing}}收</text>
-					</view>
-				</view>
-				<view class="c-row b-b">
-					<text class="tit">扣款(元/吨)</text>
-					<view class="con-list">
-						<text>{{goods.minSale}}</text>
-					</view>
-				</view>
-				<view class="c-row b-b">
-					
-					<!-- <view class="con-list"> -->
-					<text><button class="cu-btn commit margin-tb-sm lg" style="background-color:  #4CD964; width: 210rpx;height: 30px;"  @click="commit">发货磅单</button></text>
-					
-					<!-- </view> -->
-				</view>
 				<view class="padding flex flex-direction">
 					<button class="cu-btn commit margin-tb-sm lg" style="background-color: #4CD964; " @click="commit1(goods)">添加发车信息</button>
 				</view>
-				
-				
 			</view>
-			 
+			 <view v-if='imgstatus' class='shade'>
+			 	<view class='shade-content'>
+			 		<image v-if='img' style='width:100px;height:100px;' :src='img'></image>
+					<button style='' @click='imgstatus=false'>取消</button>
+			 	</view>
+				
+			 </view>
 		</view>
 		
 	</view>
@@ -130,13 +95,14 @@
 		},
 		data() {
 			return {
-		
+				carlist:[],
 				swiperCurrent: 0,
 				titleNViewBackground: '',
 				swiperLength: 0,
+				id:'',
 				goods: {
 					// id:"",
-					contractNo:'',
+					// contractNo:'',
 					// contractNo:'',
 					// unloadPoundImg:'',
 					// loadPoundImg:'',
@@ -145,53 +111,75 @@
 					// settlementPrice:'',
 					// deductionAmount:'',
 					// deductionItems:'',
-					
 				},
+				gooods1:{
+					contractNo:'',
+				},
+				img:'',
 				share:{
 				   title: '',
 				   imageUrl:'https://taohaoliang.oss-cn-beijing.aliyuncs.com/shareLogo.png',
 				},
+				imgstatus:false,
 				reason:"",
 				price:undefined
 
 			};
 		},
 		onShow() {
+			this.loaddata()
 		},
 		onLoad(option) {
-			// this.goods.id = option.id
-			 this.goods.contractNo = option.contractNo
-			// this.goods.customer = option.customer
-			// this.goods.goodsName = option.goodsName
-			// this.goods.netWeight = option.netWeight
-			// this.goods.sendDateStart = option.sendDateStart
-			this.getList()
-			this.loaddata(option.contractNo)
+			this.goods.goodsName=option.goodsName
+			this.goods.customer=option.customer
+			this.id = option.id
+			this.goods.contractNo = option.contractNo
+		
 		},
 		computed: {
-			...mapState(['hasLogin','userInfo'])
+			...mapState(['hasLogin','userInfo']),
+			sendout(){
+				var num=0
+				for(var i=0;i<this.carlist.length;i++){
+					num+=this.carlist[i].loadNetWeight
+				}
+				return num
+			},
+			collect(){
+				var num=0
+				for(var i=0;i<this.carlist.length;i++){
+					num+=this.carlist[i].unloadNetWeight
+				}
+				return num
+			}
 		},
 		methods: {
-			commit1(goods){
+			unload(item){
+				this.img=item.unloadPoundImg
+				this.imgstatus=true
+			},
+			shipments(item){
+				this.img=item.loadPoundImg
+				this.imgstatus=true
+			},
+			commit1(){
+				var tranCarNo=''
+				if(this.carlist.length<=9){
+					tranCarNo='C00'+(this.carlist.length+1)
+				}else if(this.carlist.length<100&&this.carlist.length>9){
+					tranCarNo='C0'+(this.carlist.length+1)
+				}else  if(this.carlist.length<1000&&this.carlist.length>99){
+					tranCarNo='C'+(this.carlist.length+1)
+				}
 				uni.navigateTo({
-					url: `/pageB/contract/contract_detail?id=${goods.id}`
+					url: `/pageB/contract/contract_detail?contractNo=`+this.goods.contractNo+'&goodsName='+this.goods.goodsName+'&tranCarNo='+tranCarNo
 				})
 			},
-			getList(){
-				console.log(15454)
-			this.$api.doRequest('post','/tranCarInfo/api/confirmUnloading',this.goods).then(res => {
-			     console.log("调用接口")
-			      that.sendDisabled = true
-			      let sec = 60
-			      let interval = setInterval(() => {
-			       sec--;
-			       that.sendText = sec + 's后重发'
-			       if (sec <= 0) {
-			        that.sendDisabled = false
-			        that.sendText = "获取验证码"
-			        clearInterval(interval)
-			       }
-			      }, 1000)
+			confirmunload(item){
+			this.$api.doRequest('post','/tranCarInfo/api/confirmUnloading',{id:item.id}).then(res => {
+			     if(res.data.code==200){
+					 item.confirmFlag=3
+				 }
 			    })
 			    .catch(res => {
 			     uni.showToast({
@@ -202,19 +190,10 @@
 			    });
 			   },
 			   loaddata(){
-			   this.$api.doRequest('get','/tranCarInfo/api/selectTranCarInfoNum',this.goods).then(res => {
-			        console.log("调用接口")
-			         that.sendDisabled = true
-			         let sec = 60
-			         let interval = setInterval(() => {
-			          sec--;
-			          that.sendText = sec + 's后重发'
-			          if (sec <= 0) {
-			           that.sendDisabled = false
-			           that.sendText = "获取验证码"
-			           clearInterval(interval)
-			          }
-			         }, 1000)
+			   this.$api.doRequest('get','/tranCarInfo/api/selectTranCarInfoNum',{contractNo:this.goods.contractNo},'application/json;charset=UTF-8').then(res => {
+			        if(res.data.code==200){
+						this.carlist=res.data.data
+					}
 			       })
 			       .catch(res => {
 			        uni.showToast({
@@ -900,4 +879,23 @@
 			}
 		}
 	}
+	.shade{
+		position:fixed;
+		top:0;
+		left:0;
+		width:100%;background:rgba(0,0,0,0.5);
+		height:100%;
+		z-index:999999;
+	}
+	.shade-content{
+		background:#fff;
+		position:absolute;
+		top:50%;
+		left:50%;
+		transform: translateX(-50%) translateY(-50%);
+		z-index:999999;
+		text-align:center;
+		width:325px;
+		padding:10px;
+	}
 </style>

+ 11 - 6
pageC/businessCard/businessCard.vue

@@ -3,21 +3,26 @@
 		<view class="userinfo">
 			<u-avatar :src="userInfo.avatar" mode="square" size="110" @tap="previewImg(url)"></u-avatar>
 			<view class="userinfo-desc">
-				<view class="userinfo-desc-name">{{userInfo.nickName||userInfo.realname }}</view>
-				<view class="userinfo-desc-gray">积分:{{userInfo.money}}</view>
+				<view>
+					<view class="userinfo-desc-name">{{userInfo.nickName||userInfo.realname }}</view>
+					<u-tag v-if="userInfo.traderFlag == 1" style="margin-right: 10px;" text="粮商" size ="mini"type="info" mode="plain"/>
+					<u-tag v-if="userInfo.farmerFlag == 1" style="margin-right: 10px;" text="粮农" size ="mini"type="info" mode="plain"/>
+					<u-tag v-if="userInfo.driverFlag == 1" style="margin-right: 10px;" text="物流" size ="mini"type="info" mode="plain"/>
+				</view>
+				<!-- <view class="userinfo-desc-gray">积分:{{userInfo.money}}</view> -->
 			</view>
 		</view>
 		<view  class="perch"></view>
 		<u-cell-group v-if="1 == source">
-			<u-cell-item title="粮友圈" label="暂不支持查看粮友圈" hover-class="none" :title-style="{ marginLeft: '10rpx' }"></u-cell-item>
-			<u-cell-item title="更多信息" :title-style="{ marginLeft: '10rpx' }" @click="linkToMoreInfoMation"></u-cell-item>
+			<!-- <u-cell-item title="粮友圈" label="暂不支持查看粮友圈" hover-class="none" :title-style="{ marginLeft: '10rpx' }"></u-cell-item> -->
+			<!-- <u-cell-item title="更多信息" :title-style="{ marginLeft: '10rpx' }" @click="linkToMoreInfoMation"></u-cell-item> -->
 		</u-cell-group>
 		<view class="" v-if="!isItMe">
 			<view  class="perch"></view>
 			<u-cell-group v-if="0 == source || 2 == source">
-				<u-cell-item title=" " @click="toAddUser" :arrow="false" :center="true" :title-style="{ marginLeft: '10rpx' }">
+				<!-- <u-cell-item title=" " @click="toAddUser" :arrow="false" :center="true" :title-style="{ marginLeft: '10rpx' }">
 					<view style="text-align: center;">添加到通讯录</view>
-				</u-cell-item>
+				</u-cell-item> -->
 			</u-cell-group>
 			<u-cell-group v-else-if="1 == source">
 				<u-cell-item title="发消息" :arrow="false" :center="true" :title-style="{ marginLeft: '10rpx' }" @click="linkToChat">

+ 1 - 0
pageD/identity/driverIdentity.vue

@@ -197,6 +197,7 @@
 				ModelIndex: '高栏',
 				Model: '',
 				ModelType: ["高栏", "集装箱", "自卸车"],
+				carLongIndex: '13',
 				carLong: '',
 				carLongIndex:0,
 				carLongType: ['13', '9.6', '8.2', '8.7', '11.7', '12.5', '13.7', '15', '16', '17.5'],

+ 4 - 1
pageD/search/search.vue

@@ -36,7 +36,7 @@
 				:focus="true"
 				@custom="clickCancel"
 				@search="toSearch"
-				placeholder="h5能否自动获取焦点取决于浏览器的实现"
+				placeholder="请输入关键字搜索"
 				shape="square"
 				:action-style="{ color: '#007aff' }"
 				action-text="取消"
@@ -134,6 +134,7 @@ export default {
 						if (res.success) {
 							that.list = res.chats;
 						}
+						uni.hideLoading()
 					});
 					break;
 				case '2':
@@ -150,6 +151,8 @@ export default {
 						}
 						return flag
 					});
+					
+					uni.hideLoading()
 					break;
 				case '3':
 					that.$socket.getFriendMessageByCondition(this.chatId, that.userData.user.operId, this.pageNum, keyword, res => {

+ 63 - 16
pageD/warehousings/warehousings.vue

@@ -27,7 +27,7 @@
 				<view class="c-row b-b">
 					<text class="tit">车牌号</text>
 					<view class="con-list">
-						<text>{{WarehouseInOutInfo.carNo}}</text>
+						<text>{{WarehouseInOutInfo1.carNo}}</text>
 					</view>
 				</view>
 			</view>
@@ -38,16 +38,18 @@
 			<view class="c-list">
 				<view class="cu-form-group align-start">
 					<view class="title">毛重(吨)</view>
-					<input placeholder="请输入毛重" name="input" v-model="WarehouseInOutInfo.grossWeight"></input>
+					<input placeholder="请输入毛重" name="input" v-model="WarehouseInOutInfo.grossWeight"
+						@input="grossWeightInput"></input>
 				</view>
 				<view class="cu-form-group align-start">
 					<view class="title">皮重(吨)</view>
-					<input placeholder="请输入皮重" name="input" v-model="WarehouseInOutInfo.tare"></input>
+					<input placeholder="请输入皮重" name="input" v-model="WarehouseInOutInfo.tare"
+						@input="tareInput"></input>
 				</view>
 				<view class="c-row b-b">
 					<text class="tit">净重(吨)</text>
 					<view class="con-list">
-						<text>{{WarehouseInOutInfo.grossWeight - WarehouseInOutInfo.tare > 0 ? WarehouseInOutInfo.grossWeight - WarehouseInOutInfo.tare : 0}}</text>
+						<text>{{numFilter(WarehouseInOutInfo.netWeight)}}</text>
 					</view>
 				</view>
 				<view class="c-row b-b">
@@ -59,10 +61,10 @@
 				<view class="cu-form-group align-start">
 					<view class="title">仓位号</view>
 					<view class="con-list">
-					<input placeholder="请输入仓位号" name="input" v-model="WarehouseInOutInfo.binNumber"></input>
-				</view>
+						<input placeholder="请输入仓位号" name="input" v-model="WarehouseInOutInfo.binNumber"></input>
+					</view>
 				</view>
-				
+
 				<view class="c-row b-b">
 					<text class="tit">入库类型 </text>
 					<picker @change="ruChange" :value="ruIndex" :range="ruType" class="con-list">
@@ -140,7 +142,7 @@
 							</view>
 							<!-- 底部操作菜单 -->
 							<view class="padding flex flex-direction">
-								<button class="cu-btn bg-red margin-tb-sm lg" @click="commit">暂存</button>
+								<button class="cu-btn bg-red margin-tb-sm lg" @click="commit1">暂存</button>
 								<button class="cu-btn bg-red margin-tb-sm lg" @click="commit">提交</button>
 							</view>
 						</view>
@@ -160,26 +162,51 @@
 				goods: {},
 				list: {},
 				WarehouseInOutInfo: {
-					warehouseInOutDetail: {}
+					warehouseInOutDetail: {},
+					pcFlag: 0,
+					contractNo: {},
+					carNo: {},
 				},
-				pinIndex: 0,
+				WarehouseInOutInfo1: {
+					contractNo: {},
+					carNo: {},
+				},
+				pinIndex: '不限(默认)',
+				pinTypes: '',
 				pinType: ['不限(默认)', '一等品', '二等品', '三等品', '等外'],
-				ruIndex: 0,
+				ruIndex: '采购入库',
+				rutypes: '',
 				ruType: ['采购入库', '移库入库', '暂存入库', '贸易服务入库', '退库'],
 			}
 		},
-		onLoad(option){
+		onLoad(option) {
 			this.WarehouseInOutInfo.contractNo = option.contractNo
 			this.WarehouseInOutInfo.goodsName = option.goodsName
-			this.WarehouseInOutInfo.startNetWeight = option.startNetWeight
-			this.WarehouseInOutInfo.carNo = option.carNo+'('+ option.tranCarNo+ ')'
+			this.WarehouseInOutInfo.startWeight = option.startWeight
+			this.WarehouseInOutInfo1.carNo = option.carNo + '(' + option.tranCarNo + ')'
 			this.WarehouseInOutInfo.warehouseName = option.warehouseName
+			this.WarehouseInOutInfo.id = option.id
+			this.WarehouseInOutInfo.carNo = option.carNo
 		},
 		methods: {
+			commit1() {
+				console.log(this.list)
+				this.WarehouseInOutInfo.warehouseInOutDetail = this.list
+				this.WarehouseInOutInfo.statusFlag = 1
+				this.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse', this.WarehouseInOutInfo).then(res => {
 
+				}).catch(res => {
+					uni.showToast({
+						title: res.data.message,
+						icon: 'none',
+						duration: 2000
+					})
+				})
+			},
 			commit() {
 				console.log(this.list)
 				this.WarehouseInOutInfo.warehouseInOutDetail = this.list
+				this.WarehouseInOutInfo.statusFlag = 3
 				this.$api.doRequest('post', '/warehouseInOutInfo/InOutWarehouse', this.WarehouseInOutInfo).then(res => {
 
 				}).catch(res => {
@@ -190,13 +217,33 @@
 					})
 				})
 			},
-			ruChange(e){
+			numFilter(value) {
+				if (!value) {
+					return 0
+				}
+				// 截取当前数据到小数点后两位
+				let realVal = parseFloat(value).toFixed(2)
+				return realVal
+			},
+			grossWeightInput(e) {
+				this.WarehouseInOutInfo.grossWeight = e.detail.value
+				if (this.WarehouseInOutInfo.grossWeight && this.WarehouseInOutInfo.tare) {
+					this.WarehouseInOutInfo.netWeight = this.WarehouseInOutInfo.grossWeight - this.WarehouseInOutInfo.tare
+				}
+			},
+			tareInput(e) {
+				this.WarehouseInOutInfo.tare = e.detail.value
+				if (this.WarehouseInOutInfo.grossWeight && this.WarehouseInOutInfo.tare) {
+					this.WarehouseInOutInfo.netWeight = this.WarehouseInOutInfo.grossWeight - this.WarehouseInOutInfo.tare
+				}
+			},
+			ruChange(e) {
 				this.ruIndex = e.detail.value
 				this.rutypes = this.ruType[this.ruIndex];
 			},
 			pinChange(e) {
 				this.pinIndex = e.detail.value
-				this.pintypes = this.pinType[this.pinIndex];
+				this.pinTypes = this.pinType[this.pinIndex];
 			},
 		}
 

+ 99 - 58
pages.json

@@ -328,6 +328,7 @@
             }
             
         }
+
         ,{
             "path" : "pageD/identity/driverIdentity",
             "style" :                                                                                    
@@ -392,61 +393,8 @@
                 "enablePullDownRefresh": false
             }
             
-        }
-        ,{
-            "path" : "pageD/myRelease/sellGrain",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "卖粮",
-                "enablePullDownRefresh": false
-            }
-            
-        },
-		{
-		    "path" : "pageD/myRelease/buyGrain",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": "买粮",
-		        "enablePullDownRefresh": false
-		    }
-		    
-		},
-		{
-		    "path" : "pageD/myRelease/sellDetails",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": "卖粮详情",
-		        "enablePullDownRefresh": false
-		    }
-		    
-		},
-		{
-		    "path" : "pageD/myRelease/buyDetails",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": "买粮详情",
-				"enablePullDownRefresh": false
-		    }
-		}
-        ,{
-            "path" : "pageD/warehousings/warehousings",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "入库",
-                "enablePullDownRefresh": false
-            }
-            
         }
 		
-		,{
-		    "path" : "pageD/warehousings/warehousingDetails",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": "入库详情",
-		        "enablePullDownRefresh": false
-		    }
-		    
-		}
     ],
 	"subpackages": [
 			{
@@ -466,6 +414,13 @@
 				        "navigationBarTitleText": "交易审核任务"
 				    }
 				},
+				{
+				    "path" : "product/Identity_switching",
+				    "style" :                                                                                    
+				    {
+				        "navigationBarTitleText": "粮商身份"
+				    }
+				},
 				{
 				    "path" : "pages/task_detail_ys",
 				    "style" :                                                                                    
@@ -1003,12 +958,98 @@
 				    }
 				},
 				{
-				"path": "chooseBgImg/chooseBgImg",
-				"style": {
-					"enablePullDownRefresh": true ,
-					"navigationBarTitleText": "选择背景图"
+					"path": "chooseBgImg/chooseBgImg",
+					"style": {
+						"enablePullDownRefresh": true ,
+						"navigationBarTitleText": "选择背景图"
+					}
+				},{
+				    "path" : "identity/driverIdentity",
+				    "style" :                                                                                    
+				    {
+				        "navigationBarTitleText": "司机认证",
+				        "enablePullDownRefresh": false
+				    }
+				    
+				},
+				{
+				    "path" : "identity/driverIdentityLook",
+				    "style" :                                                                                    
+				    {
+				        "navigationBarTitleText": "认证信息",
+				        "enablePullDownRefresh": false
+				    }   
+				},
+				{
+				    "path" : "identity/companyIdentity",
+				    "style" :                                                                                    
+				    {
+				        "navigationBarTitleText": "粮商认证",
+				        "enablePullDownRefresh": false
+				    }   
+				},
+				{
+				    "path" : "identity/companyIdentityLook",
+				    "style" :                                                                                    
+				    {
+				        "navigationBarTitleText": "认证信息",
+				        "enablePullDownRefresh": false
+				    }   
+				}
+				,{
+				    "path" : "myRelease/sellGrain",
+				    "style" :                                                                                    
+				    {
+				        "navigationBarTitleText": "卖粮",
+				        "enablePullDownRefresh": false
+				    }
+				    
+				},
+				{
+				    "path" : "myRelease/buyGrain",
+				    "style" :                                                                                    
+				    {
+				        "navigationBarTitleText": "买粮",
+				        "enablePullDownRefresh": false
+				    }
+				    
+				},
+				{
+				    "path" : "myRelease/sellDetails",
+				    "style" :                                                                                    
+				    {
+				        "navigationBarTitleText": "卖粮详情",
+				        "enablePullDownRefresh": false
+				    }
+				    
+				},
+				{
+				    "path" : "myRelease/buyDetails",
+				    "style" :                                                                                    
+				    {
+				        "navigationBarTitleText": "买粮详情",
+						"enablePullDownRefresh": false
+				    }
+				}
+				,{
+				    "path" : "warehousings/warehousings",
+				    "style" :                                                                                    
+				    {
+				        "navigationBarTitleText": "入库",
+				        "enablePullDownRefresh": false
+				    }
+				    
+				}
+				
+				,{
+				    "path" : "warehousings/warehousingDetails",
+				    "style" :                                                                                    
+				    {
+				        "navigationBarTitleText": "入库详情",
+				        "enablePullDownRefresh": false
+				    }
+				    
 				}
-			}
 			  ]
 			}
 			

+ 1 - 1
pages/business/business.vue

@@ -325,7 +325,7 @@ currentPage:this.currentPage,searchKeyWord:this.searchKeyWord,receivePrivate:thi
 	}
 </script>
 
-<style>
+<style lang='scss'>
 	page,
 	.content {
 		background: #F5F6FA;

+ 32 - 58
pages/home/home.vue

@@ -13,12 +13,18 @@
 			<!-- #endif -->
 			
 			<!-- #ifdef APP-PLUS -->
-			<u-navbar :is-back="false" title="消息" :background="{ background: '#F6F7F8'  }" title-color="#404133" :border-bottom="false" z-index="1001">
+			<u-navbar :is-back="false" title="粮信" :background="{ background: '#F6F7F8'  }" title-color="#404133" :border-bottom="false" z-index="1001">
+				<view class="slot-wrap">
+						<text class = 'tip_text cuIcon-back' @click='back' ></text>
+				</view>
+			</u-navbar>
+			<!-- #endif -->
+			<!-- #ifdef H5 -->
+			<u-navbar :is-back="false" title="粮信" :background="{ background: '#F6F7F8'  }" title-color="#404133" :border-bottom="false" z-index="1001">
 				<view class="slot-wrap">
 						<text class = 'tip_text cuIcon-back' @click='back' ></text>
 				</view>
 			</u-navbar>
-			
 			<!-- #endif -->
 			<!-- <selectInput :list="selectList" :list-key="'name'" :show.sync="selectShow" @on-select="checkSelect" @close="closeSelect" /> -->
 			<searchInput :searchType="1"/>
@@ -35,7 +41,14 @@
 			</u-navbar>
 			<!-- #endif -->
 			<!-- #ifdef APP-PLUS -->
-			<u-navbar :is-back="false" title="通讯录" :background="{ background: '#F6F7F8'  }" title-color="#404133" :border-bottom="false" z-index="1001">
+			<u-navbar :is-back="false" title="粮信" :background="{ background: '#F6F7F8'  }" title-color="#404133" :border-bottom="false" z-index="1001">
+			<view class="slot-wrap">
+					<text class = 'tip_text cuIcon-back' @click='back'></text>
+			</view>
+			</u-navbar>
+			<!-- #endif -->
+			<!-- #ifdef H5 -->
+			<u-navbar :is-back="false" title="粮信" :background="{ background: '#F6F7F8'  }" title-color="#404133" :border-bottom="false" z-index="1001">
 			<view class="slot-wrap">
 					<text class = 'tip_text cuIcon-back' @click='back'></text>
 			</view>
@@ -53,7 +66,14 @@
 			</u-navbar>
 			<!-- #endif -->
 			<!-- #ifdef APP-PLUS -->
-			<u-navbar :is-back="false" title="发现" :background="{ background: '#F6F7F8'  }" title-color="#404133" :border-bottom="false" z-index="1001">
+			<u-navbar :is-back="false" title="粮信" :background="{ background: '#F6F7F8'  }" title-color="#404133" :border-bottom="false" z-index="1001">
+			<view class="slot-wrap">
+					<text class = 'tip_text cuIcon-back' @click='back' ></text>
+			</view>
+			</u-navbar>
+			<!-- #endif -->
+			<!-- #ifdef H5 -->
+			<u-navbar :is-back="false" title="粮信" :background="{ background: '#F6F7F8'  }" title-color="#404133" :border-bottom="false" z-index="1001">
 			<view class="slot-wrap">
 					<text class = 'tip_text cuIcon-back' @click='back' ></text>
 			</view>
@@ -65,7 +85,7 @@
 				</u-cell-item>
 			</u-cell-group>	
 			<view style="height: 10rpx;"></view>
-			<u-cell-group>
+			<!-- <u-cell-group>
 				<u-cell-item  title="扫一扫" :title-style="{marginLeft:'30rpx',fontWeight:'800'}" @tap="linkToScan">
 					<u-icon slot="icon" name="scan" color="#409eff" size="40"></u-icon> 
 				</u-cell-item>
@@ -78,56 +98,7 @@
 					</u-cell-item>
 				</u-cell-group>
 				<view v-if="index!=linkItem.length" class="" style="height: 10rpx;"></view>
-			</view>
-		</block>
-		<block v-if='PageCur=="my"'>
-			<!-- #ifdef MP-WEIXIN -->
-			<u-navbar :is-back="false" title=" " :border-bottom="false">
-				<view class="slot-wrap">
-					<text class = 'tip_text cuIcon-back' @click='back' ></text>
-				</view>
-				<view class="u-flex u-row-right" style="width: 100%;">
-					<view class="camera u-flex u-row-center">
-						<u-icon @tap="linkToMoment" name="camera-fill" color="#000000" size="48"></u-icon>
-					</view>
-				</view>
-			</u-navbar>
-			<!-- #endif -->
-			<!-- #ifdef APP-PLUS -->
-			<u-navbar :is-back="false" title=" " :border-bottom="false">
-				<view class="slot-wrap">
-					<text class = 'tip_text cuIcon-back' @click='back' ></text>
-				</view>
-			</u-navbar>
-			<!-- #endif -->
-			<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30" @tap="linkToPerson">
-				<view class="u-m-r-10">
-					<u-avatar mode="square" :src="userData.user.avatar" size="140"></u-avatar>
-				</view>
-				<view class="u-flex-1">
-					<view class="u-font-18 u-p-b-20">{{userData.user.realname}}</view>
-					<view class="u-font-14 u-tips-color">积分: {{userData.user.money}}</view>
-				</view>
-				<view class="u-m-l-10 u-p-10">
-					<u-icon name="arrow-right" color="#969799" size="28"></u-icon>
-				</view>
-			</view>
-			
-			<view class="u-m-t-20">
-				<u-cell-group>
-					<u-cell-item @tap="linkTomy(index)" v-for="(item, index) in groupList" :key="index" :title="item.title" :title-style="{ marginLeft: '30rpx' ,fontWeight:'800'}">
-						<u-icon slot="icon" :name="item.icon" :color="item.color" size="40"></u-icon>
-					</u-cell-item>
-				</u-cell-group>
-			</view>
-			
-			<view class="u-m-t-20">
-				<u-cell-group>
-					<u-cell-item @click="linkToSetting" title="设置" :title-style="{ marginLeft: '30rpx' ,fontWeight:'800'}">
-						<u-icon slot="icon" name="setting" color="#409eff" size="40"></u-icon>
-					</u-cell-item>
-				</u-cell-group>
-			</view>
+			</view> -->
 		</block>
 		<view class="cu-bar tabbar bg-white shadow foot">
 			<view :class="PageCur=='msg'?'action text-pink':'action text-gray'" @click="tabClick" data-cur="msg">
@@ -139,9 +110,6 @@
 			<view :class="PageCur=='find'?'action text-pink':'action text-gray'" @click="tabClick" data-cur="find">
 				<view :class="PageCur=='find'?'cuIcon-friendfill':'cuIcon-friendfill'"></view> 发现
 			</view>
-			<view :class="PageCur=='my'?'action text-pink':'action text-gray'" @click="tabClick" data-cur="my">
-				<view :class="PageCur=='my'?'cuIcon-people':'cuIcon-people'"></view> 我的
-			</view>
 		</view>
 	</view>
 </template>
@@ -224,8 +192,14 @@ export default {
 	computed: {
 			...mapState(['hasLogin', 'userInfo'])
 	},
+	onReady() {
+		uni.setNavigationBarTitle({
+			title: '新的标题'
+		});
+	},
 	onShow() {
 		uni.hideTabBar()
+		
 		this.userInfo =  uni.getStorageSync("userInfo")
 		console.log(this.userData.user.realname,this.userInfo.nickname)
 		// if(this.userData.user.realname == this.userInfo.nickname){

+ 1 - 1
pages/public/code.vue

@@ -203,7 +203,7 @@
 	width: 100vw;
 	height: 100vh;
 	overflow: hidden;
-	background: url('../../static/img/login/bg.png');
+	background: url('~@/static/img/login/bg.png');
 	background-size:100%;}
 	.back-btn {
 		position: absolute;

+ 1 - 1
pages/public/login.vue

@@ -863,7 +863,7 @@
 		width: 100vw;
 		height: 100vh;
 		overflow: hidden;
-		background: url('../../static/img/login/bg.png');
+		background: url('~@/static/img/login/bg.png');
 		background-size:100%;
 	}
 

+ 1 - 1
pages/public/login_account_number.vue

@@ -868,7 +868,7 @@ username: "13333333333"}).then(res => {
 		width: 100vw;
 		height: 100vh;
 		overflow: hidden;
-		background: url('../../static/img/login/bg.png');
+		background: url('~@/static/img/login/bg.png');
 		background-size:100%;
 	}
 

+ 1 - 1
pages/public/register.vue

@@ -995,7 +995,7 @@
 		width: 100vw;
 		height: 100vh;
 		overflow: hidden;
-		background: url('../../static/img/login/bg.png');
+		background: url('~@/static/img/login/bg.png');
 		background-size:100%;
 	}
 	.close{

+ 1 - 1
pages/public/reset.vue

@@ -742,7 +742,7 @@
 		width: 100vw;
 		height: 100vh;
 		overflow: hidden;
-		background: url('../../static/img/login/bg.png');
+		background: url('~@/static/img/login/bg.png');
 		background-size:100%;
 	}
 

+ 1 - 3
pages/task/my_task.vue

@@ -109,9 +109,7 @@
 				})
 				}else{
 					uni.navigateTo({
-						url: `/pageD/warehousings/warehousings?id=${item.id}&contractNo=${item.contractNo}
-						&goodsName=${item.goodsName}&startNetWeight=${item.startNetWeight}
-						&carNo=${item.carNo}&tranCarNo=${item.tranCarNo}&warehouseName=${item.warehouseName}`
+						url: `/pageD/warehousings/warehousings?id=${item.id}&goodsName=${item.goodsName}&contractNo=${item.contractNo}&startWeight=${item.startWeight}&carNo=${item.carNo}&tranCarNo=${item.tranCarNo}&warehouseName=${item.warehouseName}`
 					})
 				}
 			}

+ 28 - 0
uni_modules/uni-file-picker/changelog.md

@@ -0,0 +1,28 @@
+## 0.2.2(2021-07-27)
+- 修复 vue3 下赋值错误的Bug
+- 优化 h5平台下上传文件导致页面卡死的问题
+## 0.2.0(2021-07-13)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 0.1.1(2021-07-02)
+- 修复 sourceType 缺少默认值导致 ios 无法选择文件
+## 0.1.0(2021-06-30)
+- 优化 解耦与uniCloud的强绑定关系 ,如不绑定服务空间,默认autoUpload为false且不可更改
+## 0.0.11(2021-06-30)
+- 修复 由 0.0.10 版本引发的 returnType 属性失效的问题
+## 0.0.10(2021-06-29)
+- 优化 文件上传后进度条消失时机
+## 0.0.9(2021-06-29)
+- 修复 在uni-forms 中,删除文件 ,获取的值不对的Bug
+## 0.0.8(2021-06-15)
+- 修复 删除文件时无法触发 v-model 的Bug
+## 0.0.7(2021-05-12)
+- 新增 组件示例地址
+## 0.0.6(2021-04-09)
+- 修复 选择的文件非 file-extname 字段指定的扩展名报错的Bug
+## 0.0.5(2021-04-09)
+- 优化 更新组件示例
+## 0.0.4(2021-04-09)
+- 优化 file-extname 字段支持字符串写法,多个扩展名需要用逗号分隔
+## 0.0.3(2021-02-05)
+- 调整为uni_modules目录规范
+- 修复 微信小程序不指定 fileExtname 属性选择失败的Bug

+ 142 - 0
uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js

@@ -0,0 +1,142 @@
+'use strict';
+
+// Object.defineProperty(exports, '__esModule', { value: true });
+
+const ERR_MSG_OK = 'chooseAndUploadFile:ok';
+const ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
+function chooseImage(opts) {
+		const { count, sizeType, sourceType = ['album', 'camera'], extension } = opts
+    return new Promise((resolve, reject) => {
+        uni.chooseImage({
+            count,
+            sizeType,
+            sourceType,
+            extension,
+            success(res) {
+                resolve(normalizeChooseAndUploadFileRes(res, 'image'));
+            },
+            fail(res) {
+                reject({
+                    errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL),
+                });
+            },
+        });
+    });
+}
+function chooseVideo(opts) {
+    const { camera, compressed, maxDuration, sourceType = ['album', 'camera'], extension } = opts;
+    return new Promise((resolve, reject) => {
+        uni.chooseVideo({
+            camera,
+            compressed,
+            maxDuration,
+            sourceType,
+            extension,
+            success(res) {
+                const { tempFilePath, duration, size, height, width } = res;
+                resolve(normalizeChooseAndUploadFileRes({
+                    errMsg: 'chooseVideo:ok',
+                    tempFilePaths: [tempFilePath],
+                    tempFiles: [
+                        {
+                            name: (res.tempFile && res.tempFile.name) || '',
+                            path: tempFilePath,
+                            size,
+                            type: (res.tempFile && res.tempFile.type) || '',
+                            width,
+                            height,
+                            duration,
+                            fileType: 'video',
+                            cloudPath: '',
+                        },
+                    ],
+                }, 'video'));
+            },
+            fail(res) {
+                reject({
+                    errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL),
+                });
+            },
+        });
+    });
+}
+function chooseAll(opts) {
+    const { count, extension } = opts;
+    return new Promise((resolve, reject) => {
+        let chooseFile = uni.chooseFile;
+        if (typeof wx !== 'undefined' &&
+            typeof wx.chooseMessageFile === 'function') {
+            chooseFile = wx.chooseMessageFile;
+        }
+        if (typeof chooseFile !== 'function') {
+            return reject({
+                errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。',
+            });
+        }
+        chooseFile({
+            type: 'all',
+            count,
+            extension,
+            success(res) {
+                resolve(normalizeChooseAndUploadFileRes(res));
+            },
+            fail(res) {
+                reject({
+                    errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL),
+                });
+            },
+        });
+    });
+}
+function normalizeChooseAndUploadFileRes(res, fileType) {
+    res.tempFiles.forEach((item, index) => {
+        if (!item.name) {
+            item.name = item.path.substring(item.path.lastIndexOf('/') + 1);
+        }
+        if (fileType) {
+            item.fileType = fileType;
+        }
+        item.cloudPath =
+            Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.'));
+    });
+    // wx.chooseMessageFile
+    if (!res.tempFilePaths) {
+        res.tempFilePaths = res.tempFiles.map((file) => file.path);
+    }
+    return res;
+}
+function uploadCloudFiles(res, max = 5, onUploadProgress) {}
+function uploadFiles(choosePromise, { onChooseFile, onUploadProgress }) {
+    return choosePromise
+        .then((res) => {
+        if (onChooseFile) {
+            const customChooseRes = onChooseFile(res);
+            if (typeof customChooseRes !== 'undefined') {
+                return Promise.resolve(customChooseRes).then((chooseRes) => typeof chooseRes === 'undefined' ? res : chooseRes);
+            }
+        }
+        return res;
+    })
+        .then((res) => {
+        if (res === false) {
+            return {
+                errMsg: ERR_MSG_OK,
+                tempFilePaths: [],
+                tempFiles: [],
+            };
+        }
+		return res
+        // return uploadCloudFiles(res, 5, onUploadProgress);
+    })
+}
+function chooseAndUploadFile(opts = { type: 'all' }) {
+    if (opts.type === 'image') {
+        return uploadFiles(chooseImage(opts), opts);
+    }
+    else if (opts.type === 'video') {
+        return uploadFiles(chooseVideo(opts), opts);
+    }
+    return uploadFiles(chooseAll(opts), opts);
+}
+
+export {chooseAndUploadFile};

+ 740 - 0
uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue

@@ -0,0 +1,740 @@
+<template>
+	<view class="uni-file-picker">
+		<view v-if="title" class="uni-file-picker__header">
+			<text class="file-title">{{ title }}</text>
+			<text class="file-count">{{ filesList.length }}/{{ limitLength }}</text>
+		</view>
+		<upload-image
+			v-if="fileMediatype === 'image' && showType === 'grid'"
+			:readonly="readonly"
+			:image-styles="imageStyles"
+			:files-list="filesList"
+			:limit="limitLength"
+			:disablePreview="disablePreview"
+			:delIcon="delIcon"
+			@uploadFiles="uploadFiles"
+			@choose="choose"
+			@delFile="delFile"
+		>
+			<slot>
+				<view class="is-add">
+					<view class="icon-add"></view>
+					<view class="icon-add rotate"></view>
+				</view>
+			</slot>
+		</upload-image>
+		<upload-file
+			v-if="fileMediatype !== 'image' || showType !== 'grid'"
+			:readonly="readonly"
+			:list-styles="listStyles"
+			:files-list="filesList"
+			:showType="showType"
+			:delIcon="delIcon"
+			@uploadFiles="uploadFiles"
+			@choose="choose"
+			@delFile="delFile"
+		>
+			<slot><button type="primary" size="mini">选择文件</button></slot>
+		</upload-file>
+	</view>
+</template>
+
+<script>
+	import {chooseAndUploadFile} from './choose-and-upload-file.js'
+	import uploadImage from './upload-image.vue'
+	import uploadFile from './upload-file.vue'
+	let fileInput = null
+/**
+ * FilePicker 文件选择上传
+ * @description 文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=4079
+ * @property {Object|Array}	value	组件数据,通常用来回显 ,类型由return-type属性决定
+ * @property {Boolean}	disabled=[true|false]	组件禁用
+ * 	@value true 	禁用
+ * 	@value false 	取消禁用
+ * @property {Boolean}	readonly=[true|false]	组件只读,不可选择,不显示进度,不显示删除按钮
+ * 	@value true 	只读
+ * 	@value false 	取消只读
+ * @property {String}	return-type=[array|object]	限制 value 格式,当为 object 时 ,组件只能单选,且会覆盖
+ * 	@value array	规定 value 属性的类型为数组
+ * 	@value object	规定 value 属性的类型为对象
+ * @property {Boolean}	disable-preview=[true|false]	禁用图片预览,仅 mode:grid 时生效
+ * 	@value true 	禁用图片预览
+ * 	@value false 	取消禁用图片预览
+ * @property {Boolean}	del-icon=[true|false]	是否显示删除按钮
+ * 	@value true 	显示删除按钮
+ * 	@value false 	不显示删除按钮
+ * @property {Boolean}	auto-upload=[true|false]	是否自动上传,值为true则只触发@select,可自行上传
+ * 	@value true 	自动上传
+ * 	@value false 	取消自动上传
+ * @property {Number|String}	limit	最大选择个数 ,h5 会自动忽略多选的部分
+ * @property {String}	title	组件标题,右侧显示上传计数
+ * @property {String}	mode=[list|grid]	选择文件后的文件列表样式
+ * 	@value list 	列表显示
+ * 	@value grid 	宫格显示
+ * @property {String}	file-mediatype=[image|video|all]	选择文件类型
+ * 	@value image	只选择图片
+ * 	@value video	只选择视频
+ * 	@value all		选择所有文件
+ * @property {Array}	file-extname	选择文件后缀,根据 file-mediatype 属性而不同
+ * @property {Object}	list-style	mode:list 时的样式
+ * @property {Object}	image-styles	选择文件后缀,根据 file-mediatype 属性而不同
+ * @event {Function} select 	选择文件后触发
+ * @event {Function} progress 文件上传时触发
+ * @event {Function} success 	上传成功触发
+ * @event {Function} fail 		上传失败触发
+ * @event {Function} delete 	文件从列表移除时触发
+ */
+export default {
+	name: 'uniFilePicker',
+	components: {
+		uploadImage,
+		uploadFile
+	},
+	props: {
+		// #ifdef VUE3
+		modelValue: {
+			type: [Array, Object],
+			default() {
+				return []
+			}
+		},
+		// #endif
+
+		// #ifndef VUE3
+		value: {
+			type: [Array, Object],
+			default() {
+				return []
+			}
+		},
+		// #endif
+
+		disabled: {
+			type: Boolean,
+			default: false
+		},
+		disablePreview: {
+			type: Boolean,
+			default: false
+		},
+		delIcon: {
+			type: Boolean,
+			default: true
+		},
+		// 自动上传
+		autoUpload: {
+			type: Boolean,
+			default: true
+		},
+		// 最大选择个数 ,h5只能限制单选或是多选
+		limit: {
+			type: [Number, String],
+			default: 9
+		},
+		// 列表样式 grid | list | list-card
+		mode: {
+			type: String,
+			default: 'grid'
+		},
+		// 选择文件类型  image/video/all
+		fileMediatype: {
+			type: String,
+			default: 'image'
+		},
+		// 文件类型筛选
+		fileExtname: {
+			type: [Array, String],
+			default() {
+				return []
+			}
+		},
+		title: {
+			type: String,
+			default: ''
+		},
+		listStyles: {
+			type: Object,
+			default() {
+				return {
+					// 是否显示边框
+					border: true,
+					// 是否显示分隔线
+					dividline: true,
+					// 线条样式
+					borderStyle: {}
+				}
+			}
+		},
+		imageStyles: {
+			type: Object,
+			default() {
+				return {
+					width: 'auto',
+					height: 'auto'
+				}
+			}
+		},
+		readonly: {
+			type: Boolean,
+			default: false
+		},
+		returnType: {
+			type: String,
+			default: 'array'
+		},
+		sizeType:{
+			type: Array,
+			default(){
+				return ['original','compressed']
+			}
+		}
+	},
+	watch: {
+		// #ifndef VUE3
+		value: {
+			handler(newVal) {
+				this.setValue(newVal)
+			},
+			immediate: true
+		},
+		// #endif
+		// #ifdef VUE3
+		modelValue:{
+			handler(newVal) {
+				this.setValue(newVal)
+			},
+			immediate: true
+		},
+		// #endif
+
+	},
+	data() {
+		return {
+			files: [],
+		}
+	},
+	computed: {
+		filesList() {
+			let files = []
+			this.files.forEach(v => {
+				files.push(v)
+			})
+			return files
+		},
+		showType() {
+			if (this.fileMediatype === 'image') {
+				return this.mode
+			}
+			return 'list'
+		},
+		limitLength() {
+			if (this.returnType === 'object') {
+				return 1
+			}
+			if (!this.limit) {
+				return 1
+			}
+			if (this.limit >= 9) {
+				return 9
+			}
+			return this.limit
+		},
+		extname(){
+			if (!Array.isArray(this.fileExtname)) {
+				let extname = this.fileExtname.replace(/(\[|\])/g,'')
+				return extname.split(',')
+			} else {
+				return this.fileExtname
+			}
+			return []
+		}
+	},
+	created() {
+		// TODO 兼容不开通服务空间的情况
+		if(!(uniCloud.config && uniCloud.config.provider)){
+			this.noSpace = true
+			uniCloud.chooseAndUploadFile = chooseAndUploadFile
+		}
+		this.tempData = {}
+		this.form = this.getForm('uniForms')
+		this.formItem = this.getForm('uniFormsItem')
+		if (this.form && this.formItem) {
+			if (this.formItem.name) {
+				this.rename = this.formItem.name
+				this.form.inputChildrens.push(this)
+			}
+		}
+	},
+	methods: {
+		setValue(newVal){
+			let newFils = []
+			let newData = [].concat(newVal || [])
+			newData.forEach(v => {
+				const files = this.files.find(i => i.url === v.url)
+				const reg = /cloud:\/\/([\w.]+\/?)\S*/
+				if (!v.path) {
+					v.path = v.url
+				}
+				if (reg.test(v.url)) {
+					this.getTempFileURL(v, v.url)
+				}
+				newFils.push(files ? files : v)
+			})
+			let data  = null
+			if (this.returnType === 'object') {
+				data = this.backObject(newFils)[0]
+			} else {
+				data = this.backObject(newFils)
+			}
+			this.formItem && this.formItem.setValue(data)
+			if(newFils.length){
+				this.files = newFils
+			}
+		},
+		/**
+		 * 获取父元素实例
+		 */
+		getForm(name = 'uniForms') {
+			let parent = this.$parent;
+			let parentName = parent.$options.name;
+			while (parentName !== name) {
+				parent = parent.$parent;
+				if (!parent) return false;
+				parentName = parent.$options.name;
+			}
+			return parent;
+		},
+		/**
+		 * 继续上传
+		 */
+		upload() {
+			// TODO 先放弃这个实现 ,不能全部上传
+			// if (this.$uploadFiles) {
+			// 	this.$uploadFiles()
+			// } else {
+			// 	uni.showToast({
+			// 		title: '请先选择文件',
+			// 		icon: 'none'
+			// 	})
+			// }
+			let files = []
+			this.files.forEach((v, index) => {
+				if (v.status === 'ready' || v.status === 'error') {
+					files.push(Object.assign({}, v))
+				}
+			})
+
+			this.uploadFiles(files)
+		},
+		/**
+		 * 选择文件
+		 */
+		choose() {
+
+			if (this.disabled) return
+			if (this.files.length >= Number(this.limitLength) && this.showType !== 'grid' && this.returnType === 'array') {
+				uni.showToast({
+					title: `您最多选择 ${this.limitLength} 个文件`,
+					icon: 'none'
+				})
+				return
+			}
+			// uni.showActionSheet({
+			// 	itemList: ['填写 url 地址', '选择文件'],
+			// 	success: (res) => {
+			// 		if (res.tapIndex === 1) {
+			// 			this.chooseFiles()
+			// 		}
+			// 	},
+			// 	fail: function(res) {}
+			// });
+			this.chooseFiles()
+		},
+
+		/**
+		 * 选择文件并上传
+		 */
+		chooseFiles() {
+
+			uniCloud
+				.chooseAndUploadFile({
+					type: this.fileMediatype,
+					compressed: false,
+					sizeType:this.sizeType,
+					// TODO 如果为空,video 有问题
+					extension: this.extname.length > 0 ? this.extname : undefined,
+					count: this.limitLength - this.files.length, //默认9
+					onChooseFile: async res => {
+						if ((Number(this.limitLength) === 1 && this.disablePreview && !this.disabled) || this.returnType === 'object') {
+							this.files = []
+						}
+						let filePaths = []
+						let files = []
+						if (this.extname && this.extname.length > 0) {
+							res.tempFiles.forEach(v => {
+								let fileFullName = this.getFileExt(v.name)
+								const extname = fileFullName.ext.toLowerCase()
+								if (this.extname.indexOf(extname) !== -1) {
+									files.push(v)
+									filePaths.push(v.path)
+								}
+							})
+							if (files.length !== res.tempFiles.length) {
+								uni.showToast({
+									title: `当前选择了${res.tempFiles.length}个文件 ,${res.tempFiles.length - files.length} 个文件格式不正确`,
+									icon: 'none',
+									duration: 5000
+								})
+							}
+						} else {
+							filePaths = res.tempFilePaths
+							files = res.tempFiles
+						}
+
+						let currentData = []
+						for (let i = 0; i < files.length; i++) {
+							if (this.limitLength - this.files.length <= 0) break
+							files[i].uuid = Date.now()
+							let filedata = await this.getFileData(files[i], this.fileMediatype)
+							filedata.progress = 0
+							filedata.status = 'ready'
+							this.files.push(filedata)
+							currentData.push({...filedata,file:files[i]})
+						}
+						this.$emit('select', {
+							tempFiles: currentData,
+							tempFilePaths: filePaths
+						})
+						res.tempFiles = files
+						// 停止自动上传
+						if (!this.autoUpload || this.noSpace) {
+							res.tempFiles = []
+							// TODO 先放弃这个实现 ,不能全部上传
+							// return new Promise((resolve) => {
+							// 	this.$uploadFiles = () => {
+							// 		// this._is_uploading = true
+							// 		resolve(res)
+							// 	}
+							// })
+						}
+					},
+					onUploadProgress: progressEvent => {
+						this.setProgress(progressEvent, progressEvent.index)
+					}
+				})
+				.then(result => {
+					this.setSuccessAndError(result.tempFiles)
+				})
+				.catch(err => {
+					console.log('选择失败', err)
+				})
+		},
+
+		/**
+		 * 批传
+		 * @param {Object} e
+		 */
+		uploadFiles(files) {
+			files = [].concat(files)
+			this.uploadCloudFiles(files, 5, res => {
+				this.setProgress(res, res.index, true)
+			})
+				.then(result => {
+					this.setSuccessAndError(result)
+				})
+				.catch(err => {
+					console.log('err', err)
+				})
+		},
+
+		/**
+		 * 成功或失败
+		 */
+		async setSuccessAndError(res, fn) {
+			let successData = []
+			let errorData = []
+			let tempFilePath = []
+			let errorTempFilePath = []
+			for (let i = 0; i < res.length; i++) {
+				// const index  = item.index
+				const item = res[i]
+				const index = item.uuid ? this.files.findIndex(p => p.uuid === item.uuid) : item.index
+				if (index === -1 || !this.files) break
+				if (item.errMsg === 'request:fail') {
+					this.files[index].url = item.path
+					this.files[index].status = 'error'
+					this.files[index].errMsg = item.errMsg
+					// this.files[index].progress = -1
+					errorData.push(this.files[index])
+					errorTempFilePath.push(this.files[index].url)
+				} else {
+					this.files[index].errMsg = ''
+					this.files[index].url = item.url
+					this.files[index].status = 'success'
+					this.files[index].progress += 1
+					successData.push(this.files[index])
+					tempFilePath.push(this.files[index].url)
+				}
+			}
+
+			if (successData.length > 0) {
+				this.setEmit()
+				// 状态改变返回
+				this.$emit('success', {
+					tempFiles: this.backObject(successData),
+					tempFilePaths: tempFilePath
+				})
+			}
+
+			if (errorData.length > 0) {
+				this.$emit('fail', {
+					tempFiles: this.backObject(errorData),
+					tempFilePaths: errorTempFilePath
+				})
+			}
+		},
+
+		/**
+		 * 获取进度
+		 * @param {Object} progressEvent
+		 * @param {Object} index
+		 * @param {Object} type
+		 */
+		setProgress(progressEvent, index, type) {
+			const fileLenth = this.files.length
+			const percentNum = (index / fileLenth) * 100
+			const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
+			let idx = index
+			if (!type) {
+				idx = this.files.findIndex(p => p.uuid === progressEvent.tempFile.uuid)
+			}
+			if (idx === -1 || !this.files[idx]) return
+			// fix by mehaotian 100 就会消失,-1 是为了让进度条消失
+			this.files[idx].progress = percentCompleted - 1
+			// 上传中
+			this.$emit('progress', {
+				index: idx,
+				progress: parseInt(percentCompleted),
+				tempFile: this.files[idx]
+			})
+		},
+
+		/**
+		 * 删除
+		 * @param {Object} index
+		 */
+		delFile(index) {
+			this.$emit('delete', {
+				tempFile: this.files[index],
+				tempFilePath: this.files[index].url
+			})
+			this.files.splice(index, 1)
+			this.$nextTick(()=>{
+				this.setEmit()
+			})
+		},
+
+		/**
+		 * 获取文件名和后缀
+		 * @param {Object} name
+		 */
+		getFileExt(name) {
+			const last_len = name.lastIndexOf('.')
+			const len = name.length
+			return {
+				name: name.substring(0, last_len),
+				ext: name.substring(last_len + 1, len)
+			}
+		},
+
+		/**
+		 * 获取图片信息
+		 * @param {Object} filepath
+		 */
+		getFileInfo(filepath) {
+			return new Promise((resolve, reject) => {
+				uni.getImageInfo({
+					src: filepath,
+					success(res) {
+						resolve(res)
+					},
+					fail(err) {
+						reject(err)
+					}
+				})
+			})
+		},
+
+		/**
+		 * 获取封装数据
+		 */
+		async getFileData(files, type = 'image') {
+			// 最终需要上传数据库的数据
+			let fileFullName = this.getFileExt(files.name)
+			const extname = fileFullName.ext.toLowerCase()
+			let filedata = {
+				name: files.name,
+				uuid: files.uuid,
+				extname: extname || '',
+				cloudPath: files.cloudPath,
+				fileType: files.fileType,
+				url: files.path || files.path,
+				size: files.size, //单位是字节
+				image: {},
+				path: files.path,
+				video: {}
+			}
+			if (type === 'image') {
+				const imageinfo = await this.getFileInfo(files.path)
+				delete filedata.video
+				filedata.image.width = imageinfo.width
+				filedata.image.height = imageinfo.height
+				filedata.image.location = imageinfo.path
+			}else{
+				delete filedata.image
+			}
+			return filedata
+		},
+
+		/**
+		 * 批量上传
+		 */
+		uploadCloudFiles(files, max = 5, onUploadProgress) {
+			files = JSON.parse(JSON.stringify(files))
+			const len = files.length
+			let count = 0
+			let self = this
+			return new Promise(resolve => {
+				while (count < max) {
+					next()
+				}
+
+				function next() {
+					let cur = count++
+					if (cur >= len) {
+						!files.find(item => !item.url && !item.errMsg) && resolve(files)
+						return
+					}
+					const fileItem = files[cur]
+					const index = self.files.findIndex(v => v.uuid === fileItem.uuid)
+					fileItem.url = ''
+					delete fileItem.errMsg
+
+					uniCloud
+						.uploadFile({
+							filePath: fileItem.path,
+							cloudPath: fileItem.cloudPath,
+							fileType: fileItem.fileType,
+							onUploadProgress: res => {
+								res.index = index
+								onUploadProgress && onUploadProgress(res)
+							}
+						})
+						.then(res => {
+							fileItem.url = res.fileID
+							fileItem.index = index
+							if (cur < len) {
+								next()
+							}
+						})
+						.catch(res => {
+							fileItem.errMsg = res.errMsg || res.message
+							fileItem.index = index
+							if (cur < len) {
+								next()
+							}
+						})
+				}
+			})
+		},
+		setEmit() {
+			let data = []
+			if (this.returnType === 'object') {
+				data = this.backObject(this.files)[0]
+			} else {
+				data = this.backObject(this.files)
+			}
+			// #ifdef VUE3
+			this.$emit('update:modelValue',data)
+			// #endif
+			// #ifndef VUE3
+			this.$emit('input', data)
+			// #endif
+		},
+		backObject(files) {
+			let newFilesData = JSON.parse(JSON.stringify(files))
+			newFilesData.map(v => {
+				delete v.path
+				delete v.uuid
+				delete v.video
+				delete v.progress
+				delete v.errMsg
+				delete v.status
+				delete v.cloudPath
+				return v
+			})
+			return newFilesData
+		},
+		async getTempFileURL(file, fileList) {
+			fileList = {
+				fileList: [].concat(fileList)
+			}
+			const urls = await uniCloud.getTempFileURL(fileList)
+			file.path = urls.fileList[0].tempFileURL || ''
+			const index = this.files.findIndex(v => v.path === file.path)
+			if (index !== -1) {
+				this.$set(this.files, index, file)
+			}
+		}
+	}
+}
+</script>
+
+<style>
+.uni-file-picker {
+	/* #ifndef APP-NVUE */
+	box-sizing: border-box;
+	overflow: hidden;
+	/* #endif */
+}
+
+.uni-file-picker__header {
+	padding-top: 5px;
+	padding-bottom: 10px;
+	/* #ifndef APP-NVUE */
+	display: flex;
+	/* #endif */
+	justify-content: space-between;
+}
+
+.file-title {
+	font-size: 14px;
+	color: #333;
+}
+
+.file-count {
+	font-size: 14px;
+	color: #999;
+}
+
+.is-add {
+	/* #ifndef APP-NVUE */
+	display: flex;
+	/* #endif */
+	align-items: center;
+	justify-content: center;
+}
+
+.icon-add {
+	width: 50px;
+	height: 5px;
+	background-color: #f1f1f1;
+	border-radius: 2px;
+}
+
+.rotate {
+	position: absolute;
+	transform: rotate(90deg);
+}
+</style>

+ 324 - 0
uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue

@@ -0,0 +1,324 @@
+<template>
+	<view class="uni-file-picker__files">
+		<view v-if="!readonly" class="files-button" @click="choose">
+			<slot></slot>
+		</view>
+		<!-- :class="{'is-text-box':showType === 'list'}" -->
+		<view v-if="list.length > 0" class="uni-file-picker__lists is-text-box" :style="borderStyle">
+			<!-- ,'is-list-card':showType === 'list-card' -->
+
+			<view class="uni-file-picker__lists-box" v-for="(item ,index) in list" :key="index" :class="{
+				'files-border':index !== 0 && styles.dividline}"
+			 :style="index !== 0 && styles.dividline &&borderLineStyle">
+				<view class="uni-file-picker__item">
+					<!-- :class="{'is-text-image':showType === 'list'}" -->
+					<!-- 	<view class="files__image is-text-image">
+						<image class="header-image" :src="item.logo" mode="aspectFit"></image>
+					</view> -->
+					<view class="files__name">{{item.name}}</view>
+					<view v-if="delIcon&&!readonly" class="icon-del-box icon-files" @click="delFile(index)">
+						<view class="icon-del icon-files"></view>
+						<view class="icon-del rotate"></view>
+					</view>
+				</view>
+				<view v-if="(item.progress && item.progress !== 100) ||item.progress===0 " class="file-picker__progress">
+					<progress class="file-picker__progress-item" :percent="item.progress === -1?0:item.progress" stroke-width="4"
+					 :backgroundColor="item.errMsg?'#ff5a5f':'#EBEBEB'" />
+				</view>
+				<view v-if="item.status === 'error'" class="file-picker__mask" @click.stop="uploadFiles(item,index)">
+					点击重试
+				</view>
+			</view>
+
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: "uploadFile",
+		props: {
+			filesList: {
+				type: Array,
+				default () {
+					return []
+				}
+			},
+			delIcon: {
+				type: Boolean,
+				default: true
+			},
+			limit: {
+				type: [Number, String],
+				default: 9
+			},
+			showType: {
+				type: String,
+				default: ''
+			},
+			listStyles: {
+				type: Object,
+				default () {
+					return {
+						// 是否显示边框
+						border: true,
+						// 是否显示分隔线
+						dividline: true,
+						// 线条样式
+						borderStyle: {}
+					}
+				}
+			},
+			readonly:{
+				type:Boolean,
+				default:false
+			}
+		},
+		computed: {
+			list() {
+				let files = []
+				this.filesList.forEach(v => {
+					files.push(v)
+				})
+				return files
+			},
+			styles() {
+				let styles = {
+					border: true,
+					dividline: true,
+					'border-style': {}
+				}
+				return Object.assign(styles, this.listStyles)
+			},
+			borderStyle() {
+				let {
+					borderStyle,
+					border
+				} = this.styles
+				let obj = {}
+				if (!border) {
+					obj.border = 'none'
+				} else {
+					let width = (borderStyle && borderStyle.width) || 1
+					width = this.value2px(width)
+					let radius = (borderStyle && borderStyle.radius) || 5
+					radius = this.value2px(radius)
+					obj = {
+						'border-width': width,
+						'border-style': (borderStyle && borderStyle.style) || 'solid',
+						'border-color': (borderStyle && borderStyle.color) || '#eee',
+						'border-radius': radius
+					}
+				}
+				let classles = ''
+				for (let i in obj) {
+					classles += `${i}:${obj[i]};`
+				}
+				return classles
+			},
+			borderLineStyle() {
+				let obj = {}
+				let {
+					borderStyle
+				} = this.styles
+				if (borderStyle && borderStyle.color) {
+					obj['border-color'] = borderStyle.color
+				}
+				if (borderStyle && borderStyle.width) {
+					let width = borderStyle && borderStyle.width || 1
+					let style = borderStyle && borderStyle.style || 0
+					if (typeof width === 'number') {
+						width += 'px'
+					} else {
+						width = width.indexOf('px') ? width : width + 'px'
+					}
+					obj['border-width'] = width
+
+					if (typeof style === 'number') {
+						style += 'px'
+					} else {
+						style = style.indexOf('px') ? style : style + 'px'
+					}
+					obj['border-top-style'] = style
+				}
+				let classles = ''
+				for (let i in obj) {
+					classles += `${i}:${obj[i]};`
+				}
+				return classles
+			}
+		},
+
+		methods: {
+			uploadFiles(item, index) {
+				this.$emit("uploadFiles", {
+					item,
+					index
+				})
+			},
+			choose() {
+				this.$emit("choose")
+			},
+			delFile(index) {
+				this.$emit('delFile', index)
+			},
+			value2px(value) {
+				if (typeof value === 'number') {
+					value += 'px'
+				} else {
+					value = value.indexOf('px') !== -1 ? value : value + 'px'
+				}
+				return value
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.uni-file-picker__files {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		flex-direction: column;
+		justify-content: flex-start;
+	}
+
+	.files-button {
+		// border: 1px red solid;
+	}
+
+	.uni-file-picker__lists {
+		position: relative;
+		margin-top: 5px;
+		overflow: hidden;
+	}
+
+	.file-picker__mask {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		justify-content: center;
+		align-items: center;
+		position: absolute;
+		right: 0;
+		top: 0;
+		bottom: 0;
+		left: 0;
+		color: #fff;
+		font-size: 14px;
+		background-color: rgba(0, 0, 0, 0.4);
+	}
+
+	.uni-file-picker__lists-box {
+		position: relative;
+	}
+
+	.uni-file-picker__item {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		align-items: center;
+		padding: 8px 10px;
+		padding-right: 5px;
+		padding-left: 10px;
+	}
+
+	.files-border {
+		border-top: 1px #eee solid;
+	}
+
+	.files__name {
+		flex: 1;
+		font-size: 14px;
+		color: #666;
+		margin-right: 25px;
+		/* #ifndef APP-NVUE */
+		word-break: break-all;
+		word-wrap: break-word;
+		/* #endif */
+	}
+
+	.icon-files {
+		/* #ifndef APP-NVUE */
+		position: static;
+		background-color: initial;
+		/* #endif */
+	}
+
+	// .icon-files .icon-del {
+	// 	background-color: #333;
+	// 	width: 12px;
+	// 	height: 1px;
+	// }
+
+
+	.is-list-card {
+		border: 1px #eee solid;
+		margin-bottom: 5px;
+		border-radius: 5px;
+		box-shadow: 0 0 2px 0px rgba(0, 0, 0, 0.1);
+		padding: 5px;
+	}
+
+	.files__image {
+		width: 40px;
+		height: 40px;
+		margin-right: 10px;
+	}
+
+	.header-image {
+		width: 100%;
+		height: 100%;
+	}
+
+	.is-text-box {
+		border: 1px #eee solid;
+		border-radius: 5px;
+	}
+
+	.is-text-image {
+		width: 25px;
+		height: 25px;
+		margin-left: 5px;
+	}
+
+	.rotate {
+		position: absolute;
+		transform: rotate(90deg);
+	}
+
+	.icon-del-box {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		margin: auto 0;
+		/* #endif */
+		align-items: center;
+		justify-content: center;
+		position: absolute;
+		top: 0px;
+		bottom: 0;
+		right: 5px;
+		height: 26px;
+		width: 26px;
+		// border-radius: 50%;
+		// background-color: rgba(0, 0, 0, 0.5);
+		z-index: 2;
+		transform: rotate(-45deg);
+	}
+
+	.icon-del {
+		width: 15px;
+		height: 1px;
+		background-color: #333;
+		// border-radius: 1px;
+	}
+
+	/* #ifdef H5 */
+	@media all and (min-width: 768px) {
+		.uni-file-picker__files {
+			max-width: 375px;
+		}
+	}
+
+	/* #endif */
+</style>

+ 289 - 0
uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue

@@ -0,0 +1,289 @@
+<template>
+	<view class="uni-file-picker__container">
+		<view class="file-picker__box" v-for="(item,index) in filesList" :key="index" :style="boxStyle">
+			<view class="file-picker__box-content" :style="borderStyle">
+				<image class="file-image" :src="item.path" mode="aspectFill" @click.stop="prviewImage(item,index)"></image>
+				<view v-if="delIcon && !readonly" class="icon-del-box" @click.stop="delFile(index)">
+					<view class="icon-del"></view>
+					<view class="icon-del rotate"></view>
+				</view>
+				<view v-if="(item.progress && item.progress !== 100) ||item.progress===0 " class="file-picker__progress">
+					<progress class="file-picker__progress-item" :percent="item.progress === -1?0:item.progress" stroke-width="4"
+					 :backgroundColor="item.errMsg?'#ff5a5f':'#EBEBEB'" />
+				</view>
+				<view v-if="item.errMsg" class="file-picker__mask" @click.stop="uploadFiles(item,index)">
+					点击重试
+				</view>
+			</view>
+		</view>
+		<view v-if="filesList.length < limit && !readonly" class="file-picker__box" :style="boxStyle">
+			<view class="file-picker__box-content is-add" :style="borderStyle" @click="choose">
+				<slot>
+					<view class="icon-add"></view>
+					<view class="icon-add rotate"></view>
+				</slot>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: "uploadImage",
+		props: {
+			filesList: {
+				type: Array,
+				default () {
+					return []
+				}
+			},
+			disabled:{
+				type: Boolean,
+				default: false
+			},
+			disablePreview: {
+				type: Boolean,
+				default: false
+			},
+			limit: {
+				type: [Number, String],
+				default: 9
+			},
+			imageStyles: {
+				type: Object,
+				default () {
+					return {
+						width: 'auto',
+						height: 'auto',
+						border: {}
+					}
+				}
+			},
+			delIcon: {
+				type: Boolean,
+				default: true
+			},
+			readonly:{
+				type:Boolean,
+				default:false
+			}
+		},
+		computed: {
+			styles() {
+				let styles = {
+					width: 'auto',
+					height: 'auto',
+					border: {}
+				}
+				return Object.assign(styles, this.imageStyles)
+			},
+			boxStyle() {
+				const {
+					width = 'auto',
+						height = 'auto'
+				} = this.styles
+				let obj = {}
+				if (height === 'auto') {
+					if (width !== 'auto') {
+						obj.height = this.value2px(width)
+						obj['padding-top'] = 0
+					} else {
+						obj.height = 0
+					}
+				} else {
+					obj.height = this.value2px(height)
+					obj['padding-top'] = 0
+				}
+
+				if (width === 'auto') {
+					if (height !== 'auto') {
+						obj.width = this.value2px(height)
+					} else {
+						obj.width = '33.3%'
+					}
+				} else {
+					obj.width = this.value2px(width)
+				}
+
+				let classles = ''
+				for(let i in obj){
+					classles+= `${i}:${obj[i]};`
+				}
+				return classles
+			},
+			borderStyle() {
+				let {
+					border
+				} = this.styles
+				let obj = {}
+				if (typeof border === 'boolean') {
+					obj.border = border ? '1px #eee solid' : 'none'
+				} else {
+					let width = (border && border.width) || 1
+					width = this.value2px(width)
+					let radius = (border && border.radius) || 5
+					radius = this.value2px(radius)
+					obj = {
+						'border-width': width,
+						'border-style': (border && border.style) || 'solid',
+						'border-color': (border && border.color) || '#eee',
+						'border-radius': radius
+					}
+				}
+				let classles = ''
+				for(let i in obj){
+					classles+= `${i}:${obj[i]};`
+				}
+				return classles
+			}
+		},
+		methods: {
+			uploadFiles(item, index) {
+				this.$emit("uploadFiles", item)
+			},
+			choose() {
+				this.$emit("choose")
+			},
+			delFile(index) {
+				this.$emit('delFile', index)
+			},
+			prviewImage(img, index) {
+				let urls = []
+				if(Number(this.limit) === 1&&this.disablePreview&&!this.disabled){
+					this.$emit("choose")
+				}
+				if(this.disablePreview) return
+				this.filesList.forEach(i => {
+					urls.push(i.path)
+				})
+
+				uni.previewImage({
+					urls: urls,
+					current: index
+				});
+			},
+			value2px(value) {
+				if (typeof value === 'number') {
+					value += 'px'
+				} else {
+					if (value.indexOf('%') === -1) {
+						value = value.indexOf('px') !== -1 ? value : value + 'px'
+					}
+				}
+				return value
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.uni-file-picker__container {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		box-sizing: border-box;
+		/* #endif */
+		flex-wrap: wrap;
+		margin: -5px;
+	}
+
+	.file-picker__box {
+		position: relative;
+		// flex: 0 0 33.3%;
+		width: 33.3%;
+		height: 0;
+		padding-top: 33.33%;
+		/* #ifndef APP-NVUE */
+		box-sizing: border-box;
+		/* #endif */
+	}
+
+	.file-picker__box-content {
+		position: absolute;
+		top: 0;
+		right: 0;
+		bottom: 0;
+		left: 0;
+		margin: 5px;
+		border: 1px #eee solid;
+		border-radius: 8px;
+		overflow: hidden;
+	}
+
+	.file-picker__progress {
+		position: absolute;
+		bottom: 0;
+		left: 0;
+		right: 0;
+		/* border: 1px red solid; */
+		z-index: 2;
+	}
+
+	.file-picker__progress-item {
+		width: 100%;
+	}
+
+	.file-picker__mask {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		justify-content: center;
+		align-items: center;
+		position: absolute;
+		right: 0;
+		top: 0;
+		bottom: 0;
+		left: 0;
+		color: #fff;
+		font-size: 12px;
+		background-color: rgba(0, 0, 0, 0.4);
+	}
+
+	.file-image {
+		width: 100%;
+		height: 100%;
+	}
+
+	.is-add {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		align-items: center;
+		justify-content: center;
+	}
+
+	.icon-add {
+		width: 50px;
+		height: 5px;
+		background-color: #f1f1f1;
+		border-radius: 2px;
+	}
+
+	.rotate {
+		position: absolute;
+		transform: rotate(90deg);
+	}
+
+	.icon-del-box {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+		align-items: center;
+		justify-content: center;
+		position: absolute;
+		top: 5px;
+		right: 5px;
+		height: 26px;
+		width: 26px;
+		border-radius: 50%;
+		background-color: rgba(0, 0, 0, 0.5);
+		z-index: 2;
+		transform: rotate(-45deg);
+	}
+
+	.icon-del {
+		width: 15px;
+		height: 2px;
+		background-color: #fff;
+		border-radius: 2px;
+	}
+</style>

+ 82 - 0
uni_modules/uni-file-picker/package.json

@@ -0,0 +1,82 @@
+{
+  "id": "uni-file-picker",
+  "displayName": "uni-file-picker 文件选择上传",
+  "version": "0.2.2",
+  "description": "文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间",
+  "keywords": [
+    "uni-ui",
+    "uniui",
+    "图片上传",
+    "文件上传"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": ""
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+  "dcloudext": {
+    "category": [
+      "前端组件",
+      "通用组件"
+    ],
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "n"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        }
+      }
+    }
+  }
+}

+ 301 - 0
uni_modules/uni-file-picker/readme.md

@@ -0,0 +1,301 @@
+
+## FilePicker 文件选择上传
+
+> **组件名:uni-file-picker**
+>  代码块: `uFilePicker`
+
+
+文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间
+
+> **注意事项**
+> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。
+> - 组件需要依赖 `sass` 插件 ,请自行手动安装
+> - 如不绑定服务空间,`autoUpload`默认为`false`且不可更改
+> - 选择文件目前只支持 `H5` 和 `微信小程序平台` ,且 `微信小程序平台` 使用 `wx.chooseMessageFile()`
+> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
+
+
+
+## API
+
+### FilePicker Props
+
+| 属性名					| 类型			| 默认值	| 可选值								| 说明																	|
+| :-:						| :-:			| :-:		| :-:									| :-:																	|
+| v-model/value	| Array\Object	| -			| -						| 组件数据,通常用来回显 ,类型由`return-type`属性决定	,**格式见下文**	|
+| disabled			| Boolean	| false	| -										| 组件禁用								|
+| readonly			| Boolean	| false	| -										| 组件只读,不可选择,不显示进度,不显示删除按钮								|
+| return-type		| String	| array	| array/object				| 限制 `value` 格式,当为 `object`	 时	,组件只能单选,且会覆盖	|
+| disable-preview| Boolean	| false	| -									| 禁用图片预览,仅	`mode:grid`生效	|
+| del-icon			| Boolean	| true	| -										| 是否显示删除按钮	|
+| auto-upload		| Boolean	| true	| -										| 是否自动上传,值为`true`则只触发@select,可自行上传|
+| limit					| Number\String	| 9	| -									| 最大选择个数 ,h5 会自动忽略多选的部分			|
+| title					| String	| -			| -										| 组件标题,右侧显示上传计数			|
+| mode					| String	| list	| list/grid						| 选择文件后的文件列表样式								|
+| file-mediatype| String	| image	| image/video/all			| 选择文件类型,all 只支持 H5 和微信小程序平台	|
+| file-extname	| Array\String		| -			| -						| 选择文件后缀,字符串的情况下需要用逗号分隔(推荐使用字符串),根据 `file-mediatype` 属性而不同|
+| list-styles	  | Object	| -			| -										| `mode:list` 时的样式			|
+| image-styles	| Object	| -			| -										| `mode:grid` 时的样式	|
+
+
+### value 格式 
+
+三个属性必填,否则影响组件显示
+
+```json 
+[
+	{
+		"name":"file.txt",
+		"extname":"txt",
+		"url":"https://xxxx",
+		// ...
+	}
+]
+
+```
+
+### list-styles 格式 
+
+```json 
+{
+	"borderStyle":{
+		"color":"#eee",		// 边框颜色
+		"width":"1px",		// 边框宽度
+		"style":"solid", 	// 边框样式
+		"radius":"5px" 		// 边框圆角,不支持百分比
+	},
+	"border":false, // 是否显示边框
+	"dividline":true // 是否显示分隔线
+}
+```
+
+### image-styles 格式 
+
+```json 
+{
+	"height": 60,	// 边框高度
+	"width": 60,	// 边框宽度
+	"border":{ // 如果为 Boolean 值,可以控制边框显示与否
+		"color":"#eee",		// 边框颜色
+		"width":"1px",		// 边框宽度
+		"style":"solid", 	// 边框样式
+		"radius":"50%" 		// 边框圆角,支持百分比
+	}
+}
+```
+
+### FilePicker Events
+
+|事件称名		|说明							|	返回值	|					
+|:-:			|:-:							|	:-:	|
+|@select	| 选择文件后触发 		| 见下文|
+|@progress|文件上传时触发			| 见下文|
+|@success	|上传成功触发				| 见下文|
+|@fail		|上传失败触发				| 见下文|
+|@delete	|文件从列表移除时触发| 见下文|
+
+
+#### Callback Params
+
+```json
+{
+	"progress"			: Number, 		// 上传进度 ,仅 @progress 事件包含此字段
+	"index"				: Number, 		// 上传文件索引 ,仅 @progress 事件包含此字段
+	"tempFile"			: file, 		// 当前文件对象 ,包含文件流,文件大小,文件名称等,仅 @progress 事件包含此字段
+	"tempFiles"			: files, 		// 文件列表,包含文件流,文件大小,文件名称等
+	"tempFilePaths"		: filePaths, 	// 文件地址列表,@sucess 事件为上传后的线上文件地址
+}
+
+```
+
+
+### FilePicker Methods
+
+通过 `$ref` 调用
+
+| 方法称名						| 说明			|		参数 		|				
+| :-:								| :-:		  |		:-:		  |				
+| upload						| 手动上传 	,如`autoUpload`为`false`  ,必须调用此方法| - |
+
+### FilePicker Slots
+
+插槽可定义上传按钮显示样式 
+
+|	插槽名 	| 说明 |
+| :-:			| :-:		  |
+|	default	|默认插槽|
+
+## 组件用法
+
+### 基础用法
+
+```html
+<uni-file-picker 
+	v-model="imageValue" 
+	fileMediatype="image" 
+	mode="grid" 
+	@select="select" 
+	@progress="progress" 
+	@success="success" 
+	@fail="fail" 
+/>
+```
+
+```javascript
+export default {
+		data() {
+			return {
+				imageValue:[]
+			}
+		},
+		methods:{
+			// 获取上传状态
+			select(e){
+				console.log('选择文件:',e)
+			}
+			// 获取上传进度
+			progress(e){
+				console.log('上传进度:',e)
+			},
+			
+			// 上传成功
+			success(e){
+				console.log('上传成功')
+			},
+			
+			// 上传失败
+			fail(e){
+				console.log('上传失败:',e)
+			}
+		}
+}
+
+```
+
+### 选择指定后缀图片,且限制选择个数
+
+配置 `file-mediatype` 属性为 `image`,限定只选择图片
+
+配置 `file-extname` 属性为 `'png,jpg'`,限定只选择 `png`和`jpg`后缀的图片
+
+配置 `limit` 属性为 1 ,则最多选择一张图片
+
+配置 `mode` 属性为 `grid` ,可以使用九宫格样式选择图片
+
+
+```html
+<uni-file-picker 
+	v-model="imageValue"  
+	file-mediatype="image"
+	mode="grid"
+	file-extname="png,jpg"
+	:limit="1"
+	@progress="progress" 
+	@success="success" 
+	@fail="fail" 
+	@select="select"
+/>
+```
+
+### 手动上传
+
+配置 `auto-upload` 属性为 `false` ,可以停止自动上传,通过`ref`调用`upload`方法自行选择上传时机
+
+```html
+<view>
+	<uni-file-picker  ref="files" :auto-upload="false"/>
+	<button @click="upload">上传文件</button>
+</view>
+```
+
+```javascript
+export default {
+		data() {},
+		methods:{
+			upload(){
+				this.$refs.files.upload()
+			}
+		}
+}
+
+```
+
+### 单选图片且点击再次选择
+
+配置 `disable-preview` 属性为 `true`,禁用点击预览图片功能
+
+配置 `del-icon` 属性为 `false`,隐藏删除按钮
+
+配置 `return-type` 属性为 `object`,设置 `value` 类型 ,如需绑定 `array`类型 ,则设置`limit:1`,可达到一样的效果
+
+
+
+```html
+<uni-file-picker 
+	disable-preview
+	:del-icon="false"
+	return-type="object"
+>选择头像</uni-file-picker>
+```
+
+### 自定义样式
+
+配置 `image-styles` 属性,可以自定义`mode:image`时的回显样式
+
+配置 `list-styles` 属性,可以自定义`mode:video|| mode:all`时的回显样式
+
+```html
+<view>
+	<uni-file-picker fileMediatype="image" :image-styles="imageStyles"/>
+	<uni-file-picker fileMediatype="all" :list-styles="listStyles"/>
+</view>
+```
+
+```javascript
+export default {
+		data() {
+			imageStyles:{
+				width:64,
+				height:64,
+				border:{
+					color:"#ff5a5f",
+					width:2,
+					style:'dashed',
+					radius:'2px'
+				}
+			},
+			listStyles:{
+				// 是否显示边框
+				border: true,
+				// 是否显示分隔线
+				dividline: true,
+				// 线条样式
+				borderStyle: {
+					width:1,
+					color:'blue',
+					radius:2
+				}
+			}
+		}
+}
+
+```
+
+
+
+### 使用插槽 
+
+使用默认插槽可以自定义选择文件按钮样式
+
+```html
+<uni-file-picker 
+	v-model="value" file-mediatype="all">
+	<button>选择文件</button>
+</uni-file-picker>
+```
+
+
+
+## 组件示例
+
+点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/file-picker/file-picker](https://hellouniapp.dcloud.net.cn/pages/extUI/file-picker/file-picker)