入住信息修改
This commit is contained in:
parent
66760ee72a
commit
27d4107679
|
|
@ -1,63 +1,54 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="step-tab">
|
<view class="step-tab">
|
||||||
<view class="step-container">
|
<view class="step-container">
|
||||||
<!-- 步骤1: 入驻协议 -->
|
|
||||||
<view class="step-item" :class="getStepClass(0)">
|
<view class="step-item" :class="getStepClass(0)">
|
||||||
<view class="step-icon">
|
<view class="step-icon">
|
||||||
<image
|
<image
|
||||||
v-if="currentStep === 0"
|
v-if="mappedStep === 0"
|
||||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/55a51333-318f-4ae4-8402-aca265bd499d"
|
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/55a51333-318f-4ae4-8402-aca265bd499d"
|
||||||
class="step-img active-circle"
|
class="step-img active-circle"
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
/>
|
/>
|
||||||
<view v-else-if="currentStep > 0" class="step-done">1</view>
|
<view v-else-if="mappedStep > 0" class="step-done">1</view>
|
||||||
<view v-else class="step-number">1</view>
|
<view v-else class="step-number">1</view>
|
||||||
</view>
|
</view>
|
||||||
<text class="step-text" :class="{ active: currentStep === 0 }">入驻协议</text>
|
<text class="step-text" :class="{ active: mappedStep === 0 }">入驻协议</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 第一个连接线 -->
|
|
||||||
<view class="line-segment line-1">
|
<view class="line-segment line-1">
|
||||||
<view class="line-progress" :class="{ active: line1Active, deactivating: line1Deactivating }"></view>
|
<view class="line-progress" :class="{ active: line1Active, deactivating: line1Deactivating }"></view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 步骤2: 根据身份显示不同信息 -->
|
|
||||||
<view class="step-item" :class="getStepClass(1)">
|
<view class="step-item" :class="getStepClass(1)">
|
||||||
<view class="step-icon">
|
<view class="step-icon">
|
||||||
<image
|
<image
|
||||||
v-if="currentStep === 1"
|
v-if="mappedStep === 1"
|
||||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/55a51333-318f-4ae4-8402-aca265bd499d"
|
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/55a51333-318f-4ae4-8402-aca265bd499d"
|
||||||
class="step-img active-circle"
|
class="step-img active-circle"
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
/>
|
/>
|
||||||
<view v-else-if="currentStep > 1" class="step-done">2</view>
|
<view v-else-if="mappedStep > 1" class="step-done">2</view>
|
||||||
<view v-else class="step-number">2</view>
|
<view v-else class="step-number">2</view>
|
||||||
</view>
|
</view>
|
||||||
<text class="step-text" :class="{ active: currentStep === 1 }">
|
<text class="step-text" :class="{ active: mappedStep === 1 }">基本信息</text>
|
||||||
{{ identity === 1 ? '个人信息' : '资质信息' }}
|
|
||||||
</text>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 第二个连接线 -->
|
|
||||||
<view class="line-segment line-2">
|
<view class="line-segment line-2">
|
||||||
<view class="line-progress" :class="{ active: line2Active, deactivating: line2Deactivating }"></view>
|
<view class="line-progress" :class="{ active: line2Active, deactivating: line2Deactivating }"></view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 步骤3: 根据身份显示不同信息 -->
|
|
||||||
<view class="step-item" :class="getStepClass(2)">
|
<view class="step-item" :class="getStepClass(2)">
|
||||||
<view class="step-icon">
|
<view class="step-icon">
|
||||||
<image
|
<image
|
||||||
v-if="currentStep === 2"
|
v-if="mappedStep === 2"
|
||||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/55a51333-318f-4ae4-8402-aca265bd499d"
|
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/55a51333-318f-4ae4-8402-aca265bd499d"
|
||||||
class="step-img active-circle"
|
class="step-img active-circle"
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
/>
|
/>
|
||||||
<view v-else-if="currentStep > 2" class="step-done">3</view>
|
<view v-else-if="mappedStep > 2" class="step-done">3</view>
|
||||||
<view v-else class="step-number">3</view>
|
<view v-else class="step-number">3</view>
|
||||||
</view>
|
</view>
|
||||||
<text class="step-text" :class="{ active: currentStep === 2 }">
|
<text class="step-text" :class="{ active: mappedStep === 2 }">资质认证</text>
|
||||||
{{ identity === 1 ? '资质信息' : '门店信息' }}
|
|
||||||
</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -67,32 +58,23 @@
|
||||||
export default {
|
export default {
|
||||||
name: "StepTab",
|
name: "StepTab",
|
||||||
props: {
|
props: {
|
||||||
// 当前步骤索引 (0, 1, 2)
|
mappedStep: {
|
||||||
currentStep: {
|
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
},
|
|
||||||
// 身份类型:1-手艺人,2-商家
|
|
||||||
identity: {
|
|
||||||
type: Number,
|
|
||||||
default: 2
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
prevStep: 0, // 记录上一步骤
|
prevStep: 0,
|
||||||
line1Active: false, // 第一条线激活状态
|
line1Active: false,
|
||||||
line2Active: false, // 第二条线激活状态
|
line2Active: false,
|
||||||
line1Deactivating: false, // 第一条线正在取消激活
|
line1Deactivating: false,
|
||||||
line2Deactivating: false // 第二条线正在取消激活
|
line2Deactivating: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// 监听currentStep变化,处理线条动画
|
mappedStep(newVal, oldVal) {
|
||||||
currentStep(newVal, oldVal) {
|
|
||||||
this.prevStep = oldVal;
|
this.prevStep = oldVal;
|
||||||
|
|
||||||
// 处理前进动画
|
|
||||||
if (newVal > oldVal) {
|
if (newVal > oldVal) {
|
||||||
if (newVal >= 1) {
|
if (newVal >= 1) {
|
||||||
this.line1Active = true;
|
this.line1Active = true;
|
||||||
|
|
@ -102,38 +84,34 @@ export default {
|
||||||
this.line2Active = true;
|
this.line2Active = true;
|
||||||
this.line2Deactivating = false;
|
this.line2Deactivating = false;
|
||||||
}
|
}
|
||||||
}
|
} else if (newVal < oldVal) {
|
||||||
// 处理返回动画
|
|
||||||
else if (newVal < oldVal) {
|
|
||||||
if (newVal < 2) {
|
if (newVal < 2) {
|
||||||
this.line2Deactivating = true;
|
this.line2Deactivating = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.line2Active = false;
|
this.line2Active = false;
|
||||||
this.line2Deactivating = false;
|
this.line2Deactivating = false;
|
||||||
}, 300); // 与动画持续时间匹配
|
}, 300);
|
||||||
}
|
}
|
||||||
if (newVal < 1) {
|
if (newVal < 1) {
|
||||||
this.line1Deactivating = true;
|
this.line1Deactivating = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.line1Active = false;
|
this.line1Active = false;
|
||||||
this.line1Deactivating = false;
|
this.line1Deactivating = false;
|
||||||
}, 300); // 与动画持续时间匹配
|
}, 300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 初始化线条状态
|
this.line1Active = this.mappedStep >= 1;
|
||||||
this.line1Active = this.currentStep >= 1;
|
this.line2Active = this.mappedStep >= 2;
|
||||||
this.line2Active = this.currentStep >= 2;
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取步骤的CSS类名
|
|
||||||
getStepClass(stepIndex) {
|
getStepClass(stepIndex) {
|
||||||
if (stepIndex === this.currentStep) {
|
if (stepIndex === this.mappedStep) {
|
||||||
return 'active';
|
return 'active';
|
||||||
}
|
}
|
||||||
else if (stepIndex < this.currentStep) {
|
else if (stepIndex < this.mappedStep) {
|
||||||
return 'completed';
|
return 'completed';
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
|
|
@ -259,35 +237,16 @@ export default {
|
||||||
transform-origin: left center;
|
transform-origin: left center;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 激活状态的线条 - 前进动画 */
|
|
||||||
.line-progress.active {
|
.line-progress.active {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #E8101E;
|
background-color: #E8101E;
|
||||||
transition: width 0.3s ease;
|
transition: width 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 取消激活状态的线条 - 返回动画 */
|
|
||||||
.line-progress.deactivating {
|
.line-progress.deactivating {
|
||||||
width: 0%;
|
width: 0%;
|
||||||
background-color: #E8101E;
|
background-color: #E8101E;
|
||||||
transition: width 0.3s ease;
|
transition: width 0.3s ease;
|
||||||
transform-origin: right center;
|
transform-origin: right center;
|
||||||
}
|
}
|
||||||
|
</style>
|
||||||
/* 响应式调整 */
|
|
||||||
@media (max-width: 750rpx) {
|
|
||||||
.step-container {
|
|
||||||
/* padding: 5rpx 40rpx; */
|
|
||||||
}
|
|
||||||
|
|
||||||
.line-segment {
|
|
||||||
/* width: 100rpx; */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* .line-1,
|
|
||||||
.line-2 {
|
|
||||||
margin-left: 15rpx;
|
|
||||||
margin-right: 15rpx;
|
|
||||||
} */
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
||||||
|
|
@ -1006,6 +1006,12 @@
|
||||||
"style": {
|
"style": {
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/ruzhu/successruzhu",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "入驻成功"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -4,23 +4,23 @@
|
||||||
<custom-navbar :title="navTitle" :showBack="true"></custom-navbar>
|
<custom-navbar :title="navTitle" :showBack="true"></custom-navbar>
|
||||||
|
|
||||||
<!-- 步骤切换 -->
|
<!-- 步骤切换 -->
|
||||||
<step-tab :currentStep="currentStep" :identity="identity"></step-tab>
|
<step-tab v-if="currentStep !== 2" :mappedStep="mappedStep"></step-tab>
|
||||||
|
|
||||||
<!-- 内容区域根据身份和步骤显示不同内容 -->
|
<!-- 内容区域根据身份和步骤显示不同内容 -->
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<!-- 入驻协议内容 -->
|
|
||||||
<view class="xieyi_content" v-if="currentStep === 0">
|
<view class="xieyi_content" v-if="currentStep === 0">
|
||||||
<rich-text :nodes="textData.text"></rich-text>
|
<rich-text :nodes="textData.text"></rich-text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 步骤1: 根据身份显示不同内容 -->
|
|
||||||
<view v-else-if="currentStep === 1">
|
<view v-else-if="currentStep === 1">
|
||||||
<!-- 手艺人显示个人信息,商家显示资质信息 -->
|
|
||||||
<qualification-info ref="qualificationInfo"></qualification-info>
|
<qualification-info ref="qualificationInfo"></qualification-info>
|
||||||
</view>
|
</view>
|
||||||
<!-- 步骤2: 根据身份显示不同内容 -->
|
|
||||||
<view v-else-if="currentStep === 2">
|
<view v-else-if="currentStep === 2">
|
||||||
<!-- 手艺人显示资质信息,商家显示门店信息 -->
|
<successruzhu :data="successData"></successruzhu>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view v-else-if="currentStep === 3">
|
||||||
<store-info ref="storeInfo"></store-info>
|
<store-info ref="storeInfo"></store-info>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
<!-- 底部按钮区域 -->
|
<!-- 底部按钮区域 -->
|
||||||
<view class="bottom-fixed">
|
<view class="bottom-fixed">
|
||||||
<!-- 步骤0: 入驻协议 - 只显示下一步 -->
|
<!-- 步骤0: 入驻协议 -->
|
||||||
<view v-if="currentStep === 0" class="step-0-buttons">
|
<view v-if="currentStep === 0" class="step-0-buttons">
|
||||||
<view class="agree">
|
<view class="agree">
|
||||||
<image v-if="!isAgree" src="/static/images/agree_n.png" class="agree-btn" mode="aspectFit"
|
<image v-if="!isAgree" src="/static/images/agree_n.png" class="agree-btn" mode="aspectFit"
|
||||||
|
|
@ -38,24 +38,36 @@
|
||||||
<text class="agree-tip">我已阅读并同意以上协议</text>
|
<text class="agree-tip">我已阅读并同意以上协议</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="next-btn" @click="goNext">
|
<view class="next-btn" @click="goNext">
|
||||||
<text class="next-text">下一步,填写资质信息</text>
|
<text class="next-text">下一步,填写基本信息</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 步骤1: 资质信息 - 显示上一步和下一步 -->
|
<!-- 步骤1: 资质信息 -->
|
||||||
<view v-else-if="currentStep === 1" class="step-1-buttons">
|
<view v-else-if="currentStep === 1" class="step-1-buttons">
|
||||||
<view class="button-row">
|
<view class="button-row">
|
||||||
<view class="prev-btn" @click="goPrev">
|
<view class="prev-btn" @click="goPrev">
|
||||||
<text class="prev-text">上一步</text>
|
<text class="prev-text">上一步</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="next-btn" @click="goNext">
|
<view class="next-btn" @click="goNext">
|
||||||
<text class="next-text">下一步,填写门店信息</text>
|
<text class="next-text">提交入驻</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 步骤2: 门店信息 - 显示上一步和提交申请 -->
|
<!-- 步骤2: 提交成功 -->
|
||||||
<view v-else-if="currentStep === 2" class="step-2-buttons">
|
<view v-else-if="currentStep === 2" class="step-2-buttons">
|
||||||
|
<view class="button-row">
|
||||||
|
<view class="prev-btn" @click="topt">
|
||||||
|
<text class="prev-text">进入平台</text>
|
||||||
|
</view>
|
||||||
|
<view class="submit-btn" @click="goNext">
|
||||||
|
<text class="submit-text">去完成资质认证</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 步骤3: 门店信息 -->
|
||||||
|
<view v-else-if="currentStep === 3" class="step-2-buttons">
|
||||||
<view class="button-row">
|
<view class="button-row">
|
||||||
<view class="prev-btn" @click="goPrev">
|
<view class="prev-btn" @click="goPrev">
|
||||||
<text class="prev-text">上一步</text>
|
<text class="prev-text">上一步</text>
|
||||||
|
|
@ -74,16 +86,18 @@
|
||||||
import StepTab from '@/components/step-tab/step-tab.vue';
|
import StepTab from '@/components/step-tab/step-tab.vue';
|
||||||
import QualificationInfo from './qualification_sj.vue';
|
import QualificationInfo from './qualification_sj.vue';
|
||||||
import StoreInfo from './sj-info.vue';
|
import StoreInfo from './sj-info.vue';
|
||||||
|
import successruzhu from './successruzhu.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
StepTab,
|
StepTab,
|
||||||
QualificationInfo,
|
QualificationInfo,
|
||||||
StoreInfo,
|
StoreInfo,
|
||||||
|
successruzhu
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
currentStep: 0, // 当前步骤索引
|
currentStep:3, // 当前步骤索引
|
||||||
isAgree: false,
|
isAgree: false,
|
||||||
identity: null,
|
identity: null,
|
||||||
textData: {},
|
textData: {},
|
||||||
|
|
@ -92,6 +106,7 @@
|
||||||
navTitle: '商家入驻', // 默认标题
|
navTitle: '商家入驻', // 默认标题
|
||||||
qualificationData: null, // 新增:保存资质信息
|
qualificationData: null, // 新增:保存资质信息
|
||||||
storeInfoData: null, // 新增:保存门店信息
|
storeInfoData: null, // 新增:保存门店信息
|
||||||
|
successData:{},//入驻提示
|
||||||
// 新增:缓存手艺人数据
|
// 新增:缓存手艺人数据
|
||||||
artisanDataCache: {
|
artisanDataCache: {
|
||||||
personalInfo: null,
|
personalInfo: null,
|
||||||
|
|
@ -99,6 +114,14 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
mappedStep() {
|
||||||
|
if (this.currentStep === 0) return 0;
|
||||||
|
if (this.currentStep === 1) return 1;
|
||||||
|
if (this.currentStep === 3) return 2;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
async onLoad(options) {
|
async onLoad(options) {
|
||||||
this.identity = 2;
|
this.identity = 2;
|
||||||
await this.getUserInfoSync()
|
await this.getUserInfoSync()
|
||||||
|
|
@ -113,6 +136,11 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
topt(){
|
||||||
|
uni.switchTab({
|
||||||
|
url:'/pages/home/home'
|
||||||
|
})
|
||||||
|
},
|
||||||
// 获取用户信息(复用不可服务时间页面的方法)
|
// 获取用户信息(复用不可服务时间页面的方法)
|
||||||
async getUserInfoSync() {
|
async getUserInfoSync() {
|
||||||
await request.post('/sj/userSjAuth/details', {
|
await request.post('/sj/userSjAuth/details', {
|
||||||
|
|
@ -122,59 +150,36 @@
|
||||||
let data = result.data
|
let data = result.data
|
||||||
if (getApp().globalData.artisanType == 2) {
|
if (getApp().globalData.artisanType == 2) {
|
||||||
|
|
||||||
//储存已有的商家入驻信息
|
|
||||||
let qualification_form_data = {
|
let qualification_form_data = {
|
||||||
"uscc_num": data.uscc_num,
|
"uscc_type": data.uscc_type || '',
|
||||||
"uscc_name": data.uscc_name,
|
// "contact_identity": 'legal',
|
||||||
"legal_name": data.legal_name,
|
// "contact_name": data.legal_name || data.contact_name || '',
|
||||||
"legal_phone": data.legal_phone,
|
"contact_phone": data.legal_phone || data.contact_phone || '',
|
||||||
"legal_idcard_num": data.legal_idcard_num,
|
"backup_phone": data.backup_phone || '',
|
||||||
"uscc_photo": data.uscc_photo,
|
"invite_code": data.invite_code_other || '',
|
||||||
"legal_idcard_positive": data.legal_idcard_positive,
|
"dependency": data.dependency || '',
|
||||||
"legal_idcard_negative": data.legal_idcard_negative,
|
"address": data.address || '',
|
||||||
"uscc_type": data.uscc_type,
|
"dependency_code": data.dependency_code || '',
|
||||||
"license_valid_type": data.uscc_expiry_type,
|
"dependency_province": data.dependency_province || '',
|
||||||
}
|
"dependency_city": data.dependency_city || '',
|
||||||
if (data.uscc_expiry) {
|
"longitude": data.longitude || '',
|
||||||
let expirys = data.uscc_expiry.split(' —— ')
|
"latitude": data.latitude || '',
|
||||||
qualification_form_data.license_start_date = expirys[0]
|
"name": data.name || '',
|
||||||
qualification_form_data.license_end_date = expirys[1]
|
"contact_type": data.contact_type || ''
|
||||||
}
|
|
||||||
if (data.legal_idcard_expiry) {
|
}
|
||||||
let expirys = data.legal_idcard_expiry.split(' —— ')
|
uni.setStorageSync('qualification_form_data', qualification_form_data);
|
||||||
qualification_form_data.idcard_start_date = expirys[0]
|
let store_info_form_data = {
|
||||||
if (expirys[1]) {
|
"head_photo": data.head_photo,
|
||||||
qualification_form_data.legal_idcard_expiry_type = "date"
|
"name": data.name,
|
||||||
qualification_form_data.idcard_end_date = expirys[1]
|
"business_time": data.business_time,
|
||||||
} else {
|
// "servers_kill": data.servers_kill,
|
||||||
qualification_form_data.legal_idcard_expiry_type = "permanent"
|
"apply_state": data.apply_state,
|
||||||
qualification_form_data.idcard_end_date = ""
|
"invite_code_other": data.invite_code_other,
|
||||||
}
|
"major": data.major
|
||||||
|
}
|
||||||
}
|
console.log(111111111, store_info_form_data)
|
||||||
uni.setStorageSync('qualification_form_data', qualification_form_data);
|
uni.setStorageSync('store_info_form_data', store_info_form_data);
|
||||||
let store_invite_state = {
|
|
||||||
"currentValidatingCode": data.invite_code_other
|
|
||||||
}
|
|
||||||
uni.setStorageSync('store_invite_state', store_invite_state);
|
|
||||||
let store_info_form_data = {
|
|
||||||
"head_photo": data.head_photo,
|
|
||||||
"name": data.name,
|
|
||||||
"business_time": data.business_time,
|
|
||||||
"servers_kill": data.servers_kill,
|
|
||||||
"dependency": data.dependency,
|
|
||||||
"address": data.address,
|
|
||||||
"apply_state": data.apply_state,
|
|
||||||
"invite_code_other": data.invite_code_other,
|
|
||||||
"major": data.major,
|
|
||||||
"dependency_code": data.dependency_code,
|
|
||||||
"dependency_province": data.dependency_province,
|
|
||||||
"dependency_city": data.dependency_city,
|
|
||||||
"longitude": data.longitude,
|
|
||||||
"latitude": data.latitude
|
|
||||||
}
|
|
||||||
console.log(111111111, store_info_form_data)
|
|
||||||
uni.setStorageSync('store_info_form_data', store_info_form_data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -182,65 +187,6 @@
|
||||||
console.error('获取用户信息接口错误:', error);
|
console.error('获取用户信息接口错误:', error);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* 解析身份证有效期字符串,转换为中文日期格式(兼容低版本iOS,支持结束日期为空/长期)
|
|
||||||
* @param {string} expiryStr 原有效期字符串,格式如:"2016-01-29 —— 2026-01-29" | "2016-01-29 —— " | "2016-01-29 —— 长期"
|
|
||||||
* @returns {Object} 包含开始和结束日期的对象
|
|
||||||
*/
|
|
||||||
parseIdCardExpiry(expiryStr) {
|
|
||||||
// 初始化默认值
|
|
||||||
let id_card_start_date = '';
|
|
||||||
let id_card_end_date = '';
|
|
||||||
|
|
||||||
try {
|
|
||||||
// 1. 分割字符串:兼容多种分隔符(——、--、—、-),并去除前后空格
|
|
||||||
const dateParts = expiryStr.split(/\s*[-—]{1,2}\s*/).map(str => str.trim());
|
|
||||||
// 提取开始和结束日期部分(处理分割后长度不足的情况)
|
|
||||||
const startStr = dateParts[0] || '';
|
|
||||||
const endStr = dateParts[1] || '';
|
|
||||||
|
|
||||||
// 2. 日期解析函数(核心:兼容低版本iOS)
|
|
||||||
const formatDateToChinese = (dateStr) => {
|
|
||||||
// 若为空,直接返回空
|
|
||||||
if (!dateStr) return '';
|
|
||||||
// 若为“长期”,直接返回“长期”
|
|
||||||
if (dateStr === '长期') return '长期';
|
|
||||||
|
|
||||||
// 关键:低版本iOS不支持“yyyy-mm-dd”,替换为“yyyy/mm/dd”
|
|
||||||
const compatibleStr = dateStr.replace(/-/g, '/');
|
|
||||||
const date = new Date(compatibleStr);
|
|
||||||
|
|
||||||
// 检查日期是否有效
|
|
||||||
if (isNaN(date.getTime())) {
|
|
||||||
return ''; // 解析失败则返回空
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取年、月、日(去掉前导零)
|
|
||||||
const year = date.getFullYear();
|
|
||||||
const month = date.getMonth() + 1;
|
|
||||||
const day = date.getDate();
|
|
||||||
|
|
||||||
return `${year}年${month}月${day}日`;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 3. 解析开始日期(必须有值,否则置空)
|
|
||||||
if (startStr) {
|
|
||||||
id_card_start_date = formatDateToChinese(startStr);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 4. 解析结束日期(支持空、长期、正常日期)
|
|
||||||
id_card_end_date = formatDateToChinese(endStr);
|
|
||||||
|
|
||||||
} catch (err) {
|
|
||||||
console.error('解析身份证有效期失败:', err);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 5. 返回结果
|
|
||||||
return {
|
|
||||||
id_card_start_date,
|
|
||||||
id_card_end_date
|
|
||||||
};
|
|
||||||
},
|
|
||||||
// 检查并传递地址给商家组件
|
// 检查并传递地址给商家组件
|
||||||
checkAndPassAddressToSj() {
|
checkAndPassAddressToSj() {
|
||||||
try {
|
try {
|
||||||
|
|
@ -248,38 +194,15 @@
|
||||||
if (sjAddress) {
|
if (sjAddress) {
|
||||||
console.log('找到商家地址数据,准备传递:', sjAddress);
|
console.log('找到商家地址数据,准备传递:', sjAddress);
|
||||||
|
|
||||||
// 延迟执行,确保组件已渲染
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.identity === 2 && this.$refs.storeInfo) {
|
if (this.identity === 2 && this.$refs.qualificationInfo) {
|
||||||
console.log('传递地址给商家组件');
|
console.log('传递地址给资质组件');
|
||||||
|
if (typeof this.$refs.qualificationInfo.handleAddressSelected === 'function') {
|
||||||
// 传递给商家组件
|
this.$refs.qualificationInfo.handleAddressSelected(sjAddress);
|
||||||
if (typeof this.$refs.storeInfo.handleAddressSelected === 'function') {
|
|
||||||
this.$refs.storeInfo.handleAddressSelected(sjAddress);
|
|
||||||
} else if (this.$refs.storeInfo.formData) {
|
|
||||||
// 直接设置数据
|
|
||||||
this.$refs.storeInfo.formData.address = sjAddress.address || sjAddress
|
|
||||||
.name;
|
|
||||||
this.$refs.storeInfo.formData.longitude = sjAddress.longitude;
|
|
||||||
this.$refs.storeInfo.formData.latitude = sjAddress.latitude;
|
|
||||||
|
|
||||||
// 设置省市区信息
|
|
||||||
if (sjAddress.pname || sjAddress.cityname || sjAddress.adname) {
|
|
||||||
const locationParts = [];
|
|
||||||
if (sjAddress.pname) locationParts.push(sjAddress.pname);
|
|
||||||
if (sjAddress.cityname) locationParts.push(sjAddress.cityname);
|
|
||||||
if (sjAddress.adname) locationParts.push(sjAddress.adname);
|
|
||||||
this.$refs.storeInfo.formData.dependency = locationParts.join('-');
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$refs.storeInfo.saveFormDataToLocal();
|
|
||||||
this.$refs.storeInfo.$forceUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 清理存储
|
|
||||||
uni.removeStorageSync('sj_selected_address');
|
|
||||||
}
|
}
|
||||||
}, 300);
|
}
|
||||||
|
uni.removeStorageSync('sj_selected_address');
|
||||||
|
}, 300);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('处理商家地址失败:', e);
|
console.error('处理商家地址失败:', e);
|
||||||
|
|
@ -400,82 +323,32 @@
|
||||||
|
|
||||||
// 审核提交方法
|
// 审核提交方法
|
||||||
async submitForReview() {
|
async submitForReview() {
|
||||||
// 提交前确保有用户信息
|
|
||||||
const userInfo = await this.checkAndGetUserInfo();
|
const userInfo = await this.checkAndGetUserInfo();
|
||||||
if (!userInfo) {
|
if (!userInfo) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uni.showLoading({
|
uni.showLoading({ title: '提交中...' });
|
||||||
title: '提交中...'
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log('=== 提交审核调试信息 ===');
|
let formData = this.buildBusinessData(this.qualificationData, {});
|
||||||
console.log('身份类型:', this.identity);
|
formData.type = 1;
|
||||||
console.log('门店信息数据:', this.storeInfoData);
|
formData.id_type = 1;
|
||||||
console.log('资质信息数据:', this.qualificationData);
|
|
||||||
console.log('个人信息数据:', this.personalInfoData);
|
|
||||||
|
|
||||||
|
|
||||||
let apiUrl = '';
|
|
||||||
let formData = {};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (this.identity === 2) {
|
|
||||||
// 商家入驻
|
|
||||||
apiUrl = '/sj/userSjAuth/apply';
|
|
||||||
|
|
||||||
// 确保重新获取最新数据
|
|
||||||
if (this.$refs.storeInfo) {
|
|
||||||
if (!this.$refs.storeInfo.saveFormData()) {
|
|
||||||
uni.hideLoading();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.storeInfoData = this.$refs.storeInfo.getFormData();
|
|
||||||
console.log('重新获取的门店信息:', this.storeInfoData);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 验证服务技能是否存在
|
|
||||||
if (!this.storeInfoData || !this.storeInfoData.servers_kill || this.storeInfoData
|
|
||||||
.servers_kill.length === 0) {
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.showToast({
|
|
||||||
title: '请选择服务技能',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
formData = this.buildBusinessData(this.qualificationData, this.storeInfoData);
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log('提交的数据:', formData);
|
|
||||||
console.log('API URL:', apiUrl);
|
|
||||||
|
|
||||||
formData.type = 1
|
|
||||||
formData.id_type = 1
|
|
||||||
|
|
||||||
const res = await request.post(apiUrl, formData);
|
|
||||||
|
|
||||||
|
const res = await request.post('/sj/userSjAuth/applyOne', formData);
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
|
||||||
if (res.state == 1 || res.code == 200) {
|
if (res.state == 1 || res.code == 200) {
|
||||||
// 提交成功后清除缓存数据
|
this.successData=res.data.customer_service
|
||||||
|
console.log(this.successData,'this.successDatathis.successDatathis.successDatathis.successData=======');
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '提交成功',
|
title: '提交成功',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 1500,
|
duration: 1500
|
||||||
success: () => {
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.redirectTo({
|
|
||||||
url: `./submitres?identity=${this.identity}&applyState=1`
|
|
||||||
});
|
|
||||||
}, 1500);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
this.currentStep = 2;
|
||||||
|
}, 1500);
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg || '提交失败',
|
title: res.msg || '提交失败',
|
||||||
|
|
@ -484,7 +357,6 @@
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
console.error('提交审核失败:', error);
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '提交失败,请重试',
|
title: '提交失败,请重试',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
|
|
@ -492,106 +364,63 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 优化日期格式化方法
|
|
||||||
formatDateForBackend(dateStr) {
|
|
||||||
if (!dateStr) return '';
|
|
||||||
if (dateStr === '长久有效' || dateStr === '长久有效') return '';
|
|
||||||
|
|
||||||
// 将 年月日 格式转换为 YYYY-MM-DD
|
|
||||||
const match = dateStr.match(/(\d+)年(\d+)月(\d+)日/);
|
|
||||||
if (match) {
|
|
||||||
const year = match[1];
|
|
||||||
const month = match[2].padStart(2, '0');
|
|
||||||
const day = match[3].padStart(2, '0');
|
|
||||||
return `${year}-${month}-${day}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果已经是 YYYY-MM-DD 格式,直接返回
|
|
||||||
return dateStr;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 构建商家数据
|
// 构建商家数据
|
||||||
buildBusinessData(qualificationData, storeData) {
|
buildBusinessData(qualificationData, storeData) {
|
||||||
// 根据接口文档构建数据
|
console.log(qualificationData,'storeDatastoreDatastoreData');
|
||||||
const formData = {};
|
const formData = {};
|
||||||
|
|
||||||
// 服务技能处理 - 添加更严格的验证
|
|
||||||
if (storeData && storeData.servers_kill && storeData.servers_kill.length > 0) {
|
|
||||||
// 确保 servers_kill 是数组
|
|
||||||
formData.servers_kill = Array.isArray(storeData.servers_kill) ?
|
|
||||||
storeData.servers_kill : [storeData.servers_kill];
|
|
||||||
|
|
||||||
console.log('服务技能数组:', formData.servers_kill);
|
|
||||||
} else {
|
|
||||||
console.warn('警告:没有服务技能数据');
|
|
||||||
formData.servers_kill = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
// 营业执照信息
|
|
||||||
if (qualificationData.uscc_type) {
|
if (qualificationData.uscc_type) {
|
||||||
formData.uscc_type = qualificationData.uscc_type === 'individual' ? 1 : 2;
|
formData.uscc_type = qualificationData.uscc_type;
|
||||||
}
|
}
|
||||||
if (qualificationData.uscc_photo) {
|
// if (qualificationData.contact_identity) {
|
||||||
formData.uscc_photo = qualificationData.uscc_photo;
|
// formData.contact_identity = qualificationData.contact_identity;
|
||||||
|
// }
|
||||||
|
// if (qualificationData.contact_name) {
|
||||||
|
// formData.contact_name = qualificationData.contact_name;
|
||||||
|
// }
|
||||||
|
if (qualificationData.contact_phone) {
|
||||||
|
formData.contact_phone = qualificationData.contact_phone;
|
||||||
}
|
}
|
||||||
if (qualificationData.uscc_num) {
|
if (qualificationData.backup_phone) {
|
||||||
formData.uscc_num = qualificationData.uscc_num;
|
formData.backup_phone = qualificationData.backup_phone;
|
||||||
}
|
}
|
||||||
if (qualificationData.uscc_name) {
|
if (qualificationData.contact_type) {
|
||||||
formData.uscc_name = qualificationData.uscc_name;
|
formData.contact_type = qualificationData.contact_type;
|
||||||
}
|
}
|
||||||
if (qualificationData.license_valid_type) {
|
if (qualificationData.invite_code) {
|
||||||
formData.uscc_expiry_type = qualificationData.license_valid_type === 'permanent' ? 1 : 2;
|
formData.invite_code_other = qualificationData.invite_code;
|
||||||
|
}
|
||||||
|
if (qualificationData.contact_name) {
|
||||||
|
formData.contact_name = qualificationData.contact_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 格式化有效期
|
if (qualificationData.dependency) {
|
||||||
if (qualificationData.license_start_date) {
|
formData.dependency = qualificationData.dependency;
|
||||||
const startDate = this.formatDateForBackend(qualificationData.license_start_date);
|
}
|
||||||
|
if (qualificationData.dependency_code) {
|
||||||
|
formData.dependency_code = qualificationData.dependency_code;
|
||||||
|
}
|
||||||
|
if (qualificationData.dependency_province) {
|
||||||
|
formData.dependency_province = qualificationData.dependency_province;
|
||||||
|
}
|
||||||
|
if (qualificationData.dependency_city) {
|
||||||
|
formData.dependency_city = qualificationData.dependency_city;
|
||||||
|
}
|
||||||
|
if (qualificationData.name) {
|
||||||
|
formData.name = qualificationData.name;
|
||||||
|
}
|
||||||
|
if (qualificationData.address) {
|
||||||
|
formData.address = qualificationData.address;
|
||||||
|
}
|
||||||
|
if (qualificationData.longitude) formData.longitude = qualificationData.longitude;
|
||||||
|
if (qualificationData.latitude) formData.latitude = qualificationData.latitude;
|
||||||
|
|
||||||
if (qualificationData.license_valid_type === 'permanent') {
|
// if (storeData && storeData.servers_kill && storeData.servers_kill.length > 0) {
|
||||||
// 长久有效格式:开始日期 + " —— "
|
// // formData.servers_kill = Array.isArray(storeData.servers_kill) ?
|
||||||
formData.uscc_expiry = `${startDate} —— `;
|
// // storeData.servers_kill : [storeData.servers_kill];
|
||||||
} else if (qualificationData.license_end_date) {
|
// } else {
|
||||||
// 指定日期格式:开始日期 + " —— " + 结束日期
|
// formData.servers_kill = [];
|
||||||
const endDate = this.formatDateForBackend(qualificationData.license_end_date);
|
// }
|
||||||
formData.uscc_expiry = `${startDate} —— ${endDate}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 法人信息
|
|
||||||
if (qualificationData.legal_name) {
|
|
||||||
formData.legal_name = qualificationData.legal_name;
|
|
||||||
}
|
|
||||||
if (qualificationData.legal_phone) {
|
|
||||||
formData.legal_phone = qualificationData.legal_phone;
|
|
||||||
}
|
|
||||||
if (qualificationData.legal_idcard_num) {
|
|
||||||
formData.legal_idcard_num = qualificationData.legal_idcard_num;
|
|
||||||
}
|
|
||||||
if (qualificationData.legal_idcard_expiry_type) {
|
|
||||||
formData.legal_idcard_expiry_type = qualificationData.legal_idcard_expiry_type === 'permanent' ? 1 : 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 格式化有效期
|
|
||||||
if (qualificationData.idcard_start_date) {
|
|
||||||
const idcardStartDate = this.formatDateForBackend(qualificationData.idcard_start_date);
|
|
||||||
|
|
||||||
if (qualificationData.legal_idcard_expiry_type === 'permanent') {
|
|
||||||
formData.legal_idcard_expiry = `${idcardStartDate} —— `;
|
|
||||||
} else if (qualificationData.idcard_end_date) {
|
|
||||||
const idcardEndDate = this.formatDateForBackend(qualificationData.idcard_end_date);
|
|
||||||
formData.legal_idcard_expiry = `${idcardStartDate} —— ${idcardEndDate}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (qualificationData.legal_idcard_positive) {
|
|
||||||
formData.legal_idcard_positive = qualificationData.legal_idcard_positive;
|
|
||||||
}
|
|
||||||
if (qualificationData.legal_idcard_negative) {
|
|
||||||
formData.legal_idcard_negative = qualificationData.legal_idcard_negative;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 门店信息
|
|
||||||
if (storeData.head_photo) {
|
if (storeData.head_photo) {
|
||||||
formData.head_photo = storeData.head_photo;
|
formData.head_photo = storeData.head_photo;
|
||||||
}
|
}
|
||||||
|
|
@ -601,86 +430,38 @@
|
||||||
if (storeData.business_time) {
|
if (storeData.business_time) {
|
||||||
formData.business_time = storeData.business_time;
|
formData.business_time = storeData.business_time;
|
||||||
}
|
}
|
||||||
if (storeData.servers_kill && storeData.servers_kill.length > 0) {
|
|
||||||
// 直接传递数组
|
|
||||||
formData.servers_kill = storeData.servers_kill;
|
|
||||||
console.log('服务技能数组:', formData.servers_kill);
|
|
||||||
} else {
|
|
||||||
formData.servers_kill = [];
|
|
||||||
console.warn('警告:没有服务技能数据');
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log('最终 formData 中的 servers_kill:', formData.servers_kill);
|
|
||||||
console.log('=== 调试结束 ===');
|
|
||||||
|
|
||||||
if (storeData.dependency) {
|
|
||||||
formData.dependency = storeData.dependency;
|
|
||||||
|
|
||||||
// 地址编码
|
|
||||||
if (storeData.dependency_code) {
|
|
||||||
formData.dependency_code = storeData.dependency_code;
|
|
||||||
}
|
|
||||||
if (storeData.dependency_province) {
|
|
||||||
formData.dependency_province = storeData.dependency_province;
|
|
||||||
}
|
|
||||||
if (storeData.dependency_city) {
|
|
||||||
formData.dependency_city = storeData.dependency_city;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (storeData.address) {
|
|
||||||
formData.address = storeData.address;
|
|
||||||
}
|
|
||||||
// 经纬度
|
|
||||||
if (storeData.longitude) formData.longitude = storeData.longitude;
|
|
||||||
if (storeData.latitude) formData.latitude = storeData.latitude;
|
|
||||||
|
|
||||||
// 其他信息
|
|
||||||
if (storeData.apply_state) {
|
if (storeData.apply_state) {
|
||||||
formData.get_msg_method = storeData.apply_state;
|
formData.get_msg_method = storeData.apply_state;
|
||||||
}
|
}
|
||||||
if (storeData.invite_code_other) {
|
|
||||||
formData.invite_code_other = storeData.invite_code_other;
|
|
||||||
}
|
|
||||||
if (storeData.major) {
|
if (storeData.major) {
|
||||||
formData.major = storeData.major;
|
formData.major = storeData.major;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 账号信息 - 直接从登录时输入的手机号获取
|
|
||||||
// 注意:这里使用 qualificationData 或 storeData 中的手机号,或者从全局获取
|
|
||||||
const userInfo = uni.getStorageSync('userInfo');
|
const userInfo = uni.getStorageSync('userInfo');
|
||||||
|
|
||||||
if (userInfo && userInfo.account) {
|
if (userInfo && userInfo.account) {
|
||||||
formData.account = userInfo.account;
|
formData.account = userInfo.account;
|
||||||
} else {
|
} else {
|
||||||
// 如果全局没有,尝试从本地存储的登录信息获取
|
|
||||||
const loginAccount = uni.getStorageSync('loginAccount');
|
const loginAccount = uni.getStorageSync('loginAccount');
|
||||||
if (loginAccount) {
|
if (loginAccount) {
|
||||||
formData.account = loginAccount;
|
formData.account = loginAccount;
|
||||||
|
} else if (qualificationData.contact_phone) {
|
||||||
|
formData.contact_name = qualificationData.contact_name;
|
||||||
} else {
|
} else {
|
||||||
// 最后尝试:从资质信息或门店信息中获取手机号
|
console.error('无法获取账号信息');
|
||||||
if (qualificationData.legal_phone) {
|
uni.showToast({
|
||||||
formData.account = qualificationData.legal_phone;
|
title: '无法获取用户账号',
|
||||||
} else {
|
icon: 'none'
|
||||||
console.error('无法获取账号信息');
|
});
|
||||||
uni.showToast({
|
return null;
|
||||||
title: '无法获取用户账号',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('使用的账号:', formData.account);
|
|
||||||
return formData;
|
return formData;
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async goNext() {
|
async goNext() {
|
||||||
console.log('当前步骤:', this.currentStep);
|
|
||||||
console.log('身份类型:', this.identity);
|
|
||||||
|
|
||||||
// 步骤0需要同意协议
|
|
||||||
if (this.currentStep === 0 && !this.isAgree) {
|
if (this.currentStep === 0 && !this.isAgree) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请阅读并同意以上协议',
|
title: '请阅读并同意以上协议',
|
||||||
|
|
@ -689,68 +470,55 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 步骤1需要验证信息
|
|
||||||
if (this.currentStep === 1) {
|
if (this.currentStep === 1) {
|
||||||
console.log('商家验证资质信息');
|
|
||||||
// 商家验证资质信息
|
|
||||||
if (this.$refs.qualificationInfo) {
|
if (this.$refs.qualificationInfo) {
|
||||||
const isValid = await this.$refs.qualificationInfo.saveFormData();
|
const isValid = await this.$refs.qualificationInfo.saveFormData();
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
console.log('商家资质信息验证失败');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.qualificationData = this.$refs.qualificationInfo.getFormData();
|
this.qualificationData = this.$refs.qualificationInfo.getFormData();
|
||||||
console.log(' 商家资质信息验证通过 ');
|
|
||||||
}
|
}
|
||||||
|
await this.submitForReview();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 步骤2需要验证信息
|
if (this.currentStep < 3) {
|
||||||
if (this.currentStep === 2) {
|
|
||||||
// 商家验证门店信息
|
|
||||||
if (this.$refs.storeInfo) {
|
|
||||||
const isValid = await this.$refs.storeInfo.saveFormData();
|
|
||||||
if (!isValid) {
|
|
||||||
console.log('商家门店信息验证失败');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.storeInfoData = this.$refs.storeInfo.getFormData();
|
|
||||||
console.log('商家门店信息验证通过');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.currentStep < 2) {
|
|
||||||
this.currentStep++;
|
this.currentStep++;
|
||||||
console.log('切换到步骤:', this.currentStep);
|
|
||||||
|
|
||||||
// 步骤切换后滚动到顶部
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.scrollToTop();
|
this.scrollToTop();
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
} else {
|
|
||||||
this.completeRegistration();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
submitApplication() {
|
async submitApplication() {
|
||||||
// 商家验证门店信息
|
|
||||||
if (this.$refs.storeInfo) {
|
if (this.$refs.storeInfo) {
|
||||||
if (!this.$refs.storeInfo.saveFormData()) {
|
if (!this.$refs.storeInfo.saveFormData()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.storeInfoData = this.$refs.storeInfo.getFormData();
|
this.storeInfoData = this.$refs.storeInfo.getFormData();
|
||||||
console.log('商家门店信息数据:', this.storeInfoData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 提交前确认邀请码
|
uni.showLoading({ title: '提交中...' });
|
||||||
if (this.$refs.storeInfo && this.$refs.storeInfo.confirmInviteCodeBeforeSubmit) {
|
try {
|
||||||
this.$refs.storeInfo.confirmInviteCodeBeforeSubmit(() => {
|
let formData = {};
|
||||||
// 确认后执行提交逻辑
|
if (this.qualificationData) {
|
||||||
this.completeRegistration();
|
Object.assign(formData, this.qualificationData);
|
||||||
});
|
}
|
||||||
} else {
|
if (this.storeInfoData) {
|
||||||
// 不支持邀请码确认,直接提交
|
Object.assign(formData, this.storeInfoData);
|
||||||
this.completeRegistration();
|
}
|
||||||
|
formData.type = 1;
|
||||||
|
formData.id_type = 1;
|
||||||
|
const res = await request.post('/sj/userSjAuth/apply', formData);
|
||||||
|
uni.hideLoading();
|
||||||
|
if (res.state == 1 || res.code == 200) {
|
||||||
|
uni.showToast({ title: '提交成功', icon: 'none' });
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: res.msg || '提交失败', icon: 'none' });
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.showToast({ title: '提交失败,请重试', icon: 'none' });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -759,11 +527,6 @@
|
||||||
this.currentStep--;
|
this.currentStep--;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
completeRegistration() {
|
|
||||||
// 提交审核的逻辑
|
|
||||||
this.submitForReview();
|
|
||||||
},
|
|
||||||
// 添加滚动到顶部的方法
|
|
||||||
scrollToTop() {
|
scrollToTop() {
|
||||||
uni.pageScrollTo({
|
uni.pageScrollTo({
|
||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
|
|
@ -850,7 +613,7 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background: linear-gradient(180deg, #f52540 0%, #e8101e 100%);
|
background: #FF4767;
|
||||||
border-radius: 49rpx;
|
border-radius: 49rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -875,7 +638,7 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background: linear-gradient(180deg, #f52540 0%, #e8101e 100%);
|
background: #FF4767;
|
||||||
border-radius: 49rpx;
|
border-radius: 49rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue