Browse Source

认证门店

lilei 2 years ago
parent
commit
ca9e4b8aa5
5 changed files with 48 additions and 7 deletions
  1. 7 0
      api/xprh.js
  2. 3 5
      pages/index/index.vue
  3. 3 0
      pages/morePage/morePage.vue
  4. 23 2
      pages/storeManage/storeAuth.vue
  5. 12 0
      store/index.js

+ 7 - 0
api/xprh.js

@@ -27,4 +27,11 @@ export const xprhStoreApplyRead = (params) => {
     url: `xprh/apply/read/${params.sn}`,
     method: 'get'
   })
+}
+// 查询汽配商
+export const xprhFindDealer = (params) => {
+  return request({
+    url: `xprh/apply/findDealer/${params.inviteCode}`,
+    method: 'get'
+  })
 }

+ 3 - 5
pages/index/index.vue

@@ -22,6 +22,7 @@
 				<view><u-icon name="volume" color="#f2a557" :size="28" :margin-right='15'></u-icon> 您有待取货的货架订单哦!</view> <text class="text">立即处理>></text>
 			</view>
 			<!-- 门店审核不通过 -->
+			{{storeApply.auditStatus=='REFUSE'&&storeApply.readFlag=='0'}}
 			<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>
@@ -96,7 +97,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 { xprhStoreApplyRead } from '@/api/xprh.js'
 	import { listLookUp, getLookUpDatas } from '@/api/data.js';
 	import { scanVinLogQueryRoll, getScanVinLogList }from '@/api/car.js'
 	export default {
@@ -203,10 +204,7 @@
 			// 获取最新申请门店
 			findLastApply(){
 				// const mobile = this.userInfo.mobile
-				xprhStoreApplyFindLast({contactPhone: '13709146193'}).then(res => {
-					console.log(res)
-					this.$store.state.vuex_storeAuthInfo = res.data || null;
-				})
+				this.$store.dispatch('getSotreAuth','13709146193')
 			},
 			// 知道审核不通过
 			toKnow(){

+ 3 - 0
pages/morePage/morePage.vue

@@ -85,6 +85,9 @@
 			},
 			userInfo(){
 				return this.$store.state.vuex_userInfo
+			},
+			storeApply(){
+				return this.$store.state.vuex_storeAuthInfo
 			}
 		},
 		onShow() {

+ 23 - 2
pages/storeManage/storeAuth.vue

@@ -46,7 +46,10 @@
 					{{form.contactPhone}}
 				</u-form-item>
 				<u-form-item label="汽配商邀请码">
-					<u-input v-model="form.inviteCode" placeholder="如没有可不填"/>
+					<u-input v-model="form.inviteCode" @input="$u.debounce(findDealer, 500)" placeholder="如没有可不填"/>
+				</u-form-item>
+				<u-form-item label="汽配商" v-if="form.inviteName">
+					{{form.inviteName||'--'}}
 				</u-form-item>
 			</u-form>
 			<!-- 详情 -->
@@ -75,6 +78,9 @@
 				<u-form-item label="汽配商邀请码">
 					{{form.inviteCode||'--'}}
 				</u-form-item>
+				<u-form-item label="汽配商">
+					{{form.inviteName||'--'}}
+				</u-form-item>
 			</u-form>
 		</view>
 		<view class="form-btn-con flex justify_center" v-if="!isRead">
@@ -87,7 +93,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 { xprhStoreApply } from '@/api/xprh.js'
+	import { xprhStoreApply, xprhFindDealer } from '@/api/xprh.js'
 	const baseUrl = getApp().globalData.baseUrl
 	export default{
 		components: {
@@ -200,6 +206,21 @@
 			removeYyzzPhoto(index){
 				this.form.licenseImage = ''
 			},
+			findDealer(v){
+				if(!this.form.inviteCode){return}
+				uni.showLoading({
+					title: "正在查询"
+				})
+				xprhFindDealer({inviteCode: this.form.inviteCode}).then(res => {
+					if(res.status == 200){
+						this.form.inviteName = res.data
+					}else{
+						this.form.inviteCode = ''
+					}
+					uni.showToast({icon: 'none',title: res.message})
+					uni.hideLoading()
+				})
+			},
 			//  表单提交
 			formSubmit(){
 				this.$refs.uForm.validate(valid => {

+ 12 - 0
store/index.js

@@ -4,6 +4,7 @@ Vue.use(Vuex)
 import {code2Session, logout, checkLogin} from '@/api/login.js'
 import {getLookUpDatas} from '@/api/data.js'
 import { getScanVinQty } from '@/api/car.js'
+import { xprhStoreApplyFindLast } from '@/api/xprh.js'
 let lifeData = {};
 
 try{
@@ -110,8 +111,19 @@ const store = new Vuex.Store({
 		setScanNums(state,nums) {
 			state.vuex_vinScanNums = nums
 		},
+		setStoreAuthInfo(state,obj) {
+			state.vuex_storeAuthInfo = obj
+		}
     },
 	actions: {
+		// 获取门店审核
+		getSotreAuth(context,mobile){
+			xprhStoreApplyFindLast({contactPhone: mobile}).then(res => {
+				console.log(res)
+				context.commit('setStoreAuthInfo',res.data || null)
+			})
+		},
+		// 获取查询次数
 		getScanNums(context,provider){
 			getScanVinQty().then(res => {
 				context.commit('setScanNums',res.data||0)