瀏覽代碼

认证入口优化

忆雪 10 月之前
父節點
當前提交
d25b67be2c
共有 2 個文件被更改,包括 97 次插入15 次删除
  1. 82 6
      src/pageMerchant/mineModule/openStoreAppealDetail.vue
  2. 15 9
      src/pages/tabbar/components/TapList.vue

+ 82 - 6
src/pageMerchant/mineModule/openStoreAppealDetail.vue

@@ -9,8 +9,8 @@
 			<view class="item-l">
 				<p>负责人 : {{ list.legalRepresentativeName || '--' }}</p>
 				<p>联系方式 : {{ list.mobileNumber || '--' }}</p>
-				<p>电子邮箱 : {{ '--' }}</p>
-				<p>所属地区 : {{ list.storeAddress || '--' }}</p>
+				<p>电子邮箱 : {{ list.email || '--' }}</p>
+				<p>所属地区 : {{ findAreaByCode(list.merchant.region)  || '--' }}</p>
 				<p>详细地址 : {{ list.merchant.address || '--' }}</p>
 			</view>
 			<img class="img" src="@/static/mine/icon_mine_underReview.png" alt="" />
@@ -19,9 +19,9 @@
 		<view class="content-item">
 			<view class="item-l">
 				<p>店铺名称 : {{ list.merchant.name || '--' }}</p>
-				<p>主营业务 : {{ '--' }}</p>
-				<p>辅营业务 : {{'--' }}</p>
-				<p>营业时间 : {{ '--' }}</p>
+				<p>主营业务 : {{funName(list.merchant.mainBusiness) }}</p>
+				<p>辅营业务 : {{getNameById(list.merchant.ancillaryBusiness) }}</p>
+				<p>营业时间 : {{ list.merchant.opening || '--' }}</p>
 
 			</view>
 		</view>
@@ -96,16 +96,92 @@
 </template>
 
 <script>
+	import cityData from '@/utils/city';
+	import {
+		getParentCategoriesData,
+		getRootCategoriesData
+	} from '@/api/merchant/merchantAuth';
 	export default {
 		data() {
 			return {
 				list: {},
+				ParentCategoriesData: [],
+				RootCategoriesData: [],
 			};
 		},
-		methods: {},
+		// computed: {
+		// 	funName(categories) {
+		// 		for (const service of ParentCategoriesData) {
+		// 			if (service.id == categories) {
+		// 				return service.name;
+		// 			}
+		// 		}
+		// 		return null; // 如果未找到对应id的name,返回null或者其他你认为合适的默认值
+		// 	},
+		// 	getNameById(ids) {
+		// 		// 将数组转换为对象
+		// 		const servicesMap = {};
+		// 		RootCategoriesData.forEach(service => {
+		// 			servicesMap[service.id] = service.name;
+		// 		});
+		// 		const names = ids.map(id => servicesMap[id]).filter(Boolean);
+		// 		return names.join(", ");
+		// 	}
+		// },
+		mounted() {
+			this.request();
+		},
+		methods: {
+			async request() {
+				const res = await getParentCategoriesData({
+					type: 0
+				})
+				this.ParentCategoriesData = res.data
+
+				const res1 = await getRootCategoriesData({
+					type: 0
+				})
+				this.RootCategoriesData = res1.data
+
+			},
+			funName(categoryId) {
+				for (const service of this.ParentCategoriesData) {
+					if (service.id == categoryId) {
+						return service.name;
+					}
+				}
+				return null; // 如果未找到对应id的name,返回null或者其他你认为合适的默认值
+			},
+			getNameById(ids) {
+				const servicesMap = {};
+				this.RootCategoriesData.forEach(service => {
+					servicesMap[service.id] = service.name;
+				});
+				const names = ids.map(id => servicesMap[id]).filter(Boolean);
+				return names.join(", ");
+			},
+			findAreaByCode(areaCode) {
+				for (const province of cityData) {
+					if (province.provinceCode == areaCode) {
+						return `${province.provinceName}`;
+					}
+					for (const city of province.cities) {
+						if (city.cityCode == areaCode) {
+							return `${province.provinceName} - ${city.cityName}`;
+						}
+						const county = city.counties.find(item => item.countyCode == areaCode);
+						if (county) {
+							return `${province.provinceName} - ${city.cityName} - ${county.countyName}`;
+						}
+					}
+				}
+				return '未找到对应地区';
+			}
+		},
 		onShow() {
 			this.list = this.$store.state.data.merchantInfo;
 		},
+
 	};
 </script>
 

+ 15 - 9
src/pages/tabbar/components/TapList.vue

@@ -100,22 +100,24 @@
 			},
 			// 点击确认时
 			confirmSwitch() {
-				// this.showSwitchDialog = false;
-				// this.$store.dispatch('SwitchIdentity','MERCHANT')
 				if (this.title == "提醒") {
 					this.getMerchantAuth()
 
+				} else if (this.title == "警告!") {
+					//进入审核未通过详情
+					uni.navigateTo({
+						url: 'pageMerchant/mineModule/openStoreAppealDetail'
+					});
+					this.cancelSwitch()
 				} else {
+					// 进入开店流程页面
 					uni.navigateTo({
 						url: '/pageMerchant/mineModule/certification/index'
 					});
-				}
-
+					this.cancelSwitch()
 
+				}
 
-				// uni.navigateTo({
-				//   url: '/pageMerchant/index',
-				// });
 			},
 
 			/*===========================================================*/
@@ -125,11 +127,15 @@
 				console.log(res, "获取商家信息")
 				if (res.code === 'OK' && res.data) {
 					if (res.data.reviewStatus == 2) {
+						//跳转认证中页面
 						uni.navigateTo({
-							url: '/pageMerchant/mineModule/certification/openStoreAppealDetail'
+							// url: '/pageMerchant/mineModule/certification/openStoreAppealDetail'
+							url: 'pageMerchant/mineModule/openStoreAppealDetail'
 						});
 						this.cancelSwitch();
 					} else if (res.data.reviewStatus == 1) {
+						//通过认证
+						this.$store.dispatch('SwitchIdentity', 'MERCHANT')
 						// 将数据存储到vuex中
 						this.merchantInfo = Object.assign({}, {
 							...res.data,
@@ -142,7 +148,7 @@
 						this.cancelSwitch();
 					} else {
 						this.title = "警告!"
-						this.content = `认证未通过,审核意见:${res.data.message}`
+						this.content = `认证未通过,审核意见:${res.data.message}. 点击确认进入查看信息`
 					}
 				} else {
 					this.title = "温馨提示!"