| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <template>
- <view>
- <uni-popup ref="popupAddress" type="bottom">
- <view class="pop-address box-border-box p-24">
- <view class="text-align-center fs-36 fw-600 box-title mb-32">
- 选择收货地址
- <uni-icons @click="closeCoupon" class="box-close" type="closeempty" size="20"></uni-icons>
- </view>
-
- <view v-if="list.length === 0" class="scroll-view-css">
- <EnBlank :customSrc='true'>
- <template v-slot:blankImg>
- <image class="black-custom-img" src="@/static/img/common/no-order.png" mode=""></image>
- </template>
- </EnBlank>
- </view>
-
- <view v-else class="scroll-view-css">
- <view class="item-box flex-justify-space align-items-center mb-20" v-for="(item,index) in list" :key="index" @click.stop="select(item)">
- <image v-if="id==item.id" class="s-icon" src="@/static/img/common/y-select.png" mode=""></image>
- <image v-else class="s-icon"src="@/static/img/common/n-select.png" mode=""></image>
-
- <view class="">
- <view class="fs-34 fw-600 w556 mb-12">
- <span v-if="item.is_default == 1" class="list-box-only fs-24 fc-FE9E11 text-align-center mr-8">默认</span>
- {{item.address}}{{item.school_name}}{{item.dorm_name}}
- </view>
- <view class="p-b-20">
- <span class="mr-24 fs-28 fc-9">{{item.consignee}}</span><span class="fs-28 fc-9">{{item.phone}}</span>
- </view>
- </view>
-
- <image class="edit-img" src="@/static/img/common/edit.png" mode="" @click.stop="toEdit(1,item)"></image>
- </view>
- </view>
-
- <view class="box-border-box p-24 bgc-f" @click="toEdit(2)">
- <view class="add-box text-align-center fs-34 fc-f">新增地址</view>
- </view>
- </view>
-
- </uni-popup>
- </view>
- </template>
- <script>
- import {getAddressList} from '@/api/member.js'
- import EnBlank from "@/components/en-utils/en-blank/en-blank";
- import tools from "@/service/tools.js";
-
- export default {
- components:{EnBlank,},
- data(){
- return{
- id:'',
- list:[],
- }
- },
- onShow() {
- this.list = [];
- getAddressList().then((res)=>{
- if(res.code === 1){
- this.list = res.data;
- }
- })
- },
- methods:{
- getList(AddressId){
- getAddressList().then((res)=>{
- if(res.code === 1){
- this.list = res.data;
- let isConfirmAddressFlag = uni.getStorageSync('isConfirmAddressFlag');
- if (isConfirmAddressFlag && AddressId) {
- let item = ''
- res.data.forEach((v,k) => {
- if(v.id == AddressId){
- item = v
- }
- })
- this.$emit('giveAddress',item);
- }
- this.openPop();
- }
- })
- },
- select(item){
- if(item.id != this.id){
- this.$emit('giveAddress',item);
- this.closeCoupon();
- }
- },
- openPop(){
- this.$refs.popupAddress.open();
- },
- closeCoupon(){
- this.list = [];
- this.$refs.popupAddress.close();
- },
- toEdit(type,item){
- if(type === 1){
- uni.navigateTo({
- url:"pages-address/edit-add?id=" + item.id
- })
- }else{
- uni.navigateTo({
- url:"pages-address/edit-add"
- })
- }
- },
- },
- }
- </script>
- <style scoped lang="scss">
- .add-box{
- width: 100%;
- height: 80rpx;
- line-height: 80rpx;
- background-color: #2F80ED;
- border-radius: 200rpx;
-
- }
- .w556{
- width: 556rpx;
- }
- .list-box-only{
- width: 64rpx;
- height: 34rpx;
- line-height: 34rpx;
- border-radius: 8rpx;
- border: 2rpx solid #FE9E11;
- }
-
- .item-box{
- border-bottom: 1rpx solid #f9f9f9;
- .s-icon{
- width: 32rpx;
- height: 32rpx;
- }
- .edit-img{
- width: 48rpx;
- height: 48rpx;
- }
- }
-
- .pop-address{
- width: 100%;
- height: 50vh;
- background-color: #fff;
- border-radius: 24rpx 24rpx 0rpx 0rpx;
- padding-top: 32rpx !important;
- display: flex;
- flex-direction: column;
- .box-title{
- position: relative;
- .box-close{
- position: absolute;
- right: 22rpx;
- }
- }
- }
- </style>
|