初始提交:91 短剧落地页项目
另外新增两版「糖果短剧」logo 素材(candy_logo、candy_logo_sexy), 参考 pc/logo.webp 的构图制作,暂未在页面中引用。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,498 @@
|
||||
<template>
|
||||
<div class="container" @click="doCopy()">
|
||||
<template v-if="version == 'A'">
|
||||
<mobile1
|
||||
v-if="!isPC"
|
||||
class="mobile"
|
||||
:os="os"
|
||||
@getApkInfo="handleGetApkInfo"
|
||||
@recordClick="recordClick"
|
||||
:ip="ip"
|
||||
:configs="configs"
|
||||
:switchData="switchData"
|
||||
:version="version"
|
||||
style="height:100%"
|
||||
></mobile1>
|
||||
|
||||
<tips
|
||||
v-else-if="isPC && page_pc_url === 'https://sisqd.com/?dc=THD2'"
|
||||
></tips>
|
||||
<pc
|
||||
v-else
|
||||
class="pc"
|
||||
:qr-img="QRImg"
|
||||
:os="os"
|
||||
:configs="configs"
|
||||
@getApkInfo="handleGetApkInfo"
|
||||
></pc>
|
||||
</template>
|
||||
<template v-else>
|
||||
<mobile2
|
||||
v-if="!isPC"
|
||||
class="mobile"
|
||||
:os="os"
|
||||
@getApkInfo="handleGetApkInfo"
|
||||
@recordClick="recordClick"
|
||||
:ip="ip"
|
||||
:configs="configs"
|
||||
:switchData="switchData"
|
||||
style="height:100%"
|
||||
ref="mobileRef"
|
||||
/>
|
||||
<tips
|
||||
v-else-if="isPC && page_pc_url === 'https://sisqd.com/?dc=THD2'"
|
||||
></tips>
|
||||
<pc2
|
||||
v-else
|
||||
class="pc"
|
||||
:qr-img="QRImg"
|
||||
:os="os"
|
||||
:configs="configs"
|
||||
@getApkInfo="handleGetApkInfo"
|
||||
></pc2>
|
||||
</template>
|
||||
<!-- loading-->
|
||||
<div class="loading_box" v-if="loading && !isPC">
|
||||
<div style="height: 5px"></div>
|
||||
<div class="lds-roller">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
<h3>加载中...</h3>
|
||||
</div>
|
||||
<selectLinePopup
|
||||
:apiUrls="apiUrls"
|
||||
:showOverlay="showOverlay"
|
||||
@selectLine="selectLine"
|
||||
></selectLinePopup>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import getApkInfo from "@/api/getApkInfo";
|
||||
import getButtonlist from "@/api/getTemplate";
|
||||
import userAgent from "@/utils/userAgent";
|
||||
import QRCode from "qrcode";
|
||||
import axios from "@/utils/request.js";
|
||||
import mobile1 from "./components/mobile1";
|
||||
import mobile2 from "./components/mobile2";
|
||||
import pc from "./components/pc";
|
||||
import pc2 from "./components/pc2";
|
||||
import tips from "./components/tips";
|
||||
import selectLinePopup from "./components/selectLinePopup";
|
||||
import { getTraceId, landingPageView } from "@/utils/eventTracker";
|
||||
const APPID = 214;
|
||||
export default {
|
||||
components: {
|
||||
mobile1,
|
||||
mobile2,
|
||||
pc,
|
||||
pc2,
|
||||
tips,
|
||||
selectLinePopup
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type: "",
|
||||
QRImg: "",
|
||||
os: "",
|
||||
param: "",
|
||||
cutInfo: {}, //替换url参数对象内<key> dc内容;
|
||||
ip: "",
|
||||
switchData: {},
|
||||
page_pc_url: "",
|
||||
iosDownUrl: "",
|
||||
androidDownUrl: "",
|
||||
shopIosDownUrl: "", // 商店包链接
|
||||
storeAndroidDownUrl: "",
|
||||
channelApkAndDownUrl: "",
|
||||
// iosJumpSetUpUrl: "", // 执行完下载链接后需要执行的跳转
|
||||
loading: true,
|
||||
currUrl: window.location.href,
|
||||
apiUrls: JSON.parse(process.env.VUE_APP_BASE_HOSTS), // api数组
|
||||
showOverlay: false, // 显示选线弹窗
|
||||
configs: [],
|
||||
// tgUrl: "",
|
||||
// potatoUrl: "",
|
||||
// swUrl: "",
|
||||
// qdUrl: "",
|
||||
version: "A",
|
||||
trace_id: getTraceId()
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
isPC() {
|
||||
return this.os.isPc;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// const queryVersion = (this.$route.query.version || "").toUpperCase();
|
||||
// this.version =
|
||||
// queryVersion === "A" || queryVersion === "B"
|
||||
// ? queryVersion
|
||||
// : Math.random() < 0.5
|
||||
// ? "A"
|
||||
// : "B";
|
||||
this.version = "A";
|
||||
this.getPcUrl();
|
||||
this.os = userAgent();
|
||||
this.functionParam();
|
||||
this.getButtonlist();
|
||||
landingPageView(this);
|
||||
const referrer = document.referrer;
|
||||
// console.log(referrer, "-----------referrer");
|
||||
if (referrer) {
|
||||
sessionStorage.setItem("referrer", referrer);
|
||||
}
|
||||
if (this.$route.query.dc) {
|
||||
sessionStorage.setItem("dc", this.$route.query.dc);
|
||||
}
|
||||
// this.getIp();
|
||||
},
|
||||
mounted() {
|
||||
this.getQRImg();
|
||||
},
|
||||
methods: {
|
||||
isDcMatch(value) {
|
||||
const reg = /^(?:ky(?:(?:0[1-9]|[1-9][0-9]|100))|TLGG(?:(?:0[1-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-6]))|erra(?:(?:0[1-9]|10))|cctl(?:(?:0[1-9]|10))|mijieer[1-5][a-d])$/;
|
||||
return reg.test(value);
|
||||
},
|
||||
getPcUrl() {
|
||||
this.page_pc_url = window.location.href;
|
||||
},
|
||||
//1.判断进来的url地址 替换到需要手动设置的参数 如cd
|
||||
functionParam() {
|
||||
this.param =
|
||||
JSON.stringify(this.$route.query) === "{}"
|
||||
? "{}"
|
||||
: JSON.stringify(this.$route.query);
|
||||
},
|
||||
//2.获取按钮状态信息
|
||||
async getButtonlist() {
|
||||
try {
|
||||
let param_btn_list = {
|
||||
appId: APPID,
|
||||
channel: this.param,
|
||||
domain: window.location.protocol + "//" + window.location.host,
|
||||
version: this.version
|
||||
};
|
||||
const res = await getButtonlist(param_btn_list);
|
||||
this.loading = false;
|
||||
if (res.data.code === 200) {
|
||||
this.switchData = res.data.data;
|
||||
this.configs = res.data.data.configs || [];
|
||||
this.androidDownUrl = res.data.data.androidDownUrl;
|
||||
this.storeAndroidDownUrl = res.data.data.storeAndroidDownUrl;
|
||||
this.channelApkAndDownUrl = res.data.data.channelApkAndDownUrl;
|
||||
this.iosDownUrl = res.data.data.iosDownUrl;
|
||||
this.shopIosDownUrl = res.data.data.shopIosDownUrl;
|
||||
// this.iosJumpSetUpUrl = res.data.data.iosJumpSetUpUrl;
|
||||
}
|
||||
} catch (err) {
|
||||
this.loading = false;
|
||||
this.showOverlay = true;
|
||||
console.log(err);
|
||||
}
|
||||
},
|
||||
//3. 获取外网IP地址
|
||||
getIp() {
|
||||
axios.get("https://api.ipify.org/?format=json").then(res => {
|
||||
this.ip = res.data.ip;
|
||||
});
|
||||
},
|
||||
//4. 点击下载按钮获取apk信息并下载
|
||||
async handleGetApkInfo(type) {
|
||||
await this.doCopy();
|
||||
let terminal;
|
||||
let packageType;
|
||||
if (type === "ios") {
|
||||
terminal = "ios";
|
||||
packageType = 1;
|
||||
} else if (type == "shopIos") {
|
||||
terminal = "ios";
|
||||
packageType = 2;
|
||||
} else if (type == "androidSpare") {
|
||||
terminal = "androidSpare";
|
||||
} else {
|
||||
terminal = "android";
|
||||
}
|
||||
if (terminal === "android" || terminal === "androidSpare") {
|
||||
let dc = this.$route.query.dc;
|
||||
if (this.storeAndroidDownUrl && this.isDcMatch(dc)) {
|
||||
let url = this.storeAndroidDownUrl || this.channelApkAndDownUrl;
|
||||
window.location.href = url;
|
||||
} else if (terminal === "androidSpare") {
|
||||
window.location.href = this.androidDownUrl;
|
||||
} else {
|
||||
let jumpUrl = this.channelApkAndDownUrl || this.androidDownUrl;
|
||||
window.location.href = jumpUrl;
|
||||
}
|
||||
} else {
|
||||
let dc = this.$route.query.dc;
|
||||
let ch = this.$route.query.ch;
|
||||
let pc = this.$route.query.pc;
|
||||
let linkUrl = "";
|
||||
if (dc) {
|
||||
linkUrl = `${this.iosDownUrl}?dc=${dc}&tid=${this.trace_id}`;
|
||||
} else if (ch) {
|
||||
linkUrl = `${this.iosDownUrl}?ch=${ch}&tid=${this.trace_id}`;
|
||||
} else if (pc) {
|
||||
linkUrl = `${this.iosDownUrl}?pc=${pc}&tid=${this.trace_id}`;
|
||||
} else {
|
||||
linkUrl = `${this.iosDownUrl}?tid=${this.trace_id}`;
|
||||
}
|
||||
if (type == "shopIos" && this.shopIosDownUrl) {
|
||||
window.open(this.shopIosDownUrl);
|
||||
} else {
|
||||
window.location.href = linkUrl;
|
||||
}
|
||||
// if (this.iosJumpSetUpUrl) {
|
||||
// setTimeout(() => {
|
||||
// window.location.href = this.iosJumpSetUpUrl;
|
||||
// }, 1500);
|
||||
// }
|
||||
}
|
||||
// getApkInfo(param);
|
||||
},
|
||||
recordClick(type) {
|
||||
let terminal;
|
||||
let packageType;
|
||||
if (type === "ios") {
|
||||
terminal = "ios";
|
||||
packageType = 1;
|
||||
} else if (type == "shopIos") {
|
||||
terminal = "ios";
|
||||
packageType = 2;
|
||||
} else {
|
||||
terminal = "android";
|
||||
}
|
||||
const param = {
|
||||
appId: APPID,
|
||||
ip: this.ip ? this.ip : "", //获取ip地址
|
||||
channel: JSON.stringify({
|
||||
...JSON.parse(this.param),
|
||||
...this.cutInfo
|
||||
}),
|
||||
domain: window.location.protocol + "//" + window.location.host,
|
||||
terminal,
|
||||
packageType,
|
||||
version: this.version
|
||||
};
|
||||
getApkInfo(param);
|
||||
},
|
||||
//5.生成二维码
|
||||
getQRImg() {
|
||||
// const referrer = sessionStorage.getItem("referrer");
|
||||
// const dc = sessionStorage.getItem("dc");
|
||||
// if (referrer && dc) {
|
||||
// this.currUrl = referrer + "user.html?dc=" + dc;
|
||||
// } else {
|
||||
// if (referrer) {
|
||||
// this.currUrl = referrer + "user.html";
|
||||
// } else {
|
||||
// this.currUrl = window.location.href;
|
||||
// }
|
||||
// }
|
||||
QRCode.toDataURL(this.currUrl, {
|
||||
width: 170,
|
||||
margin: 1,
|
||||
maskPattern: 1,
|
||||
scale: 1,
|
||||
color: {
|
||||
dark: "#000",
|
||||
light: "rgba()"
|
||||
}
|
||||
}).then(url => {
|
||||
const regex = /code=/gi;
|
||||
if (url.indexOf("code=") != -1) {
|
||||
this.QRImg = url.replace(regex, "pc=");
|
||||
} else {
|
||||
this.QRImg = url;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 6.剪贴板
|
||||
doCopy() {
|
||||
let req = JSON.stringify({
|
||||
...this.$route.query,
|
||||
tid: this.trace_id
|
||||
});
|
||||
this.$copyText(req).then(
|
||||
() => {
|
||||
console.log("复制成功");
|
||||
},
|
||||
() => {
|
||||
console.log("复制失败");
|
||||
}
|
||||
);
|
||||
},
|
||||
// 选线
|
||||
selectLine(item) {
|
||||
axios.defaults.baseURL = item; // 更改apiURL
|
||||
setTimeout(() => {
|
||||
this.showOverlay = false;
|
||||
this.loading = true;
|
||||
this.getButtonlist(); // 重新请求接口
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
overflow: hidden;
|
||||
height: 100%;
|
||||
.mobile {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
// @media screen and (min-width: 750px) {
|
||||
// .mobile {
|
||||
// display: none;
|
||||
// }
|
||||
// .pc {
|
||||
// overflow: hidden;
|
||||
// }
|
||||
// }
|
||||
// @media screen and (max-width: 750px) {
|
||||
// .pc {
|
||||
// display: none;
|
||||
// }
|
||||
// }
|
||||
/* loading */
|
||||
.loading_box {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
z-index: 10;
|
||||
border-radius: 20px;
|
||||
display: flex;
|
||||
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
h3 {
|
||||
padding-top: 10px;
|
||||
font-size: 20px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.lds-roller {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.lds-roller div {
|
||||
animation: lds-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
||||
transform-origin: 40px 40px;
|
||||
}
|
||||
|
||||
.lds-roller div:after {
|
||||
content: " ";
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
border-radius: 50%;
|
||||
background: #fff;
|
||||
margin: -4px 0 0 -4px;
|
||||
}
|
||||
|
||||
.lds-roller div:nth-child(1) {
|
||||
animation-delay: -0.036s;
|
||||
}
|
||||
|
||||
.lds-roller div:nth-child(1):after {
|
||||
top: 63px;
|
||||
left: 63px;
|
||||
}
|
||||
|
||||
.lds-roller div:nth-child(2) {
|
||||
animation-delay: -0.072s;
|
||||
}
|
||||
|
||||
.lds-roller div:nth-child(2):after {
|
||||
top: 68px;
|
||||
left: 56px;
|
||||
}
|
||||
|
||||
.lds-roller div:nth-child(3) {
|
||||
animation-delay: -0.108s;
|
||||
}
|
||||
|
||||
.lds-roller div:nth-child(3):after {
|
||||
top: 71px;
|
||||
left: 48px;
|
||||
}
|
||||
|
||||
.lds-roller div:nth-child(4) {
|
||||
animation-delay: -0.144s;
|
||||
}
|
||||
|
||||
.lds-roller div:nth-child(4):after {
|
||||
top: 72px;
|
||||
left: 40px;
|
||||
}
|
||||
|
||||
.lds-roller div:nth-child(5) {
|
||||
animation-delay: -0.18s;
|
||||
}
|
||||
|
||||
.lds-roller div:nth-child(5):after {
|
||||
top: 71px;
|
||||
left: 32px;
|
||||
}
|
||||
|
||||
.lds-roller div:nth-child(6) {
|
||||
animation-delay: -0.216s;
|
||||
}
|
||||
|
||||
.lds-roller div:nth-child(6):after {
|
||||
top: 68px;
|
||||
left: 24px;
|
||||
}
|
||||
|
||||
.lds-roller div:nth-child(7) {
|
||||
animation-delay: -0.252s;
|
||||
}
|
||||
|
||||
.lds-roller div:nth-child(7):after {
|
||||
top: 63px;
|
||||
left: 17px;
|
||||
}
|
||||
|
||||
.lds-roller div:nth-child(8) {
|
||||
animation-delay: -0.288s;
|
||||
}
|
||||
|
||||
.lds-roller div:nth-child(8):after {
|
||||
top: 56px;
|
||||
left: 12px;
|
||||
}
|
||||
|
||||
@keyframes lds-roller {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
//loading
|
||||
</style>
|
||||
Reference in New Issue
Block a user