commonInfo.vue 3.17 KB
Newer Older
1 2
<template>
	<view>
潘永坪's avatar
潘永坪 committed
3 4 5 6 7 8 9
		<view class="top">
			<view v-for="(item,index) in tabList" :key='index' @click="tabClick(index)" :class="{on:active==index}">
				{{item}}
			</view>
		</view>
		
		<view class="middle">
潘永坪's avatar
潘永坪 committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
			<view v-if="active==0" class="contact-list" v-for="(item,index) in 8" :key="index">
				<view class="contact-name">
					<text>姓名:潘永坪</text>
					<text>15808046328</text>
				</view>
				
				<view class="contact-id">
					证件号:500109198808199110
				</view>
				
				<view class="contact-edit">
					<view>
						<u-icon name='file-text' color='#666666' size='56'></u-icon>
						编辑
					</view>
					<view>
						<u-icon name='trash' color='#666666' size='56'></u-icon>
						删除
					</view>
				</view>
			</view>
潘永坪's avatar
潘永坪 committed
31
			
潘永坪's avatar
潘永坪 committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
			<view v-else class="address-list" v-for="(item,a) in 8" :key="a">
				<view class="address-name">
					<text>收件人:潘永坪</text>
					<text>15808046328</text>
				</view>
				
				<view class="address-add">
					重庆市渝北区恒大御都会2栋5-6
				</view>
				
				<view class="address-edit">
					<view>
						<label class="radio">
							<radio />
							默认地址
						</label>
					</view>
					<view>
						<u-icon name='file-text' color='#666666' size='56'></u-icon>
						编辑
					</view>
					<view>
						<u-icon name='trash' color='#666666' size='56'></u-icon>
						删除
					</view>
				</view>
			</view>
潘永坪's avatar
潘永坪 committed
59 60 61 62 63 64 65
		</view>
		
		<view class="bottom">
			<text v-if="active==0">新增联系人</text>
			<text v-else>新增地址</text>
		</view>
		 
66 67 68 69 70 71 72
	</view>
</template>

<script>
export default {
  data() {
    return {
潘永坪's avatar
潘永坪 committed
73 74
      active:0,//导航下标
      tabList:['联系人','收货地址']//导航标题
75 76 77
    }
  },
  onLoad(option) {
潘永坪's avatar
潘永坪 committed
78
    
79 80
  },
  methods: {
潘永坪's avatar
潘永坪 committed
81 82 83 84
    //---导航点击
    tabClick(index){
      this.active=index
    }
85 86 87 88
  }
}
</script>

潘永坪's avatar
潘永坪 committed
89 90 91
<style lang="scss" scoped>
.top{
	position: fixed;
潘永坪's avatar
潘永坪 committed
92
	top: 0;
潘永坪's avatar
潘永坪 committed
93 94 95
	z-index: 1;
	background: #fff;
	display: flex;
潘永坪's avatar
潘永坪 committed
96 97
	height: 100rpx;
	align-items: center;
潘永坪's avatar
潘永坪 committed
98 99 100
	width: 100%;
	view{
		width: 50%;
潘永坪's avatar
潘永坪 committed
101 102 103 104
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
潘永坪's avatar
潘永坪 committed
105 106 107 108 109 110
	}
	view.on{
		color: $theme;
		font-weight: bold;
	}
}
潘永坪's avatar
潘永坪 committed
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
.middle{
	padding:100rpx 0 128rpx 0 ;
}
.address-list,.contact-list{
	background: #fff;
	padding: 40rpx;
	border-radius: 8rpx;
	margin-top: 20rpx;
}
.address-name,.contact-name{
	display: flex;
	justify-content: space-between;
	font-weight: bold;
}
.address-add,.contact-id{
	color: $grey;
	margin-top: 20rpx;
	padding-bottom: 38rpx;
	border-bottom: 1rpx solid #ededed;
}
.contact-edit{
	display: flex;
	margin-top: 30rpx;
	color: #666666;
	justify-content: space-between;
	>view{
		display: flex;
		align-items: center;
	}
}
.address-edit{
	display: flex;
	margin-top: 30rpx;
	color: #666666;
	>view{
		display: flex;
		align-items: center;
	}
	>view:first-child{
		flex: 1;
	}
	>view:last-child{
		margin-left: 60rpx;
	}
}
潘永坪's avatar
潘永坪 committed
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
.bottom{
	height: 128rpx;
	background: #fff;
	display: flex;
	align-items: center;
	position: fixed;
	bottom: 0;
	z-index: 1;
	width: 100%;
	padding: 0 32rpx;
	text{
		display:flex;
		height: 88rpx;
		width: 100%;
		align-items: center;
		justify-content: center;
		background: $red;
		color: #fff;
		font-size: 32rpx;
		border-radius: 44rpx;
	}
}
178 179

</style>