小程序外卖订单界面的示例代码(2)

<style lang='scss'> @import '../../style/base.scss'; page { height: 100%; } .container { height: 100vh; background-color: #fff; box-sizing: border-box; overflow: hidden; .dialog1{ width: 100%; height: 100vh; position: fixed; top: 0; left: 0; background-color: rgba(0,0,0, 0.5); z-index: 4; .detbox{ position: fixed; bottom: 0; left: 0; right: 0; background-color: #fff; width: 100%; max-height: 700rpx; overflow-y: auto; color: #333; border-radius: 40rpx 40rpx 0 0; .img{ width: 100%; height: 375rpx; background: rgba(0,0,0,0.6); } .box{ padding: 20rpx 30rpx 40rpx; box-sizing: border-box; .tit{ font-size: 28rpx; color: #333; font-weight: bold; } .money{ font-size: 26rpx; color: #f00; margin: 10rpx 0; } .desc{ font-size: 22rpx; color: #666; line-height: 32rpx; } } .close{ width: 50rpx; height: 50rpx; position: absolute; right: 20rpx; top: 20rpx; display: flex; align-items: center; justify-content: center; image{ width: 40rpx; height: 40rpx; } } } } .dialog{ width: 100%; height: 100vh; position: fixed; top: 0; left: 0; background-color: rgba(0,0,0, 0.5); z-index: 2; .boxs{ position: fixed; bottom: 80rpx; left: 0; right: 0; z-index: 6; background-color: #fff; width: 100%; max-height: 600rpx; color: #333; .title-block{ padding: 0 30rpx; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; height: 70rpx; background: #EEF0F1; text{ font-size: 26rpx; color: #666; } .clear{ font-size: 22rpx; color: #888; display: flex; align-items: center; image{ width: 24rpx; height: 24rpx; margin-right: 10rpx; } } } .content{ width: 100%; max-height: 530rpx; overflow-y: auto; padding-bottom: 30rpx; box-sizing: border-box; .item{ width: 690rpx; height: 80rpx; line-height: 80rpx; margin: 0 auto; position: relative; display: flex; align-items: center; justify-content: space-between; &::after{ position: absolute; width: 100%; height: 1rpx; background: #f2f2f2; content: ''; bottom: 1rpx; left: 0; } .tit{ width: 400rpx; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 28rpx; color: #333; } .right{ display: flex; justify-content: flex-start; align-items: center; height: 80rpx; text{ font-size: 26rpx; color: #f00; } .box{ display: flex; justify-content: flex-start; align-items: center; flex-wrap: nowrap; margin-left: 20rpx; height: 80rpx; .icon{ width: 34rpx; height: 34rpx; display: flex; align-items: center; justify-content: center; image{ width: 34rpx; height: 34rpx; } } input{ width: 60rpx; height: 34rpx; border: none; color: #333; text-align: center; font-size: 26rpx; } } } } } } } .index-cont{ height: calc(100vh - 80rpx); display: flex; justify-content: space-between; .index-left{ width: 160rpx; height: 100%; background: #efefef; .item{ font-size: 26rpx; color: #333; border-bottom: 1rpx dashed #666; height: 80rpx; line-height: 80rpx; padding: 0 20rpx; box-sizing: border-box; &.on{ background: #fff; } } } .index-right{ width: 590rpx; height: 100%; .boxs{ padding: 0 30rpx; box-sizing: border-box; width: 100%; } .index-title{ height: 70rpx; line-height: 70rpx; background: #f7f7f7; padding-left: 30rpx; font-size: 26rpx; color: #666; box-sizing: border-box; } .item{ padding: 30rpx 0; box-sizing: border-box; display: flex; justify-content: space-between; position: relative; height: 212rpx; &::after{ position: absolute; top: 0rpx; left: 0; background: #ccc; width: 100%; height: 1rpx; content: ''; } .pic{ width: 150rpx; height: 150rpx; image{ width: 100%; height: 100%; } } .main{ width: 380rpx; padding-left: 30rpx; box-sizing: border-box; .tit{ font-size: 26rpx; color: #333; font-weight: bold; } .desc{ font-size: 22rpx; color: #999; line-height: 30rpx; margin: 5rpx 0 10rpx; min-height: 65rpx; } .money{ font-size: 28rpx; color: #f00; } } .box{ display: flex; justify-content: flex-start; align-items: center; flex-wrap: nowrap; margin-left: 10rpx; height: 34rpx; position: absolute; right: 0; bottom: 30rpx; .icon{ width: 34rpx; height: 34rpx; display: flex; align-items: center; justify-content: center; image{ width: 34rpx; height: 34rpx; } } input{ width: 60rpx; height: 34rpx; border: none; color: #333; text-align: center; font-size: 26rpx; } } } } } .index-cart{ width: 100%; height: 80rpx; display: flex; align-items: center; justify-content: flex-start; position: relative; z-index: 3; .left{ width: 470rpx; height: 100%; background: #3e3a39; display: flex; align-items: center; justify-content: flex-start; .cart-num{ width: 100rpx; height: 100rpx; background: #6E6D6C; position: relative; padding:25rpx; box-sizing: border-box; border-radius: 100%; top: -30rpx; left: 22rpx; &.on{ background: $base-color; } image{ width: 50rpx; height: 50rpx; } text{ font-size: 20rpx; color: #fff; display: inline-block; padding: 0 9rpx; box-sizing: border-box; position: absolute; right: 3rpx; top: -3rpx; height: 30rpx; line-height: 30rpx; border-radius: 30rpx; background: #f00; } } .cart-money{ color: #fff; font-size: 30rpx; margin-left: 50rpx; } } .order-btn{ width: 280rpx; height: 100%; background: $base-color; font-size: 28rpx; color: #fff; display: flex; align-items: center; justify-content: center; } } }

4.ps

小程序使用mpx为框架;
商品列表数据根据接口获取,测试数据可以根据mock数据测试
实际数据类型是

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/e77a7239e9d7f71655f172998292f6f0.html