index.vue 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. <template>
  2. <view class="cnt_wrapper">
  3. <image class='bannerImg' src="../../static/images/1.png" alt="" srcset="" />
  4. <image class='title_img' src="../../static/images/2.png" mode="">
  5. <view class="content">
  6. <view class="searchBtn">
  7. <van-search shape="round" v-model="value" placeholder="搜索知识" />
  8. </view>
  9. <view class="imgBox">
  10. <view class="img_box img_color1">
  11. <!-- <img class='img_box_tu' src="../../static/images/5.png" alt="" /> -->
  12. <image class='img_box_tu' src="../../static/images/5.png" mode=""></image>
  13. <view class="imgBox_title">健康咨询</view>
  14. <view class='img_box_text'>优质服务 限时响应</view>
  15. </view>
  16. <view class="img_box img_color2">
  17. <!-- <img class='img_box_tu' src="../../static/images/6.png" alt="" /> -->
  18. <image class='img_box_tu' src="../../static/images/6.png" mode=""></image>
  19. <view class="imgBox_title">专家名医</view>
  20. <view class='img_box_text'>肾科医生 全国专家</view>
  21. </view>
  22. <view class="img_box img_color3">
  23. <!-- <img class='img_box_tu' src="../../static/images/7.png" alt="" /> -->
  24. <image class='img_box_tu' src="../../static/images/7.png" mode=""></image>
  25. <view class="imgBox_title">在线买药</view>
  26. <view class='img_box_text'>优惠购药 极速送达</view>
  27. </view>
  28. </view>
  29. <view class="health" style="">
  30. <view class="health_1" style="" @click="recordclick">
  31. <image class="health_img" src="../../static/images/11.png" mode=""></image>
  32. <!-- <img class="health_img" src="../../static/images/11.png" alt="" /> -->
  33. <view class="">健康档案</view>
  34. </view>
  35. <view class="health_1" style="" @click="healthclick">
  36. <!-- <img class="health_img" src="../../static/images/12.png" alt="" /> -->
  37. <image class="health_img" src="../../static/images/12.png" mode=""></image>
  38. <view class="">健康监测</view>
  39. </view>
  40. <view class="health_1" style="" @click="toCode">
  41. <!-- <img class="health_img" src="../../static/images/13.png" alt="" /> -->
  42. <image class="health_img" src="../../static/images/13.png" mode=""></image>
  43. <view class="">透析签到</view>
  44. </view>
  45. <view class="health_1" style="" @click="toDialysis">
  46. <!-- <img class="health_img" src="../../static/images/14.png" alt="" /> -->
  47. <image class="health_img" src="../../static/images/14.png" mode=""></image>
  48. <view class="">我的透析</view>
  49. </view>
  50. </view>
  51. <view class="img_bottom" style="">
  52. <image class="bottom" style="" src="../../static/images/15.png" mode=""></image>
  53. <view class="img_text">呵护每一位肾友健康</view>
  54. </view>
  55. <view class="knowledge" v-for="(item,index) in 6" :key='index'>
  56. <view class="knowledge_box" style="" @click="wenzhang_click(index)">
  57. <view class="box_left" style="">
  58. <view style="" class="knowledge_title">领透圣卫士肾友知识小科普</view>
  59. <view class="author" style="">
  60. <text class='author_1'>圣妞儿</text>
  61. <text class='author_1'>阅读量:xxxxx</text>
  62. </view>
  63. </view>
  64. <view class="box_right" style="width: 30%;">
  65. <!-- <img class="right_img" style="" src="../../static/images/11.png" alt="" /> -->
  66. <image class="right_img" style="" src="../../static/images/11.png" mode=""></image>
  67. </view>
  68. </view>
  69. </view>
  70. <!-- <view class="imgBox_title">
  71. <img class="imgtitle" @click="toCup" src="../../static/images/story.png" alt="">
  72. </view>
  73. <view class="article_list">
  74. <view class="list_box" v-for="li in act_li">
  75. <view class="title_list">
  76. <h3 style="font-weight: bold;">{{li.title}}</h3>
  77. </view>
  78. <view class="content_list">
  79. <span>{{li.content}}</span>
  80. </view>
  81. <view class="bottom_list">
  82. <view class="name_date">
  83. <img src="../../static/images/author.png" alt="..">
  84. <span>{{li.author}}</span>
  85. <span>{{li.date}}</span>
  86. </view>
  87. <view class="read">
  88. <img src="../../static/images/read.png" alt="">
  89. <span>{{li.readNum}}</span>
  90. </view>
  91. <view class="nice">
  92. <img src="../../static/images/nice.png" alt="">
  93. <span>{{li.niceNum}}</span>
  94. </view>
  95. </view>
  96. </view>
  97. </view> -->
  98. <van-toast id="van-toast" />
  99. </view>
  100. </view>
  101. </template>
  102. <script>
  103. import Toast from '@/wxcomponents/vant/toast/toast';
  104. import Vue from 'vue';
  105. import {
  106. mapState,
  107. mapGetters,
  108. mapActions,
  109. mapMutations
  110. } from 'vuex'
  111. import { login } from '../../api/api';
  112. export default {
  113. // page({
  114. data() {
  115. return {
  116. title: 'Hello',
  117. name: '',
  118. url: "",
  119. city: '',
  120. act_li: [{
  121. title: '111',
  122. content: '哈哈哈哈',
  123. author: '张三',
  124. date: '2022-11-2',
  125. readNum: '1245',
  126. niceNum: '2635'
  127. }, {
  128. title: '222',
  129. content: 'xixixi',
  130. author: '周小英',
  131. date: '2022-10-2',
  132. readNum: '1245',
  133. niceNum: '2635'
  134. }, {
  135. title: '糖尿病能吃哪些水果?',
  136. content: '根据最新发布的糖尿病膳食指南以及中国糖尿病医学营养治疗指南',
  137. author: '猪大强',
  138. date: '2022-10-2',
  139. readNum: '1245',
  140. niceNum: '2635'
  141. }]
  142. }
  143. },
  144. computed: {
  145. ...mapGetters(['getHasLogin', 'getBind'])
  146. },
  147. onLoad() {},
  148. methods: {
  149. // 健康监测
  150. healthclick(){
  151. wx.navigateTo({
  152. url:'/pages/Health_monitor/index'
  153. })
  154. },
  155. // 健康档案
  156. recordclick(){
  157. wx.navigateTo({
  158. url:'/pages/Health_record/index'
  159. })
  160. // wx.navigateTo({
  161. // // url:'/pages/Health_record/creatinine'
  162. // url:'/pages/Health_record/archives'
  163. // })
  164. console.log('111111');
  165. },
  166. wenzhang_click(index){
  167. console.log('用户点击取消',index);
  168. uni.switchTab({
  169. url: '/pages/my/index'
  170. })
  171. // wx.redirectTo({
  172. // url:'pages/dialysis/index'
  173. // })
  174. },
  175. getCheckSession() {
  176. uni.checkSession({
  177. success: function(res) {
  178. },
  179. fail: function(res) {
  180. console.log(res, '登录过期了')
  181. uni.showModal({
  182. title: '提示',
  183. content: '您尚未绑定任何就诊人,绑定后可继续操作',
  184. success: function(res) {
  185. if (res.confirm) {
  186. uni.switchTab({
  187. url: '/pages/my/index'
  188. })
  189. } else if (res.cancel) {
  190. console.log('用户点击取消');
  191. }
  192. }
  193. });
  194. },
  195. })
  196. },
  197. getUserInfomation() {
  198. // uni.login({
  199. // provider: 'weixin',
  200. // success: function (loginRes) {
  201. // console.log(loginRes);
  202. // }
  203. // });
  204. uni.login({
  205. provider: 'univerify',
  206. univerifyStyle: {
  207. fullScreen: true
  208. }
  209. })
  210. },
  211. noClick() {
  212. Toast('敬请期待');
  213. },
  214. // 跳转透析记录
  215. toDialysis() {
  216. let userInfo = uni.getStorageSync('userInfo')
  217. let hasLogin = this.$store.state.data.hasLogin
  218. console.log('userInfo',this.$store.state.data.hasLogin)
  219. if (!this.getHasLogin) {
  220. uni.showModal({
  221. title: '提示',
  222. content: '您未登录,登录后可继续操作',
  223. confirmText: '立即登录',
  224. success: function(res) {
  225. if (res.confirm) {
  226. uni.switchTab({
  227. url: '/pages/my/index'
  228. })
  229. } else if (res.cancel) {
  230. console.log('用户点击取消');
  231. }
  232. }
  233. });
  234. } else {
  235. if (!this.getBind) {
  236. uni.showModal({
  237. title: '未绑定',
  238. content: '是否去绑定',
  239. success: function(res) {
  240. if (res.confirm) {
  241. uni.navigateTo({
  242. // url: '/pages/userBinding/index'
  243. url:'/pages/addPatient/index'
  244. })
  245. } else if (res.cancel) {
  246. console.log('用户点击取消');
  247. }
  248. }
  249. });
  250. } else {
  251. uni.navigateTo({
  252. url: '/pages/dialysis/index'
  253. })
  254. }
  255. }
  256. // uni.navigateTo({
  257. // url: '/pages/dialysis/index'
  258. // })
  259. },
  260. toshop() {
  261. // if (!this.getHasLogin) {
  262. // uni.showModal({
  263. // title: '未登录',
  264. // content: '是否去登录',
  265. // success: function(res) {
  266. // if (res.confirm) {
  267. // uni.switchTab({
  268. // url: '/pages/my/index'
  269. // })
  270. // } else if (res.cancel) {
  271. // console.log('用户点击取消');
  272. // }
  273. // }
  274. // });
  275. // } else {
  276. // if (!this.getBind) {
  277. // uni.showModal({
  278. // title: '未绑定',
  279. // content: '是否去绑定',
  280. // success: function(res) {
  281. // if (res.confirm) {
  282. // uni.navigateTo({
  283. // url: '/pages/userBinding/index'
  284. // })
  285. // } else if (res.cancel) {
  286. // console.log('用户点击取消');
  287. // }
  288. // }
  289. // });
  290. // } else {
  291. // uni.navigateTo({
  292. // url: '/pages/shop/index'
  293. // })
  294. // }
  295. // }
  296. Toast('敬请期待');
  297. },
  298. // 透析签到
  299. toCode() {
  300. if (!this.getHasLogin) {
  301. uni.showModal({
  302. title: '未登录',
  303. content: '是否去登录',
  304. success: function(res) {
  305. if (res.confirm) {
  306. uni.switchTab({
  307. url: '/pages/my/index'
  308. })
  309. } else if (res.cancel) {
  310. console.log('用户点击取消');
  311. }
  312. }
  313. });
  314. } else {
  315. if (!this.getBind) {
  316. uni.showModal({
  317. title: '未绑定',
  318. content: '是否去绑定',
  319. success: function(res) {
  320. if (res.confirm) {
  321. uni.navigateTo({
  322. url: '/pages/userBinding/index'
  323. })
  324. } else if (res.cancel) {
  325. console.log('用户点击取消');
  326. }
  327. }
  328. });
  329. } else {
  330. uni.navigateTo({
  331. url: '/pages/code/index'
  332. })
  333. }
  334. }
  335. // uni.navigateTo({
  336. // url: '/pages/dialysisRecord/index'
  337. // })
  338. },
  339. toCup() {
  340. Toast('敬请期待');
  341. // uni.navigateTo({
  342. // // url: '/pages/cup/index',
  343. // // url:'/subPackages/pages/cup/index'
  344. // })
  345. }
  346. }
  347. }
  348. </script>
  349. <style scoped>
  350. page {
  351. height: 100%;
  352. }
  353. .cnt_wrapper {
  354. margin: 0;
  355. padding: 0;
  356. height: 100%;
  357. }
  358. .imgs{
  359. height: 400rpx;
  360. }
  361. .content {
  362. height: 100%;
  363. padding: 0 20rpx;
  364. transform: translateY(-215rpx);
  365. }
  366. .bannerImg {
  367. height: 333rpx;
  368. width: 100%;
  369. border-radius: 8rpx;
  370. z-index: -2;
  371. }
  372. .title_img{
  373. width: 161px;
  374. height: 28px;
  375. position: absolute;
  376. top: 0px;
  377. left: 0px;
  378. }
  379. .imgBox {
  380. display: flex;
  381. justify-content: space-between;
  382. margin-top: 25rpx;
  383. /* background: #fff; */
  384. border-radius: 10rpx;
  385. /* box-shadow: 0px 2rpx 24rpx 0px #f4f4f4; */
  386. }
  387. .img_box{
  388. padding: 10rpx;
  389. width: 6.4rem;
  390. text-align: center;
  391. border-radius: 10rpx;
  392. /* background-color: #eeeeff; */
  393. }
  394. .img_color1{
  395. background-color: #ecf4fc;
  396. }
  397. .img_color2{
  398. background-color: #e6fff4;
  399. }
  400. .img_color3{
  401. background-color: #fff7eb;
  402. }
  403. .img_box_tu{
  404. width: 100rpx;
  405. height: 100rpx;
  406. padding-bottom: 10rpx;
  407. }
  408. .imgBox_title {
  409. color: black;
  410. }
  411. .img_box_text{
  412. color: gray;
  413. font-size: 24rpx;
  414. /* padding-bottom: 10rpx; */
  415. }
  416. .health{
  417. display: flex;
  418. margin-top: 20rpx;
  419. text-align: center;
  420. }
  421. .health_1{
  422. flex: 1;
  423. }
  424. .health_img{
  425. height: 100rpx;
  426. width: 100rpx;
  427. }
  428. .img_text{
  429. width: 350rpx;
  430. text-align: center;
  431. border-radius: 50rpx;
  432. background: #fff;
  433. color: #50c793;
  434. position: absolute;
  435. top: 60rpx;
  436. left: 180rpx;
  437. }
  438. .img_bottom{
  439. width: 99%;
  440. height: 150rpx;
  441. margin-top: 20rpx;
  442. position: relative;
  443. }
  444. .bottom{
  445. width: 100%;
  446. height: 150rpx;
  447. }
  448. .knowledge{
  449. margin-top: 20rpx;
  450. }
  451. .knowledge_box{
  452. margin-bottom: 20rpx;
  453. display: flex;
  454. padding: 10rpx;
  455. /* border: 1px solid black; */
  456. height: 160rpx;
  457. background: #f2f0f0b3;
  458. box-shadow: 0 0 5 f2f0f0b3;
  459. border-radius: 20rpx;
  460. }
  461. .box_left{
  462. width: 70%;
  463. }
  464. .box_right{
  465. width: 30%;
  466. }
  467. .knowledge_title{
  468. height: 120rpx;
  469. font-size: 36rpx;
  470. }
  471. .author{
  472. height: 40rpx;
  473. font-size: 28rpx;
  474. display: flex;
  475. text-align: left;
  476. }
  477. .author_1{
  478. flex: 1;
  479. }
  480. .right_img{
  481. width: 100%;
  482. height: 160rpx;
  483. }
  484. .imgBox_title .imgtitle {
  485. width: 150rpx;
  486. height: 36rpx;
  487. margin-top: 20rpx;
  488. }
  489. .article_list {
  490. display: flex;
  491. flex-direction: column;
  492. justify-content: space-evenly;
  493. margin-top: 25rpx;
  494. background: #fff;
  495. border-radius: 10rpx;
  496. box-shadow: 0px 2rpx 24rpx 0px #f4f4f4;
  497. max-height: 730rpx;
  498. overflow: scroll;
  499. }
  500. .list_box {
  501. width: 90%;
  502. margin: 20rpx auto;
  503. border-bottom: 1px solid #e5e5e5;
  504. padding: 20rpx 0;
  505. }
  506. .list_box .content_list {
  507. font-size: 28rpx;
  508. color: #757373;
  509. padding: 10rpx 0;
  510. }
  511. .bottom_list {
  512. display: flex;
  513. justify-content: space-between;
  514. color: #c2c2c2;
  515. }
  516. .bottom_list img {
  517. width: 50rpx;
  518. height: 50rpx;
  519. }
  520. .bottom_list span {
  521. font-size: 24rpx;
  522. }
  523. .bottom_list .name_date,
  524. .read,
  525. .nice {
  526. display: flex;
  527. align-items: center;
  528. }
  529. .imgDislysis {
  530. width: 344rpx;
  531. height: 374rpx;
  532. background: linear-gradient(0deg, #28D87D, #01BD5D);
  533. box-shadow: 0px 0px 24rpx 0px rgba(9, 196, 148, 0.3);
  534. border-radius: 16rpx;
  535. }
  536. .imgBoxRight {
  537. display: flex;
  538. flex-direction: column;
  539. justify-content: space-between;
  540. margin-top: 30rpx;
  541. }
  542. .imgBoxRight img {
  543. width: 235rpx;
  544. height: 250rpx;
  545. /* background: #FEF4D8; */
  546. /* box-shadow: 0px 2rpx 24rpx 0px rgba(255, 209, 110, 0.3); */
  547. border-radius: 16rpx;
  548. }
  549. .imgVideo {
  550. width: 344rpx;
  551. height: 223rpx;
  552. background: #FEE6D8;
  553. box-shadow: 0px 2rpx 24rpx 0px rgba(255, 171, 110, 0.3);
  554. border-radius: 16rpx;
  555. margin-top: 20rpx;
  556. }
  557. .van-search {
  558. padding: 0rpx;
  559. }
  560. </style>
  561. <style lang="scss">
  562. .searchBtn {
  563. .van-search {
  564. padding: 0;
  565. border-radius: 50rpx;
  566. }
  567. }
  568. </style>