Ver código fonte

二手发布修改

Admin 3 anos atrás
pai
commit
ac57681f84

+ 4 - 0
components/cm-module/productDetails/secondParameters.vue

@@ -50,6 +50,10 @@
 			<view class="content-td">所在地</view>
 			<view class="content-th">{{product.provinceCityDistrict}}</view>
 		</view>
+		<view class="content-tr">
+			<view class="content-td">提供方</view>
+			<view class="content-th">{{product.provinceCityDistrict}}</view>
+		</view>
 	</view>
 </template>
 

+ 127 - 21
pages/second/form/form.vue

@@ -180,20 +180,39 @@
 							 placeholder="请输入联系人姓名" 
 							 placeholder-class="placeholder">
 				</view> 
-			 </view>
-			 <view class="row">
+			</view>
+			<view class="row">
 				<view class="label">联系方式:</view>
 				<view class="spacing">
 					<input  type="text" 
 							v-model="secondParams.contactMobile" 
 							maxlength="11" 
 							placeholder="请输入联系人手机号" 
+							@blur="contactMobileOnblur"
 							placeholder-class="placeholder">
 				</view> 
-			 </view>
+			</view>
+			<view class="row">
+				<view class="label">验证码:</view>
+				<view class="spacing">
+					<input  type="text" 
+							v-model="secondParams.checkCode" 
+							maxlength="6" 
+							placeholder="请输入验证码" 
+							placeholder-class="placeholder">
+				</view> 
+				<view class="row-btn" :class="[isMobileDisabled  ? 'disabled' : '']">
+					<button class="row-input"
+							type="button" 
+							@click.stop="getMobileCodeFn" 
+							:disabled="isMobileDisabled">
+							{{ mobileCodeText }}
+					</button>
+				</view>		
+			</view>
 			<view class="row none" v-if="secondParams.publishIdentity === 1">
 				<view class="label-im">身份证照片:</view>
-				<view class="label-em">个人请上传身份证正面照片(图片大小不超过5M)</view>
+				<view class="label-em">个人请上传身份证正面照片(图片大小不超过5M)</view>
 				<view class="release-input upload image uploadGoodsImages" >
 					<view class="upload-file-view">
 						<view class="upload-file" v-if="secondParams.authenticationImage == ''">
@@ -353,7 +372,7 @@
 				</view>
 			</view>	
 		</view>
-		<view class="secondBj thebj"   v-show="model1" :class="model1 ? 'show':''">
+		<view class="secondBj thebj"   v-show="modal1" :class="modal1 ? 'show':''">
 			<view class="bjmain theresult">
 				<text class="title">发布提示</text>
 				<text class="content"> {{ tipsContentText }} </text>
@@ -376,11 +395,11 @@
 				<view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
 					<view class="tui-flex-1">
 						<view class="tui-button-text" @click="handleChangAgree">
-							<text  @click="changeBox($event)"
-								   class="iconfont"
+							<text  class="iconfont"
 								   :class="checkbox ? 'icon-yixuanze':'icon-weixuanze'" >
 							</text>
-							已阅读并同意采美<text style="color:#1890f9;">《二手出让协议》</text>
+							已阅读并同意采美
+							<text style="color:#1890f9;" @click.stop="this.$api.navigateTo('/pages/service/service?id=1013&title=二手出让协议')">《二手出让协议》</text>
 						</view>
 					</view>
 					<view class="tui-flex-1">
@@ -419,7 +438,7 @@
 				isIphoneX: this.$store.state.isIphoneX,
 				popupShow:true,
 				userIdentity:0,
-				publisherText:'请选择发布身份',
+				publisherText:'个人身份',
 				organizationTypeText:'请选择二手分类',
 				organizationTypeText1:'请选择商品类型',
 				brandActions:[],
@@ -459,11 +478,13 @@
 					originalPrice:'',//采购价
 					stock:'',//数量
 					productQuality:'',//商品成色
+					fileType:'', // 商品文件类型
 					contactName:'',//联系人
 					contactMobile:'',//联系方式
+					checkCode:'',// 联系人手机验证码
 					authenticationImage:'', //身份证正面
 					authenticationBackImage:'', //身份证反面
-					licenseImage:'',//身份验证图片
+					licenseImage:'',//营业执照图片
 					commitmentImage:'',//承诺函图片
 					dockingPeopleName:'',//采美对接人姓名
 					dockingPeopleMobile:'',//采美对接人手机号
@@ -493,7 +514,11 @@
 				isButtonsType:0,
 				vShow_detailTalkFlag:false,
 				modal:false,
