update:优化推广位部分方法
This commit is contained in:
parent
52022e6a0b
commit
50af9c1f53
|
@ -274,6 +274,8 @@ const shouye = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const mobile=getQueryParam("mobile");
|
||||||
|
if(mobile.value&&mobile.value.length > 0) {
|
||||||
if (isRend) {
|
if (isRend) {
|
||||||
const keyImages = [
|
const keyImages = [
|
||||||
{ id: "coverImg", url: coverImgUrl.value },
|
{ id: "coverImg", url: coverImgUrl.value },
|
||||||
|
|
|
@ -144,7 +144,7 @@ import {
|
||||||
import { isMobile, isIOS, showTel } from "@/utils/tools";
|
import { isMobile, isIOS, showTel } from "@/utils/tools";
|
||||||
import md5 from "js-md5";
|
import md5 from "js-md5";
|
||||||
import { showDialog } from "vant";
|
import { showDialog } from "vant";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter,useRoute } from "vue-router";
|
||||||
const longSpace = "\xa0".repeat(10);
|
const longSpace = "\xa0".repeat(10);
|
||||||
let $router = useRouter();
|
let $router = useRouter();
|
||||||
let htmlLoadFinish = ref(false);
|
let htmlLoadFinish = ref(false);
|
||||||
|
@ -177,6 +177,7 @@ let coverImgUrl = ref("");
|
||||||
let coverBtnImgUrl = ref("");
|
let coverBtnImgUrl = ref("");
|
||||||
let isTelOrder = ref(false);
|
let isTelOrder = ref(false);
|
||||||
let showNoticeBar = ref(true);
|
let showNoticeBar = ref(true);
|
||||||
|
const route=useRoute()
|
||||||
|
|
||||||
//同意弹窗
|
//同意弹窗
|
||||||
const handleAgree = (type) => {
|
const handleAgree = (type) => {
|
||||||
|
@ -193,26 +194,13 @@ const handleAgree = (type) => {
|
||||||
tipsShow.value = false;
|
tipsShow.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const getUrlParam = () => {
|
|
||||||
let url = document.location.toString();
|
|
||||||
let arrObj = url.split("?");
|
|
||||||
let params = Object.create(null);
|
|
||||||
if (arrObj.length > 1) {
|
|
||||||
arrObj = arrObj[1].split("&");
|
|
||||||
arrObj.forEach((item) => {
|
|
||||||
item = item.split("=");
|
|
||||||
params[item[0]] = item[1];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return params;
|
|
||||||
};
|
|
||||||
//跳转看agree等
|
//跳转看agree等
|
||||||
const toAgreePages = (types) => {
|
const toAgreePages = (types) => {
|
||||||
let typesparmes = types === "hdRule" ? 1 : types === "ysRule" ? 2 : 3;
|
let typesparmes = types === "hdRule" ? 1 : types === "ysRule" ? 2 : 3;
|
||||||
$router.push(`/agree?promotionId=${promotionId.value}&type=${typesparmes}`);
|
$router.push(`/agree?promotionId=${promotionId.value}&type=${typesparmes}`);
|
||||||
};
|
};
|
||||||
const shouye = () => {
|
const shouye = () => {
|
||||||
let param = getUrlParam();
|
let param=route.query
|
||||||
resourceInfo({promotionCode:promotionCode.value,...param}).then((resp) => {
|
resourceInfo({promotionCode:promotionCode.value,...param}).then((resp) => {
|
||||||
if (resp.data.code == "S00000") {
|
if (resp.data.code == "S00000") {
|
||||||
const result = resp.data.result;
|
const result = resp.data.result;
|
||||||
|
@ -336,28 +324,19 @@ const submitOrder = () => {
|
||||||
// showToast("请先阅读并同意服务条款");
|
// showToast("请先阅读并同意服务条款");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/*
|
//替换地址栏参数
|
||||||
* changeURLStatic 修改地址栏URL参数 不跳转
|
|
||||||
* @param name 参数名
|
|
||||||
* @param value 参数值
|
|
||||||
*
|
|
||||||
* */
|
|
||||||
const changeURLStatic = (name, value) => {
|
const changeURLStatic = (name, value) => {
|
||||||
let url = location.href;
|
let url = new URL(location.href);
|
||||||
let url2 = "";
|
let params = url.searchParams;
|
||||||
let reg = eval("/([?|&]" + name + "=)[^&]*/gi");
|
value = value.toString().trim();
|
||||||
value = value.toString().replace(/(^\s*)|(\s*$)/g, ""); //移除首尾空格
|
if (value) {
|
||||||
if (!value) {
|
params.set(name, value);
|
||||||
url2 = url.replace(reg, ""); //正则替换
|
|
||||||
} else {
|
} else {
|
||||||
if (url.match(reg)) {
|
params.delete(name);
|
||||||
url2 = url.replace(reg, "$1" + value); //正则替换
|
|
||||||
} else {
|
|
||||||
url2 = url + (url.indexOf("?") > -1 ? "&" : "?") + name + "=" + value; //没有参数添加参数
|
|
||||||
}
|
}
|
||||||
}
|
history.replaceState(null, null, url.toString());
|
||||||
history.replaceState(null, null, url2); //替换地址栏
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const submitData = async () => {
|
const submitData = async () => {
|
||||||
let mobiles = mobile.value;
|
let mobiles = mobile.value;
|
||||||
|
|
||||||
|
@ -605,6 +584,7 @@ onMounted(() => {
|
||||||
margin-bottom: 0.32407rem;
|
margin-bottom: 0.32407rem;
|
||||||
width: 6rem;
|
width: 6rem;
|
||||||
border: none;
|
border: none;
|
||||||
|
margin-top:20px;
|
||||||
}
|
}
|
||||||
.agreement-view {
|
.agreement-view {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
@ -206,19 +206,6 @@ const phoneBlur = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const getUrlParam = () => {
|
|
||||||
let url = document.location.toString();
|
|
||||||
let arrObj = url.split("?");
|
|
||||||
let params = Object.create(null);
|
|
||||||
if (arrObj.length > 1) {
|
|
||||||
arrObj = arrObj[1].split("&");
|
|
||||||
arrObj.forEach((item) => {
|
|
||||||
item = item.split("=");
|
|
||||||
params[item[0]] = item[1];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return params;
|
|
||||||
};
|
|
||||||
//跳转看agree等
|
//跳转看agree等
|
||||||
const toAgreePages = (types) => {
|
const toAgreePages = (types) => {
|
||||||
let typesparmes = types === "hdRule" ? 1 : types === "ysRule" ? 2 : 3;
|
let typesparmes = types === "hdRule" ? 1 : types === "ysRule" ? 2 : 3;
|
||||||
|
@ -239,7 +226,7 @@ const toAgreePages = (types) => {
|
||||||
$router.push(`/agree?promotionId=${promotionId.value}&type=${typesparmes}`);
|
$router.push(`/agree?promotionId=${promotionId.value}&type=${typesparmes}`);
|
||||||
};
|
};
|
||||||
const shouye = () => {
|
const shouye = () => {
|
||||||
let param = getUrlParam();
|
let param=route.query
|
||||||
resourceInfo({promotionCode:promotionCode.value,...param})
|
resourceInfo({promotionCode:promotionCode.value,...param})
|
||||||
.then((resp) => {
|
.then((resp) => {
|
||||||
if (resp.data.code == "S00000") {
|
if (resp.data.code == "S00000") {
|
||||||
|
|
Loading…
Reference in New Issue