index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <view>
  3. <!-- 选择送货方式 -->
  4. <view class="mask-box">
  5. <view class="bg" v-if="isShowBox"></view>
  6. <view class="mask-content animated" :class="{slideInUp:isShowBox}">
  7. <view class="title-bar">
  8. 配送方式
  9. <view class="close" @click="closeShowBox"><text class="iconfont icon-guanbi"></text></view>
  10. </view>
  11. <view class="box">
  12. <view class="check-item" v-for="(item,index) in radioList" :key="index" :class="{on:index == radioIndex}">
  13. <view>{{item.title}}</view>
  14. <view class="radio" @click="bindCheck(item,index)">
  15. <block v-if="index == newData.isTake">
  16. <view class="iconfont icon-xuanzhong1"></view>
  17. </block>
  18. <block v-else>
  19. <view class="iconfont icon-weixuanzhong"></view>
  20. </block>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="foot">
  25. <view class="btn" @click="confirmBtn">确定</view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. export default{
  33. name:'checkDelivery',
  34. props:{
  35. isShowBox:{
  36. type:Boolean,
  37. default:false
  38. },
  39. activeObj:{
  40. type:Object,
  41. default:function(){
  42. return {}
  43. }
  44. }
  45. },
  46. data(){
  47. return {
  48. radioList:[
  49. {
  50. title:'快递配送',
  51. check:true
  52. },
  53. {
  54. title:'到店自提',
  55. check:false
  56. }
  57. ],
  58. radioIndex:0,
  59. oldRadioIndex:'', //旧的索引
  60. newData:{}
  61. }
  62. },
  63. created() {
  64. this.newData = JSON.parse(JSON.stringify(this.activeObj))
  65. },
  66. methods:{
  67. // 关闭配送方式弹窗
  68. closeShowBox(){
  69. this.$emit('close')
  70. },
  71. // 选择配送方式
  72. bindCheck(item,index){
  73. this.newData.isTake = index
  74. },
  75. confirmBtn(){
  76. this.$emit('confirmBtn',this.newData)
  77. }
  78. }
  79. }
  80. </script>
  81. <style lang="scss">
  82. .mask-box{
  83. .bg{
  84. z-index: 30;
  85. position: fixed;
  86. left: 0;
  87. bottom: 0;
  88. width: 100%;
  89. height: 100%;
  90. background: rgba(0,0,0,0.5);
  91. }
  92. .mask-content{
  93. z-index: 40;
  94. position: fixed;
  95. left: 0;
  96. bottom: 0;
  97. width: 100%;
  98. background-color: #fff;
  99. border-radius: 16rpx 16rpx 0 0;
  100. transform: translate3d(0, 100%, 0);
  101. transition: all .3s cubic-bezier(.25, .5, .5, .9);
  102. .title-bar{
  103. position: relative;
  104. text-align: center;
  105. padding: 30rpx 0;
  106. margin-bottom: 20rpx;
  107. font-size: 32rpx;
  108. color: #282828;
  109. .close{
  110. position: absolute;
  111. right: 30rpx;
  112. top: 50%;
  113. transform: translateY(-50%);
  114. .iconfont{
  115. color: #8A8A8A;
  116. }
  117. }
  118. }
  119. .box{
  120. padding: 0 30rpx;
  121. .check-item{
  122. display: flex;
  123. align-items: center;
  124. justify-content: space-between;
  125. height: 40rpx;
  126. margin-bottom: 50rpx;
  127. font-size: 28rpx;
  128. .iconfont{
  129. font-size: 38rpx;
  130. color: #CCCCCC;
  131. &.icon-xuanzhong1{
  132. color: #E93323;
  133. }
  134. }
  135. }
  136. }
  137. .foot{
  138. padding: 15rpx 30rpx;
  139. border-top: 1px solid #F5F5F5;
  140. .btn{
  141. width: 100%;
  142. height: 70rpx;
  143. line-height: 70rpx;
  144. text-align: center;
  145. border-radius: 35rpx;
  146. color: #fff;
  147. font-size: 30rpx;
  148. background: $theme-color;
  149. }
  150. }
  151. }
  152. }
  153. .animated {
  154. animation-duration: .3s
  155. }
  156. </style>