fission.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984
  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 } 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. this.$native.setShareInfo(this.shareInfo);
  303. await this.shareCanReceiveCloudPhone();
  304. await Promise.all([
  305. this.getActivityRules(),
  306. this.type === 2 && this.getMyActivationCode(this.myCodeFrom),
  307. this.myCodeFrom.activityId && this.getRanking({ activityId: this.myCodeFrom.activityId })
  308. ]);
  309. } catch (error) {
  310. Toast({
  311. message: error.message,
  312. duration: 4000
  313. });
  314. }
  315. if (this.$userAgent.isSzx && this.$userAgent.isAndroid) {
  316. this.client = 1;
  317. } else if (this.$userAgent.isSzx && this.$userAgent.isIos) {
  318. this.client = 2;
  319. } else if (this.$userAgent.isMiniProgram) {
  320. this.client = 5;
  321. } else {
  322. this.client = 7;
  323. }
  324. },
  325. head: {
  326. title: '邀请好友'
  327. },
  328. computed: {
  329. codeHasMore() {
  330. return (
  331. this.codeTotal < 0 ||
  332. this.myCodeFrom.pageNum * this.myCodeFrom.pageSize < this.codeTotal
  333. );
  334. },
  335. dataList() {
  336. switch (this.type) {
  337. case 1: {
  338. return [
  339. { label: '邀请用户总数', value: this.data.totalPromoter },
  340. { label: '购买总订单数', value: this.data.totalBuyOrderCount }
  341. ];
  342. }
  343. case 2: {
  344. return [
  345. { label: '邀请用户总数', value: this.data.totalPromoter },
  346. { label: '购买总订单数', value: this.data.totalBuyOrderCount }
  347. ];
  348. }
  349. case 3: {
  350. return [
  351. { label: '邀请用户总数', value: this.data.totalPromoter },
  352. { label: '购买总订单数', value: this.data.totalBuyOrderCount }
  353. ];
  354. }
  355. default: {
  356. return [];
  357. }
  358. }
  359. },
  360. type() {
  361. return 2;
  362. },
  363. shareUrl() {
  364. return (
  365. location.origin +
  366. this.$router.resolve({
  367. path: '/activity/invite-user/register-fission/',
  368. query: {
  369. invitationUserName: this.data.inviteUserName,
  370. activityId: this.data.activityId,
  371. type: this.type,
  372. },
  373. }).href
  374. );
  375. },
  376. shareInfo() {
  377. if (this.$userAgent.isMiniProgram) {
  378. return {
  379. title: '双子星APP',
  380. path: '/pages/home/home',
  381. imgUrl: location.origin + require('~/assets/image/logo.png'),
  382. };
  383. }
  384. return {
  385. title: '双子星云手机',
  386. desc: `畅玩“原神”“幻塔”,24小时在线,不限下载流量的手机`,
  387. link: this.shareUrl,
  388. imgUrl: location.origin + require('~/assets/image/logo.png'),
  389. };
  390. }
  391. },
  392. mounted() {
  393. this.makePoint('activity_Share_PV')
  394. this.makePoint('activity_Share_UV')
  395. this.addUserVisit(12);
  396. },
  397. methods: {
  398. async shareCanReceiveCloudPhone() {
  399. try {
  400. const res = await this.$axios.$get('/resources/register/send/cloud/phone/shareCanReceiveCloudPhone', {}, { headers: { Authorization: this.token } });
  401. this.received = res.data.received
  402. // this.shareInfo.title = res.data.title
  403. // this.shareInfo.content = res.data.content
  404. // this.shareInfo.shareUrl = res.data.url
  405. // this.shareInfo.shareImage = fileKeyToUrl(res.data.imgUrl)
  406. // this.$native.setShareInfo(this.shareInfo);
  407. } catch (err) {
  408. Toast({
  409. message: err.message,
  410. position: 'top'
  411. });
  412. }
  413. },
  414. // async shareReceiveCloudPhone() {
  415. // try {
  416. // const res = await this.$axios.$post('/resources/register/send/cloud/phone/shareReceiveCloudPhone', {}, { headers: { Authorization: this.token } });
  417. // Dialog.alert({
  418. // message: res.msg,
  419. // }).then(() => {
  420. // this.showShare = false
  421. // });
  422. // this.addUserVisit(7);
  423. // } catch (err) {
  424. // Toast({
  425. // message: err.message,
  426. // position: 'top'
  427. // });
  428. // }
  429. // },
  430. async receiveLevelAward(goodsId) {
  431. try {
  432. const res = await this.$axios.$post('/activity/v1/level/award/receiveLevelAward', { activityId: this.myCodeFrom.activityId, goodsId }, { headers: { Authorization: this.token } });
  433. Toast({
  434. message: res.msg,
  435. position: 'top'
  436. });
  437. if (this.myCodeFrom.activityId) {
  438. await this.myLevelAward();
  439. }
  440. this.myCodeFrom.pageNum = 1;
  441. this.myActivationCode = [];
  442. this.getMyActivationCode(this.myCodeFrom);
  443. if (this.myCodeFrom.activityId) {
  444. this.getRanking({ activityId: this.myCodeFrom.activityId });
  445. }
  446. } catch (err) {
  447. Toast({
  448. message: err.message,
  449. position: 'top'
  450. });
  451. }
  452. },
  453. async myLevelAward() {
  454. const res = await this.$axios.$get(`/activity/v1/level/award/myLevelAward?activityId=${this.myCodeFrom.activityId}`, { headers: { Authorization: this.token } });
  455. this.level = res.data;
  456. if (this.level.levelAwardDetails) {
  457. this.width = 0;
  458. const levelLength = 280 / (this.level.levelAwardDetails.length - 1)
  459. this.level.levelAwardDetails.forEach((item, index) => {
  460. if (item.status > 0) {
  461. if (index > 0) {
  462. this.width += levelLength
  463. }
  464. if (index === 0 || index === this.level.levelAwardDetails.length - 1) {
  465. this.width += 14
  466. }
  467. }
  468. })
  469. }
  470. },
  471. async getActiveInfo() {
  472. const res = await this.$axios.$get('/activity/v1/inviteUser/orderRelation/starCoinOverview', { headers: { Authorization: this.token } });
  473. this.data = res.data;
  474. this.myCodeFrom.activityId = res.data.activityId;
  475. if (this.myCodeFrom.activityId) {
  476. await this.myLevelAward();
  477. }
  478. },
  479. async getMyActivationCode(params) {
  480. try {
  481. this.codeIsLoading = true;
  482. const res = await this.$axios.$get('/activity/v1/inviteUser/orderRelation/myActivationCode', { params, headers: { Authorization: this.token } });
  483. this.codeTotal = res.data.total;
  484. this.myActivationCode.push(
  485. ...(res.data.list ?? [])
  486. );
  487. this.myCodeFrom = params;
  488. } finally {
  489. this.codeIsLoading = false;
  490. }
  491. },
  492. async getRanking(params) {
  493. try {
  494. this.codeIsLoading = true;
  495. const res = await this.$axios.$get('/activity/v1/level/award/ranking', { params, headers: { Authorization: this.token } });
  496. this.boostValue = res.data.boostValue
  497. this.currentEndTime = res.data.currentEndTime
  498. this.currentRanking = res.data.currentRanking
  499. this.preRanking = res.data.preRanking
  500. this.levelAwardRankings = res.data.levelAwardRankings;
  501. this.userType = res.data.userType;
  502. } finally {
  503. this.codeIsLoading = false;
  504. }
  505. },
  506. async share() {
  507. if (this.data.status !== 1) {
  508. if (this.data.status === 0) {
  509. Toast({
  510. message: '当前活动已过期',
  511. position: 'top'
  512. });
  513. return
  514. }
  515. if (this.data.status === 2) {
  516. Toast({
  517. message: '当前活动未开启',
  518. position: 'top'
  519. });
  520. return
  521. }
  522. if (this.data.status === 3) {
  523. Toast({
  524. message: '当前活动已结束',
  525. position: 'top'
  526. });
  527. return
  528. }
  529. Toast({
  530. message: '未知活动状态',
  531. position: 'top'
  532. });
  533. return
  534. }
  535. this.$tongji.trackEvent('活动', '分享', '', 0);
  536. if (this.received) {
  537. this.addUserVisit(13);
  538. }
  539. if (this.$userAgent.isSzx || this.$userAgent.isSzxBrowser) {
  540. // app环境
  541. this.$native.share(this.shareInfo);
  542. this.makePoint('activity_Share_分享好友按钮');
  543. } else {
  544. // 浏览器环境
  545. await this.$native.clipboard.writeText(`${this.shareUrl} 双子星云手机`);
  546. // throw new Error('1231');
  547. this.$toast.success('链接复制成功');
  548. this.makePoint('activity_Share_复制链接');
  549. }
  550. },
  551. makePoint(positionButton) {
  552. this.$axios.$post('/public/v5/buriedPointRecord/reportRecords', [
  553. {
  554. client: this.client,
  555. eventCode: '28_分享活动',
  556. userName: this.$auth.user.username,
  557. positionButton,
  558. operationTime: this.getCurrentTime(),
  559. phoneNumber: this.$auth.user.phone,
  560. deviceId: ''
  561. },
  562. ]);
  563. },
  564. getCurrentTime() {
  565. const date = new Date(); // 当前时间
  566. const year = date.getFullYear() // 年
  567. const month = this.repair(date.getMonth() + 1); // 月
  568. const day = this.repair(date.getDate()); // 日
  569. const hour = this.repair(date.getHours()); // 时
  570. const minute = this.repair(date.getMinutes()); // 分
  571. const second = this.repair(date.getSeconds()); // 秒
  572. // 当前时间
  573. const curTime = year + "-" + month + "-" + day +
  574. " " + hour + ":" + minute + ":" + second;
  575. return curTime;
  576. },
  577. repair(i) {
  578. if (i >= 0 && i <= 9) {
  579. return "0" + i;
  580. } else {
  581. return i;
  582. }
  583. },
  584. async getActivityRules() {
  585. const agreementCoding = {
  586. 1: 'iuserrules01',
  587. 2: 'iuserrules02',
  588. 3: 'iuserrules03',
  589. }[this.type];
  590. if (agreementCoding) {
  591. const res = await this.$axios.$get(
  592. '/public/v4/agreement/content/getContentByType',
  593. {
  594. params: {
  595. agreementCoding,
  596. type: 1,
  597. },
  598. },
  599. );
  600. this.activityRules = res.data.content
  601. .replace(/[\d\D]*<body>([\d\D]+)<\/body>[\d\D]*/i, '$1')
  602. .replace(/<div class="phone-container">([\d\D]+)<\/div>/g, '$1');
  603. }
  604. },
  605. async copyCode(item) {
  606. await this.$native.clipboard.writeText(item.activationCode);
  607. Toast({
  608. message: '复制激活码,请在【我的-兑换中心】兑换'
  609. });
  610. this.makePoint('activity_Share_激活码复制')
  611. },
  612. codeLoadMoreIntersect(event) {
  613. if (event[0].isIntersecting && this.codeHasMore && !this.codeIsLoading) {
  614. this.getMyActivationCode({
  615. ...this.myCodeFrom,
  616. pageNum: this.myCodeFrom.pageNum + 1,
  617. });
  618. }
  619. },
  620. addUserVisit(accessType) {
  621. this.$axios.$post('/user/v5/operateApi/addUserVisit', {
  622. accessType,
  623. loginType: 1
  624. });
  625. }
  626. }
  627. };
  628. </script>
  629. <style lang="scss" scoped>
  630. .w76h24 {
  631. width: 76px;
  632. height: 24px;
  633. margin: 5px 0;
  634. }
  635. .w373h237 {
  636. width: 373px;
  637. height: 237px;
  638. display: block;
  639. }
  640. .fcnc {
  641. display: flex;
  642. flex-wrap: wrap;
  643. margin-top: 51px;
  644. justify-content: center;
  645. }
  646. .w373h192 {
  647. width: 373px;
  648. height: 192px;
  649. display: block;
  650. margin: 17px auto 0;
  651. }
  652. .fcw {
  653. display: flex;
  654. flex-direction: column;
  655. justify-content: center;
  656. align-items: center;
  657. font-size: 12px;
  658. color: #333333;
  659. }
  660. .c8F8F8F {
  661. color: #8F8F8F;
  662. margin-bottom: 8px;
  663. }
  664. .mylevel {
  665. width: 358px;
  666. height: 68px;
  667. background: #FFFFFF;
  668. box-shadow: 0px 2px 16px 0px rgba(243, 93, 67, 0.22);
  669. border-radius: 6px;
  670. margin-left: -12px;
  671. margin-top: 20px;
  672. margin-bottom: 20px;
  673. display: flex;
  674. justify-content: space-around;
  675. align-items: center;
  676. }
  677. .rule {
  678. width: 24px;
  679. height: 56px;
  680. line-height: 28px;
  681. background: rgba(0, 0, 0, 0.19);
  682. border-radius: 6px 0px 0px 6px;
  683. font-size: 15px;
  684. font-weight: 400;
  685. color: #FFFFFF;
  686. position: absolute;
  687. right: 0;
  688. top: 28px;
  689. text-align: center;
  690. }
  691. .close1 {
  692. font-size: 30px;
  693. text-align: center;
  694. display: block;
  695. }
  696. .fwc {
  697. text-align: center;
  698. img {
  699. width: 75px;
  700. height: 83px;
  701. margin-top: 120px;
  702. }
  703. }
  704. .invite-user {
  705. color: #333;
  706. background-size: 100% auto;
  707. overflow: hidden;
  708. padding: 0;
  709. padding-bottom: env(safe-area-inset-bottom, 30px);
  710. background-color: #F67350;
  711. &.bg-1 {
  712. background-image: url('~/assets/image/activity/invite-user/bg@2x.png');
  713. }
  714. &.bg-2 {
  715. background-image: url('~/assets/image/activity/invite-user/bg-6@2x.png');
  716. }
  717. &.bg-3 {
  718. background-image: url('~/assets/image/activity/invite-user/bg-3@2x.png');
  719. }
  720. }
  721. .box1 {
  722. margin: 240px auto 0;
  723. width: 373px;
  724. height: 648px;
  725. background: url('~/assets/image/activity/invite-user/box.png');
  726. background-size: 100% 100%;
  727. overflow: hidden;
  728. .cybz-content-container {
  729. display: flex;
  730. flex-direction: column;
  731. justify-content: center;
  732. align-items: center;
  733. width: 140px;
  734. }
  735. .cybz-content {
  736. width: 119px;
  737. height: 108px;
  738. margin: auto;
  739. display: block;
  740. }
  741. .cybz-content-text {
  742. font-size: 12px;
  743. color: #FF6F3C;
  744. }
  745. .share-button {
  746. display: block;
  747. margin: auto;
  748. width: 302px !important;
  749. height: 62px !important;
  750. background-image: url('~/assets/image/activity/invite-user/share-button@2x.png');
  751. background-size: 100% 100%;
  752. margin-top: 24px;
  753. color: #dd1b0d;
  754. font-size: 18px;
  755. font-weight: bold;
  756. }
  757. .dqdj-content {
  758. width: 308px;
  759. height: 71px;
  760. background: #f9f1f5;
  761. border-radius: 6px;
  762. margin: 15px auto 0;
  763. display: flex;
  764. align-items: center;
  765. justify-content: center;
  766. .dqdj-content-line {
  767. width: 1px;
  768. height: 32px;
  769. background: #ff1d02;
  770. opacity: 0.1;
  771. }
  772. .dqdj-item {
  773. width: 96px;
  774. text-align: center;
  775. }
  776. .dqdj-title {
  777. font-size: 14px;
  778. font-weight: 600;
  779. color: #ff1d02;
  780. line-height: 20px;
  781. margin-bottom: 3px;
  782. }
  783. .dqdj-text {
  784. font-size: 12px;
  785. font-weight: 400;
  786. color: #333333;
  787. line-height: 17px;
  788. }
  789. }
  790. .progress {
  791. width: 308px;
  792. height: 8px;
  793. background: #e8e8e8;
  794. border-radius: 4px;
  795. margin: 34px auto 33px;
  796. position: relative;
  797. .progress-box {
  798. height: 8px;
  799. background: linear-gradient(270deg, #ff8a00 0%, #ff4200 100%);
  800. border-radius: 4px;
  801. position: absolute;
  802. top: 0;
  803. left: 0;
  804. }
  805. .wh38 {
  806. width: 38px;
  807. height: 38px;
  808. }
  809. .fnc {
  810. display: flex;
  811. flex-direction: column;
  812. justify-content: center;
  813. align-items: center;
  814. }
  815. .progress-text {
  816. font-size: 12px;
  817. color: #8f8f8f;
  818. line-height: 17px;
  819. margin-top: 5px;
  820. }
  821. .progress-list {
  822. width: 298px;
  823. position: absolute;
  824. left: 5px;
  825. top: -19px;
  826. display: flex;
  827. justify-content: space-between;
  828. }
  829. }
  830. }
  831. .box2 {
  832. .value {
  833. color: #ff6600;
  834. }
  835. ::v-deep .box-main {
  836. padding-left: 20px;
  837. padding-right: 20px;
  838. }
  839. }
  840. .box3 {
  841. width: 345px;
  842. height: 523px;
  843. margin: 25px auto 0;
  844. background: url('~/assets/image/activity/invite-user/box2@2x.png');
  845. background-size: 100% 100%;
  846. padding: 0 4px;
  847. box-sizing: border-box;
  848. &.tab2 {
  849. background: url('~/assets/image/activity/invite-user/box@2x.png') !important;
  850. background-size: 100% 100% !important;
  851. height: 627px !important;
  852. }
  853. .tab {
  854. display: flex;
  855. width: 307px;
  856. justify-content: space-between;
  857. margin: 0 auto;
  858. .tab-item {
  859. width: 146px;
  860. height: 44px;
  861. text-align: center;
  862. line-height: 44px;
  863. font-size: 16px;
  864. font-weight: 500;
  865. color: #ffffff;
  866. }
  867. }
  868. ::v-deep .box-main {
  869. padding-left: 10px;
  870. padding-right: 10px;
  871. }
  872. }
  873. .code-table {
  874. .table-body {
  875. max-height: 430px;
  876. overflow-y: auto;
  877. }
  878. .time-col {
  879. width: 105px;
  880. }
  881. .code-col {
  882. width: 94px;
  883. }
  884. .award-col {
  885. width: 85px;
  886. }
  887. .status-col {
  888. width: 60px;
  889. }
  890. .num-col {
  891. width: 53px;
  892. text-align: center;
  893. }
  894. .user-col {
  895. width: 92px;
  896. text-align: center;
  897. }
  898. .friend-col {
  899. width: 85px;
  900. text-align: center;
  901. }
  902. .award-col {
  903. width: 96px;
  904. text-align: center;
  905. }
  906. tr {
  907. height: 40px;
  908. color: #8F8F8F;
  909. }
  910. td {
  911. height: 40px;
  912. color: #333;
  913. }
  914. .copy-btn {
  915. min-width: 0 !important;
  916. height: auto !important;
  917. padding: 0 !important;
  918. }
  919. }
  920. .box4::v-deep .box-main {
  921. padding-left: 10px;
  922. padding-right: 10px;
  923. }
  924. .table-header {
  925. margin: 0 2px;
  926. background: #F9F1F5;
  927. }
  928. .w24h28 {
  929. width: 24px;
  930. height: 28px;
  931. }
  932. </style>