mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-18 08:25:55 +08:00
·修改部分页面数据冗余
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="address">
|
||||
<view class="bar"></view>
|
||||
<empty v-if="empty"></empty>
|
||||
|
||||
<u-empty class="empty" v-if="empty" text="暂无收货地址" mode="address"></u-empty>
|
||||
<view class="list" v-else>
|
||||
<view class="item c-content" v-for="(item, index) in addressList" :key="index">
|
||||
<view class="basic" @click="selectAddressData(item)">
|
||||
@@ -10,21 +10,11 @@
|
||||
<text class="default" v-show="item.isDefault">默认</text>
|
||||
<view>
|
||||
<div class="region">
|
||||
<span v-if="item.consigneeAddressPath[0]">{{
|
||||
item.consigneeAddressPath[0]
|
||||
}}</span>
|
||||
<span v-if="item.consigneeAddressPath[1]">{{
|
||||
item.consigneeAddressPath[1]
|
||||
}}</span>
|
||||
<span v-if="item.consigneeAddressPath[2]">{{
|
||||
item.consigneeAddressPath[2]
|
||||
}}</span>
|
||||
<span v-if="item.consigneeAddressPath[3]">{{
|
||||
item.consigneeAddressPath[3]
|
||||
}}</span>
|
||||
<span>
|
||||
{{ item.detail }}
|
||||
</span>
|
||||
<span v-if="item.consigneeAddressPath[0]">{{item.consigneeAddressPath[0]}}</span>
|
||||
<span v-if="item.consigneeAddressPath[1]">{{item.consigneeAddressPath[1]}}</span>
|
||||
<span v-if="item.consigneeAddressPath[2]">{{item.consigneeAddressPath[2]}}</span>
|
||||
<span v-if="item.consigneeAddressPath[3]">{{item.consigneeAddressPath[3]}}</span>
|
||||
<span>{{ item.detail }}</span>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
@@ -38,7 +28,7 @@
|
||||
<view class="alifont icon-bianji-copy"></view>
|
||||
<text class="mr-40" @click="addAddress(item.id)">编辑</text>
|
||||
<view class="alifont icon-lajitong"></view>
|
||||
<text @click="delAddress(item.id)">删除</text>
|
||||
<text @click="removeAddress(item.id)">删除</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -48,7 +38,7 @@
|
||||
<u-icon name="plus-circle"></u-icon>
|
||||
添加新收货人
|
||||
</button>
|
||||
<u-action-sheet :list="delList" :tips="tips" v-model="showAction" @click="deleteAddressMessage"></u-action-sheet>
|
||||
<u-action-sheet :list="removeList" :tips="tips" v-model="showAction" @click="deleteAddressMessage"></u-action-sheet>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -58,12 +48,10 @@ import * as API_Address from "@/api/address.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
ifOnShow: false, //组件加载为true 离开为false
|
||||
activeClass: "activeClass",
|
||||
addressList: [],
|
||||
showAction: false,
|
||||
empty: false,
|
||||
delList: [
|
||||
addressList: [], //地址列表
|
||||
showAction: false, //是否显示下栏框
|
||||
empty: false, //是否为空
|
||||
removeList: [
|
||||
{
|
||||
text: "确定",
|
||||
},
|
||||
@@ -71,12 +59,11 @@ export default {
|
||||
tips: {
|
||||
text: "确定要删除该收货人信息吗?",
|
||||
},
|
||||
delId: "",
|
||||
addid: "",
|
||||
removeId: "", //删除的地址id
|
||||
routerVal: "",
|
||||
params: {
|
||||
pageNumber: 1,
|
||||
pageSize: 50,
|
||||
pageSize: 1000,
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -122,7 +109,6 @@ export default {
|
||||
|
||||
this.$set(this, "addressList", res.data.result.records);
|
||||
|
||||
|
||||
console.log(this.addressList);
|
||||
}
|
||||
|
||||
@@ -130,12 +116,12 @@ export default {
|
||||
});
|
||||
},
|
||||
//删除地址
|
||||
delAddress(id) {
|
||||
this.delId = id;
|
||||
removeAddress(id) {
|
||||
this.removeId = id;
|
||||
this.showAction = true;
|
||||
},
|
||||
deleteAddressMessage() {
|
||||
API_Address.deleteAddress(this.delId).then((res) => {
|
||||
API_Address.deleteAddress(this.removeId).then((res) => {
|
||||
if (res.statusCode == 200) {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
@@ -186,158 +172,10 @@ export default {
|
||||
this.getAddressList();
|
||||
});
|
||||
},
|
||||
|
||||
// 地址id
|
||||
addId(params) {
|
||||
API_Trade.setAddressId(params.address_id).then((res) => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.active {
|
||||
background: #f19736;
|
||||
}
|
||||
|
||||
.alifont {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.region {
|
||||
span {
|
||||
margin: 0 4rpx !important;
|
||||
}
|
||||
}
|
||||
.address {
|
||||
.bar {
|
||||
height: 20rpx;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
background: url("/pages/floor/imgs/line.png") no-repeat;
|
||||
background-size: 100%;
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 0;
|
||||
transform: scale(1, 0.8);
|
||||
}
|
||||
.default {
|
||||
border: 1px solid #ff6262;
|
||||
color: #ff6262;
|
||||
font-size: 22rpx;
|
||||
border-radius: 6rpx;
|
||||
align-self: center;
|
||||
padding: 2rpx 20rpx;
|
||||
}
|
||||
.list {
|
||||
.item:hover {
|
||||
background: #ededed;
|
||||
}
|
||||
|
||||
.item {
|
||||
margin-top: 20rpx;
|
||||
font-size: $font-base;
|
||||
color: #666;
|
||||
|
||||
.basic {
|
||||
padding: 30rpx;
|
||||
line-height: 1.5em;
|
||||
border-bottom: 1px solid $border-color-light;
|
||||
|
||||
:nth-child(2) {
|
||||
margin: 0 20rpx;
|
||||
}
|
||||
|
||||
:nth-child(4) {
|
||||
color: $font-color-light;
|
||||
font-size: $font-sm;
|
||||
|
||||
margin-top: 10rpx;
|
||||
|
||||
text:nth-child(2) {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
view {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.edit {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
vertical-align: middle;
|
||||
height: 80rpx;
|
||||
font-size: $font-sm;
|
||||
color: $font-color-light;
|
||||
padding: 0 30rpx;
|
||||
|
||||
.unchecked {
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
border-radius: 50%;
|
||||
border: 1px solid #e0e0e0;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin-right: 8rpx;
|
||||
position: relative;
|
||||
top: -2rpx;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
view:nth-child(1) {
|
||||
view:nth-child(1) {
|
||||
font-size: $font-base;
|
||||
color: $main-color;
|
||||
margin-right: 8rpx;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
view:nth-child(2) {
|
||||
text {
|
||||
margin-left: 5rpx;
|
||||
}
|
||||
|
||||
.alifont {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.icon-bianji-copy {
|
||||
font-size: 28rpx;
|
||||
position: relative;
|
||||
top: 2rpx;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.icon-lajitong {
|
||||
position: relative;
|
||||
top: 4rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.mr-40 {
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
background: $light-color;
|
||||
position: fixed;
|
||||
width: 690rpx;
|
||||
bottom: 60rpx;
|
||||
height: 80rpx;
|
||||
left: 30rpx;
|
||||
font-size: 30rpx;
|
||||
line-height: 80rpx;
|
||||
|
||||
.u-icon {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
@import './address.scss';
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user