Ver código fonte

前端小程序sdy

zhongtianhaoyuan 3 anos atrás
pai
commit
b7a73673a1

+ 151 - 34
pageD/identity/companyIdentity.vue

@@ -13,6 +13,9 @@
 		<view v-if="consentStatus == true">
 			<view>
 				<button type="default" @click="license">上传营业执照</button>
+				<view style="width: 100px;margin: 0 auto;" v-if="license1 != ''">
+					<image v-bind:src = "license1" style="width: 100px;height: 100px;"></image>
+				</view>
 			</view>
 			<view class="c-row b-b">
 				<text class="tit">公司名称</text>
@@ -28,8 +31,14 @@
 				</view>
 			</view>
 			<view>
-				<button type="default">上传身份证正面</button>
-				<button type="default">上传身份证反面</button>
+				<button type="default" @click="idUp">上传身份证正面</button>
+				<view style="width: 100px;margin: 0 auto;" v-if="id1 != ''">
+					<image v-bind:src = "id1" style="width: 100px;height: 100px;"></image>
+				</view>
+				<button type="default" @click="idLow">上传身份证反面</button>
+				<view style="width: 100px;margin: 0 auto;" v-if="id2 != ''">
+					<image v-bind:src = "id2" style="width: 100px;height: 100px;"></image>
+				</view>
 			</view>
 			<view class="c-row b-b">
 				<text class="tit">姓名</text>
@@ -45,8 +54,14 @@
 				</view>
 			</view>
 			<view>
-				<button type="default">上传银行卡正面</button>
-				<button type="default">上传银行卡反面</button>
+				<button type="default" @click="bankUp()">上传银行卡正面</button>
+				<view style="width: 100px;margin: 0 auto;" v-if="bank1 != ''">
+					<image v-bind:src = "bank1" style="width: 100px;height: 100px;"></image>
+				</view>
+				<button type="default" @click="bankLow()">上传银行卡反面</button>
+				<view style="width: 100px;margin: 0 auto;" v-if="bank2 != ''">
+					<image v-bind:src = "bank2" style="width: 100px;height: 100px;"></image>
+				</view>
 			</view>
 			<view class="c-row b-b">
 				<text class="tit">银行卡号</text>
@@ -89,8 +104,14 @@
 		</view>
 		<view v-else>
 			<view>
-				<button type="default">上传身份证正面</button>
-				<button type="default">上传身份证反面</button>
+				<button type="default" @click="idUp">上传身份证正面</button>
+				<view style="width: 100px;margin: 0 auto;" v-if="id1 != ''">
+					<image v-bind:src = "id1" style="width: 100px;height: 100px;"></image>
+				</view>
+				<button type="default" @click="idLow">上传身份证反面</button>
+				<view style="width: 100px;margin: 0 auto;" v-if="id2 != ''">
+					<image v-bind:src = "id2" style="width: 100px;height: 100px;"></image>
+				</view>
 			</view>
 			<view class="c-row b-b">
 				<text class="tit">姓名</text>
@@ -106,8 +127,14 @@
 				</view>
 			</view>
 			<view>
-				<button type="default">上传银行卡正面</button>
-				<button type="default">上传银行卡反面</button>
+				<button type="default" @click="bankUp()">上传银行卡正面</button>
+				<view style="width: 100px;margin: 0 auto;" v-if="bank1 != ''">
+					<image v-bind:src = "bank1" style="width: 100px;height: 100px;"></image>
+				</view>
+				<button type="default" @click="bankLow()">上传银行卡反面</button>
+				<view style="width: 100px;margin: 0 auto;" v-if="bank2 != ''">
+					<image v-bind:src = "bank2" style="width: 100px;height: 100px;"></image>
+				</view>
 			</view>
 			<view class="c-row b-b">
 				<text class="tit">银行卡号</text>
@@ -170,10 +197,14 @@
 </template>
 
 <script>
