index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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~2021 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. },
  60. computed: mapGetters(['viewColor']),
  61. data(){
  62. return {
  63. radioList:[
  64. {
  65. title:this.deliveryName,
  66. check:true
  67. },
  68. {
  69. title:'到店核销',
  70. check:false
  71. }
  72. ],
  73. radioIndex:0,
  74. oldRadioIndex:'', //旧的索引
  75. newData:{}
  76. }
  77. },
  78. created() {
  79. this.newData = JSON.parse(JSON.stringify(this.activeObj))
  80. },
  81. methods:{
  82. // 关闭配送方式弹窗
  83. closeShowBox(){
  84. this.$emit('close')
  85. },
  86. // 选择配送方式
  87. bindCheck(item,index){
  88. this.newData.order.isTake = index
  89. },
  90. confirmBtn(){
  91. this.$emit('confirmBtn',this.newData)
  92. }
  93. }
  94. }
  95. </script>
  96. <style lang="scss">
  97. .mask-box{
  98. .bg{
  99. z-index: 30;
  100. position: fixed;
  101. left: 0;
  102. bottom: 0;
  103. width: 100%;
  104. height: 100%;
  105. background: rgba(0,0,0,0.5);
  106. }
  107. .mask-content{
  108. z-index: 40;
  109. position: fixed;
  110. left: 0;
  111. bottom: 0;
  112. width: 100%;
  113. background-color: #fff;
  114. border-radius: 16rpx 16rpx 0 0;
  115. transform: translate3d(0, 100%, 0);
  116. transition: all .3s cubic-bezier(.25, .5, .5, .9);
  117. .title-bar{
  118. position: relative;
  119. text-align: center;
  120. padding: 30rpx 0;
  121. margin-bottom: 20rpx;
  122. font-size: 32rpx;
  123. color: #282828;
  124. .close{
  125. position: absolute;
  126. right: 30rpx;
  127. top: 50%;
  128. transform: translateY(-50%);
  129. .iconfont{
  130. color: #8A8A8A;
  131. }
  132. }
  133. }
  134. .box{
  135. padding: 0 30rpx;
  136. .check-item{
  137. display: flex;
  138. align-items: center;
  139. justify-content: space-between;
  140. height: 40rpx;
  141. margin-bottom: 50rpx;
  142. font-size: 28rpx;
  143. .iconfont{
  144. font-size: 38rpx;
  145. color: #CCCCCC;
  146. &.icon-xuanzhong1{
  147. color: var(--view-theme);
  148. }
  149. }
  150. }
  151. }
  152. .foot{
  153. padding: 15rpx 30rpx;
  154. border-top: 1px solid #F5F5F5;
  155. .btn{
  156. width: 100%;
  157. height: 70rpx;
  158. line-height: 70rpx;
  159. text-align: center;
  160. border-radius: 35rpx;
  161. color: #fff;
  162. font-size: 30rpx;
  163. background: var(--view-theme);
  164. }
  165. }
  166. }
  167. }
  168. .animated {
  169. animation-duration: .3s
  170. }
  171. </style>