Procházet zdrojové kódy

门店审核认证接口对接

lilei před 2 roky
rodič
revize
086c0bd9cf
5 změnil soubory, kde provedl 163 přidání a 47 odebrání
  1. 2 2
      App.vue
  2. 30 0
      api/xprh.js
  3. 35 5
      pages/index/index.vue
  4. 95 40
      pages/storeManage/storeAuth.vue
  5. 1 0
      store/index.js

+ 2 - 2
App.vue

@@ -1,8 +1,8 @@
 <script>
 	export default {
 		globalData: {
-			// baseUrl: 'http://192.168.0.215:9110/saas/clz/', // 本地
-			baseUrl: 'https://md.test.zyucgj.com/saas/clz/', // 预发布
+			baseUrl: 'http://192.168.0.102:9110/saas/clz/', // 本地
+			// baseUrl: 'https://md.test.zyucgj.com/saas/clz/', // 预发布
 			// baseUrl: 'https://car.zyucgj.com/saas/clz/' // 生产
 		},
 		onLaunch: function() {

+ 30 - 0
api/xprh.js

@@ -0,0 +1,30 @@
+import request from './request';
+// 门店认证
+export const xprhStoreApply = (params) => {
+  return request({
+    url: `xprh/apply/create`,
+    data: params,
+    method: 'post'
+  })
+}
+// 门店认证详情
+export const xprhStoreApplyDetail = (params) => {
+  return request({
+    url: `xprh/findBySn/${params.sn}`,
+    method: 'get'
+  })
+}
+// 查询用户最新申请
+export const xprhStoreApplyFindLast = (params) => {
+  return request({
+    url: `xprh/apply/findLast/${params.contactPhone}`,
+    method: 'get'
+  })
+}
+// 已读
+export const xprhStoreApplyRead = (params) => {
+  return request({
+    url: `xprh/apply/read/${params.sn}`,
+    method: 'get'
+  })
+}

+ 35 - 5
pages/index/index.vue

@@ -21,6 +21,10 @@
 			<view class="notices flex align_center" v-if="!bondRecord&&orderTodo" @click="toOrder">
 				<view><u-icon name="volume" color="#f2a557" :size="28" :margin-right='15'></u-icon> 您有待取货的货架订单哦!</view> <text class="text">立即处理>></text>
 			</view>
+			<!-- 门店审核不通过 -->
+			<view class="notices flex align_center" v-if="storeApply.auditStatus=='REFUSE'&&storeApply.readFlag=='0'">
+				<view><u-icon name="volume" color="#f2a557" :size="28" :margin-right='15'></u-icon> 门店认证资料审核不通过,请重新提交审核!</view> <text class="text" @click="toKnow">知道了</text>
+			</view>
 			<!-- 名片 -->
 			<view class="userCard flex align_center justify_between" @click="toUser">
 				<view class="userCard-info flex align_center justify_between">
@@ -40,7 +44,7 @@
 				</view>
 				<view>
 					<text v-if="userInfo&&userInfo.identifyType=='VISITOR'" class="user-rz">
-						认证成为门店
+						{{storeApply.auditStatus=='WAIT'?'认证门店审核中':'认证成为门店'}}
 					</text>
 					<u-icon name="arrow-right"></u-icon>
 				</view>
@@ -92,6 +96,7 @@
 	import scrollBox from '@/components/scrollBox.vue'
 	import UniStatusBar from '@/components/uni-status-bar/uni-status-bar.vue'
 	import { shelfBondRecordWaitPayRecord, findStoreShelf, shelfGetTotalWaitQty } from '@/api/shelf.js'
+	import { xprhStoreApplyFindLast, xprhStoreApplyRead } from '@/api/xprh.js'
 	import { listLookUp, getLookUpDatas } from '@/api/data.js';
 	import { scanVinLogQueryRoll, getScanVinLogList }from '@/api/car.js'
 	export default {
@@ -118,6 +123,9 @@
 			},
 			userInfo(){
 				return this.$store.state.vuex_userInfo
+			},
+			storeApply(){
+				return this.$store.state.vuex_storeAuthInfo
 			}
 		},
 		onReady() {
@@ -156,8 +164,10 @@
 				uni.stopPullDownRefresh();
 			}, 1000);
 		},
