1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693 |
- <template>
- <div class="bargaining-assistance">
- <!-- 邀请人提示 -->
- <div class="inviter-tips" v-if="+type">
- <img src="@/assets/image/claimCloudPhone/inviter-tips.png" alt="" />
- <div>好友注册获得助力 好友下单加速助力</div>
- </div>
- <!-- 被邀请人提示 -->
- <div v-else class="invitee-tips">
- <div class="invitee-tips-text">
- <div>亲,我在用<span>双子星云手机</span>,它可以帮我:</div>
- <div>
- <div style="animation-delay: 0.5s">
- <van-icon name="success" /> <span>24小时</span>运行游戏 / 聊天 /
- 看视频
- </div>
- <div style="animation-delay: 1s">
- <van-icon name="success" /> 双子星云手机已经帮我节省<span>
- 10086 </span
- >小时
- </div>
- <div style="animation-delay: 1.5s">
- <van-icon name="success" />
- 我得任务全做完了,游戏升级哇哇快,现在官方活动领云机,麻烦帮我助力!
- </div>
- </div>
- </div>
- </div>
- <!-- 砍价进度 -->
- <div
- class="bargaining-assistance-main"
- :class="{ 'bargaining-assistance-main-animation': !+type }"
- >
- <!-- 被邀请人助力、邀请人砍价 -->
- <template>
- <div class="package-name">
- <span> {{ info.phoneType }}{{ info.validityPeriod }}天</span>
- </div>
- <div class="package-price"><span>¥</span>{{ info.totalAmount }}</div>
- <div class="package-progress">
- <customProgress v-model="info.schedule" />
- </div>
- <div class="package-tips">
- <div>
- 仅差<span>{{ info.remainingPrice }}元</span>
- </div>
- <div>
- 必得价值<span>{{ info.totalAmount }}元</span>的免费云机
- </div>
- </div>
- <div
- :class="['package-btn', { end: +type === 7, 'mb-24': !+type }]"
- @click="btnFun"
- >
- {{ btnName }}
- </div>
- <div class="package-expire" v-if="+type">
- 免单失效时间:<van-count-down :time="time" />
- </div>
- </template>
- <van-dialog v-model="assistanceVisible" :showConfirmButton="false">
- <div class="invitee-to-claim">
- <div class="invitee-to-claim_btn" @click="loginVisible = true">
- 免费领取
- </div>
- </div>
- </van-dialog>
- </div>
- <!-- 邀请人显示 -->
- <template v-if="+type">
- <!-- 砍价记录 -->
- <div class="bargaining-record">
- <div class="title">砍价记录</div>
- <div class="container">
- <loadList
- ref="assistRecodeList"
- url="activity/v5/assist/operation/assistRecodeList"
- description="暂无砍价记录"
- >
- <template #default="{ list }">
- <div
- v-for="item in list"
- :key="item.id"
- class="bargaining-record-item"
- >
- <div class="bargaining-record-item_info">
- <div>{{ item.surfaceName }}</div>
- <div v-if="item.assistType === 1">
- 道具砍掉<span>{{ item.assistPrice }}元</span>
- </div>
- <div
- v-else-if="item.assistType === 2 || item.assistType === 3"
- >
- 为您砍价<span>{{ item.assistPrice }}元</span>
- </div>
- <div v-else>为您加油打气</div>
- </div>
- </div>
- </template>
- </loadList>
- </div>
- </div>
- <!-- 云机发放记录 -->
- <div class="distribution-records">
- <div class="title">云机发放记录</div>
- <div class="container">
- <div>
- <div>序号</div>
- <div>云机名称</div>
- <div>套餐类型</div>
- <div>云机时长</div>
- <div>购买类型</div>
- </div>
- <div>
- <loadList
- ref="assistGetPhoneRecode"
- url="activity/v5/assist/operation/assistGetPhoneRecode"
- description="当前您还没有白嫖到云手机"
- >
- <template #default="{ list }">
- <div
- v-for="(item, index) in list"
- :key="item.id"
- class="distribution-records-item"
- >
- <div>{{ index + 1 }}</div>
- <div>{{ item.diskName }}</div>
- <div>{{ item.phoneTypeStr }}</div>
- <div>{{ item.validTime }}天</div>
- <div>{{ ['', '购买', '续费'][item.dataType] }}</div>
- </div>
- </template>
- </loadList>
- </div>
- </div>
- </div>
- </template>
- <!-- 参加活动的所有信息 -->
- <template v-if="barrageList.length">
- <div class="barrage"></div>
- </template>
- <div class="rule" @click="ruleVisible = true" v-if="+type">规则</div>
- <!-- 规则弹窗 -->
- <van-dialog v-model="ruleVisible" :showConfirmButton="false">
- <div class="rule-title">活动规则</div>
- <div class="rule-content">
- <div v-html="ruleHtml"></div>
- </div>
- <div class="rule-close">
- <van-icon name="cross" @click="ruleVisible = false" />
- </div>
- </van-dialog>
- <!-- 邀请人首次到砍价的页面的弹窗 -->
- <van-dialog
- v-model="bargainingVisible"
- :showConfirmButton="false"
- class="dialog-bargaining"
- >
- <template v-if="!bargainingTipsBool">
- <div class="bargaining-img">
- <img
- src="@/assets/image/claimCloudPhone/red-packet-title.png"
- alt=""
- class="red-packet-title"
- />
- <lottie class="glory" :data="glory" :key="'glory'" />
- <lottie
- :key="'red-packet'"
- class="red-packet"
- :data="redPacket"
- @click.native="bargainingFun(true)"
- />
- </div>
- </template>
- <template v-if="bargainingTipsBool">
- <div class="bargaining-amount">
- <div class="bargaining-amount-text">
- 恭喜您,砍价成功<span>{{ bargainingAmount }}元</span>
- </div>
- <lottie
- class="species"
- :data="species"
- v-if="species"
- :key="'species'"
- />
- </div>
- </template>
- </van-dialog>
- <!-- 退出活动页的弹窗 -->
- <van-dialog v-model="exitVisible" :showConfirmButton="false">
- <div class="exit">
- <div class="exit-content">
- <div>确定要退出吗?</div>
- <div>
- 仅差<span>{{ info.remainingPrice }}元</span>免费带走云机
- </div>
- <div class="exit-content-progress">
- <customProgress v-model="info.schedule" />
- </div>
- <div class="exit-content-btn">
- <img
- @click="exitVisible = false"
- src="@/assets/image/claimCloudPhone/Inviting-others-img.png"
- alt=""
- />
- <div class="exit-content-btn_leave" @click="leaveFun">狠心离开</div>
- </div>
- </div>
- <img src="@/assets/image/claimCloudPhone/inviter-exit.png" alt="" />
- <lottie class="exit-glory" :data="glory" :key="'exit-glory'" />
- </div>
- </van-dialog>
- <!-- 砍价成功的弹窗-->
- <van-dialog
- v-model="successfulBargainingVisible"
- :showConfirmButton="false"
- >
- <div class="bargaining-success">
- <div class="bargaining-success-title">恭喜您,砍价成功</div>
- <div class="bargaining-success-tips">
- 您的云手机【{{ info.diskName }}】发放成功/续费成功
- </div>
- <div class="bargaining-success-btn">
- <div @click="claimTheNextOne">免费领下一台云机</div>
- <div @click="leaveFun">返回云手机首页</div>
- </div>
- </div>
- </van-dialog>
- <!-- 免单时间过期弹窗 -->
- <van-dialog v-model="expireVisible" :showConfirmButton="false">
- <div class="expire">
- <div class="expire-btn" @click="claimTheNextOne">免费领下一台云机</div>
- </div>
- </van-dialog>
- <!-- 被邀请人登录 -->
- <van-dialog v-model="loginVisible" :showConfirmButton="false">
- <div class="login">
- <div class="login-title">双子星快捷登录</div>
- <van-field
- placeholder="手机号"
- type="digit"
- v-model="laoginData.phone"
- clearable
- maxLength="11"
- />
- <van-field
- placeholder="验证码"
- v-model="laoginData.code"
- clearable
- type="digit"
- maxLength="6"
- >
- <template #button>
- <div
- :class="[
- 'login-code',
- {
- disabled:
- codeNumber !== '获取验证码' || laoginData.phone.length < 11,
- },
- ]"
- @click="getCode"
- >
- {{ codeNumber }}
- </div>
- </template>
- </van-field>
- <van-button
- color="#3666F2"
- :disabled="
- !agreementBool ||
- !laoginData.code ||
- laoginData.phone.length < 11 ||
- loginLoading
- "
- @click="login"
- >
- <template v-if="loginLoading"> 正在登录中... </template>
- <template v-else> 登录 </template>
- </van-button>
- <div class="login-agreement">
- <van-checkbox icon-size="16px" v-model="agreementBool">
- 通过登录即可完成注册,成为我们的新用户登录后表示同意
- <span @click.stop="toAgreement">用户协议</span>
- </van-checkbox>
- </div>
- </div>
- </van-dialog>
- <van-dialog
- v-model="endVisible"
- :showConfirmButton="false"
- :before-close="beforeClose"
- style="background: #fff"
- >
- <img
- src="@/assets/image/claimCloudPhone/end-visible-img.png"
- @click="endConfirm"
- class="end-visible-img"
- />
- <!-- <div style="text-align: center; padding: 10px; color: #999">
- 感谢您对我们应用的支持和参与。<br />
- 我们的活动已经结束了,<br />
- 但是我们会不断努力,<br />
- 为您带来更多精彩的活动和内容。<br />
- </div> -->
- </van-dialog>
- <Verify
- @success="success"
- mode="pop"
- captchaType="blockPuzzle"
- :imgSize="{ width: '300px', height: '155px' }"
- ref="verify"
- ></Verify>
- </div>
- </template>
- <script>
- import * as species from '@/assets/lottie/species/data.json';
- import * as redPacket from '@/assets/lottie/redPacket/data.json';
- import * as glory from '@/assets/lottie/glory/data.json';
- import { sha256 } from 'js-sha256';
- import customProgress from './customProgress.vue';
- import loadList from '@/components/loadList';
- import { fileKeyToUrl } from '@/plugins/file-center.js';
- import Verify from '@/components/verifition/Verify';
- import { writeToClipboard } from '@/plugins/plugins.js';
- import lottie from '@/components/lottie';
- export default {
- props: {
- operateActivityId: {
- type: [String, Number],
- default: '',
- },
- type: {
- type: [Number, String],
- default: '',
- },
- getSystemTime: {
- type: Function,
- default: () => {
- return () => {};
- },
- },
- leaveFun: {
- type: Function,
- default: () => {
- return () => {};
- },
- },
- wxIntercept: {
- type: Function,
- default: () => {
- return () => {};
- },
- },
- inviteeData: {
- type: Object,
- default: () => {
- return {};
- },
- },
- },
- data() {
- return {
- total: 50, // 砍价百分比
- barrageList: [], // 滚动轮播数据
- ruleVisible: false, // 规则弹窗
- bargainingVisible: false, // 首次砍价弹窗
- bargainingTipsBool: false, // 是否切换成砍价金额的页面
- exitVisible: false, // 退出弹窗
- successfulBargainingVisible: false, // 砍价成功弹窗
- expireVisible: false, // 免单时间过期弹窗
- loginVisible: false, // 被邀请人登录框
- agreementBool: false, // 是否勾选协议
- ruleHtml: '', // 规则内容
- info: {}, // 砍价相关信息
- bargainingAmount: '', // 砍价金额
- systemTime: '', // 系统时间
- assistanceVisible: false, // 是否触发助力
- laoginData: {
- // 被邀请人登录信息
- phone: '',
- code: '',
- },
- codeNumber: '获取验证码',
- loginLoading: false,
- endVisible: false, // 被邀请人活动结束弹窗
- species,
- redPacket,
- glory,
- };
- },
- components: {
- customProgress,
- loadList,
- Verify,
- lottie,
- },
- mounted() {
- if (sessionStorage.getItem('isAgreementBool')) {
- this.loginVisible = true;
- this.laoginData.phone = sessionStorage.getItem('invitedPhone');
- this.laoginData.code = sessionStorage.getItem('invitedCode');
- sessionStorage.removeItem('isAgreementBool');
- sessionStorage.removeItem('invitedPhone');
- sessionStorage.removeItem('invitedCode');
- }
- if (+this.type === 1 || +this.type === 2 || +this.type === 7) {
- this.getRule();
- this.getAssistAwardRecode();
- }
- setTimeout(() => {
- this.bargainingStatus(true);
- });
- },
- computed: {
- time() {
- const { validityPeriodTimeStamp = 0 } = this.info;
- let time = null;
- time = validityPeriodTimeStamp
- ? validityPeriodTimeStamp - this.systemTime * 1000
- : 0;
- time = +this.type === 7 ? 0 : time;
- return time;
- },
- btnName() {
- let name = null;
- if (+this.type === 7) {
- name = '活动已到期';
- } else {
- name = +this.type
- ? this.info.bargainingStatus === 1
- ? `继续砍价${this.info.remainingQuantity || 0}次`
- : '邀请好友助力免单'
- : '帮他助力';
- }
- return name;
- },
- },
- methods: {
- // 轮播活动参加的人的信息
- startBarrage() {
- const barrage = document.querySelector('.barrage');
- if (!barrage.childNodes.length) {
- const data = this.barrageList[0];
- this.barrageList.shift();
- this.barrageList.push(data);
- barrage.appendChild(writeIn(data));
- }
- const first = barrage.childNodes[0];
- setTimeout(() => {
- first.className = 'start';
- first.addEventListener('animationstart', () => {
- const data = this.barrageList[0];
- this.barrageList.shift();
- this.barrageList.push(data);
- const div = writeIn(data);
- barrage.appendChild(div);
- setTimeout(() => {
- div.style = 'opacity: 1';
- }, 100);
- });
- first.addEventListener('animationend', () => {
- barrage.removeChild(first);
- this.startBarrage();
- });
- }, 1000);
- function writeIn({ price, phoneNumber, phoneType, duration }) {
- const div = document.createElement('div');
- div.style = 'opacity: 0';
- div.innerHTML = `<div>
- <div>${phoneNumber}</div>
- <div class="free">免单</div>
- </div>
- <div>${phoneType}${duration}天,价值<span>${price}元</span></div>`;
- return div;
- }
- },
- bargainingFun(bool = false) {
- // 首次砍价的时候进此判断
- if (bool) {
- this.$toast.loading({
- message: '加载中...',
- forbidClick: true,
- duration: 0,
- });
- const { menuRuleId, userCardId } = this.$route.query;
- const obj = {
- operateActivityId: this.operateActivityId,
- menuRuleId,
- };
- // 如果是续费,选择了对应云机,需要传云机id
- if (userCardId) obj.userCardId = userCardId;
- this.$axios
- .$post('activity/v5/assist/bargaining/userSelectedPackage', obj)
- .then((res) => {
- if (res.success) {
- // 砍价金额
- this.bargainingAmount = res.data.fristKnifeAmount;
- setTimeout(() => {
- this.bargainingTipsBool = true;
- });
- // 重新获取用户最新的数据
- setTimeout(this.bargainingStatus, 1000);
- }
- })
- .catch((error) => {
- setTimeout(() => {
- this.$toast(error.message);
- });
- })
- .finally(() => {
- this.$toast.clear();
- });
- return;
- }
- this.chopAKnife();
- },
- // 获取规则
- getRule() {
- this.$axios
- .$get('public/v4/agreement/content', {
- params: { agreementCoding: 'YDQLBHD10000' },
- })
- .then((res) => {
- if (res.success) {
- const html = res.data.content;
- const rx = /<body[^>]*>([\s\S]+?)<\/body>/i;
- let m = rx.exec(html);
- if (m) {
- m = m[1];
- }
- this.ruleHtml = m;
- }
- });
- },
- // 获取用户数据接口
- bargainingStatus(bool = false) {
- if (bool) {
- this.$toast.loading({
- message: '加载中...',
- forbidClick: true,
- duration: 0,
- });
- }
- const params = {
- operateActivityId: localStorage.getItem('auth.operateActivityId'),
- };
- if (Object.keys(this.inviteeData).length) {
- params.userLaunchId = this.inviteeData.userLaunchId;
- }
- this.$axios
- .$get('activity/v5/assist/bargaining/current/bargainingStatus', {
- params,
- })
- .then(async (res) => {
- if (res.success) {
- this.info = res.data;
- // 砍价记录、云机发放记录
- if (
- [1, 2, 7].includes(this.info.bargainingStatus) &&
- this.$refs.assistRecodeList &&
- this.$refs.assistGetPhoneRecode
- ) {
- this.$refs.assistRecodeList.data = [];
- this.$refs.assistGetPhoneRecode.data = [];
- this.$refs.assistRecodeList.list();
- this.$refs.assistGetPhoneRecode.list();
- }
- localStorage.setItem(
- 'bargainingStatusInfo',
- JSON.stringify(this.info),
- );
- // 如果是被邀请人就不需要走下面流程
- if (Object.keys(this.inviteeData).length) {
- // 被邀请人活动结束
- if (res.data.bargainingStatus === 5) this.endVisible = true;
- return;
- }
- switch (+this.type) {
- case 3: // 成功,领取下一台云机界面
- this.successfulBargainingVisible = true;
- break;
- case 4: // 失败,领取下一台云机界面
- this.expireVisible = true;
- return;
- case 7: // 活动已结束
- return;
- }
- const data = await this.getSystemTime();
- this.systemTime = data.data;
- if (this.info.bargainingStatus === 0) {
- this.bargainingVisible = true;
- return;
- }
- // 如果是安卓客户端登录的情况且bargainingStatus为 1 2 ,
- if (
- this.info.bargainingStatus === 1 ||
- this.info.bargainingStatus === 2
- ) {
- // 对安卓返回键做拦截
- if (
- (this.$userAgent.isSzx || this.$userAgent.isSzxBrowser) &&
- this.$userAgent.isAndroid
- ) {
- // 旧版本做兼容,如果有的情况下的话就显示
- if (window.native.webBackStatus) {
- window.native.webBackStatus(true);
- window.appGoBackCallback = () => {
- this.exitVisible = true;
- };
- }
- }
- // 对微信做拦截
- if (this.$userAgent.isWx) {
- this.wxIntercept(() => {
- history.pushState(null, null, document.URL);
- this.exitVisible = true;
- });
- }
- }
- }
- })
- .catch((error) => {
- this.$toast(error.message);
- })
- .finally(() => {
- if (this.info.bargainingStatus !== 0) this.bargainingVisible = false;
- this.$toast.clear();
- });
- },
- // 滚动的相关数据
- getAssistAwardRecode() {
- this.$axios
- .$get('activity/v5/assist/operation/getAssistAwardRecode', {})
- .then((res) => {
- if (res.success) {
- this.barrageList = res.data;
- setTimeout(() => {
- this.barrageList.length && this.startBarrage();
- });
- }
- });
- },
- // 领取下一台手机
- claimTheNextOne() {
- this.$toast.loading({
- message: '加载中...',
- forbidClick: true,
- duration: 0,
- });
- this.$axios
- .$get('activity/v5/assist/operation/reportCutStatus', {
- params: {
- userLaunchId: this.info.userLaunchId,
- },
- })
- .then((res) => {
- if (res.success) {
- // 解除安卓返回按键
- if (
- (this.$userAgent.isSzx || this.$userAgent.isSzxBrowser) &&
- this.$userAgent.isAndroid
- ) {
- window.native.webBackStatus && window.native.webBackStatus(false);
- }
- this.$router.replace('/claimCloudPhone?exit=1&bool=1');
- }
- })
- .catch((error) => {
- setTimeout(() => {
- this.$toast(error.message);
- });
- })
- .finally(() => {
- this.$toast.clear();
- });
- },
- // 砍一刀
- chopAKnife() {
- this.$toast.loading({
- message: '加载中...',
- forbidClick: true,
- duration: 0,
- });
- this.$axios
- .$post('activity/v5/assist/operation/chopAKnife')
- .then((res) => {
- if (res.success) {
- this.bargainingTipsBool = true;
- this.bargainingAmount = res.data;
- setTimeout(() => {
- this.bargainingVisible = true;
- });
- // 重新获取用户最新的数据
- setTimeout(this.bargainingStatus, 1000);
- }
- })
- .catch((error) => {
- setTimeout(() => {
- this.$toast(error.message);
- });
- setTimeout(() => {
- this.$toast.clear();
- }, 500);
- })
- .finally(() => {
- this.$toast.clear();
- });
- },
- btnFun() {
- if (+this.type === 7) return;
- if (!+this.type) this.assistanceVisible = true;
- if (+this.type) {
- switch (this.info.bargainingStatus) {
- case 1:
- this.chopAKnife();
- break;
- case 2:
- this.$toast.loading({
- message: '加载中...',
- forbidClick: true,
- duration: 0,
- });
- this.$axios
- .$post('activity/v5/assist/bargaining/getGenerateInvitationLink')
- .then(async (res) => {
- if (res.success) {
- res.data.desc = res.data.content;
- res.data.link = res.data.url;
- res.data.imgUrl = fileKeyToUrl(res.data.imgUrl);
- const shareInfo = { ...res.data };
- if (this.$userAgent.isSzx || this.$userAgent.isSzxBrowser) {
- this.$native.share(shareInfo);
- } else {
- writeToClipboard(
- res.data.link,
- () => {
- setTimeout(() => {
- this.$toast('链接复制成功');
- });
- },
- () => {
- setTimeout(() => {
- this.$toast('链接复制失败');
- });
- },
- );
- }
- }
- })
- .finally(() => {
- this.$toast.clear();
- });
- break;
- }
- }
- },
- // 获取验证码
- getCode() {
- if (
- this.laoginData.phone.length < 11 ||
- this.codeNumber !== '获取验证码'
- ) {
- return;
- }
- if (!/^1[3456789]\d{9}$/.test(this.laoginData.phone)) {
- this.$toast('手机号码有误,请重填');
- return;
- }
- this.$refs.verify.show();
- },
- // 登录
- async login() {
- this.loginLoading = true;
- let uuid = localStorage.getItem('uuid');
- if (!uuid) {
- const url = URL.createObjectURL(new Blob());
- uuid = url.toString();
- URL.revokeObjectURL(url);
- uuid = uuid.substring(uuid.lastIndexOf('/') + 1);
- // 去除 UUID 字符串中的连字符
- const uuidHex = uuid.replace(/-/g, '');
- // 将十六进制字符串解析为大整数
- const uuidNumber = BigInt('0x' + uuidHex);
- uuid = uuidNumber.toString().substring(0, 20); // 将大整数转换为字符串格式
- localStorage.setItem('uuid', uuid);
- }
- const data = await this.getSystemTime();
- const registerTime = this.timestampToTime(data.data);
- const params = {
- invitationType: 6,
- registerSource: 102,
- uuid,
- registerTime,
- };
- const headers = {
- devicesId: uuid,
- registerSign: this.jm(registerTime),
- };
- Object.assign(params, this.laoginData);
- Object.assign(params, this.inviteeData);
- params.activityId = params.operateActivityId;
- delete params.operateActivityId;
- this.$axios
- .$post('user/v5/client/register/forH5', params, { headers })
- .then((res) => {
- if (res.success) {
- localStorage.setItem('phone', params.phone);
- localStorage.setItem('auth._token.password', res.data.token);
- localStorage.setItem('token', res.data.token);
- localStorage.setItem(
- 'dataInfo',
- JSON.stringify({ type: Object, data: res.data }),
- );
- this.$toast('登录成功');
- const url = res.data.jumpToPage
- ? '/claimCloudPhone?bool=1'
- : '/claimCloudPhone/firstReward';
- this.$router[res.data.jumpToPage ? 'replace' : 'push'](url);
- }
- })
- .catch((error) => {
- setTimeout(() => {
- this.$toast(error.message);
- });
- })
- .finally(() => {
- this.loginLoading = false;
- });
- },
- timestampToTime(timestamp) {
- var date = new Date(timestamp * 1000);
- var Y = date.getFullYear() + '-';
- var M =
- (date.getMonth() + 1 < 10
- ? '0' + (date.getMonth() + 1)
- : date.getMonth() + 1) + '-';
- var D =
- (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ';
- var h =
- (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
- var m =
- (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) +
- ':';
- var s =
- date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
- return Y + M + D + h + m + s;
- },
- jm(systemTime) {
- const registerSign = sha256('Register_SZX_2023:' + systemTime);
- return registerSign;
- },
- // 跳转对应协议
- toAgreement() {
- sessionStorage.setItem('invitedPhone', this.laoginData.phone);
- sessionStorage.setItem('invitedCode', this.laoginData.code);
- this.$router.push(
- '/claimCloudPhone/agreement?agreementCoding=XYPZYHXY2002',
- );
- },
- success(data) {
- this.$toast.loading({
- message: '加载中...',
- forbidClick: true,
- duration: 0,
- });
- const params = {
- type: 'common',
- authorizationType: 4,
- phone: this.laoginData.phone,
- captchaVerification: data.captchaVerification,
- };
- this.$axios
- .$post('activity/v5/assist/bargaining/phone/send/activity', params)
- .then((res) => {
- if (res.success) {
- this.codeNumber = 60;
- const timer = setInterval(() => {
- this.codeNumber--;
- if (this.codeNumber === 0) {
- this.codeNumber = '获取验证码';
- clearInterval(timer);
- }
- }, 1000);
- setTimeout(() => {
- this.$toast('获取成功');
- });
- }
- })
- .catch((error) => {
- setTimeout(() => {
- this.$toast(error.message);
- });
- })
- .finally(() => {
- this.$toast.clear();
- });
- },
- endConfirm() {
- location.href = 'https://www.androidscloud.com';
- },
- beforeClose(action, done) {
- done(false);
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .bargaining-assistance {
- @keyframes invitee-tips-text {
- 0% {
- opacity: 0;
- }
- 100% {
- opacity: 1;
- }
- }
- height: 100%;
- position: relative;
- .inviter-tips,
- .invitee-tips {
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- }
- .inviter-tips {
- & > img {
- height: 60px;
- display: block;
- margin: 0 auto;
- }
- & > div {
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- font-weight: 400;
- font-size: 12px;
- color: #ffffff;
- line-height: 17px;
- text-align: center;
- font-style: normal;
- margin-top: 6px;
- margin-bottom: 14px;
- }
- }
- .invitee-tips {
- .invitee-tips-user {
- font-weight: bold;
- font-size: 18px;
- color: #ffffff;
- line-height: 22px;
- text-align: left;
- font-style: normal;
- margin-bottom: 8px;
- }
- .invitee-tips-text {
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- font-weight: 500;
- font-size: 18px;
- color: #ffffff;
- line-height: 22px;
- font-style: normal;
- & > div:first-of-type {
- opacity: 0;
- animation: invitee-tips-text 0.5s linear forwards;
- }
- & > div:last-of-type {
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- font-weight: 400;
- font-size: 14px;
- color: #fff;
- line-height: 22px;
- text-align: left;
- font-style: normal;
- margin-top: 15px;
- margin-bottom: 14px;
- & > div {
- opacity: 0;
- animation: invitee-tips-text 0.5s linear forwards;
- margin-bottom: 14px;
- .van-icon-success {
- margin-right: 13px;
- }
- }
- }
- span {
- color: #ffe7a1;
- }
- }
- }
- .bargaining-assistance-main {
- background: #ffffff;
- border-radius: 20px;
- margin-bottom: 24px;
- overflow: hidden;
- &.bargaining-assistance-main-animation {
- opacity: 0;
- animation: invitee-tips-text 0.5s linear forwards;
- animation-delay: 2s;
- }
- .package-name {
- display: flex;
- justify-content: center;
- span {
- display: inline-block;
- padding: 5px 61px;
- background: #ffe8e8;
- border-radius: 0 0 15px 15px;
- margin: 0 auto;
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- font-weight: bold;
- font-size: 16px;
- color: #c00202;
- line-height: 20px;
- text-align: center;
- font-style: normal;
- }
- }
- .package-price {
- font-family: Alibaba-PuHuiTi, Alibaba-PuHuiTi;
- font-weight: bold;
- color: #c70b0b;
- height: 120px;
- font-weight: normal;
- box-sizing: border-box;
- padding-top: 30px;
- font-size: 60px;
- line-height: 62px;
- text-align: center;
- font-style: normal;
- font-weight: bold;
- width: calc(100% - 24px);
- margin: 0 auto;
- background: #fff3f5;
- box-shadow: 0px 0px 8px 2px #f4f7f8, 0px 2px 4px 0px #ecedf8;
- border-radius: 20px;
- margin-top: -20px;
- border: 1px solid #eaeaea;
- span {
- font-size: 30px;
- }
- }
- .package-progress {
- margin: 24px 42px 35px;
- }
- .package-tips {
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- text-align: center;
- font-size: 16px;
- color: #000000;
- font-style: normal;
- margin-bottom: 24px;
- font-weight: 500;
- line-height: 22px;
- font-style: normal;
- span {
- color: #f04646;
- }
- & > div:first-of-type {
- font-size: 21px;
- line-height: 29px;
- }
- }
- .package-btn {
- height: 54px;
- background: linear-gradient(178deg, #fd8c50 0%, #fc3307 100%);
- border-radius: 28px;
- margin: 0 27px;
- font-family: AlimamaShuHeiTi, AlimamaShuHeiTi;
- font-weight: bold;
- font-size: 20px;
- color: #ffffff;
- line-height: 54px;
- text-align: center;
- font-style: normal;
- // margin-bottom: 24px;
- &.end {
- opacity: 0.5;
- }
- }
- .package-expire {
- margin-top: 12px;
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- text-align: center;
- font-style: normal;
- margin-bottom: 24px;
- &,
- .van-count-down {
- font-weight: 400;
- font-size: 12px;
- color: #7d6156;
- line-height: 16px;
- }
- .van-count-down {
- display: inline-block;
- }
- }
- .invitee-to-claim {
- width: 330px;
- height: 406px;
- border-radius: 20px;
- background: url('~/assets/image/claimCloudPhone/Invitee-to-claim.png')
- no-repeat 0 0;
- background-size: 100% 100%;
- position: relative;
- .invitee-to-claim_btn {
- height: 54px;
- background: linear-gradient(90deg, #ff6d2b 0%, #ff1500 100%);
- box-shadow: inset 9px -7px 19px 0px #ffba57,
- inset -1px 2px 6px 0px #ffbd63;
- border-radius: 27px;
- text-align: center;
- position: absolute;
- bottom: 14px;
- width: 200px;
- font-family: YouSheBiaoTiYuan;
- font-size: 28px;
- color: #ffffff;
- line-height: 23px;
- left: 50%;
- transform: translateX(-50%);
- font-style: normal;
- font-weight: bold;
- line-height: 54px;
- }
- }
- }
- .bargaining-record {
- margin-bottom: 24px;
- }
- .bargaining-record,
- .distribution-records {
- background: #ffffff;
- border-radius: 12px;
- .title {
- height: 44px;
- background: #ffe8e8;
- border-radius: 12px 12px 0px 0px;
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- font-weight: bold;
- font-size: 16px;
- color: #c00202;
- line-height: 44px;
- text-align: center;
- font-style: normal;
- }
- .container {
- height: 250px;
- overflow-y: auto;
- padding: 0 20px;
- scrollbar-width: none !important; /* 对于 Firefox 隐藏滚动条 */
- &::-webkit-scrollbar {
- display: none !important; /* 对于 Chrome, Safari 和 Opera 隐藏滚动条 */
- }
- ::v-deep .van-empty {
- padding: 0 !important;
- }
- }
- .bargaining-record-item {
- height: 53px;
- border-bottom: 2px #f1f1f1 solid;
- display: flex;
- align-items: center;
- .bargaining-record-item_info {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- color: #7d6156;
- line-height: 18px;
- font-style: normal;
- & > div:first-of-type,
- span {
- font-weight: bold;
- }
- span {
- color: #c00202;
- }
- }
- }
- }
- .distribution-records {
- .container {
- padding: 0px;
- position: relative;
- & > div:first-of-type {
- position: absolute;
- width: 100%;
- left: 0;
- height: 20px;
- background: #ffffff;
- box-shadow: 0px 2px 4px 0px #ecedf8;
- top: 0;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 12px;
- color: #7d6156;
- line-height: 20px;
- text-align: center;
- display: flex;
- font-style: normal;
- & > div {
- width: 25%;
- }
- }
- & > div:last-of-type {
- height: 100%;
- box-sizing: border-box;
- padding-top: 20px;
- overflow-y: auto;
- scrollbar-width: none !important; /* 对于 Firefox 隐藏滚动条 */
- &::-webkit-scrollbar {
- display: none !important; /* 对于 Chrome, Safari 和 Opera 隐藏滚动条 */
- }
- ::v-deep .van-empty {
- padding: 0px;
- .van-empty__image {
- img {
- display: none;
- }
- background: url('~/assets/image/claimCloudPhone/distribution-records-empty.png')
- no-repeat center bottom;
- background-size: 90px 90px;
- }
- }
- .distribution-records-item {
- height: 46px;
- line-height: 46px;
- box-sizing: border-box;
- display: flex;
- border-bottom: 2px #f1f1f1 solid;
- & > div {
- width: 25%;
- text-align: center;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- color: #6d2b12;
- text-align: center;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- font-style: normal;
- }
- }
- }
- }
- }
- .barrage {
- position: fixed;
- bottom: 11%;
- transform: translateY(-11%);
- right: 11px;
- & > ::v-deep div {
- transition: all 0.7s;
- &.start {
- opacity: 1;
- animation: barrage 0.5s linear;
- @keyframes barrage {
- 0% {
- opacity: 1;
- transform: translateY(0px);
- }
- 100% {
- transform: translateY(-30px);
- opacity: 0;
- }
- }
- }
- opacity: 1;
- width: 143px;
- height: 40px;
- position: absolute;
- bottom: 11%;
- right: 11px;
- background: linear-gradient(
- 90deg,
- #992bff 0%,
- rgba(255, 21, 0, 0.4) 100%
- );
- border-radius: 23px;
- border-image: linear-gradient(
- 94deg,
- rgba(255, 255, 255, 1),
- rgba(255, 255, 255, 0.35)
- )
- 1 1;
- padding-left: 20px;
- font-size: 10px;
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- font-weight: 400;
- color: #ffffff;
- display: flex;
- flex-direction: column;
- justify-content: center;
- & > div {
- height: 16px;
- line-height: 16px;
- &:first-of-type {
- display: flex;
- justify-content: space-between;
- align-items: center;
- & > div:first-of-type {
- width: 60px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- & > div:last-of-type {
- height: 16px;
- line-height: 16px;
- margin-right: 15px;
- padding: 0 8px;
- background: linear-gradient(to top, #fec37a 0%, #ff1500 100%);
- border-radius: 21px;
- }
- }
- &:last-of-type span {
- color: #fddb2b;
- }
- }
- }
- }
- .rule {
- position: absolute;
- z-index: 0;
- right: -16px;
- top: 5.5%;
- width: 40px;
- height: 20px;
- line-height: 20px;
- background: #f04646;
- border-radius: 17px 0px 0px 17px;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 12px;
- color: #ffffff;
- text-align: center;
- font-style: normal;
- }
- .rule-title {
- height: 53px;
- border-radius: 16px 16px 0 0;
- background: linear-gradient(90deg, #f6cdb9 0%, #fbdbde 100%);
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- font-weight: bold;
- font-size: 18px;
- color: #751d13;
- line-height: 53px;
- text-align: center;
- font-style: normal;
- }
- .rule-content {
- height: 325px;
- padding: 16px;
- box-sizing: border-box;
- background: #fff;
- border-radius: 0 0 16px 16px;
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- font-weight: 400;
- font-size: 14px;
- color: #751d13;
- line-height: 16px;
- font-style: normal;
- overflow-y: auto;
- }
- .rule-close {
- height: 32px;
- width: 32px;
- background: #c1c1c1;
- z-index: 5;
- margin: 20px auto 0;
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 24px;
- color: #666666;
- }
- ::v-deep .van-dialog {
- background: transparent !important;
- // overflow: visible;
- }
- .bargaining-img {
- position: relative;
- width: 336px;
- height: 468px;
- }
- .bargaining-amount {
- box-sizing: border-box;
- background-size: 100% auto;
- .bargaining-amount-text {
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- font-weight: bold;
- font-size: 24px;
- color: #ffffff;
- line-height: 20px;
- text-align: center;
- font-style: normal;
- span {
- color: #ff0000;
- font-size: 35px;
- color: #fad539;
- }
- }
- }
- .exit {
- height: 520px;
- position: relative;
- & > img {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- height: 321px;
- width: 284px;
- z-index: -1;
- }
- .exit-glory {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%) scale(1.5);
- z-index: -2;
- }
- .exit-content {
- position: absolute;
- top: 25%;
- left: 50%;
- width: 200px;
- transform: translateX(-50%);
- font-family: AlimamaShuHeiTi, AlimamaShuHeiTi;
- color: #171815;
- line-height: 24px;
- text-align: center;
- font-style: normal;
- font-weight: bold;
- font-size: 16px;
- z-index: 0;
- & > div span {
- color: #f04646;
- }
- .exit-content-progress {
- margin: 30px 10px 100px;
- }
- .exit-content-btn {
- & > img {
- height: 42px;
- width: 100%;
- }
- .exit-content-btn_leave {
- font-weight: 400;
- font-size: 12px;
- color: #faf3d8;
- }
- }
- }
- }
- .bargaining-success {
- height: 378px;
- width: 289px;
- margin: 0 auto;
- background: url('~/assets/image/claimCloudPhone/successful-bargaining-img.png')
- no-repeat 0 0;
- background-size: 100% 100%;
- overflow: hidden;
- position: relative;
- .bargaining-success-title {
- margin-top: 24px;
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- text-align: center;
- font-style: normal;
- font-weight: bold;
- font-size: 28px;
- color: #fdf9c8;
- line-height: 38px;
- }
- .bargaining-success-tips {
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- font-weight: 500;
- font-size: 12px;
- color: #ffffff;
- line-height: 17px;
- text-align: center;
- font-style: normal;
- width: 160px;
- margin: 0 auto;
- }
- .bargaining-success-btn {
- position: absolute;
- bottom: 20px;
- left: 50%;
- transform: translateX(-50%);
- display: flex;
- flex-direction: column;
- justify-content: center;
- & > div {
- width: 180px;
- height: 48px;
- line-height: 48px;
- text-align: center;
- border-radius: 24px;
- color: #fff;
- font-weight: bold;
- &:first-of-type {
- margin-bottom: 8px;
- background: linear-gradient(178deg, #fd8c50 0%, #fc3307 100%);
- }
- &:last-of-type {
- color: #e63b47;
- border: 1px solid #e63b47;
- }
- }
- }
- }
- .expire {
- height: 378px;
- width: 289px;
- margin: 0 auto;
- background: url('~/assets/image/claimCloudPhone/expire-img.png') no-repeat 0
- 0;
- background-size: 100% 100%;
- position: relative;
- .expire-btn {
- position: absolute;
- bottom: 20px;
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- font-weight: 500;
- font-size: 16px;
- color: #ffffff;
- line-height: 48px;
- left: 50%;
- transform: translateX(-50%);
- text-align: center;
- font-style: normal;
- width: 180px;
- height: 48px;
- background: linear-gradient(178deg, #fd8c50 0%, #fc3307 100%);
- border-radius: 24px;
- }
- }
- .login {
- height: 312px;
- background: #ffffff;
- border-radius: 24px;
- padding: 16px 28px;
- box-sizing: border-box;
- .login-title {
- font-family: DingTalk, DingTalk;
- font-weight: normal;
- font-weight: bold;
- font-size: 24px;
- color: #0a132b;
- line-height: 28px;
- text-align: left;
- font-style: normal;
- margin-bottom: 14px;
- }
- .van-field {
- margin-bottom: 14px;
- border-radius: 8px;
- border: 1px solid #e6e6e6;
- }
- .van-button {
- width: 100%;
- border-radius: 8px;
- }
- .login-code {
- font-family: PingFangSC, PingFang SC;
- font-weight: 500;
- font-size: 14px;
- color: #3666f2;
- line-height: 16px;
- text-align: left;
- font-style: normal;
- &.disabled {
- color: #999;
- }
- }
- .login-agreement {
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 12px;
- font-style: normal;
- margin-top: 12px;
- display: flex;
- span {
- color: #3666f2;
- }
- .van-checkbox {
- align-items: start;
- ::v-deep .van-checkbox__label {
- color: #999999;
- }
- ::v-deep .van-checkbox__icon {
- margin-top: 3px;
- }
- }
- }
- }
- ::v-deep .phone-container {
- background: transparent;
- }
- }
- .dialog-bargaining {
- overflow: visible;
- }
- .species {
- height: 234px !important;
- }
- .glory,
- .red-packet {
- position: absolute;
- top: 90%;
- left: 50%;
- }
- .glory {
- top: 116%;
- transform: translate(-50%, -110%) scale(1.5);
- }
- .red-packet {
- width: 259px !important;
- height: 318px !important;
- transform: translate(-50%, -90%);
- }
- .red-packet-title {
- width: 90%;
- height: 146px;
- position: absolute;
- top: 0;
- left: 50%;
- transform: translateX(-50%);
- }
- .end-visible-img {
- width: 289px;
- height: 264px;
- margin: 0 auto;
- display: block;
- }
- .mb-24 {
- margin-bottom: 24px !important;
- }
- .mask {
- z-index: 4000;
- }
- </style>
|