...
This commit is contained in:
45
src/pages/mine/subs/address/index.vue
Normal file
45
src/pages/mine/subs/address/index.vue
Normal 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>
|
Reference in New Issue
Block a user