From fb14fa911bde1ed360fe89a1c41d74b158db9ab5 Mon Sep 17 00:00:00 2001
From: xuxueyang <xuxy@fengyuntec.com>
Date: 星期五, 09 八月 2024 15:26:28 +0800
Subject: [PATCH] update 花店样式等

---
 sub_pages/supplier/supplier-info/supplier-info.vue |  150 +++++++++++++++++++++++++++++++++-----------------
 1 files changed, 99 insertions(+), 51 deletions(-)

diff --git a/sub_pages/supplier/supplier-info/supplier-info.vue b/sub_pages/supplier/supplier-info/supplier-info.vue
index 2fe3f08..e04c51f 100644
--- a/sub_pages/supplier/supplier-info/supplier-info.vue
+++ b/sub_pages/supplier/supplier-info/supplier-info.vue
@@ -27,7 +27,8 @@
 				</view>
 			</view>
 			<view class="form-item bottom-border-no">
-				<view class="label required" style="width: 360rpx;">店铺头像(推荐80*80px)</view>
+				<view class="label required" style="width: 360rpx;min-width: 360rpx;font-size: 28rpx;">店铺头像(推荐80*80px)
+				</view>
 				<view class="m-l-a m-r-0 flex m-t-20 m-b-20">
 					<view class="component-button-upload" @click="uploadIcon('cover')">
 
@@ -114,26 +115,41 @@
 				<view class="label required">选择审核方式</view>
 				<view class="m-l-a m-r-0 flex">
 
-					<u-radio-group v-model="dto.idcardType" placement="row">
+					<!-- 	<u-radio-group v-model="dto.idcardType" placement="row">
 						<u-radio :customStyle="{'margin-bottom': '8px','margin-right': '8px','font-size':'28rpx'}"
 							v-for="(item, index) in shTypeList" :key="index" :label="item.name" :name="item.name">
 						</u-radio>
-					</u-radio-group>
+					</u-radio-group> -->
+					<!--					<view>-->
+					<!--						<radio :checked="dto.idcardType==='身份证'" @click="()=>{-->
+					<!--							dto.idcardType='身份证';-->
+					<!--							$forceUpdate()-->
+					<!--						}">-->
+					<!--						</radio>身份证-->
+					<!--					</view>-->
+					<!--					<view class="m-l-10">-->
+					<!--						<radio :checked="dto.idcardType==='营业执照'" @click="()=>{-->
+					<!--							dto.idcardType='营业执照';-->
+					<!--							$forceUpdate()-->
+					<!--						}">-->
+					<!--						</radio>营业执照-->
+					<!--					</view>-->
+					<evan-radio-group v-model="dto.idcardType">
+						<evan-radio v-for="item in shTypeList" :key="item.value"
+							:label="item.value">{{item.label}}</evan-radio>
+					</evan-radio-group>
 				</view>
 			</view>
-			<view class="form-item bottom-border-no before-line m-t-20 p-b-20" v-if="dto.idcardType=='身份证'">
+			<view class="form-item bottom-border-no before-line m-t-20 p-b-20" v-if="dto.idcardType=='1'">
 				<view class="label required">身份证正反面</view>
 				<view class="m-l-a m-r-0 flex">
-					<!-- 					<view class="component-button-upload m-r-15" @click="uploadIcon('idCards')">
-
-					</view> -->
 					<view class="component-button-upload" @click="uploadIcon('idCards')">
 
 					</view>
 				</view>
 			</view>
 			<view class="flex p20" style="padding-top: 0rpx;padding-bottom: 10rpx"
-				v-if="dto.idcardType==='身份证'&&dto.idCards&&dto.idCards.length>0">
+				v-if="dto.idcardType==='1'&&dto.idCards&&dto.idCards.length>0">
 				<view class="m-t-12 m-r-10 " v-for="(tBanner,index) of dto.idCards" :key="index">
 					<image class="banner-img" :src="tBanner.url" @click.stop="previewImg(tBanner.url)">
 
