裂变星小程序-25.03.04
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.0 KiB

  1. <template>
  2. <view class="page">
  3. <navbar leftClick @leftClick="$utils.navigateBack" />
  4. <view class="content">
  5. <image class="avatar" :src="detail.imageUrl"></image>
  6. <text class="nick-name">{{ detail.groupName }}</text>
  7. <template v-if="isLocked">
  8. <button class="btn" type="success" @click="openPopup">加入</button>
  9. </template>
  10. <view v-else class="group-info flex">
  11. <text>扫一扫加群主审核进群</text>
  12. <image class="qr" :src="detail.qrCode" :show-menu-by-longpress="true"></image>
  13. </view>
  14. </view>
  15. <popupUnlock ref="popupUnlock" src="../static/sharing/unlock-group.png"></popupUnlock>
  16. </view>
  17. </template>
  18. <script>
  19. import popupUnlock from '../components/popupUnlock.vue'
  20. export default {
  21. components: {
  22. popupUnlock,
  23. },
  24. data() {
  25. return {
  26. detail: {
  27. id: null,
  28. avatarUrl: null,
  29. nickName: null,
  30. imageUrl: null,
  31. times: 10,
  32. qrCode: null,
  33. description: null,
  34. },
  35. isLocked: true,
  36. }
  37. },
  38. onLoad(option) {
  39. const { id } = option
  40. this.fetchSharingDetail(id)
  41. },
  42. onShareAppMessage(res) {
  43. const {
  44. description,
  45. imageUrl,
  46. } = this.detail
  47. // todo: check
  48. let o = {
  49. title : description,
  50. imageUrl: imageUrl,
  51. // path: `/pages_order/sharing/personal?id=${this.detail.id}`
  52. query: `id=${this.detail.id}`,
  53. }
  54. // todo: check callback? settimeout?
  55. // todo: get times and check is unlocked
  56. this.isLocked = false
  57. return o
  58. },
  59. methods: {
  60. async fetchSharingDetail(id) {
  61. // todo: init data by id
  62. this.detail = {
  63. id: '001',
  64. groupName: '裂变星创业服务交流群',
  65. imageUrl: 'http://gips3.baidu.com/it/u=70459541,3412285454&fm=3028&app=3028&f=JPEG&fmt=auto?w=960&h=1280',
  66. times: 10,
  67. qrCode: '../static/temp-qrcode.png',
  68. // title: '裂变星轻松获客',
  69. description: '如此好用的赚钱项目,赶快加入吧!',
  70. auditStatus: 2,
  71. createTime: '2025年2月1日',
  72. state: 2,
  73. }
  74. },
  75. openPopup() {
  76. this.$refs.popupUnlock.open();
  77. },
  78. },
  79. }
  80. </script>
  81. <style scoped lang="scss">
  82. .page {
  83. position: relative;
  84. height: 100vh;
  85. }
  86. .content {
  87. display: flex;
  88. flex-direction: column;
  89. align-items: center;
  90. }
  91. .avatar {
  92. width: 180rpx;
  93. height: 180rpx;
  94. margin-top: 127rpx;
  95. }
  96. .nick-name {
  97. color: #1B1B1B;
  98. font-size: 32rpx;
  99. margin-top: 30rpx;
  100. }
  101. .btn, .group-info {
  102. position: absolute;
  103. }
  104. .btn {
  105. width: calc(100% - 60rpx*2);
  106. height: auto;
  107. left: 60rpx;
  108. bottom: 292rpx;
  109. background-color: #07C160;
  110. border: none;
  111. color: #FFFFFF;
  112. font-size: 28rpx;
  113. line-height: 1;
  114. border-radius: 45rpx;
  115. padding: 25rpx 0;
  116. box-sizing: border-box;
  117. }
  118. .group-info {
  119. bottom: 269rpx;
  120. flex-direction: column;
  121. color: #1B1B1B;
  122. font-size: 32rpx;
  123. }
  124. .qr {
  125. margin-top: 40rpx;
  126. width: 350rpx;
  127. height: 350rpx;
  128. }
  129. </style>