-		onShareAppMessage() {
-			
+		onShareAppMessage() {},
+		onShow() {
+			// 查询门店认证信息
+			this.findLastApply()
 		},
 		methods: {
 			pageInit(){
@@ -190,11 +200,31 @@
 					}
 				});
 			},
+			// 获取最新申请门店
+			findLastApply(){
+				// const mobile = this.userInfo.mobile
+				xprhStoreApplyFindLast({contactPhone: '13709146193'}).then(res => {
+					console.log(res)
+					this.$store.state.vuex_storeAuthInfo = res.data || null;
+				})
+			},
+			// 知道审核不通过
+			toKnow(){
+				uni.showLoading({
+					title: "正在提交"
+				})
+				xprhStoreApplyRead({sn:this.storeApply.applySn}).then(res => {
+					if(res.status == 200){
+						this.findLastApply()
+					}
+					uni.hideLoading()
+				})
+			},
 			// 待取货数量合计
 			shelfGetTotalWaitQty(){
 				shelfGetTotalWaitQty({billState:'WAIT'}).then(res => {
 					if(res.status == 200){
-						this.orderTodo = res.data
+						this.orderTodo = res.data;
 					}
 				})
 			},
@@ -302,7 +332,7 @@
 					})
 				}else{
 					uni.navigateTo({
-						url: '/pages/login/login'
+						url: '/pages/storeManage/storeAuth'
 					})
 				}
 			},

+ 95 - 40
pages/storeManage/storeAuth.vue

@@ -1,8 +1,11 @@
 <template>
 	<view class="apply-wrap flex flex_column">
+		<view v-if="tipTit">
+			<u-alert-tips :show-icon="true" type="warning" :title="tipTit"></u-alert-tips>
+		</view>
 		<view class="login-form">
-			<u-form :model="form" label-width="180rpx" :error-type="['toast']" ref="uForm">
-				<u-form-item label="门头照片" required prop="storePhoto">
+			<u-form v-if="!isRead" :model="form" label-width="180rpx" :error-type="['toast']" ref="uForm">
+				<u-form-item label="门头照片" required prop="storeImage">
 					<u-upload 
 					@on-success="uploadStorePhoto" 
 					@on-remove="removeStorePhoto" 
@@ -26,8 +29,8 @@
 					upload-text="上传营业执照"
 					max-count="1"></u-upload>
 				</u-form-item>
-				<u-form-item label="门店名称" required prop="name">
-					<u-input v-model="form.name" maxlength="30" placeholder="请输入门店名称(最多30个字符)"/>
+				<u-form-item label="门店名称" required prop="storeName">
+					<u-input v-model="form.storeName" maxlength="30" placeholder="请输入门店名称(最多30个字符)"/>
 				</u-form-item>
 				<u-form-item label="所在地区" required prop="label">
 					<u-input v-model="form.label" placeholder="请选择省市区" :disabled="true" @click="openAddress"/>
@@ -36,18 +39,45 @@
 				<u-form-item label="详细地址" required prop="addrDetail">
 					<u-input v-model="form.addrDetail" placeholder="请输入详细地址"/>
 				</u-form-item>
-				<u-form-item label="联系人姓名" required prop="userName">
-					<u-input v-model="form.userName" placeholder="请输入联系人姓名"/>
+				<u-form-item label="联系人姓名" required prop="contactName">
+					<u-input v-model="form.contactName" placeholder="请输入联系人姓名"/>
 				</u-form-item>
 				<u-form-item label="联系人手机">
 					{{form.contactPhone}}
 				</u-form-item>
 				<u-form-item label="汽配商邀请码">
