diff --git a/src/api/card.js b/src/api/card.js index 531ee7f..8aadade 100644 --- a/src/api/card.js +++ b/src/api/card.js @@ -1,6 +1,5 @@ import ajax from "./ajax"; -//通訊錄 export const getCardData = async () => ajax(`/Card/getCardData`); \ No newline at end of file diff --git a/src/api/user.js b/src/api/user.js index 40f9303..8c95073 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -1,9 +1,12 @@ import ajax from "./ajax"; -//通訊錄 + export const getUserData = async () => ajax(`/user/getUser`); +export const getUserExtra = async (uid) => + ajax(`/user/getUserExtra`, { uid }, "GET"); + export const updateUserExtra = async (params) => ajax(`/user/updateUserExtra`, params, "POST"); diff --git a/src/views/Member/index.vue b/src/views/Member/index.vue index 8aaef0b..440f7d9 100644 --- a/src/views/Member/index.vue +++ b/src/views/Member/index.vue @@ -13,9 +13,9 @@ import { useRouter } from 'vue-router' import { showToast, showFailToast, showLoadingToast, showSuccessToast } from 'vant'; -import { getUserInfo, updateUserInfo, updateCard, searchConnection, addUserFavi, setUserNfcTpl } from '@/api' +import { getUserInfo, updateUserInfo, updateCard, searchConnection, addUserFavi, setUserNfcTpl } from '@/api' -import { updateUserExtra, updateUserLink, updateUserAddon } from '@/api/user'; +import { updateUserExtra, updateUserLink, getUserExtra,updateUserAddon } from '@/api/user'; import { getAreaList, getWorkList } from '@/api/system'; import imgTp1 from '@/assets/images/tp/tp_1.jpg' @@ -48,7 +48,7 @@ const tabItemObj = ref([ { title: "基本資料", icon: "fa-id-card-clip" }, { title: "社群分享", icon: "fa-share-nodes" }, { title: "人脈資訊", icon: "fa-gem" }, - { title: "版型設定", icon: "fa-layer-group" } + { title: "NFC版型", icon: "fa-layer-group" } ]); const validatorUrl = (val) => { @@ -78,28 +78,35 @@ const crop = ref({ onMounted(async () => { let userRes = await getUserInfo() if (userRes.code === 200) { - form.value = userRes.data - } else { - + uInfoForm.value = userRes.data + console.log("userRes:",userRes) } + // let userExtraRes = await getUserExtra() + // console.log(userExtraRes.code) + // if (userExtraRes.code === 200) { + // // form.value = userExtraRes.data + // console.log("userExtraRes:",userExtraRes) + // } + //取得區域資料 let areaRes = await getAreaList() if (areaRes.code === 200) { areaColumns.value = areaRes.data //取得區域名稱 if (areaRes.data.length > 0) { - areaName.value = _.find(areaRes.data, { value: form.value.area }).text + areaName.value = _.find(areaRes.data, { value: uInfoForm.value.area }).text } } //取得工作性質資料 let workRes = await getWorkList() if (workRes.code === 200) { + console.log(workRes) workColumns.value = workRes.data //取得工作性質名稱 if (workRes.data.length > 0) { - workName.value = _.find(workRes.data, { value: form.value.work }).text + workName.value = _.find(workRes.data, { value: uInfoForm.value.work }).text } } @@ -204,8 +211,6 @@ const userInfoSubmit = async (values) => { message: '資料更新中...', forbidClick: true, }); - values.area = form.value.area - values.work = form.value.work let res = await updateUserInfo(values) if (res.code === 200) { @@ -250,7 +255,7 @@ const areaName = ref(''); const onAreaConfirm = (value) => { areaName.value = value.selectedOptions[0].text - form.value.area = value.selectedOptions[0].value + uInfoForm.area = value.selectedOptions[0].value showAreaPicker.value = false } @@ -261,7 +266,7 @@ const workName = ref(''); const onWorkConfirm = (value) => { workName.value = value.selectedOptions[0].text - form.value.work = value.selectedOptions[0].value + uInfoForm.work = value.selectedOptions[0].value showAreaPicker.value = false } @@ -452,7 +457,7 @@ const handleChangeTplSubmit = async() => {
- +

上傳圖片,預設為Line頭像

@@ -460,38 +465,38 @@ const handleChangeTplSubmit = async() => {
-
- - - - + - - - - + + - - @@ -741,28 +746,25 @@ const handleChangeTplSubmit = async() => {
- - - -
- - 預覽 - - 確認修改 + 確認修改
+ + + +
diff --git a/src/views/Send/index.vue b/src/views/Send/index.vue index 32afb87..8aea831 100644 --- a/src/views/Send/index.vue +++ b/src/views/Send/index.vue @@ -45,7 +45,7 @@ const cusCardInfo = computed(() => { // return cardStore.vipCard; // }); -onBeforeMount(async () => { +onMounted(async () => { // console.log('liff',liff) await liff.init({ liffId: import.meta.env.VITE_APP_LINE_LIFF_ID }); @@ -60,29 +60,26 @@ onBeforeMount(async () => { } }) -onMounted(async () => { - //切換tab - watch(() => activeName.value, function (newVal, oldVal) { - - if (newVal !== oldVal) { - showFlex(newVal) - } - }, { immediate: true }) +//切換tab +watch(() => activeName.value, function (newVal, oldVal) { + + if (newVal !== oldVal) { + showFlex(newVal) + } +}, { immediate: true }) - //確認是否顯示附加卡片 - watch(() => userInfo.value.cus_card, function (newVal, oldVal) { - // if (userInfo.value.level > 1 && newVal > 0) { - if (userInfo.value.level > 1) { - state.value.showCusCard = true - } - }, { immediate: true }) +//確認是否顯示附加卡片 +watch(() => userInfo.value.cus_card, function (newVal, oldVal) { + // if (userInfo.value.level > 1 && newVal > 0) { + if (userInfo.value.level > 1) { + state.value.showCusCard = true + } +}, { immediate: true }) - //切換NFC版型 - watch(() => userInfo.value.nc_template, function (newVal, oldVal) { - showFlex('0') - }) - +//切換NFC版型 +watch(() => userInfo.value.nc_template, function (newVal, oldVal) { + showFlex('0') }) async function showFlex(id) {