achao hace 3 años
padre
commit
726ff6a7f4
Se han modificado 3 ficheros con 46 adiciones y 16 borrados
  1. 2 2
      config/index.js
  2. 38 8
      pages/mine/company/addcompany.vue
  3. 6 6
      pages/mine/company/companyvideo.nvue

+ 2 - 2
config/index.js

@@ -1,6 +1,6 @@
 const dev = {
-	// baseUrlNew: 'https://apitest.eliangeyun.com',
-	baseUrlNew: 'http://192.168.1.114:8099',
+	baseUrlNew: 'https://apitest.eliangeyun.com',
+	// baseUrlNew: 'http://192.168.1.114:8099',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false
 }

+ 38 - 8
pages/mine/company/addcompany.vue

@@ -127,11 +127,12 @@
 		</view>
 		<view class='content3' v-if="dataDetails.videoAddressUrl">
 			<view class="left-text">视频验证(点击按钮播放视频)</view>
-			<view>
+			<video class="myVideo" :src="dataDetails.videoAddressUrl" controls></video>
+		<!-- 	<view>
 				<view class="video-icon">
 					<u-icon size="40" name="play-circle-fill" @click="isSshowPlayVideo=true"></u-icon>
 				</view>
-			</view>
+			</view> -->
 		</view>
 
 		<view class="content4">
@@ -180,7 +181,6 @@
 			return {
 				isSshowPlayVideo: false,
 				srcHandler() {
-					// 
 					return `/hybrid/html/play.html?src=${this.dataDetails.videoAddressUrl}`
 				},
 				consentStatus: false,
@@ -212,7 +212,8 @@
 					propertyAddressUrl: '',
 					advanceFreightService: 1,
 					landOwnership: '自有',
-					videoAddressUrl: null
+					videoAddressUrl: null,
+					legalPersonName:''
 
 				}
 			}
@@ -224,12 +225,34 @@
 			this.dataDetails.phone = this.userInfo.phone
 			console.log('```````````````')
 			console.log(options)
+			if(uni.getStorageSync('companydata')){
+				this.dataDetails = uni.getStorageSync('companydata')
+			}
 			this.dataDetails.videoAddressUrl = options.videoSrc
+			this.getName()
 		},
 		computed: {
 			...mapState(['hasLogin', 'userInfo']),
 		},
 		methods: {
+			getName(){
+				let that = this
+				this.$request.baseRequest('get', '/cargoOwnerInfo/selectCargoOwner', {
+						commonId: this.userInfo.id
+					}).then(res => {
+						if (res.code==200) {debugger
+							that.dataDetails.legalPersonName = res.data.name
+						}
+					})
+					.catch(res => {
+						uni.hideLoading()
+						uni.showToast({
+							title: res.message,
+							icon: 'none',
+							duration: 2000
+						})
+					});
+			},
 			loadedmetadata(event) {
 				console.log(event)
 			},
@@ -250,6 +273,13 @@
 					})
 					return true
 				}
+				if (this.dataDetails.companyName.length<4||this.dataDetails.companyName.length<25) {
+					this.$refs.uToast.show({
+						type: 'error',
+						message: "企业名称字数在4-25个字!",
+					})
+					return true
+				}
 				if (uni.$u.test.isEmpty(this.dataDetails.legalPersonName)) {
 					this.$refs.uToast.show({
 						type: 'error',
@@ -439,10 +469,7 @@
 				// this.index = index
 			},
 			goDetailPage(src) {
-				uni.setStorage({
-					key: 'companydata',
-					data: JSON.stringify(this.dataDetails)
-				});
+				uni.setStorageSync('companydata', this.dataDetails);
 				uni.$u.route(src);
 			},
 			selectValidityPeriod(type) {
@@ -673,4 +700,7 @@
 		align-items: center;
 		color: #6A7282;
 	}
+	.myVideo{
+		
+	}
 </style>

+ 6 - 6
pages/mine/company/companyvideo.nvue

@@ -16,11 +16,9 @@
 				</view>
 			</view>
 			<view class="btn-view"  :style="{width:width}">
-				<view v-if='!isSaveVideo'>
 					<u-button @click="startVideoCapture" class="btn" v-if='!isAlreadyRecord' type="primary" text="开始录像"></u-button>
 					<u-button @click="stopVideoCapture" class="btn" v-if='isAlreadyRecord' text="停止录像" type="primary"></u-button>
-				</view>
-				<u-button @click="saveVideo" class="btn" v-if='isSaveVideo' type="primary" text="保存视频"></u-button>
+				<!-- <u-button @click="saveVideo" class="btn" v-if='isSaveVideo' type="primary" text="保存视频"></u-button> -->
 				<u-button @click="switchCamera" class="btn" type="primary" text="切换摄像头"></u-button>
 				<!-- <button @click="setZoomFactor" class="btn" type="primary">
 				    设置焦距
@@ -174,7 +172,7 @@
 						"savePath": plus.io.convertLocalFileSystemURL("_doc/KJ-Camera"), //保存视频位置,一定要是_doc绝对路径
 						"isAddAudio": true, //是否添加音频,默认是true
 						"videoEncoder": 2, //andorid有效,DEFAULT = 0;H263 = 1;H264 = 2;MPEG_4_SP = 3;VP8 = 4;HEVC = 5;
-						"audioEncoder": 0, //andorid有效,DEFAULT = 0;AMR_NB = 1;AMR_WB = 2;AAC = 3;HE_AAC = 4;AAC_ELD = 5;VORBIS = 6;
+						"audioEncoder": 3, //andorid有效,DEFAULT = 0;AMR_NB = 1;AMR_WB = 2;AAC = 3;HE_AAC = 4;AAC_ELD = 5;VORBIS = 6;
 					}
 					this.$refs.Camera.startVideoCapture(dic, (res) => {
 						console.log("startVideoCapture: " + JSON.stringify(res))
@@ -188,7 +186,9 @@
 								result => {
 									// 上传成功回调函数
 									console.log('视频地址', result)
-									this.videoSrc = result
+									uni.$u.route('/pages/mine/company/addcompany', {
+										videoSrc: result,
+									});
 								}
 							)
 							//                uni.saveVideoToPhotosAlbum({
@@ -407,7 +407,7 @@
 
 		.img-bgc {
 			position: fixed;
-			top: 0;
+			top: -50px;
 		}
 
 		.content {