-					<u-input v-model="form.code" placeholder="如没有可不填"/>
+					<u-input v-model="form.inviteCode" placeholder="如没有可不填"/>
+				</u-form-item>
+			</u-form>
+			<!-- 详情 -->
+			<u-form v-else :model="form" label-width="180rpx" :error-type="['toast']" ref="uForm">
+				<u-form-item label="门头照片" required prop="storeImage">
+					<u-image :src="form.storeImage" width="200" height="150"></u-image>
+				</u-form-item>
+				<u-form-item label="营业执照">
+					<u-image :src="form.licenseImage" width="200" height="150"></u-image>
+				</u-form-item>
+				<u-form-item label="门店名称" required prop="storeName">
+					{{form.storeName||'--'}}
+				</u-form-item>
+				<u-form-item label="所在地区" required prop="label">
+					{{form.label||'--'}}
+				</u-form-item>
+				<u-form-item label="详细地址" required prop="addrDetail">
+					{{form.addrDetail||'--'}}
+				</u-form-item>
+				<u-form-item label="联系人姓名" required prop="contactName">
+					{{form.contactName||'--'}}
+				</u-form-item>
+				<u-form-item label="联系人手机">
+					{{form.contactPhone||'--'}}
+				</u-form-item>
+				<u-form-item label="汽配商邀请码">
+					{{form.inviteCode||'--'}}
 				</u-form-item>
 			</u-form>
 		</view>
-		<view class="form-btn-con flex justify_center">
+		<view class="form-btn-con flex justify_center" v-if="!isRead">
 			<u-button class="form-btn" shape="circle" type="info" :custom-style="{ background: '#066cff', color: '#fff',width:'350rpx' }" @click="formSubmit">提交审核</u-button>
 		</view>
 	</view>
@@ -57,7 +87,7 @@
 	import Address from '@/components/address.vue'
 	import uniPopup from '@/components/uni-popup/uni-popup.vue'
 	import popupCon from '@/components/uni-popup/popup-con.vue'
-	import { sendVerifyCode, apply, validateUser } from '@/api/user.js'
+	import { xprhStoreApply } from '@/api/xprh.js'
 	const baseUrl = getApp().globalData.baseUrl
 	export default{
 		components: {
@@ -69,20 +99,33 @@
 			return{
 				theme: '',
 				form: {
-					name: '',
+					storeImage:'',
+					licenseImage:'',
+					storeName: '',
 					addrProvince: '',
 					addrCity: '',
 					addrDistrict: '',
+					addrProvinceName: '',
+					addrCityName: '',
+					addrDistrictName: '',
 					addrDetail: '',
+					contactName:'',
 					contactPhone: '',
-					label: ''
+					label: '',
+					inviteCode:''
 				},
 				rules: {
-					name: [
+					storeImage:[
+						{
+							required: true, 
+							message: '请选择门头照片', 
+							trigger: 'change'
+						}
+					],
+					storeName: [
 						{ 
 							required: true, 
 							message: '请输入门店名称', 
-							// 可以单个或者同时写两个触发验证方式 
 							trigger: ['change','blur'],
 						}
 					],
@@ -100,13 +143,22 @@
 							trigger: 'change'
 						}
 					],
+					contactName: [
+						{
+							required: true, 
+							message: '请输入联系人姓名', 
+							trigger: 'change'
+						}
+					]
 				},
 				areaIdArr: [],  //  省市区id数组
+				labelArr: [],
 				action: baseUrl + '/upload',
 				storePhotoList: [],
-				itemIconArr: [], // 门店图片
 				yyzzPhotoList: [],
-				yyzzIconArr: [], // 营业执照图片
+				storeApply: null,
+				isRead: false,
+				tipTit: ''
 			}
 		},
 		// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
