| | |
| | | <template> |
| | | <view class="full-page"> |
| | | <view class="full-page-fff"> |
| | | <view class="content"> |
| | | <up-form labelPosition="left" :model="enterpriseInfo" :rules="rules" ref="formRef" labelWidth='90'> |
| | | <up-form-item label="营业执照" prop="enterpriseInfo.businessLicense" required ref="item1"> |
| | | <fui-upload immediate :url="`${apiBaseUrl}api/UpFile/UpBizLicense`" ref="uploadB" max='1' |
| | | <up-form-item label="营业执照" prop="businessLicense" required ref="item1"> |
| | | <fui-upload immediate :url="`${apiBaseUrl}/api/UpFile/UpBizLicense`" ref="uploadB" max='1' |
| | | background='#fff' @success="success" @error="error" @complete="complete" width="300" |
| | | height="150"> |
| | | :sizeType='sizeType' height="150"> |
| | | <image |
| | | :src="enterpriseInfo.businessLicense?enterpriseInfo.businessLicense:'/static/enterprise.png'" |
| | | mode="widthFix" style="width: 300rpx;height: 150rpx;"></image> |
| | |
| | | <up-input v-model="enterpriseInfo.regtime" border="none" placeholder="请输入企业注册号" readonly></up-input> |
| | | </up-form-item> |
| | | <up-form-item label="企业地址" required prop="address" ref="item1"> |
| | | <up-input v-model="enterpriseInfo.address" border="none" placeholder="请输入企业地址" |
| | | readonly></up-input> |
| | | <up-input v-model="enterpriseInfo.address" border="none" placeholder="请输入企业地址" readonly></up-input> |
| | | </up-form-item> |
| | | <up-form-item label="联系人" required prop="contact" ref="item1"> |
| | | <up-input v-model="enterpriseInfo.contact" border="none" placeholder="请输入联系人"></up-input> |
| | |
| | | <up-textarea v-model="enterpriseInfo.resume" count placeholder="请输入公司简介" height='200' |
| | | maxlength='800'></up-textarea> |
| | | <view class="tabbtns"> |
| | | <up-button color='#fece01' class="text-69" text="保存" @click="saveUserCompany"></up-button> |
| | | <up-button color='#fece01' class="text-69" text="保存" :loading='isLoading' loadingText="保存中" |
| | | @click="saveUserCompany"></up-button> |
| | | </view> |
| | | </up-form> |
| | | </view> |
| | |
| | | onShow, |
| | | onReady |
| | | } from "@dcloudio/uni-app"; |
| | | let sizeType = ['compressed'] |
| | | let rules = { |
| | | businessLicense: { |
| | | required: true, |
| | |
| | | $db |
| | | } = getCurrentInstance().appContext.config.globalProperties |
| | | onLoad(() => { |
| | | let data = JSON.parse($db.get('userInfo')).userCompany |
| | | const userToken = $db.get("userToken"); |
| | | if (!userToken) { |
| | | uni.showToast({ |
| | | title: '请先登录!', |
| | | icon: 'none', |
| | | duration: 1000, |
| | | complete: function() { |
| | | setTimeout(function() { |
| | | uni.hideToast(); |
| | | uni.navigateTo({ |
| | | url: '/pages/login/index' |
| | | }); |
| | | }, |
| | | 1000); |
| | | } |
| | | }); |
| | | } |
| | | let data = $db.get('userInfo') ? JSON.parse($db.get('userInfo')).userCompany : null |
| | | if (data) { |
| | | enterpriseInfo.businessLicense = data.businessLicense |
| | | enterpriseInfo.suppliername = data.suppliername //企业名称 |
| | |
| | | enterpriseInfo.resume = data.resume |
| | | } |
| | | }) |
| | | |
| | | let isLoading = ref(false) |
| | | // 使用 ref 创建响应式引用 |
| | | const formRef = ref(null); |
| | | onReady(() => { |
| | |
| | | } |
| | | const saveUserCompany = () => { |
| | | formRef.value.validate().then(res => { |
| | | isLoading.value = true |
| | | $api.saveUserCompany(enterpriseInfo).then(res => { |
| | | if (res.code == 1) { |
| | | $api.getUser().then(res => { |
| | |
| | | title: "保存成功!", |
| | | icon: "success" |
| | | }) |
| | | uni.navigateBack() |
| | | } else { |
| | | $util.showToast({ |
| | | title: res.msg |
| | | }) |
| | | } |
| | | isLoading.value = false |
| | | }) |
| | | }).catch(errors => { |
| | | console.log(errors) |
| | |
| | | background-color: #fff; |
| | | padding: 0 20rpx; |
| | | } |
| | | .u-form-item__body{ |
| | | |
| | | .u-form-item__body { |
| | | padding: 5px 0 !important; |
| | | } |
| | | </style> |