feat:同步近期的修改:优酷&支付宝小程序&免费模式测试等

This commit is contained in:
wwxin 2024-09-05 17:02:28 +08:00
parent f51d8e47c5
commit bfb211a471
5 changed files with 167 additions and 78 deletions

View File

@ -2,7 +2,7 @@
* @Author: wwxin 2463926940@qq.com
* @Date: 2024-06-20 15:11:40
* @LastEditors: wwxin 2463926940@qq.com
* @LastEditTime: 2024-08-21 10:44:41
* @LastEditTime: 2024-09-05 15:12:55
* @FilePath: /vip-server-new/src/api/urls.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@ -80,10 +80,21 @@ export function getCodeCheck(data) {
}
//发送验证吗
export function sendCode(params) {
export function sendCode(data) {
return request({
url: `/api/mobile/code/${params.mobile}`,
url: `/api/mobile/code/${data.mobile}`,
method: 'post',
params,
data,
});
}
//支付宝模式-传递下游参数
export function saveQueryData(data) {
return request({
url: `/api/mo/saveQueryData`,
method: 'post',
data
});
}

View File

@ -2,20 +2,15 @@
* @Author: wwxin 2463926940@qq.com
* @Date: 2023-08-29 14:22:42
* @LastEditors: wwxin 2463926940@qq.com
* @LastEditTime: 2024-07-25 10:09:39
* @LastEditTime: 2024-09-05 15:35:29
* @FilePath: /vip-server-new/src/utils/tools.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
export function isMobile(value) {
return /^1[3|4|5|6|7|8|9][0-9]\d{8}$/.test(value);
}
export function isIOS() {
return /iPhone|iPad|iPod/i.test(navigator.userAgent);
}
export const showTel = () => {
const telArr = getRandomTel();
@ -28,7 +23,6 @@ export const showTel = () => {
"已领取饿了么月卡会员",
"已领取QQ绿钻月卡会员"
];
return telArr.map((tel, index) => `${tel} ${membershipTypes[index % 7]}`);
};
//联合的

View File

@ -2,7 +2,7 @@
* @Author: wwxin 2463926940@qq.com
* @Date: 2024-07-03 13:47:13
* @LastEditors: wwxin 2463926940@qq.com
* @LastEditTime: 2024-07-24 14:01:42
* @LastEditTime: 2024-09-05 13:58:16
* @FilePath: /a-vue3 2/src/views/promotion/agree.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@ -13,7 +13,7 @@
<div class="back" @click="$router.go(-1)">返回</div>
<div class="nav-title">{{ titleText }}</div>
</div>
<div v-html="textcontent">
<div v-html="textcontent" class="content-box" >
</div>
</div>
@ -86,5 +86,8 @@ cursor: pointer;
font-size: 16px;
}
}
.content-box{
padding: 10px 20px;
}
</style>

View File

