123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491 |
- <template>
- <div class="bargaining-assistance">
- <!-- 邀请人提示 -->
- <div class="inviter-tips" v-if="+type">
- <div>恭喜您选到喜欢的云手机</div>
- <div>您一定要免费带走</div>
- 好友注册获得助力 好友下单加速助力
- </div>
- <!-- 被邀请人提示 -->
- <div v-else class="invitee-tips">
- <div class="invitee-tips-text">
- 亲,我在用双子星云手机,可以<span>24小时运行游戏/聊天/看视频</span>,双子星云手机已经帮我节省<span>10086小时</span>,我得任务全做完了,游戏升级哇哇快,现在官方活动领云机,麻烦帮我助力!
- </div>
- </div>
- <!-- 砍价进度 -->
- <div class="bargaining-assistance-main">
- <!-- 被邀请人助力、邀请人砍价 -->
- <template v-if="!assistanceBool">
- <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"
- :style="!+type ? 'margin-bottom: 24px;' : ''"
- @click="btnFun"
- >
- {{
- +type
- ? info.bargainingStatus === 1
- ? `继续砍价${info.remainingQuantity || 0}次`
- : '邀请好友助力免单'
- : '帮他助力'
- }}
- </div>
- <div class="package-expire" v-if="+type && time">
- 免单失效时间:<van-count-down :time="time" />
- </div>
- </template>
- <!-- 被邀请人点击助力之后领取手机的页面 -->
- <template v-else>
- <div class="invitee-to-claim">
- <div class="invitee-to-claim_btn" @click="loginVisible = true">
- 免费领取
- </div>
- </div>
- </template>
- </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>
- <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>
- </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">
- <div
- class="bargaining-img"
- @click="bargainingFun(true)"
- v-if="!bargainingTipsBool"
- ></div>
- <template v-else>
- <div class="bargaining-amount">
- <div class="bargaining-amount-text">
- 恭喜您,砍价成功<span>{{ bargainingAmount }}元</span>
- </div>
- <div class="bargaining-amount-img"></div>
- </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="" />
- </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>
- <Verify
- @success="success"
- mode="pop"
- captchaType="blockPuzzle"
- :imgSize="{ width: '300px', height: '155px' }"
- ref="verify"
- ></Verify>
- </div>
- </template>
- <script>
- 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';
- 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: '', // 系统时间
- assistanceBool: false, // 是否触发助力
- laoginData: {
- // 被邀请人登录信息
- phone: '',
- code: '',
- },
- codeNumber: '获取验证码',
- loginLoading: false,
- };
- },
- components: {
- customProgress,
- loadList,
- Verify,
- },
- mounted() {
- if (sessionStorage.getItem('isAgreementBool')) {
- this.assistanceBool = true;
- 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.getRule();
- this.getAssistAwardRecode();
- }
- setTimeout(() => {
- this.bargainingStatus(true);
- });
- },
- computed: {
- time() {
- const { validityPeriodTimeStamp = 0 } = this.info;
- return validityPeriodTimeStamp
- ? validityPeriodTimeStamp - this.systemTime * 1000
- : 0;
- },
- },
- 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>
- <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 = {};
- 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;
- localStorage.setItem(
- 'bargainingStatusInfo',
- JSON.stringify(this.info),
- );
- // 如果是被邀请人就不需要走下面流程
- if (Object.keys(this.inviteeData).length) {
- return;
- }
- switch (+this.type) {
- case 3: // 成功,领取下一台云机界面
- this.successfulBargainingVisible = true;
- break;
- case 4: // 失败,领取下一台云机界面
- this.expireVisible = true;
- break;
- }
- 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(() => {
- if(!this.$userAgent.isMiniProgram) {
- this.$toast('无法返回上一页,可直接关闭页面')
- return
- }
- history.pushState(null, null, document.URL);
- this.exitVisible = true;
- });
- }
- }
- if (
- [1, 2].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();
- }
- }
- })
- .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/chooseCloudPhone?exit=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) => {
- this.$toast(error.message);
- setTimeout(() => {
- this.$toast.clear();
- }, 500);
- });
- },
- btnFun() {
- if (!+this.type) this.assistanceBool = 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 {
- if (
- this.$userAgent.isIos &&
- !this.$userAgent.isWx
- ) {
- await this.$native.clipboard.writeText(res.data.link);
- setTimeout(() => {
- this.$toast.success('链接复制成功');
- });
- return;
- }
- writeToClipboard(res.data.link)
- .then(() => {
- setTimeout(() => {
- this.$toast('链接复制成功');
- });
- })
- .catch((err) => {
- 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();
- });
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .bargaining-assistance {
- height: 100%;
- /deep/ .van-overlay {
- z-index: 0 !important;
- }
- /deep/ .van-dialog {
- z-index: 0 !important;
- }
- .inviter-tips,
- .invitee-tips {
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- }
- .inviter-tips {
- font-weight: 400;
- font-size: 12px;
- color: #ffffff;
- line-height: 17px;
- text-align: center;
- font-style: normal;
- margin-bottom: 14px;
- & > div {
- font-size: 26px;
- line-height: 30px;
- }
- }
- .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-weight: 400;
- font-size: 14px;
- color: #ffffff;
- line-height: 22px;
- text-align: left;
- font-style: normal;
- span {
- color: #fceba9;
- }
- margin-bottom: 24px;
- }
- }
- .bargaining-assistance-main {
- background: #ffffff;
- border-radius: 20px;
- margin-bottom: 24px;
- overflow: hidden;
- .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;
- height: 120px;
- font-weight: normal;
- box-sizing: border-box;
- padding-top: 30px;
- font-size: 30px;
- color: #c70b0b;
- line-height: 62px;
- text-align: center;
- font-style: normal;
- font-weight: bold;
- width: calc(100% - 24px);
- margin: 0 auto;
- background: #ffffff;
- box-shadow: 0px 0px 8px 2px #f4f7f8, 0px 2px 4px 0px #ecedf8;
- border-radius: 20px;
- margin-top: -20px;
- span {
- font-size: 20px;
- }
- }
- .package-progress {
- margin: 40px 42px 28px;
- }
- .package-tips {
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- text-align: center;
- font-size: 16px;
- font-weight: bold;
- color: #000000;
- line-height: 22px;
- font-style: normal;
- margin-bottom: 24px;
- 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;
- }
- .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 {
- height: 339px;
- 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 隐藏滚动条 */
- }
- .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;
- 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;
- & > div {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
- &:last-of-type span {
- color: #fddb2b;
- }
- }
- }
- }
- .rule {
- position: fixed;
- top: 12.5%;
- right: 0;
- width: 40px;
- height: 20px;
- line-height: 20px;
- background: #f04646;
- border-radius: 17px 0px 0px 17px;
- z-index: 2;
- 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;
- text-align: left;
- 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;
- }
- .bargaining-img {
- height: 512px;
- width: 100%;
- background: url('~/assets/image/claimCloudPhone/bargaining-popUp.png')
- no-repeat 0 20px;
- background-size: 100% 100%;
- }
- .bargaining-amount {
- height: 234px;
- background: url('~/assets/image/claimCloudPhone/bargaining-amount-img.png')
- no-repeat 0 20px;
- padding-top: 30px;
- box-sizing: border-box;
- background-size: 100% 210px;
- .bargaining-amount-text {
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- font-weight: bold;
- font-size: 24px;
- color: #ffffff;
- text-align: center;
- font-style: normal;
- span {
- color: #ff0000;
- }
- }
- }
- .exit {
- height: 520px;
- position: relative;
- & > img {
- height: 100%;
- width: 100%;
- }
- .exit-content {
- position: absolute;
- top: 25%;
- left: 50%;
- width: 200px;
- transform: translateX(-50%);
- font-family: AlimamaShuHeiTi, AlimamaShuHeiTi;
- font-weight: bold;
- font-size: 16px;
- color: #171815;
- line-height: 24px;
- text-align: center;
- font-style: normal;
- & > div span {
- color: #f04646;
- }
- .exit-content-progress {
- margin: 50px 0 80px;
- }
- .exit-content-btn {
- & > img {
- height: 42px;
- width: 100%;
- }
- .exit-content-btn_leave {
- font-weight: 400;
- font-size: 12px;
- color: #faf3d8;
- }
- }
- }
- }
- .bargaining-success {
- height: 378px;
- 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;
- font-weight: bold;
- font-size: 28px;
- color: #fdf9c8;
- line-height: 38px;
- text-align: center;
- font-style: normal;
- }
- .bargaining-success-tips {
- font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
- width: 165px;
- font-weight: bold;
- font-size: 12px;
- color: #ffffff;
- line-height: 17px;
- text-align: center;
- 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;
- 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;
- }
- }
- </style>
|