This commit is contained in:
2024-03-16 22:46:10 +08:00
parent 8b0ad91bd4
commit 84b6ff15c7
14 changed files with 27 additions and 24 deletions

View File

@@ -0,0 +1,45 @@
<template>
<view class='content'>
<scroll-view :scroll-y='true'>
<item v-for='(item,index) in addressList' :key='index' :item='item' />
</scroll-view>
<view class='bottom-button-view'>
<button class='primary-button' @click.stop='goPath("create")'>+新增地址</button>
</view>
</view>
</template>
<script lang='ts' setup>
import Item from './components/item.vue';
import { goPath } from '@/utils';
import { getAddressList } from '@/api/user';
const addressList = ref<{
name: string,
mobile: string,
address: string,
status: number
}[]>([{
name: '黄先生',
mobile: '13xxxxxx8900',
status: 1
}, {
name: '李先生',
mobile: '13xxxxxx8900',
status: 0
}]);
onLoad((e) => {
fetchAddressList();
});
const fetchAddressList = async () => {
const { data } = await getAddressList();
addressList.value = data;
};
</script>
<style lang='scss' scoped>
</style>