Selaa lähdekoodia

招聘会分享

Xiao_123 2 kuukautta sitten
vanhempi
commit
f406da3372

+ 13 - 0
api/jobFair.js

@@ -52,6 +52,19 @@ export const getJobFairEntJobPage = (params) => {
   })
 }
 
+// 保存分享参数
+export const saveShareQuery = (data) => {
+  return request({
+    url: '/app-api/menduner/system/share/share',
+    method: 'POST',
+    data,
+    custom: {
+      showLoading: false,
+      auth: false
+    }
+  })
+}
+
 // 根据id获取分享参数
 export const getShareQueryById = (params) => {
   return request({

+ 4 - 3
pagesB/jobFair/jobFairShare.vue

@@ -13,7 +13,7 @@
 import { ref, computed } from 'vue'
 import { onLoad } from '@dcloudio/uni-app'
 import { getJobAdvertisedShareQrcode } from '@/api/user'
-import { getJobFair } from '@/api/jobFair'
+import { getJobFair, saveShareQuery } from '@/api/jobFair'
 
 const shareUrl = ref('')
 const windowWidth = ref(0)
@@ -90,13 +90,14 @@ const getToLocal = (base64data) => {
 // 生成分享二维码
 const qrCode = ref()
 const handleShareCode = async () => {
+  const result = await saveShareQuery({ jobFairId })
 	const query = {
-		scene: 'jobFairId=' + jobFairId,
+		scene: 'id=' + result.data,
     path: 'pagesB/jobFair/positionClassification',
 		width: 200,
 		autoColor: false,
 		checkPath: true,
-		hyaline: true
+		hyaline: false
 	}
 	const res = await getJobAdvertisedShareQrcode(query)
 	const data = res?.data ? 'data:image/png;base64,' + res.data : ''

+ 3 - 2
pagesB/jobFair/positionClassification.vue

@@ -72,12 +72,13 @@ onLoad(async (options) => {
 	if (options.scene) {
     const scene = decodeURIComponent(options.scene)
     const key = scene.split('=')[1]
-    console.log('key:', key)
     if (!key) return
     const res = await getShareQueryById({key})
     console.log('res:', res)
     options.jobFairId = res?.data?.jobFairId
     options.enterpriseId = res?.data?.enterpriseId
+    options.backgroundColor = res?.data?.backgroundColor
+    options.entName = res?.data?.entName
   }
   if (options?.jobFairId) {
     query.jobFairId = options.jobFairId
@@ -89,7 +90,7 @@ onLoad(async (options) => {
       getJobFairDetail()
     }
   }
-  if (options.backgroundColor || obj?.backgroundColor) backgroundColor.value = options.backgroundColor || obj?.backgroundColor
+  if (options.backgroundColor) backgroundColor.value = options.backgroundColor
 })
 
 // 招聘会详情

+ 1 - 1
utils/config.js

@@ -13,7 +13,7 @@ const config = {
   }
 }
 
-export const envObj = config['produce']
+export const envObj = config['httpsTest']
 
 export const baseUrl = envObj.baseUrl