index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view :style="viewColor">
  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.order.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. // +----------------------------------------------------------------------
  33. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  34. // +----------------------------------------------------------------------
  35. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  36. // +----------------------------------------------------------------------
  37. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  38. // +----------------------------------------------------------------------
  39. // | Author: CRMEB Team <admin@crmeb.com>
  40. // +----------------------------------------------------------------------
  41. import { mapGetters } from "vuex";
  42. export default{
  43. name:'checkDelivery',
  44. props:{
  45. isShowBox:{
  46. type:Boolean,
  47. default:false
  48. },
  49. activeObj:{
  50. type:Object,
  51. default:function(){
  52. return {}
  53. }
  54. },
  55. deliveryName:{
  56. type:String,
  57. default:'快递配送'
  58. },
  59. radioList:{
  60. type:Array,
  61. default: [
  62. {
  63. title:'快递配送',
  64. check:true
  65. },
  66. {
  67. title:'到店核销',
  68. check:false
  69. }
  70. ],
  71. },
  72. },
  73. computed: mapGetters(['viewColor']),
  74. data(){
  75. return {
  76. radioIndex:0,
  77. oldRadioIndex:'', //旧的索引
  78. newData:{}
  79. }
  80. },
  81. created() {
  82. this.newData = JSON.parse(JSON.stringify(this.activeObj))
  83. },
  84. methods:{
  85. // 关闭配送方式弹窗
  86. closeShowBox(){
  87. this.$emit('close')
  88. },
  89. // 选择配送方式
  90. bindCheck(item,index){
  91. this.newData.order.isTake = index
  92. },
  93. confirmBtn(){
  94. this.$emit('confirmBtn',this.newData)
  95. }
  96. }
  97. }
  98. </script>
  99. <style lang="scss">
  100. .mask-box{
  101. .bg{
  102. z-index: 30;
  103. position: fixed;
  104. left: 0;
  105. bottom: 0;
  106. width: 100%;
  107. height: 100%;
  108. background: rgba(0,0,0,0.5);
  109. }
  110. .mask-content{
  111. z-index: 40;
  112. position: fixed;
  113. left: 0;
  114. bottom: 0;
  115. width: 100%;
  116. background-color: #fff;
  117. border-radius: 16rpx 16rpx 0 0;
  118. transform: translate3d(0, 100%, 0);
  119. transition: all .3s cubic-bezier(.25, .5, .5, .9);
  120. .title-bar{
  121. position: relative;
  122. text-align: center;
  123. padding: 30rpx 0;
  124. margin-bottom: 20rpx;
  125. font-size: 32rpx;
  126. color: #282828;
  127. .close{
  128. position: absolute;
  129. right: 30rpx;
  130. top: 50%;
  131. transform: translateY(-50%);
  132. .iconfont{
  133. color: #8A8A8A;
  134. }
  135. }
  136. }
  137. .box{
  138. padding: 0 30rpx;
  139. .check-item{
  140. display: flex;
  141. align-items: center;
  142. justify-content: space-between;
  143. height: 40rpx;
  144. margin-bottom: 50rpx;
  145. font-size: 28rpx;
  146. .iconfont{
  147. font-size: 38rpx;
  148. color: #CCCCCC;
  149. &.icon-xuanzhong1{
  150. color: var(--view-theme);
  151. }
  152. }
  153. }
  154. }
  155. .foot{
  156. padding: 20rpx 30rpx;
  157. padding-bottom: calc(20rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
  158. padding-bottom: calc(20rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
  159. border-top: 1px solid #F5F5F5;
  160. .btn{
  161. width: 100%;
  162. height: 70rpx;
  163. line-height: 70rpx;
  164. text-align: center;
  165. border-radius: 35rpx;
  166. color: #fff;
  167. font-size: 30rpx;
  168. background: var(--view-theme);
  169. }
  170. }
  171. }
  172. }
  173. .animated {
  174. animation-duration: .3s
  175. }
  176. </style>