@@ -141,7 +157,7 @@
 					<view class="t-red text-center" @click.stop="deleteImg('idCards',index)">删除</view>
 				</view>
 			</view>
-			<view class="form-item bottom-border-no before-line m-t-20 p-b-20" v-if="dto.idcardType=='营业执照'">
+			<view class="form-item bottom-border-no before-line m-t-20 p-b-20" v-if="dto.idcardType=='2'">
 				<view class="label required">营业执照</view>
 				<view class="m-l-a m-r-0 flex">
 					<view class="component-button-upload m-r-15" @click="uploadIcon('pictures')">
@@ -151,7 +167,7 @@
 				</view>
 			</view>
 			<view class="flex p20" style="padding-top: 0rpx;padding-bottom: 10rpx"
-				v-if="dto.idcardType==='营业执照'&&dto.pictures&&dto.pictures.length>0">
+				v-if="dto.idcardType==='2'&&dto.pictures&&dto.pictures.length>0">
 				<view class="m-t-12 m-r-10 " v-for="(tBanner,index) of dto.pictures" :key="index">
 					<image class="banner-img" :src="tBanner.url" @click.stop="previewImg(tBanner.url)">
 
@@ -162,9 +178,16 @@
 
 
 
-			<view class="button-green-1 m-t-20 button-fixed-bottom before-line " @click="submit">
+			<view class="button-green-1 m-t-20 button-fixed-bottom before-line " style="font-size: 22rpx;"
+				v-if="currentInfo.supplierDTO&&currentInfo.supplierDTO.status==='P'">
+				审核已通过,部分信息请前往个人资料修改
+			</view>
+
+			<view class="button-green-1 m-t-20 button-fixed-bottom before-line " v-else @click="submit">
 				提交审核
 			</view>
+
+
 
 		</view>
 
@@ -187,8 +210,15 @@
 	import {
 		mapState
 	} from 'vuex'
+	import EvanRadio from "../components/evan-radio/evan-radio.vue";
+	import EvanRadioGroup from "../components/evan-radio-group/evan-radio-group.vue";
 
 	export default {
+
+		components: {
+			EvanRadioGroup,
+			EvanRadio
+		},
 
 		data() {
 			return {
@@ -200,7 +230,7 @@
 					pictures: [],
 					idCards: [],
 					cover: '',
-					idcardType: '身份证',
+					idcardType: '1',
 					description: '',
 					address: '',
 					stationId: '',
@@ -260,12 +290,12 @@
 
 				//审核方式
 				shTypeList: [{
-						name: '身份证',
-						disabled: false
+						label: '身份证',
+						value: '1'
 					},
 					{
-						name: '营业执照',
-						disabled: false
+						label: '营业执照',
+						value: '2'
 					}
 				],
 				regionDataPlus: [],
@@ -318,7 +348,7 @@
 							this.dto.city = e.detail.value[0].value
 						if (!!e.detail.value[1])
 							this.dto.region = e.detail.value[1].value
-					}else if(e.detail.value.length <= 3) {
+					} else if (e.detail.value.length <= 3) {
 						if (!!e.detail.value[0])
 							this.dto.province = e.detail.value[0].value
 						if (!!e.detail.value[1])
@@ -353,13 +383,17 @@
 				}
 			},
 			async init_area() {
-				const res = await this.$http.request('get', '/api/pub/china/area/json')
-				// console.log('area', JSON.parse(res.data))
-				this.regionDataPlus = res.data && JSON.parse(res.data.replaceAll('code', 'value').replaceAll('name',
-					'text')) || []
-
-				// console.log('area', this.regionDataPlus)
-
+				var a = this.$storage.getItem('cache_area')
+				if (a) {
+					this.regionDataPlus = JSON.parse(a) || []
+				} else {
+					const res = await this.$http.request('get', '/api/pub/china/area/json')
+					// console.log('area', JSON.parse(res.data))
+					this.regionDataPlus = res.data && JSON.parse(res.data.replaceAll('code', 'value').replaceAll(
+						'name',
+						'text')) || []
+					this.$storage.setItem('cache_area', JSON.stringify(this.regionDataPlus))
+				}
 
 			},
 
@@ -380,28 +414,25 @@
 					data
 				} = await this.$http.request('get', "/api/current/supplier", {})
 				if (code == 0) {
-					this.dto = {
+					const dto = {
 						...data,
 
 					}
-					if (!this.dto.pictures) {
-						this.dto.pictures = []
-					} else if (typeof this.dto.pictures == 'string') {
-						this.dto.pictures = JSON.parse(this.dto.pictures)
+					if (!dto.pictures) {
+						dto.pictures = []
+					} else if (typeof dto.pictures == 'string') {
+						dto.pictures = JSON.parse(dto.pictures)
 					}
-					if (!this.dto.idCards) {
-						this.dto.idCards = []
-					} else if (typeof this.dto.idCards == 'string') {
-						this.dto.idCards = JSON.parse(this.dto.idCards)
+					if (!dto.idCards) {
+						dto.idCards = []
+					} else if (typeof dto.idCards == 'string') {
+						dto.idCards = JSON.parse(dto.idCards)
 					}
-
-					if (this.dto.idcardType == '1') {
-						this.dto.idcardType = '身份证'
-					} else {
-						this.dto.idcardType = '营业执照'
+					if (!dto.idcardType) {
+						dto.idcardType = '1'
 					}
-					this.dto.userId = this.currentInfo.id
-
+					dto.userId = this.currentInfo.id
+					this.dto = dto
 				}
 
 				this.$message.hideLoading()
@@ -427,11 +458,6 @@
 					} else if (typeof this.dto.idCards == 'string') {
 						this.dto.idCards = JSON.parse(this.dto.idCards)
 					}
-					if (this.dto.idcardType == '1') {
-						this.dto.idcardType = '身份证'
-					} else {
-						this.dto.idcardType = '营业执照'
-					}
 				}
 
 				this.$message.hideLoading()
@@ -444,20 +470,33 @@
 						return
 					}
 				}
