







- <style lang="scss" scoped>
- .flex {
- display: flex;
- }
- .shopcart-container {
- background: #eee;
- overflow: hidden;
- // 商品列表
- .goods-list {
- margin-top: 10px;
- .mui-card {
- margin: 0;
- .mui-card-content {
- border-bottom: 1px solid #eee;
- .mui-card-content-inner {
- align-items: center;
- padding: 10px;
- img {
- width: 60px;
- }
- .info {
- margin-left: 10px;
- box-sizing: border-box;
- width: 100%;
- overflow: hidden;
- h1 {
- font-size: 13px;
- font-weight: bold;
- line-height: 20px;
- padding-top: 22px;
- }
- p {
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- .price {
- font-size: 16px;
- font-weight: 700;
- color: red;
- flex: 1
- }
- }
- }
- }
- }
- // 配送信息
- .process-info {
- padding: 10px;
- border-bottom: 1px solid #eee;
- p {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- color: #333;
- span {
- color:#999
- }
- }
- }
- // 店铺备注
- .store-info {
- padding: 10px;
- textarea {
- font-size: 13px;
- }
- }
- }
- }
- // 运费信息
- .fare-info {
- padding: 10px;
- margin: 10px 0 0 0;
- .fare-price {
- padding: 5px 0;
- display: flex;
- justify-content: space-between;
- .red {
- color: red;
- font-size: 16px;
- }
- }
- }
- }
- </style>



3、默认收货地址区域CSS样式- .address-container {
- .mui-card {
- margin: 0;
- padding: 10px;
- text-align: left;
- h3 {
- color: #333;
- font-size: 16px;
- font-weight: bold;
- }
- }
- }



3、收货地址列表页,添加从下订单跳转过来的 点击收货地址能跳回下订单页面1)、下订单页面路由添加name属性,方便跳转的时候传参

2)、收货地址页添加跳转回下订单页面的点击事件

3)、点击事件select方法

4、下订单页面接收收货地址页跳转传的参数
5、获取默认收货地址的请求中添加 收货地址id参数,如果id有值时就根据id获取地址,没有的时候获取默认收货地址
发现一个bug 解决一下:
添加收货地址 这边少了一个$符号,添加上,否则添加完收货地址,无法返回上一页
6、获取默认收货地址的时候,如果没有收货地址,跳转到收货地址列表页去添加收货地址
至此,收货地址选择功能完成。
2、点击事件处理函数order实现


发下一个bug:获取默认收货地址的时候没有复制addressId,这样下订单的时候获取不到addressId会出错




- <style lang="scss" scoped>
- .pay-list p {
- padding: 0 10px;
- text-align: right;
- span {
- color: #151515;
- }
- }
- .mui-card-header {
- color:#999;
- font-size: 13px;
- span.title {
- font-size: 13px;
- color: #888;
- }
- }
- .mui-card-content-inner {
- text-align: left;
- .cover {
- position: relative;
- width: 70px;
- height: 70px;
- display: inline-block;
- margin-right: 10px;
- .img-con {
- width: 100%;
- height: 100%;
- margin-right: 10px;
- border-radius: 2px;
- position: relative;
- img {
- width: 100%;
- height: 100%;
- border-radius: 2px;
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate3d(-50%,-50%,0);
- }
- }
- .img-tag {
- position: absolute;
- opacity: .5;
- background: #000;
- color: #fff;
- text-align: center;
- font-size: 12px;
- right: 0;
- bottom: 0;
- padding: 0 5px;
- border-radius: 2px 0;
- }
- }
- }
- </style>









- <style lang="scss" scoped>
- .flex {
- display: flex;
- }
- .shopcart-container {
- background: #eee;
- overflow: hidden;
- // 商品列表
- .goods-list {
- margin-top: 10px;
- .mui-card {
- margin: 0;
- .mui-card-content {
- border-bottom: 1px solid #eee;
- .mui-card-content-inner {
- align-items: center;
- padding: 10px;
- img {
- width: 60px;
- }
- .info {
- margin-left: 10px;
- box-sizing: border-box;
- width: 100%;
- overflow: hidden;
- h1 {
- font-size: 13px;
- font-weight: bold;
- line-height: 20px;
- padding-top: 22px;
- }
- p {
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- .price {
- font-size: 16px;
- font-weight: 700;
- color: red;
- flex: 1
- }
- }
- }
- }
- }
- // 配送信息
- .process-info {
- padding: 10px;
- border-bottom: 1px solid #eee;
- p {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- color: #333;
- span {
- color: #999
- }
- }
- }
- }
- }
- // 运费信息
- .fare-info {
- padding: 10px;
- margin: 10px 0 0 0;
- .fare-price {
- padding: 5px 0;
- display: flex;
- justify-content: space-between;
- .red {
- color: red;
- font-size: 16px;
- }
- }
- }
- }
- </style>







至此订单相关功能完成