فهرست منبع

单独修改二手发布

Admin 3 سال پیش
والد
کامیت
1f8ff3b7e2
2فایلهای تغییر یافته به همراه199 افزوده شده و 99 حذف شده
  1. 3 3
      common/css/iconfont.scss
  2. 196 96
      pages/second/form/form.vue

+ 3 - 3
common/css/iconfont.scss

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 1519039 */
-  src: url('//at.alicdn.com/t/font_1519039_9e2bfkcum7.woff2?t=1642663000447') format('woff2'),
-       url('//at.alicdn.com/t/font_1519039_9e2bfkcum7.woff?t=1642663000447') format('woff'),
-       url('//at.alicdn.com/t/font_1519039_9e2bfkcum7.ttf?t=1642663000447') format('truetype');
+  src: url('//at.alicdn.com/t/font_1519039_mxoh1k6nohe.woff2?t=1647230680693') format('woff2'),
+       url('//at.alicdn.com/t/font_1519039_mxoh1k6nohe.woff?t=1647230680693') format('woff'),
+       url('//at.alicdn.com/t/font_1519039_mxoh1k6nohe.ttf?t=1647230680693') format('truetype');
 }
 
 .iconfont {

+ 196 - 96
pages/second/form/form.vue

@@ -9,18 +9,46 @@
 					后续采美工作人员将联系您进行承诺书签名,谢谢合作。
 				</view>
 			</view>
-			<view class="row" @click="bindPickerChangePublisher">
+			<view class="row">
 				<view class="label">发布身份:</view>
-				<text class="spacing">
-					{{ publisherText }} 
-				</text> 
+				<view class="select spacing">
+					<picker
+						@change="bindPickerChangePublisher($event)"
+						:value="index"
+						:range="publisherActions"
+						range-key="name"
+					>
+						<input
+							class="input"
+							type="text"
+							disabled="true"
+							v-model="publisherText"
+							placeholder="请选择发布身份"
+							placeholder-class="placeholder"
+						/>
+					</picker>
+				</view>
 				<text class="iconfont icon-xiayibu"></text>
 			</view>
-			<view class="row" @click="bindPickerChange">
+			<view class="row">
 				<view class="label">二手分类:</view>
-				<text class="spacing">
-					{{ organizationTypeText }} 
-				</text> 
+				<view class="select spacing">
+					<picker
+						@change="bindPickerChange($event)"
+						:value="index"
+						:range="categoryActions"
+						range-key="name"
+					>
+						<input
+							class="input"
+							type="text"
+							disabled="true"
+							v-model="organizationTypeText"
+							placeholder="请选择分类"
+							placeholder-class="placeholder"
+						/>
+					</picker>
+				</view>
 				<text class="iconfont icon-xiayibu"></text>
 			</view>
 			<view class="row">
@@ -74,7 +102,7 @@
 						   placeholder-class="placeholder">
 				 </view>
 			 </view>
-			 <view class="row" v-if="secondParams.publisherType === 2">
+			 <view class="row" v-if="secondParams.publishIdentity === 2">
 				 <view class="label">公司名称:</view>
 				 <view class="spacing">
 					 <input type="text"  
@@ -126,6 +154,23 @@
 							placeholder-class="placeholder">
 				</view> 
 			 </view>
+			 <view class="row none">
+				 <view class="label">商品包含的文件:</view>
+			 </view>
+			 <view class="row none">
+				 <view class="checkbox-main">
+				 	<view
+				 		class="checkbox-list"
+				 		:class="type.isChecked ? 'checked' : ''"
+				 		v-for="(type, index) in productFileTypeActions"
+				 		:key="index"
+				 		@click="choiceProductFileType(type, index)"
+				 	>
+				 		<text class="iconfont" :class="type.isChecked ? 'icon-yixuanze' : 'icon-weixuanze'"></text>
+				 		{{ type.name }}
+				 	</view>
+				 </view>
+			 </view>
 			 <view class="row">
 				 <view class="label">联系人:</view>
 				 <view class="spacing">
@@ -146,7 +191,7 @@
 							placeholder-class="placeholder">
 				</view> 
 			 </view>
-			<view class="row none" v-if="secondParams.publisherType === 1">
+			<view class="row none" v-if="secondParams.publishIdentity === 1">
 				<view class="label-im">身份证照片:</view>
 				<view class="label-em">个人请上传身份证正面照片(图片大小不超过5M)</view>
 				<view class="release-input upload image uploadGoodsImages" >
@@ -154,38 +199,38 @@
 						<view class="upload-file" v-if="secondParams.authenticationImage == ''">
 							<text class="iconfont icon-shangchuantupian"></text>
 							<text class="add-text">身份证正面</text>
-							<view ref="goodsImages" class="input-file"  @click="uploadUserImageFn"></view>
+							<view ref="goodsImages" class="input-file"  @click="uploadCardImageFn(1)"></view>
 						</view>
 						<view class="upload-file" v-else>
 							<image :src="secondParams.authenticationImage" alt="" class="upload-img" ></image>
-							<text class=" del iconfont icon-shanchu1" @click="removeUserImageFn"></text>
+							<text class=" del iconfont icon-iconfontguanbi" @click="removeCardImageFn(1)"></text>
 						</view>
 					</view>
 					<view class="upload-file-view">
-						<view class="upload-file" v-if="secondParams.authenticationImage == ''">
+						<view class="upload-file" v-if="secondParams.authenticationBackImage == ''">
 							<text class="iconfont icon-shangchuantupian"></text>
 							<text class="add-text">身份证反面</text>
-							<view ref="goodsImages" class="input-file"  @click="uploadUserImageFn"></view>
+							<view ref="goodsImages" class="input-file"  @click="uploadCardImageFn(2)"></view>
 						</view>
 						<view class="upload-file" v-else>
-							<image :src="secondParams.authenticationImage" alt="" class="upload-img" ></image>
-							<text class=" del iconfont icon-shanchu1" @click="removeUserImageFn"></text>
+							<image :src="secondParams.authenticationBackImage" alt="" class="upload-img" ></image>
+							<text class=" del iconfont icon-iconfontguanbi" @click="removeCardImageFn(2)"></text>
 						</view>
 					</view>
 				</view>
 			 </view>
-			 <view class="row none" v-if="secondParams.publisherType === 2">
+			 <view class="row none" v-if="secondParams.publishIdentity === 2">
 			 	<view class="label-im">营业执照:</view>
 			 	<view class="label-em">请上传营业执照照片(图片大小不超过5M)</view>
 			 	<view class="release-input upload image uploadGoodsImages" >
-			 		<view class="upload-file" v-if="secondParams.authenticationImage == ''">
+			 		<view class="upload-file" v-if="secondParams.licenseImage == ''">
 			 			<text class="iconfont icon-shangchuantupian"></text>
 			 			<text class="add-text">营业执照</text>
 			 			<view ref="goodsImages" class="input-file"  @click="uploadUserImageFn"></view>
 			 		</view>
 			 		<view class="upload-file" v-else>
-			 			<image :src="secondParams.authenticationImage" alt="" class="upload-img" ></image>
-			 			<i class=" del iconfont icon-shanchu1" @click="removeUserImageFn"></i>
+			 			<image :src="secondParams.licenseImage" alt="" class="upload-img" ></image>
+			 			<i class=" del iconfont icon-iconfontguanbi" @click="removeUserImageFn"></i>
 			 		</view>
 			 	</view>
 			  </view>
@@ -209,11 +254,25 @@
 							placeholder-class="placeholder">
 				</view> 
 			 </view>
-			 <view class="row" @click="bindPickerChange1">
+			 <view class="row">
 				 <view class="label">商品类型:</view>
-				 <text class="spacing">
-					{{ organizationTypeText1 }} 
-				 </text>
+				 <view class="select spacing">
+				 	<picker
+				 		@change="bindPickerChangeProduct($event)"
+				 		:value="index"
+				 		:range="productActions"
+				 		range-key="name"
+				 	>
+				 		<input
+				 			class="input"
+				 			type="text"
+				 			disabled="true"
+				 			v-model="organizationTypeText1"
+				 			placeholder="请选择发布身份"
+				 			placeholder-class="placeholder"
+				 		/>
+				 	</picker>
+				 </view>
 				 <text class="iconfont icon-xiayibu"></text>
 			 </view>
 			<view class="row" >
@@ -243,7 +302,7 @@
 						</view>
 						<view class="upload-file" v-for="(item, index) in GoodsImagesList" :key="index">
 							<image :data-original='item' :src="item" :data-image="item" alt="" class="upload-img" ></image>
-							<text class=" del iconfont icon-shanchu1" @click="removeGoodsImagesFn(index)"></text>
+							<text class=" del iconfont icon-iconfontguanbi" @click="removeGoodsImagesFn(index)"></text>
 						</view>
 					</view>
 					<view class="form-upload-tips">
@@ -259,7 +318,7 @@
 					</view> 
 					<view class="spacing file-text" v-else>
 						<text class="file-text-em">{{ secondParams.fileName }}</text>
-						<text class=" del iconfont icon-shanchu1" @click="deleteCommitmentFile"></text>
+						<text class=" del iconfont icon-iconfontguanbi" @click="deleteCommitmentFile"></text>
 					</view>
 				</view>
 				<view class="row none">
@@ -274,7 +333,7 @@
 						</view>
 						<view class="upload-file" v-else>
 							<image :src="secondParams.commitmentImage" alt="" class="upload-img" ></image>
-							<i class=" del iconfont icon-shanchu1" @click="removeCommitmentImageFn"></i>
+							<i class=" del iconfont icon-iconfontguanbi" @click="removeCommitmentImageFn"></i>
 						</view>
 					</view>
 				</view>
@@ -364,11 +423,30 @@
 				organizationTypeText:'请选择二手分类',
 				organizationTypeText1:'请选择商品类型',
 				brandActions:[],
+				publisherActions:[
+					{name:'个人身份',value:1},
+					{name:'公司身份',value:2},
+				],
+				categoryActions:[
+					{name:'二手仪器',value:1},
+					{name:'其他',value:3},
+				],
+				productActions:[
+					{name:'医美',value:1},
+					{name:'非医美',value:3},
+				],
+				productFileTypeActions:[
+					{ name:'仪器原始合同',value:1,isChecked:false},
+					{ name:'仪器注册证',value:2,isChecked:false},
+					{ name:'仪器发票',value:3,isChecked:false},
+					{ name:'仪器报关单',value:4,isChecked:false},
+					{ name:'无任何文件',value:5,isChecked:false}
+				],
 				GoodsImagesList:[],
 				secondParams:{
-					publisherType:1, // 发布者身份 1 个人身份 2 公司身份
+					publishIdentity:1, // 发布者身份 1 个人身份 2 公司身份
 					secondHandType:'',//一级分类
-					instrumentType:'',//二手仪器分类
+					instrumentType:1,//二手仪器分类
 					name:'',
 					brandId:'',//品牌ID
 					brandName:'',//其他品牌
@@ -383,7 +461,9 @@
 					productQuality:'',//商品成色
 					contactName:'',//联系人
 					contactMobile:'',//联系方式
-					authenticationImage:'',//身份验证图片
+					authenticationImage:'', //身份证正面
+					authenticationBackImage:'', //身份证反面
+					licenseImage:'',//身份验证图片
 					commitmentImage:'',//承诺函图片
 					dockingPeopleName:'',//采美对接人姓名
 					dockingPeopleMobile:'',//采美对接人手机号
@@ -396,6 +476,7 @@
 					productDetails:'',//商品详细信息
 					source:2//二手发布来源.1:WWW,2:小程序,3:后台,4:协销
 				 },
+				 checkedFileTypeList:[],
 				 addressData:{
 					address:'请选择所在地区',
 					townID:'',			//区ID
@@ -430,69 +511,42 @@
 				this.addressData.provinceID = e.provinceCode
 				this.secondParams.townId = this.addressData.townID
 			},
-			bindPickerChangePublisher(){// 选择发布者身份
-				let self = this
-				uni.showActionSheet({
-					title:'标题',
-					itemList: ['个人身份','公司身份'],
-					success: (e) => {
-						switch(e.tapIndex){
-							case 0:
-								self.secondParams.publisherType = 1
-								self.publisherText = '个人身份'
-								break
-							case 1:
-								self.secondParams.publisherType = 2
-								self.publisherText = '公司身份'
-								break
-						}
-					}
-				})
+			bindPickerChangePublisher(e) {// 选择发布者身份
+				this.publisherText = this.publisherActions[e.target.value].name
+				this.secondParams.publishIdentity = this.publisherActions[e.target.value].value
 			},
-			bindPickerChange() {// 选择二手分类
-				let self = this
-				uni.showActionSheet({
-					title:'标题',
-					itemList: ['二手仪器','其他'],
-					success: (e) => {
-						switch(e.tapIndex){
-							case 0:
-								self.secondParams.secondHandType = 1
-								self.secondParams.instrumentType = 1
-								self.organizationTypeText = '二手仪器-美容仪器'
-								break
-							case 1:
-								self.secondParams.secondHandType = 3
-								self.secondParams.instrumentType = ''
-								self.organizationTypeText = '其他'
-								break
-						}
-					}
-				})
+			bindPickerChange(e) {// 选择二手分类
+				this.secondParams.secondHandType = this.categoryActions[e.target.value].value
+				if(this.secondParams.secondHandType === 1){
+					this.organizationTypeText =  '二手仪器-美容仪器'
+				}else{
+					this.organizationTypeText = this.categoryActions[e.target.value].name
+				}
 			},
 			bindPickerChangeBrand(e) {
 				// 选择品牌
 				this.brandName = this.brandActions[e.target.value].name
 				this.secondParams.brandId = this.brandActions[e.target.value].value
 			},
-			bindPickerChange1() {// 选择商品类型
-				let self = this
-				uni.showActionSheet({
-					title:'标题',
-					itemList: ['医美','非医美'],
-					success: (e) => {
-						switch(e.tapIndex){
-							case 0:
-								self.secondParams.secondProductType = 1
-								self.organizationTypeText = '医美'
-								break
-							case 1:
-								self.secondParams.secondProductType = 2
-								self.organizationTypeText = '非医美'
-								break
-						}
+			bindPickerChangeProduct(e) {
+				// 选择商品类型
+				this.organizationTypeText1 = this.productActions[e.target.value].name
+				this.secondParams.secondProductType = this.productActions[e.target.value].value
+			},
+			choiceProductFileType(type,index){
+				// 选择类别
+				type.isChecked = !type.isChecked
+				if (type.isChecked) {
+					if(!this.contains(this.checkedFileTypeList,type.value)){
+						this.checkedFileTypeList.push(type.value)
 					}
-				})
+				} else {
+					this.checkedFileTypeList.splice(this.checkedFileTypeList.indexOf(type.value),1)
+				}
+				this.secondParams.fileType = this.checkedFileTypeList.join(',')
+			},
+			contains(arr, val) {// 校验
+				return arr.some(item => item === val)
 			},
 			Detailed(){
 				this.vShow_detailTalkFlag = !this.vShow_detailTalkFlag
@@ -508,9 +562,19 @@
 					 this.secondParams.image =this.GoodsImagesList.toString()+','
 				})
 			},
-			uploadUserImageFn(event){//上传身份图片
+			uploadCardImageFn(type){//上传身份正反面照
 				uploadFileImage().then(res =>{
-					 this.secondParams.authenticationImage = JSON.parse(res.data).data
+					if(type == 1){
+						this.secondParams.authenticationImage = JSON.parse(res.data).data
+					}else{
+						this.secondParams.authenticationBackImage = JSON.parse(res.data).data
+					}
+				})
+			},
+			uploadUserImageFn(event){//上传营业执照图片
+				console.log('event')
+				uploadFileImage().then(res =>{
+					 this.secondParams.licenseImage = JSON.parse(res.data).data
 				})
 			},
 			uploadCommitmentImageFn(event){//上传承诺函图片
@@ -534,8 +598,15 @@
 				this.GoodsImagesList.splice(index,1)
 				this.secondParams.image =this.GoodsImagesList.toString()+','
 			},
-			removeUserImageFn(index){//删除身份图片
-				this.secondParams.authenticationImage = ''
+			removeCardImageFn(type){//删除身份证图片
+				if(type == 1){
+					this.secondParams.authenticationImage = ''
+				}else{
+					this.secondParams.authenticationBackImage = ''
+				}
+			},
+			removeUserImageFn(index){//删除公司营业执照图片
+				this.secondParams.licenseImage = ''
 			},
 			removeCommitmentImageFn(index){//删除承诺函图片
 				this.secondParams.commitmentImage = ''
@@ -633,7 +704,7 @@
 					return
 				}
 				console.log(this.secondParams)
-				if(this.secondParams.authenticationImage == ''){
+				if(this.secondParams.licenseImage == ''){
 					this.model1 = true
 					this.tipsContentText = '上传身份验证照片,您的二手商品将获得更好的推荐推荐和曝光,方便您快速卖出。'
 					this.cancelButtonText = '继续发布'
@@ -806,10 +877,33 @@
 		width: 70%;
 	}
 	.row{
+		width: 100%;
 		border-bottom: 2rpx solid #e1e1e1;
 		line-height: 90rpx;
+		float: left;
 		height: auto;
 		position: relative;
+		.checkbox-main{
+			width: 100%;
+			.checkbox-list {
+				height: 60rpx;
+				font-size: $font-size-28;
+				line-height: 60rpx;
+				border-radius: 10rpx;
+				margin-right: 20rpx;
+				margin-bottom: 10rpx;
+				box-sizing: border-box;
+				float: left;
+				.icon-yixuanze{
+					margin-right: 10rpx;
+					color: #E15616;
+				}
+				.icon-weixuanze{ 
+					margin-right: 10rpx;
+					color: #B2B2B2;
+				}
+			}
+		}
 		&.none{
 			border-bottom: none;
 		}
@@ -858,7 +952,7 @@
 				box-sizing: border-box;
 				position: relative;
 			}
-			.icon-shanchu1{
+			.icon-iconfontguanbi{
 				width: 40rpx;
 				height: 40rpx;
 				line-height: 40rpx;
@@ -951,11 +1045,13 @@
 		position: relative;
 		display: inline-block;
 		.input-file {
-			width: 180rpx;
-			height: 180rpx;
+			width: 194rpx;
+			height: 194rpx;
 			opacity: 0;
 			cursor: pointer;
 			position: absolute;
+			top: 0;
+			left: 0;
 		}
 		.upload-img {
 			width: 100%;
@@ -983,16 +1079,20 @@
 			color: #b2b2b2;
 			text-align: center;
 		}
-		.icon-shanchu1{
+		.icon-iconfontguanbi{
 			width: 40rpx;
 			height: 40rpx;
 			line-height: 40rpx;
 			display: block;
 			position: absolute;
+			background: #f94b4b;
+			text-align: center;
+			line-height: 40rpx;
+			border-radius: 50%;
 			top: -15rpx;
 			right:-18rpx;
-			color: #f94b4b;
-			font-size: 36rpx;
+			color: #FFFFFF;
+			font-size: $font-size-24;
 		}
 	}
 	.wen-tips {