invitationCode.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <view class="page">
  3. <public-module></public-module>
  4. <view class="headers dis a-c j-start">
  5. <u-icon name="arrow-left" color="#333" size="38" @tap="back"></u-icon>
  6. <text style="margin: auto;">邀请码</text>
  7. </view>
  8. <view class="homeBackground"></view>
  9. <view class="p-2">
  10. <!-- 二维码 -->
  11. <view class="bgimg dis f-c ">
  12. <view class="header dis a-c mb-3">
  13. <image src="/static/image/my/wuxingb.png" mode=""></image>
  14. <view class="dis f-c ml-2">
  15. <text>{{userInfo.sysUser.userName}}</text>
  16. <text>{{userInfo.sysUser.deptName}}</text>
  17. </view>
  18. </view>
  19. <view class="dis f-c a-c ">
  20. <view class="panelcanvas " id="panelcanvas">
  21. <image :src="recommendImg" mode="widthFix" lazy-load></image>
  22. </view>
  23. <view class="operation mt-4 dis a-c ">
  24. <view class="dis f-c a-c" style="margin-right: 136rpx;" @click="">
  25. <image src="/static/share.png" mode=""></image>
  26. <text class="mt-1">保存图片</text>
  27. </view>
  28. <view class="dis f-c a-c">
  29. <image src="/static/save.png" mode=""></image>
  30. <text class="mt-1">链接分享</text>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <!-- 标签 -->
  36. <view class="tag mt-2 dis f-c ">
  37. <view class="dis a-c j-s">
  38. <text>我的身份:{{gradeText}}</text>
  39. <view class="entryPoint" v-show="supportUpgrade" @click="upgrade">去升级</view>
  40. </view>
  41. <text class="mt-1">再邀请6个工作室,即可升级成为管理人,赚取更多收益</text>
  42. </view>
  43. <view class="tag mt-2 dis f-c a-start">
  44. <text>我的佣金权益:0.2%</text>
  45. <text class="mt-1">再邀请3-5个工作室,佣金可达0.5%</text>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. import {
  52. pathToBase64,
  53. base64ToPath
  54. } from '@/common/pdf.js'
  55. import QR from "@/common/wxqrcode.js"
  56. import {
  57. mapState,
  58. mapMutations
  59. } from "vuex"
  60. export default {
  61. data() {
  62. return {
  63. recommendImg: "", //邀请码
  64. grade: "", //等级
  65. supportUpgrade: false, //是否支持升级
  66. }
  67. },
  68. onShow() {
  69. },
  70. computed: {
  71. ...mapState(['userInfo', "userCheckInfo"]),
  72. gradeText() {
  73. const gradeMap = {
  74. 1: '创始人',
  75. 2: '管理人',
  76. 3: '合伙人',
  77. 4: '工作室'
  78. }
  79. return gradeMap[this.userInfo.sysUser.grade] || ''
  80. }
  81. },
  82. onLoad(options) {
  83. if (options) {
  84. this.grade = options.grade;
  85. }
  86. this.recommendCode();
  87. this.entryPoint();
  88. },
  89. methods: {
  90. //获取升级标识
  91. async entryPoint() {
  92. let res = await this.$http.post('/partner/verifyUpgradeConditions', {
  93. grade: this.grade,
  94. });
  95. if (res.code == '200') {
  96. this.supportUpgrade = true;
  97. } else {
  98. this.supportUpgrade = false;
  99. }
  100. },
  101. //去升级
  102. async upgrade() {
  103. let res = await this.$http.post('/partner/submitLiftingRecord', {
  104. grade: this.grade,
  105. });
  106. if (res.code == '200') {
  107. uni.navigateTo({
  108. url: '/pages/institutional/applicationResult'
  109. })
  110. }
  111. },
  112. //邀请二维码生成
  113. recommendCode() {
  114. this.recommendImg = QR.createQrCodeImg(this.$base.h5BaseUrl + "/#/pages/index/applypartner?grade=" +
  115. this
  116. .grade + '&userId=' + this.userInfo.sysUser.userId, {
  117. size: parseInt(300) //二维码大小
  118. })
  119. },
  120. back() {
  121. uni.navigateBack({
  122. delta: 1, // 返回的页面数,如果是1表示返回上一页
  123. success: function() {}
  124. });
  125. },
  126. }
  127. }
  128. </script>
  129. <style lang="scss" scoped>
  130. .headers {
  131. position: fixed;
  132. top: 0;
  133. left: 0;
  134. height: auto;
  135. width: 100%;
  136. z-index: 999999;
  137. padding: 30rpx;
  138. padding-top: 50px;
  139. text {
  140. font-size: 36rpx;
  141. font-weight: bold;
  142. color: #000;
  143. }
  144. .headers-activeTab {
  145. width: 80%;
  146. }
  147. .right {
  148. position: absolute;
  149. right: 30rpx;
  150. image {
  151. width: 28rpx;
  152. height: 28rpx;
  153. margin-right: 4rpx;
  154. }
  155. text {
  156. font-weight: 400;
  157. color: #000;
  158. font-size: 24rpx;
  159. }
  160. }
  161. }
  162. //头部背景
  163. .homeBackground {
  164. width: 100%;
  165. height: 176rpx;
  166. background: linear-gradient(180deg, #D1EFFE 0%, #FFFFFF 100%);
  167. }
  168. .bgimg {
  169. width: 100%;
  170. background-image: url("/static/bgimg.png");
  171. background-size: 100% 100%;
  172. padding: 40rpx;
  173. box-sizing: border-box;
  174. background-color: #FFFFFF;
  175. .header {
  176. image {
  177. width: 90rpx;
  178. height: 90rpx;
  179. }
  180. .ml-2 {
  181. text:first-child {
  182. font-size: 32rpx;
  183. color: #333;
  184. font-weight: bold;
  185. }
  186. text:last-child {
  187. font-size: 28rpx;
  188. color: #999;
  189. }
  190. }
  191. }
  192. .panelcanvas {
  193. position: relative;
  194. image {
  195. width: 340rpx;
  196. height: 340rpx;
  197. }
  198. }
  199. .operation {
  200. image {
  201. width: 88rpx;
  202. height: 88rpx;
  203. }
  204. text {
  205. font-size: 24rpx;
  206. color: #333;
  207. }
  208. }
  209. }
  210. .tag {
  211. background: #FFFFFF;
  212. border-radius: 10rpx 10rpx 10rpx 10rpx;
  213. padding: 30rpx;
  214. box-sizing: border-box;
  215. .entryPoint {
  216. background: linear-gradient(132deg, #2DD9FF 0%, #2D6DFF 100%);
  217. border-radius: 4rpx 4rpx 4rpx 4rpx;
  218. padding: 1rpx 17rpx;
  219. box-sizing: border-box;
  220. font-size: 24rpx;
  221. color: #FFFFFF;
  222. }
  223. text:first-child {
  224. font-size: 30rpx;
  225. color: #333;
  226. font-weight: bold;
  227. }
  228. text:last-child {
  229. font-size: 24rpx;
  230. color: #666;
  231. }
  232. }
  233. </style>