-				model1:false
+				modal1:false,
+				isMobileDisabled: true,	//手机验证码按钮控制
+				mobilCount: '',				//倒计时
+				mobileCodeText: '获取验证码',
+				mobilTime: null,
 			}
 		},
 		methods:{
@@ -611,6 +636,42 @@
 			removeCommitmentImageFn(index){//删除承诺函图片
 				this.secondParams.commitmentImage = ''
 			},
+			contactMobileOnblur(e){// 识别手机号是否正确
+				if(this.$reg.isMobile(e.detail.value)){
+					this.isMobileDisabled = false;
+				}
+			},
+			getMobileCodeFn(){
+				let params = {
+						mobile:this.secondParams.contactMobile,
+						isCheckCaptcha:1,
+						activateCodeType:2,
+						platformType:2
+					}
+				this.isMobileDisabled = true;
+				this.PublicService.GetRegisterMobileCode(params).then(response =>{
+					this.$util.msg('验证短信已发送',2000);
+					const TIME_COUNT = 60;
+			     	if (!this.mobilTime) {
+			       		this.mobilCount = TIME_COUNT;
+			       		this.isMobileDisabled = true;
+			       		this.mobilTime = setInterval(() => {
+			       			if (this.mobilCount > 1 && this.mobilCount <= TIME_COUNT) {
+			         			this.mobilCount--
+			         			this.mobileCodeText = this.mobilCount +'s重新发送'
+			        		} else {
+				         		this.isMobileDisabled = false;
+				         		clearInterval(this.mobilTime)
+				         		this.mobilTime = null
+								this.mobileCodeText = '获取验证码'
+			        		}
+			       		},1000)
+			      	}
+				}).catch( error =>{
+					this.$util.msg(error.msg,2000);
+					this.isMobileDisabled = false;
+				})
+			},
 			handleSubmitBtn () {
 				if(this.secondParams.secondHandType == ''){
 					this.$util.msg('请选择分类',2000)
@@ -658,6 +719,10 @@
 					this.$util.msg('请输入商品成色',2000)
 					return
 				}
+				if(this.secondParams.fileType == ''){
+					this.$util.msg('请选择商品包含的文件',2000)
+					return
+				}
 				if(this.secondParams.contactName == ''){
 					this.$util.msg('请输入联系人姓名',2000)
 					return
@@ -671,6 +736,10 @@
 					this.$util.msg('请填写正确的手机号',2000)
 					return
 				}
+				if(this.secondParams.checkCode == ''){
+					this.$util.msg('请输入短信验证码',2000)
+					return
+				}
 				if(this.userIdentity === 1){
 					if(this.secondParams.dockingPeopleName == ''){
 						this.$util.msg('请输入采美对接人姓名',2000)
@@ -705,7 +774,7 @@
 				}
 				console.log(this.secondParams)
 				if(this.secondParams.licenseImage == ''){
-					this.model1 = true
+					this.modal1 = true
 					this.tipsContentText = '上传身份验证照片,您的二手商品将获得更好的推荐推荐和曝光,方便您快速卖出。'
 					this.cancelButtonText = '继续发布'
 					this.confirmButtonText = '去上传'
@@ -713,39 +782,40 @@
 					return
 				}
 				if(this.secondParams.commitmentImage == '' || this.secondParams.ossName == ''){
-					this.model1 = true
+					this.modal1 = true
 					this.tipsContentText = '上传二手出让承诺函,您的二手商品将获得更好的推荐推荐和曝光,方便您快速卖出。'
 					this.cancelButtonText = '继续发布'
 					this.confirmButtonText = '去上传'
 					this.isButtonsType = 1
 					return
 				}
-				this.SecondHandProduct()
 			},
-			SecondHandProduct(){//提交发布
-				this.SecondService.SecondHandProduct(this.secondParams).then(res=>{ 
-					this.model = true
-				}).catch(error =>{
+			SecondHandProduct(params){//提交发布
+				this.SecondService.SecondHandProduct(params).then(res=>{ 
+					this.modal = true
+				})
+				.catch(error =>{
 					this.$util.msg(error.msg,2000)
 				})
 			},
 			cancelButtonFn(){//弹窗操作按钮
 				switch(this.isButtonsType){
 					case 1:
+						this.modal1 = false
 						this.SecondHandProduct(this.secondParams)
 						break
 					case 2:	
-						this.model1 = false
+						this.modal1 = false
 						break
 				}
 			},
 			confirmButtonFn(){//弹窗操作按钮
 				switch(this.isButtonsType){
 					case 1:
-						this.model1 = false
+						this.modal1 = false
 						break
 					case 2:	
-						this.model1 = false
+						this.modal1 = false
 						break
 				}
 			},
@@ -904,6 +974,42 @@
 				}
 			}
 		}
+		.row-btn{
+			width: 180rpx;
+			height:64rpx;
+			background: $btn-confirm;
+			padding: 0;
+			border-radius: 32rpx;
+			position: absolute;
+			right: 0;
+			top: 10rpx;
+			.row-input{
+				width: 180rpx;
+				height: 64rpx;
+				line-height: 64rpx;
+				padding: 0;
+				color: #FFFFFF;
+				background: $btn-confirm;
+				text-align: center;
+				border-radius: 32rpx;
+				&.other{
+					width: 180rpx;
+					background: #F7F7F7;
+					margin-right: 20rpx;
+				}
+				&.none{
+					background: #F7F7F7;
+				}
+			}
+			&.disabled{
+				background: #F7F7F7;
+				.row-input{
+					background: #F7F7F7;
+					color: #999999;
+					font-size: 24rpx;
+				}
+			}
+		}
 		&.none{
 			border-bottom: none;
 		}