index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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. title:'骑手配送',
  71. shippingType: 4
  72. }
  73. ],
  74. radioIndex:0,
  75. oldRadioIndex:'', //旧的索引
  76. newData:{},
  77. theme: app.globalData.theme,
  78. shippingType: 1,
  79. deliveryNameNew: '',
  80. }
  81. },
  82. created() {
  83. this.newData = JSON.parse(JSON.stringify(this.activeObj));
  84. },
  85. methods:{
  86. // 关闭配送方式弹窗
  87. closeShowBox(){
  88. this.$emit('close')
  89. },
  90. // 选择配送方式
  91. bindCheck(item,index){
  92. this.deliveryNameNew = item.title;
  93. this.newData.shippingType = item.shippingType;
  94. },
  95. confirmBtn(){
  96. this.$emit('confirmBtn',this.newData)
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .mask-box{
  103. .bg{
  104. z-index: 99;
  105. position: fixed;
  106. left: 0;
  107. bottom: 0;
  108. width: 100%;
  109. height: 100%;
  110. background: rgba(0,0,0,0.5);
  111. }
  112. .mask-content{
  113. z-index: 999;
  114. position: fixed;
  115. left: 0;
  116. bottom: 0;
  117. width: 100%;
  118. background-color: #fff;
  119. border-radius: 16rpx 16rpx 0 0;
  120. transform: translate3d(0, 100%, 0);
  121. transition: all .3s cubic-bezier(.25, .5, .5, .9);
  122. .title-bar{
  123. position: relative;
  124. text-align: center;
  125. padding: 30rpx 0;
  126. margin-bottom: 20rpx;
  127. font-size: 32rpx;
  128. color: #282828;
  129. .close{
  130. position: absolute;
  131. right: 30rpx;
  132. top: 50%;
  133. transform: translateY(-50%);
  134. .iconfont{
  135. color: #8A8A8A;
  136. }
  137. }
  138. }
  139. .box{
  140. padding: 0 30rpx;
  141. .check-item{
  142. display: flex;
  143. align-items: center;
  144. justify-content: space-between;
  145. height: 40rpx;
  146. margin-bottom: 50rpx;
  147. font-size: 28rpx;
  148. .iconfont{
  149. font-size: 38rpx;
  150. color: #CCCCCC;
  151. &.icon-xuanzhong1{
  152. @include main_color(theme);
  153. }
  154. }
  155. }
  156. }
  157. .foot{
  158. padding: 15rpx 30rpx;
  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. @include main_bg_color(theme);
  169. }
  170. }
  171. }
  172. }
  173. .animated {
  174. animation-duration: .3s
  175. }
  176. </style>