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

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