From 1acade375323f0e3693f9f568636db625981fa20 Mon Sep 17 00:00:00 2001 From: bruce68410 Date: Sat, 2 Dec 2023 21:48:37 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A0=81=E9=9D=A2=E5=8A=9F=E8=83=BD=E5=88=97?= =?UTF-8?q?=E5=8F=8A=E7=A2=BA=E8=AA=8D=E6=8C=89=E9=88=95=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E7=BD=AE=E9=A0=82=E7=BD=AE=E5=BA=95=E3=80=81=E9=80=9A=E8=A8=8A?= =?UTF-8?q?=E9=8C=84=E8=A3=BD=E4=BD=9C(=E9=A1=9E=E5=88=A5=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E3=80=81=E7=AF=A9=E9=81=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/css/main.css | 9 ++ src/assets/sass/layout/_layout.scss | 11 ++ src/views/Address/index.vue | 166 +++++++++++++--------------- src/views/Card/Edit.vue | 3 +- src/views/Home/index.vue | 12 +- src/views/Member/index.vue | 9 +- src/views/Send/index.vue | 24 ++-- 7 files changed, 124 insertions(+), 110 deletions(-) diff --git a/src/assets/css/main.css b/src/assets/css/main.css index 309c58f..fddbdaa 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -541,8 +541,17 @@ h1, h2, h3, h4, h5, h6 { } /* ========================================= vant ============================================= */ +.van-nav-bar { + position: sticky; + top: 0; + z-index: 10001; +} + .van-notice-bar { + position: sticky; + top: 78px; font-size: 18px; + z-index: 10000; } .van-popup.van-toast { diff --git a/src/assets/sass/layout/_layout.scss b/src/assets/sass/layout/_layout.scss index 8cf0bd4..0ceec24 100644 --- a/src/assets/sass/layout/_layout.scss +++ b/src/assets/sass/layout/_layout.scss @@ -4,10 +4,21 @@ /* ========================================= vant ============================================= */ + +.van-nav-bar{ + position: sticky; + top:0; + z-index: 10001; +} + .van-notice-bar{ + position: sticky; + top:78px; font-size: 18px; + z-index: 10000; } + .van-popup{ &.van-toast{ display: flex; diff --git a/src/views/Address/index.vue b/src/views/Address/index.vue index 4f45acc..5b10e79 100644 --- a/src/views/Address/index.vue +++ b/src/views/Address/index.vue @@ -6,51 +6,36 @@ import { getUserFaviList, getUserCateList, updateUserCate } from '@/api' import { onMounted, reactive, ref, toRefs, computed, watch } from 'vue' -/* ============ page ============ */ const setShowPicker = ref(false); -const selectVal1 = ref(0); -const selectVal2 = ref('a'); -const selectOpt1 = [ - { text: '未分類', value: 0 }, - { text: '分類一', value: 1 }, - { text: '分類二', value: 2 }, - { text: '分類三', value: 3 } -]; -const selectOpt2 = [ - { text: '重要', value: 'important' }, - { text: '普通', value: 'normal' } -]; - -const addressList = ref([ - { - avatar:"https://fakeimg.pl/250x100/", - real_name:"樹林李敏鎬", - introduction:"test", - }, - { - avatar:"https://fakeimg.pl/250x100/", - real_name:"樹林李敏鎬", - introduction:"test", - }, - { - avatar:"https://fakeimg.pl/250x100/", - real_name:"樹林李敏鎬", - introduction:"test", - }, -]); - -// let res = await getUserFaviList(); -// if (res.code === 200) { -// addressList.value.data = res.data; - -// console.log(addressList) -// } - - - -/* ============ modal ============ */ +const selectVal1 = ref('all'); +const selectVal2 = ref('普通'); +const selectOpt1 = ref([{ text: '全部', value: 'all' }]); +const selectOpt2 = ref([{ text: '重要', value: '重要' },{ text: '普通', value: '普通' }]); + +const addressList = ref({ + data:[ + { + id:"a1", + real_name:"樹林李敏鎬", + line:"test", + user_cate_id:'' + }, + { + id:"a2", + real_name:"五條悟", + line:"test", + user_cate_id:'' + }, + { + id:"a3", + real_name:"機哩瓜啦", + line:"test", + user_cate_id:'' + }, + ] +}); const modalForm = ref({ page: 1, @@ -59,63 +44,66 @@ const modalForm = ref({ "id": 1, "name": "第一類", "children": [ - { - "id": 4, - "name": "普通" - }, - { - "id": 5, - "name": "重要" - } + {"id": 4,"name": "普通"}, + {"id": 5,"name": "重要"} ] }, { "id": 2, "name": "第二類", "children": [ - { - "id": 6, - "name": "普通" - }, - { - "id": 7, - "name": "重要" - } + {"id": 6,"name": "普通"}, + {"id": 7,"name": "重要"} ] }, { "id": 3, "name": "第三類", "children": [ - { - "id": 8, - "name": "普通" - }, - { - "id": 9, - "name": "重要" - }, - { - "name": "特殊" - } + {"id": 8,"name": "普通"}, + {"id": 9,"name": "重要"}, + {"name": "特殊"} ] } ] }); -// onMounted(async() => { -// let res = await getUserCateList() -// if (res.code === 200) { -// modalForm.value.sort = res.data -// console.log("res:",res) -// } -// }); +onMounted(async() => { + let res = await getUserFaviList(); + if (res.code === 200) { + addressList.value.data = res.data; + } -// watch(() => form.value.name, -// (newVal) => { -// form.value.json5.altText = newVal; -// } -// ); + res = await getUserCateList(); + if (res.code === 200) { + let sort = modalForm.value.sort; + sort.forEach((item, i) => { + selectOpt1.value.push({ + text:item.name, + value:i + }) + }); + } +}); + +const sel1Change = (value) => { + if(value != 'all'){ + let child = modalForm.value.sort[value].children; + let ary = []; + + child.forEach((item, i) => { + ary.push({ + text:item.name, + value:item.name + }) + }); + selectOpt2.value = ary; + selectVal2.value = child[0].name; + }else{ + selectOpt2.value = []; + selectVal2.value = ''; + } +}; const addCard = () => { modalForm.value.sort.push( @@ -237,25 +225,27 @@ const onSubmit = async () => {
- + - - + -
+
-
+
{{ item.real_name }}
-
@{{ item.introduction }}
+
@{{ item.line }}
+
+
+
@@ -305,7 +295,7 @@ const onSubmit = async () => {
- + form.value.title, +watch(() => form.value.title, (newVal) => { form.value.json5.altText = newVal; } diff --git a/src/views/Home/index.vue b/src/views/Home/index.vue index de49092..fab089d 100644 --- a/src/views/Home/index.vue +++ b/src/views/Home/index.vue @@ -425,12 +425,14 @@ const handleLogout = () => { -
- -
發送名片
-
+ +
+ +
發送名片
+
+
+
-
diff --git a/src/views/Member/index.vue b/src/views/Member/index.vue index 76c8e20..66ef757 100644 --- a/src/views/Member/index.vue +++ b/src/views/Member/index.vue @@ -265,6 +265,7 @@ const handleSearch = async () => { let res = await searchConnection(search.value); if (res.code === 200) { tab2list.value = res.data; + console.log(tab2list.value) } }; @@ -477,7 +478,7 @@ const handleChangeTplSubmit = async() => {
- +
確認修改
@@ -529,7 +530,7 @@ const handleChangeTplSubmit = async() => { - +
確認修改
@@ -654,7 +655,7 @@ const handleChangeTplSubmit = async() => { - +
確認修改
@@ -751,7 +752,7 @@ const handleChangeTplSubmit = async() => { .cnt3 { .block { - height: 500px; + height: 110vw; text-align: center; background-color: #000; padding: 20px 35px; diff --git a/src/views/Send/index.vue b/src/views/Send/index.vue index ffd6c29..702a1a6 100644 --- a/src/views/Send/index.vue +++ b/src/views/Send/index.vue @@ -205,7 +205,7 @@ const changeTpl = async (val) => {