소스 검색

企微二维码

xhj 2 년 전
부모
커밋
90dd886e71
1개의 변경된 파일48개의 추가작업 그리고 2개의 파일을 삭제
  1. 48 2
      card/create/create.vue

+ 48 - 2
card/create/create.vue

@@ -57,10 +57,21 @@
 					<image class="upload-close" src="../../static/pages/images/close3.png" @click.stop="wechatCode=''"></image>
 				</view>
 			</view>
+			<view class="li dflex">
+				<view class="label">企微二维码</view>
+				<view v-if="!wechatCompanyCode" class="upload-box ddflex" @tap="uploadWechatCompanyCode()">
+					<image src="../static/images/pic.png"></image>
+					<view>点击上传</view>
+				</view>
+				<view v-else class="upload-box-image ddflex" @tap="uploadWechatCompanyCode()">
+					<image class="upload-image" :src="wechatCompanyCode"></image>
+					<image class="upload-close" src="../../static/pages/images/close3.png" @click.stop="wechatCompanyCode=''"></image>
+				</view>
+			</view>
 		</view>
 		
 		<view class="form">
-			<view class="li dflex">
+			<!-- <view class="li dflex">
 				<view class="label">所获荣誉</view>
 				<view class="ddflex upload-group flex">
 					<view class="upload-box-image ddflex" v-for="item,index in honorImgUrls" @click="uploadHonor('change',index)">
@@ -72,7 +83,7 @@
 						<view>点击上传</view>
 					</view>
 				</view>
-			</view>
+			</view> -->
 			<view class="li dflex">
 				<view class="label">个人风采</view>
 				<view class="ddflex upload-group flex">
@@ -159,6 +170,7 @@ export default {
 			jobNumber:'',
 			wechat: '',
 			wechatCode:'',
+			wechatCompanyCode:'',
 			email: '',
 			companyName: '',
 			job:'',//职业
@@ -272,6 +284,7 @@ export default {
 					this.phone = res.phone;
 					this.wechat = res.wechat;
 					this.wechatCode = res.wechatCode;
+					this.wechatCompanyCode = res.wechatCompanyCode;
 					this.email = res.email;
 					this.honorImgUrls = res.honorImgUrls?res.honorImgUrls:[];
 					this.styleImgUrls = res.styleImgUrls?res.styleImgUrls:[];
@@ -382,6 +395,38 @@ export default {
 				}
 			});
 		},
+		uploadWechatCompanyCode() {
+			let that = this;
+			uni.chooseImage({
+				count: 1,
+				sizeType: ['original', 'compressed'],
+				sourceType: ['album', 'camera'],
+				success: function({ tempFilePaths }) {
+					uni.showLoading({
+						title:'上传中'
+					})
+					var promise = Promise.all(
+						tempFilePaths.map(tempFilePath => {
+							return new Promise(function(resolve, reject) {
+								req.uploadFile('/api/nocheck/upload', tempFilePath, res => {
+									that.wechatCompanyCode = res.src;
+									resolve()
+								});
+							});
+						})
+					);
+					promise
+						.then(function(results) {
+							uni.hideLoading()
+							console.log(results);
+						})
+						.catch(function(err) {
+							uni.hideLoading()
+							console.log(err);
+						});
+				}
+			});
+		},
 		
 		uploadHonor(type,index){
 			let that = this;
@@ -558,6 +603,7 @@ export default {
 			dataP.phone = this.phone;
 			dataP.wechat = this.wechat;
 			dataP.wechatCode = this.wechatCode;
+			dataP.wechatCompanyCode = this.wechatCompanyCode;
 			dataP.companyName = this.companyName;
 			// dataP.companyIntroduction = this.companyIntroduction;
 			dataP.job = this.employmentInfo.actrank;