|
@@ -13,10 +13,8 @@
|
|
|
import { ref, computed } from 'vue'
|
|
|
import { onLoad } from '@dcloudio/uni-app'
|
|
|
import { getJobAdvertisedShareQrcode } from '@/api/user'
|
|
|
-import { getJobFair } from '@/api/jobFair'
|
|
|
-// import { getEnterpriseDetails } from '@/api/user'
|
|
|
-// import { getEnterpriseDetails } from '@/api/user'
|
|
|
- // const positionList = listData.value.length ? JSON.stringify(listData.value.slice(0, 2)) : "0"
|
|
|
+import { getJobFairEntJobPage, getJobFair } from '@/api/jobFair'
|
|
|
+import { formatName } from '@/utils/getText'
|
|
|
|
|
|
const shareUrl = ref('')
|
|
|
const windowWidth = ref(0)
|
|
@@ -30,21 +28,22 @@ onLoad(async (options) => {
|
|
|
enterpriseId = options.enterpriseId
|
|
|
await getJobFairDetail()
|
|
|
await getEntPositionList()
|
|
|
- // await getJobFairEntDetail()
|
|
|
const windowInfo = wx.getWindowInfo()
|
|
|
windowWidth.value = windowInfo.windowWidth
|
|
|
console.log(windowWidth.value, '当前机型屏幕宽')
|
|
|
+ if (shareImg) createPoster() // 生成海报
|
|
|
})
|
|
|
|
|
|
const getJobFairDetail = async () => {
|
|
|
if (!jobFairId) return
|
|
|
const { data } = await getJobFair(jobFairId)
|
|
|
shareImg = data?.contentImg || ''
|
|
|
- if (shareImg) createPoster()
|
|
|
}
|
|
|
|
|
|
+let positionNameList = []
|
|
|
+let entLogoUrl = ''
|
|
|
const getEntPositionList = async () => {
|
|
|
- if (!jobFairId || enterpriseId) {
|
|
|
+ if (!jobFairId || !enterpriseId) {
|
|
|
uni.showToast({ title: '获取企业岗位失败,请重试!', icon: 'none', duration: 2000 })
|
|
|
return
|
|
|
}
|
|
@@ -55,26 +54,13 @@ const getEntPositionList = async () => {
|
|
|
jobFairId,
|
|
|
enterpriseId,
|
|
|
}
|
|
|
- // tab对应的职位类型id列表
|
|
|
- const idList = tabIndex.value !== -1 ? tabList.value[tabIndex.value]?.value : []
|
|
|
- idList?.length && idList.forEach((value, index) => { params[`positionId[${index}]`] = value })
|
|
|
- //
|
|
|
const res = await getJobFairEntJobPage(params)
|
|
|
- const list = res?.data?.list || []
|
|
|
- // list.forEach(e => {
|
|
|
- // e.job = dealDictObjData({}, e)
|
|
|
- // e.enterprise = { ...e.enterprise, ...dealDictObjData({}, e.enterprise)}
|
|
|
- // })
|
|
|
- // listData.value = listData.value.concat(list)
|
|
|
- // showShareBtn.value = true
|
|
|
- // if (listData.value?.length === +res?.data?.total) {
|
|
|
- // more.value = 'noMore'
|
|
|
- // return
|
|
|
- // }
|
|
|
- } catch (error) {
|
|
|
- query.pageNo--
|
|
|
- more.value = 'more'
|
|
|
- }
|
|
|
+ const list = res?.data?.list?.length ? res.data.list : []
|
|
|
+ positionNameList = list.map(e => { return formatName(e?.name) })
|
|
|
+ entLogoUrl = list[0]?.enterprise?.logoUrl || ''
|
|
|
+ entName = list[0]?.enterprise?.anotherName || ''
|
|
|
+ debugger
|
|
|
+ } catch (error) {}
|
|
|
}
|
|
|
|
|
|
const imgStyle = computed(() => {
|
|
@@ -131,11 +117,10 @@ const getToLocal = (base64data) => {
|
|
|
// 生成分享二维码
|
|
|
const qrCode = ref()
|
|
|
const handleShareCode = async () => {
|
|
|
+ const result = await saveShareQuery({ jobFairId, enterpriseId, entName })
|
|
|
const query = {
|
|
|
- scene: `jobFairId=${jobFairId}&enterpriseId=${enterpriseId}&entName=${entName}`,
|
|
|
- scene: 'jobFairId=' + jobFairId + '&enterpriseId=' + enterpriseId,
|
|
|
- path: 'pages/login/index',
|
|
|
- // path: 'pagesB/jobFair/positionClassification',
|
|
|
+ scene: 'id=' + result.data,
|
|
|
+ path: 'pagesB/jobFair/positionClassification',
|
|
|
width: 200,
|
|
|
autoColor: false,
|
|
|
checkPath: true,
|