index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <ion-page class="list-page">
  3. <ion-header class="header-theme2 header-theme3">
  4. <ion-toolbar>
  5. <ion-title>信息登记</ion-title>
  6. </ion-toolbar>
  7. </ion-header>
  8. <ion-content>
  9. <div class="bw-vue-form">
  10. <div class="form-detail">
  11. <ion-label>姓名</ion-label>
  12. <ion-text>{{ user.name }}</ion-text>
  13. </div>
  14. <div class="form-detail">
  15. <ion-label>工号</ion-label>
  16. <ion-text>{{ user.userNo }}</ion-text>
  17. </div>
  18. <div class="form-detail">
  19. <ion-label>身份证号</ion-label>
  20. <ion-text>{{ user.IDCard }}</ion-text>
  21. </div>
  22. <div class="form-detail">
  23. <ion-label>身份</ion-label>
  24. <ion-text>驿站工作人员</ion-text>
  25. </div>
  26. <div class="form-detail">
  27. <ion-label>所属驿站</ion-label>
  28. <ion-text>{{ user.siteName }}</ion-text>
  29. </div>
  30. </div>
  31. <div class="page_button">
  32. <ion-button shape="round" expand="block" @click="onCompany">我是企业</ion-button>
  33. <ion-button shape="round" expand="block" @click="onJobUser">我是求职者</ion-button>
  34. </div>
  35. </ion-content>
  36. </ion-page>
  37. </template>
  38. <script>
  39. import {defineComponent, ref} from "vue";
  40. import {getUrlParams} from "@/utils/urlUtils";
  41. import {alertController} from "@ionic/vue";
  42. import {getUserByID} from "@/api/siteUserInfo";
  43. import {useRouter} from "vue-router";
  44. import {getWxOpenId} from "@/api/wechat";
  45. import {useUserStore} from "@/store/modules/user";
  46. const presentAlert = async (message) => {
  47. const alert = await alertController.create({
  48. header: '错误!',
  49. message: message,
  50. buttons: [
  51. '确定'
  52. ],
  53. });
  54. await alert.present();
  55. }
  56. export default defineComponent({
  57. name: "jobUserInfoIndex",
  58. setup() {
  59. const router = useRouter();
  60. const user = ref({userNo: '', name: '', IDCard: '', siteName: ''});
  61. const urlParams = getUrlParams();
  62. const userId = urlParams["userId"];
  63. const userStore = useUserStore();
  64. const getUser = async function () {
  65. const reqData = await getUserByID(userId);
  66. user.value = reqData;
  67. };
  68. const onCompany = function () {
  69. router.push({path: '/jobUserInfo/companyedit', query: {reload: 1, openId: userStore.getOpenId}});
  70. };
  71. const onJobUser = function () {
  72. router.push({path: '/jobUserInfo/useredit', query: {reload: 1, openId: userStore.getOpenId}});
  73. };
  74. if (!userId) {
  75. presentAlert("驿站工作者信息获取失败");
  76. } else {
  77. getUser();
  78. }
  79. return {
  80. user,
  81. onCompany,
  82. onJobUser
  83. }
  84. }
  85. });
  86. </script>
  87. <style lang="less">
  88. .bw-vue-form{
  89. padding: 20px 10px;
  90. }
  91. .page_button {
  92. display: flex;
  93. justify-content: space-around;
  94. padding: 20px;
  95. ion-button {
  96. width: 150px;
  97. }
  98. }
  99. .header-theme3{
  100. ion-title{
  101. margin-left: 0px !important;
  102. }
  103. }
  104. </style>