index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <view :data-theme="theme">
  3. <view class="cart_nav" :style='"height:"+navH+"rpx;"'>
  4. <nav-bar iconColor='#fff' backgroundColor="#FF6702" ref="navBarRef" navTitle="今日吃啥">
  5. </nav-bar>
  6. </view>
  7. <view class="content">
  8. <view class="items">
  9. <view class="item" v-for="(item,i) in items" :key="i" :class="item.checked ? 'active':'notActive'"
  10. @click="handleCheck(i)">
  11. <img :src="item.icon" alt="" style="height: 80rpx;width: 80rpx;margin-right: 19rpx;"/>
  12. <view class="">
  13. {{item.label}}
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import navBar from '@/components/navBar';
  22. var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  23. let app = getApp();
  24. export default {
  25. components:{navBar},
  26. data() {
  27. return {
  28. theme: app.globalData.theme,
  29. navH:'',
  30. statusBarHeight: app.globalData.statusBarHeight,
  31. navigationBarHeight: 0,
  32. loading: false,
  33. loadTitle: '',
  34. items:[
  35. {
  36. label:'我不挑食',
  37. icon:require('../static/img/甜点.png'),
  38. checked:true
  39. },
  40. {
  41. label:'减肥套餐',
  42. icon:require('../static/img/减肥餐.png'),
  43. checked:true
  44. },
  45. {
  46. label:'精致小食',
  47. icon:require('../static/img/小食.png'),
  48. checked:true
  49. },
  50. {
  51. label:'豪华美食',
  52. icon:require('../static/img/豪华餐.png'),
  53. checked:true
  54. }
  55. ]
  56. }
  57. },
  58. //下拉刷新
  59. onPullDownRefresh() {
  60. },
  61. onLoad(options) {
  62. this.navH = 96;
  63. },
  64. onShow() {
  65. },
  66. methods: {
  67. handleCheck(i) {
  68. this.items[i].checked = !this.items[i].checked
  69. },
  70. handBack() {
  71. uni.navigateBack({
  72. delta: 1
  73. })
  74. },
  75. },
  76. mounted() {
  77. },
  78. }
  79. </script>
  80. <style scoped>
  81. .order-nav {
  82. font-weight: 500;
  83. font-size: 35rpx;
  84. color: #FFFFFF;
  85. background-color: #FF6702;
  86. text-align: center;
  87. position: relative;
  88. }
  89. .back-button {
  90. width: 25rpx;
  91. height: 25rpx;
  92. border-right: 4rpx solid #fff;
  93. border-bottom: 4rpx solid #fff;
  94. transform: rotate(135deg);
  95. margin-left: 10rpx;
  96. display: inline-block;
  97. position: absolute;
  98. left: 40rpx;
  99. top: 25rpx;
  100. }
  101. .content {
  102. margin-top: 96rpx;
  103. padding-top: 39rpx;
  104. }
  105. .items {
  106. display: grid;
  107. grid-template-columns: auto auto;
  108. grid-gap: 19.23rpx;
  109. margin: 0 57rpx;
  110. }
  111. .item {
  112. display: flex;
  113. align-items: center;
  114. color: #B16F22;
  115. font-size: 35rpx;
  116. font-weight: 500;
  117. font-family: PingFangSC, PingFang SC;
  118. width: 308rpx;
  119. height: 96rpx;
  120. background: linear-gradient( 180deg, #FFE7CA 0%, #FFFFFF 100%);
  121. border-radius: 8rpx;
  122. border: 4rpx solid;
  123. border-image: linear-gradient(225deg, rgba(255, 194, 80, 1), rgba(255, 220, 107, 1), rgba(255, 225, 133, 1)) 4 4 !important;
  124. padding: 9rpx;
  125. }
  126. .active {
  127. border: 4rpx solid;
  128. }
  129. .notActive {
  130. border: none;
  131. }
  132. </style>