advantage.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <!-- -->
  2. <template>
  3. <view style="padding: 20rpx 30rpx;">
  4. <textarea
  5. placeholder-style="color:#F76260"
  6. placeholder="请填写您的个人优势..."
  7. auto-focus
  8. maxlength="300"
  9. v-model="advantage"
  10. style="border: 1rpx solid gray; width: 100%; min-height: 300px;"
  11. ></textarea>
  12. <view class="f-horizon-center">
  13. <button type="primary" size="default" class="send-button" @click="submit">提 交</button>
  14. </view>
  15. </view>
  16. </template>
  17. <script setup>
  18. import { saveResumeAdvantage } from '@/api/user'
  19. import { ref } from 'vue'
  20. import { userStore } from '@/store/user'; const useUserStore = userStore()
  21. const advantage = ref('')
  22. // 获取基础信息-
  23. function getBaseInfo () {
  24. const baseInfo = useUserStore.baseInfo
  25. advantage.value = baseInfo?.advantage || ''
  26. }
  27. // 获取基础信息
  28. getBaseInfo()
  29. // 提交
  30. const submit = async () => {
  31. if (!advantage.value) {
  32. uni.showToast({ title: '请填写您的个人优势', icon: 'none' })
  33. return
  34. }
  35. await saveResumeAdvantage({ content: advantage.value })
  36. uni.showToast({ title: '编辑成功', icon: 'success' })
  37. await useUserStore.getInfo()
  38. //
  39. setTimeout(() => {
  40. uni.navigateBack({
  41. delta: 1,
  42. })
  43. }, 1000);
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. </style>