fission.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991
  1. <template>
  2. <v-container class="invite-user" fluid :class="`bg-${type}`">
  3. <div class="rule" @click="show = true">规则</div>
  4. <div class="box1">
  5. <div class="fcnc">
  6. <div v-for="(item, index) in level.levelAwardDetails" :key="item.goodsId">
  7. <div v-if="index < 4" class="cybz-content-container">
  8. <v-img class="cybz-content" :src="returnContent[index].img" />
  9. <div class="cybz-content-text">{{returnContent[index].content}}</div>
  10. <img v-if="item.status === 0" class="w76h24" src="~/assets/image/activity/invite-user/btn-3.png" alt="">
  11. <img v-else-if="item.status === 1" class="w76h24" src="~/assets/image/activity/invite-user/btn-1.png" alt="" @click="receiveLevelAward(item.goodsId)">
  12. <img v-else-if="item.status === 2" class="w76h24" src="~/assets/image/activity/invite-user/btn-2.png" alt="">
  13. </div>
  14. </div>
  15. </div>
  16. <v-btn v-if="received" class="share-button" rounded @click="share()">
  17. 云机免费领取
  18. </v-btn>
  19. <v-btn v-else class="share-button" rounded @click="share()">
  20. 赶紧分享你的好友,送云机时长
  21. </v-btn>
  22. <div class="dqdj-content">
  23. <div class="dqdj-item">
  24. <div class="dqdj-title">{{ level.currentLevelName }}</div>
  25. <div class="dqdj-text">当前等级</div>
  26. </div>
  27. <div class="dqdj-content-line"></div>
  28. <div class="dqdj-item">
  29. <div class="dqdj-title">{{ level.shareFriendCount }}</div>
  30. <div class="dqdj-text">分享好友数</div>
  31. </div>
  32. <div class="dqdj-content-line"></div>
  33. <div class="dqdj-item">
  34. <div class="dqdj-title">{{ level.boostValue }}</div>
  35. <div class="dqdj-text">累计助力值</div>
  36. </div>
  37. </div>
  38. <div class="progress">
  39. <div class="progress-box" :style="`width: ${width}px`"></div>
  40. <div class="progress-list">
  41. <div v-for="item in level.levelAwardDetails" :key="item.goodsId" class="fnc">
  42. <img v-if="item.status === 0" class="wh38" src="~/assets/image/activity/invite-user/box-gray.png" alt="">
  43. <img v-else-if="item.status === 1" class="wh38" src="~/assets/image/activity/invite-user/box-close.png" alt="" @click="receiveLevelAward(item.goodsId)">
  44. <img v-else-if="item.status === 2" class="wh38" src="~/assets/image/activity/invite-user/box-open.png" alt="">
  45. <span class="progress-text">{{ item.levelName }}</span>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <div v-if="type === 2" :class="current ? 'box3 tab2' : 'box3'">
  51. <div class="tab">
  52. <div class="tab-item" @click="current = 0">{{ current === 1 ? '我的奖励' : '' }}</div>
  53. <div class="tab-item" @click="current = 1">{{ current === 1 ? '排行榜' : '' }}</div>
  54. </div>
  55. <div v-show="current === 0">
  56. <div v-if="myActivationCode.length" class="code-table">
  57. <div class="table-header">
  58. <table class="w-full">
  59. <colgroup>
  60. <col class="time-col" />
  61. <col class="code-col" />
  62. <col class="award-col" />
  63. <col class="status-col" />
  64. </colgroup>
  65. <thead class="text-left text-sm whitespace-nowrap break-normal">
  66. <tr>
  67. <th class="text-center">获取的时间</th>
  68. <th class="text-center">激活码编号</th>
  69. <th class="text-center">奖励内容</th>
  70. <th class="text-center">使用状态</th>
  71. </tr>
  72. </thead>
  73. </table>
  74. </div>
  75. <div class="table-body">
  76. <table class="w-full">
  77. <colgroup>
  78. <col class="time-col" />
  79. <col class="code-col" />
  80. <col class="award-col" />
  81. <col class="status-col" />
  82. </colgroup>
  83. <tbody class="text-xs">
  84. <tr v-for="(item, index) in myActivationCode" :key="index">
  85. <td class="whitespace-nowrap break-normal text-center">
  86. {{ item.createTime | formatDate('MM月DD日 HH:mm') }}
  87. </td>
  88. <td class="whitespace-nowrap break-normal text-center">
  89. <div class="flex">
  90. <span class="font-mono">{{ item.activationCode | activationCodeMask }} </span><span class="mx-1">|</span>
  91. <v-btn text small color="#FF9616" class="copy-btn" @click="copyCode(item)">复制</v-btn>
  92. </div>
  93. </td>
  94. <td class="whitespace-nowrap break-normal text-center">
  95. {{ item.awardStr }}
  96. </td>
  97. <td class="whitespace-nowrap break-normal text-center">
  98. <span :style="item.activationUse ? 'color: #FF1D02' : '#333333'">{{ ['未使用', '已使用', '已过期'][item.activationUse] }}</span>
  99. </td>
  100. </tr>
  101. </tbody>
  102. </table>
  103. <div v-if="myActivationCode.length" v-intersect.quiet="codeLoadMoreIntersect" class="flex item-center justify-center">
  104. <v-btn :loading="codeIsLoading" text small>
  105. <template v-if="codeIsLoading">加载中</template>
  106. <template v-else-if="codeHasMore">加载更多</template>
  107. <template v-else>没有更多</template>
  108. </v-btn>
  109. </div>
  110. </div>
  111. </div>
  112. <div v-else class="fwc">
  113. <img src="~/assets/image/activity/invite-user/noReward@2x.png" alt="">
  114. </div>
  115. </div>
  116. <div v-show="current === 1">
  117. <div v-if="levelAwardRankings.length" class="code-table">
  118. <div class="mylevel">
  119. <div class="fcw">
  120. <span class="c8F8F8F">当前排名</span>
  121. <span>{{ currentRanking > 0 ? currentRanking : '暂未上榜' }}</span>
  122. </div>
  123. <div class="fcw">
  124. <span class="c8F8F8F">本轮助力值</span>
  125. <span>{{ boostValue }}</span>
  126. </div>
  127. <div class="fcw">
  128. <span class="c8F8F8F">距上一名</span>
  129. <span>{{ preRanking > 0 ? preRanking : '/' }}</span>
  130. </div>
  131. <div class="fcw">
  132. <span class="c8F8F8F">距本轮排行结束时间</span>
  133. <span>
  134. <van-count-down :time="currentEndTime * 1000" format="DD 天 HH 时 mm 分 ss 秒" />
  135. </span>
  136. </div>
  137. </div>
  138. <div class="table-header">
  139. <table class="w-full">
  140. <colgroup>
  141. <col class="num-col" />
  142. <col class="user-col" />
  143. <col class="friend-col" />
  144. <col class="award-col" />
  145. </colgroup>
  146. <thead class="text-sm whitespace-nowrap break-normal">
  147. <tr>
  148. <th class="text-center">排名</th>
  149. <th class="text-center">用户</th>
  150. <th class="text-center">好友助力值</th>
  151. <th class="text-center">排名奖励</th>
  152. </tr>
  153. </thead>
  154. </table>
  155. </div>
  156. <div class="table-body">
  157. <table class="w-full">
  158. <colgroup>
  159. <col class="num-col" />
  160. <col class="user-col" />
  161. <col class="friend-col" />
  162. <col class="award-col" />
  163. </colgroup>
  164. <tbody class="text-xs">
  165. <tr v-for="(item, index) in levelAwardRankings" :key="index">
  166. <td class="whitespace-nowrap break-normal text-center">
  167. <img v-if="item.ranking === 1" class="w24h28" src="~/assets/image/activity/invite-user/no1.png" alt="">
  168. <img v-else-if="item.ranking === 2" class="w24h28" src="~/assets/image/activity/invite-user/no2.png" alt="">
  169. <img v-else-if="item.ranking === 3" class="w24h28" src="~/assets/image/activity/invite-user/no3.png" alt="">
  170. <span v-else>{{ item.ranking }}</span>
  171. </td>
  172. <td class="whitespace-nowrap break-normal text-center">
  173. {{ item.userName }}
  174. </td>
  175. <td class="whitespace-nowrap break-normal text-center">
  176. {{ item.boostValue }}
  177. </td>
  178. <td class="whitespace-nowrap break-normal text-center">
  179. {{ item.awardStr }}
  180. </td>
  181. </tr>
  182. </tbody>
  183. </table>
  184. </div>
  185. </div>
  186. <div v-else class="fwc">
  187. <img src="~/assets/image/activity/invite-user/nodata.png" alt="">
  188. </div>
  189. </div>
  190. </div>
  191. <img class="w373h192" src="~/assets/image/activity/invite-user/rule2.png" alt="">
  192. <van-popup v-model="show" style="background: transparent;padding-bottom: 60px;width: 100%;">
  193. <activity-invite-user-box class="box4">
  194. <template #title>活动规则</template>
  195. <div class="text-sm" v-html="activityRules"></div>
  196. </activity-invite-user-box>
  197. <van-icon name="close" class="close1" color="#939393" @click="show = false;" />
  198. </van-popup>
  199. </v-container>
  200. </template>
  201. <script>
  202. import { Toast, Dialog } from 'vant';
  203. import NativeShare from 'nativeshare';
  204. import { fileKeyToUrl } from '@/plugins/file-center.js';
  205. export default {
  206. auth: false,
  207. name: 'Fission',
  208. filters: {
  209. activationCodeMask(value) {
  210. return value.replace(/(.{2})(.*)(.{2}$)/, '$1**$3');
  211. },
  212. timeStamp(StatusMinute) {
  213. const day = parseInt(StatusMinute / 60 / 60 / 24);
  214. const hour = parseInt((StatusMinute / 60 / 60) % 24);
  215. const min = parseInt(StatusMinute / 60 % 60);
  216. StatusMinute = '';
  217. if (day > 0) {
  218. StatusMinute = day + '天';
  219. }
  220. if (hour > 0) {
  221. StatusMinute += hour + '小时';
  222. }
  223. if (min > 0) {
  224. StatusMinute += parseFloat(min) + '分钟';
  225. }
  226. return StatusMinute;
  227. }
  228. },
  229. data() {
  230. return {
  231. show: false,
  232. current: 0,
  233. data: {
  234. todayIncomeStarCoin: 0,
  235. totalIncomeStarCoin: 0,
  236. todayBuyOrderCount: 0,
  237. totalBuyOrderCount: 0,
  238. todayBuyOrderSuccessCount: 0,
  239. totalBuyOrderSuccessCount: 0,
  240. withdrawStarCoinNum: 0,
  241. inviteUserName: null,
  242. activityId: null,
  243. status: 0,
  244. type: 2
  245. },
  246. level: {
  247. currentLevelName: '',
  248. activityId: '',
  249. levelAwardDetails: [],
  250. shareFriendCount: 0,
  251. boostValue: 0
  252. },
  253. activityRules: '',
  254. myActivationCode: [],
  255. levelAwardRankings: [],
  256. myCodeFrom: {
  257. activityId: null,
  258. pageNum: 1,
  259. pageSize: 8,
  260. },
  261. codeTotal: -1,
  262. codeIsLoading: false,
  263. client: 1,
  264. token: '',
  265. width: 0,
  266. boostValue: 0,
  267. currentEndTime: 0,
  268. currentRanking: 0,
  269. preRanking: 0,
  270. userType: 1,
  271. received: 0,
  272. shareInfo: {
  273. title: '双子星云手机',
  274. content: `免费领取一台全能云手机!`,
  275. shareUrl: '',
  276. shareImage: ''
  277. },
  278. showShare: false,
  279. returnContent: [{
  280. img: require('@/assets/image/activity/invite-user/card-1.png'),
  281. content: '奖励一&邀请1人注册',
  282. },
  283. {
  284. img: require('@/assets/image/activity/invite-user/card-2.png'),
  285. content: '奖励二&邀请2人注册',
  286. },
  287. {
  288. img: require('@/assets/image/activity/invite-user/card-3.png'),
  289. content: '奖励三&邀请3人注册',
  290. },
  291. {
  292. img: require('@/assets/image/activity/invite-user/card-4.png'),
  293. content: '奖励四&邀请5人注册',
  294. }]
  295. };
  296. },
  297. async fetch() {
  298. // 页面初始化后触发
  299. try {
  300. this.token = this.$route.query.token;
  301. await this.getActiveInfo();
  302. await this.shareCanReceiveCloudPhone();
  303. await Promise.all([
  304. this.getActivityRules(),
  305. this.type === 2 && this.getMyActivationCode(this.myCodeFrom),
  306. this.myCodeFrom.activityId && this.getRanking({ activityId: this.myCodeFrom.activityId })
  307. ]);
  308. } catch (error) {
  309. Toast({
  310. message: error.message,
  311. duration: 4000
  312. });
  313. }
  314. if (this.$userAgent.isSzx && this.$userAgent.isAndroid) {
  315. this.client = 1;
  316. } else if (this.$userAgent.isSzx && this.$userAgent.isIos) {
  317. this.client = 2;
  318. } else if (this.$userAgent.isMiniProgram) {
  319. this.client = 5;
  320. } else {
  321. this.client = 7;
  322. }
  323. },
  324. head: {
  325. title: '邀请好友'
  326. },
  327. computed: {
  328. codeHasMore() {
  329. return (
  330. this.codeTotal < 0 ||
  331. this.myCodeFrom.pageNum * this.myCodeFrom.pageSize < this.codeTotal
  332. );
  333. },
  334. dataList() {
  335. switch (this.type) {
  336. case 1: {
  337. return [
  338. { label: '邀请用户总数', value: this.data.totalPromoter },
  339. { label: '购买总订单数', value: this.data.totalBuyOrderCount }
  340. ];
  341. }
  342. case 2: {
  343. return [
  344. { label: '邀请用户总数', value: this.data.totalPromoter },
  345. { label: '购买总订单数', value: this.data.totalBuyOrderCount }
  346. ];
  347. }
  348. case 3: {
  349. return [
  350. { label: '邀请用户总数', value: this.data.totalPromoter },
  351. { label: '购买总订单数', value: this.data.totalBuyOrderCount }
  352. ];
  353. }
  354. default: {
  355. return [];
  356. }
  357. }
  358. },
  359. type() {
  360. return 2;
  361. },
  362. shareUrl() {
  363. return (
  364. location.origin +
  365. this.$router.resolve({
  366. path: '/activity/invite-user/register-fission/',
  367. query: {
  368. invitationUserName: this.data.inviteUserName,
  369. activityId: this.data.activityId,
  370. type: this.type,
  371. },
  372. }).href
  373. );
  374. }
  375. },
  376. mounted() {
  377. this.makePoint('activity_Share_PV')
  378. this.makePoint('activity_Share_UV')
  379. this.addUserVisit(12);
  380. },
  381. methods: {
  382. async shareCanReceiveCloudPhone() {
  383. try {
  384. const res = await this.$axios.$get('/resources/register/send/cloud/phone/shareCanReceiveCloudPhone', {}, { headers: { Authorization: this.token } });
  385. this.received = res.data.received
  386. this.shareInfo.title = res.data.title
  387. this.shareInfo.content = res.data.content
  388. this.shareInfo.shareUrl = res.data.url
  389. this.shareInfo.shareImage = fileKeyToUrl(res.data.imgUrl)
  390. this.$native.setShareInfo(this.shareInfo);
  391. } catch (err) {
  392. Toast({
  393. message: err.message,
  394. position: 'top'
  395. });
  396. }
  397. },
  398. async shareReceiveCloudPhone() {
  399. try {
  400. const res = await this.$axios.$post('/resources/register/send/cloud/phone/shareReceiveCloudPhone', {}, { headers: { Authorization: this.token } });
  401. Dialog.alert({
  402. message: res.msg,
  403. }).then(() => {
  404. this.showShare = false
  405. });
  406. this.addUserVisit(7);
  407. } catch (err) {
  408. Toast({
  409. message: err.message,
  410. position: 'top'
  411. });
  412. }
  413. },
  414. async receiveLevelAward(goodsId) {
  415. try {
  416. const res = await this.$axios.$post('/activity/v1/level/award/receiveLevelAward', { activityId: this.myCodeFrom.activityId, goodsId }, { headers: { Authorization: this.token } });
  417. Toast({
  418. message: res.msg,
  419. position: 'top'
  420. });
  421. if (this.myCodeFrom.activityId) {
  422. await this.myLevelAward();
  423. }
  424. this.myCodeFrom.pageNum = 1;
  425. this.myActivationCode = [];
  426. this.getMyActivationCode(this.myCodeFrom);
  427. if (this.myCodeFrom.activityId) {
  428. this.getRanking({ activityId: this.myCodeFrom.activityId });
  429. }
  430. } catch (err) {
  431. Toast({
  432. message: err.message,
  433. position: 'top'
  434. });
  435. }
  436. },
  437. async myLevelAward() {
  438. const res = await this.$axios.$get(`/activity/v1/level/award/myLevelAward?activityId=${this.myCodeFrom.activityId}`, { headers: { Authorization: this.token } });
  439. this.level = res.data;
  440. if (this.level.levelAwardDetails) {
  441. this.width = 0;
  442. const levelLength = 280 / (this.level.levelAwardDetails.length - 1)
  443. this.level.levelAwardDetails.forEach((item, index) => {
  444. if (item.status > 0) {
  445. if (index > 0) {
  446. this.width += levelLength
  447. }
  448. if (index === 0 || index === this.level.levelAwardDetails.length - 1) {
  449. this.width += 14
  450. }
  451. }
  452. })
  453. }
  454. },
  455. async getActiveInfo() {
  456. const res = await this.$axios.$get('/activity/v1/inviteUser/orderRelation/starCoinOverview', { headers: { Authorization: this.token } });
  457. this.data = res.data;
  458. this.myCodeFrom.activityId = res.data.activityId;
  459. if (this.myCodeFrom.activityId) {
  460. await this.myLevelAward();
  461. }
  462. },
  463. async getMyActivationCode(params) {
  464. try {
  465. this.codeIsLoading = true;
  466. const res = await this.$axios.$get('/activity/v1/inviteUser/orderRelation/myActivationCode', { params, headers: { Authorization: this.token } });
  467. this.codeTotal = res.data.total;
  468. this.myActivationCode.push(
  469. ...(res.data.list ?? [])
  470. );
  471. this.myCodeFrom = params;
  472. } finally {
  473. this.codeIsLoading = false;
  474. }
  475. },
  476. async getRanking(params) {
  477. try {
  478. this.codeIsLoading = true;
  479. const res = await this.$axios.$get('/activity/v1/level/award/ranking', { params, headers: { Authorization: this.token } });
  480. this.boostValue = res.data.boostValue
  481. this.currentEndTime = res.data.currentEndTime
  482. this.currentRanking = res.data.currentRanking
  483. this.preRanking = res.data.preRanking
  484. this.levelAwardRankings = res.data.levelAwardRankings;
  485. this.userType = res.data.userType;
  486. } finally {
  487. this.codeIsLoading = false;
  488. }
  489. },
  490. share() {
  491. if (this.data.status !== 1) {
  492. if (this.data.status === 0) {
  493. Toast({
  494. message: '当前活动已过期',
  495. position: 'top'
  496. });
  497. return
  498. }
  499. if (this.data.status === 2) {
  500. Toast({
  501. message: '当前活动未开启',
  502. position: 'top'
  503. });
  504. return
  505. }
  506. if (this.data.status === 3) {
  507. Toast({
  508. message: '当前活动已结束',
  509. position: 'top'
  510. });
  511. return
  512. }
  513. Toast({
  514. message: '未知活动状态',
  515. position: 'top'
  516. });
  517. return
  518. }
  519. this.$tongji.trackEvent('活动', '分享', '', 0);
  520. if (this.received) {
  521. this.addUserVisit(13);
  522. }
  523. if (this.$userAgent.isSzx || this.$userAgent.isSzxBrowser) {
  524. // app环境
  525. this.$native.share(this.shareInfo);
  526. } else {
  527. // 浏览器环境
  528. const nativeShare = new NativeShare()
  529. nativeShare.setShareData({
  530. icon: this.shareInfo.shareImage,
  531. link: this.shareInfo.shareUrl,
  532. title: this.shareInfo.content,
  533. desc: this.shareInfo.title,
  534. success: () => {
  535. this.shareReceiveCloudPhone()
  536. },
  537. fail: () => {
  538. Toast({
  539. message: '分享失败',
  540. position: 'center'
  541. })
  542. }
  543. })
  544. try {
  545. nativeShare.call('wechatTimeline')
  546. } catch (err) {
  547. Toast({
  548. message: '您的浏览器不支持分享功能,请下载app使用!',
  549. position: 'center',
  550. duration: 3000
  551. })
  552. setTimeout(() => {
  553. window.open('https://www.androidscloud.com/', '_self');
  554. }, 3000)
  555. }
  556. }
  557. },
  558. makePoint(positionButton) {
  559. this.$axios.$post('/public/v5/buriedPointRecord/reportRecords', [
  560. {
  561. client: this.client,
  562. eventCode: '28_分享活动',
  563. userName: this.$auth.user.username,
  564. positionButton,
  565. operationTime: this.getCurrentTime(),
  566. phoneNumber: this.$auth.user.phone,
  567. deviceId: ''
  568. },
  569. ]);
  570. },
  571. getCurrentTime() {
  572. const date = new Date(); // 当前时间
  573. const year = date.getFullYear() // 年
  574. const month = this.repair(date.getMonth() + 1); // 月
  575. const day = this.repair(date.getDate()); // 日
  576. const hour = this.repair(date.getHours()); // 时
  577. const minute = this.repair(date.getMinutes()); // 分
  578. const second = this.repair(date.getSeconds()); // 秒
  579. // 当前时间
  580. const curTime = year + "-" + month + "-" + day +
  581. " " + hour + ":" + minute + ":" + second;
  582. return curTime;
  583. },
  584. repair(i) {
  585. if (i >= 0 && i <= 9) {
  586. return "0" + i;
  587. } else {
  588. return i;
  589. }
  590. },
  591. async getActivityRules() {
  592. const agreementCoding = {
  593. 1: 'iuserrules01',
  594. 2: 'iuserrules02',
  595. 3: 'iuserrules03',
  596. }[this.type];
  597. if (agreementCoding) {
  598. const res = await this.$axios.$get(
  599. '/public/v4/agreement/content/getContentByType',
  600. {
  601. params: {
  602. agreementCoding,
  603. type: 1,
  604. },
  605. },
  606. );
  607. this.activityRules = res.data.content
  608. .replace(/[\d\D]*<body>([\d\D]+)<\/body>[\d\D]*/i, '$1')
  609. .replace(/<div class="phone-container">([\d\D]+)<\/div>/g, '$1');
  610. }
  611. },
  612. async copyCode(item) {
  613. await this.$native.clipboard.writeText(item.activationCode);
  614. Toast({
  615. message: '复制激活码,请在【我的-兑换中心】兑换'
  616. });
  617. this.makePoint('activity_Share_激活码复制')
  618. },
  619. codeLoadMoreIntersect(event) {
  620. if (event[0].isIntersecting && this.codeHasMore && !this.codeIsLoading) {
  621. this.getMyActivationCode({
  622. ...this.myCodeFrom,
  623. pageNum: this.myCodeFrom.pageNum + 1,
  624. });
  625. }
  626. },
  627. addUserVisit(accessType) {
  628. this.$axios.$post('/user/v5/operateApi/addUserVisit', {
  629. accessType,
  630. loginType: 1
  631. });
  632. }
  633. }
  634. };
  635. </script>
  636. <style lang="scss" scoped>
  637. .w76h24 {
  638. width: 76px;
  639. height: 24px;
  640. margin: 5px 0;
  641. }
  642. .w373h237 {
  643. width: 373px;
  644. height: 237px;
  645. display: block;
  646. }
  647. .fcnc {
  648. display: flex;
  649. flex-wrap: wrap;
  650. margin-top: 51px;
  651. justify-content: center;
  652. }
  653. .w373h192 {
  654. width: 373px;
  655. height: 192px;
  656. display: block;
  657. margin: 17px auto 0;
  658. }
  659. .fcw {
  660. display: flex;
  661. flex-direction: column;
  662. justify-content: center;
  663. align-items: center;
  664. font-size: 12px;
  665. color: #333333;
  666. }
  667. .c8F8F8F {
  668. color: #8F8F8F;
  669. margin-bottom: 8px;
  670. }
  671. .mylevel {
  672. width: 358px;
  673. height: 68px;
  674. background: #FFFFFF;
  675. box-shadow: 0px 2px 16px 0px rgba(243, 93, 67, 0.22);
  676. border-radius: 6px;
  677. margin-left: -12px;
  678. margin-top: 20px;
  679. margin-bottom: 20px;
  680. display: flex;
  681. justify-content: space-around;
  682. align-items: center;
  683. }
  684. .rule {
  685. width: 24px;
  686. height: 56px;
  687. line-height: 28px;
  688. background: rgba(0, 0, 0, 0.19);
  689. border-radius: 6px 0px 0px 6px;
  690. font-size: 15px;
  691. font-weight: 400;
  692. color: #FFFFFF;
  693. position: absolute;
  694. right: 0;
  695. top: 28px;
  696. text-align: center;
  697. }
  698. .close1 {
  699. font-size: 30px;
  700. text-align: center;
  701. display: block;
  702. }
  703. .fwc {
  704. text-align: center;
  705. img {
  706. width: 75px;
  707. height: 83px;
  708. margin-top: 120px;
  709. }
  710. }
  711. .invite-user {
  712. color: #333;
  713. background-size: 100% auto;
  714. overflow: hidden;
  715. padding: 0;
  716. padding-bottom: env(safe-area-inset-bottom, 30px);
  717. background-color: #F67350;
  718. &.bg-1 {
  719. background-image: url('~/assets/image/activity/invite-user/bg@2x.png');
  720. }
  721. &.bg-2 {
  722. background-image: url('~/assets/image/activity/invite-user/bg-6@2x.png');
  723. }
  724. &.bg-3 {
  725. background-image: url('~/assets/image/activity/invite-user/bg-3@2x.png');
  726. }
  727. }
  728. .box1 {
  729. margin: 240px auto 0;
  730. width: 373px;
  731. height: 648px;
  732. background: url('~/assets/image/activity/invite-user/box.png');
  733. background-size: 100% 100%;
  734. overflow: hidden;
  735. .cybz-content-container {
  736. display: flex;
  737. flex-direction: column;
  738. justify-content: center;
  739. align-items: center;
  740. width: 140px;
  741. }
  742. .cybz-content {
  743. width: 119px;
  744. height: 108px;
  745. margin: auto;
  746. display: block;
  747. }
  748. .cybz-content-text {
  749. font-size: 12px;
  750. color: #FF6F3C;
  751. }
  752. .share-button {
  753. display: block;
  754. margin: auto;
  755. width: 302px !important;
  756. height: 62px !important;
  757. background-image: url('~/assets/image/activity/invite-user/share-button@2x.png');
  758. background-size: 100% 100%;
  759. margin-top: 24px;
  760. color: #dd1b0d;
  761. font-size: 18px;
  762. font-weight: bold;
  763. }
  764. .dqdj-content {
  765. width: 308px;
  766. height: 71px;
  767. background: #f9f1f5;
  768. border-radius: 6px;
  769. margin: 15px auto 0;
  770. display: flex;
  771. align-items: center;
  772. justify-content: center;
  773. .dqdj-content-line {
  774. width: 1px;
  775. height: 32px;
  776. background: #ff1d02;
  777. opacity: 0.1;
  778. }
  779. .dqdj-item {
  780. width: 96px;
  781. text-align: center;
  782. }
  783. .dqdj-title {
  784. font-size: 14px;
  785. font-weight: 600;
  786. color: #ff1d02;
  787. line-height: 20px;
  788. margin-bottom: 3px;
  789. }
  790. .dqdj-text {
  791. font-size: 12px;
  792. font-weight: 400;
  793. color: #333333;
  794. line-height: 17px;
  795. }
  796. }
  797. .progress {
  798. width: 308px;
  799. height: 8px;
  800. background: #e8e8e8;
  801. border-radius: 4px;
  802. margin: 34px auto 33px;
  803. position: relative;
  804. .progress-box {
  805. height: 8px;
  806. background: linear-gradient(270deg, #ff8a00 0%, #ff4200 100%);
  807. border-radius: 4px;
  808. position: absolute;
  809. top: 0;
  810. left: 0;
  811. }
  812. .wh38 {
  813. width: 38px;
  814. height: 38px;
  815. }
  816. .fnc {
  817. display: flex;
  818. flex-direction: column;
  819. justify-content: center;
  820. align-items: center;
  821. }
  822. .progress-text {
  823. font-size: 12px;
  824. color: #8f8f8f;
  825. line-height: 17px;
  826. margin-top: 5px;
  827. }
  828. .progress-list {
  829. width: 298px;
  830. position: absolute;
  831. left: 5px;
  832. top: -19px;
  833. display: flex;
  834. justify-content: space-between;
  835. }
  836. }
  837. }
  838. .box2 {
  839. .value {
  840. color: #ff6600;
  841. }
  842. ::v-deep .box-main {
  843. padding-left: 20px;
  844. padding-right: 20px;
  845. }
  846. }
  847. .box3 {
  848. width: 345px;
  849. height: 523px;
  850. margin: 25px auto 0;
  851. background: url('~/assets/image/activity/invite-user/box2@2x.png');
  852. background-size: 100% 100%;
  853. padding: 0 4px;
  854. box-sizing: border-box;
  855. &.tab2 {
  856. background: url('~/assets/image/activity/invite-user/box@2x.png') !important;
  857. background-size: 100% 100% !important;
  858. height: 627px !important;
  859. }
  860. .tab {
  861. display: flex;
  862. width: 307px;
  863. justify-content: space-between;
  864. margin: 0 auto;
  865. .tab-item {
  866. width: 146px;
  867. height: 44px;
  868. text-align: center;
  869. line-height: 44px;
  870. font-size: 16px;
  871. font-weight: 500;
  872. color: #ffffff;
  873. }
  874. }
  875. ::v-deep .box-main {
  876. padding-left: 10px;
  877. padding-right: 10px;
  878. }
  879. }
  880. .code-table {
  881. .table-body {
  882. max-height: 430px;
  883. overflow-y: auto;
  884. }
  885. .time-col {
  886. width: 105px;
  887. }
  888. .code-col {
  889. width: 94px;
  890. }
  891. .award-col {
  892. width: 85px;
  893. }
  894. .status-col {
  895. width: 60px;
  896. }
  897. .num-col {
  898. width: 53px;
  899. text-align: center;
  900. }
  901. .user-col {
  902. width: 92px;
  903. text-align: center;
  904. }
  905. .friend-col {
  906. width: 85px;
  907. text-align: center;
  908. }
  909. .award-col {
  910. width: 96px;
  911. text-align: center;
  912. }
  913. tr {
  914. height: 40px;
  915. color: #8F8F8F;
  916. }
  917. td {
  918. height: 40px;
  919. color: #333;
  920. }
  921. .copy-btn {
  922. min-width: 0 !important;
  923. height: auto !important;
  924. padding: 0 !important;
  925. }
  926. }
  927. .box4::v-deep .box-main {
  928. padding-left: 10px;
  929. padding-right: 10px;
  930. }
  931. .table-header {
  932. margin: 0 2px;
  933. background: #F9F1F5;
  934. }
  935. .w24h28 {
  936. width: 24px;
  937. height: 28px;
  938. }
  939. </style>