modal-checked.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="">
  3. <u-modal @confirm="confirm" v-model="show" title="请选择物料种类" confirm-color="#EF9944">
  4. <view class="modal-content">
  5. <view @click="activeIndex=0" class="item" :class="{'active':activeIndex==0}">
  6. <view class="flex">
  7. <image class="img1" src="/static/icon/paycode.png" mode=""></image>
  8. <text class="center">付款码</text>
  9. </view>
  10. <view class="">
  11. <image v-if="activeIndex==0" class="img2 center" src="/static/icon/checked.png" mode=""></image>
  12. </view>
  13. </view>
  14. <view @click="activeIndex=1" class="item" :class="{'active':activeIndex==1}">
  15. <view class="flex">
  16. <image class="img3" src="/static/icon/order.png" mode=""></image>
  17. <text class="center">点餐码</text>
  18. </view>
  19. <view class="">
  20. <image v-if="activeIndex==1" class="img2 center" src="/static/icon/checked.png" mode=""></image>
  21. </view>
  22. </view>
  23. </view>
  24. </u-modal>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. name: '',
  30. data() {
  31. return {
  32. show:false,
  33. activeIndex:0
  34. };
  35. },
  36. onLoad() {
  37. },
  38. methods:{
  39. showModal(){
  40. this.show=true
  41. },
  42. hideModal(){
  43. this.show=false
  44. },
  45. confirm(){
  46. this.$emit('confirm',this.activeIndex)
  47. }
  48. }
  49. };
  50. </script>
  51. <style lang="scss" scoped>
  52. .modal-content{
  53. padding:70rpx 30rpx;
  54. .img1{
  55. width: 40rpx;
  56. height: 40rpx;
  57. margin-right: 20rpx;
  58. margin-left: 20rpx;
  59. }
  60. .img2{
  61. width: 36rpx;
  62. height: 36rpx;
  63. margin-right: 20rpx;
  64. }
  65. .img3{
  66. width: 42rpx;
  67. height: 42rpx;
  68. margin-right: 20rpx;
  69. margin-left: 20rpx;
  70. }
  71. .item{
  72. display: flex;
  73. justify-content: space-between;
  74. background-color: #f7f7f7;
  75. border-radius: 50rpx;
  76. padding: 20rpx;
  77. margin-bottom: 50rpx;
  78. font-size: 26rpx;
  79. font-weight: 400;
  80. color: #696969;
  81. }
  82. .active {
  83. color: #0b0100;
  84. // background-color:rgba(255, 148, 71,.3);
  85. background-color: #fef6e1;
  86. image{
  87. transform: scale(1.3);
  88. }
  89. text{
  90. transform: scale(1.1);
  91. }
  92. }
  93. }
  94. </style>