fission.vue 28 KB

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