普兆健康管家前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

343 lines
7.6 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
  1. <template>
  2. <view class="page__view">
  3. <navbar bgColor="#FFFFFF" >
  4. <image class="nav-icon" src="@/static/image/icon-nav.png" mode="widthFix"></image>
  5. </navbar>
  6. <view class="content">
  7. <productSwiper :list="productSwiperList"></productSwiper>
  8. <view class="section">
  9. <sectionHeader title="个性推荐" desc="Personal Recommendation"></sectionHeader>
  10. <recommend-swiper :list="recommendList"></recommend-swiper>
  11. <health-records-intro :list="detectionStepList"></health-records-intro>
  12. </view>
  13. <view class="section">
  14. <achievement-intro :list="achievementList"></achievement-intro>
  15. </view>
  16. <view class="section">
  17. <sectionHeader title="团队成员背景" desc="Background of Team Members"></sectionHeader>
  18. <team-bg-intro :list="medicineList"></team-bg-intro>
  19. </view>
  20. <view class="section">
  21. <sectionHeader desc="Background of Team Members">
  22. <template #title>
  23. 关注我们<br/>参与更多健康活动
  24. </template>
  25. </sectionHeader>
  26. <follow-us-intro :articleList="followReasonList" :wayList="followWayList"></follow-us-intro>
  27. </view>
  28. </view>
  29. <tabber select="home" />
  30. </view>
  31. </template>
  32. <script>
  33. import tabber from '@/components/base/tabbar.vue'
  34. import sectionHeader from '@/components/home/sectionHeader.vue'
  35. import productSwiper from '@/components/home/productSwiper.vue'
  36. import recommendSwiper from '@/pages_order/home/recommendSwiper.vue'
  37. import healthRecordsIntro from '@/pages_order/home/healthRecordsIntro.vue'
  38. import achievementIntro from '@/pages_order/home/achievementIntro.vue'
  39. import teamBgIntro from '@/pages_order/home/teamBgIntro.vue'
  40. import followUsIntro from '@/pages_order/home/followUsIntro.vue'
  41. export default {
  42. components: {
  43. productSwiper,
  44. sectionHeader,
  45. recommendSwiper,
  46. healthRecordsIntro,
  47. achievementIntro,
  48. teamBgIntro,
  49. followUsIntro,
  50. tabber,
  51. },
  52. data() {
  53. return {
  54. productSwiperList: [],
  55. recommendList: [],
  56. detectionStepList: [],
  57. achievementList: [],
  58. medicineList: [],
  59. followReasonList: [],
  60. followWayList: [],
  61. }
  62. },
  63. onLoad() {
  64. this.fetchBanner()
  65. this.fetchPersonalized()
  66. this.fetchAbout()
  67. if(uni.getStorageSync('token')){
  68. this.$store.commit('getUserInfo')
  69. }
  70. this.productSwiperList = [
  71. {
  72. id: '001',
  73. url: '',
  74. arr: [
  75. { text: '你是独一无二的', class: 'font1' },
  76. { text: '你的健康数据也是', class: 'font2' },
  77. { text: '普兆,即精准', class: 'font3' },
  78. ],
  79. btns: [
  80. { text: '全部产品', path: '/pages_order/auth/wxLogin' },
  81. { text: '定制健康档案', path: '/pages_order/auth/wxLogin' },
  82. ],
  83. },
  84. {
  85. id: '002',
  86. url: '',
  87. arr: [
  88. { text: '你是独一无二的', class: 'font1' },
  89. { text: '你的健康数据也是', class: 'font2' },
  90. { text: '普兆,即精准', class: 'font3' },
  91. ],
  92. btns: [
  93. { text: '全部产品', path: '/pages_order/auth/wxLogin' },
  94. { text: '定制健康档案', path: '/pages_order/auth/wxLogin' },
  95. ],
  96. },
  97. {
  98. id: '003',
  99. url: '',
  100. arr: [
  101. { text: '你是独一无二的', class: 'font1' },
  102. { text: '你的健康数据也是', class: 'font2' },
  103. { text: '普兆,即精准', class: 'font3' },
  104. ],
  105. btns: [
  106. { text: '全部产品', path: '/pages_order/auth/wxLogin' },
  107. { text: '定制健康档案', path: '/pages_order/auth/wxLogin' },
  108. ],
  109. },
  110. ]
  111. return
  112. this.recommendList = [
  113. {
  114. id: '001',
  115. url: '',
  116. arr: [
  117. { text: '你的身体在“说话”', class: 'font1' },
  118. { text: '你听懂了吗?', class: 'font2' },
  119. { text: '5分钟问卷', class: 'font3' },
  120. ],
  121. btn: { text: 'Al定制方案', path: '/pages_order/auth/wxLogin' },
  122. },
  123. {
  124. id: '002',
  125. url: '',
  126. arr: [
  127. { text: '你的健康', class: 'font1' },
  128. { text: '需要“管理员”', class: 'font2' },
  129. { text: '私人营养师全程跟进', class: 'font3' },
  130. ],
  131. btn: { text: '领取管家', path: '/pages_order/auth/wxLogin' },
  132. },
  133. {
  134. id: '003',
  135. url: '',
  136. arr: [
  137. { text: '你的身体在“说话”', class: 'font1' },
  138. { text: '你听懂了吗?', class: 'font2' },
  139. { text: '5分钟问卷', class: 'font3' },
  140. ],
  141. btn: { text: 'Al定制方案', path: '/pages_order/auth/wxLogin' },
  142. },
  143. ]
  144. this.detectionStepList = [
  145. {
  146. id: '001',
  147. title: '定制检测',
  148. url: '',
  149. desc: '测评读懂你的身体语言,完成定制化检测。',
  150. },
  151. {
  152. id: '002',
  153. title: '定制检测',
  154. url: '',
  155. desc: '用数据精准跟踪你的健康档案。',
  156. },
  157. {
  158. id: '003',
  159. title: '定制检测',
  160. url: '',
  161. desc: '测评读懂你的身体语言,完成定制化检测。',
  162. },
  163. ]
  164. this.achievementList = [
  165. {
  166. id: '001',
  167. url: '',
  168. },
  169. {
  170. id: '002',
  171. url: '',
  172. },
  173. {
  174. id: '003',
  175. url: '',
  176. },
  177. ]
  178. this.medicineList = [
  179. {
  180. id: '001',
  181. url: '',
  182. zh: '维生素D',
  183. en: 'Vitamin D',
  184. },
  185. {
  186. id: '002',
  187. url: '',
  188. zh: '维生素B2',
  189. en: 'Vitamin B2',
  190. },
  191. {
  192. id: '003',
  193. url: '',
  194. zh: '维生素P',
  195. en: 'Vitamin P',
  196. },
  197. {
  198. id: '004',
  199. url: '',
  200. zh: '维生素M',
  201. en: 'Vitamin M',
  202. },
  203. {
  204. id: '005',
  205. url: '',
  206. zh: '维生素B1',
  207. en: 'Vitamin B1',
  208. },
  209. {
  210. id: '006',
  211. url: '',
  212. zh: '维生素C',
  213. en: 'Vitamin C',
  214. },
  215. ]
  216. this.followReasonList = [
  217. {
  218. id: '001',
  219. url: '',
  220. path: '/pages_order/auth/wxLogin',
  221. },
  222. {
  223. id: '002',
  224. url: '',
  225. path: '/pages_order/auth/wxLogin',
  226. },
  227. {
  228. id: '003',
  229. url: '',
  230. path: '/pages_order/auth/wxLogin',
  231. },
  232. ]
  233. this.followWayList = [
  234. {
  235. id: '001',
  236. title: '公众号',
  237. desc: 'PETUAL MEDICAL',
  238. url: '/pages_order/static/index/wx.png',
  239. path: '/pages_order/auth/wxLogin',
  240. },
  241. {
  242. id: '002',
  243. title: '健康伙伴',
  244. desc: 'PETUAL MEDICAL',
  245. url: '/pages_order/static/index/group.png',
  246. path: '/pages_order/auth/wxLogin',
  247. },
  248. {
  249. id: '003',
  250. title: '官方号',
  251. desc: 'PETUAL MEDICAL',
  252. url: '/pages_order/static/index/xhs.png',
  253. path: '/pages_order/auth/wxLogin',
  254. },
  255. ]
  256. },
  257. methods: {
  258. async fetchBanner() {
  259. try {
  260. await this.$fetch('getBanner')
  261. } catch (err) {
  262. }
  263. },
  264. async fetchPersonalized() {
  265. try {
  266. let result = await this.$fetch('getPersonalized')
  267. this.recommendList = result.map(item => {
  268. const { id, title, subTitle, info, btnTxt } = item
  269. return {
  270. id,
  271. // todo: check img url?
  272. // url
  273. arr: [
  274. { text: title, class: 'font1' },
  275. { text: subTitle, class: 'font2' },
  276. { text: info, class: 'font3' },
  277. ],
  278. // btn: { text: btnTxt, path: '/pages_order/auth/wxLogin' },
  279. // todo: check path?
  280. btn: { text: btnTxt },
  281. }
  282. })
  283. } catch (err) {
  284. }
  285. },
  286. async fetchAbout() {
  287. try {
  288. await this.$fetch('getAbout')
  289. this.followReasonList
  290. } catch (err) {
  291. }
  292. },
  293. },
  294. }
  295. </script>
  296. <style scoped lang="scss">
  297. .page__view {
  298. width: 100vw;
  299. min-height: 100vh;
  300. background-color: $uni-bg-color;
  301. position: relative;
  302. }
  303. .nav-icon {
  304. width: 200rpx;
  305. height: auto;
  306. vertical-align: top;
  307. }
  308. .content {
  309. // padding: 80rpx 32rpx 182rpx 32rpx;
  310. padding: 70rpx 0 182rpx 0;
  311. }
  312. .section {
  313. margin-top: 80rpx;
  314. }
  315. </style>