123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <template>
- <view class="div container" @click="onclick">
- <view class="div top-wrapper">
- <view class="selected-wrapper" v-if="hasAddress">
- <view class="div line">
- <text class="i icon iconfont"></text>
- <view class="div line-content">
- <view class="div title-wrapper">
- <label class="title">{{item.address_realname}}</label>
- <label class="title" style="margin-left:1rem;">{{item.address_mob_phone}}</label>
- <label class="default" v-if="isDefault">默认</label>
- </view>
- <view class="div desc address-text">{{item.area_info}}{{item.address_detail}}</view>
- <view class="div desc address-text-cityerror" v-if="item.cityerror">门店已失效,请重新编辑收货地址</view>
- </view>
- </view>
- </view>
- <view v-else class="div unselected-wrapper">
- <label class="desc">您还没有收货地址,点击这里添加。</label>
- </view>
- </view>
- </view>
- </template>
- <script>
- import flexLine from '../../../flexLine'
- export default {
- props: ['item'],
- created: function () {
- },
- components: { flexLine },
- computed: {
- hasAddress () {
- if (this.item) {
- return true
- }
- this.onclick()
- return false
- },
- isDefault () {
- if (this.item && this.item.is_default) {
- return true
- }
- return false
- }
- },
- methods: {
- onclick () {
- this.$emit('onclick')
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .container {
- background-color: #fff;
- }
- .line{display: flex;
- .line-content{flex:1}
- }
- .top-wrapper {
- background-color: #fff;
- }
- .title-wrapper {
- height: 1rem;
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- align-items: center;
- }
- .icon {
- font-size:$h1;
- margin-right: .2rem;
- color:$primaryColor
- }
- .title {
- font-size:$h3;
- color: #333;
- font-weight: 700;
- }
- .default {
- width: 1.4rem;
- margin-left: 0.5rem;
- margin-right: 0.5rem;
- border: 1px solid $primaryColor;
- color: $primaryColor;
- font-size:$h6;
- text-align: center;
- border-radius: 0.1rem;
- }
- .desc {
- color: $descTextColor;
- font-size:$subFontSize;
- }
- .address-text {
- margin-top: .3rem;
- font-weight: normal;
- }
- .address-text-cityerror{
- margin-top: .3rem;
- font-weight: normal;
- color: #ff4040;
- }
- .selected-wrapper{
- padding:1rem 0;
- border-bottom: 1px dashed #eee;
- }
- .unselected-wrapper {
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding:2rem 0;
- }
- .indicator {
- height: 0.6rem;
- margin-left: 0.5rem;
- margin-right: $pageSpace;
- }
- .line-wrapper {
- background:#eee;
- // position: relative;
- left: 0;
- right: 0;
- bottom: 0;
- width: 100%;
- height: 0.1rem;
- }
- </style>
|