@@ -114,24 +166,39 @@
 			this.$refs.uForm.setRules(this.rules);
 		},
 		onLoad() {
-			this.form.contactPhone = this.$store.state.vuex_userInfo.mobile
+			// 判断是否审核中
+			this.storeApply = this.$store.state.vuex_storeAuthInfo
+			if(this.storeApply){
+				this.isRead = this.storeApply.auditStatus == 'WAIT'
+				this.tipTit = this.storeApply.auditStatus == 'WAIT' ? '门店认证资料审核中,请耐心等待' : (this.storeApply.auditStatus == 'REFUSE' ? '门店认证资料审核不通过,请重新提交审核!' : '')
+				this.form = Object.assign(this.form, this.storeApply)
+				this.storePhotoList = this.form.storeImage ? [{url:this.form.storeImage}] : []
+				this.yyzzPhotoList = this.form.licenseImage ? [{url:this.form.licenseImage}] : [],
+				this.labelArr = [this.form.addrProvinceName,this.form.addrCityName,this.form.addrDistrictName]
+				this.areaIdArr = [this.form.addrProvince,this.form.addrCity,this.form.addrDistrict]
+				this.form.label = this.labelArr.join('-')
+			}else{
+				// this.form.contactPhone = this.$store.state.vuex_userInfo.mobile
+				this.form.contactPhone = '13709146193'
+				this.tipTit = ''
+			}
 		},
 		methods: {
 			// 上传门店图片成功
 			uploadStorePhoto(res){
-				this.itemIconArr.push(res.data)
+				this.form.storeImage = res.data
 			},
 			// 删除门店图片
 			removeStorePhoto(index){
-				this.itemIconArr.splice(index,1)
+				this.form.storeImage = ''
 			},
 			// 上传营业执照图片成功
 			uploadYyzzPhoto(res){
-				this.yyzzIconArr.push(res.data)
+				this.form.licenseImage = res.data
 			},
 			// 删除营业执照图片
 			removeYyzzPhoto(index){
-				this.yyzzIconArr.splice(index,1)
+				this.form.licenseImage = ''
 			},
 			//  表单提交
 			formSubmit(){
@@ -149,35 +216,23 @@
 				obj.addrProvince = this.areaIdArr[0]  //  省id
 				obj.addrCity = this.areaIdArr[1]  //  市id
 				obj.addrDistrict = this.areaIdArr[2]  //  区id
+				obj.addrProvinceName = this.labelArr[0]  //  省
+				obj.addrCityName = this.labelArr[1]  //  市
+				obj.addrDistrictName = this.labelArr[2]  //  区
 				//  申请试用
-				apply(obj).then(res => {
+				xprhStoreApply(obj).then(res => {
 					console.log(res)
 					if(res.status == 200){
-						 
-					}else{
-						uni.showToast({icon: 'none',title: res.message})
+						 uni.navigateBack()
+						 uni.$emit("updateAuthState")
 					}
+					uni.showToast({icon: 'none',title: res.message})
 				})
 			},
-			//  获取验证码
-			getCodeValidate(){
-				if(this.form.contactPhone){
-					//  校验手机号是否注册过
-					validateUser({phone: this.form.contactPhone}).then(res => {
-						if(res.status == 200){
-							//  图文验证码
-							this.$refs.imageTxtPopup.open()
-						}else{
-							uni.showToast({icon: 'none',title: res.message})
-						}
-					})
-				}else{
-					uni.showToast({icon: 'none',title: '请先输入手机号'})
-				}
-			},
 			//  选择省区市
 			areaConfirm(e) {
 				console.log('已选择的省市区', e)
+				this.labelArr = e.labelArr
 				this.areaIdArr = [ e.provinceCode, e.cityCode, e.areaCode ]
 				this.form.label = e.label
 			},

+ 1 - 0
store/index.js

@@ -52,6 +52,7 @@ const store = new Vuex.Store({
 		vuex_openid: "",
 		vuex_nowStaffData: null, // 员工临时数据
 		vuex_vinScanNums:null, // 扫描次数
+		vuex_storeAuthInfo: null // 门店认证状态信息
     },
 	getters:{
 		getOpeid(state){