|
@@ -211,6 +211,7 @@ import { getAccessToken, showNecessaryInfoPopup } from '@/utils/request'
|
|
|
import { onLoad, onShareAppMessage, onShow } from '@dcloudio/uni-app'
|
|
|
import { prologue, defaultText } from '@/hooks/useIM'
|
|
|
import { userStore } from '@/store/user'
|
|
|
+import { getSubscribeTemplateList } from '@/api/common'
|
|
|
|
|
|
const useUserStore = userStore()
|
|
|
const sharePopup = ref()
|
|
@@ -447,6 +448,16 @@ const popup = ref()
|
|
|
const uploadPopup = ref()
|
|
|
const resumeList = ref([])
|
|
|
const selectIndex = ref(null)
|
|
|
+
|
|
|
+const handleOpen = async () => {
|
|
|
+ const { data } = await getPersonResumeCv()
|
|
|
+ resumeList.value = data
|
|
|
+ // 未上传简历
|
|
|
+ if (!resumeList.value?.length) {
|
|
|
+ return uploadPopup.value.open()
|
|
|
+ }
|
|
|
+ popup.value.open()
|
|
|
+}
|
|
|
const handleDelivery = async () => {
|
|
|
// 未登录
|
|
|
if (!getAccessToken()) {
|
|
@@ -471,13 +482,24 @@ const handleDelivery = async () => {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- const { data } = await getPersonResumeCv()
|
|
|
- resumeList.value = data
|
|
|
- // 未上传简历
|
|
|
- if (!resumeList.value?.length) {
|
|
|
- return uploadPopup.value.open()
|
|
|
- }
|
|
|
- popup.value.open()
|
|
|
+ // 消息订阅
|
|
|
+ const { data: templateList } = await getSubscribeTemplateList()
|
|
|
+ const tmplIds = templateList.map(e => e.id)
|
|
|
+ console.log(tmplIds, '消息订阅模版ID')
|
|
|
+ uni.requestSubscribeMessage({
|
|
|
+ tmplIds,
|
|
|
+ success:(res)=>{
|
|
|
+ console.log(res, 'uni.requestSubscribeMessage-res')
|
|
|
+ if (res[tmplIds[0]] === 'accept' || res[tmplIds[1]] === 'accept') {
|
|
|
+ console.log('订阅成功', res)
|
|
|
+ handleOpen()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail:(err)=>{
|
|
|
+ console.log('订阅失败', err)
|
|
|
+ handleOpen()
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
const deliverySubmit = async (uploadFile) => {
|
|
|
const resume = uploadFile ? uploadFile : resumeList.value[selectIndex.value]
|