+	import {
+	    mapState 
+	} from 'vuex';
 	export default {
 		name: "buy",
 		data() {
 			return {
+				tupian:"",
 				inputContent: null,
 				customerPhone: '',
 				consentStatus: true,
@@ -184,6 +215,13 @@
 				sendText: '获取验证码',
 				platform: '',
 				sendDisabled: false,
+				id:[],
+				id1:"",
+				id2:"",
+				license1:"",
+				bank1:"",
+				bank2:"",
+				bankid:[],
 
 				identityAuthenticationInfo: {
 					customerPhone: '',
@@ -192,13 +230,16 @@
 				tempFilePaths: [],
 				businessLicenseAddressUrl:"",
 
-				userInfo:{
-					phone: ''
-				},
+				// userInfo:{
+				// 	phone: ''
+				// },
 				identityAuthenticationInfo: {},
 			};
 
 		},
+		computed: {
+			...mapState(['hasLogin','userInfo'])
+		},
 		methods: {
 			consent() {
 				if (this.consentStatus == false && this.consentStatus1 == true) {
@@ -211,6 +252,61 @@
 			},
 
 			license() {
+				var that = this
+				wx.chooseImage({
+					success: function(res) {
+						wx.uploadFile({
+							url: 'https://www.zthymaoyi.com/upload/admin',
+							filePath: res.tempFilePaths[0],
+							name: 'file',
+							success(res) {
+								var data = res.data
+								var strToObj = JSON.parse(data)			
+								that.identityAuthenticationInfo.businessLicenseAddressUrl = strToObj.url
+								that.license1 = strToObj.url
+							}
+						})
+					}
+				})
+			},
+			idUp(){
+				var that = this
+				wx.chooseImage({
+					success: function(res) {
+						wx.uploadFile({
+							url: 'https://www.zthymaoyi.com/upload/admin',
+							filePath: res.tempFilePaths[0],
+							name: 'file',
+							success(res) {
+								var data = res.data
+								var strToObj = JSON.parse(data)			
+								that.id[0] = strToObj.url
+								that.id1 = strToObj.url
+							}
+						})
+					}
+				})
+			},
+			idLow(){
+				var that = this
+				wx.chooseImage({
+					success: function(res) {
+						wx.uploadFile({
+							url: 'https://www.zthymaoyi.com/upload/admin',
+							filePath: res.tempFilePaths[0],
+							name: 'file',
+							success(res) {
+								var data = res.data
+								var strToObj = JSON.parse(data)			
+								that.id[1] = strToObj.url
+								that.id2 = strToObj.url
+							}
+						})
+					}
+				})
+			},
+			bankUp(){
+				var that = this
 				wx.chooseImage({
 					success: function(res) {
 						wx.uploadFile({
@@ -218,16 +314,54 @@
 							filePath: res.tempFilePaths[0],
 							name: 'file',
 							success(res) {
-								const data = res.data
-								const strToObj = JSON.parse(data)
-								
-								this.businessLicenseAddressUrl = strToObj.url
-								console.log(this.businessLicenseAddressUrl)
+								var data = res.data
+								var strToObj = JSON.parse(data)			
+								that.bankid[0] = strToObj.url
+								that.bank1 = strToObj.url
 							}
 						})
 					}
 				})
 			},
+			bankLow(){
+				var that = this
+				wx.chooseImage({
+					success: function(res) {
+						wx.uploadFile({
+							url: 'https://www.zthymaoyi.com/upload/admin',
+							filePath: res.tempFilePaths[0],
+							name: 'file',
+							success(res) {
+								var data = res.data
+								var strToObj = JSON.parse(data)			
+								that.bankid[1] = strToObj.url
+								that.bank2 = strToObj.url
+							}
+						})
+					}
+				})
+			},
+			commit() {
+				this.identityAuthenticationInfo.commonId = this.userInfo.id
+				this.identityAuthenticationInfo.cardAddressUrl = this.id.toString()
+				this.identityAuthenticationInfo.payeeAddressUrl = this.bankid.toString()
+				if(this.consentStatus1 == true){
+					this.identityAuthenticationInfo.customerTypeFlag = "个人"
+				}else if(this.consentStatus == true){
+					this.identityAuthenticationInfo.customerTypeFlag = "企业"
+				}
+				this.$api.doRequest('post', '/identityAuthenticationInfo/api/addIdentityAuthenticationInfo', this
+						.identityAuthenticationInfo)
+					.then(res => {
+						console.log(12545645)
+					}).catch(res => {
+						uni.showToast({
+							title: res.data.message,
+							icon: 'none',
+							duration: 2000
+						})
+					})
+			},
 
 			getcode() {
 				var that = this
@@ -283,24 +417,7 @@
 				this.inputStatus = 'none'
 				this.isPhone = false
 			},
-			commit() {
-				this.identityAuthenticationInfo.businessLicenseAddressUrl = 111
-				console.log(this.businessLicenseAddressUrl,"好了")
-				console.log(this.identityAuthenticationInfo.businessLicenseAddressUrl,"好了吗")
-				console.log(this.identityAuthenticationInfo,"对象")
-				return
-				this.$api.doRequest('post', '/identityAuthenticationInfo/api/addIdentityAuthenticationInfo', this
-						.identityAuthenticationInfo)
-					.then(res => {
-						console.log(12545645)
-					}).catch(res => {
-						uni.showToast({
-							title: res.data.message,
-							icon: 'none',
-							duration: 2000
-						})
-					})
-			},
+			
 		},
 	}
 </script>

+ 1 - 1
pageD/identity/companyIdentityLook.vue

@@ -169,7 +169,7 @@
 		methods: {
 			getList() {
 				
-				this.$api.doRequest('get', '/identityAuthenticationInfo/api/getIdentityAuthenticationInfo', {id:this.id}, 'application/json;').then(res => {
+				this.$api.doRequest('get', '/identityAuthenticationInfo/getInfo', {id:this.id}, 'application/json;charset=UTF-8').then(res => {
 						console.log("成功连接")
 						this.procurementPlanInfos = res.data.data
 					})

+ 122 - 7
pageD/identity/driverIdentity.vue

@@ -2,8 +2,16 @@
 	<view class="center">
 		<view>
 			<view class="labels">司机信息</view>
-			<button type="default">身份证正面</button>
-			<button type="default">身份证反面</button>
+			<view>
+				<button type="default" @click="idUp">上传身份证正面</button>
+				<view style="width: 100px;margin: 0 auto;" v-if="id1 != ''">
+					<image v-bind:src = "id1" style="width: 100px;height: 100px;"></image>
+				</view>
+				<button type="default" @click="idLow">上传身份证反面</button>
+				<view style="width: 100px;margin: 0 auto;" v-if="id2 != ''">
+					<image v-bind:src = "id2" style="width: 100px;height: 100px;"></image>
+				</view>
+			</view>
 			<view class="c-row b-b">
 				<text class="tit">姓名</text>
 				<view class="con-list">
@@ -22,11 +30,13 @@
 					<input placeholder="请填写手机号" name="input" @input="addressInput"></input>
 				</view>
 			</view>
-			<view class="c-row b-b">
-				<text class="tit"><button type="default">获取验证码</button></text>
-				<view class="con-list">
-					<input placeholder="请填写验证码" name="input" @input="addressInput"></input>
+			<view style='width:100%;border-bottom:1px solid #E8E9ED;position:relative;padding:10px;' class="flex">
+				<button :class='codestatus&&!sendDisabled?"active":""' @click='getcode'
+					class='getcode'>{{sendText}}</button>
+				<view style='width:70%;position:relative;margin-left: 200px;'>
+					<input v-model='verifyCode' placeholder="请输入验证码" type="text">
 				</view>
+			
 			</view>
 			<view class="c-row b-b">
 				<text class="tit">常驻城市</text>
@@ -151,6 +161,13 @@
 				ModelType:["高栏","集装箱","自卸车"],
 				carLong:'',
 				carLongType:['13','9.6','8.2','8.7','11.7','12.5','13.7','15','16','17.5'],
+				id:[],
+				id1:"",
+				id2:"",
+				// bank1:"",
+				// bank2:"",
+				// bankid:[],
+				sendText: '获取验证码',
 
 			}
 		},
@@ -162,7 +179,84 @@
 			carLongChange(e){
 				this.carLongIndex = e.detail.value
 				this.carLong = this.carLongType[this.carLongIndex];
-			}
+			},
+			idUp(){
+				var that = this
+				wx.chooseImage({
+					success: function(res) {
+						wx.uploadFile({
+							url: 'https://www.zthymaoyi.com/upload/admin',
+							filePath: res.tempFilePaths[0],
+							name: 'file',
+							success(res) {
+								var data = res.data
+								var strToObj = JSON.parse(data)			
+								that.id[0] = strToObj.url
+								that.id1 = strToObj.url
+							}
+						})
+					}
+				})
+			},
+			idLow(){
+				var that = this
+				wx.chooseImage({
+					success: function(res) {
+						wx.uploadFile({
+							url: 'https://www.zthymaoyi.com/upload/admin',
+							filePath: res.tempFilePaths[0],
+							name: 'file',
+							success(res) {
+								var data = res.data
+								var strToObj = JSON.parse(data)			
+								that.id[1] = strToObj.url
+								that.id2 = strToObj.url
+							}
+						})
+					}
+				})
+			},
+			getcode() {
+				var that = this
+				if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.identityAuthenticationInfo.customerPhone)) {
+					this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
+							phone: this.identityAuthenticationInfo.customerPhone
+						}).then(res => {
+							if (res.data.code == 200) {
+								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)
+							} else {
+								uni.showToast({
+									title: res.data.message,
+									icon: 'none',
+									duration: 2000
+								})
+							}
+						})
+						.catch(res => {
+							uni.showToast({
+								title: res.data.message,
+								icon: 'none',
+								duration: 2000
+							})
+						});
+				} else {
+					uni.showToast({
+						title: '请输入正确的手机号',
+						icon: 'none',
+						duration: 2000
+					})
+				}
+			},
 		}
 	}
 </script>