-				if (this.dto.idcardType == '身份证' && this.dto.idCards.length == 0) {
-					this.$message.showToast(`${this.dto.idcardType}信息未填写`)
+				if (this.dto.contactTel.length !== 11 && !this.dto.contactTel.startsWith('1')) {
+					this.$message.showToast(`联系方式需要为11位,且开头为1`)
 					return
 				}
-				if (this.dto.idcardType !== '身份证' && this.dto.pictures.length == 0) {
-					this.$message.showToast(`${this.dto.idcardType}信息未填写`)
+				if (isNaN(parseInt(this.dto.contactTel))) {
+					this.$message.showToast(`联系方式需要为11位手机号,格式错误`)
 					return
 				}
+				if (this.dto.idcardType == '1' && this.dto.idCards.length == 0) {
+					this.$message.showToast(`身份证信息未填写`)
+					return
+				}
+				if (this.dto.idcardType == '1' && this.dto.idCards.length < 2) {
+					this.$message.showToast(`身份证信息未填写完整,至少上传两张图片(正反面)`)
+					return
+				}
+				if (this.dto.idcardType == '2' && this.dto.pictures.length == 0) {
+					this.$message.showToast(`营业执照信息未填写`)
+					return
+
+				}
+
 				await this.$message.confirm(`是否确定提交/修改店铺信息`)
 
 
 				var dto = {
 					...this.dto,
-					idcardType: this.dto.idcardType === '身份证' ? "1" : '2'
 				}
 				this.$message.showLoading()
 				const re = await this.$http.request('post', '/api/supplier/addOrUpdate', {
@@ -532,7 +571,6 @@
 		computed: {
 			...mapState(['currentInfo'])
 		},
-		components: {}
 	}
 </script>
 
@@ -620,4 +658,14 @@
 		color: #F56c6c;
 		background-color: rgb(254, 243, 243);
 	}
+
+	/deep/ {
+		.evan-radio-group {
+			display: flex;
+		}
+
+		.evan-radio {
+			margin-right: 12rpx;
+		}
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3