Merge branch 'mrr_sj_develop_hjy_20260520_商家改版' of https://gitee.com/qtvbidt/mrr.sj.front into mrr_sj_develop_hjy_20260520_商家改版
This commit is contained in:
commit
6d6c279731
|
|
@ -73,7 +73,7 @@
|
|||
v-if="!userInfo.servers_kill_arr || userInfo.servers_kill_arr.length === 0">
|
||||
</image>
|
||||
<text style="margin-right: 16rpx;"
|
||||
:style="{ color: (userInfo.servers_kill_arr && userInfo.servers_kill_arr.length > 0) ? '#333333' : '#ec5d57' }">
|
||||
:style="{ color: (userInfo.servers_kill_arr && userInfo.servers_kill_arr.length > 0) ? '#c9c9c9' : '#ec5d57' }">
|
||||
{{ (userInfo.servers_kill_arr && userInfo.servers_kill_arr.length > 0) ? '已设置' :
|
||||
'待完善' }}
|
||||
</text>
|
||||
|
|
@ -630,14 +630,12 @@
|
|||
})
|
||||
},
|
||||
|
||||
navigateToQualification() { // 商家手艺人:资质信息
|
||||
navigateToQualification() {
|
||||
if (this.userInfo.credentials_state == '1') {
|
||||
// 商家跳转到资质信息页面
|
||||
uni.navigateTo({
|
||||
url: '/pages/ruzhu/ruzhu?type=1'
|
||||
})
|
||||
} else {
|
||||
// 手艺人跳转到资质信息页面
|
||||
uni.navigateTo({
|
||||
url: '/pages/shop/qualification_sj_change'
|
||||
})
|
||||
|
|
|
|||
|
|
@ -176,8 +176,7 @@ export default {
|
|||
{
|
||||
title: "店铺装修",
|
||||
url: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/4b558456-2e38-4185-8713-d1f0e6645820.png",
|
||||
// https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/e6e72039-eec4-414c-8a86-aad404602962.png
|
||||
path: "/pages/shop/qualification_sj_change",
|
||||
path: "/pages/artisan/profile",
|
||||
go_id_type: 1,
|
||||
},
|
||||
{
|
||||
|
|
@ -654,6 +653,19 @@ export default {
|
|||
request.post("/sj/user/getUser").then((result) => {
|
||||
this.userInfo = result.data;
|
||||
uni.setStorageSync("syrId", result.data.id);
|
||||
const allReady = result.data.business_time
|
||||
&& result.data.servers_kill_arr
|
||||
&& result.data.servers_kill_arr.length > 0
|
||||
&& result.data.credentials_state === 2;
|
||||
const mgmtCard = this.cardList.find(c => c.title === "管理中心");
|
||||
if (mgmtCard) {
|
||||
const shopItem = mgmtCard.list.find(i => i.title === "店铺装修");
|
||||
if (shopItem) {
|
||||
shopItem.url = allReady
|
||||
? "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/e6e72039-eec4-414c-8a86-aad404602962.png"
|
||||
: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/4b558456-2e38-4185-8713-d1f0e6645820.png";
|
||||
}
|
||||
}
|
||||
});
|
||||
this.getInviteList();
|
||||
},
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -9,6 +9,9 @@
|
|||
<view class="form-item-one box-cont">
|
||||
<view class="label-wrapper">
|
||||
<text class="label required">店铺名称</text>
|
||||
<image class="label-icon"
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108"
|
||||
mode="aspectFit" @click="showTipPopup('name')"></image>
|
||||
</view>
|
||||
<input type="text" v-model="formData.name" placeholder="请输入营业执照的店铺名称" placeholder-class="placeholder"
|
||||
class="input" @input="saveFormDataToLocalDebounce" />
|
||||
|
|
@ -19,7 +22,8 @@
|
|||
<text :class="formData.dependency ? 'picker-value' : 'placeholder'">
|
||||
{{ formData.dependency || '请选择' }}
|
||||
</text>
|
||||
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/dccc4513-377c-4bfa-9fd2-a5cfdb9798f3"
|
||||
<image
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/dccc4513-377c-4bfa-9fd2-a5cfdb9798f3"
|
||||
class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -29,7 +33,8 @@
|
|||
<text :class="formData.address ? 'picker-value' : 'placeholder'">
|
||||
{{ formData.address || '请选择' }}
|
||||
</text>
|
||||
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/dccc4513-377c-4bfa-9fd2-a5cfdb9798f3"
|
||||
<image
|
||||
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/dccc4513-377c-4bfa-9fd2-a5cfdb9798f3"
|
||||
class="arrow-right" mode="aspectFit"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -71,30 +76,63 @@
|
|||
|
||||
<view class="form-item-one box-cont">
|
||||
<text class="label required">联系人电话</text>
|
||||
<input type="number" v-model="formData.contact_phone" placeholder="请输入联系电话" placeholder-class="placeholder"
|
||||
class="input" @input="saveFormDataToLocalDebounce" />
|
||||
<input type="number" v-model="formData.contact_phone" placeholder="请输入联系电话"
|
||||
placeholder-class="placeholder" class="input" @input="saveFormDataToLocalDebounce" />
|
||||
</view>
|
||||
|
||||
<view class="form-item-one box-cont">
|
||||
<text class="label">备用联系人电话</text>
|
||||
<input type="number" v-model="formData.backup_phone" placeholder="请输入备用联系电话" placeholder-class="placeholder"
|
||||
class="input" @input="saveFormDataToLocalDebounce" />
|
||||
<input type="number" v-model="formData.backup_phone" placeholder="请输入备用联系电话"
|
||||
placeholder-class="placeholder" class="input" @input="saveFormDataToLocalDebounce" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-title">
|
||||
<view class="title-bar"></view>
|
||||
<text class="title-text">其他信息</text>
|
||||
</view>
|
||||
|
||||
<view class="form-item-one box-cont">
|
||||
<view class="form-item-one-yqr box-cont invite-code-container">
|
||||
<view class="invite-code-top">
|
||||
<view class="label-wrapper">
|
||||
<text class="label required">邀请码</text>
|
||||
<input type="text" v-model="formData.invite_code" placeholder="请输入邀请码" placeholder-class="placeholder"
|
||||
class="input" @input="saveFormDataToLocalDebounce" />
|
||||
</view>
|
||||
<view class="invite-tip box-cont">
|
||||
<text class="invite-tip-text">请填写邀请人的邀请码,若没有邀请人请填写13131313</text>
|
||||
<input type="text" v-model="formData.invite_code_other" placeholder="请输入邀请码"
|
||||
placeholder-class="placeholder" class="input" @input="handleInviteCodeInput" />
|
||||
</view>
|
||||
|
||||
<!-- 分割线 -->
|
||||
<view class="divider"></view>
|
||||
|
||||
<!-- 邀请人信息 -->
|
||||
<view class="invite-info-container">
|
||||
<!-- 默认提示 -->
|
||||
<text v-if="!formData.invite_code_other" class="invite-tip">
|
||||
请填写邀请人的邀请码,若没有邀请人请填写13131313
|
||||
</text>
|
||||
|
||||
<!-- 验证中 -->
|
||||
<view v-else-if="inviteCodeValidating" class="invite-validating">
|
||||
<text>验证中...</text>
|
||||
</view>
|
||||
|
||||
<!-- 验证失败 -->
|
||||
<view v-else-if="inviteCodeError" class="invite-error" :class="{ 'shake-animation': shakeInviteError }">
|
||||
<text>邀请码无效</text>
|
||||
</view>
|
||||
|
||||
<!-- 特殊邀请码13131313 -->
|
||||
<view v-else-if="formData.invite_code_other === '13131313' && !inviterInfo" class="invite-tip">
|
||||
请填写邀请人的邀请码,若没有邀请人请填写13131313
|
||||
</view>
|
||||
|
||||
<!-- 显示邀请人信息 -->
|
||||
<view v-else-if="inviterInfo" class="inviter-info">
|
||||
<text class="inviter-label">邀请人:</text>
|
||||
<text class="inviter-name">{{ inviterInfo.name || inviterInfo.nick_name }}</text>
|
||||
<text class="inviter-divider">/</text>
|
||||
<text class="inviter-phone">{{ inviterInfo.account }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 其他情况(接口返回成功但没有认证铁军的邀请码) -->
|
||||
<view v-else class="invite-error" :class="{ 'shake-animation': shakeInviteError }">
|
||||
<text>邀请码无效</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -146,7 +184,7 @@
|
|||
<view class="tip-popup-body">
|
||||
<view class="tip-title">{{ tipTitle }}</view>
|
||||
<view class="tip-image-container">
|
||||
<image class="tip-image" :src="tipImage" mode="widthFix"></image>
|
||||
<image class="tip-image" :class="currentTipType" :src="tipImage" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="tip-buttons">
|
||||
<view class="tip-btn cancel" @click="hideTipPopup">
|
||||
|
|
@ -164,7 +202,9 @@
|
|||
|
||||
<script>
|
||||
import request from '../../utils/request';
|
||||
import { debounce } from '@/utils/debounce.js';
|
||||
import {
|
||||
debounce
|
||||
} from '@/utils/debounce.js';
|
||||
import ChinaCitys from '../../static/data/ChinaCitys.json';
|
||||
|
||||
export default {
|
||||
|
|
@ -179,7 +219,7 @@ export default {
|
|||
contact_name: '',
|
||||
contact_phone: '',
|
||||
backup_phone: '',
|
||||
invite_code: '',
|
||||
invite_code_other: '',
|
||||
dependency: '',
|
||||
address: '',
|
||||
dependency_code: '',
|
||||
|
|
@ -192,6 +232,7 @@ export default {
|
|||
indicatorStyle: 'height: 68rpx;',
|
||||
tipTitle: '',
|
||||
tipImage: '',
|
||||
currentTipType: '',
|
||||
isSubmit: false,
|
||||
identity: 2,
|
||||
|
||||
|
|
@ -199,7 +240,16 @@ export default {
|
|||
locatinCitys: [],
|
||||
locationAreas: [],
|
||||
locationValue: [0, 0, 0],
|
||||
showLocationPopupFlag: false
|
||||
showLocationPopupFlag: false,
|
||||
// 抖动效果控制
|
||||
shakeInviteError: false,
|
||||
|
||||
// 邀请码相关字段
|
||||
inviteCodeValidating: false,
|
||||
inviteCodeError: false,
|
||||
inviterInfo: null,
|
||||
currentValidatingCode: '',
|
||||
inviteValidationTimer: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -219,7 +269,7 @@ export default {
|
|||
'formData.backup_phone'(newVal) {
|
||||
this.saveFormDataToLocalDebounce();
|
||||
},
|
||||
'formData.invite_code'(newVal) {
|
||||
'formData.invite_code_other'(newVal) {
|
||||
this.saveFormDataToLocalDebounce();
|
||||
},
|
||||
'formData.dependency'(newVal) {
|
||||
|
|
@ -247,6 +297,12 @@ export default {
|
|||
|
||||
this.checkGlobalData();
|
||||
this.checkAddressData();
|
||||
|
||||
this.loadInviteStateFromLocal();
|
||||
|
||||
if (this.formData.invite_code_other) {
|
||||
this.validateInviteCode(this.formData.invite_code_other);
|
||||
}
|
||||
},
|
||||
|
||||
onUnload() {
|
||||
|
|
@ -265,6 +321,10 @@ export default {
|
|||
mounted() {
|
||||
this.locatinCitys = this.ChinaCitys[0].citys;
|
||||
this.locationAreas = this.locatinCitys[0].areas;
|
||||
|
||||
if (this.formData.invite_code_other) {
|
||||
this.validateInviteCode(this.formData.invite_code_other);
|
||||
}
|
||||
},
|
||||
|
||||
onHide() {
|
||||
|
|
@ -272,6 +332,307 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
loadInviteStateFromLocal() {
|
||||
try {
|
||||
const inviteState = uni.getStorageSync('store_invite_state');
|
||||
if (inviteState) {
|
||||
console.log('加载邀请码验证状态:', inviteState);
|
||||
|
||||
// 恢复邀请码验证状态
|
||||
this.inviterInfo = inviteState.inviterInfo || null;
|
||||
this.inviteCodeError = inviteState.inviteCodeError || false;
|
||||
this.currentValidatingCode = inviteState.currentValidatingCode || '';
|
||||
|
||||
// 特殊处理:如果当前邀请码是13131313,确保状态正确
|
||||
if (this.formData.invite_code_other === '13131313') {
|
||||
console.log('检测到特殊邀请码13131313,重置验证状态');
|
||||
this.inviteCodeError = false;
|
||||
this.inviterInfo = null;
|
||||
this.currentValidatingCode = '13131313';
|
||||
}
|
||||
|
||||
// 如果正在验证的邀请码与当前表单中的一致,保持验证状态
|
||||
if (this.currentValidatingCode === this.formData.invite_code_other) {
|
||||
// 状态已恢复,无需额外操作
|
||||
} else {
|
||||
// 如果不一致,重新验证
|
||||
if (this.formData.invite_code_other && this.formData.invite_code_other.trim() !== '') {
|
||||
console.log('邀请码不一致,重新验证:', this.formData.invite_code_other);
|
||||
this.handleInviteCodeInput({
|
||||
detail: {
|
||||
value: this.formData.invite_code_other
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 如果没有保存的状态,重置为初始状态
|
||||
this.resetInviteCodeState();
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('加载邀请码验证状态失败:', e);
|
||||
this.resetInviteCodeState();
|
||||
}
|
||||
},
|
||||
|
||||
// 新增方法:重置邀请码状态
|
||||
resetInviteCodeState() {
|
||||
this.inviteCodeValidating = false;
|
||||
this.inviteCodeError = false;
|
||||
this.inviterInfo = null;
|
||||
this.currentValidatingCode = '';
|
||||
this.shakeInviteError = false;
|
||||
},
|
||||
|
||||
// 新增方法:专门保存邀请码验证状态
|
||||
saveInviteStateToLocal() {
|
||||
try {
|
||||
const inviteState = {
|
||||
inviterInfo: this.inviterInfo,
|
||||
inviteCodeError: this.inviteCodeError,
|
||||
currentValidatingCode: this.currentValidatingCode || this.formData.invite_code_other || ''
|
||||
};
|
||||
uni.setStorageSync('store_invite_state', inviteState);
|
||||
|
||||
console.log('邀请码验证状态已保存:', {
|
||||
hasInviterInfo: !!this.inviterInfo,
|
||||
inviteCodeError: this.inviteCodeError,
|
||||
currentValidatingCode: this.currentValidatingCode
|
||||
});
|
||||
} catch (e) {
|
||||
console.log('保存邀请码验证状态失败:', e);
|
||||
}
|
||||
},
|
||||
// 触发邀请码错误抖动效果
|
||||
triggerInviteErrorShake() {
|
||||
// 触发抖动效果
|
||||
this.shakeInviteError = true;
|
||||
|
||||
// 滚动到邀请码容器位置
|
||||
this.$nextTick(() => {
|
||||
// 使用uni.createSelectorQuery获取邀请码容器的位置
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select('.invite-code-container').boundingClientRect((rect) => {
|
||||
if (rect) {
|
||||
// 获取当前窗口高度
|
||||
const windowHeight = uni.getSystemInfoSync().windowHeight;
|
||||
|
||||
// 判断邀请码容器是否已经在可视区域内
|
||||
// 计算容器在屏幕中的位置比例(0-1之间)
|
||||
const containerTopRatio = rect.top / windowHeight;
|
||||
const containerBottomRatio = (rect.top + rect.height) / windowHeight;
|
||||
|
||||
// 如果容器已经在屏幕中上部(顶部在屏幕中间以上),就不需要滚动
|
||||
// 或者容器整体都在屏幕内,也不需要滚动
|
||||
if (containerTopRatio >= 0 && containerTopRatio < 0.7 &&
|
||||
containerBottomRatio <= 1) {
|
||||
console.log('邀请码容器已在可视区域内,不需要滚动');
|
||||
return;
|
||||
}
|
||||
|
||||
// 滚动到邀请码容器位置,减去一些偏移量让用户体验更好
|
||||
uni.pageScrollTo({
|
||||
scrollTop: rect.top - 50,
|
||||
duration: 300
|
||||
});
|
||||
}
|
||||
}).exec();
|
||||
});
|
||||
|
||||
// 0.5秒后重置抖动状态
|
||||
setTimeout(() => {
|
||||
this.shakeInviteError = false;
|
||||
}, 500);
|
||||
},
|
||||
|
||||
// 处理邀请码输入
|
||||
handleInviteCodeInput(e) {
|
||||
const code = e.detail ? e.detail.value : this.formData.invite_code_other;
|
||||
|
||||
console.log('邀请码输入:', code);
|
||||
|
||||
// 立即重置状态
|
||||
this.inviteCodeValidating = false;
|
||||
this.inviteCodeError = false;
|
||||
this.inviterInfo = null;
|
||||
|
||||
// 如果邀请码为空,不进行验证
|
||||
if (!code || code.trim() === '') {
|
||||
this.formData.invite_code_other = '';
|
||||
this.saveFormDataToLocalDebounce();
|
||||
// 保存空状态
|
||||
this.saveInviteStateToLocal();
|
||||
return;
|
||||
}
|
||||
|
||||
this.formData.invite_code_other = code;
|
||||
this.saveFormDataToLocalDebounce();
|
||||
|
||||
// 【关键修复】如果是13131313,立即通过验证并取消任何正在进行的验证
|
||||
if (code === '13131313') {
|
||||
console.log('检测到特殊邀请码13131313,立即通过');
|
||||
|
||||
// 清除任何可能的定时器
|
||||
if (this.inviteValidationTimer) {
|
||||
clearTimeout(this.inviteValidationTimer);
|
||||
this.inviteValidationTimer = null;
|
||||
}
|
||||
|
||||
// 立即更新状态
|
||||
this.inviteCodeValidating = false;
|
||||
this.inviteCodeError = false;
|
||||
this.inviterInfo = null;
|
||||
this.currentValidatingCode = code;
|
||||
|
||||
// 特殊邀请码也需要保存状态
|
||||
const inviteState = {
|
||||
inviterInfo: null,
|
||||
inviteCodeError: false,
|
||||
currentValidatingCode: code
|
||||
};
|
||||
uni.setStorageSync('store_invite_state', inviteState);
|
||||
|
||||
// 强制更新视图
|
||||
this.$forceUpdate();
|
||||
return;
|
||||
}
|
||||
|
||||
// 记录当前正在验证的邀请码
|
||||
this.currentValidatingCode = code;
|
||||
|
||||
// 立即保存状态(验证中)
|
||||
this.saveInviteStateToLocal();
|
||||
|
||||
// 清除之前的定时器
|
||||
if (this.inviteValidationTimer) {
|
||||
clearTimeout(this.inviteValidationTimer);
|
||||
this.inviteValidationTimer = null;
|
||||
}
|
||||
|
||||
// 设置新的定时器
|
||||
this.inviteValidationTimer = setTimeout(() => {
|
||||
// 检查邀请码是否变化
|
||||
if (this.formData.invite_code_other !== this.currentValidatingCode) {
|
||||
console.log('邀请码已变化,取消验证');
|
||||
return;
|
||||
}
|
||||
|
||||
// 再次检查是否是13131313(双重检查)
|
||||
if (this.formData.invite_code_other === '13131313') {
|
||||
console.log('双重检查:检测到特殊邀请码13131313');
|
||||
this.inviteCodeValidating = false;
|
||||
this.inviteCodeError = false;
|
||||
this.inviterInfo = null;
|
||||
this.currentValidatingCode = '13131313';
|
||||
|
||||
const inviteState = {
|
||||
inviterInfo: null,
|
||||
inviteCodeError: false,
|
||||
currentValidatingCode: '13131313'
|
||||
};
|
||||
uni.setStorageSync('store_invite_state', inviteState);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('开始验证邀请码:', this.formData.invite_code_other);
|
||||
this.validateInviteCode(this.formData.invite_code_other);
|
||||
|
||||
// 清理定时器
|
||||
this.inviteValidationTimer = null;
|
||||
}, 600); // 适当增加延迟时间
|
||||
},
|
||||
|
||||
// 验证邀请码
|
||||
async validateInviteCode(code) {
|
||||
console.log('开始验证邀请码:', code);
|
||||
|
||||
// 特殊邀请码13131313直接通过
|
||||
if (code === '13131313') {
|
||||
console.log('特殊邀请码13131313,直接通过');
|
||||
this.inviteCodeValidating = false;
|
||||
this.inviteCodeError = false;
|
||||
this.inviterInfo = null;
|
||||
this.currentValidatingCode = code;
|
||||
// 特殊邀请码也需要保存状态
|
||||
const inviteState = {
|
||||
inviterInfo: null,
|
||||
inviteCodeError: false,
|
||||
currentValidatingCode: code
|
||||
};
|
||||
uni.setStorageSync('store_invite_state', inviteState);
|
||||
|
||||
// 强制更新视图
|
||||
this.$forceUpdate();
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果邀请码为空
|
||||
if (!code || code.trim() === '') {
|
||||
this.inviteCodeValidating = false;
|
||||
this.inviteCodeError = false;
|
||||
this.inviterInfo = null;
|
||||
this.currentValidatingCode = '';
|
||||
const inviteState = {
|
||||
inviterInfo: null,
|
||||
inviteCodeError: false,
|
||||
currentValidatingCode: ''
|
||||
};
|
||||
uni.setStorageSync('store_invite_state', inviteState);
|
||||
return;
|
||||
}
|
||||
|
||||
// 设置验证中状态
|
||||
this.inviteCodeValidating = true;
|
||||
this.inviteCodeError = false;
|
||||
this.inviterInfo = null;
|
||||
this.currentValidatingCode = code;
|
||||
|
||||
try {
|
||||
// 调用接口验证邀请码
|
||||
const response = await request.post('/user/user/getInvite', {
|
||||
invite_code_other: code
|
||||
});
|
||||
|
||||
console.log('邀请码验证响应:', response);
|
||||
|
||||
// 验证完成
|
||||
this.inviteCodeValidating = false;
|
||||
|
||||
if (response && (response.state === 1 || response.code === 200) && response.data) {
|
||||
const userData = response.data;
|
||||
|
||||
if (userData.account) {
|
||||
// 邀请码有效,保存邀请人信息
|
||||
this.inviterInfo = userData;
|
||||
this.inviteCodeError = false;
|
||||
console.log('邀请码验证通过,邀请人:', userData);
|
||||
} else {
|
||||
// 接口返回数据但没有account字段,说明不是有效邀请人
|
||||
console.log('接口返回数据无效,没有account字段:', userData);
|
||||
this.inviterInfo = null;
|
||||
this.inviteCodeError = true;
|
||||
}
|
||||
} else {
|
||||
// 接口返回错误或数据为空
|
||||
console.log('接口返回错误:', response?.msg || '未知错误');
|
||||
this.inviterInfo = null;
|
||||
this.inviteCodeError = true;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('验证邀请码失败:', error);
|
||||
this.inviteCodeValidating = false;
|
||||
this.inviteCodeError = true;
|
||||
this.inviterInfo = null;
|
||||
} finally {
|
||||
// 无论成功失败都保存状态
|
||||
const inviteState = {
|
||||
inviterInfo: this.inviterInfo,
|
||||
inviteCodeError: this.inviteCodeError,
|
||||
currentValidatingCode: this.currentValidatingCode
|
||||
};
|
||||
uni.setStorageSync('store_invite_state', inviteState);
|
||||
}
|
||||
},
|
||||
checkGlobalData() {
|
||||
if (getApp().globalData.qualificationData) {
|
||||
this.formData = {
|
||||
|
|
@ -288,6 +649,15 @@ export default {
|
|||
const stored = uni.getStorageSync('qualification_form_data');
|
||||
if (stored) {
|
||||
console.log('从本地存储加载数据:', stored);
|
||||
|
||||
const inviteState = uni.getStorageSync('store_invite_state');
|
||||
if (inviteState) {
|
||||
this.inviterInfo = inviteState.inviterInfo;
|
||||
this.inviteCodeError = inviteState.inviteCodeError || false;
|
||||
this.currentValidatingCode = inviteState.currentValidatingCode || '';
|
||||
console.log('加载邀请码验证状态:', inviteState);
|
||||
}
|
||||
|
||||
return stored;
|
||||
}
|
||||
} catch (e) {
|
||||
|
|
@ -303,6 +673,13 @@ export default {
|
|||
saveFormDataToLocal() {
|
||||
try {
|
||||
uni.setStorageSync('qualification_form_data', this.formData);
|
||||
|
||||
const inviteState = {
|
||||
inviterInfo: this.inviterInfo,
|
||||
inviteCodeError: this.inviteCodeError,
|
||||
currentValidatingCode: this.currentValidatingCode
|
||||
};
|
||||
uni.setStorageSync('store_invite_state', inviteState);
|
||||
console.log('数据已保存到本地存储');
|
||||
} catch (e) {
|
||||
console.log('保存数据失败:', e);
|
||||
|
|
@ -337,36 +714,59 @@ export default {
|
|||
},
|
||||
|
||||
getFormData() {
|
||||
return { ...this.formData };
|
||||
return {
|
||||
...this.formData
|
||||
};
|
||||
},
|
||||
|
||||
saveFormData() {
|
||||
if (!this.formData.name) {
|
||||
uni.showToast({ title: '请输入店铺名称', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '请输入店铺名称',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!this.formData.dependency) {
|
||||
uni.showToast({ title: '请选择门店所在地', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '请选择门店所在地',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!this.formData.address) {
|
||||
uni.showToast({ title: '请选择门店详细地址', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '请选择门店详细地址',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!this.formData.contact_name) {
|
||||
uni.showToast({ title: '请输入联系人', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '请输入联系人',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!this.formData.contact_phone) {
|
||||
uni.showToast({ title: '请输入联系人电话', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '请输入联系人电话',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!/^1[3-9]\d{9}$/.test(this.formData.contact_phone)) {
|
||||
uni.showToast({ title: '请输入正确的手机号码', icon: 'none' });
|
||||
uni.showToast({
|
||||
title: '请输入正确的手机号码',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!this.formData.invite_code) {
|
||||
uni.showToast({ title: '请输入邀请码', icon: 'none' });
|
||||
if (!this.formData.invite_code_other) {
|
||||
uni.showToast({
|
||||
title: '请输入邀请码',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
this.saveFormDataToLocal();
|
||||
|
|
@ -381,12 +781,13 @@ export default {
|
|||
showTipPopup(field) {
|
||||
const tipConfig = {
|
||||
'name': {
|
||||
title: '如何找到店铺名称',
|
||||
image: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/4fb3e0a2-4c1a-4433-a181-b7a1dfefd030'
|
||||
title: '如何查看店铺名称',
|
||||
image: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/4a2dc8c2-98d4-4465-ae31-b2ea2d13aa23'
|
||||
}
|
||||
};
|
||||
|
||||
if (tipConfig[field]) {
|
||||
this.currentTipType = field;
|
||||
this.tipTitle = tipConfig[field].title;
|
||||
this.tipImage = tipConfig[field].image;
|
||||
this.showTipPopupFlag = true;
|
||||
|
|
@ -566,7 +967,8 @@ export default {
|
|||
|
||||
const regionParts = [];
|
||||
if (addressData.pname) regionParts.push(addressData.pname);
|
||||
if (addressData.cityname && addressData.cityname !== addressData.pname) regionParts.push(addressData.cityname);
|
||||
if (addressData.cityname && addressData.cityname !== addressData.pname) regionParts.push(addressData
|
||||
.cityname);
|
||||
if (addressData.adname) regionParts.push(addressData.adname);
|
||||
|
||||
const regionText = regionParts.join('');
|
||||
|
|
@ -678,6 +1080,14 @@ export default {
|
|||
font-weight: 500;
|
||||
}
|
||||
|
||||
.invite-code-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 24rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.label-wrapper {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
|
@ -999,4 +1409,50 @@ export default {
|
|||
.tip-btn .btn-text {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.invite-info-container {
|
||||
padding: 20rpx 24rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
min-height: 60rpx;
|
||||
}
|
||||
|
||||
.invite-tip {
|
||||
font-size: 24rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.invite-validating {
|
||||
font-size: 20rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.invite-error {
|
||||
font-size: 24rpx;
|
||||
color: #E8101E;
|
||||
}
|
||||
|
||||
.inviter-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
.inviter-label {
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.inviter-name {
|
||||
color: #333333;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.inviter-divider {
|
||||
color: #666666;
|
||||
margin: 0 5rpx;
|
||||
}
|
||||
|
||||
.inviter-phone {
|
||||
color: #666666;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -416,8 +416,8 @@
|
|||
if (qualificationData.contact_type) {
|
||||
formData.contact_type = qualificationData.contact_type;
|
||||
}
|
||||
if (qualificationData.invite_code) {
|
||||
formData.invite_code_other = qualificationData.invite_code;
|
||||
if (qualificationData.invite_code_other) {
|
||||
formData.invite_code_other = qualificationData.invite_code_other;
|
||||
}
|
||||
if (qualificationData.contact_name) {
|
||||
formData.contact_name = qualificationData.contact_name;
|
||||
|
|
|
|||
Loading…
Reference in New Issue