index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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" :style="{'background-image': `url(../static/img/背景.png)`}">
  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. <image class="start-btn" src="../static/img/开始按钮.png" mode="" @click="onStartBtnClick"></image>
  18. </view>
  19. <!-- 评论 -->
  20. <uni-popup type="center" animation ref="activate" :mask-click="false">
  21. <view class="model-container">
  22. <img @click="onClose" src="../static/img/关闭.png" alt="" style="height: 49rpx;width: 49rpx;"
  23. class="m-close" />
  24. <view class="goods-items">
  25. <view class="g-item" v-for="ite in 2" :key="ite">
  26. <img src="../static/img/甜点.png" alt="" style="height: 230rpx;width: 230rpx;" />
  27. <view class="g-title">
  28. 张记煲仔饭套餐
  29. </view>
  30. <view class="g-price">
  31. ¥18
  32. </view>
  33. <view class="choose-btn" @click="onChoose({id:23})">
  34. 选择
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </uni-popup>
  40. </view>
  41. </template>
  42. <script>
  43. import navBar from '@/components/navBar';
  44. var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  45. let app = getApp();
  46. export default {
  47. components: {
  48. navBar
  49. },
  50. data() {
  51. return {
  52. theme: app.globalData.theme,
  53. navH: '',
  54. statusBarHeight: app.globalData.statusBarHeight,
  55. navigationBarHeight: 0,
  56. loading: false,
  57. loadTitle: '',
  58. items: [{
  59. label: '我不挑食',
  60. icon: require('../static/img/甜点.png'),
  61. checked: true
  62. },
  63. {
  64. label: '减肥套餐',
  65. icon: require('../static/img/减肥餐.png'),
  66. checked: true
  67. },
  68. {
  69. label: '精致小食',
  70. icon: require('../static/img/小食.png'),
  71. checked: true
  72. },
  73. {
  74. label: '豪华美食',
  75. icon: require('../static/img/豪华餐.png'),
  76. checked: true
  77. }
  78. ]
  79. }
  80. },
  81. //下拉刷新
  82. onPullDownRefresh() {
  83. },
  84. onLoad(options) {
  85. this.navH = 96;
  86. },
  87. onShow() {
  88. },
  89. methods: {
  90. handleCheck(i) {
  91. this.items[i].checked = !this.items[i].checked
  92. },
  93. handBack() {
  94. uni.navigateBack({
  95. delta: 1
  96. })
  97. },
  98. onStartBtnClick() {
  99. uni.showLoading()
  100. this.$refs.activate.open()
  101. uni.hideLoading()
  102. },
  103. onClose() {
  104. this.$refs.activate.close()
  105. },
  106. onChoose(data) {
  107. uni.navigateTo({
  108. url: `/pages/goods/goods_details/index?id=${data.id}&mt=0&type=4`,
  109. })
  110. }
  111. },
  112. mounted() {
  113. },
  114. }
  115. </script>
  116. <style scoped>
  117. .order-nav {
  118. font-weight: 500;
  119. font-size: 35rpx;
  120. color: #FFFFFF;
  121. background-color: #FF6702;
  122. text-align: center;
  123. position: relative;
  124. }
  125. .back-button {
  126. width: 25rpx;
  127. height: 25rpx;
  128. border-right: 4rpx solid #fff;
  129. border-bottom: 4rpx solid #fff;
  130. transform: rotate(135deg);
  131. margin-left: 10rpx;
  132. display: inline-block;
  133. position: absolute;
  134. left: 40rpx;
  135. top: 25rpx;
  136. }
  137. .content {
  138. position: relative;
  139. height: calc(100vh - 49px);
  140. width: 100vw;
  141. padding-top: 135rpx;
  142. /* background-image: url('../static/img/背景.png'); */
  143. background-size: cover;
  144. background-repeat: no-repeat;
  145. }
  146. .items {
  147. display: grid;
  148. grid-template-columns: auto auto;
  149. grid-gap: 19.23rpx;
  150. margin: 0 57rpx;
  151. }
  152. .item {
  153. display: flex;
  154. align-items: center;
  155. color: #B16F22;
  156. font-size: 35rpx;
  157. font-weight: 500;
  158. font-family: PingFangSC, PingFang SC;
  159. width: 308rpx;
  160. height: 96rpx;
  161. background: linear-gradient(180deg, #FFE7CA 0%, #FFFFFF 100%);
  162. border-radius: 8rpx;
  163. border: 4rpx solid;
  164. border-image: linear-gradient(225deg, rgba(255, 194, 80, 1), rgba(255, 220, 107, 1), rgba(255, 225, 133, 1)) 4 4 !important;
  165. padding: 9rpx;
  166. }
  167. .active {
  168. border: 4rpx solid;
  169. }
  170. .notActive {
  171. border: none;
  172. }
  173. .start-btn {
  174. position: absolute;
  175. width: 153rpx;
  176. height: 80rpx;
  177. top: 55%;
  178. left: 50%;
  179. transform: translateX(-50%);
  180. }
  181. .model-container {
  182. position: relative;
  183. width: 712rpx;
  184. height: 654rpx;
  185. background-color: #fff;
  186. border-radius: 23rpx;
  187. padding-top: 96rpx;
  188. }
  189. .m-close {
  190. position: absolute;
  191. right: 39rpx;
  192. top: 20rpx;
  193. }
  194. .goods-items {
  195. margin: 0 39rpx;
  196. display: flex;
  197. gap: 20rpx;
  198. }
  199. .g-item {
  200. padding: 38.46rpx;
  201. background: linear-gradient(180deg, #FFF9F1 0%, #FFFFFF 100%);
  202. border-radius: 8rpx;
  203. border: 2rpx solid;
  204. border-image: linear-gradient(225deg, rgba(255, 194, 80, 1), rgba(255, 220, 107, 1), rgba(255, 225, 133, 1)) 2 2;
  205. }
  206. .g-title {
  207. margin-top: 19rpx;
  208. font-family: PingFangSC, PingFang SC;
  209. font-size: 27rpx;
  210. color: #141414;
  211. line-height: 38rpx;
  212. text-align: center;
  213. }
  214. .g-price {
  215. font-family: PingFangSC, PingFang SC;
  216. font-weight: 600;
  217. font-size: 31rpx;
  218. color: #FF9805;
  219. line-height: 42rpx;
  220. text-align: center;
  221. margin-bottom: 10rpx;
  222. }
  223. .choose-btn {
  224. width: 154rpx;
  225. height: 54rpx;
  226. background: linear-gradient(180deg, #FFAC3D 0%, #FF1E1D 100%);
  227. border-radius: 15rpx;
  228. border: 2rpx solid #FFD288;
  229. font-family: PingFangSC, PingFang SC;
  230. font-size: 27rpx;
  231. color: #FFFFFF;
  232. line-height: 54rpx;
  233. text-align: center;
  234. margin: auto;
  235. }
  236. </style>