@ -13,7 +13,7 @@
</van-notice-bar>
</div>
<div class="transaction-view" ref="myTransactionView">
<div class="ipt-view">
<div class="ipt-view" v-if="!isJumpMini">
<input
placeholder="请输入手机号码"
type="tel"
@ -34,6 +34,17 @@
<div class="view">
<van-checkbox v-model="isCheck" checked-color="red"
>我已阅读并同意
<a
v-if="agreementThree == 1"
class="agreement"
@click="toAgreePages('hyService')"
id="hy"
>
{{
unionType == 2 ? "《优酷系列会员服务协议》" : "《会员服务协议》"
}}
</a>
<a
v-if="agreementTwo == 1"
class="agreement"
@ -41,24 +52,20 @@
@click="toAgreePages('ysRule')"
>隐私政策</a
>
<a
v-if="agreementThree == 1"
class="agreement"
@click="toAgreePages('hyService')"
id="hy"
>会员服务协议</a
>
<a
v-if="agreementFour == 1"
class="agreement"
id="hd"
@click="toAgreePages('zdxfService')"
>自动续费协议</a
>并同意购买自动续费商品
<span v-if="promotionCode != 'RZpJsF'"
>{{ accTxt }}业务资费:<a>{{ price }}</a
>/{{ priceTxt }}</span
>
<div v-if="unionType == 1">
及其
<a
v-if="agreementFour == 1"
class="agreement"
id="hd"
@click="toAgreePages('zdxfService')"
>自动续费协议</a
>并同意购买自动续费商品
<span
>{{ accTxt }}业务资费:<a>{{ price }}</a
>/{{ priceTxt }}</span
>
</div>
</van-checkbox>
</div>
<div v-if="promotionCode == 'RZpJsF'">首月19.9元次月29.9元</div>
@ -66,7 +73,7 @@
</div>
<img :src="img3" v-if="img3" class="item" />
<div class="rule-content">
<img :src="img4" class="rule-info" />
<img :src="img4" class="rule-info" />
</div>
</div>
<van-overlay :show="overlayShow">
@ -103,7 +110,7 @@
id="hd"
@click="toAgreePages('zdxfService')"
>自动续费协议</a
>并同意购买自动续费商品
>
</div>
</div>
<div class="btn-list">
@ -147,8 +154,10 @@ import {
resourceAreaDj,
resourceAreaAv,
creatUnion,
getCodeCheck,
sendCode
getCodeCheck,
sendCode,
resourceAgree,
saveQueryData,
} from "@/api/urls";
import md5 from "js-md5";
import { useRouter, useRoute } from "vue-router";
@ -184,16 +193,19 @@ let coverBtnImgUrl = ref("");
let traceId = $ref("");
let unionType = ref("");
let promotionId = ref("");
//
let isJumpMini = ref(false);
let isJumpH5 = ref("");
let miniAplaiayId = ref("");
//
let isFreeGiftMode = ref("false");
//url
let agreementIsUrl = ref("false");
const route = useRoute();
onMounted(() => {
promotionCode.value = getQueryParam("promotionCode");
if (promotionCode.value != "RZpJsF") {
ntext.value = showlhTel();
} else {
showNoticeBar.value = false;
}
ntext.value = showlhTel();
maidian();
});
const phoneBlur = () => {
@ -230,6 +242,9 @@ const handleAgree = (type) => {
};
//agree
const toAgreePages = (types) => {
if (agreementIsUrl.value && types === "hyService") {
return getYoukuAgreement(promotionId.value);
}
let typesparmes =
types === "hdRule"
? 1
@ -240,6 +255,18 @@ const toAgreePages = (types) => {
: 4;
$router.push(`/agree?promotionId=${promotionId.value}&type=${typesparmes}`);
};
//-
const getYoukuAgreement = (id) => {
let typesparmes = 3;
let promotionId = id;
resourceAgree({ promotionId, typesparmes }).then((resp) => {
if (resp.data.code == "S00000") {
if (resp.data.result) {
window.location.href = resp.data.result;
}
}
});
};
//ip
const handleSubmitCode = () => {
getCodeCheck({ mobile: mobile.value, code: smsCode.value }).then((resp) => {
@ -252,7 +279,44 @@ const handleSubmitCode = () => {
}
});
};
//
const toApliayMini = (appid) => {
let ua = navigator.userAgent.toLowerCase();
let pageParams = `pages/prompp/index?promotionType=2&promotionCode=${promotionCode.value}&miniAplaiayId=${miniAplaiayId.value}`;
let urls =
`https://ulink.alipay.com/?scheme=` +
encodeURIComponent(
`alipays://platformapi/startapp?appId=${appid}&page=${encodeURIComponent(
pageParams
)}&query=${encodeURIComponent(
`promotionType=2&promotionCode=${promotionCode.value}&miniAplaiayId=${miniAplaiayId.value}`
)}`
);
if (ua.match(/MicroMessenger/i) == "micromessenger") {
if (!isIOS()) {
var link = document.createElement("a");
link.href = `${
location.protocol + "//" + location.host
}/static/uproWechatUrl.txt?promotionCode=${promotionCode.value}&isApliayMini=true&appId=${appid}&miniAplaiayId=${miniAplaiayId.value}`;
link.textContent = "";
link.download = "11";
document.body.appendChild(link);
link.click();
return;
} else {
window.location.href = urls;
return;
}
} else {
let scheme = `alipays://platformapi/startapp?appId=${appid}&page=${encodeURIComponent(
pageParams
)}&query=${encodeURIComponent(
`promotionType=2&promotionCode=${promotionCode.value}&miniAplaiayId=${miniAplaiayId.value}`
)}`;
window.location.href = scheme;
return;
}
};
const shouye = () => {
resourceInfo({ promotionCode: promotionCode.value }).then((resp) => {
if (resp.data.code == "S00000") {
@ -265,7 +329,6 @@ const shouye = () => {
img3.value = result.imgTwo ? cdnBaseUrl + result.imgTwo : "";
img4.value = cdnBaseUrl + result.imgThree;
coverBtnImgUrl.value = cdnBaseUrl + result.imgXxBtn;
//
payMethod.value = result.payMethod || "0";
price.value = result.price;
@ -278,22 +341,32 @@ const shouye = () => {
agreementThree.value = result.agreementThree;
agreementFour.value = result.agreementFour;
promotionId.value = result.promotionId;
//
isFreeGiftMode.value = result.isFreeGiftMode
//callbackUrl tammy
if (result.callbackUrl.toLowerCase() === "tammy") {
const script = document.createElement("script");
script.src = "https://openapp.yytese.com/tongji.js";
document.head.appendChild(script);
}
//线
agreementIsUrl.value = result.agreementIsUrl;
//
isFreeGiftMode.value = result.isFreeGiftMode;
//广-
unionType.value = result.unionType;
if (result.periodPayDays) {
priceTxt.value = `${result.periodPayDays}`;
}
accTxt.value = result.agreementTxt;
if (
promotionCode.value == "afSKPj" ||
promotionCode.value == "MadlRh" ||
promotionCode.value == "oVkHuA"
) {
accTxt.value = "VIP";
//
isJumpMini.value = result.isJumpMini;
isJumpH5.value = result.isJumpH5;
if (result.isJumpMini) {
let xiayous = { queryData: window.location.search.substring(1) };
saveQueryData({ data: xiayous }).then((res) => {
miniAplaiayId.value = res.data.result;
toApliayMini(result.isJumpH5);
});
}
accTxt.value = result.agreementTxt;
if (route.query.phnumber) {
const mobile1 = getQueryParam("phnumber");
if (isMobile(mobile1) && autoSelect.value == "1") {
@ -321,9 +394,19 @@ const maidian = () => {
};
//
const getQueryParam = (variable = "") => {
if (variable === "allParmes") {
// `?`
return window.location.search.substring(1);
}
return route.query[variable] || "";
};
const submitOrder = () => {
//
if (isJumpMini.value) {
toApliayMini(isJumpH5.value);
return;
}
if (isCheck.value) {
submitData();
} else {
@ -351,9 +434,8 @@ const submitData = async () => {
return;
}
let ua = navigator.userAgent.toLowerCase();
let xiayou = getQueryParam("param");
//?广
let xiayou = getQueryParam("allParmes");
let text = `mobile=${mobiles}promotionCode=${promotionCode.value}`;
overlayShow.value = true;
let param = {
@ -361,7 +443,7 @@ const submitData = async () => {
promotionCode: promotionCode.value,
sign: md5(text),
extra: xiayou,
isFreeGiftMode: isFreeGiftMode.value
isFreeGiftMode: isFreeGiftMode.value,
};
resourceAreaDj({ union: 1, promotionCode: promotionCode.value }).then(
(resp) => {}
@ -372,15 +454,15 @@ const submitData = async () => {
let jumpp = resp.data.result.payUrl;
let youkuurl = resp.data.result.jumpUrl;
if (ua.match(/MicroMessenger/i) == "micromessenger") {
// ;
// ;
if (unionType.value == 2) {
window.location.href = youkuurl;
return;
}
//
if (this.isFreeGiftMode) {
return window.location.href = `${youkuurl}&phnumber=${mobiles}`
}
//
if (isFreeGiftMode.value) {
return (window.location.href = `${youkuurl}&phnumber=${mobiles}`);
}
if (payMethod.value == "0") {
jumpp = jumpp.replaceAll(
"https://openapi.alipay.com/gateway.do?",
@ -410,24 +492,23 @@ const submitData = async () => {
window.location.href = youkuurl;
return;
}
if ( isFreeGiftMode.value) {
window.location.href = `${youkuurl}&phnumber=${mobile}`
return
}
if (isFreeGiftMode.value) {
window.location.href = `${youkuurl}&phnumber=${mobile}`;
return;
}
window.location.href = jumpp;
}
getBurialPoint(1100);
} else if (resp.data.code == "103") {
smsCodeShow.value = true
sendCode({mobile:mobile.value}).then(res=>{
if (res.data.code == "S00000") {
showToast("验证码已发送,请注意查收");
} else {
showToast(res.data.message);
}
})
}else {
smsCodeShow.value = true;
sendCode({ mobile: mobile.value }).then((res) => {
if (res.data.code == "S00000") {
showToast("验证码已发送,请注意查收");
} else {
showToast(res.data.message);
}
});
} else {
showToast(resp.data.message);
}
})
@ -461,11 +542,11 @@ const hrefurl = (p, payMethod, ios) => {
var link = document.createElement("a");
link.href = `${
location.protocol + "//" + location.host
}/static/wechatUrls.txt?payMethod=${payMethod}&url=${encodeURIComponent(
}/static/uproWechatUrl.txt?payMethod=${payMethod}&url=${encodeURIComponent(
p
)}&promotionCode=${promotionCode.value}`;
link.textContent = "点击这里下载PDF文件";
link.download = "wechatUrls.txt";
link.download = "uproWechatUrl.txt";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);