<!--pages/complete/complete.wxml--> <navigator url="../address/address"> <view wx:if="{{hasAddress}}" class="orders-address"> <text class="orders-address-name">收货人: {{address.name}}</text> <text class="orders-address-phone">电话: {{address.phone}}</text> <view class="orders-address-detail">{{address.detail}}</view> </view> <view wx:else class="orders-no-address">添加收货地址</view> </navigator> <view class="order_pay_wrap" bindtap="balance1"> 结算 </view>帮我优化这个代码,并且写一个漂亮的wxss
时间: 2023-06-17 15:03:07 浏览: 127
<!--pages/complete/complete.wxml-->
<view class="container">
<navigator url="../address/address">
<view class="address-wrapper">
<view wx:if="{{hasAddress}}" class="address">
<text class="name">{{address.name}}</text>
<text class="phone">{{address.phone}}</text>
<view class="detail">{{address.detail}}</view>
</view>
<view wx:else class="no-address">添加收货地址</view>
<image class="arrow" src="../../images/arrow-right.png"></image>
</view>
</navigator>
<view class="pay-button" bindtap="balance1">结算</view>
</view>
/* pages/complete/complete.wxss */
.container {
padding: 20rpx;
background-color: #F2F2F2;
}
.address-wrapper {
display: flex;
align-items: center;
justify-content: space-between;
background-color: #FFFFFF;
border-radius: 10rpx;
padding: 20rpx;
margin-bottom: 20rpx;
}
.address {
display: flex;
flex-direction: column;
}
.name {
font-size: 28rpx;
font-weight: bold;
margin-bottom: 10rpx;
}
.phone {
font-size: 26rpx;
color: #666666;
margin-bottom: 20rpx;
}
.detail {
font-size: 26rpx;
color: #666666;
line-height: 1.5;
}
.no-address {
font-size: 28rpx;
color: #666666;
}
.arrow {
width: 30rpx;
height: 30rpx;
}
.pay-button {
display: block;
width: 100%;
background-color: #FFC900;
color: #FFFFFF;
font-size: 32rpx;
text-align: center;
padding: 20rpx;
border-radius: 10rpx;
}
阅读全文