2024-04-09 20:17:17 +08:00
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<meta name="viewport"
|
|
|
|
|
content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
|
|
|
|
|
<title>组合立减金</title>
|
2024-04-09 22:01:37 +08:00
|
|
|
|
<link rel="stylesheet" href="../combining.css?v=234">
|
2024-04-09 20:17:17 +08:00
|
|
|
|
<link rel="stylesheet" href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/css/homepage2_0.css" />
|
|
|
|
|
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/vue.min.js?v=20210302151401"
|
|
|
|
|
type="text/javascript" charset="utf-8"></script>
|
|
|
|
|
<script type="text/javascript" src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/common/axios.js?v=1367936144322">
|
|
|
|
|
</script>
|
2024-04-10 18:00:34 +08:00
|
|
|
|
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/lodash.min.js"></script>
|
2024-04-11 03:05:05 +08:00
|
|
|
|
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/api2_0.js?v=232323"></script>
|
2024-04-09 20:17:17 +08:00
|
|
|
|
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/js/libs.js?v=sdfhksdfklwrwer"></script>
|
2024-07-25 15:15:53 +08:00
|
|
|
|
<script src="../YT_Client_api.js"></script>
|
2024-04-09 20:17:17 +08:00
|
|
|
|
<style>
|
|
|
|
|
body,
|
|
|
|
|
html {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
2024-04-10 18:00:34 +08:00
|
|
|
|
<link rel="stylesheet"
|
|
|
|
|
href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/libs/antui/swiper.min.css">
|
|
|
|
|
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/libs/antui/swiper.min.js"></script>
|
|
|
|
|
<link rel="stylesheet"
|
|
|
|
|
href="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/libs/antui/antui-all.css" />
|
|
|
|
|
<script src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/libs/antui/antui.js"></script>
|
|
|
|
|
|
2024-04-09 20:17:17 +08:00
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
<div id="app">
|
|
|
|
|
<div v-if="goods">
|
|
|
|
|
|
|
|
|
|
<img @click="backGoodsFn" v-if="backAble" class="backIcon"
|
|
|
|
|
src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/backprepageBtn.png" alt="">
|
|
|
|
|
|
|
|
|
|
<div class="prompt" :class="promptShow?'proactive':''">
|
|
|
|
|
{{prompt_text}}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="mask" @touchmove.prevent @mousewheel.prevent v-show="message">
|
|
|
|
|
<div class="model">
|
|
|
|
|
<p class="m-title">温馨提示</p>
|
|
|
|
|
<p class="m-msg">{{message}}</p>
|
|
|
|
|
<button class="m-but" @click="copyFn" v-if="copyLink">复制</button>
|
|
|
|
|
<button class="m-but" @click="message = ''" v-else>知道了</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="content" :style="{background: dynamicStyle.bg}">
|
|
|
|
|
<img class="banner" :src="dynamicStyle.banner" alt="">
|
|
|
|
|
<div class="countdown" v-if="this.outTime.length>0">
|
|
|
|
|
<p :style="{color:dynamicStyle.times_color}">{{this.outTime[0]}}</p>时
|
|
|
|
|
<p :style="{color:dynamicStyle.times_color}">{{this.outTime[1]}}</p>分
|
|
|
|
|
<p :style="{color:dynamicStyle.times_color}">{{this.outTime[2]}}</p>秒
|
|
|
|
|
</div>
|
|
|
|
|
<div class="box">
|
|
|
|
|
<div class="box-cotent">
|
|
|
|
|
<div class="goods-box"
|
|
|
|
|
:style="{backgroundImage:`url(${dynamicStyle.goods_bg})`,paddingTop:goods.group_info.channel==1?'0.28rem':goods.group_info.channel==2?'0.16rem':'0.2rem'}">
|
|
|
|
|
<p class="title" :style="{color:dynamicStyle.title_color}">{{goods.title}}</p>
|
|
|
|
|
<ul class="g-b-u"
|
|
|
|
|
:style="{marginLeft:goods.group_info.channel==1?'0.12rem':'0.14rem',marginTop:goods.group_info.channel==2?'0.12rem':'0.28rem'}">
|
2024-04-10 18:00:34 +08:00
|
|
|
|
<li v-for="(item, indexProduct) in goods.product"
|
|
|
|
|
:style="{backgroundImage:`url(${dynamicStyle.goods_a})`}"
|
|
|
|
|
style="text-align: center;">
|
|
|
|
|
<span class="g-b-u-t-new">立减金 <span>x{{ item.send_num }}</span></span>
|
2024-04-09 20:17:17 +08:00
|
|
|
|
<p class="money">
|
|
|
|
|
<span>¥</span>
|
2024-04-10 18:00:34 +08:00
|
|
|
|
{{item.reduce_amount}}
|
2024-04-09 20:17:17 +08:00
|
|
|
|
</p>
|
2024-04-10 18:00:34 +08:00
|
|
|
|
<p class="reduce">满{{item.denomination}}可用</p>
|
|
|
|
|
|
|
|
|
|
<!-- 轮播 -->
|
|
|
|
|
<div class="g-b-but-new-box">
|
|
|
|
|
<div class="swiper-container demo-swiper1" :id="`J-swiper${indexProduct}`">
|
|
|
|
|
<div class="swiper-wrapper demo-swiper-wrapper">
|
|
|
|
|
<div class="swiper-slide demo-swiper-slide"
|
|
|
|
|
v-for="(items, index) in item.voucher" :key="index">
|
|
|
|
|
<p>
|
|
|
|
|
{{ items.text }}({{ items.num }})
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-04-09 20:17:17 +08:00
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<p class="notis" :style="{color:dynamicStyle.notis_color}" v-show="goods.product.length>3">
|
|
|
|
|
滑动查看更多
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<p class="g_b_title"
|
|
|
|
|
v-if="goods.send_status !== 2 && (goods.group_info.channel==3||goods.group_info.channel==1&&goods.group_info.receive_mode==2)">
|
|
|
|
|
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/ysf_title_icon.png"
|
|
|
|
|
alt="">
|
|
|
|
|
{{goods.group_info.channel==1?'支付宝账号':'云闪付账号'}}
|
|
|
|
|
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/ysf_title_icon.png"
|
|
|
|
|
alt="">
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<template
|
|
|
|
|
v-if="goods.send_status !== 2 && (goods.group_info.channel==3||goods.group_info.channel==1&&goods.group_info.receive_mode==2)">
|
|
|
|
|
<input type="text" maxlength="50"
|
2024-10-22 19:00:48 +08:00
|
|
|
|
:placeholder="goods.group_info.channel==3?'请输入手机号':'请输入账号'" :disabled="!!goods.account" v-model="form.confirm">
|
2024-04-09 20:17:17 +08:00
|
|
|
|
<input type="text" maxlength="50"
|
2024-10-22 19:00:48 +08:00
|
|
|
|
:placeholder="goods.group_info.channel==3?'请再次输入手机号':'请再次输入账号'" :disabled="!!goods.account"
|
2024-04-09 20:17:17 +08:00
|
|
|
|
v-model="form.receive_account">
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<button type="button" class="but"
|
|
|
|
|
:style="{marginTop:goods.group_info.channel==2||goods.group_info.channel==1&&goods.group_info.receive_mode==1&&'0.12rem'}"
|
|
|
|
|
alt="" @click="submit" :disabled="loading"
|
|
|
|
|
v-show="goods.send_status === 5 || goods.send_status === 3 || goods.send_status === 4"></button>
|
|
|
|
|
|
|
|
|
|
<!-- 发放中。。。 -->
|
|
|
|
|
<div class="ff-btn" v-show="goods.send_status === 1">
|
|
|
|
|
<div class="ff-text">发放中,请等待<span class="ani_dot">...</span></div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<p class="time" v-if="goods.group_info.time_limit.timer_show!=2"
|
|
|
|
|
:style="{marginTop: 0,color:dynamicStyle.time_color}">
|
|
|
|
|
生效时间:{{goods.group_info.time_limit.effect_time.start_time}}
|
|
|
|
|
~
|
|
|
|
|
{{goods.group_info.time_limit.effect_time.end_time}}</p>
|
|
|
|
|
|
|
|
|
|
<p class="time" :style="{marginTop: '0.05rem',color:dynamicStyle.time_color}"
|
|
|
|
|
v-if="goods.group_info.time_limit.receive_time.start_time">
|
|
|
|
|
领取时间:{{goods.group_info.time_limit.receive_time.start_time}} ~
|
|
|
|
|
{{goods.group_info.time_limit.receive_time.end_time}}</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="box-footer">
|
|
|
|
|
<img class="b-f-img" :src="dynamicStyle.footer_top" alt="">
|
|
|
|
|
<div class="b-f-b" :style="{backgroundImage:`url(${dynamicStyle.footer_middle})`}">
|
|
|
|
|
<div class="b-f-i" v-html="goods.group_info.instruction"
|
|
|
|
|
:style="{color:dynamicStyle.footer_color}" v-if="goods.group_info.instructionType==1">
|
|
|
|
|
</div>
|
|
|
|
|
<img v-else :src="goods.group_info.group_image" alt="" class="group_image">
|
|
|
|
|
</div>
|
|
|
|
|
<img class="b-f-img" :style="{filter:goods.receive_status==1?'grayscale(0)':'grayscale(0.6)'}"
|
|
|
|
|
:src="dynamicStyle.footer_bottom" alt="">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 弹窗 -->
|
|
|
|
|
<div class="tip-pop mask" v-show="popMsg">
|
|
|
|
|
<div class="tip-main">
|
|
|
|
|
<div class="tip-pop-head">
|
|
|
|
|
<img src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/zh-dd.png"
|
|
|
|
|
class="tip-pop-dd" />
|
|
|
|
|
</div>
|
|
|
|
|
<p class="tip-title">温馨提示</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="tip-card-status" v-show="goods.send_status === 2">全部领取成功</p>
|
|
|
|
|
<p class="tip-card-status" v-show="goods.send_status === 3" style="color: #FD2323;">全部领取失败</p>
|
|
|
|
|
<p class="tip-card-status" v-show="goods.send_status === 4">领取成功{{ isOKLength }}条,<span
|
|
|
|
|
style="color: #FD2323;font-size: 0.16rem;">失败{{ isErrLength }}条</span></p>
|
|
|
|
|
|
|
|
|
|
<p class="tip-card-text" v-show="goods.send_status === 2">
|
2024-04-10 09:29:57 +08:00
|
|
|
|
请前往微信-我的卡包查询使用
|
2024-04-09 20:17:17 +08:00
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p class="tip-card-text" style="padding: 0 0.2rem;" v-show="goods.send_status === 3">
|
|
|
|
|
{{ goods.err_msg[0] }}
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p class="tip-card-text" v-show="goods.send_status === 4">
|
|
|
|
|
请根据界面错误原因进行调整后再重试
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<div v-if="errListShow"
|
|
|
|
|
style="padding: 0 0.2rem;text-align: left;max-height: 2rem;overflow-y: scroll;">
|
|
|
|
|
<p class="err-list-p" v-for="(item,index) in goods.err_msg">错误{{Number(index) + 1}}: {{ item }}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<button class="tip-btn" v-show="goods.send_status === 2 || goods.send_status === 3"
|
|
|
|
|
@click="() => popMsg = false">我知道了</button>
|
|
|
|
|
|
|
|
|
|
<button class="tip-btn" v-show="goods.send_status === 4" @click="() => {
|
|
|
|
|
errListShow = !errListShow
|
|
|
|
|
|
|
|
|
|
if(errListShow === false){
|
|
|
|
|
popMsg = false;
|
|
|
|
|
}
|
|
|
|
|
}">{{
|
|
|
|
|
errListShow ? '我知道了' : '查看失败原因' }}</button>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 弹出提示 -->
|
|
|
|
|
<div class="popboxshow" v-if="popboxshow" :class="popboxshow?'active':''">
|
|
|
|
|
<div class="tip">
|
|
|
|
|
<p>{{tiptext}}</p>
|
|
|
|
|
<span @click="knowFn">知道了</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
<script>
|
|
|
|
|
const bm_obj_data = sessionStorage.getItem("bm_auth") ? JSON.parse(sessionStorage.getItem("bm_auth")) : null;
|
|
|
|
|
const phoneReg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
|
|
|
|
|
const emailReg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
|
|
|
|
new Vue({
|
|
|
|
|
el: "#app",
|
2024-04-18 09:26:36 +08:00
|
|
|
|
data() {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
return {
|
|
|
|
|
goods: '',
|
|
|
|
|
backAble: (~~sessionStorage.getItem('goodsCount')) > 1,
|
|
|
|
|
token: localStorage.getItem('token'),
|
|
|
|
|
key: localStorage.getItem('key'),
|
|
|
|
|
promptShow: false,
|
|
|
|
|
popShow: false,
|
|
|
|
|
is: false,
|
|
|
|
|
cls: null,
|
|
|
|
|
prompt_text: '',
|
|
|
|
|
receive_time: '',
|
|
|
|
|
message: '',
|
|
|
|
|
loading: false,
|
|
|
|
|
openId: localStorage.getItem('openid'),
|
|
|
|
|
copyLink: '',
|
|
|
|
|
outTime: [],
|
|
|
|
|
form: {
|
|
|
|
|
confirm: null,
|
|
|
|
|
receive_account: null
|
|
|
|
|
},
|
|
|
|
|
errListShow: false,
|
|
|
|
|
popMsg: false,
|
|
|
|
|
popboxshow: false,
|
|
|
|
|
maskshow: false,
|
|
|
|
|
tiptext: "",
|
|
|
|
|
cont: 0,
|
|
|
|
|
timeGet: null,
|
|
|
|
|
isOKLength: 0,
|
|
|
|
|
isErrLength: 0,
|
2024-04-10 18:00:34 +08:00
|
|
|
|
isTimeOut: 5000,
|
|
|
|
|
swiper: null
|
2024-04-09 20:17:17 +08:00
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|
2024-04-18 09:26:36 +08:00
|
|
|
|
mounted() {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
document.title = localStorage.getItem('title');
|
|
|
|
|
this.code_batch_id = JSON.parse(sessionStorage.getItem('goodsInfo')).entity.code_batch_id;
|
|
|
|
|
this.getProductDetail();
|
|
|
|
|
|
|
|
|
|
/* 倒计时 */
|
|
|
|
|
const key_expiration_time = sessionStorage.getItem('key_expiration_time');
|
|
|
|
|
if (key_expiration_time != 0) {
|
|
|
|
|
const cls = setInterval(() => {
|
|
|
|
|
const time = pageOutTime(key_expiration_time);
|
|
|
|
|
if (time) {
|
|
|
|
|
this.outTime = time;
|
|
|
|
|
} else {
|
|
|
|
|
this.outTime = ['00', '00', '00'];
|
|
|
|
|
clearInterval(cls);
|
|
|
|
|
}
|
|
|
|
|
}, 1000);
|
|
|
|
|
} else {
|
|
|
|
|
this.outTime = [];
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
computed: {
|
2024-04-18 09:26:36 +08:00
|
|
|
|
dynamicStyle() {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
switch (Number(this.goods.group_info.channel)) {
|
|
|
|
|
case 1:
|
|
|
|
|
return {
|
|
|
|
|
bg: '#4989f5',
|
|
|
|
|
title_color: '#fff',
|
|
|
|
|
banner: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/zfb_common_img_banner.png',
|
|
|
|
|
goods_bg: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/zfb_redenvelope_img.png',
|
|
|
|
|
footer_top: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/zfb_common_img_top.png',
|
|
|
|
|
footer_middle: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/zfb_common_img_middle.png',
|
|
|
|
|
footer_bottom: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/zfb_common_img_d.png',
|
|
|
|
|
footer_color: '#4989F5',
|
|
|
|
|
notis_color: '#FF486D',
|
|
|
|
|
times_color: '#1b7bff',
|
2024-04-10 18:00:34 +08:00
|
|
|
|
goods_a: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/llj-box-new.png',
|
|
|
|
|
|
2024-04-09 20:17:17 +08:00
|
|
|
|
};
|
|
|
|
|
case 2:
|
|
|
|
|
return {
|
|
|
|
|
bg: '#cee5be',
|
|
|
|
|
title_color: '#239700',
|
|
|
|
|
banner: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/wx_common_img_banner.png',
|
|
|
|
|
goods_bg: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/wx_redenvelope_img.png',
|
|
|
|
|
footer_top: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/wx_common_img_top.png',
|
|
|
|
|
footer_middle: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/wx_common_img_middle.png',
|
|
|
|
|
footer_bottom: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/wx_common_img_d.png',
|
|
|
|
|
footer_color: '#5eb145',
|
|
|
|
|
time_color: '#5eb145',
|
|
|
|
|
times_color: '#5eb145',
|
|
|
|
|
notis_color: '#239700',
|
2024-04-10 18:00:34 +08:00
|
|
|
|
goods_a: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/llj-box-new.png',
|
2024-04-09 20:17:17 +08:00
|
|
|
|
};
|
|
|
|
|
case 3:
|
|
|
|
|
return {
|
|
|
|
|
bg: '#ff4830',
|
|
|
|
|
title_color: '#FF3024',
|
|
|
|
|
banner: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/ysf_common_img_banner.png',
|
|
|
|
|
goods_bg: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/ysf_redenvelope_img.png',
|
|
|
|
|
footer_top: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/ysf_common_img_top.png',
|
|
|
|
|
footer_middle: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/ysf_common_img_middle.png',
|
|
|
|
|
footer_bottom: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/ysf_common_img_d.png',
|
|
|
|
|
footer_color: '#FF4901',
|
|
|
|
|
times_color: '#ed703f',
|
|
|
|
|
notis_color: '#FFD3D8',
|
2024-04-10 18:00:34 +08:00
|
|
|
|
goods_a: 'https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/combining/llj-box-new.png',
|
2024-04-09 20:17:17 +08:00
|
|
|
|
};
|
|
|
|
|
default:
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
2024-04-10 18:00:34 +08:00
|
|
|
|
//获取商品详情
|
2024-04-18 09:26:36 +08:00
|
|
|
|
getProductDetail() {
|
2024-04-10 18:00:34 +08:00
|
|
|
|
const self = this;
|
2024-04-10 20:35:59 +08:00
|
|
|
|
req.axiosGet('/key/group/v2/groupProductDetail', {
|
2024-04-10 18:00:34 +08:00
|
|
|
|
token: self.token,
|
|
|
|
|
code_batch_id: self.code_batch_id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res.code == 200) {
|
2024-04-10 20:35:59 +08:00
|
|
|
|
let new_data = res.data;
|
|
|
|
|
|
2024-04-10 18:00:34 +08:00
|
|
|
|
new_data.product = self.computeNum(new_data.product);
|
2024-04-11 10:45:05 +08:00
|
|
|
|
self.goods = new_data;
|
2024-10-22 19:00:48 +08:00
|
|
|
|
this.form.receive_account = this.goods.account || '';
|
|
|
|
|
this.form.confirm = this.goods.account || '';
|
2024-04-09 22:01:37 +08:00
|
|
|
|
|
2024-04-10 18:00:34 +08:00
|
|
|
|
// send_status 1发放中,2全部成功 ,3全部失败,4部分失败 ,5未领取
|
2024-10-29 16:28:41 +08:00
|
|
|
|
self.popMsg = self.goods.send_status === 2 || self.goods.send_status === 3 || self.goods.send_status === 4 ? this.goods.period_type == 2 || this.goods.period_type == 3 ? false : true : false;
|
2024-04-09 20:17:17 +08:00
|
|
|
|
|
2024-04-10 18:00:34 +08:00
|
|
|
|
// 部分失败
|
|
|
|
|
if (self.goods.send_status === 4) {
|
2024-04-10 23:34:19 +08:00
|
|
|
|
let all_product_voucher = [];
|
|
|
|
|
|
|
|
|
|
new_data.product.forEach(item => {
|
2024-04-11 10:45:05 +08:00
|
|
|
|
all_product_voucher = all_product_voucher.concat(item.voucher);
|
|
|
|
|
});
|
2024-04-10 23:39:40 +08:00
|
|
|
|
let is_err_length = all_product_voucher.filter(item => item.status === 9).length;
|
2024-04-10 23:30:36 +08:00
|
|
|
|
self.isOKLength = all_product_voucher.length - is_err_length;
|
2024-04-10 18:00:34 +08:00
|
|
|
|
self.isErrLength = is_err_length;
|
|
|
|
|
}
|
2024-04-09 20:17:17 +08:00
|
|
|
|
|
2024-04-10 20:35:59 +08:00
|
|
|
|
// 1.发放中 轮循
|
2024-04-10 18:00:34 +08:00
|
|
|
|
if (res.data.send_status === 1) {
|
2024-04-10 20:35:59 +08:00
|
|
|
|
// 2.发放中才有 轮播
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
new_data.product.forEach((item, index) => {
|
|
|
|
|
if (item.voucher.length > 1) {
|
|
|
|
|
new Swiper(`#J-swiper${index}`, {
|
|
|
|
|
loop: true,
|
|
|
|
|
direction: "vertical",
|
|
|
|
|
autoplay: 1000
|
|
|
|
|
});
|
|
|
|
|
}
|
2024-04-11 10:45:05 +08:00
|
|
|
|
});
|
|
|
|
|
}, 1000);
|
|
|
|
|
clearInterval(self.timeGet);
|
2024-04-10 18:00:34 +08:00
|
|
|
|
self.timeGet = null;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
self.groupProductVoucherDetail();
|
2024-04-11 10:45:05 +08:00
|
|
|
|
}, 5000);
|
2024-04-10 18:00:34 +08:00
|
|
|
|
}
|
2024-04-09 20:17:17 +08:00
|
|
|
|
|
2024-04-10 18:00:34 +08:00
|
|
|
|
// 代码暂时这样
|
|
|
|
|
if (self.goods.group_info.channel == 1 && self.goods.group_info.receive_mode == 1) {
|
|
|
|
|
|
|
|
|
|
} else if (self.goods.group_info.channel == 2) {
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
// 领取成功结算 5
|
|
|
|
|
if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 5) {
|
|
|
|
|
settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2024-04-11 10:45:05 +08:00
|
|
|
|
self.openErrorDialog(res.message);
|
2024-04-10 18:00:34 +08:00
|
|
|
|
}
|
|
|
|
|
}).catch();
|
2024-04-09 20:17:17 +08:00
|
|
|
|
},
|
|
|
|
|
// 轮循
|
2024-04-18 09:26:36 +08:00
|
|
|
|
groupProductVoucherDetail() {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
let self = this;
|
|
|
|
|
req.axiosPost('/key/group/groupProductVoucherDetail', {
|
|
|
|
|
token: this.token,
|
|
|
|
|
code_batch_id: this.code_batch_id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res.code === 200) {
|
2024-04-10 21:38:35 +08:00
|
|
|
|
let new_data = res.data.product;
|
2024-04-10 20:35:59 +08:00
|
|
|
|
|
2024-04-09 20:17:17 +08:00
|
|
|
|
// send_status 1发放中,2全部成功 ,3全部失败,4部分失败 ,5未领取
|
|
|
|
|
// status 1待领取,2发放中,3待使用,4已使用,5领取失败
|
2024-04-10 20:35:59 +08:00
|
|
|
|
// 第一步:替换数据
|
|
|
|
|
let old_product_all = self.goods.product;
|
|
|
|
|
let new_voucher_all = []; // 存储所有voucher 用于判断
|
2024-04-09 20:17:17 +08:00
|
|
|
|
|
2024-04-10 20:35:59 +08:00
|
|
|
|
let all_err = []; // 所有错误
|
|
|
|
|
for (let i = 0; i < old_product_all.length; i++) {
|
2024-04-11 10:45:05 +08:00
|
|
|
|
let el = new_data.find(item => item.id === old_product_all[i].id);
|
2024-04-09 20:17:17 +08:00
|
|
|
|
if (el) {
|
|
|
|
|
|
2024-04-10 20:35:59 +08:00
|
|
|
|
// 存储错误
|
2024-04-10 23:43:58 +08:00
|
|
|
|
el.order_voucher.forEach(row => {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
if (row.receive_error !== "") {
|
|
|
|
|
all_err.push(row.receive_error);
|
|
|
|
|
}
|
2024-04-10 22:44:20 +08:00
|
|
|
|
});
|
2024-04-09 20:17:17 +08:00
|
|
|
|
|
2024-04-10 20:35:59 +08:00
|
|
|
|
// 合并所有数组 用于判断最终状态
|
2024-04-10 23:43:58 +08:00
|
|
|
|
new_voucher_all = new_voucher_all.concat(el.order_voucher);
|
2024-04-09 20:17:17 +08:00
|
|
|
|
|
2024-04-10 20:35:59 +08:00
|
|
|
|
// 替换 voucher
|
2024-04-10 23:43:58 +08:00
|
|
|
|
old_product_all[i].voucher = el.order_voucher;
|
2024-04-10 20:35:59 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-04-09 20:17:17 +08:00
|
|
|
|
|
2024-04-10 20:35:59 +08:00
|
|
|
|
// 替换
|
|
|
|
|
self.goods.product = self.computeNum(old_product_all);
|
|
|
|
|
// 第二步:状态判断
|
2024-04-10 22:43:15 +08:00
|
|
|
|
// 6发放中 1已领取 9领取失败 20待领取 轮循+详情
|
2024-04-10 20:35:59 +08:00
|
|
|
|
// 发放中 备注:只要有一个 发放中 -> send_status 1 发放中
|
2024-04-10 22:43:15 +08:00
|
|
|
|
let ffLength = new_voucher_all.filter(item => item.status === 6);
|
2024-04-09 20:17:17 +08:00
|
|
|
|
if (ffLength.length > 0) {
|
|
|
|
|
self.goods.send_status = 1;
|
2024-04-10 20:35:59 +08:00
|
|
|
|
|
|
|
|
|
// 1.发放中才有 轮播
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
self.goods.product.forEach((item, index) => {
|
|
|
|
|
if (item.voucher.length > 1) {
|
|
|
|
|
new Swiper(`#J-swiper${index}`, {
|
|
|
|
|
loop: true,
|
|
|
|
|
initialSlide: 0,
|
|
|
|
|
direction: "vertical",
|
|
|
|
|
autoplay: 1000
|
|
|
|
|
});
|
|
|
|
|
}
|
2024-04-11 10:45:05 +08:00
|
|
|
|
});
|
|
|
|
|
}, 1000);
|
2024-04-10 20:35:59 +08:00
|
|
|
|
|
2024-04-09 20:17:17 +08:00
|
|
|
|
setTimeout(() => {
|
|
|
|
|
if (self.cont > 10) {
|
|
|
|
|
// 超过50s,增加请求间隔 为 30s
|
|
|
|
|
self.isTimeOut = 30000;
|
|
|
|
|
// 设置最大请求数 60分钟
|
|
|
|
|
if (self.cont > 60) {
|
2024-04-10 22:44:20 +08:00
|
|
|
|
self.openErrorDialog("请刷新页面重试!");
|
2024-04-09 20:17:17 +08:00
|
|
|
|
// 放弃
|
2024-04-10 22:44:20 +08:00
|
|
|
|
return;
|
2024-04-09 20:17:17 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
self.groupProductVoucherDetail();
|
|
|
|
|
self.cont++;
|
|
|
|
|
}, self.isTimeOut);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-10 20:35:59 +08:00
|
|
|
|
// 全部失败+部分失败
|
2024-04-09 20:17:17 +08:00
|
|
|
|
// 备注:领取失败失败数,大于等于全部数量 -> send_status 3 全部失败
|
2024-04-10 22:43:15 +08:00
|
|
|
|
// 6发放中 1已领取 9领取失败 20待领取 轮循+详情
|
|
|
|
|
let errLength = new_voucher_all.filter(item => item.status === 9);
|
2024-04-09 20:17:17 +08:00
|
|
|
|
|
2024-04-10 20:35:59 +08:00
|
|
|
|
if (errLength.length > 0 && new_voucher_all.length === errLength.length) {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
self.goods.send_status = 3;
|
|
|
|
|
// 错误去重
|
|
|
|
|
self.goods.err_msg = [...new Set(all_err)];
|
|
|
|
|
|
|
|
|
|
self.popMsg = true;
|
2024-04-11 10:45:05 +08:00
|
|
|
|
return;
|
2024-04-10 20:35:59 +08:00
|
|
|
|
} else if (errLength.length > 0 && new_voucher_all.length > errLength.length) {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
// 领取失败数,小于全部数量 -> send_status 4 部分失败
|
|
|
|
|
// 错误去重
|
|
|
|
|
self.goods.err_msg = [...new Set(all_err)];
|
2024-04-10 20:35:59 +08:00
|
|
|
|
|
|
|
|
|
self.isOKLength = new_voucher_all.length - errLength.length;
|
2024-04-09 20:17:17 +08:00
|
|
|
|
self.isErrLength = errLength.length;
|
|
|
|
|
self.goods.send_status = 4;
|
|
|
|
|
|
|
|
|
|
self.popMsg = true;
|
2024-04-10 22:44:20 +08:00
|
|
|
|
return;
|
2024-04-09 20:17:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-04-10 20:35:59 +08:00
|
|
|
|
// 全部领取
|
2024-04-10 22:43:15 +08:00
|
|
|
|
let allOkLength = new_voucher_all.filter(item => item.status === 1);
|
2024-04-10 20:35:59 +08:00
|
|
|
|
if (allOkLength.length > 0 && allOkLength.length === new_voucher_all.length) {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
self.goods.send_status = 2;
|
|
|
|
|
|
|
|
|
|
self.popMsg = true;
|
2024-04-10 22:44:20 +08:00
|
|
|
|
return;
|
2024-04-09 20:17:17 +08:00
|
|
|
|
}
|
2024-04-09 22:01:37 +08:00
|
|
|
|
|
2024-04-09 20:17:17 +08:00
|
|
|
|
|
|
|
|
|
}
|
2024-04-11 10:45:05 +08:00
|
|
|
|
});
|
2024-04-09 20:17:17 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/* ******************************************** 官方领取 ******************************************** */
|
|
|
|
|
/* 直接领取 */
|
2024-04-18 09:26:36 +08:00
|
|
|
|
directSubmit() {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
const self = this;
|
|
|
|
|
self.loading = true;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
self.loading = false;
|
2024-04-10 22:44:20 +08:00
|
|
|
|
}, 5000);
|
2024-04-09 20:17:17 +08:00
|
|
|
|
|
|
|
|
|
/* 公众号打开 */
|
|
|
|
|
if (this.goods.group_info.channel == 2 && this.goods.group_info.is_webview == 1 && !this.openId) {
|
|
|
|
|
const linkId = localStorage.getItem('linkId');
|
|
|
|
|
location.href = `https://openapi.1688sup.com/wechat/oauth?jump=${location.origin}/${linkId}/${this.key}`;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const data = {
|
|
|
|
|
key: this.key,
|
|
|
|
|
token: this.token,
|
|
|
|
|
code_batch_id: this.code_batch_id,
|
|
|
|
|
receive_mode: 1
|
|
|
|
|
};
|
|
|
|
|
req.axiosPost("/key/couponGroupUsage", data)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
// 领取结算 4
|
|
|
|
|
if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 4) {
|
|
|
|
|
settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type);
|
|
|
|
|
}
|
|
|
|
|
if (this.goods.group_info.channel == 1 && this.goods.group_info.receive_mode == 1) {
|
|
|
|
|
/* 支付宝官方领取 */
|
|
|
|
|
this.toLinkAlipay();
|
|
|
|
|
} else if (this.goods.group_info.channel == 2) {
|
|
|
|
|
if (this.goods.group_info.is_webview == 1) {
|
|
|
|
|
/* 公众号 */
|
|
|
|
|
this.publicCollection();
|
|
|
|
|
} else {
|
|
|
|
|
/* 小程序 */
|
2024-07-25 15:15:53 +08:00
|
|
|
|
let ua = navigator.userAgent; //判断用户打开链接环境
|
2024-08-01 16:36:31 +08:00
|
|
|
|
// let plan_id = localStorage.getItem('plan_id');
|
|
|
|
|
if (ua.indexOf("CreditCardAppNew") > -1) { // 正式z 用 CreditCardAppNew UnionPay/1.0
|
2024-07-25 15:15:53 +08:00
|
|
|
|
Fw.device.api.openWXMiniProgram({
|
|
|
|
|
programID: "gh_07fecf7a6d31",
|
2024-08-01 14:55:38 +08:00
|
|
|
|
path: `pages/index/index?code_batch_id=${this.code_batch_id}&token=${this.token}`,
|
2024-08-01 15:28:03 +08:00
|
|
|
|
// miniType: 2, // 1 开发版 2 体验版 // 正式z 删除
|
2024-07-25 15:15:53 +08:00
|
|
|
|
extJson: JSON.stringify({
|
2024-08-01 11:05:26 +08:00
|
|
|
|
code_batch_id: this.code_batch_id,
|
|
|
|
|
token: this.token,
|
2024-07-25 15:15:53 +08:00
|
|
|
|
})
|
|
|
|
|
})
|
2024-08-01 16:36:31 +08:00
|
|
|
|
} else if (ua.indexOf("Source/YOUBankApp/psbc") > -1) {
|
2024-07-25 15:15:53 +08:00
|
|
|
|
function upWXSmallProgramYouBank(){
|
|
|
|
|
function objectToQueryString(path) {
|
|
|
|
|
const obj = JSON.parse(JSON.stringify(path));
|
|
|
|
|
return Object.keys(obj).map(key => key + '=' + obj[key]).join('&');
|
|
|
|
|
}
|
2024-08-01 11:05:26 +08:00
|
|
|
|
let params = { code_batch_id: this.code_batch_id, token: this.token };
|
|
|
|
|
let url = "pages/index/index?" + objectToQueryString(params);
|
2024-07-25 15:15:53 +08:00
|
|
|
|
AlipayJSBridge.call('upWXSmallProgramYouBank', {
|
|
|
|
|
id: 'gh_07fecf7a6d31',
|
|
|
|
|
url: url,
|
|
|
|
|
},
|
|
|
|
|
function(result) {
|
|
|
|
|
console.log(result);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
upWXSmallProgramYouBank();
|
|
|
|
|
} else {
|
|
|
|
|
window.location.replace(res.data.redirect_url);
|
|
|
|
|
}
|
2024-04-09 22:57:33 +08:00
|
|
|
|
self.timeGet = setInterval(() => {
|
2024-04-11 02:50:18 +08:00
|
|
|
|
self.getProductDetail();
|
|
|
|
|
// self.groupProductVoucherDetail();
|
2024-04-10 22:44:20 +08:00
|
|
|
|
}, 3000);
|
2024-04-09 20:17:17 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.axiosErrorFun(res.code, res.message);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => { this.loading = false; });
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/* 公众号领取 */
|
2024-04-18 09:26:36 +08:00
|
|
|
|
publicCollection() {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
let params = {
|
|
|
|
|
token: this.token,
|
|
|
|
|
code_batch_id: this.code_batch_id,
|
|
|
|
|
channel_user_id: this.openId,
|
|
|
|
|
is_webview: 1
|
|
|
|
|
};
|
|
|
|
|
req.axiosPost("/voucher/groupVoucherGrant", params)
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
// 领取成功结算 5
|
|
|
|
|
if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 5) {
|
|
|
|
|
settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 使用结算 6
|
|
|
|
|
if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 6) {
|
|
|
|
|
settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.getProductDetail();
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
this.axiosErrorFun(res.code, res.message);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => { this.loading = false; });
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/* 支付宝官方领取H5跳转 */
|
2024-04-18 09:26:36 +08:00
|
|
|
|
toLinkAlipay() {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
// 领取成功结算 5
|
|
|
|
|
if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 5) {
|
|
|
|
|
settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 使用结算 6
|
|
|
|
|
if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 6) {
|
|
|
|
|
settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let self = this;
|
|
|
|
|
let banklink = encodeURIComponent(
|
|
|
|
|
window.location.origin +
|
|
|
|
|
`/packkey/combiningAlipay.html?codeBatchId=${this.code_batch_id}&token=${this.token}`
|
|
|
|
|
);
|
2024-04-18 09:26:36 +08:00
|
|
|
|
let link = "https://openapi.1688sup.com/alipay/oauth?jump=" + banklink;
|
2024-04-09 20:17:17 +08:00
|
|
|
|
let ua = navigator.userAgent.toLowerCase(); //判断用户打开链接环境
|
|
|
|
|
if (isWx() ||
|
|
|
|
|
(ua.indexOf("android") > -1 &&
|
|
|
|
|
ua.indexOf("baiduboxapp") > -1) ||
|
|
|
|
|
ua.indexOf("windows") > -1) {
|
|
|
|
|
//复制链接地址,提醒去浏览器打开
|
|
|
|
|
this.message = '请点击下方[复制]按钮,复制链接到浏览器打开!';
|
|
|
|
|
this.copyLink = link;
|
|
|
|
|
} else {
|
|
|
|
|
//唤起支付宝
|
|
|
|
|
window.location.replace(link);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/* ******************************************** 账号领取 ******************************************** */
|
|
|
|
|
/* 立即领取 */
|
2024-04-18 09:26:36 +08:00
|
|
|
|
submit() {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
if (this.goods.group_info.channel == 3 || this.goods.group_info.channel == 1 && this.goods.group_info.receive_mode == 2) {
|
|
|
|
|
const { confirm, receive_account } = this.form;
|
|
|
|
|
if (this.loading) return;
|
|
|
|
|
if (confirm !== receive_account) return this.tips('两次输入账号不一致');
|
|
|
|
|
/* 云闪付校验手机号 支付宝校验手机号/邮箱号 */
|
|
|
|
|
if ((phoneReg.test(receive_account) && this.goods.group_info.channel == 3 || this.goods.group_info.channel == 1 && (emailReg.test(receive_account) || phoneReg.test(receive_account)))) {
|
|
|
|
|
this.finalSubmit();
|
|
|
|
|
} else {
|
|
|
|
|
this.tips('请输入正确的账号');
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.directSubmit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// 提交函数
|
2024-04-18 09:26:36 +08:00
|
|
|
|
submitOne(data) {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
/* 领取立减金 */
|
|
|
|
|
req.axiosPost("/key/couponGroupUsage", data)
|
|
|
|
|
.then(({ code, message }) => {
|
|
|
|
|
if (code == 200) {
|
|
|
|
|
this.getProductDetail();
|
|
|
|
|
// 使用结算 6
|
|
|
|
|
if (bm_obj_data && !bm_obj_data.settlement_data.is_settlement && bm_obj_data.settlement_data.settlement_type === 6) {
|
|
|
|
|
settlementFun(bm_obj_data.token, bm_obj_data.settlement_data.settlement_type);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.axiosErrorFun(code, message);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => { this.loading = false; });
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 重试函数
|
2024-04-18 09:26:36 +08:00
|
|
|
|
resetSubmit(data) {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
/* 领取立减金 */
|
|
|
|
|
req.axiosPost("/voucher/groupVoucherRetry", data)
|
|
|
|
|
.then(({ code, message }) => {
|
|
|
|
|
if (code == 200) {
|
|
|
|
|
this.getProductDetail();
|
|
|
|
|
} else {
|
|
|
|
|
this.axiosErrorFun(code, message);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => { this.loading = false; });
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/* 验证后 最终提交 */
|
2024-04-18 09:26:36 +08:00
|
|
|
|
finalSubmit() {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
const self = this;
|
|
|
|
|
self.loading = true;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
self.loading = false;
|
2024-04-10 22:44:20 +08:00
|
|
|
|
}, 5000);
|
2024-04-09 20:17:17 +08:00
|
|
|
|
|
2024-10-22 19:00:48 +08:00
|
|
|
|
if (!this.goods.period_type || this.goods.period_type == 1 && (this.goods.send_status === 3 || this.goods.send_status === 4)) {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
let params = {
|
|
|
|
|
token: localStorage.getItem("token"),
|
|
|
|
|
code_batch_id: this.code_batch_id,
|
|
|
|
|
channel_user_id: this.form.receive_account
|
2024-04-10 22:44:20 +08:00
|
|
|
|
};
|
2024-04-09 20:17:17 +08:00
|
|
|
|
this.resetSubmit(params); // 重试
|
|
|
|
|
} else {
|
|
|
|
|
let params = {
|
|
|
|
|
key: this.key,
|
|
|
|
|
code_batch_id: this.code_batch_id,
|
|
|
|
|
token: localStorage.getItem("token"),
|
|
|
|
|
account: this.form.receive_account,
|
|
|
|
|
receive_mode: 2
|
|
|
|
|
};
|
|
|
|
|
this.submitOne(params); // 普通提交
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/* 返回 */
|
2024-04-18 09:26:36 +08:00
|
|
|
|
backGoodsFn() {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
if (this.backAble) {
|
|
|
|
|
window.location.replace('./homepage.html');
|
|
|
|
|
} else {
|
|
|
|
|
history.go(-2);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/* 接口异常处理 */
|
2024-04-18 09:26:36 +08:00
|
|
|
|
axiosErrorFun(code, message) {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
this.loading = false;
|
|
|
|
|
if (code == 403) {
|
|
|
|
|
if (this.backAble) {
|
|
|
|
|
this.message = message;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
window.location.href = localStorage.getItem('entryLink');
|
|
|
|
|
}, 3000);
|
|
|
|
|
} else {
|
|
|
|
|
this.message = message;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.message = message;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//复制文本
|
2024-04-18 09:26:36 +08:00
|
|
|
|
copyFn() {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
var textArea = document.createElement("textarea");
|
|
|
|
|
textArea.value = this.copyLink;
|
|
|
|
|
document.body.appendChild(textArea);
|
|
|
|
|
textArea.select();
|
|
|
|
|
document.execCommand("copy");
|
|
|
|
|
this.tips("复制成功,请到浏览器打开");
|
|
|
|
|
document.body.removeChild(textArea);
|
|
|
|
|
this.copyshow = false;
|
|
|
|
|
this.maskshow = false;
|
|
|
|
|
this.copyLink = null;
|
|
|
|
|
this.message = '';
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/* 触发提示 */
|
2024-04-18 09:26:36 +08:00
|
|
|
|
tips(text) {
|
2024-04-09 20:17:17 +08:00
|
|
|
|
this.cls && clearTimeout(this.cls);
|
|
|
|
|
this.prompt_text = text;
|
|
|
|
|
this.promptShow = true;
|
|
|
|
|
this.cls = setTimeout(() => {
|
|
|
|
|
this.promptShow = false;
|
|
|
|
|
}, 3000);
|
|
|
|
|
},
|
2024-04-10 18:00:34 +08:00
|
|
|
|
// 错误弹出框关闭
|
2024-04-18 09:26:36 +08:00
|
|
|
|
knowFn() {
|
2024-04-10 18:00:34 +08:00
|
|
|
|
this.popboxshow = false;
|
|
|
|
|
this.maskshow = false;
|
|
|
|
|
},
|
|
|
|
|
// 错误弹窗
|
2024-04-18 09:26:36 +08:00
|
|
|
|
openErrorDialog(tip) {
|
2024-04-10 18:00:34 +08:00
|
|
|
|
this.maskshow = true;
|
|
|
|
|
this.tiptext = tip;
|
|
|
|
|
this.popboxshow = true;
|
|
|
|
|
},
|
2024-04-10 22:43:15 +08:00
|
|
|
|
// 6发放中 1待使用 9领取失败 20待领取 轮循+详情
|
2024-04-18 09:26:36 +08:00
|
|
|
|
formatStatusText(status) {
|
2024-04-10 18:00:34 +08:00
|
|
|
|
switch (status) {
|
|
|
|
|
case 6:
|
2024-04-11 10:45:05 +08:00
|
|
|
|
return "发放中";
|
2024-04-10 18:00:34 +08:00
|
|
|
|
case 1:
|
2024-04-11 10:45:05 +08:00
|
|
|
|
return "已领取";
|
2024-04-10 18:00:34 +08:00
|
|
|
|
case 9:
|
2024-04-11 10:45:05 +08:00
|
|
|
|
return "领取失败";
|
2024-04-10 22:43:15 +08:00
|
|
|
|
case 20:
|
2024-04-11 10:45:05 +08:00
|
|
|
|
return "待领取";
|
|
|
|
|
case 2:
|
|
|
|
|
return "已领取";
|
2024-04-10 18:00:34 +08:00
|
|
|
|
default:
|
2024-04-11 10:45:05 +08:00
|
|
|
|
return "";
|
2024-04-10 18:00:34 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 计算 num
|
2024-04-18 09:26:36 +08:00
|
|
|
|
computeNum(data) {
|
2024-04-10 18:00:34 +08:00
|
|
|
|
const self = this;
|
|
|
|
|
let new_product = data.map(item => {
|
|
|
|
|
let result = item.voucher.reduce((acc, curr) => {
|
|
|
|
|
let existingObj = acc.find(obj => obj.status === curr.status);
|
|
|
|
|
if (existingObj) {
|
|
|
|
|
existingObj.num++;
|
2024-04-11 10:45:05 +08:00
|
|
|
|
existingObj.text = self.formatStatusText(existingObj.status);
|
2024-04-10 18:00:34 +08:00
|
|
|
|
} else {
|
|
|
|
|
acc.push({ status: curr.status, num: 1, text: self.formatStatusText(curr.status) });
|
|
|
|
|
}
|
|
|
|
|
return acc;
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
item.voucher = result;
|
2024-04-11 10:45:05 +08:00
|
|
|
|
return item;
|
|
|
|
|
});
|
2024-04-10 18:00:34 +08:00
|
|
|
|
return new_product;
|
|
|
|
|
}
|
2024-04-09 20:17:17 +08:00
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
</html>
|