follow.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <view v-if='!subscribe'>
  3. <!-- #ifdef H5 -->
  4. <view class="follow acea-row row-between-wrapper" :style="'background:' + bgColor + ';margin-top:' + mbConfig + 'rpx;margin-left:'+prConfig+'rpx;margin-right:'+prConfig+'rpx;'">
  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" :style="{ 'background-image': `url(${domain}/static/images/code-bg.png)`}"><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. // +----------------------------------------------------------------------
  22. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  23. // +----------------------------------------------------------------------
  24. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  25. // +----------------------------------------------------------------------
  26. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  27. // +----------------------------------------------------------------------
  28. // | Author: CRMEB Team <admin@crmeb.com>
  29. // +----------------------------------------------------------------------
  30. // #ifdef H5
  31. import { getSubscribe } from '@/api/public';
  32. import { HTTP_REQUEST_URL } from '@/config/app';
  33. export default {
  34. name: 'follow',
  35. props: {
  36. dataConfig: {
  37. type: Object,
  38. default: () => {}
  39. }
  40. },
  41. data() {
  42. return {
  43. domain: HTTP_REQUEST_URL,
  44. followCode: false,
  45. followUrl:this.dataConfig.codeConfig.url,
  46. bgColor:this.dataConfig.bgColor.color[0].item,
  47. imgConfig:this.dataConfig.imgConfig.url,
  48. mbConfig:this.dataConfig.mbConfig.val*2,
  49. prConfig:this.dataConfig.prConfig&&this.dataConfig.prConfig.val*2 || 0,
  50. themeColor:this.dataConfig.themeColor.color[0].item,
  51. titleConfig:this.dataConfig.titleConfig.value,
  52. subscribe: true
  53. };
  54. },
  55. created() {},
  56. mounted() {
  57. getSubscribe().then(res => {
  58. this.subscribe = res.data.subscribe;
  59. }).catch(() => {})
  60. },
  61. methods: {
  62. followTap(){
  63. this.followCode = true;
  64. },
  65. closeFollowCode(){
  66. this.followCode = false
  67. },
  68. }
  69. }
  70. // #endif
  71. </script>
  72. <style lang="scss" scoped>
  73. .follow {
  74. padding: 0 20rpx;
  75. height: 140rpx;
  76. background: rgba(0, 0, 0, 0.02);
  77. .picTxt {
  78. .pictrue {
  79. width: 92rpx;
  80. height: 92rpx;
  81. border-radius: 50%;
  82. image {
  83. width: 100%;
  84. height: 100%;
  85. border-radius: 50%;
  86. }
  87. }
  88. .name {
  89. font-size: 32rpx;
  90. color: #000;
  91. margin-left: 32rpx;
  92. width: 400rpx;
  93. }
  94. }
  95. .notes {
  96. font-size: 28rpx;
  97. color: #02a0e8;
  98. width: 120rpx;
  99. height: 52rpx;
  100. border: 2rpx solid rgba(2, 160, 232, 1);
  101. opacity: 1;
  102. border-radius: 6rpx;
  103. }
  104. }
  105. .followCode {
  106. .pictrue {
  107. width: 500rpx;
  108. height: 720rpx;
  109. border-radius: 12px;
  110. left: 50%;
  111. top: 50%;
  112. margin-left: -250rpx;
  113. margin-top: -360rpx;
  114. position: fixed;
  115. z-index: 10000;
  116. .code-bg {
  117. display: flex;
  118. justify-content: center;
  119. width: 100%;
  120. height: 100%;
  121. background-size: 100% 100%;
  122. }
  123. .imgs {
  124. width: 310rpx;
  125. height: 310rpx;
  126. margin-top: 92rpx;
  127. }
  128. }
  129. .mask {
  130. z-index: 9999;
  131. }
  132. }
  133. </style>