follow.vue 2.7 KB

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