|
|
|
|
@ -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([
|
|
|
|
|
const selectVal1 = ref('all');
|
|
|
|
|
const selectVal2 = ref('普通');
|
|
|
|
|
const selectOpt1 = ref([{ text: '全部', value: 'all' }]);
|
|
|
|
|
const selectOpt2 = ref([{ text: '重要', value: '重要' },{ text: '普通', value: '普通' }]);
|
|
|
|
|
|
|
|
|
|
const addressList = ref({
|
|
|
|
|
data:[
|
|
|
|
|
{
|
|
|
|
|
avatar:"https://fakeimg.pl/250x100/",
|
|
|
|
|
id:"a1",
|
|
|
|
|
real_name:"樹林李敏鎬",
|
|
|
|
|
introduction:"test",
|
|
|
|
|
line:"test",
|
|
|
|
|
user_cate_id:''
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
avatar:"https://fakeimg.pl/250x100/",
|
|
|
|
|
real_name:"樹林李敏鎬",
|
|
|
|
|
introduction:"test",
|
|
|
|
|
id:"a2",
|
|
|
|
|
real_name:"五條悟",
|
|
|
|
|
line:"test",
|
|
|
|
|
user_cate_id:''
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
avatar:"https://fakeimg.pl/250x100/",
|
|
|
|
|
real_name:"樹林李敏鎬",
|
|
|
|
|
introduction:"test",
|
|
|
|
|
id:"a3",
|
|
|
|
|
real_name:"機哩瓜啦",
|
|
|
|
|
line:"test",
|
|
|
|
|
user_cate_id:''
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
// let res = await getUserFaviList();
|
|
|
|
|
// if (res.code === 200) {
|
|
|
|
|
// addressList.value.data = res.data;
|
|
|
|
|
|
|
|
|
|
// console.log(addressList)
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ============ modal ============ */
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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 () => {
|
|
|
|
|
<div class="content">
|
|
|
|
|
<van-cell-group inset>
|
|
|
|
|
<van-dropdown-menu>
|
|
|
|
|
<van-dropdown-item v-model="selectVal1" :options="selectOpt1" />
|
|
|
|
|
<van-dropdown-item v-model="selectVal1" :options="selectOpt1" @change="sel1Change"/>
|
|
|
|
|
<van-dropdown-item v-model="selectVal2" :options="selectOpt2" />
|
|
|
|
|
</van-dropdown-menu>
|
|
|
|
|
</van-cell-group>
|
|
|
|
|
|
|
|
|
|
<van-cell-group inset>
|
|
|
|
|
<!-- <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="tab2ListonLoad" -->
|
|
|
|
|
<van-list class="accordion" id="accordion">
|
|
|
|
|
<van-list>
|
|
|
|
|
|
|
|
|
|
<div class="list-item" v-for="(item, index) in addressList" :key="index">
|
|
|
|
|
<div class="list-item" v-for="(item, index) in addressList.data" :data-cateid="item.user_cate_id" :key="index">
|
|
|
|
|
<div class="left">
|
|
|
|
|
<div class="avatar"><img :src="item.avatar"></div>
|
|
|
|
|
<div class="avatar"><img :src="`https://fakeimg.pl/350x200/?text=${item.id}`"></div>
|
|
|
|
|
<div class="text">
|
|
|
|
|
<h5 class="name ellipsis">{{ item.real_name }}</h5>
|
|
|
|
|
<div class="desc ellipsis">@{{ item.introduction }}</div>
|
|
|
|
|
<div class="desc ellipsis">@{{ item.line }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="right">
|
|
|
|
|
<van-button size="small" class="border-0">
|
|
|
|
|
<h5><i class="fa-solid fa-heart text-darkBlue"></i></h5>
|
|
|
|
|
</van-button>
|
|
|
|
|
<van-button size="small" class="border-0" :url="`line://ti/p/@${item.line}`">
|
|
|
|
|
<h5><i class="fa-solid fa-share-nodes text-darkBlue"></i></h5>
|
|
|
|
|
</van-button>
|
|
|
|
|
</div>
|
|
|
|
|
@ -305,7 +295,7 @@ const onSubmit = async () => {
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<van-cell-group class="pt-2">
|
|
|
|
|
<van-cell-group class="m-0 pt-2">
|
|
|
|
|
<van-field
|
|
|
|
|
label="調整卡片順序"
|
|
|
|
|
:border="false"
|
|
|
|
|
|