From 5644df7aec1ec1bf0ebede821454f120d8016a26 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Sat, 22 Nov 2025 19:28:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/http.api.js | 16 + components/applyForm/index.vue | 178 +++++--- .../calendar-widget/calendar-widget.vue | 2 +- .../company-selector/company-selector.vue | 390 ++++++++++++++++++ packages/course/detail.vue | 10 +- packages/my/index.vue | 23 +- pages/course/index.vue | 20 +- 7 files changed, 564 insertions(+), 75 deletions(-) create mode 100644 components/company-selector/company-selector.vue diff --git a/common/http.api.js b/common/http.api.js index ace8f95..9205832 100644 --- a/common/http.api.js +++ b/common/http.api.js @@ -71,6 +71,11 @@ let apiApp = { // 校友地图 schoolmateCompany:'/api/mobile/other/company-list', + // 企查查公司 + otherCompany:'/api/mobile/other/company', + otherCompanyDetail:'/api/mobile/other/company-detail', + // 企业资质 + companyConfig:'/api/admin/company/config', } // 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作 @@ -146,6 +151,11 @@ const install = (Vue, vm) => { let courseEvaluationDetail = (params = {}) => vm.$u.get(apiApp.courseEvaluationDetail, params); // 校友地图 let schoolmateCompany = (params = {}) => vm.$u.get(apiApp.schoolmateCompany, params); + // 企查查公司 + let otherCompany = (params = {}) => vm.$u.get(apiApp.otherCompany, params); + let otherCompanyDetail = (params = {}) => vm.$u.get(apiApp.otherCompanyDetail, params); + // 企业资质 + let companyConfig = (params = {}) => vm.$u.get(apiApp.companyConfig, params); // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下 vm.$u.api = { // 用户 @@ -210,6 +220,12 @@ const install = (Vue, vm) => { courseEvaluationDetail, // 校友地图 schoolmateCompany, + // 企查查公司 + otherCompany, + // 企业资质 + companyConfig, + // 企查查公司详情 + otherCompanyDetail, }; } diff --git a/components/applyForm/index.vue b/components/applyForm/index.vue index 503bfe3..155ddc3 100644 --- a/components/applyForm/index.vue +++ b/components/applyForm/index.vue @@ -5,21 +5,24 @@ - - - + + - - - - + + + + - + + @@ -71,7 +75,11 @@ import { ROOTPATH as baseUrl } from "@/common/config.js" + import CompanySelector from '@/components/company-selector/company-selector.vue' export default { + components: { + CompanySelector + }, props: { course_forms: { type: Array, @@ -82,6 +90,7 @@ }, data() { return { + showCompanySelector: false, submitForm: {}, now_fileld: 0, // 当前所操作的 filed index值 // 单选 @@ -130,6 +139,45 @@ }, methods: { + // 处理公司选择确认事件 + handleCompanyConfirm(company) { + console.log('选中的公司:', company); + this.course_forms.map(item1 => { + if (item1.field === 'company_name') { + this.$set(item1,'value',company.enterpriseName||'') + } + if (item1.field === 'company_date') { + this.$set(item1,'value',company.startDate||'') + } + if (item1.field === 'company_product') { + this.$set(item1,'value',company.businessScope||'') + } + if (item1.field === 'company_type') { + const company_type = company.tagList && Array.isArray(company.tagList)?company.tagList.join(','):'' + const _arr = company_type.split(',') + this.$set(item1,'value',company_type) + item1.select_item.forEach(item2 => { + console.log("item2",item2) + // 检查 item.value 是否存在于数组 b 中 + const exists = _arr.includes(item2.value); + // 根据检查结果设置 checked 属性 + item2.checked = exists; + this.$set(item2,'checked',exists) + }); + + } + if (item1.field === 'company_area') { + this.$set(item1,'value',company.country||'') + } + if (item1.field === 'company_address') { + this.$set(item1,'value',company.address||'') + } + if (item1.field === 'is_yuanhe') { + this.$set(item1,'value',company.isYhInvested?'是':'否') + } + }) + console.log("this.course_forms",this.course_forms) + }, // 单选 showSelect(item, index) { this.selectList = item.select_item @@ -170,38 +218,38 @@ onUploaded(lists, name, item) { let arr = [] let arrid = [] - console.log("lists---", lists, item) - if(lists.length>0){ - this.course_forms.map(item1 => { - if (item1.field === item.field) { - this.$set(item1,'fileListArr',lists) - } - }) - }else{ - this.course_forms.map(item1 => { - if (item1.field === item.field) { - this.$set(item1,'fileListArr',[]) - } - }) + console.log("lists---", lists, item) + if(lists.length>0){ + this.course_forms.map(item1 => { + if (item1.field === item.field) { + this.$set(item1,'fileListArr',lists) + } + }) + }else{ + this.course_forms.map(item1 => { + if (item1.field === item.field) { + this.$set(item1,'fileListArr',[]) + } + }) } }, onRemove(index, lists, name, item) { let arr = [] - let arrid = [] - if(lists.length>0){ - // item.fileListArr = lists - - this.course_forms.map(item1 => { - if (item1.field === item.field) { - this.$set(item1,'fileListArr',lists) - } - }) - }else{ - this.course_forms.map(item1 => { - if (item1.field === item.field) { - this.$set(item1,'fileListArr',[]) - } - }) + let arrid = [] + if(lists.length>0){ + // item.fileListArr = lists + + this.course_forms.map(item1 => { + if (item1.field === item.field) { + this.$set(item1,'fileListArr',lists) + } + }) + }else{ + this.course_forms.map(item1 => { + if (item1.field === item.field) { + this.$set(item1,'fileListArr',[]) + } + }) } }, // 提交 @@ -258,29 +306,29 @@ return } } - } - - // 文件上传处理 - if(item.edit_input==='files'){ - let valueArr = [] - let fileListArr = [] - console.log("item.fileListArr",item.fileListArr) - if(item.fileListArr && item.fileListArr.length>0){ - item.fileListArr.map(f=>{ - if(f.response){ - valueArr.push(f.response.url.replace(baseUrl, '')) - fileListArr.push(f.response) - }else{ - valueArr.push(f.url.replace(baseUrl, '')) - fileListArr.push(f) - } - }) - }else{ - item.fileListArr = [] - } - item.value = valueArr.join(",") - item.fileList = fileListArr - console.log("submit---",valueArr,fileListArr) + } + + // 文件上传处理 + if(item.edit_input==='files'){ + let valueArr = [] + let fileListArr = [] + console.log("item.fileListArr",item.fileListArr) + if(item.fileListArr && item.fileListArr.length>0){ + item.fileListArr.map(f=>{ + if(f.response){ + valueArr.push(f.response.url.replace(baseUrl, '')) + fileListArr.push(f.response) + }else{ + valueArr.push(f.url.replace(baseUrl, '')) + fileListArr.push(f) + } + }) + }else{ + item.fileListArr = [] + } + item.value = valueArr.join(",") + item.fileList = fileListArr + console.log("submit---",valueArr,fileListArr) } }) if (errorCount > 0) { diff --git a/components/calendar-widget/calendar-widget.vue b/components/calendar-widget/calendar-widget.vue index 2aedbf6..e41237d 100644 --- a/components/calendar-widget/calendar-widget.vue +++ b/components/calendar-widget/calendar-widget.vue @@ -158,7 +158,7 @@ export default { // 课程 if (type === 1) { if (ev.course_id) { - uni.navigateTo({ url: `/packages/course/detail?id=${ev.course_id}` }) + uni.navigateTo({ url: `/packages/course/detail?id=${ev.course_id}&newsUrl=${ev.url}` }) return } // 无 course_id → 需要有开始时间或地点才弹窗 diff --git a/components/company-selector/company-selector.vue b/components/company-selector/company-selector.vue new file mode 100644 index 0000000..ddfb7d6 --- /dev/null +++ b/components/company-selector/company-selector.vue @@ -0,0 +1,390 @@ + + + + + diff --git a/packages/course/detail.vue b/packages/course/detail.vue index 149967f..c198f46 100644 --- a/packages/course/detail.vue +++ b/packages/course/detail.vue @@ -78,7 +78,8 @@ imgList: [], showRegister: false, hasImg: false, - sign_info: {} + sign_info: {}, + newsUrl: '' } }, @@ -98,6 +99,7 @@ }, onLoad(options) { this.course_id = options.id + this.newsUrl = options.newsUrl?options.newsUrl:'' let token = uni.getStorageSync('stbc1_lifeData') ? uni.getStorageSync('stbc1_lifeData').vuex_token : '' if (this.base.isNull(token)) { this.getToken() @@ -254,6 +256,12 @@ // 打开webview页面 openWebview() { + if (this.newsUrl) { + uni.navigateTo({ + url: `/packages/webview/index?type=3&url=${this.newsUrl}` + }) + return + } if (this.info.url) { uni.navigateTo({ url: `/packages/webview/index?type=3&url=${this.info.url}` diff --git a/packages/my/index.vue b/packages/my/index.vue index f0f00e4..9e9ff91 100644 --- a/packages/my/index.vue +++ b/packages/my/index.vue @@ -32,7 +32,7 @@ - + @@ -95,6 +95,8 @@ + + @@ -103,9 +105,11 @@ import { plate } from '@/components/plate/index.vue' + import CompanySelector from '@/components/company-selector/company-selector.vue' export default { components: { - plate + plate, + CompanySelector }, data() { return { @@ -145,6 +149,7 @@ isLocked: false, plate1: '', plateNumber: ['苏', 'E', '', '', '', '', ''], + showCompanySelector: false, rules: { mobile: [{ required: true, @@ -313,6 +318,20 @@ this.plate1 = val.join('') }, + // 处理公司选择确认事件 + handleCompanyConfirm(company) { + console.log('选中的公司:', company); + this.form.company_name = company.enterpriseName||''; + this.form.company_date = company.startDate||''; + this.form.company_product = company.businessScope||''; + if(company.tagList && Array.isArray(company.tagList)){ + this.form.company_type = company.tagList.join(','); + } + this.form.company_area = company.country||''; + this.form.company_address = company.address||''; + this.form.is_yuanhe = company.isYhInvested?'是':'否' + console.log("this.form",this.form) + }, saveUser(type) { if (type == 'add') { diff --git a/pages/course/index.vue b/pages/course/index.vue index ba59df0..451d0d5 100644 --- a/pages/course/index.vue +++ b/pages/course/index.vue @@ -25,14 +25,18 @@ - - + + + + + + - + @@ -282,7 +286,8 @@ } }, // 报名 - toDetail(item) { + toDetail(item) { + console.log("item",item) uni.navigateTo({ url: '/packages/course/detail?id=' + item.id }) @@ -359,13 +364,16 @@ transform: translateY(-50%); width: 56rpx; height: 56rpx; - line-height: 56rpx; + // line-height: 56rpx; text-align: center; border-radius: 56rpx; background: rgba(0,0,0,0.3); color: #fff; z-index: 10; - font-size: 40rpx; + // font-size: 56rpx; + display: flex; + align-items: center; + justify-content: center; } .arrow-left { left: 10rpx; } .arrow-right { right: 10rpx; }