Compare commits

..

No commits in common. "c8d1d09279ef50378b995caa9cc80bf7ff97009e" and "d93ea66c24cda23622562c42a2fda711caf80d0e" have entirely different histories.

9 changed files with 270 additions and 133 deletions

View File

@ -8,7 +8,7 @@ import {
const routePublic = [
{
path: "/",
redirect: "/home?key=RRNh8MJovInMq/RaPpjkpsL4CWwX13o7Fuerg/xLhwg="
redirect: "/home?key=pGp/5HxvwkTcO2ubI72WTBSw7uhGqjFwWgLEcczRgag="
},
{
// 首页(中转处理逻辑)

View File

@ -9,7 +9,7 @@ export default {
return {
key: this.$route.query.key,
jumpPath: this.$route.query.jumpPath,
wxAuthUrl: 'https://utils.85938.cn/utils/v1/wechat/oauth/bale',
wxAuthUrl: 'https://openapi.1688sup.com/wechat/oauth',
isAutoEmpower: true,
loadingText: '加载中',
}

View File

@ -90,7 +90,7 @@ export default {
overlayLoad: false, // loading
isWx: navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1,
wxAuthUrl: 'https://utils.85938.cn/utils/v1/wechat/oauth/bale',
wxAuthUrl: 'https://openapi.1688sup.com/wechat/oauth',
zfbAuthUrl: 'https://openapi.1688sup.com/alipay/oauth',
key: this.$route.query.key || localStorage.getItem("key"),

View File

@ -76,21 +76,20 @@
.form {
display: flex;
flex-direction: column;
margin-top: 20px;
.f-input {
border: 0;
outline: 0;
height: 42px;
border-radius: 100px;
padding-left: 30px;
padding-right: 30px;
padding: 0 16px;
box-sizing: border-box;
margin-bottom: 14px;
font-size: 14px;
font-size: 16px;
}
.f-note {
color: #FFFFFF;
font-size: 12px;
text-align: center;
}
.inputBt {
margin: 20px auto 20px;

View File

@ -13,15 +13,17 @@
{{ cash.denomination || 0 }}
</span>
</p>
<p class="type">
<span>XX红包</span>
</p>
<div v-if="!needInput" class="bt" @click="receive">立即领取</div>
<!-- <p class="type">
<span>固额红包</span>
</p> -->
<div v-if="!needInput" class="bt" @click="receive">
立即领取
</div>
</div>
<div v-if="needInput" class="form">
<van-field class="f-input" v-model="inputVal" label="账号" :placeholder="`请输入${getInputText}账号`" />
<van-field class="f-input" v-model="inputValAgain" label="再次输入" placeholder="请再次输入" />
<p class="f-note">您可在{{ getInputText }}的个人信息中查看{{ getInputText }}账号</p>
<input type="text" placeholder="请输入真实姓名" class="f-input" v-model="inputVal" maxlength="100">
<input type="text" placeholder="请输入支付宝账号" class="f-input" v-model="inputValAgain">
<p class="f-note">您可在支付宝的个人信息中查看支付宝账号</p>
<div class="bt inputBt" @click="receive">
立即领取
</div>
@ -31,11 +33,15 @@
<div class="instruction">
<div class="instruction-1">
<p class="center">
<img class="notice" src="https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/common_title_notice.png" alt="" />
<img
class="notice"
src="https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/common_title_notice.png"
alt=""
/>
</p>
<div>
<h3 class="instruction-text">使用规则</h3>
<p class="scroll" v-html="'待补充规则'"></p>
<p class="scroll" v-html="cash.instruction"></p>
</div>
</div>
</div>
@ -62,7 +68,7 @@ export default {
overlayLoad: false, // loading
isWx: navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1,
wxAuthUrl: 'https://utils.85938.cn/utils/v1/wechat/oauth/bale',
wxAuthUrl: 'https://openapi.1688sup.com/wechat/oauth',
zfbAuthUrl: 'https://openapi.1688sup.com/alipay/oauth',
key: this.$route.query.key || localStorage.getItem("key"),
@ -72,7 +78,6 @@ export default {
bgDefault: 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/common_img_main_1.png',
bgInput: 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/zfb-red-banner.png',
goodId: Number(this.$route.query.id),
goods: {}, //
cash: {}, //
inputVal: '',
@ -90,28 +95,18 @@ export default {
return true;
}
return false;
},
getInputText() {
if (this.cash.channel === 1) { // -
return '支付宝';
} else { //
return '云闪付';
}
}
},
methods: {
async getData() {
this.loadingStatus = true;
if (!this.goodId) return showToast('商品ID不能为空');
const { code, data, message } = await DETAIL_QUERY({ key: this.key, id: this.goodId }) || {};
const id = this.$route.query.id;
if (!id) return showToast('商品ID不能为空');
const { code, data, message } = await DETAIL_QUERY({ key: this.key, id: id }) || {};
if (code === 200) {
Object.assign(this.goods, data.goods);
Object.assign(this.cash, data.cash, {
// todo
channel: 2,
receive_mode: 2,
end_time: '2024-9-30',
denomination: '78.00',
});
} else {
showToast(message || '请求失败');
@ -122,7 +117,7 @@ export default {
if (this.goods.err_code) {
return showToast(this.goods.reson || '商品异常');
}
let account = '';
let account = '默认';
if (this.needInput) { // - +
if (!this.inputVal) {
return showToast('请输入账号');
@ -147,9 +142,9 @@ export default {
this.overlayLoad = true;
const res = await EXCHANGE({
key: this.key,
id: [this.goodId],
account: account || '默认',
name: '默认',
id: [Number(this.$route.query.id)],
account: account,
name: 'name',
});
if (res && res.code === 200 && res.data) {
if (res.data[0].code === 200) {
@ -168,7 +163,7 @@ export default {
// mode 1 2 1 2 3
const channel = this.cash.channel, mode = this.cash.receive_mode;
if (channel === 1 && mode === 1) { // -
const backLink = encodeURIComponent(`${location.origin}/yxh5/cmsVoucher?key=${localStorage.getItem('key')}&id=${this.goodId}`);
const backLink = encodeURIComponent(`${location.origin}/yxh5/cmsVoucher?key=${localStorage.getItem('key')}&id=${this.$route.query.id}`);
const url = `${this.zfbAuthUrl}?jump=${backLink}`;
//
const ua = navigator.userAgent.toLowerCase();
@ -180,7 +175,7 @@ export default {
.then(() => {
this.copyFn(url);
})
.catch(() => {})
.catch(() => ({}))
} else {
//
location.replace(url);
@ -188,7 +183,7 @@ export default {
} else if (channel === 2) { //
if (!this.isWx) { //
if (mode === 2) { //
const backLink = encodeURIComponent(`${location.origin}/yxh5/cmsVoucher?key=${localStorage.getItem('key')}&id=${this.goodId}`);
const backLink = encodeURIComponent(`${location.origin}/yxh5/cmsVoucher?key=${localStorage.getItem('key')}&id=${this.$route.query.id}`);
const url = `${this.wxAuthUrl}?jump=${backLink}`;
showConfirmDialog({
confirmButtonText: '复制',
@ -197,7 +192,7 @@ export default {
.then(() => {
this.copyFn(url);
})
.catch(() => {})
.catch(() => ({}))
} else { // +
// todo
location.replace('https://www.baidu.com/')
@ -218,7 +213,7 @@ export default {
//
async orderPolling() {
const that = this;
const params = [{ key: this.key, goods_id: this.goodId }];
const params = [{ key: this.key, goods_id: Number(this.$route.query.id) }];
const res = await ORDER_QUERY({ query: params });
if (res && res.code === 200 && res.data.length) {
if (res.data[0].status === 2) {

View File

@ -11,7 +11,7 @@
</div>
<p class="line"/>
<img class="defaultInputImg" v-if="!pageData" :src="cssData.defaultInputImg" alt="">
<div v-if="pageData && needInput" class="inputBox">
<div v-if="pageData && !((pageData.degital.product_type === 2) && (pageData.degital.card_show === 2))" class="inputBox">
<van-cell-group inset>
<van-field v-model="inputVal" label="账号" placeholder="请输入手机号" />
<van-field
@ -35,7 +35,7 @@
:class="['detailBtn', pageData && pageData.goods.err_code && 'btnPlacingAshes']"
:style="{ color: cssData.btnColor, backgroundColor: cssData.btnBgc }"
>
{{ pageData && btnMap.get(String(pageData.goods.err_code)) ? btnMap.get(String(pageData.goods.err_code)) : '立即兑换' }}
{{ pageData && pageData.goods.err_code ? 'code文案' : '立即兑换' }}
</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="">
@ -59,7 +59,6 @@
import "./index.scss";
import config from "./config";
import { DETAIL_QUERY, GET_THEME, EXCHANGE, ORDER_QUERY } from "@/router/api";
import { phoneRegex } from "@/utils";
export default {
name: 'cmsDetail',
@ -80,18 +79,17 @@ export default {
loadingStatus: false, // loading
overlayLoad: false, // loading
key: this.$route.query.key || localStorage.getItem("key"),
// token: this.$route.query.token || localStorage.getItem("key"),
goodId: Number(this.$route.query.id),
pageData: null,
cssData: {
btnColor: 'rgb(255, 255, 255)',
btnBgc: 'rgb(250, 205, 106)',
activityDescType: 1, //1 2 3
bottomImg: [] as Array<any>,
floatImg: 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/acticeTextTip.png',
floatText: '',
//
//
carouselImg: 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/detailtop.png',
defaultInputImg: 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/74A757EF-F86A-4006-8259-AAE60119C9A8.png',
},
@ -103,12 +101,11 @@ export default {
codeStatus: false,
inputValAgain: '',
popComStatus: false,
btnMap: new Map([ // todo
testMap: new Map([ // todo code btn
['1', '即将开始'],
['2', '已兑换'],
['3', '已兑完'],
['4', '已过期'],
['5', '领取中'],
]),
}
},
@ -119,12 +116,6 @@ export default {
this.$emit('getDefault', config);
}
},
computed: {
needInput() {
// (-)
return !((this.pageData.degital.product_type === 2) && (this.pageData.degital.card_show === 2)) || (this.pageData.degital.check_sms_code === 1);
}
},
watch: {
formData: {
handler(newVal: any) {
@ -144,15 +135,18 @@ export default {
},
async getData() {
this.loadingStatus = true;
if (!this.goodId) return showToast('商品ID不能为空');
const res = await DETAIL_QUERY({ key: this.key, id: this.goodId });
const id = this.$route.query.id;
if (!id) return showToast('商品ID不能为空');
const res = await DETAIL_QUERY({ key: this.key, id: id });
if (res && res.code === 200) {
if (res.data) {
this.pageData = { ...res.data };
console.log('---接口详情数据---', this.pageData);
const list = [res.data.degital.describe_url, res.data.degital.detail_url, res.data.degital.show_url]
this.imgList = [ ...list.filter(Boolean) ];
await this.getCss(res.data.goods.theme_goods_detail_id);
if (this.pageData.goods.err_code === 5) { // todo
if (this.pageData.goods.listStatus === 1) {
//
this.overlayLoad = true;
await this.orderPolling();
}
@ -166,6 +160,7 @@ export default {
async getCss(themeId: number | string) {
const res = await GET_THEME({ id: themeId });
if (res && res.code === 200) {
console.log('---详情模版数据---', JSON.parse(res.data.config));
this.cssData = {
...this.cssData,
...JSON.parse(res.data.config)
@ -176,17 +171,11 @@ export default {
}
},
sendCode() {
if (!this.inputVal) {
return showToast('请输入手机号');
} else if (!phoneRegex.test(this.inputVal)) {
return showToast('手机号格式不正确');
}
// todo
showToast('暂无短信接口');
if (this.codeStatus) return;
const self = this;
self.codeNum = 60;
this.codeStatus = true;
showToast('暂无接口');
self.codeTime = setInterval(() => {
self.codeNum--;
if (self.codeNum < 0) {
@ -197,19 +186,16 @@ export default {
}, 1000)
},
async receive() {
if (this.pageData.goods.err_code) {
return showToast(this.pageData.goods.reson || '商品异常');
if (this.pageData.goods.err_code && this.pageData.goods.reson) {
return showToast(this.pageData.goods.reson);
}
let account = '';
// (-)
if (this.needInput) {
let account = 'account';
// - +
if (!((this.pageData.degital.product_type === 2) && (this.pageData.degital.card_show === 2)) || (this.pageData.degital.check_sms_code === 1)) {
if (!this.inputVal) {
return showToast('请输入账号');
} else {
if (this.pageData.degital.check_sms_code === 1) {
if (!phoneRegex.test(this.inputVal)) {
return showToast('手机号格式不正确');
}
if (!this.inputSms) {
return showToast('请输入验证码');
}
@ -226,9 +212,9 @@ export default {
this.overlayLoad = true;
const res = await EXCHANGE({
key: this.key,
id: [this.goodId],
account: account || '默认',
name: '默认',
id: [Number(this.$route.query.id)],
account: account,
name: 'name',
});
if (res && res.code === 200 && res.data) {
if (res.data[0].code === 200) {
@ -243,7 +229,7 @@ export default {
},
async orderPolling () {
const that = this;
const params = [{ key: this.key, goods_id: this.goodId }];
const params = [{ key: this.key, goods_id: Number(this.$route.query.id) }];
const res = await ORDER_QUERY({ query: params });
if (res && res.code === 200 && res.data.length) {
if (res.data[0].status === 2) {

View File

@ -117,14 +117,13 @@ export default {
floatImg: 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/acticeTextTip.png',
floatText: '',
//
carouselImg: 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/swiper.png',
defaultList: [1, 2, 3, 4, 5],
defaultListImg: 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/uploads/2024-08-20/A89BB503-00DC-456e-B757-CA04ADFA9C06.png',
defaultMatrix: [1, 2, 3, 4, 5, 6],
defaultMatrixImg: 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/uploads/2024-08-20/0338CC5C-D9FD-4f9d-B65C-DCAB50F2FAA7.png',
},
iconMap: new Map([ // todo
iconMap: new Map([ // todo code icon
['1', 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/jijiangkaishi.png'], //
['2', 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/yiduihuan.png'], //
['3', 'https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/yiduiwan.png'], //
@ -137,7 +136,7 @@ export default {
if (this.$props.comType === 1) {
const openid = this.$route.query.openid;
if (openid) {
localStorage.setItem('openid', openid || '');
localStorage.setItem('openid', openid);
}
this.getData()
} else {
@ -170,8 +169,8 @@ export default {
const changeData = this.changeData(res.data);
const errCode = changeData[0].goods.err_code;
const reson = changeData[0].goods.reson;
if (this.startsWith(String(errCode), ['10', '11'])) { // 10XXX key 11XXX 12XXX
return showToast(reson || '活动异常');
if (this.startsWith(String(errCode), ['10', '11']) && reson) { // 10XXX key 11XXX 12XXX
return showToast(reson);
}
//
if (changeData.length === 1) {
@ -180,13 +179,15 @@ export default {
sessionStorage.removeItem('jumpPath')
this.$router.push(this.jumpPath);
} else {
await this.getCss(res.data[0].theme_list_id, changeData);
this.pageData = [ ...changeData, ...changeData ]; //
this.initialSlide = changeData.length;
await this.getCss(res.data[0].theme_list_id);
}
} else {
showToast('商品数据为空');
}
} else {
showToast(res?.message || '请求失败');
showToast(res?.message || '接口请求失败');
}
},
changeData(data: Array<any>) {
@ -213,18 +214,16 @@ export default {
const regex = new RegExp('^(' + prefixes.join('|') + ')');
return regex.test(str);
},
async getCss(id: number | string, changeData: Array<any>) {
async getCss(id: number | string) {
const res = await GET_THEME({ id: id });
if (res && res.code === 200) {
this.cssData = {
...this.cssData,
...JSON.parse(res.data.config)
};
this.pageData = this.cssData.contentType === 1 ? [ ...changeData, ...changeData ] : [ ...changeData ]; //
this.initialSlide = changeData.length;
this.loadingStatus = false;
} else {
showToast(res?.message || '请求失败');
showToast(res?.message || '接口请求失败');
}
},
onSlideChange(swiper: any) {

View File

@ -1,4 +1,5 @@
#reduce {
// height: 6rem !important;
background: #f4f6f9;
overflow-y: auto;
display: flex;
@ -111,20 +112,12 @@
color: #cc9590;
}
.form {
padding: 20px 0 0;
.inputBoxZFB,.inputBoxYSF {
padding: 40px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.f-input {
width: 100%;
}
.f-note {
font-size: 12px;
text-align: center;
margin-top: 20px;
}
}
#reduce .receiveBtn {

View File

@ -1,9 +1,63 @@
<template>
<van-loading v-if="loadingStatus" class="pageNoneLoading_Vant" size="24px" color="#0094ff" vertical>加载中...</van-loading>
<div v-else id="reduce" :style="{ paddingTop: '21px' }">
<!-- 弹出框 -->
<div class="mask" v-if="maskshow"></div>
<!-- 单条弹出框 -->
<!-- <div class="prompt" :class="promtshow ? 'proactive' : ''">
{{ promttip }}
</div> -->
<!-- 弹出提示 -->
<!-- <div
class="popboxshow"
v-if="popboxshow"
:class="popboxshow ? 'active' : ''"
>
<div class="tip">
<p>{{ tiptext }}</p>
<span @click="knowFn">知道了</span>
</div>
</div> -->
<!-- 复制提示 -->
<!-- <div class="popboxshow" v-if="copyshow" :class="copyshow ? 'active' : ''">
<div class="tip">
<p>请点击下方[复制]按钮复制链接到浏览器打开</p>
<span @click="copyFn">复制</span>
</div>
</div> -->
<!-- <div class="countdown" v-if="outTime.length > 0">
<span>链接有效期</span>
<p>{{ outTime[0] }}</p>
<p>{{ outTime[1] }}</p>
<p>{{ outTime[2] }}</p>
</div> -->
<!-- <div
class="mask"
v-if="loading"
ref="load"
@touchmove.prevent
@mousewheel.prevent
>
<preload-component />
</div> -->
<div class="couponShow">
<!-- <span>
<img
@click="backgoodsFn"
v-if="backAble"
class="backIcon"
src="https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/backprepageBtn.png"
alt=""
/>
</span> -->
<div class="coupon-left">
<p class="coupon_money">
<p class="coupon_money" :style="{ fontSize: fonts() }">
<span></span>{{ parseFloat(info.amount || 1) }}
</p>
<p class="full_money">
@ -26,7 +80,7 @@
<p class="validity" v-if="info.time_limit.receive_type">
领取后{{
info.time_limit.receive_type == 0 ? "立即" : "次日凌晨"
}}生效,有效期 {{ info.time_limit.receive_day || '' }}
}}生效,有效期 {{ info.time_limit.receive_day }}
</p>
<p class="validity" v-if="info.time_limit.start_time">
可用时间:{{ info.time_limit.start_time }}-{{
@ -35,12 +89,27 @@
</p>
</div>
</div>
<div v-if="needInput" class="form">
<!-- 支付宝-账号领取 -->
<div v-if="(info.channel === 1) && (info.receive_mode === 2)" class="inputBoxZFB">
<p class="inputTitle">支付宝账号</p>
<van-cell-group inset>
<van-field class="f-input" v-model="inputVal" label="账号" :placeholder="`请输入${getInputText}账号`" />
<van-field class="f-input" v-model="inputValAgain" label="再次输入" placeholder="请再次输入" />
<van-field v-model="inputVal" label="账号" placeholder="请输入支付宝账号" />
<van-field v-model="inputValAgain" label="再次输入" placeholder="请再次输入" />
</van-cell-group>
<p class="f-note">您可在{{ getInputText }}的个人信息中查看{{ getInputText }}账号</p>
<p class="inputTip">
您可在支付宝的个人信息中查看支付宝账号
</p>
</div>
<!-- 云闪付 -->
<div v-if="info.channel === 3" class="inputBoxYSF">
<p class="inputTitle">云闪付账号</p>
<van-cell-group inset>
<van-field v-model="inputVal" label="账号" placeholder="请输入手机号" />
<van-field v-model="inputValAgain" label="再次输入" placeholder="请再次输入" />
</van-cell-group>
<p class="inputTip">
温馨提示单笔交易大于{{ '0' }}元可立减{{ '0' }}
</p>
</div>
<div
class="receiveBtn"
@ -48,12 +117,63 @@
:class="goods.err_code != 0 ? 'readOnly' : ''"
>
立即领取
<!-- {{
goodInfo.available == 9
? buttonTextFun(goodInfo.type, "received")
: buttonTextFun(goodInfo.type, "receive")
}} -->
</div>
<div class="coupon_explain">
<h1>- 兑换说明 -</h1>
<!-- <div class="content">
<h3
v-if="
receive_time.use_time.type == 'week' ||
receive_time.use_time.type == 'irregular'
"
>
可用时间
</h3>
<ul v-if="receive_time.use_time.type == 'week'" class="weekTime">
<li v-for="(item, index) in receive_time.use_time.week" :key="index">
<p>{{ item }}</p>
<div>
<p
v-for="(item2, index2) in receive_time.use_time.time"
:key="index2"
>
{{ item2[0] }}~{{ item2[1] }}
</p>
</div>
</li>
</ul>
<ul v-if="receive_time.use_time.type == 'irregular'">
<li v-for="(item, index) in receive_time.use_time.day" :key="index">
<p>{{ item[0] }}{{ item[1] }}</p>
<div>
<p
v-for="(item2, index2) in receive_time.use_time.time"
:key="index2"
>
{{ item2[0] }}~{{ item2[1] }}
</p>
</div>
</li>
</ul>
</div> -->
<div class="content">
<h3>使用须知</h3>
<p v-html="info.notice" v-if="info.notice"></p>
<p v-else>
1{{
info.channel == 1 ? "支付宝H5" : "微信APP内打开链接"
}}点击一键领取完成领取{{
info.channel == 1 ? "支付宝" : "微信"
}}立减金<br />
2{{
info.channel == 1 ? "支付宝" : "微信"
}}立减金一旦领取不可撤销不可转让注意不要将兑换券泄露给他人
</p>
</div>
<div class="content">
<h3>使用规则</h3>
@ -72,6 +192,8 @@
import "./index.scss";
import { DETAIL_QUERY, EXCHANGE, ORDER_QUERY } from "@/router/api";
let goodsDetail = 0,
goodsCount = 0;
export default {
name: "cmsVoucher",
props: {},
@ -81,7 +203,7 @@ export default {
overlayLoad: false, // loading
isWx: navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1,
wxAuthUrl: 'https://utils.85938.cn/utils/v1/wechat/oauth/bale',
wxAuthUrl: 'https://openapi.1688sup.com/wechat/oauth',
zfbAuthUrl: 'https://openapi.1688sup.com/alipay/oauth',
key: this.$route.query.key || localStorage.getItem("key"),
@ -90,31 +212,22 @@ export default {
alipayuserid: this.$route.query.alipayuserid || localStorage.getItem("alipayuserid"), // id
goods: {}, //
info: {}, //
inputVal: '',
inputValAgain: '',
info: { //
amount: 1, //
full_amount: 1.01, //
send_num: 1, //
card_type: ["1"], //
//
time_limit: {},
},
};
},
created() {
this.getData();
},
computed: {
needInput() {
if ((this.info.channel === 1) && (this.info.receive_mode === 2)) { // -
return true;
} else if (this.info.channel === 3) { //
return true;
}
return false;
},
getInputText() {
if (this.info.channel === 1) { // -
return '支付宝';
} else { //
return '云闪付';
}
}
},
methods: {
async getData() {
this.loadingStatus = true;
@ -124,11 +237,8 @@ export default {
if (code === 200) {
Object.assign(this.goods, data.goods);
Object.assign(this.info, data.info, {
card_type: data.info.card_type ? JSON.parse(data.info.card_type) : ['1'],
time_limit: data.info.time_limit ? JSON.parse(data.info.time_limit) : {},
// todo
channel: 3,
receive_mode: 2,
card_type: data.info.card_type ? JSON.parse(data.info.card_type) : ["1"],
});
} else {
showToast(message || '请求失败');
@ -253,8 +363,63 @@ export default {
showToast(res?.message || '轮询失败');
}
},
cardType(val: any[]) {
return val.map((item) => { return item == 1 ? '借记卡' : '信用卡' + ' '; }).join(' ');
return val
.map((item) => {
return item == 1 ? "借记卡" : "信用卡" + " ";
})
.join(" ");
},
globalFormatStatus(type: any) {
switch (type) {
case 1:
return "立即兑换";
case 9:
return "已兑换";
default:
return "立即兑换";
}
},
/* 公众号领取 */
publicCollection(order_number: any) {
let params = {
order_number,
channel: 2,
channel_user_id: this.openId,
is_webview: 1,
};
},
//
knowFn() {
this.popboxshow = false;
this.maskshow = false;
},
//
openErrorDialog(tip: string) {
this.maskshow = true;
this.tiptext = tip;
this.popboxshow = true;
},
//
openDialog(tip: string) {
this.promtshow = true;
this.promttip = tip;
setTimeout(() => {
this.promtshow = false;
this.promttip = "";
}, 3000);
},
/* 动态font */
fonts() {
const defaultCss = "32px";
const count = String(parseFloat(this.info.amount || 1)).length + 1;
if (count > 4) {
return 32 - (count - 3) * 2.2 + "px";
} else {
return defaultCss;
}
},
},
};