health-encyclopedia.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <!-- 康养百科 -->
  2. <template>
  3. <view class="wrap">
  4. <view class="header">
  5. <view class="header-bottom">
  6. <view class="search-bar">
  7. <image src="../../static/search-icon.png" mode="" class="search-icon"></image>
  8. <input type="text" value="" placeholder="亚健康养生" placeholder-class="placeholder"
  9. class="search-input" />
  10. <button type="default" class="search-btn">搜索</button>
  11. </view>
  12. <view class="header-right">
  13. <button type="default">
  14. <image src="../../static/head-icon1.png" mode="widthFix"></image>
  15. </button>
  16. <button type="default">
  17. <image src="../../static/head-icon2.png" mode="widthFix"></image>
  18. </button>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="content-box">
  23. <view class="health-nav-list">
  24. <view class="health-nav-item">
  25. <image src="../../static/health-nav1.png" class="health-nav-item-img" mode=""></image>
  26. 时令养生
  27. </view>
  28. <view class="health-nav-item">
  29. <image src="../../static/health-nav2.png" class="health-nav-item-img" mode=""></image>
  30. 四季养生
  31. </view>
  32. <view class="health-nav-item">
  33. <image src="../../static/health-nav3.png" class="health-nav-item-img" mode=""></image>
  34. 膳食养生
  35. </view>
  36. <view class="health-nav-item">
  37. <image src="../../static/health-nav4.png" class="health-nav-item-img" mode=""></image>
  38. 茶酒养生
  39. </view>
  40. <view class="health-nav-item">
  41. <image src="../../static/health-nav5.png" class="health-nav-item-img" mode=""></image>
  42. 中医养生
  43. </view>
  44. <view class="health-nav-item">
  45. <image src="../../static/health-nav6.png" class="health-nav-item-img" mode=""></image>
  46. 养生讲堂
  47. </view>
  48. </view>
  49. <view class="swiper-box">
  50. <swiper class="swiper" indicator-dots="true" indicator-color="#F2F2F2" indicator-active-color="#F2501A"
  51. :circular="true" autoplay="true" interval="3000" duration="500">
  52. <swiper-item v-for="(item,index) in swiperList" :key="index">
  53. <view class="swiper-item">
  54. <image :src="item" class="banner-img" mode="aspectFill" />
  55. </view>
  56. </swiper-item>
  57. </swiper>
  58. </view>
  59. <view class="tag-box">
  60. <view class="tag-list">
  61. <view class="tag-item">
  62. # 经常熬夜该吃的食物
  63. </view>
  64. <view class="tag-item">
  65. # 经常熬夜该吃的食物
  66. </view>
  67. <view class="tag-item">
  68. # 经常熬夜该吃的食物
  69. </view>
  70. <view class="tag-item">
  71. # 经常熬夜该吃的食物
  72. </view>
  73. </view>
  74. <view class="refresh-row">
  75. <image src="../../static/refresh-icon.png" mode=""></image>
  76. 换一批
  77. </view>
  78. </view>
  79. <view class="health-menu-list">
  80. <view class="health-menu-item">
  81. <image src="../../static/health-menu1.png" class="health-menu-item-img" mode="heightFix"></image>
  82. 亚健康养生
  83. </view>
  84. <view class="health-menu-item">
  85. <image src="../../static/health-menu2.png" class="health-menu-item-img" mode="heightFix"></image>
  86. 食谱知识
  87. </view>
  88. <view class="health-menu-item">
  89. <image src="../../static/health-menu3.png" class="health-menu-item-img" mode="heightFix"></image>
  90. 食疗知识
  91. </view>
  92. <view class="health-menu-item">
  93. <image src="../../static/health-menu4.png" class="health-menu-item-img" mode="heightFix"></image>
  94. 食材知识
  95. </view>
  96. <view class="health-menu-item">
  97. <image src="../../static/health-menu5.png" class="health-menu-item-img" mode="heightFix"></image>
  98. 妙方知识
  99. </view>
  100. </view>
  101. <view class="health-consult-box">
  102. <image src="../../static/icon-1.png" class="health-consult-img" mode="widthFix"></image>
  103. <view class="health-consult-sidebar">
  104. <view class="health-consult-column">
  105. <view class="health-consult-name">健康咨询</view>
  106. <view class="health-consult-msg">携手熊猫为您专业量身定制健康食谱</view>
  107. </view>
  108. <button type="default" class="health-consult-btn">去定制</button>
  109. </view>
  110. </view>
  111. <view class="product-bottom">
  112. <scroll-view scroll-x="true" class="tab-list">
  113. <view :class="{ 'active' : isActive === index }" class="child" v-for="(item,index) in navList"
  114. :key="index" @click="checked(index)">
  115. <view class="child-column">
  116. <view class="child-column-name">{{item.title}}</view>
  117. <view class="child-column-msg">
  118. <text>{{item.msg}}</text>
  119. <image src="../../static/border.png" class="border-img" mode="widthFix"></image>
  120. </view>
  121. </view>
  122. </view>
  123. </scroll-view>
  124. <view class="product-list">
  125. <view class="product-item">
  126. <image src="../../static/img-4.png" class="product-item-column-img" mode="aspectFill" />
  127. <view class="product-item-sidebar">
  128. <view class="product-item-sidebar-top">
  129. <image src="../../static/hot.png" class="product-tag-img" mode="widthFix"></image>
  130. <text class="product-item-column-name">有勇气去改变可以改变的事,有胸怀去接受</text>
  131. </view>
  132. <view class="product-item-row-between">
  133. <text class="look-num">3.2万人浏览</text>
  134. <button type="default" class="collect-btn">
  135. <image src="../../static/heart-active.png" mode="widthFix"></image>
  136. 3386
  137. </button>
  138. </view>
  139. </view>
  140. </view>
  141. <view class="product-item">
  142. <image src="../../static/img-4.png" class="product-item-column-img" mode="aspectFill" />
  143. <view class="product-item-sidebar">
  144. <view class="product-item-sidebar-top">
  145. <image src="../../static/newest.png" class="product-tag-img" mode="widthFix"></image>
  146. <text class="product-item-column-name">有勇气去改变可以改变的事,有胸怀去接受</text>
  147. </view>
  148. <view class="product-item-row-between">
  149. <text class="look-num">3.2万人浏览</text>
  150. <button type="default" class="collect-btn">
  151. <image src="../../static/heart-active.png" mode="widthFix"></image>
  152. 3386
  153. </button>
  154. </view>
  155. </view>
  156. </view>
  157. <view class="product-item">
  158. <image src="../../static/img-4.png" class="product-item-column-img" mode="aspectFill" />
  159. <view class="product-item-sidebar">
  160. <view class="product-item-sidebar-top">
  161. <image src="../../static/newest.png" class="product-tag-img" mode="widthFix"></image>
  162. <text
  163. class="product-item-column-name">有勇气去改变可以改变的事有勇气去改变可以改变的事有勇气去改变可以改变的事有勇气去改变可以改变的事,有胸怀去接受</text>
  164. </view>
  165. <view class="product-item-row-between">
  166. <text class="look-num">3.2万人浏览</text>
  167. <button type="default" class="collect-btn">
  168. <image src="../../static/heart-active.png" mode="widthFix"></image>
  169. 3386
  170. </button>
  171. </view>
  172. </view>
  173. </view>
  174. </view>
  175. </view>
  176. </view>
  177. <!-- 健康咨询-弹窗 -->
  178. <view v-show="isShowConsult">
  179. <view class="mask" @tap="closeConsult"></view>
  180. <view class="window">
  181. <view class="window-label">
  182. 健康咨询
  183. </view>
  184. <view class="itemBox">
  185. <view v-for="(item, index) in checkboxList" :key="index"
  186. :class="'fang ' + (item.isSelected ? 'selected':'')" @click="cutTabClick(index, item)">
  187. <text class="grid-text">{{ item.name }}</text>
  188. </view>
  189. </view>
  190. <view class="window-bottom">
  191. <button type="default">确定</button>
  192. </view>
  193. </view>
  194. </view>
  195. <!-- 健康咨询-弹窗 -->
  196. </view>
  197. </template>
  198. <script>
  199. export default {
  200. data() {
  201. return {
  202. //轮播
  203. swiperList: [
  204. '../../static/banner-2.png',
  205. '../../static/banner-2.png',
  206. '../../static/banner-2.png'
  207. ],
  208. //选项卡
  209. isActive: 0,
  210. navList: [{
  211. index: 0,
  212. title: '亚健康',
  213. msg: '健康管理'
  214. }, {
  215. index: 1,
  216. title: "时令养生",
  217. msg: '学会养生'
  218. }, {
  219. index: 2,
  220. title: "食疗知识",
  221. msg: '开启食疗'
  222. }, {
  223. index: 3,
  224. title: "膳食养生",
  225. msg: '膳食食品'
  226. }],
  227. //健康咨询-弹窗
  228. isShowConsult: true,
  229. //健康咨询多选列表
  230. checkboxList: [{
  231. isSelected: true,
  232. name: '# 疲乏无力'
  233. },
  234. {
  235. isSelected: true,
  236. name: '# 注意力不集中'
  237. },
  238. {
  239. isSelected: false,
  240. name: '# 脘腹不适'
  241. },
  242. {
  243. isSelected: false,
  244. name: '# 肌肉/关节酸痛'
  245. },
  246. {
  247. isSelected: false,
  248. name: '# 精力不足'
  249. },
  250. {
  251. isSelected: false,
  252. name: '# 反应迟钝'
  253. },
  254. {
  255. isSelected: false,
  256. name: '# 精力不足'
  257. },
  258. {
  259. isSelected: false,
  260. name: '# 反应迟钝'
  261. }
  262. ],
  263. }
  264. },
  265. methods: {
  266. //选项卡
  267. checked(index) {
  268. this.isActive = index
  269. },
  270. /**
  271. * 健康咨询-弹窗
  272. */
  273. showConsult() {
  274. this.isShowConsult = true;
  275. },
  276. closeConsult() {
  277. this.isShowConsult = false;
  278. },
  279. //多选
  280. cutTabClick(index, item) {
  281. this.selected = index;
  282. //然后通过这个属性判断是否选中点亮和取消
  283. item.isSelected = !item.isSelected;
  284. }
  285. }
  286. }
  287. </script>
  288. <style scoped lang="scss">
  289. @import "./health-encyclopedia.css";
  290. </style>