This commit is contained in:
唐明明
2022-06-07 16:37:03 +08:00
parent b1e8d774ff
commit 1c6091371e
1706 changed files with 225309 additions and 1 deletions

View File

View File

@@ -0,0 +1,207 @@
<template>
<scroll-view class="address--scroll" scroll-y="true" >
<view class="address--footer">
<view class="address--newAdd" @click="$emit('onAdd')" :style="btnStyle">
<slot name="btn">新建收货地址</slot>
</view>
</view>
<block v-if="lists.length > 0">
<view class="address--lists">
<view class="address--item" :class="[pattern ? 'chunk': 'broad', {'edit': isEdit}]" v-for="(item, index) in lists" :key="index">
<view class="city">
<block v-if="isTag">
<text v-if="item.default" class="city--tag city--default">默认</text>
<!-- <text v-if="item.tag && item.tag != ''" class="city--tag city--type">{{item.tag}}</text> -->
</block>
{{item.province.name}}{{item.city.name}}{{item.district.name}}
</view>
<view class="address">{{item.address}}</view>
<view class="name">{{item.name}}<text>{{item.mobile}}</text></view>
<view class="edit" :style="{'color': editColor}" @click="$emit('onAddress', item)">{{isEdit ? '编辑' : '选择'}}</view>
</view>
</view>
</block>
<block v-else>
<view class="address--null">
<slot name="null">
<image class="null--icon" v-if="nullIcon != ''" :src="nullIcon" mode="widthFix"></image>
<view class="null--text">{{nullText}}</view>
</slot>
</view>
</block>
</scroll-view>
</template>
<script>
export default{
props: {
// 订单样式否为块
pattern: {
type: Boolean,
default: true
},
// 地址列表
lists: {
type: Array,
default: () => {
return []
}
},
// 是否为管理列表
isEdit: {
type: Boolean,
default: true
},
// 状态标签颜色
stateColor: {
type : Object,
default : () => {
return {}
}
},
// 编辑/选择按钮颜色
editColor: {
type : String,
default : "#FF6160"
},
// 底部按钮颜色
btnStyle: {
type : Object,
default : () => {
return {}
}
},
// 缺省页提示文字
nullText: {
type : String,
default : '还没有创建收货地址~'
},
// 缺省页提示icon
nullIcon: {
type : String,
default : () => {
return require('../../static/null-icon.png')
}
},
// 是否显示地址标签
isTag: {
type : Boolean,
default : true
}
}
}
</script>
<style lang="scss" scoped>
$margin: 30rpx;
$radius: 10rpx;
.address--footer{
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: white;
padding: $margin;
z-index: 999;
.address--newAdd{
background-color: #3764FF;
color: white;
height: 90rpx;
line-height: 90rpx;
border-radius: $radius;
text-align: center;
font-size: 32rpx;
margin-bottom: env(safe-area-inset-bottom);
margin-bottom: constant(safe-area-inset-bottom);
}
}
.address--scroll{
height: 100vh;
width: 100vw;
box-sizing: border-box;
.address--lists{
padding-bottom: ($margin*3) + 90rpx;
padding-bottom: ($margin*3) + 90rpx;
overflow: hidden;
.address--item{
position: relative;
background: white;
&.chunk{
margin: $margin;
border-radius: $radius;
padding: $margin ($margin + 120rpx) $margin $margin;
}
&.broad{
padding: $margin;
border-bottom: solid 1rpx #ddd;
}
&>.edit{
position: absolute;
right: $margin;
top: 50%;
margin-top: -45rpx;
line-height: 90rpx;
width: 90rpx;
text-align: center;
font-size: 28rpx;
}
&>.city{
font-size: 26rpx;
color: #888;
.city--tag{
vertical-align: middle;
margin-right: $margin/2;
}
.city--default{
background: #e6576b;
color: white;
padding: 0 $margin/3;
border-radius: $radius;
font-size: 22rpx;
}
.city--type{
background: #007AFF;
padding: 0 $margin/3;
border-radius: $radius;
color: white;
font-size: 22rpx;
}
}
&>.address{
font-size: 30rpx;
color: #333;
line-height: 30rpx;
padding: $margin/3 0;
font-weight: bold;
}
&>.name{
font-size: 26rpx;
color: #888;
text{
padding-left: $margin;
}
}
&:last-child{
margin-bottom: env(safe-area-inset-bottom);
margin-bottom: constant(safe-area-inset-bottom);
}
}
}
}
.address--null{
height: 80vh;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
.null--icon{
width: 188rpx;
}
.null--text{
color: #555;
font-size: 28rpx;
margin-top: $margin;
}
}
</style>

View File

@@ -0,0 +1,80 @@
{
"id": "oct-address",
"displayName": "oct-address",
"version": "1.0.0",
"description": "oct-address",
"keywords": [
"oct-address"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "",
"data": "",
"permissions": ""
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "u",
"aliyun": "u"
},
"client": {
"Vue": {
"vue2": "u",
"vue3": "u"
},
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}

View File

@@ -0,0 +1 @@
# oct-address

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB