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