follow.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view>
  3. <!-- #ifdef H5 -->
  4. <view class="follow acea-row row-between-wrapper" :style="'background:' + bgColor + ';margin-top:' + mbConfig + 'rpx;'" v-if='subscribe === false'>
  5. <view class="picTxt acea-row row-middle">
  6. <view class="pictrue"><image :src="imgConfig"></image></view>
  7. <view class="name line1">{{ titleConfig }}</view>
  8. </view>
  9. <view class="notes acea-row row-center-wrapper" :style="'color:' + themeColor + ';border-color:' + themeColor + ';'" @click="followTap">关注</view>
  10. </view>
  11. <view class="followCode" v-if="followCode">
  12. <view class="pictrue">
  13. <view class="code-bg"><img class="imgs" :src="followUrl" /></view>
  14. </view>
  15. <view class="mask" @click="closeFollowCode"></view>
  16. </view>
  17. <!-- #endif -->
  18. </view>
  19. </template>
  20. <script>
  21. // #ifdef H5
  22. import {
  23. getSubscribe
  24. } from '@/api/public';
  25. export default {
  26. name: 'follow',
  27. props: {
  28. dataConfig: {
  29. type: Object,
  30. default: () => {}
  31. }
  32. },
  33. data() {
  34. return {
  35. followCode: false,
  36. followUrl:this.dataConfig.codeConfig.url,
  37. bgColor:this.dataConfig.bgColor.color[0].item,
  38. imgConfig:this.dataConfig.imgConfig.url,
  39. mbConfig:this.dataConfig.mbConfig.val*2,
  40. themeColor:this.dataConfig.themeColor.color[0].item,
  41. titleConfig:this.dataConfig.titleConfig.value,
  42. subscribe: true
  43. };
  44. },
  45. created() {},
  46. mounted() {
  47. getSubscribe().then(res => {
  48. this.subscribe = res.data.subscribe || false;
  49. }).catch(() => {})
  50. },
  51. methods: {
  52. followTap(){
  53. this.followCode = true;
  54. },
  55. closeFollowCode(){
  56. this.followCode = false
  57. },
  58. }
  59. }
  60. // #endif
  61. </script>
  62. <style lang="scss">
  63. .follow {
  64. padding: 0 20rpx;
  65. height: 140rpx;
  66. background: rgba(0, 0, 0, 0.02);
  67. .picTxt {
  68. .pictrue {
  69. width: 92rpx;
  70. height: 92rpx;
  71. border-radius: 50%;
  72. image {
  73. width: 100%;
  74. height: 100%;
  75. border-radius: 50%;
  76. }
  77. }
  78. .name {
  79. font-size: 32rpx;
  80. color: #000;
  81. margin-left: 32rpx;
  82. width: 400rpx;
  83. }
  84. }
  85. .notes {
  86. font-size: 28rpx;
  87. color: #02a0e8;
  88. width: 120rpx;
  89. height: 52rpx;
  90. border: 2rpx solid rgba(2, 160, 232, 1);
  91. opacity: 1;
  92. border-radius: 6rpx;
  93. }
  94. }
  95. .followCode {
  96. .pictrue {
  97. width: 500rpx;
  98. height: 720rpx;
  99. border-radius: 12px;
  100. left: 50%;
  101. top: 50%;
  102. margin-left: -250rpx;
  103. margin-top: -360rpx;
  104. position: fixed;
  105. z-index: 10000;
  106. .code-bg {
  107. display: flex;
  108. justify-content: center;
  109. width: 100%;
  110. height: 100%;
  111. background-image: url('~@/static/images/code-bg.png');
  112. background-size: 100% 100%;
  113. }
  114. .imgs {
  115. width: 310rpx;
  116. height: 310rpx;
  117. margin-top: 92rpx;
  118. }
  119. }
  120. .mask {
  121. z-index: 9999;
  122. }
  123. }
  124. </style>