test.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view class="">
  3. <u-modal 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:true,
  33. activeIndex:0
  34. };
  35. },
  36. onLoad() {
  37. },
  38. methods:{
  39. }
  40. };
  41. </script>
  42. <style lang="scss" scoped>
  43. .modal-content{
  44. padding:70rpx 30rpx;
  45. .img1{
  46. width: 40rpx;
  47. height: 40rpx;
  48. margin-right: 20rpx;
  49. margin-left: 20rpx;
  50. }
  51. .img2{
  52. width: 36rpx;
  53. height: 36rpx;
  54. margin-right: 20rpx;
  55. }
  56. .img3{
  57. width: 42rpx;
  58. height: 42rpx;
  59. margin-right: 20rpx;
  60. margin-left: 20rpx;
  61. }
  62. .item{
  63. display: flex;
  64. justify-content: space-between;
  65. background-color: #f7f7f7;
  66. border-radius: 50rpx;
  67. padding: 20rpx;
  68. margin-bottom: 50rpx;
  69. font-size: 26rpx;
  70. font-weight: 400;
  71. color: #696969;
  72. }
  73. .active {
  74. color: #0b0100;
  75. // background-color:rgba(255, 148, 71,.3);
  76. background-color: #fef6e1;
  77. image{
  78. transform: scale(1.3);
  79. }
  80. text{
  81. transform: scale(1.1);
  82. }
  83. }
  84. }
  85. </style>