index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view :data-theme="theme">
  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="newData.shippingType === item.shippingType">
  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~2025 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. let app = getApp();
  43. export default{
  44. name:'checkDelivery',
  45. props:{
  46. isShowBox:{
  47. type:Boolean,
  48. default:false
  49. },
  50. activeObj:{
  51. type:Object,
  52. default:function(){
  53. return {}
  54. }
  55. }
  56. },
  57. computed: mapGetters(['viewColor']),
  58. data(){
  59. return {
  60. radioList:[
  61. {
  62. title:'商家配送',
  63. shippingType: 1
  64. },
  65. {
  66. title:'到店自提',
  67. shippingType: 2
  68. }
  69. ],
  70. radioIndex:0,
  71. oldRadioIndex:'', //旧的索引
  72. newData:{},
  73. theme: app.globalData.theme,
  74. shippingType: 1,
  75. deliveryNameNew: '',
  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.deliveryNameNew = item.title;
  89. this.newData.shippingType = item.shippingType;
  90. },
  91. confirmBtn(){
  92. this.$emit('confirmBtn',this.newData)
  93. }
  94. }
  95. }
  96. </script>
  97. <style lang="scss" scoped>
  98. .mask-box{
  99. .bg{
  100. z-index: 99;
  101. position: fixed;
  102. left: 0;
  103. bottom: 0;
  104. width: 100%;
  105. height: 100%;
  106. background: rgba(0,0,0,0.5);
  107. }
  108. .mask-content{
  109. z-index: 999;
  110. position: fixed;
  111. left: 0;
  112. bottom: 0;
  113. width: 100%;
  114. background-color: #fff;
  115. border-radius: 16rpx 16rpx 0 0;
  116. transform: translate3d(0, 100%, 0);
  117. transition: all .3s cubic-bezier(.25, .5, .5, .9);
  118. .title-bar{
  119. position: relative;
  120. text-align: center;
  121. padding: 30rpx 0;
  122. margin-bottom: 20rpx;
  123. font-size: 32rpx;
  124. color: #282828;
  125. .close{
  126. position: absolute;
  127. right: 30rpx;
  128. top: 50%;
  129. transform: translateY(-50%);
  130. .iconfont{
  131. color: #8A8A8A;
  132. }
  133. }
  134. }
  135. .box{
  136. padding: 0 30rpx;
  137. .check-item{
  138. display: flex;
  139. align-items: center;
  140. justify-content: space-between;
  141. height: 40rpx;
  142. margin-bottom: 50rpx;
  143. font-size: 28rpx;
  144. .iconfont{
  145. font-size: 38rpx;
  146. color: #CCCCCC;
  147. &.icon-xuanzhong1{
  148. @include main_color(theme);
  149. }
  150. }
  151. }
  152. }
  153. .foot{
  154. padding: 15rpx 30rpx;
  155. border-top: 1px solid #F5F5F5;
  156. .btn{
  157. width: 100%;
  158. height: 70rpx;
  159. line-height: 70rpx;
  160. text-align: center;
  161. border-radius: 35rpx;
  162. color: #fff;
  163. font-size: 30rpx;
  164. @include main_bg_color(theme);
  165. }
  166. }
  167. }
  168. }
  169. .animated {
  170. animation-duration: .3s
  171. }
  172. </style>