123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <template>
- <view>
- <view class="address-box">
-
- <radio-group @change="radioChange">
- <view class="address-box-list" v-for="(item, index) in items" :key="item.value">
- <label>
- <view class="address-box-select">
- <radio :value="item.value" :checked="index === current" />
- </view>
- <view class="address-box-left2">
- <text class="address-box-title">{{item.name}} </text>
- <text class="address-box-desc">asd asdsa dasda sdad asdas</text>
- </view>
- </label>
- <view class="address-box-right">
- <image src="../../images/edit.png"></image>
- </view>
- </view>
- </radio-group>
-
-
-
- <view class="address-nodata">
- 还没有添加收货地址哦~
- </view>
- </view>
-
- <view class="bottom-btn">
- 新增收货地址
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- title: 'radio 单选框',
- items: [{
- value: 'USA',
- name: '美国'
- },
- {
- value: 'CHN',
- name: '中国',
- checked: 'true'
- },
- {
- value: 'BRA',
- name: '巴西'
- },
- {
- value: 'JPN',
- name: '日本'
- },
- {
- value: 'ENG',
- name: '英国'
- },
- {
- value: 'FRA',
- name: '法国'
- },
- ],
- current: 0
- }
- },
- onLoad() {
- },
- methods: {
- radioChange(evt) {
- for (let i = 0; i < this.items.length; i++) {
- if (this.items[i].value === evt.detail.value) {
- this.current = i;
- break;
- }
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .address-box{
- padding-bottom: 100rpx;
- }
- .address-nodata{
- margin-top: 150rpx;
- text-align: center;
- font-size: 32rpx;
- color: #666666;
- }
- .address-box-list{
- background-color: #FFFFFF;
- margin: 10rpx 0;
- padding: 10rpx 20rpx;
- overflow: hidden;
- }
- .address-box-left2{
- display: inline-block;
- width: 570rpx;
- height: auto;
- float: left;
- }
- .address-box-left2 .address-box-title{
- display: inline-block;
- width: 100%;
- height: 30rpx;
- line-height: 30rpx;
- color: #3E3E3E;
- font-size: 32rpx;
- }
- .address-box-left2 .address-box-desc{
- display: inline-block;
- width: 100%;
- height: 30rpx;
- line-height: 30rpx;
- color: #949494;
- font-size: 28rpx;
- }
- .address-box-right{
- display: inline-block;
- width: 60rpx;
- height: auto;
- float: right;
- text-align: center;
- }
- .address-box-right image{
- width: 40rpx;
- height: 40rpx;
- vertical-align: middle;
- margin-top: 20rpx;
- }
- .address-box-select{
- display: inline-block;
- width: 60rpx;
- height: auto;
- float: left;
- }
- .address-box-select radio{
- width: 40rpx;
- height: 40rpx;
- // vertical-align: middle;
- margin-top: 20rpx;
- }
-
- .bottom-btn{
- width: 100%;
- height: 98rpx;
- line-height: 98rpx;
- background-color: $theme-color;
- color: #FFFFFF;
- text-align: center;
- position: fixed;
- z-index: 100;
- left: 0;
- bottom: 0;
- }
- </style>
|