企业信息补全接口联调
This commit is contained in:
@@ -111,6 +111,23 @@ class UniStorageHelper {
|
|||||||
return storeData.filter(item => item[fieldName] === value);
|
return storeData.filter(item => item[fieldName] === value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getRecordCount(storeName) {
|
||||||
|
const storeData = this._storageGet(this._getStoreKey(storeName)) || [];
|
||||||
|
return storeData.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
async deleteOldestRecord(storeName) {
|
||||||
|
const storeKey = this._getStoreKey(storeName);
|
||||||
|
const storeData = this._storageGet(storeKey) || [];
|
||||||
|
if (storeData.length > 0) {
|
||||||
|
// 删除第一条记录(最早的记录)
|
||||||
|
const newData = storeData.slice(1);
|
||||||
|
this._storageSet(storeKey, newData);
|
||||||
|
this._log(`删除最早的记录,剩余${newData.length}条记录`);
|
||||||
|
}
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
|
||||||
/*==================
|
/*==================
|
||||||
更新/删除方法
|
更新/删除方法
|
||||||
==================*/
|
==================*/
|
||||||
|
@@ -65,6 +65,50 @@
|
|||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 企业类型 -->
|
||||||
|
<view class="form-item clickable" @click="selectEnterpriseType">
|
||||||
|
<view class="label">企业类型</view>
|
||||||
|
<view class="input-content">
|
||||||
|
<input class="input-con" v-model="formData.natureText" disabled placeholder="请选择企业类型" />
|
||||||
|
<uni-icons type="arrowright" size="16" color="#999"></uni-icons>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 是否是就业见习基地 -->
|
||||||
|
<view class="form-item clickable" @click="selectEmploymentBase">
|
||||||
|
<view class="label">是否是就业见习基地</view>
|
||||||
|
<view class="input-content">
|
||||||
|
<text class="input-text" :class="{ placeholder: formData.enterpriseType === null }">
|
||||||
|
{{ formData.enterpriseType === null ? '请选择' : (formData.enterpriseType ? '是' : '否') }}
|
||||||
|
</text>
|
||||||
|
<uni-icons type="arrowright" size="16" color="#999"></uni-icons>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 法人身份证号 -->
|
||||||
|
<view class="form-item">
|
||||||
|
<view class="label">法人身份证号</view>
|
||||||
|
<input
|
||||||
|
class="input-field"
|
||||||
|
v-model="formData.legalIdCard"
|
||||||
|
placeholder="请输入法人身份证号"
|
||||||
|
maxlength="18"
|
||||||
|
@input="updateCompletion"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 法人联系方式 -->
|
||||||
|
<view class="form-item">
|
||||||
|
<view class="label">法人联系方式</view>
|
||||||
|
<input
|
||||||
|
class="input-field"
|
||||||
|
v-model="formData.legalPhone"
|
||||||
|
placeholder="请输入法人联系方式"
|
||||||
|
maxlength="11"
|
||||||
|
@input="updateCompletion"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 本地重点发展产业 -->
|
<!-- 本地重点发展产业 -->
|
||||||
<view class="form-item clickable" @click="selectIndustry">
|
<view class="form-item clickable" @click="selectIndustry">
|
||||||
<view class="label">本地重点发展产业</view>
|
<view class="label">本地重点发展产业</view>
|
||||||
@@ -78,7 +122,7 @@
|
|||||||
|
|
||||||
<!-- 是否是本地企业 -->
|
<!-- 是否是本地企业 -->
|
||||||
<view class="form-item clickable" @click="selectLocalCompany">
|
<view class="form-item clickable" @click="selectLocalCompany">
|
||||||
<view class="label">是否是本地企业</view>
|
<view class="label">是否是本地重点发展产业</view>
|
||||||
<view class="input-content">
|
<view class="input-content">
|
||||||
<text class="input-text" :class="{ placeholder: formData.isLocalCompany === null }">
|
<text class="input-text" :class="{ placeholder: formData.isLocalCompany === null }">
|
||||||
{{ formData.isLocalCompany === null ? '请选择' : (formData.isLocalCompany ? '是' : '否') }}
|
{{ formData.isLocalCompany === null ? '请选择' : (formData.isLocalCompany ? '是' : '否') }}
|
||||||
@@ -94,15 +138,25 @@
|
|||||||
<!-- 每个联系人作为一个分组 -->
|
<!-- 每个联系人作为一个分组 -->
|
||||||
<view
|
<view
|
||||||
class="contact-group"
|
class="contact-group"
|
||||||
v-for="(contact, index) in formData.contacts"
|
v-for="(contact, index) in formData.companyContactList"
|
||||||
:key="index"
|
:key="index"
|
||||||
>
|
>
|
||||||
<view class="group-header">联系人{{ index + 1 }}</view>
|
<view class="group-header">
|
||||||
|
<text>联系人{{ index + 1 }}</text>
|
||||||
|
<view
|
||||||
|
class="delete-btn"
|
||||||
|
@click="deleteContact(index)"
|
||||||
|
v-if="formData.companyContactList.length > 1"
|
||||||
|
>
|
||||||
|
<uni-icons type="trash" size="16" color="#ff4757"></uni-icons>
|
||||||
|
<text class="delete-text">删除</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<view class="label">联系人姓名</view>
|
<view class="label">联系人姓名</view>
|
||||||
<input
|
<input
|
||||||
class="input-field"
|
class="input-field"
|
||||||
v-model="contact.name"
|
v-model="contact.contactPerson"
|
||||||
placeholder="请输入联系人姓名"
|
placeholder="请输入联系人姓名"
|
||||||
@input="updateCompletion"
|
@input="updateCompletion"
|
||||||
/>
|
/>
|
||||||
@@ -111,7 +165,7 @@
|
|||||||
<view class="label">联系人电话</view>
|
<view class="label">联系人电话</view>
|
||||||
<input
|
<input
|
||||||
class="input-field"
|
class="input-field"
|
||||||
v-model="contact.phone"
|
v-model="contact.contactPersonPhone"
|
||||||
placeholder="请输入联系人电话"
|
placeholder="请输入联系人电话"
|
||||||
@input="updateCompletion"
|
@input="updateCompletion"
|
||||||
/>
|
/>
|
||||||
@@ -120,7 +174,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 添加联系人按钮 -->
|
<!-- 添加联系人按钮 -->
|
||||||
<view class="add-contact-btn" @click="addContact" v-if="formData.contacts.length < 3">
|
<view class="add-contact-btn" @click="addContact" v-if="formData.companyContactList.length < 3">
|
||||||
<uni-icons type="plus" size="20" color="#256BFA"></uni-icons>
|
<uni-icons type="plus" size="20" color="#256BFA"></uni-icons>
|
||||||
<text>添加联系人</text>
|
<text>添加联系人</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -159,6 +213,9 @@
|
|||||||
|
|
||||||
<!-- 地址选择器 -->
|
<!-- 地址选择器 -->
|
||||||
<area-cascade-picker ref="areaPicker"></area-cascade-picker>
|
<area-cascade-picker ref="areaPicker"></area-cascade-picker>
|
||||||
|
|
||||||
|
<!-- 滚动选择器 -->
|
||||||
|
<SelectPopup ref="selectPopupRef"></SelectPopup>
|
||||||
</AppLayout>
|
</AppLayout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -166,8 +223,11 @@
|
|||||||
import { ref, reactive, computed, inject } from 'vue'
|
import { ref, reactive, computed, inject } from 'vue'
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
import AreaCascadePicker from '@/components/area-cascade-picker/area-cascade-picker.vue'
|
import AreaCascadePicker from '@/components/area-cascade-picker/area-cascade-picker.vue'
|
||||||
|
import SelectPopup from '@/components/selectPopup/selectPopup.vue'
|
||||||
|
import useDictStore from '@/stores/useDictStore'
|
||||||
|
|
||||||
const { $api } = inject('globalFunction')
|
const { $api } = inject('globalFunction')
|
||||||
|
const dictStore = useDictStore()
|
||||||
|
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
@@ -179,10 +239,15 @@ const formData = reactive({
|
|||||||
latitude: null,
|
latitude: null,
|
||||||
companyIntro: '',
|
companyIntro: '',
|
||||||
legalPersonName: '',
|
legalPersonName: '',
|
||||||
|
nature: '', // 企业类型
|
||||||
|
natureText: '', // 企业类型显示文本
|
||||||
|
enterpriseType: null, // 是否是就业见习基地 (true/false/null)
|
||||||
|
legalIdCard: '', // 法人身份证号
|
||||||
|
legalPhone: '', // 法人联系方式
|
||||||
industryType: '', // 是否是本地重点发展产业
|
industryType: '', // 是否是本地重点发展产业
|
||||||
isLocalCompany: null, // 是否是本地企业 (true/false/null)
|
isLocalCompany: null, // 是否是本地企业 (true/false/null)
|
||||||
contacts: [
|
companyContactList: [
|
||||||
{ name: '', phone: '' }
|
{ contactPerson: '', contactPersonPhone: '' }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -197,6 +262,16 @@ const currentEditField = ref('')
|
|||||||
// 地址选择器引用
|
// 地址选择器引用
|
||||||
const areaPicker = ref(null)
|
const areaPicker = ref(null)
|
||||||
|
|
||||||
|
// 滚动选择器引用
|
||||||
|
const selectPopupRef = ref(null)
|
||||||
|
|
||||||
|
// 创建本地的 openSelectPopup 函数
|
||||||
|
const openSelectPopup = (config) => {
|
||||||
|
if (selectPopupRef.value) {
|
||||||
|
selectPopupRef.value.open(config);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 产业类型选项数据
|
// 产业类型选项数据
|
||||||
const industryOptions = [
|
const industryOptions = [
|
||||||
'人工智能',
|
'人工智能',
|
||||||
@@ -206,6 +281,23 @@ const industryOptions = [
|
|||||||
'其他'
|
'其他'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
// 备用企业类型选项(当字典数据加载失败时使用)
|
||||||
|
const fallbackEnterpriseTypes = [
|
||||||
|
{ label: '有限责任公司', value: '1' },
|
||||||
|
{ label: '股份有限公司', value: '2' },
|
||||||
|
{ label: '个人独资企业', value: '3' },
|
||||||
|
{ label: '合伙企业', value: '4' },
|
||||||
|
{ label: '外商投资企业', value: '5' },
|
||||||
|
{ label: '其他', value: '6' }
|
||||||
|
]
|
||||||
|
|
||||||
|
// 企业类型选项数据从字典中获取
|
||||||
|
const enterpriseTypeOptions = computed(() => {
|
||||||
|
const natureData = dictStore.state?.nature || []
|
||||||
|
console.log('企业类型选项数据:', natureData)
|
||||||
|
return natureData
|
||||||
|
})
|
||||||
|
|
||||||
// 完成度计算
|
// 完成度计算
|
||||||
const completionPercentage = computed(() => {
|
const completionPercentage = computed(() => {
|
||||||
const fields = [
|
const fields = [
|
||||||
@@ -214,12 +306,16 @@ const completionPercentage = computed(() => {
|
|||||||
formData.registeredAddress,
|
formData.registeredAddress,
|
||||||
formData.companyIntro,
|
formData.companyIntro,
|
||||||
formData.legalPersonName,
|
formData.legalPersonName,
|
||||||
|
formData.nature,
|
||||||
|
formData.enterpriseType !== null ? 'filled' : '',
|
||||||
|
formData.legalIdCard,
|
||||||
|
formData.legalPhone,
|
||||||
formData.industryType,
|
formData.industryType,
|
||||||
formData.isLocalCompany !== null ? 'filled' : ''
|
formData.isLocalCompany !== null ? 'filled' : ''
|
||||||
]
|
]
|
||||||
|
|
||||||
// 检查联系人信息
|
// 检查联系人信息
|
||||||
const hasContact = formData.contacts.some(contact => contact.name && contact.phone)
|
const hasContact = formData.companyContactList.some(contact => contact.contactPerson && contact.contactPersonPhone)
|
||||||
|
|
||||||
const filledFields = fields.filter(field => field && field.trim()).length + (hasContact ? 1 : 0)
|
const filledFields = fields.filter(field => field && field.trim()).length + (hasContact ? 1 : 0)
|
||||||
const totalFields = fields.length + 1
|
const totalFields = fields.length + 1
|
||||||
@@ -294,6 +390,68 @@ const selectIndustry = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 选择企业类型
|
||||||
|
const selectEnterpriseType = () => {
|
||||||
|
console.log('点击企业类型,当前数据:', enterpriseTypeOptions.value)
|
||||||
|
console.log('字典store状态:', dictStore.state.nature)
|
||||||
|
|
||||||
|
// 获取企业类型选项,优先使用字典数据,失败时使用备用数据
|
||||||
|
let options = enterpriseTypeOptions.value
|
||||||
|
|
||||||
|
if (!options || !options.length) {
|
||||||
|
console.log('企业类型数据为空,尝试重新加载')
|
||||||
|
// 尝试重新加载字典数据
|
||||||
|
dictStore.getDictData().then(() => {
|
||||||
|
if (dictStore.state.nature && dictStore.state.nature.length > 0) {
|
||||||
|
selectEnterpriseType() // 递归调用
|
||||||
|
} else {
|
||||||
|
// 使用备用数据
|
||||||
|
console.log('使用备用企业类型数据')
|
||||||
|
options = fallbackEnterpriseTypes
|
||||||
|
showEnterpriseTypeSelector(options)
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
// 使用备用数据
|
||||||
|
console.log('字典加载失败,使用备用企业类型数据')
|
||||||
|
options = fallbackEnterpriseTypes
|
||||||
|
showEnterpriseTypeSelector(options)
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
showEnterpriseTypeSelector(options)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示企业类型选择器
|
||||||
|
const showEnterpriseTypeSelector = (options) => {
|
||||||
|
console.log('企业类型选项列表:', options)
|
||||||
|
|
||||||
|
openSelectPopup({
|
||||||
|
title: '企业类型',
|
||||||
|
maskClick: true,
|
||||||
|
data: [options],
|
||||||
|
success: (_, [value]) => {
|
||||||
|
console.log('选择的企业类型:', value)
|
||||||
|
formData.nature = value.value
|
||||||
|
formData.natureText = value.label
|
||||||
|
updateCompletion()
|
||||||
|
$api.msg('企业类型选择成功')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择是否是就业见习基地
|
||||||
|
const selectEmploymentBase = () => {
|
||||||
|
uni.showActionSheet({
|
||||||
|
itemList: ['是', '否'],
|
||||||
|
success: (res) => {
|
||||||
|
formData.enterpriseType = res.tapIndex === 0
|
||||||
|
updateCompletion()
|
||||||
|
$api.msg('选择成功')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 选择是否是本地企业
|
// 选择是否是本地企业
|
||||||
const selectLocalCompany = () => {
|
const selectLocalCompany = () => {
|
||||||
uni.showActionSheet({
|
uni.showActionSheet({
|
||||||
@@ -309,11 +467,31 @@ const selectLocalCompany = () => {
|
|||||||
|
|
||||||
// 添加联系人
|
// 添加联系人
|
||||||
const addContact = () => {
|
const addContact = () => {
|
||||||
if (formData.contacts.length < 3) {
|
if (formData.companyContactList.length < 3) {
|
||||||
formData.contacts.push({ name: '', phone: '' })
|
formData.companyContactList.push({ contactPerson: '', contactPersonPhone: '' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 删除联系人
|
||||||
|
const deleteContact = (index) => {
|
||||||
|
if (formData.companyContactList.length <= 1) {
|
||||||
|
$api.msg('至少需要保留一个联系人')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
uni.showModal({
|
||||||
|
title: '确认删除',
|
||||||
|
content: '确定要删除这个联系人吗?',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
formData.companyContactList.splice(index, 1)
|
||||||
|
updateCompletion()
|
||||||
|
$api.msg('联系人已删除')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
const closePopup = () => {
|
const closePopup = () => {
|
||||||
popup.value?.close()
|
popup.value?.close()
|
||||||
@@ -365,6 +543,26 @@ const confirm = () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!formData.nature.trim()) {
|
||||||
|
$api.msg('请选择企业类型')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (formData.enterpriseType === null) {
|
||||||
|
$api.msg('请选择是否是就业见习基地')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.legalIdCard.trim()) {
|
||||||
|
$api.msg('请输入法人身份证号')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!formData.legalPhone.trim()) {
|
||||||
|
$api.msg('请输入法人联系方式')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (!formData.industryType.trim()) {
|
if (!formData.industryType.trim()) {
|
||||||
$api.msg('请选择产业类型')
|
$api.msg('请选择产业类型')
|
||||||
return
|
return
|
||||||
@@ -375,9 +573,23 @@ const confirm = () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 验证身份证号格式
|
||||||
|
const idCardRegex = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
|
||||||
|
if (!idCardRegex.test(formData.legalIdCard)) {
|
||||||
|
$api.msg('请输入正确的身份证号')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证法人电话格式
|
||||||
|
const phoneRegex = /^1[3-9]\d{9}$/
|
||||||
|
if (!phoneRegex.test(formData.legalPhone)) {
|
||||||
|
$api.msg('请输入正确的法人联系方式')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 验证至少有一个联系人
|
// 验证至少有一个联系人
|
||||||
const hasValidContact = formData.contacts.some(contact =>
|
const hasValidContact = formData.companyContactList.some(contact =>
|
||||||
contact.name.trim() && contact.phone.trim()
|
contact.contactPerson.trim() && contact.contactPersonPhone.trim()
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!hasValidContact) {
|
if (!hasValidContact) {
|
||||||
@@ -386,10 +598,9 @@ const confirm = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 验证联系人电话格式
|
// 验证联系人电话格式
|
||||||
const phoneRegex = /^1[3-9]\d{9}$/
|
for (let contact of formData.companyContactList) {
|
||||||
for (let contact of formData.contacts) {
|
if (contact.contactPerson.trim() && contact.contactPersonPhone.trim()) {
|
||||||
if (contact.name.trim() && contact.phone.trim()) {
|
if (!phoneRegex.test(contact.contactPersonPhone)) {
|
||||||
if (!phoneRegex.test(contact.phone)) {
|
|
||||||
$api.msg('请输入正确的手机号码')
|
$api.msg('请输入正确的手机号码')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -399,13 +610,28 @@ const confirm = () => {
|
|||||||
// 提交数据
|
// 提交数据
|
||||||
uni.showLoading({ title: '保存中...' })
|
uni.showLoading({ title: '保存中...' })
|
||||||
|
|
||||||
// 这里调用后端接口保存企业信息
|
// 构建提交数据,按照要求的字段映射
|
||||||
const submitData = {
|
const companyData = {
|
||||||
...formData,
|
name: formData.companyName,
|
||||||
contacts: formData.contacts.filter(contact => contact.name.trim() && contact.phone.trim())
|
code: formData.socialCreditCode,
|
||||||
|
registeredAddress: formData.registeredAddress,
|
||||||
|
description: formData.companyIntro,
|
||||||
|
legalPerson: formData.legalPersonName,
|
||||||
|
nature: formData.nature,
|
||||||
|
enterpriseType: formData.enterpriseType,
|
||||||
|
legalIdCard: formData.legalIdCard,
|
||||||
|
legalPhone: formData.legalPhone,
|
||||||
|
industryType: formData.industryType,
|
||||||
|
isLocalCompany: formData.isLocalCompany,
|
||||||
|
companyContactList: formData.companyContactList.filter(contact => contact.contactPerson.trim() && contact.contactPersonPhone.trim())
|
||||||
}
|
}
|
||||||
|
|
||||||
$api.createRequest('/app/company/complete-info', submitData, 'post')
|
// 调用新的接口地址,数据格式为company数组
|
||||||
|
const submitData = {
|
||||||
|
company: companyData
|
||||||
|
}
|
||||||
|
|
||||||
|
$api.createRequest('/app/user/registerUser', submitData, 'post')
|
||||||
.then((resData) => {
|
.then((resData) => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
$api.msg('企业信息保存成功')
|
$api.msg('企业信息保存成功')
|
||||||
@@ -421,9 +647,20 @@ const confirm = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad(async (options) => {
|
||||||
// 可以在这里加载已有的企业信息
|
console.log('企业信息补全页面开始加载')
|
||||||
console.log('企业信息补全页面加载')
|
try {
|
||||||
|
// 初始化字典数据
|
||||||
|
await dictStore.getDictData()
|
||||||
|
console.log('字典数据加载完成:', {
|
||||||
|
nature: dictStore.state.nature,
|
||||||
|
complete: dictStore.complete
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
console.error('字典数据加载失败:', error)
|
||||||
|
$api.msg('数据加载失败,请重试')
|
||||||
|
}
|
||||||
|
console.log('企业信息补全页面加载完成')
|
||||||
})
|
})
|
||||||
|
|
||||||
// 暴露方法给其他页面调用
|
// 暴露方法给其他页面调用
|
||||||
@@ -488,6 +725,19 @@ defineExpose({
|
|||||||
color: #999
|
color: #999
|
||||||
font-size: 26rpx
|
font-size: 26rpx
|
||||||
|
|
||||||
|
.input-con
|
||||||
|
flex: 1
|
||||||
|
font-size: 28rpx
|
||||||
|
color: #333
|
||||||
|
text-align: right
|
||||||
|
background: transparent
|
||||||
|
border: none
|
||||||
|
outline: none
|
||||||
|
|
||||||
|
&::placeholder
|
||||||
|
color: #999
|
||||||
|
font-size: 26rpx
|
||||||
|
|
||||||
.input-content
|
.input-content
|
||||||
flex: 1
|
flex: 1
|
||||||
display: flex
|
display: flex
|
||||||
@@ -534,6 +784,23 @@ defineExpose({
|
|||||||
background: #f8f9fa
|
background: #f8f9fa
|
||||||
font-weight: 500
|
font-weight: 500
|
||||||
border-bottom: 1rpx solid #e8e8e8
|
border-bottom: 1rpx solid #e8e8e8
|
||||||
|
display: flex
|
||||||
|
justify-content: space-between
|
||||||
|
align-items: center
|
||||||
|
|
||||||
|
.delete-btn
|
||||||
|
display: flex
|
||||||
|
align-items: center
|
||||||
|
padding: 8rpx 16rpx
|
||||||
|
background: #fff5f5
|
||||||
|
border: 1rpx solid #ff4757
|
||||||
|
border-radius: 8rpx
|
||||||
|
cursor: pointer
|
||||||
|
|
||||||
|
.delete-text
|
||||||
|
margin-left: 8rpx
|
||||||
|
font-size: 24rpx
|
||||||
|
color: #ff4757
|
||||||
|
|
||||||
.form-item
|
.form-item
|
||||||
border-bottom: 1rpx solid #f0f0f0
|
border-bottom: 1rpx solid #f0f0f0
|
||||||
@@ -630,3 +897,4 @@ defineExpose({
|
|||||||
button::after
|
button::after
|
||||||
border: none
|
border: none
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@@ -538,7 +538,7 @@ function nextDetail(job) {
|
|||||||
const recordData = recommedIndexDb.JobParameter(job);
|
const recordData = recommedIndexDb.JobParameter(job);
|
||||||
recommedIndexDb.addRecord(recordData);
|
recommedIndexDb.addRecord(recordData);
|
||||||
}
|
}
|
||||||
navTo(`/packageA/pages/post/post?jobId=${btoa(job.jobId)}`);
|
navTo(`/packageA/pages/post/post?jobId=${encodeURIComponent(job.jobId)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -98,7 +98,7 @@ const useDictStore = defineStore("dict", () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function dictLabel(dictType, value) {
|
function dictLabel(dictType, value) {
|
||||||
if (state[dictType]) {
|
if (state[dictType] && Array.isArray(state[dictType])) {
|
||||||
for (let i = 0; i < state[dictType].length; i++) {
|
for (let i = 0; i < state[dictType].length; i++) {
|
||||||
let element = state[dictType][i];
|
let element = state[dictType][i];
|
||||||
if (element.value === value) {
|
if (element.value === value) {
|
||||||
@@ -176,6 +176,7 @@ const useDictStore = defineStore("dict", () => {
|
|||||||
|
|
||||||
// 导入
|
// 导入
|
||||||
return {
|
return {
|
||||||
|
state,
|
||||||
getDictData,
|
getDictData,
|
||||||
dictLabel,
|
dictLabel,
|
||||||
oneDictData,
|
oneDictData,
|
||||||
|
1
test-contact-fields.js
Normal file
1
test-contact-fields.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
1
test-delete-contact.js
Normal file
1
test-delete-contact.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
1
test-dict-format.js
Normal file
1
test-dict-format.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
1
test-dictstore-fix.js
Normal file
1
test-dictstore-fix.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
1
test-enterprise-type-picker.js
Normal file
1
test-enterprise-type-picker.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
@@ -104,15 +104,23 @@ export function createRequest(url, data = {}, method = 'GET', loading = false, h
|
|||||||
resolve(resData.data)
|
resolve(resData.data)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// 处理业务错误
|
||||||
|
if (resData.data?.code === 401 || resData.data?.code === 402) {
|
||||||
|
useUserStore().logOut()
|
||||||
|
}
|
||||||
|
// 显示具体的错误信息
|
||||||
|
const errorMsg = msg || '请求出现异常,请联系工作人员'
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: msg,
|
title: errorMsg,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
|
const err = new Error(errorMsg)
|
||||||
|
err.error = resData
|
||||||
|
reject(err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if (resData.data?.code === 401 || resData.data?.code === 402) {
|
// HTTP状态码不是200的情况
|
||||||
useUserStore().logOut()
|
const err = new Error('网络请求失败,请检查网络连接')
|
||||||
}
|
|
||||||
const err = new Error('请求出现异常,请联系工作人员')
|
|
||||||
err.error = resData
|
err.error = resData
|
||||||
reject(err)
|
reject(err)
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user