Răsfoiți Sursa

商家认证编辑功能

忆雪 11 luni în urmă
părinte
comite
a4515043f1

+ 2 - 2
src/pageMerchant/mineModule/certification/components/ImgsUpload.vue

@@ -33,8 +33,8 @@
 
 		},
 		mounted() {
-
-			this.fileList = this.imageList.split(',')
+			console.log( this.imageList," this.imageList")
+			this.fileList = this.imageList ? this.imageList.split(','):[]
 		},
 		created() {},
 		methods: {

+ 276 - 293
src/pageMerchant/mineModule/certification/corporateInformation.vue

@@ -1,293 +1,276 @@
-<template>
-  <view class="container">
-    <u-form :model="legalInfo" ref="uForm" labelPosition="left" labelWidth="80" :rules="rules">
-      <view class="content-box">
-        <view class="content-item">
-          <u-form-item prop="legalRepresentativeName" required label="法人名称" right>
-            <view class="item-r">
-              <u--input
-                placeholder="请输入法人名称"
-                border="surround"
-                v-model="legalInfo.legalRepresentativeName"
-              ></u--input>
-            </view>
-          </u-form-item>
-        </view>
-
-        <view class="content-item">
-          <u-form-item prop="sexName" required label="性别" right @click="showSex = true">
-            <view class="item-r">
-              <u--input placeholder="请选择性别" border="surround" v-model="legalInfo.sexName" />
-            </view>
-          </u-form-item>
-          <view class="icon-right-box">
-            <u-icon name="arrow-right" color="#c5c5c5" size="20"></u-icon>
-          </view>
-        </view>
-
-        <view class="content-item">
-          <u-form-item prop="documentType" required label="证件类型" right>
-            <view class="item-r">
-              <u--input
-                placeholder="居民身份证"
-                border="surround"
-                v-model="legalInfo.documentType"
-                disabled
-              ></u--input>
-            </view>
-          </u-form-item>
-        </view>
-        <view class="content-item">
-          <u-form-item prop="idCardNumber" required label="证件号" right>
-            <view class="item-r">
-              <u--input
-                placeholder="请输入证件号"
-                border="surround"
-                v-model="legalInfo.idCardNumber"
-              ></u--input>
-            </view>
-          </u-form-item>
-        </view>
-        <view class="content-item">
-          <u-form-item
-            prop="idCardExpirationDate"
-            required
-            label="有效期"
-            right
-            @click="showPicker = true"
-          >
-            <view class="item-r">
-              <u--input
-                placeholder="请输入证件有效期"
-                border="surround"
-                v-model="legalInfo.idCardExpirationDate"
-              ></u--input>
-            </view>
-          </u-form-item>
-          <view class="icon-right-box">
-            <u-icon name="arrow-right" color="#c5c5c5" size="20"></u-icon>
-          </view>
-        </view>
-      </view>
-
-      <view class="content-box">
-        <u-form-item prop="idCardFrontPhoto">
-          <imgs-upload @update="fileList" :value="1"></imgs-upload>
-          <p class="upload-text">证件正面图(国徽图)</p>
-        </u-form-item>
-      </view>
-
-      <view class="content-box">
-        <u-form-item prop="idCardBackPhoto">
-          <imgs-upload @update="fileList" :value="2"></imgs-upload>
-          <p class="upload-text">证件反面图(人像图)</p>
-        </u-form-item>
-      </view>
-    </u-form>
-
-    <button class="btn" @click="handlerSkipNext">下一步</button>
-
-    <!-- 性别 -->
-    <u-action-sheet
-      :show="showSex"
-      :actions="actions"
-      title="请选择性别"
-      description="如果选择保密会报错"
-      @close="showSex = false"
-      @select="sexSelect"
-    >
-    </u-action-sheet>
-
-    <!-- 时间 -->
-    <u-datetime-picker
-      :show="showPicker"
-      v-model="valueDate"
-      mode="date"
-      @cancel="showPicker = false"
-      @confirm="handleConfirm"
-    ></u-datetime-picker>
-  </view>
-</template>
-
-<script>
-import ImgsUpload from './components/ImgsUpload.vue';
-import { formatTime } from '@/utils/date';
-
-export default {
-  components: {
-    ImgsUpload,
-  },
-  data() {
-    return {
-      showSex: false,
-      showPicker: false,
-      valueDate: Number(new Date()),
-      actions: [
-        {
-          index: '1',
-          name: '男',
-        },
-        {
-          index: '2',
-          name: '女',
-        },
-        {
-          index: '0',
-          name: '保密',
-        },
-      ],
-      legalInfo: {
-        legalRepresentativeName: '',
-        legalRepresenativeGender: '',
-        idCardExpirationDate: '',
-        idCardNumber: '',
-        idCardFrontPhoto: '',
-        idCardBackPhoto: '',
-        sexName: '',
-      },
-      rules: {
-        legalRepresentativeName: {
-          type: 'string',
-          required: true,
-          message: '请输入法人名称',
-          trigger: ['blur', 'change'],
-        },
-        sexName: {
-          type: 'string',
-          required: true,
-          message: '请选择性别',
-          trigger: ['blur', 'change'],
-        },
-        idCardNumber: [
-          {
-            required: true,
-            message: '请输入证件号',
-            trigger: ['blur', 'change'],
-          },
-          {
-            validator: (rule, value, callback) => {
-              return uni.$u.test.idCard(value);
-            },
-            message: '您输入的证件号不正确',
-            trigger: ['change', 'blur'],
-          },
-        ],
-        idCardExpirationDate: {
-          type: 'string',
-          required: true,
-          message: '请输入证件有效期',
-          trigger: ['change'],
-        },
-      },
-    };
-  },
-  onReady() {
-    //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
-    this.$refs.uForm.setRules(this.rules);
-  },
-  methods: {
-    // 跳转到4/4资质信息
-    handlerSkipNext() {
-      this.$refs.uForm.validate().then(res => {
-        this.$store.commit('SET_LEGALINFO', this.legalInfo);
-        setTimeout(() => {
-          uni.navigateTo({
-            url: '/pageMerchant/mineModule/certification/qualificationInformation',
-          });
-        }, 1500);
-      });
-    },
-    sexSelect(e) {
-      this.legalInfo.sexName = e.name; // 数据渲染
-      this.legalInfo.legalRepresenativeGender = e.index; //后端接收
-      this.$refs.uForm.validateField('userInfo.sex');
-    },
-    handleConfirm(data) {
-      this.legalInfo.idCardExpirationDate = formatTime(data.value, 'YYYY-MM-DD');
-      this.showPicker = false;
-    },
-    // 处理图片
-    fileList(val, data) {
-      if (data == 1) {
-        this.legalInfo.idCardFrontPhoto = val[0];
-      } else if (data == 2) {
-        this.legalInfo.idCardBackPhoto = val[0];
-      }
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-.container {
-  background-color: #f7f7f7 !important;
-  padding-bottom: 40rpx;
-
-  .top-box {
-    color: #666666;
-    font-size: 26rpx;
-    text-align: center;
-    padding: 20rpx 40rpx;
-    background-color: #fff;
-  }
-
-  .content-box {
-    padding: 20rpx 40rpx;
-    background-color: #fff;
-    margin: 10rpx 0;
-
-    .content-item {
-      position: relative;
-
-      .item-r {
-        background-color: #f7f7f7;
-        border-radius: 20rpx;
-
-        .data_select {
-          width: 90%;
-        }
-
-        ::v-deep .u-form-item {
-          width: 100%;
-        }
-
-        ::v-deep .u-form-item__body {
-          padding: 0;
-        }
-      }
-
-      .icon-right-box {
-        position: absolute;
-        right: 15rpx;
-        top: 40rpx;
-      }
-    }
-
-    .upload-text {
-      text-align: center;
-      color: #666666;
-      font-size: 28rpx;
-      margin-top: 20rpx;
-    }
-  }
-
-  .btn {
-    background-color: #5992bb !important;
-    color: #fff;
-    font-size: 32rpx;
-    border-radius: 40rpx;
-    margin-top: 100rpx;
-    margin-bottom: 100rpx;
-    width: 95%;
-  }
-}
-
-::v-deep .uni-select {
-  border: none !important;
-}
-
-::v-deep .uni-select__input-placeholder {
-  font-size: 28rpx !important;
-  color: #cbced4 !important;
-}
-</style>
+<template>
+	<view class="container">
+		<u-form :model="legalInfo" ref="uForm" labelPosition="left" labelWidth="80" :rules="rules">
+			<view class="content-box">
+				<view class="content-item">
+					<u-form-item prop="legalRepresentativeName" required label="法人名称" right>
+						<view class="item-r">
+							<u--input placeholder="请输入法人名称" border="surround"
+								v-model="legalInfo.legalRepresentativeName"></u--input>
+						</view>
+					</u-form-item>
+				</view>
+
+				<view class="content-item">
+					<u-form-item prop="sexName" required label="性别" right @click="showSex = true">
+						<view class="item-r">
+							<u--input placeholder="请选择性别" border="surround" v-model="legalInfo.sexName" />
+						</view>
+					</u-form-item>
+					<view class="icon-right-box">
+						<u-icon name="arrow-right" color="#c5c5c5" size="20"></u-icon>
+					</view>
+				</view>
+
+				<view class="content-item">
+					<u-form-item prop="documentType" required label="证件类型" right>
+						<view class="item-r">
+							<u--input placeholder="居民身份证" border="surround" v-model="legalInfo.documentType"
+								disabled></u--input>
+						</view>
+					</u-form-item>
+				</view>
+				<view class="content-item">
+					<u-form-item prop="idCardNumber" required label="证件号" right>
+						<view class="item-r">
+							<u--input placeholder="请输入证件号" border="surround"
+								v-model="legalInfo.idCardNumber"></u--input>
+						</view>
+					</u-form-item>
+				</view>
+				<view class="content-item">
+					<u-form-item prop="idCardExpirationDate" required label="有效期" right @click="showPicker = true">
+						<view class="item-r">
+							<u--input placeholder="请输入证件有效期" border="surround"
+								v-model="legalInfo.idCardExpirationDate"></u--input>
+						</view>
+					</u-form-item>
+					<view class="icon-right-box">
+						<u-icon name="arrow-right" color="#c5c5c5" size="20"></u-icon>
+					</view>
+				</view>
+			</view>
+
+			<view class="content-box">
+				<u-form-item prop="idCardFrontPhoto">
+					<imgs-upload @update="fileList" :value="1"  :imageList="legalInfo.idCardFrontPhoto" ></imgs-upload>
+					<p class="upload-text">证件正面图(国徽图)</p>
+				</u-form-item>
+			</view>
+
+			<view class="content-box">
+				<u-form-item prop="idCardBackPhoto">
+					<imgs-upload @update="fileList" :value="2" :imageList="legalInfo.idCardBackPhoto" ></imgs-upload>
+					<p class="upload-text">证件反面图(人像图)</p>
+				</u-form-item>
+			</view>
+		</u-form>
+
+		<button class="btn" @click="handlerSkipNext">下一步</button>
+
+		<!-- 性别 -->
+		<u-action-sheet :show="showSex" :actions="actions" title="请选择性别" description="如果选择保密会报错"
+			@close="showSex = false" @select="sexSelect">
+		</u-action-sheet>
+
+		<!-- 时间 -->
+		<u-datetime-picker :show="showPicker" v-model="valueDate" mode="date" @cancel="showPicker = false"
+			@confirm="handleConfirm"></u-datetime-picker>
+	</view>
+</template>
+
+<script>
+	import ImgsUpload from './components/ImgsUpload.vue';
+	import {
+		formatTime
+	} from '@/utils/date';
+
+	export default {
+		components: {
+			ImgsUpload,
+		},
+		data() {
+			return {
+				showSex: false,
+				showPicker: false,
+				valueDate: Number(new Date()),
+				actions: [{
+						index: '1',
+						name: '男',
+					},
+					{
+						index: '2',
+						name: '女',
+					},
+					{
+						index: '0',
+						name: '保密',
+					},
+				],
+				legalInfo: {
+					legalRepresentativeName: '',
+					legalRepresenativeGender: '',
+					idCardExpirationDate: '',
+					idCardNumber: '',
+					idCardFrontPhoto: '',
+					idCardBackPhoto: '',
+					sexName: '',
+				},
+				rules: {
+					legalRepresentativeName: {
+						type: 'string',
+						required: true,
+						message: '请输入法人名称',
+						trigger: ['blur', 'change'],
+					},
+					sexName: {
+						type: 'string',
+						required: true,
+						message: '请选择性别',
+						trigger: ['blur', 'change'],
+					},
+					idCardNumber: [{
+							required: true,
+							message: '请输入证件号',
+							trigger: ['blur', 'change'],
+						},
+						{
+							validator: (rule, value, callback) => {
+								return uni.$u.test.idCard(value);
+							},
+							message: '您输入的证件号不正确',
+							trigger: ['change', 'blur'],
+						},
+					],
+					idCardExpirationDate: {
+						type: 'string',
+						required: true,
+						message: '请输入证件有效期',
+						trigger: ['change'],
+					},
+				},
+			};
+		},
+		onReady() {
+			//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
+			this.$refs.uForm.setRules(this.rules);
+		},
+		onShow() {
+			if (this.$store.state.data.merchantInfo) {
+				this.legalInfo = {
+					legalRepresentativeName: this.$store.state.data.merchantInfo.legalRepresentativeName,
+					// legalRepresenativeGender:  this.$store.state.data.merchantInfo.legalRepresentativeName,
+					idCardExpirationDate: formatTime(this.$store.state.data.merchantInfo.idCardExpirationDate,'YYYY-MM-DD'),
+					idCardNumber: this.$store.state.data.merchantInfo.idCardNumber,
+					idCardFrontPhoto: this.$store.state.data.merchantInfo.idCardFrontPhoto,
+					idCardBackPhoto: this.$store.state.data.merchantInfo.idCardBackPhoto,
+					sexName: this.$store.state.data.merchantInfo.sexName,
+				}
+			}
+		},
+		methods: {
+			// 跳转到4/4资质信息
+			handlerSkipNext() {
+				this.$refs.uForm.validate().then(res => {
+					this.$store.commit('SET_LEGALINFO', this.legalInfo);
+					setTimeout(() => {
+						uni.navigateTo({
+							url: '/pageMerchant/mineModule/certification/qualificationInformation',
+						});
+					}, 1500);
+				});
+			},
+			sexSelect(e) {
+				this.legalInfo.sexName = e.name; // 数据渲染
+				this.legalInfo.legalRepresenativeGender = e.index; //后端接收
+				this.$refs.uForm.validateField('userInfo.sex');
+			},
+			handleConfirm(data) {
+				this.legalInfo.idCardExpirationDate = formatTime(data.value, 'YYYY-MM-DD');
+				this.showPicker = false;
+			},
+			// 处理图片
+			fileList(val, data) {
+				if (data == 1) {
+					this.legalInfo.idCardFrontPhoto = val[0];
+				} else if (data == 2) {
+					this.legalInfo.idCardBackPhoto = val[0];
+				}
+			},
+		},
+	};
+</script>
+
+<style lang="scss" scoped>
+	.container {
+		background-color: #f7f7f7 !important;
+		padding-bottom: 40rpx;
+
+		.top-box {
+			color: #666666;
+			font-size: 26rpx;
+			text-align: center;
+			padding: 20rpx 40rpx;
+			background-color: #fff;
+		}
+
+		.content-box {
+			padding: 20rpx 40rpx;
+			background-color: #fff;
+			margin: 10rpx 0;
+
+			.content-item {
+				position: relative;
+
+				.item-r {
+					background-color: #f7f7f7;
+					border-radius: 20rpx;
+
+					.data_select {
+						width: 90%;
+					}
+
+					::v-deep .u-form-item {
+						width: 100%;
+					}
+
+					::v-deep .u-form-item__body {
+						padding: 0;
+					}
+				}
+
+				.icon-right-box {
+					position: absolute;
+					right: 15rpx;
+					top: 40rpx;
+				}
+			}
+
+			.upload-text {
+				text-align: center;
+				color: #666666;
+				font-size: 28rpx;
+				margin-top: 20rpx;
+			}
+		}
+
+		.btn {
+			background-color: #5992bb !important;
+			color: #fff;
+			font-size: 32rpx;
+			border-radius: 40rpx;
+			margin-top: 100rpx;
+			margin-bottom: 100rpx;
+			width: 95%;
+		}
+	}
+
+	::v-deep .uni-select {
+		border: none !important;
+	}
+
+	::v-deep .uni-select__input-placeholder {
+		font-size: 28rpx !important;
+		color: #cbced4 !important;
+	}
+</style>

+ 13 - 3
src/pageMerchant/mineModule/certification/qualificationInformation.vue

@@ -45,7 +45,7 @@
 
         <view class="content-item">
           <u-form-item prop="businessPhoto">
-            <imgs-upload @update="fileList" :value="1"></imgs-upload>
+            <imgs-upload @update="fileList" :value="1" :imageList="aptitudeInfo.businessPhoto" ></imgs-upload>
             <p class="upload-text">证件正面图</p>
           </u-form-item>
         </view>
@@ -93,7 +93,7 @@
 
         <view class="content-item">
           <u-form-item prop="businessLicensePhoto">
-            <imgs-upload @update="fileList" :value="2"></imgs-upload>
+            <imgs-upload @update="fileList" :value="2"  :imageList="aptitudeInfo.businessLicensePhoto"></imgs-upload>
 
             <p class="upload-text">证件正面图</p>
           </u-form-item>
@@ -170,7 +170,17 @@ export default {
     //如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
     this.$refs.uForm.setRules(this.rules);
   },
-  onShow() {
+  onShow() {
+	  if (this.$store.state.data.merchantInfo) {
+	  	this.aptitudeInfo = {
+	  		businessLicenseId: this.$store.state.data.merchantInfo.idCardNumber,
+	  		businessLicenseExpirationDate: formatTime(this.$store.state.data.merchantInfo.businessLicenseExpirationDate,'YYYY-MM-DD') ,
+	  		businessPhoto: this.$store.state.data.merchantInfo.businessPhoto,
+	  		businessLicenseNumberValid:  this.$store.state.data.merchantInfo.businessLicenseNumberValid,
+	  		businessLicenseExpirationDateValid:  formatTime(this.$store.state.data.merchantInfo.businessLicenseExpirationDateValid,'YYYY-MM-DD'),
+	  		businessLicensePhoto: this.$store.state.data.merchantInfo.businessLicenseExpirationDateValid,
+	  	}
+	  }
     this.legalInfo = this.$store.state.data.legalInfo;
     this.storeInfo = this.$store.state.data.storeInfo;
   },

+ 2 - 1
src/pageMerchant/mineModule/certification/storeInformation.vue

@@ -262,7 +262,8 @@
 			this.request()
 		},
 		mounted() {
-
+			// this.ancillaryBusiness = ["1790006554189725698", "1790006554189725698"]
+			// this.ancillaryBusinessName = ["洗车美容", "普洗"]
 		},
 		onShow() {
 			this.initCityData();

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

@@ -125,6 +125,13 @@
 			async getMerchantAuth() {
 				let res = await getMerchantAuthData();
 				console.log(res, "获取商家信息")
+				this.$store.dispatch('SwitchIdentity', 'MERCHANT')
+				// 将数据存储到vuex中
+				this.merchantInfo = Object.assign({}, {
+					...res.data,
+					mobileNumber: res.data.mobileNumber,
+				});
+				this.$store.commit('SET_MERCHANTINFO', res.data);
 				if (res.code === 'OK' && res.data) {
 					if (res.data.reviewStatus == 2) {
 						//跳转认证中页面
@@ -134,21 +141,14 @@
 						});
 						this.cancelSwitch();
 					} else if (res.data.reviewStatus == 1) {
-						//通过认证
-						this.$store.dispatch('SwitchIdentity', 'MERCHANT')
-						// 将数据存储到vuex中
-						this.merchantInfo = Object.assign({}, {
-							...res.data,
-							mobileNumber: res.data.mobileNumber,
-						});
-						this.$store.commit('SET_MERCHANTINFO', res.data);
+				 
 						uni.navigateTo({
 							url: '/pageMerchant/index',
 						});
 						this.cancelSwitch();
 					} else {
 						this.title = "警告!"
-						this.content = `认证未通过,审核意见:${res.data.message}. 点击确认进入查看信息`
+						this.content = `认证未通过, ${res.data.message?'审核意见:' +res.data.message : "" }. 点击确认进入查看信息`
 					}
 				} else {
 					this.title = "温馨提示!"

+ 2 - 2
src/utils/request.js

@@ -11,10 +11,10 @@ import {
 
 // 每次请求都创建一个新的实例
 const instance = axios.create({
-  // baseURL: 'https://test.api.chelvc.com',
+  baseURL: 'https://test.api.chelvc.com',
   // baseURL: "http://192.168.68.77:11000",
   // baseURL: "https://358175z5l5.yicp.fun",
-  baseURL: "http://localhost:11000",
+  // baseURL: "http://localhost:11000",
   timeout: 10000,
   adapter: UniAdapter,
 });