feat: latest code update
This commit is contained in:
@@ -75,10 +75,12 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { api } from '../../config'
|
||||
|
||||
const props = defineProps({ interviewId: String, position: String })
|
||||
const interviewId = ref('')
|
||||
const urlPosition = ref('')
|
||||
const form = ref({ company: '', position: '', rounds: '', experience: '', tags: [] })
|
||||
const questionsText = ref('')
|
||||
const customTag = ref('')
|
||||
@@ -89,8 +91,14 @@ const presetTags = ['算法题多', '重视项目经历', '面试官nice', '压
|
||||
|
||||
const token = () => uni.getStorageSync('token') || ''
|
||||
|
||||
onMounted(() => {
|
||||
if (props.position) form.value.position = props.position
|
||||
onLoad((options) => {
|
||||
if (options?.position) {
|
||||
urlPosition.value = decodeURIComponent(options.position)
|
||||
form.value.position = urlPosition.value
|
||||
}
|
||||
if (options?.interviewId) {
|
||||
interviewId.value = options.interviewId
|
||||
}
|
||||
})
|
||||
|
||||
const toggleTag = (tag) => {
|
||||
@@ -122,7 +130,7 @@ const submit = async () => {
|
||||
url: api('/contribution'), method: 'POST',
|
||||
header: { 'Authorization': `Bearer ${token()}`, 'Content-Type': 'application/json' },
|
||||
data: {
|
||||
interviewId: props.interviewId || '',
|
||||
interviewId: interviewId.value || '',
|
||||
company: form.value.company.trim(),
|
||||
position: form.value.position.trim(),
|
||||
rounds: form.value.rounds.trim(),
|
||||
|
||||
Reference in New Issue
Block a user