diff --git a/bun.lockb b/bun.lockb index 6c8a776..2f17657 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/src/App.vue b/src/App.vue index 0a86492..554d89c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,26 +1,26 @@ + - - + + \ No newline at end of file diff --git a/src/api/index.js b/src/api/index.js index 8693fe2..12e160b 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -25,8 +25,8 @@ export const setUserTpl = async (tpl) => export const toggleSendWithAD = async (type) => ajax(`/user/toggleSendWithAD`, { type }, "POST"); -export const searchConnection = async (type) => - ajax(`/user/searchConnection`, { type }, "POST"); +export const searchConnection = async (params) => + ajax(`/user/searchConnection`, params, "POST"); export const setUserNfcTpl = async (tpl) => ajax(`/user/setUserNfcTpl`, { tpl }, "POST"); diff --git a/src/router/index.js b/src/router/index.js index b4aa399..471b2b4 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -131,7 +131,7 @@ const routes = [ ]; const router = createRouter({ - history: createWebHistory(import.meta.env.BASE_URL), + history: createWebHistory('/home'), routes, }); diff --git a/src/views/Home/index.vue.bak b/src/views/Home/index.vue.bak deleted file mode 100644 index f22462c..0000000 --- a/src/views/Home/index.vue.bak +++ /dev/null @@ -1,449 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/views/Member/index.vue b/src/views/Member/index.vue index 3e5c350..749b5f2 100644 --- a/src/views/Member/index.vue +++ b/src/views/Member/index.vue @@ -191,33 +191,49 @@ const searchOnUpdateValue = (newValue) => { }); }; -const tab2result = ref(''); +// START: 人脈資源 + +const search = ref({ + type: 0, + keyword: '', +}) + +const tab2result = ref('你所需要的資源'); const tab2showPicker = ref(false); const tab2columns = [ - { text: '台北', value: 'Taipei' }, - { text: '桃園', value: 'Taoyuan' }, - { text: '台中', value: 'Taichung' }, - { text: '彰化', value: 'Changhua' }, - { text: '高雄', value: 'Kaohsiung' }, + { text: '你所需要的資源', value: 0 }, + { text: '你能提供的資源', value: 1 }, ]; +const tab2OnConfirm = ({ selectedOptions }) => { + tab2result.value = selectedOptions[0].text; + search.value.type = selectedOptions[0].value; + tab2showPicker.value = false; + handleSearch(); +}; + +const tab2OnSearch = async () => { + handleSearch(); +}; + +const handleSearch = async () => { + let res = await searchConnection(search.value); + if(res.code===200){ + tab2list.value = res.data; + } + + // res = await addUserFavi({uf_user_id:form.value.user_id}); + // // console.log(res); + // if(res.code===200){ + // tab2AddFriend.value = res.data; + // } +}; + const tab2list = ref([]); const tab2Loading = ref(false); const tab2Finished = ref(false); const tab2TodoLists = ref([]); const tab2AddFriend = ref([]); -onBeforeMount(async () => { - let res = await searchConnection(); - if(res.code===200){ - tab2list.value = res.data; - } - - res = await addUserFavi({uf_user_id:form.value.user_id}); - // console.log(res); - if(res.code===200){ - tab2AddFriend.value = res.data; - } -}); const tab2ListonLoad = () => { // 异步更新数据 @@ -237,16 +253,21 @@ const tab2ListonLoad = () => { // }, 1000); }; -const tab2OnConfirm = ({ selectedOptions }) => { - tab2result.value = selectedOptions[0]?.text; - tab2showPicker.value = false; -}; +const handleAddFavi = async (user_id) => { + let res = await addUserFavi({uf_user_id:user_id}); + if(res.code===200){ + return showToast({ + message: '已加入好友', + duration: 1000, + }); + } + return showToast({ + message: '加入失敗', + duration: 1000, + }); +} +// END: 人脈資源 -const tab2searchValue = ref(''); -const tab2OnSearch = () => { - // tab2TodoLists = tab2list.filter(tab2searchValue); - // console.log(tab2TodoLists) -}; const tab3list = ref([]); onBeforeMount(async () => { @@ -635,8 +656,8 @@ onBeforeMount(async () => { is-link readonly name="picker" - border="false" - placeholder="縣市" + :border="false" + placeholder="請選擇" @click="tab2showPicker = true" /> @@ -649,7 +670,7 @@ onBeforeMount(async () => { @@ -695,7 +716,7 @@ onBeforeMount(async () => { -
+
我能分享的資源
diff --git a/vite.config.js b/vite.config.js index 9da377d..56281ee 100644 --- a/vite.config.js +++ b/vite.config.js @@ -7,7 +7,7 @@ import { resolve } from 'path'; // https://vitejs.dev/config/ export default defineConfig(({ mode }) => { return { - base: '/home', + base: './', server: { host: '0.0.0.0', port: 5173,