oil-station/gasStation-uni/pagesHome/Address/Address.vue
2024-08-16 18:26:19 +08:00

173 lines
3.2 KiB
Vue

<template>
<view class="content">
<view class="container">
<view class="my-header">
<view class="my-icons" @click="goback"> <uni-icons type="left" size="16"></uni-icons> </view>
<view class="my-text">收货地址</view>
<view class="my-icons"></view>
</view>
<!-- 顶部区域 -->
<view class="box-xianze" v-for="(item,index) in dataList" :key="index">
<view class="box-left" @click="choose(item)">
<view style="display: flex;align-items: center;margin-bottom: 5px;">
<view v-if="item.ifDefault == 1" class="tapl">默认</view>
<view class="">{{item.address}}</view>
</view>
<view style="display: flex;align-items: center; font-size: 14px; color: #666666;">
<view class=""> {{item.name}}</view>
<view class=""> {{item.mobile}}</view>
</view>
</view>
<view class="box-right" @click="goedit(item)">
<u-icon name="edit-pen-fill" size="22"></u-icon>
</view>
</view>
<view class="bottom-anniu" @click="goedit()">
<view class="">新增收货地址</view>
</view>
</view>
</view>
</template>
<script>
import config from '@/config'
import request from '../../utils/request'
export default {
data() {
return {
title: '',
dataList: '',
}
},
onShow() {
this.getList();
},
components: {
},
methods: {
getList() {
request({
url: 'business/userManager/mtUserExpressAddress/getList',
method: 'get',
}).then((res) => {
if (res.code == 200) {
this.dataList = res.data
}
})
},
goedit(data) {
if (data != null) {
console.log(data)
//传值
uni.$on('unAddressInfo', function() {
uni.$emit('addressInfo', data)
})
}
uni.navigateTo({
url: '/pagesHome/editress/editress'
})
},
choose(data) {
//传值
uni.$on('unChooseAddr', function() {
uni.$emit('chooseAddr', data)
})
uni.navigateBack()
},
goback() {
uni.navigateBack()
}
}
}
</script>
<style scoped lang="scss">
.content {
background: #f4f5f6;
}
.container {
width: 100%;
height: 100vh;
box-sizing: border-box;
padding-top: 88px;
}
.my-header {
width: 100%;
height: 88px;
background: #ffffff;
display: flex;
align-items: center;
justify-content: space-between;
color: #000;
box-sizing: border-box;
padding: 0px 15px;
padding-top: 40px;
.my-icons {
width: 20px;
}
position: fixed;
top: 0px;
}
.bottom-anniu {
width: 90%;
height: 50px;
display: flex;
align-items: center;
background: #1678ff;
color: white;
justify-content: center;
position: fixed;
bottom: 15px;
left: 50%;
transform: translateX(-50%);
border-radius: 8px;
}
.box-xianze {
width: 95%;
background-color: #ffffff;
margin: 10px auto;
padding: 10px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
}
.box-left {
width: 85%;
}
.box-right {
width: 15px;
display: flex;
align-items: center;
justify-content: center;
}
.tapl {
width: 40px;
height: 20px;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
color: #1678ff;
border: 1px solid #1678ff;
font-size: 14px;
}
</style>