Compare commits

...

2 Commits

Author SHA1 Message Date
huangzhen d540f88939 update @直充 商品替换模版、openid+号 2024-10-14 09:04:57 +08:00
huangzhen 7979dcf578 update @开启console 2024-10-12 09:18:15 +08:00
9 changed files with 69 additions and 41 deletions

View File

@ -16,9 +16,9 @@
<div id="captcha-element"></div>
<div id="captcha-button"></div>
<!-- 仅开发/测试使用 -->
<!-- <script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
<script>
var vConsole = new window.VConsole();
</script> -->
</script>
</body>
</html>

View File

@ -1,6 +1,22 @@
import { isObject } from "@/utils/index";
import { showConfirmDialog } from "vant";
import Cap from "@/utils/aliyunCaptcha";
/**
* +
* @param {*} url
* @returns {*}
*/
export function getQueryParams(url?: string): any {
const params: any = {};
const queryString = url ? url.split('?')[1] : window.location.search.slice(1);
if (queryString) {
queryString.split('&').forEach((pair) => {
const [key, value] = pair.split('=');
params[decodeURIComponent(key)] = decodeURIComponent(value || '');
});
}
return params;
}
/**
*

View File

@ -7,6 +7,7 @@
<script lang="ts">
import { LOGIN } from "@/router/api";
import { wxAuthUrl } from "@/utils/datas";
import { getQueryParams } from "@/utils/methods";
export default {
name: 'home',
@ -15,7 +16,7 @@ export default {
key: this.$route.query.key || localStorage.getItem("key") || '',
loginBack: this.$route.query.loginBack,
// jumpPath: this.$route.query.jumpPath,
openid: this.$route.query.openid || localStorage.getItem("openid") || '', // id
openid: getQueryParams().openid || localStorage.getItem("openid") || '', // id
isAutoEmpower: true,
loadingText: '加载中',
dialogType: '',

View File

@ -130,7 +130,7 @@
import { QUERY, EXCHANGE, ORDER_QUERY, GET_SMS } from "@/router/api";
import { btnHighLight, btnMap, btnPoll, pollTimeNum, successCode } from "@/utils/datas";
import { channelJudge } from "@/utils/empower";
import { phoneRegex, startsWith, urlToLocal } from "@/utils/methods";
import { getQueryParams, phoneRegex, startsWith, urlToLocal } from "@/utils/methods";
export default {
name: 'comProduct',
@ -138,7 +138,7 @@ export default {
data() {
return {
key: this.$route.query.key || localStorage.getItem("key"),
openid: this.$route.query.openid || localStorage.getItem("openid"), // id
openid: getQueryParams().openid || localStorage.getItem("openid"), // id
alipayuserid: this.$route.query.alipayuserid || localStorage.getItem("alipayuserid"), // id
groupId: Number(this.$route.query.group_id),
ids: JSON.parse(this.$route.query.ids || '[]'),

View File

@ -16,7 +16,7 @@
</p>
</template>
<template v-else>
<p v-if="[3].includes(orderData.status)" class="cardNo">
<p v-if="[3].includes(orderData.status) && orderData.card_no" class="cardNo">
卡号{{ orderData.card_no }}
<img @click="copyFunc(orderData.card_no)" class="copyIcon" v-if="orderData.card_no" :src="require('./img/copy.png')" alt="">
</p>
@ -29,7 +29,7 @@
<img class="bottomCard" :src="require('./img/bottomCard.png')" alt="">
</div>
<div v-if="orderData.status < 3" class="btn refresh" @click="refresh">刷新</div>
<div v-if="(proType === 2) && [3].includes(orderData.status)" class="btn refresh" @click="look(orderData.card_pass)">查看卡密</div>
<div v-if="(proType === 2) && [3].includes(orderData.status) && orderData.card_pass" class="btn refresh" @click="look(orderData.card_pass)">查看卡密</div>
<div v-if="orderData.status > 3" class="btn error" @click="toHome">重新兑换</div>
</div>
<!-- 遮罩 loading -->
@ -58,7 +58,7 @@ export default {
proType: 1, // 1 2
orderData: {
status: 1 // 1 2 3 4 5 6
},
} as any,
dialogType: '',
dialogTitle: '',
@ -83,6 +83,10 @@ export default {
this.loadingStatus = false;
this.orderData = { ...res.data };
this.proType = res.data.order_type;
//
if ([3].includes(res.data.status) && !res.data.card_pass) {
showToast('卡密已发送短信,请注意查收');
}
} else {
showToast(res?.message || '请求失败');
}
@ -93,7 +97,7 @@ export default {
showToast('刷新成功');
},
look(pass: any) {
if (pass) { // 4
// 4
const num = pass.length > 10 ? 4 : 2, self = this;
const passTM = pass.split('').map((item: any, index: number, arr: any) =>
{
@ -111,10 +115,9 @@ export default {
.then(() => {
self.copyFunc(pass);
})
.catch(() => {})
} else { //
showToast('卡密已发送短信,请注意查收');
}
.catch((err) => {
console.log(err)
})
},
copyFunc(item: any) {
copyFn(item);

View File

@ -81,7 +81,7 @@ import "./index.scss";
import { DETAIL_QUERY, EXCHANGE, ORDER_QUERY } from "@/router/api";
import { btnMap, btnHighLight, btnPoll, pollTimeNum } from "@/utils/datas";
import { channelJudge } from "@/utils/empower";
import { phoneRegex, receiveAgain, startsWith, urlToLocal } from "@/utils/methods";
import { getQueryParams, phoneRegex, receiveAgain, startsWith, urlToLocal } from "@/utils/methods";
export default {
name: "cmsCash",
@ -89,7 +89,7 @@ export default {
data() {
return {
key: this.$route.query.key || localStorage.getItem("key"),
openid: this.$route.query.openid || localStorage.getItem("openid"), // id
openid: getQueryParams().openid || localStorage.getItem("openid"), // id
alipayuserid: this.$route.query.alipayuserid || localStorage.getItem("alipayuserid"), // id
goodId: Number(this.$route.query.id),
goods: {}, //

View File

@ -50,14 +50,22 @@
}}
</div>
</div>
<img v-if="cssData.activityDescType === 1 && cssData.bottomImg.length" class="bottomImg" :src="cssData.bottomImg[0].url" alt="">
<!-- 优先使用 直充商品 创建配置 -->
<template v-if="pageData && pageData.degital.instruction">
<div class="description-3" v-html="pageData.degital.instruction" />
</template>
<template v-else>
<img v-if="cssData.activityDescType === 2 && cssData.floatImg" @click="changePopComStatus" class="floatImg" :src="cssData.floatImg" alt="">
<div v-if="cssData.activityDescType === 3 && cssData.floatText" class="description-3" v-html="cssData.floatText" />
</template>
<img v-if="pageData && pageData.degital.detail_url" class="bottomImg" :src="pageData.degital.detail_url" alt="">
<template v-else>
<img v-if="cssData.activityDescType === 1 && cssData.bottomImg.length" class="bottomImg" :src="cssData.bottomImg[0].url" alt="">
</template>
<div v-if="popComStatus" class="popWrapper">
<img @click="changePopComStatus" class="backImg" src="https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/backprepageBtn.png" alt="">
<p class="title">活动说明</p>
<div v-if="cssData.floatText" class="description-2" v-html="cssData.floatText"></div>
<div v-if="cssData.floatText" class="description-2" v-html="pageData.degital.instruction || cssData.floatText"></div>
</div>
</div>
<!-- 遮罩 loading -->
@ -96,7 +104,7 @@ export default {
return {
key: this.$route.query.key || localStorage.getItem("key"),
goodId: Number(this.$route.query.id),
pageData: null,
pageData: null as any,
inputVal: '',
inputSms: '',
inputValAgain: '',

View File

@ -98,7 +98,7 @@ import { Swiper, SwiperSlide } from 'vue-awesome-swiper';
// import { Pagination, Autoplay } from 'swiper';
import 'swiper/swiper-bundle.css';
import { iconMap, btnHighLight, btnMap, btnPoll } from "@/utils/datas";
import { startsWith } from "@/utils/methods";
import { getQueryParams, startsWith } from "@/utils/methods";
export default {
name: 'cmsList',
@ -156,7 +156,7 @@ export default {
},
created() {
if (this.$props.comType === 1) {
const openid = this.$route.query.openid;
const openid = getQueryParams().openid;
if (openid) {
localStorage.setItem('openid', openid || '');
}

View File

@ -58,7 +58,7 @@ import "./index.scss";
import { DETAIL_QUERY, EXCHANGE, ORDER_QUERY } from "@/router/api";
import { btnMap, btnHighLight, btnPoll, pollTimeNum } from "@/utils/datas";
import { channelJudge } from "@/utils/empower";
import { startsWith, urlToLocal, receiveAgain } from "@/utils/methods";
import { startsWith, urlToLocal, receiveAgain, getQueryParams } from "@/utils/methods";
export default {
name: "cmsVoucher",
@ -66,7 +66,7 @@ export default {
data() {
return {
key: this.$route.query.key || localStorage.getItem("key"),
openid: this.$route.query.openid || localStorage.getItem("openid"), // id
openid: getQueryParams().openid || localStorage.getItem("openid"), // id
alipayuserid: this.$route.query.alipayuserid || localStorage.getItem("alipayuserid"), // id
goodId: Number(this.$route.query.id),
goods: {}, //