@@ -202,5 +296,26 @@
 		    padding-right: 20rpx;
 			font-size: 14px;
 		}
+		.getcode {
+			font-size: 14px;
+			position: absolute;
+			top: 50%;
+			transform: translateY(-50%);
+			color: #AFB3BF;
+			background: #F5F6F9;
+			height: 30px;
+			line-height: 30px;
+		}
+		.getcode.active {
+			border: none;
+		}
+		.uni-navigator{
+			display:inline-block;
+			color:#22C572;
+		}
+		.getcode.active {
+			background: #22C572;
+			color: #fff;
+		}
 
 </style>

+ 1 - 0
pageD/myRelease/buyGrain.vue

@@ -317,6 +317,7 @@
 					return
 				}
 		         this.insertProcurementPlanInfo.commonId = this.userInfo.id
+				 this.insertProcurementPlanInfo.compId = "2710b21efc1e4393930c5dc800010dc4"
 				this.$api.doRequest('post', '/procurementPlanInfo/api/insertProcurementPlanInfo', this
 						.insertProcurementPlanInfo).then(res => {
 						console.log("添加成功")

+ 2 - 3
pages/release/release.vue

@@ -133,9 +133,8 @@
 				})
 			},
 			getList(){
-				
-				this.$api.doRequest('get','/procurementPlanInfo/selectProcurementPlanInfo',this.procurementPlanInfo).then(res => {
-					
+				// this.procurementPlanInfo.pcFlag = "1"
+				this.$api.doRequest('get','/procurementPlanInfo/selectProcurementPlanInfo',this.procurementPlanInfo).then(res => {		
 					this.procurementPlanInfos = res.data.data.records
 					console.log(this.procurementPlanInfos,"对象")