普兆健康管家前端代码仓库
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.

154 lines
3.2 KiB

  1. <template>
  2. <view class="view">
  3. <view>
  4. <view class="card" v-for="article in list" :key="article.id" @click="jumpToArticle(article.id)">
  5. <image class="card-img" :src="article.image" mode="scaleToFill"></image>
  6. <!-- todo: check is need to show? -->
  7. <!-- <view class="card-title">{{ article.title }}</view> -->
  8. </view>
  9. </view>
  10. <view class="ways__view">
  11. <view class="way flex flex-column" v-for="(way, wIdx) in wayList" :key="wIdx" @click="openQrPopup(way.key)">
  12. <image class="way-icon" :src="way.url" mode="scaleToFill"></image>
  13. <view class="way-desc">{{ way.desc }}</view>
  14. <view class="way-title flex"><text style="margin-right: 4rpx;">{{ way.title }}</text><uv-icon name="arrow-right" color="#252545" size="24rpx"></uv-icon></view>
  15. </view>
  16. </view>
  17. <popupQrCode ref="popupQrCode"></popupQrCode>
  18. </view>
  19. </template>
  20. <script>
  21. import popupQrCode from '@/components/config/popupQrCode.vue'
  22. export default {
  23. components: {
  24. popupQrCode,
  25. },
  26. data() {
  27. return {
  28. list: [],
  29. wayList: [],
  30. key: '',
  31. }
  32. },
  33. created() {
  34. this.getData()
  35. this.wayList = [
  36. {
  37. id: '001',
  38. title: '公众号',
  39. desc: 'PETUAL MEDICAL',
  40. url: '/pages_order/static/index/wx.png',
  41. key: 'qrcode_wx_official_account',
  42. },
  43. {
  44. id: '002',
  45. title: '健康伙伴',
  46. desc: 'PETUAL MEDICAL',
  47. url: '/pages_order/static/index/group.png',
  48. key: 'qrcode_enterprise_wx',
  49. },
  50. {
  51. id: '003',
  52. title: '官方号',
  53. desc: 'PETUAL MEDICAL',
  54. url: '/pages_order/static/index/xhs.png',
  55. key: 'qrcode_xhs',
  56. },
  57. ]
  58. },
  59. methods: {
  60. async getData() {
  61. try {
  62. this.list = await this.$fetch('getAbout')
  63. } catch (err) {
  64. }
  65. },
  66. jumpToArticle(id) {
  67. uni.navigateTo({
  68. url: `/pages_order/home/about?id=${id}`
  69. })
  70. },
  71. openQrPopup(key) {
  72. this.$refs.popupQrCode.open(key)
  73. },
  74. },
  75. }
  76. </script>
  77. <style scoped lang="scss">
  78. .view {
  79. padding: 24rpx 32rpx 0 32rpx;
  80. }
  81. .card {
  82. position: relative;
  83. font-size: 0;
  84. overflow: hidden;
  85. border-radius: 32rpx;
  86. background-image: linear-gradient(to right, #FAFAFF, #F3F3F3);
  87. box-shadow: -5rpx -5rpx 20rpx 0 #FFFFFF,
  88. 10rpx 10rpx 20rpx 0 #AAAACC80,
  89. 4rpx 4rpx 10rpx 0 #AAAACC40,
  90. -2rpx -2rpx 5rpx 0 #FFFFFF;
  91. & + & {
  92. margin-top: 32rpx;
  93. }
  94. &-img {
  95. width: 100%;
  96. height: calc((100vw - 32rpx*2) * 129 / 343);
  97. }
  98. &-title {
  99. position: absolute;
  100. top: 80rpx;
  101. left: 60rpx;
  102. font-family: PingFang SC;
  103. font-size: 28rpx;
  104. font-weight: 500;
  105. line-height: 1.4;
  106. color: #000000;
  107. }
  108. }
  109. .ways__view {
  110. margin-top: 80rpx;
  111. display: grid;
  112. grid-template-columns: repeat(3, 1fr);
  113. grid-column-gap: 24rpx;
  114. }
  115. .way {
  116. &-icon {
  117. width: 80rpx;
  118. height: 80rpx;
  119. }
  120. &-desc {
  121. margin-top: 24rpx;
  122. font-family: PingFang SC;
  123. font-size: 22rpx;
  124. font-weight: 400;
  125. line-height: 1.4;
  126. color: #989898;
  127. }
  128. &-title {
  129. font-family: PingFang SC;
  130. font-size: 24rpx;
  131. font-weight: 400;
  132. line-height: 1.4;
  133. color: #252545;
  134. }
  135. }
  136. </style>