123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
- <meta name="description" content="双子星邀请你免费领取云手机">
- <link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
- <link rel="stylesheet" href="../static/css/index.css">
- <link rel="stylesheet" href="../static/css/vant.css" />
- <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
- <link rel="stylesheet" href="../static/css/verify.css">
- <link rel="stylesheet" href="../static/js/vender/toastr/toastr.min.css">
- <script>
- (function () {
- if (!window.Promise) {
- document.writeln('<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-promise/4.1.1/es6-promise.min.js"><' + '/' + 'script>');
- }
- })();
- </script>
- <script src="../static/js/vender/toastr/toastr.min.js"></script>
- <script src="../static/js/vender/config.js"></script>
- <script src="../static/js/vender/crypto-js.js"></script>
- <script src="../static/js/vender/ase.js"></script>
- <!-- <script src="../static/js/vender/vue/vue.min.js"></script>
- <script src="../static/js/vender/vue/vant.min.js"></script>
- <script src="../static/js/vender/config.js"></script>
- <script src="../static/js/vender/uuid.js"></script>
- <script src="../static/js/vender/vue/axios.min.js"></script>
- <script src="../static/js/vender/vue/config.js"></script>
- <script src="../static/js/vender/vue/api.js"></script> -->
- <title>分享攻略</title>
- <style>
- [v-cloak] {
- display: none !important;
- }
- .container {
- display: flex;
- height: 100vh;
- padding-top: 0.2rem;
- /* align-items: center;
- justify-content: center; */
- }
- .top-banner {
- width: 6.9rem;
- height: 0.82rem;
- background: url("../static/offImg/share-top.png") no-repeat;
- background-size: 100% 100%;
- }
- .footer {
- position: fixed;
- bottom: 0.5rem;
- padding: 0 0.3rem;
- width: 100%;
- left: 0;
- display: flex;
- justify-content: center;
- }
- .download-btn {
- width: 7.2rem;
- height: 1.3rem;
- background: url('../static/offImg/btn-down.png') no-repeat scroll top center #3B7FFF;
- background-size: 100% 100%;
- box-shadow: 0rem 0.06rem 0.4rem 0rem rgba(59, 127, 255, 0.6);
- border-radius: 0.2rem;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 0.4rem;
- }
- .button-download {
- width: 2.5rem;
- height: 0.8rem;
- line-height: 0.8rem;
- background: linear-gradient(360deg, #FF8300 0%, #FEC000 100%);
- border-radius: 0.2rem;
- text-align: center;
- font-size: 0.3rem;
- font-family: PingFangSC-Medium, PingFang SC;
- color: #FFFFFF;
- }
- .download-btn .left-nav p:first-of-type {
- font-size: 0.24rem;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: rgba(255, 255, 255, 0.7);
- margin-bottom: 0.02rem;
- }
- .download-btn .left-nav p+p {
- font-size: 0.28rem;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: rgba(255, 255, 255, 0.9);
- }
- .hideContainer {
- width: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- height: calc(100vh - 1.36rem);
- text-align: center;
- }
- .hideContainer img {
- width: 2.8rem;
- height: 2.8rem;
- }
- .hideContainer p {
- margin-top: 0.3rem;
- font-family: PingFangSC-Regular, PingFang SC;
- color: #999999;
- font-size: 0.28rem;
- }
- .top-content {
- width: 6.9rem;
- padding-bottom: 0.3rem;
- }
- .top-content .title {
- font-size: 0.44rem;
- font-family: PingFangSC-Medium, PingFang SC;
- color: #000000;
- letter-spacing: 0.01rem;
- margin-bottom: 0.2rem;
- }
- .topic-info {
- padding-bottom: 1.6rem;
- }
- .topic-info img {
- max-width: 100%;
- width: auto;
- height: auto;
- border-radius: 0.2rem;
- margin-bottom: 0.2rem;
- margin-top: 0.2rem;
- }
- .topic-info {
- font-size: 0.3rem;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #333333;
- letter-spacing: 0.02rem;
- }
- .topic-info p {
- font-size: 0.36rem;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #333333;
- letter-spacing: 0.02rem;
- }
- .van-notice-bar {
- height: 100%;
- background: none;
- width: 100%;
- }
- .notice-swipe {
- height: 0.8rem;
- line-height: 0.8rem;
- }
- .van-swipe-item {
- display: flex;
- align-items: center;
- }
- .van-swipe-item img {
- width: 0.6rem;
- margin-left: 0.3rem;
- border-radius: 50%;
- margin-right: 0.1rem;
- height: 0.6rem;
- }
- .van-swipe-item p {
- font-size: 0.28rem;
- font-family: PingFangSC-Regular, PingFang SC;
- color: #FFFFFF;
- }
- .van-swipe-item p:first-of-type {
- max-width: 2.4rem;
- display: block;
- overflow: hidden;
- word-break: keep-all;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .topic-info img {
- max-width: 100%;
- width: auto;
- height: auto;
- border-radius: 0.2rem;
- margin-bottom: 0.2rem;
- margin-top: 0.2rem;
- }
- .topic-info p {
- font-size: 0.3rem;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #333333;
- letter-spacing: 0.02rem;
- }
- .van-dialog__footer {
- display: none;
- }
- .top-banner {
- margin: 0 auto;
- margin-bottom: 0.1rem;
- }
- .hide {
- display: none !important;
- }
- .van-overlay {
- background-color: rgba(0, 0, 0, 0.5);
- }
- .van-dialog__content {
- /* padding: 0.3rem 0.6rem; */
- min-height: unset !important;
- }
- .van-dialog {
- border-radius: 0.2rem;
- width: unset !important;
- }
- .van-dialog__message {
- padding: 0.3rem 0.6rem;
- font-size: 0.3rem;
- white-space: nowrap;
- font-family: PingFangSC-Regular, PingFang SC;
- }
- .van-dialog__content {
- border-radius: 0.2rem;
- }
- .mask {
- width: 7.5rem;
- height: 100vh;
- position: absolute;
- top: 0;
- left: 0;
- background: rgba(0, 0, 0, 0.24);
- display: none;
- }
- .dialog {
- width: 6.22rem;
- height: 8.56rem;
- background: #FFFFFF;
- border-radius: 0.2rem;
- position: absolute;
- left:50%;
- transform: translateX(-50%);
- padding: 0 0.4rem;
- top: -6.96rem;
- overflow: hidden;
- }
- .imgs-block{
- width: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- position: relative;
- margin-top: 0.5rem;
- }
- .copy-tip{
- display: flex;
- justify-content: center;
- font-size: 0.28rem;
- margin-top: 0.32rem;
- color: #333333;
- }
-
- .my{
- color: #000000;
- font-weight: 600;
- }
- .point1{
- font-size: 0.26rem;
- margin-top: 0.16rem;
- color: #666666;
- }
- .point-img{
- width: 5.42rem;
- height: 1.7rem;
- margin: auto;
- margin-top: 0.2rem;
- }
- .point2{
- margin-top: 0.32rem;
- }
- .imgs{
- width: 0.38rem;
- height: 0.38rem;
- }
- .imgs-text{
- font-size: 0.36rem;
- color: #3B7FFF;
- }
- .get-success-block{
- display: flex;
- justify-content: center;
- margin-top: 0.3rem;
- }
- .get-success{
- width: 4.6rem;
- height: 0.9rem;
- line-height: 0.9rem;
- text-align: center;
- color: #FFFFFF;
- font-size: 0.25rem;
- background: linear-gradient(180deg, #6DB6FF 0%, #3B7FFF 100%);
- border-radius: 0.2rem;
- }
- .close{
- width: 0.48rem;
- height: 0.48rem;
- position: absolute;
- bottom: -0.8rem;
- left: 50%;
- margin-left: -0.24rem;
- z-index: 999;
- }
- #toast-container>.toast-error {
- background-image: none!important;
- }
- .toast-error {
- background-color: rgba(0, 0, 0, 0.7);
- }
- .toast-message {
- font-size: 0.24rem;
- padding: 0 0.1rem;
- line-height: 0.9rem;
- text-align: center;
- font-weight: 400;
- color: #FFFFFF;
- }
- #toast-container>div {
- width: 4rem;
- height: 0.9rem;
- opacity: 1;
- padding: 0 !important;
- border-radius: 0.2rem;
- box-shadow: none;
- }
- .toast-center-center {
- position: fixed;
- top: 50%;
- left: 50%;
- z-index: 99;
- margin-top: -0.45rem;
- transform: translate(-50%,-50%);
- }
- .mask{
- position: fixed;
- width: 100vw;
- }
- .share_btn{
- width: 2.4rem;
- height: 0.88rem;
- display: flex;
- justify-content: center;
- }
- @media (max-width: 480px) and (min-width: 241px) {
- #toast-container>div {
- min-width: 80px !important;
- width: auto;
- }
- }
- .miniprogram-wrap{
- position: relative;
- }
- .miniprogram{
- width: 6.25rem;
- height: 8.01rem;
- margin-left: -0.39rem;
- }
- .down-btn{
- width: 4.6rem;
- height: 0.9rem;
- position: absolute;
- bottom: 0.42rem;
- left: 0.42rem;
- }
- </style>
- </head>
- <body>
- <div id="mpanel2"></div>
- <div id="form-btn"></div>
- <div id="app" v-cloak class="container ">
- <div v-if='isshow&&topic!=null' style="margin: 0 auto;">
- <div class="footer">
- <div v-if="type == 1">
- <img @click="share" src="../static/offImg/share_btn.png" class="share_btn" alt="" />
- </div>
- <div class="download-btn" v-else>
- <div class="left-nav">
- <p>激活码:</p>
- <p>AS4*********SD3</p>
- </div>
- <div class="button-download" @click='copyHandle()'>点击复制并下载</div>
- </div>
- </div>
- <div class="top-banner">
- <van-notice-bar :scrollable="false">
- <van-swipe vertical class="notice-swipe" :autoplay="2000" :show-indicators="false">
- <van-swipe-item v-for="(item,index) in marqueeList">
- <img :src="standarImg(item.headImgUrl)" :onerror="defaultImg" alt="">
- <div class="hide">双子星邀请你免费领取云手机</div>
- <p>{{item.surfaceName}}</p>
- <p>已获得{{phoneType === 'VIP'?'星动':phoneType === 'SVIP'?'星曜':'唔即'}}云手机套餐</p>
- </van-swipe-item>
- </van-swipe>
- </van-notice-bar>
- </div>
- <div class="top-content">
- <div v-html="topic" class="topic-info"></div>
- </div>
- </div>
- <div v-if='!isshow' class="hideContainer">
- <div>
- <img src="../static/offImg/no-data.png" alt="" />
- <p>{{msg}},敬请期待</p>
- </div>
- </div>
- </div>
- <div class="mask">
- <div class="dialog">
- <div class="miniprogram-wrap">
- <img class="miniprogram" src="../static/offImg/tost.png" />
- <img class="down-btn" src="../static/offImg/down-btn.png" />
- </div>
- <div class="noMiniprogram">
- <div class="imgs-block">
- <img class="imgs" src="../static/img/icon-copy.png" />
- <div class="imgs-text">复制成功</div>
- <img class="imgs" src="../static/img/icon-copy.png" />
- </div>
- <div class="copy-tip">温馨提示:激活码使用教程</div>
- <div class="point1">1、在双子星APP的工具栏,点击 <span class="my">[我的]</span></div>
- <img class="point-img" src="../static/img/point1.png" />
- <div class="point1 point2">2、找到 我的工具 - <span class="my">[激活码] </span>,点击激活码
- 即可兑换使用激活码啦。</div>
- <img class="point-img" src="../static/img/point2.png" />
- <div class="get-success-block">
- <div class="get-success">下载APP</div>
- </div>
- <img class="close" src="img/close.png" />
- </div>
- </div>
- </div>
-
- <script src="../static/js/vender/verify.js"></script>
- <script src="../static/js/vender/vue/vue.min.js"></script>
- <script src="../static/js/vender/vue/vue-clipboard.min.js"></script>
- <script src="../static/js/vender/vue/vant.min.js"></script>
- <script src="../static/js/vender/config.js"></script>
- <script src="../static/js/vender/uuid.js"></script>
- <script src="../static/js/vender/vue/axios.min.js"></script>
- <script src="../static/js/vender/vue/config.js"></script>
- <script src="../static/js/vender/vue/api.js"></script>
- <script>
- toastr.options.positionClass = 'toast-center-center';
- toastr.options.timeOut = '1500';
- </script>
- <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
- <script type="text/javascript">
- // var meta_description = document.getElementsByTagName('meta')['description']
- // document.title = '更新标题'
- // meta_description.content = '更新描述'; // Android iOS
- // var oInput = document.createElement('input'); //创建一个input
- // oInput.setAttribute("readonly", "readonly"); //设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
- var u = navigator.userAgent,
- app = navigator.appVersion;
- var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
- var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
- var clipboard = new ClipboardJS('.copybtn') //此处为点击的dom的类名
- var html = document.documentElement;
- var imgWidth = html.getBoundingClientRect().width / 750 * 400 + 'px';
- var imgHeight = html.getBoundingClientRect().width / 750 * 200 + 'px';
- var barHeight = html.getBoundingClientRect().width / 750 * 70 + 'px';
- var code = '';
- $('.close')[0].addEventListener('click', (e) => {
- $('.dialog').animate({top: '-6.96rem'},"fast");
- $('.mask').hide();
- document.documentElement.style.overflow='auto';
- });
- $('.get-success-block')[0].addEventListener('click', (e) => {
- if(isIOS){
- copyUrl();
- }else{
- download();
- }
- });
- $('.down-btn')[0].addEventListener('click', (e) => {
- let ua = navigator.userAgent.toLowerCase();
- if (ua.match(/MicroMessenger/i) == "micromessenger") {
- var oInput = document.createElement('input'); //创建一个input
- oInput.setAttribute("readonly", "readonly"); //设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
- setTimeout(() => {
- oInput.value = code;
- document.body.appendChild(oInput);
- selectText(oInput, 0, oInput.value.length);
- document.execCommand("Copy"); // 执行浏览器复制命令
- $('.dialog').animate({top: '-6.96rem'},"fast");
- $('.mask').hide();
- document.documentElement.style.overflow='auto';
- oInput.style.display = 'none'; // 将input隐藏
- oInput.blur();
- oInput.remove(); // 将input销毁
- location.href = 'weixin://dl/business/?t=sg6FNjcPWip';
- }, 400)
- }else{
- alert('环境问题')
- }
- });
- function download() {
- if (isAndroid) {
- if (baseUrl.includes('prese.phone.androidscloud.com')) {
- window.location.href = 'http://14.18.190.144:18888/suanchou'
- } else {
- window.location.href = 'http://www.androidscloud.com/suanchou?timestamp=' + Math.random();
- }
- } else if (isIOS) {
- document.location.href = 'https://www.pgyer.com/gemini6?timestamp=' + Math.random();
- } else {
- document.location.href = 'https://www.androidscloud.com?timestamp=' + Math.random();
- }
- }
- function copyUrl() {
- var oInput = document.createElement('input'); //创建一个input
- oInput.setAttribute("readonly", "readonly"); //设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
- setTimeout(() => {
- oInput.value = code;
- // $('.ipt')[0].appendChild(oInput); //将input插入到body
- // oInput.select(); // 选择对象 ios不支持
- document.body.appendChild(oInput)
- selectText(oInput, 0, oInput.value.length);
- document.execCommand("Copy"); // 执行浏览器复制命令
- toastr.error(`复制成功`);
- $('.dialog').animate({top: '-6.96rem'},"fast");
- $('.mask').hide();
- document.documentElement.style.overflow='auto';
- oInput.style.display = 'none'; // 将input隐藏
- oInput.blur();
- oInput.remove(); // 将input销毁
- setTimeout(() => {
- document.location.href = 'https://www.pgyer.com/gemini6?timestamp=' + Math.random();
- }, 1000)
- }, 400)
- };
- function selectText(textbox, startIndex, stopIndex) {
- if (textbox.createTextRange) { //ie
- const range = textbox.createTextRange();
- range.collapse(true);
- range.moveStart('character', startIndex); //起始光标
- range.moveEnd('character', stopIndex - startIndex); //结束光标
- range.select(); //不兼容苹果
- } else { //firefox/chrome
- textbox.setSelectionRange(startIndex, stopIndex);
- textbox.focus();
- }
- };
- new Vue({
- el: '#app',
- data: {
- isshow: true,
- id: GetRequest().id ? GetRequest().id : 404,
- username: GetRequest().username ? GetRequest().username : '',
- topic: null,
- defaultImg: 'this.src="' + "../static/offImg/tou.png" + '"',
- marqueeList: [],
- code: '',
- msg: '活动已下架',
- strategyId: GetRequest().strategyId ? GetRequest().strategyId : '',
- tagId: GetRequest().tagId ? GetRequest().tagId : '',
- uuid: '',
- shareInfo: {},
- flag: true,
- timer: null,
- phoneType: '',
- type: GetRequest().type,
- dataObj: {}
- },
- created() {
- // window.location.href = 'investigate.html'
- },
- mounted() {
- // this.$dialog.alert({
- // message: '激活码总数已上限,谢谢参与'
- // })
- // document.querySelector('#app').classList.remove('hide');
- // this.validate(); // 生成验证码
- this.getActDetailList();
- this.getMarquee(); //跑马灯
- if (localStorage.getItem("uuid")) {
- this.uuid = localStorage.getItem("uuid");
- } else {
- this.uuid = UUID.generate();
- localStorage.setItem("uuid", this.uuid);
- }
- },
- methods: {
- copyHandle(){
- getActivationCode(this.username, this.tagId, this.uuid).then(res => {
- this.$toast.clear();
- if (res.status === 2 || res.status === 11) {
- $('#mpanel2').eq(0).text('');
- this.validate(); // 生成验证码
- setTimeout(() => {
- document.getElementById('form-btn').click();
- },500)
- } else {
- systemBuriedPoint({
- pointName: 'dt_裂变_h5_复制激活码'
- }).then(res => {})
- this.code = res.data;
- this.copyUrl();
- }
- }).catch((error) => {
- alert(error)
- this.$toast('复制失败');
- // this.download()
- });
- },
-
- //查看活动是否下架
- getActDetailList() { //获取活动状态
- if(GetRequest().type == 1){
- getActDetailList(GetRequest().token).then(res => {
- this.$toast.clear();
- if (res.status === 0) {
- this.phoneType = res.data.phoneType;
- this.shareInfo = res.data;
- if (res.data.actStatus == 1) {
- this.isshow = true;
- this.getStrategy();
- } else {
- this.isshow = false;
- }
- } else {
- this.$toast(res.msg);
- }
- }).catch((error) => {
- console.log(error)
- this.$toast('网络异常');
- });
- } else {
- getActDetail().then(res => {
- this.$toast.clear();
- if (res.status === 0) {
- this.phoneType = res.data.phoneType;
- if (res.data.actStatus == 1) {
- this.isshow = true;
- this.getStrategy();
- } else {
- this.isshow = false;
- }
- } else {
- this.$toast(res.msg);
- }
- }).catch((error) => {
- console.log(error)
- this.$toast('网络异常');
- });
- }
- },
- getCheck() {
- getEvantCheck(this.id).then(res => {
- console.log(res)
- })
- },
- createCopy(captchaVerification) {
- // this.$toast.loading({
- // duration: 0,
- // message: '加载中...',
- // forbidClick: true,
- // loadingType: 'spinner',
- this.stopManyClick(() => {
- systemBuriedPoint({
- pointName: 'dt_裂变_h5_复制激活码'
- }).then(res => {})
- getActivationCode(this.username, this.tagId, this.uuid, captchaVerification).then(res => {
- this.$toast.clear();
- if (res.status === 0) {
- this.code = res.data;
- this.copyUrl();
- if(isIOS){
- code = res.data;
- }
- // if(isAndroid){
- // this.code = res.data;
- // this.copyUrl();
- // }else if(isIOS){
- // $('.dialog').animate({top: '3.36rem'},"fast");
- // $('.mask').show();
- // document.documentElement.style.overflow='hidden';
- // code = res.data;
- // } else {
- // this.code = res.data;
- // this.copyUrl();
- // }
- } else {
- this.$dialog.alert({
- message: res.msg
- });
- setTimeout(() => {
- this.$dialog.close();
- // this.download();
- }, 2000)
- }
- }).catch((error) => {
- alert(error)
- this.$toast('复制失败');
- // this.download()
- });
- })
- },
- download() {
- if (isAndroid) {
- if (baseUrl.includes('prese.phone.androidscloud.com')) {
- window.location.href = 'http://14.18.190.144:18888/suanchou'
- } else {
- window.location.href = 'http://www.androidscloud.com/suanchou?timestamp=' + Math.random();
- }
- } else if (isIOS) {
- document.location.href = 'https://www.pgyer.com/gemini6?timestamp=' + Math.random();
- } else {
- document.location.href = 'https://www.androidscloud.com?timestamp=' + Math.random();
- }
- },
- standarImg(id) {
- return `${fileCenterApi}/document/newFile/download/0/347905r86eb745a1sc38?fileKey=${id}`;
- },
- getMarquee() {
- getMarquee().then(res => {
- if (res.status === 0) {
- this.marqueeList = res.data;
- } else {
- this.$toast(res.msg);
- }
- })
- },
- getStrategy() {
- this.$toast.loading({
- duration: 0,
- message: '加载中...',
- forbidClick: true,
- loadingType: 'spinner',
- });
- getStrategy(this.strategyId).then(res => {
- this.$toast.clear();
- if (res.status === 0) {
- if (res.data) {
- this.isshow = true;
- this.topic = res.data.content;
- this.dataObj = res.data;
- // this.tagId = res.data.tagId;
- console.log(this.topic)
- } else {
- this.msg = res.msg;
- this.isshow = false;
- }
- }else {
- this.$toast(res.msg);
- }
- console.log(res)
- }).catch((error) => {
- console.log(error)
- this.$toast('网络异常');
- });
- },
- validate() {
- $('#mpanel2').slideVerify({
- baseUrl: baseUrl + '/api/activity', //服务器请求地址, 默认地址为安吉服务器;
- mode: 'pop', //展示模式
- containerId: 'form-btn', //pop模式 必填 被点击之后出现行为验证码的元素id
- imgSize: { //图片的大小对象,有默认值{ width: '310px',height: '155px'},可省略
- width: imgWidth,
- height: imgHeight
- },
- barSize: {//下方滑块的大小对象,有默认值{ width: '310px',height: '50px'},可省略
- width: imgWidth,
- height: barHeight
- },
- beforeCheck: () => {
- return true
- },
- ready: () => {
- }, //加载完毕的回调
- success: (params) => { //成功的回调
- this.createCopy(params.captchaVerification);
- },
- error: function () {}
- });
- },
- handTouch(e){
- e.preventDefault();
- },
- //下载指引弹窗
- downloadTip(){
- if(isIOS){
- $('.copy-tip').eq(0).css('marginTop', '44px');
- $('.imgs-block').eq(0).css('display', 'none');
- $('.get-success').eq(0).text('下载APP并复制激活码');
- }
- let ua = navigator.userAgent.toLowerCase();
- if(ua.match(/MicroMessenger/i)=="micromessenger"){
- $('.miniprogram').eq(0).css('display', 'block');
- $('.noMiniprogram').eq(0).css('display', 'none');
- }else{
- $('.miniprogram').eq(0).css('display', 'none');
- $('.noMiniprogram').eq(0).css('display', 'block');
- }
- $('.dialog').animate({top: '1.8rem'},"fast");
- $('.mask').show();
- document.documentElement.style.overflow='hidden';
- },
- copyUrl() {
- var oInput = document.createElement('input'); //创建一个input
- oInput.setAttribute("readonly", "readonly"); //设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
- setTimeout(() => {
- oInput.value = this.code;
- // $('.ipt')[0].appendChild(oInput); //将input插入到body
- // oInput.select(); // 选择对象 ios不支持
- document.body.appendChild(oInput)
- this.selectText(oInput, 0, oInput.value.length);
- document.execCommand("Copy"); // 执行浏览器复制命令
- // this.$dialog.alert({
- // message: `复制成功`
- // })
- oInput.style.display = 'none'; // 将input隐藏
- oInput.blur();
- oInput.remove(); // 将input销毁
- setTimeout(() => {
- this.$dialog.close();
- this.downloadTip();
- // this.download();
- }, 100)
- }, 400)
- },
- selectText(textbox, startIndex, stopIndex) {
- if (textbox.createTextRange) { //ie
- const range = textbox.createTextRange();
- range.collapse(true);
- range.moveStart('character', startIndex); //起始光标
- range.moveEnd('character', stopIndex - startIndex); //结束光标
- range.select(); //不兼容苹果
- } else { //firefox/chrome
- textbox.setSelectionRange(startIndex, stopIndex);
- textbox.focus();
- }
- },
- share(){
- let middle = this.shareInfo.gotoUrl.split('=')[1];
- let result = middle.split('&')[0];
- const {
- content,
- shareImg
- } = this.shareInfo;
- let title = '免费领机:' + decodeURIComponent(GetRequest().title);
- systemBuriedPoint({
- pointName: 'dt_裂变_h5_分享攻略'
- }).then(res => {})
- if (isAndroid) {
- window.native.share(title, content, `${baseUrl}/h5/microserviceUserH5/vcloud/actFissionShare.html?username=${result}&strategyId=${this.strategyId}&tagId=${GetRequest().tagId}`, shareImg)
- } else if (isIOS) {
- window.webkit.messageHandlers.share.postMessage({
- title: title,
- content: content,
- gotoUrl: `${baseUrl}/h5/microserviceUserH5/vcloud/actFissionShare.html?username=${result}&strategyId=${this.strategyId}&tagId=${GetRequest().tagId}`,
- shareImg: shareImg
- });
- } else {
- code = window.Location.href;
- copyUrl();
- }
- },
- stopManyClick(fn) { //防抖
- if (this.flag) {
- fn();
- }
- this.flag = false;
- if (this.timer) {
- clearTimeout(this.timer);
- }
- this.timer = setTimeout(() => {
- this.flag = true
- }, 1500);
- },
- onCopy() {
- console.log(2323);
- this.$toast('复制成功');
- },
- onError() {
- this.$toast('复制失败');
- },
- }
- })
- </script>
- </body>
- </html>
|