|
@@ -101,7 +101,7 @@ async function updateUserInfo(formData) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-let isCrafts = ref(false); // 身份是否為工藝家
|
|
|
+let isCrafts = ref(false); // 身份是否為工藝教育者
|
|
|
|
|
|
// 取得使用者資料
|
|
|
async function getUserInfo() {
|
|
@@ -124,55 +124,65 @@ async function getUserInfo() {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- let position = response.data.user_inform[0].position;
|
|
|
- console.log("user.position", position);
|
|
|
+ let userInform = response.data.user_inform[0];
|
|
|
+ email.value = userInform.email;
|
|
|
+ user.user_name = userInform.user_name;
|
|
|
|
|
|
- // 判斷身份
|
|
|
- if (position["學員"]) {
|
|
|
- positionList.value.push("1");
|
|
|
- }
|
|
|
- if (position["開課工藝家"]) {
|
|
|
- isCrafts.value = true;
|
|
|
- positionList.value.push("2");
|
|
|
- }
|
|
|
+ if (userInform.position) {
|
|
|
+ let position = userInform.position;
|
|
|
+ console.log("user.position", position);
|
|
|
|
|
|
- let identifyStr = response.data.user_inform[0].identify.substring(
|
|
|
- 1,
|
|
|
- response.data.user_inform[0].identify.length - 1
|
|
|
- ); // 移除 [] 後將字串轉為陣列
|
|
|
- identityList.value = identifyStr.split(",");
|
|
|
+ // 判斷身份
|
|
|
+ if (position["學習者"]) {
|
|
|
+ positionList.value.push("1");
|
|
|
+ }
|
|
|
+ if (position["開課工藝家"]) {
|
|
|
+ isCrafts.value = true;
|
|
|
+ positionList.value.push("2");
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- email.value = response.data.user_inform[0].email;
|
|
|
- user.user_name = response.data.user_inform[0].user_name;
|
|
|
+ if (userInform.identify) {
|
|
|
+ let identifyStr = userInform.identify.substring(
|
|
|
+ 1,
|
|
|
+ userInform.identify.length - 1
|
|
|
+ ); // 移除 [] 後將字串轉為陣列
|
|
|
+ identityList.value = identifyStr.split(",");
|
|
|
+ }
|
|
|
|
|
|
- if (!response.data.user_inform[0].exist) {
|
|
|
+ if (!userInform.exist) {
|
|
|
isExist.value = false;
|
|
|
} else {
|
|
|
isExist.value = true;
|
|
|
|
|
|
// 遍歷物件屬性
|
|
|
- Object.keys(response.data.user_inform[0]).forEach((key) => {
|
|
|
+ Object.keys(userInform).forEach((key) => {
|
|
|
if (user[key] !== undefined) {
|
|
|
- user[key] = response.data.user_inform[0][key];
|
|
|
+ user[key] = userInform[key];
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- // 手機
|
|
|
- const phoneSplit = response.data.user_inform[0].phone.split(" ");
|
|
|
+ if (userInform.phone) {
|
|
|
+ // 手機
|
|
|
+ const phoneSplit = userInform.phone.split(" ");
|
|
|
|
|
|
- if (phoneSplit.length === 2) {
|
|
|
- phoneCode.value = phoneSplit[0];
|
|
|
- phone.value = phoneSplit[1];
|
|
|
- } else {
|
|
|
- phone.value = phoneSplit[1];
|
|
|
+ if (phoneSplit.length === 2) {
|
|
|
+ phoneCode.value = phoneSplit[0];
|
|
|
+ phone.value = phoneSplit[1];
|
|
|
+ } else {
|
|
|
+ phone.value = phoneSplit[1];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- // 地址
|
|
|
- city.value = response.data.user_inform[0].address.substring(0, 3);
|
|
|
- address.value = response.data.user_inform[0].address.substring(3);
|
|
|
+ if (userInform.address) {
|
|
|
+ // 地址
|
|
|
+ city.value = userInform.address.substring(0, 3);
|
|
|
+ address.value = userInform.address.substring(3);
|
|
|
+ }
|
|
|
}
|
|
|
} catch (error) {
|
|
|
store.loginState = false;
|
|
|
+ console.log("getUserInfo error");
|
|
|
localStorage.removeItem("token");
|
|
|
console.error(error);
|
|
|
}
|
|
@@ -197,13 +207,13 @@ let resume = reactive({
|
|
|
introduction: "", // 老師介紹
|
|
|
});
|
|
|
|
|
|
-// 取得工藝家履歷
|
|
|
+// 取得工藝教育者履歷
|
|
|
(async () => {
|
|
|
try {
|
|
|
const response = await axios.get(
|
|
|
`https://cmm.ai:8088/api/get_user_resume?access_token=${token}`
|
|
|
);
|
|
|
- console.log("工藝家", response.data.user_resume);
|
|
|
+ console.log("工藝教育者", response.data.user_resume);
|
|
|
|
|
|
if (response.data.user_resume) {
|
|
|
// 遍歷物件屬性
|
|
@@ -220,7 +230,7 @@ let resume = reactive({
|
|
|
}
|
|
|
})();
|
|
|
|
|
|
-// 更新工藝家履歷
|
|
|
+// 更新工藝教育者履歷
|
|
|
async function saveResume() {
|
|
|
console.log("saveResume");
|
|
|
}
|
|
@@ -277,16 +287,16 @@ let typeList = [
|
|
|
<v-card class="h-100 profile-card">
|
|
|
<v-tabs v-model="tab" color="purple" align-tabs="center" class="mb-16">
|
|
|
<v-tab :value="1">關於我</v-tab>
|
|
|
- <v-tab v-if="isCrafts" :value="2">工藝家履歷</v-tab>
|
|
|
+ <v-tab v-if="isCrafts" :value="2">工藝教育者履歷</v-tab>
|
|
|
</v-tabs>
|
|
|
<v-window v-model="tab">
|
|
|
<v-window-item :value="1">
|
|
|
<v-form @submit.prevent>
|
|
|
<p class="mb-5">身份</p>
|
|
|
<div class="d-flex">
|
|
|
- <v-chip color="purple"> 學員 </v-chip>
|
|
|
+ <v-chip color="purple"> 學習者 </v-chip>
|
|
|
<v-chip v-if="isCrafts" color="purple" class="ms-2">
|
|
|
- 開課工藝家
|
|
|
+ 開課工藝教育者
|
|
|
</v-chip>
|
|
|
</div>
|
|
|
|
|
@@ -295,14 +305,14 @@ let typeList = [
|
|
|
</v-label>
|
|
|
<v-checkbox
|
|
|
v-model="positionList"
|
|
|
- label="學員"
|
|
|
+ label="學習者"
|
|
|
value="1"
|
|
|
color="purple"
|
|
|
hide-details
|
|
|
></v-checkbox>
|
|
|
<v-checkbox
|
|
|
v-model="positionList"
|
|
|
- label="開課工藝家"
|
|
|
+ label="開課工藝教育者"
|
|
|
value="2"
|
|
|
color="purple"
|
|
|
hide-details
|
|
@@ -469,11 +479,11 @@ let typeList = [
|
|
|
</v-form>
|
|
|
</v-window-item>
|
|
|
|
|
|
- <!-- 工藝家履歷 -->
|
|
|
+ <!-- 工藝教育者履歷 -->
|
|
|
<v-window-item :value="2">
|
|
|
<v-form @submit.prevent>
|
|
|
<v-label class="mt-5">
|
|
|
- <p class="d-flex mb-5">工藝家姓名<span class="mark">*</span></p>
|
|
|
+ <p class="d-flex mb-5">工藝教育者姓名<span class="mark">*</span></p>
|
|
|
<v-text-field
|
|
|
v-model="resume.teacher_name"
|
|
|
:rules="[(v) => !!v || '請輸入您的姓名']"
|
|
@@ -552,7 +562,7 @@ let typeList = [
|
|
|
</v-row>
|
|
|
|
|
|
<v-label>
|
|
|
- <p class="d-flex mb-5">工藝家自我介紹</p>
|
|
|
+ <p class="d-flex mb-5">工藝教育者自我介紹</p>
|
|
|
<v-textarea v-model="resume.introduction" rows="5"></v-textarea>
|
|
|
</v-label>
|
|
|
|