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-element"></div>
<div id="captcha-button"></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> <script>
var vConsole = new window.VConsole(); var vConsole = new window.VConsole();
</script> --> </script>
</body> </body>
</html> </html>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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