Compare commits
2 Commits
8d3c78def5
...
699c7f4cb1
Author | SHA1 | Date |
---|---|---|
zhangguoping | 699c7f4cb1 | |
zhangguoping | 7452f8924d |
|
@ -10,7 +10,9 @@ export enum Api {
|
||||||
// 模板查询
|
// 模板查询
|
||||||
GET_THEME = "/v1/theme",
|
GET_THEME = "/v1/theme",
|
||||||
// 兑换
|
// 兑换
|
||||||
EXCHANGE = "/v1/order/exchange"
|
EXCHANGE = "/v1/order/exchange",
|
||||||
|
// 商品详情查询
|
||||||
|
DETAIL_QUERY = "/v1/goods/detail",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,3 +25,5 @@ export const DETAIL = (data?: any) => request.get(Api.DETAIL, data);
|
||||||
export const GET_THEME = (data?: any) => request.get(Api.GET_THEME, data);
|
export const GET_THEME = (data?: any) => request.get(Api.GET_THEME, data);
|
||||||
|
|
||||||
export const EXCHANGE = (data?: any) => request.post(Api.EXCHANGE, data);
|
export const EXCHANGE = (data?: any) => request.post(Api.EXCHANGE, data);
|
||||||
|
|
||||||
|
export const getGoodsDetail = (data?: any) => request.get(Api.DETAIL_QUERY, data);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div id="reduce" :style="{ paddingTop: outTime.length > 0 ? '0' : '21px' }">
|
<div id="reduce" :style="{ paddingTop: '21px' }">
|
||||||
<!-- 弹出框 -->
|
<!-- 弹出框 -->
|
||||||
<div class="mask" v-if="maskshow"></div>
|
<div class="mask" v-if="maskshow"></div>
|
||||||
<!-- 单条弹出框 -->
|
<!-- 单条弹出框 -->
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
{{ promttip }}
|
{{ promttip }}
|
||||||
</div> -->
|
</div> -->
|
||||||
<!-- 弹出提示 -->
|
<!-- 弹出提示 -->
|
||||||
<div
|
<!-- <div
|
||||||
class="popboxshow"
|
class="popboxshow"
|
||||||
v-if="popboxshow"
|
v-if="popboxshow"
|
||||||
:class="popboxshow ? 'active' : ''"
|
:class="popboxshow ? 'active' : ''"
|
||||||
|
@ -16,16 +16,16 @@
|
||||||
<p>{{ tiptext }}</p>
|
<p>{{ tiptext }}</p>
|
||||||
<span @click="knowFn">知道了</span>
|
<span @click="knowFn">知道了</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
<!-- 复制提示 -->
|
<!-- 复制提示 -->
|
||||||
<div class="popboxshow" v-if="copyshow" :class="copyshow ? 'active' : ''">
|
<!-- <div class="popboxshow" v-if="copyshow" :class="copyshow ? 'active' : ''">
|
||||||
<div class="tip">
|
<div class="tip">
|
||||||
<p>请点击下方[复制]按钮,复制链接到浏览器打开!</p>
|
<p>请点击下方[复制]按钮,复制链接到浏览器打开!</p>
|
||||||
<span @click="copyFn">复制</span>
|
<span @click="copyFn">复制</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div class="countdown" v-if="outTime.length > 0">
|
<!-- <div class="countdown" v-if="outTime.length > 0">
|
||||||
<span>链接有效期:</span>
|
<span>链接有效期:</span>
|
||||||
<p>{{ outTime[0] }}</p>
|
<p>{{ outTime[0] }}</p>
|
||||||
时
|
时
|
||||||
|
@ -33,9 +33,9 @@
|
||||||
分
|
分
|
||||||
<p>{{ outTime[2] }}</p>
|
<p>{{ outTime[2] }}</p>
|
||||||
秒
|
秒
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div
|
<!-- <div
|
||||||
class="mask"
|
class="mask"
|
||||||
v-if="loading"
|
v-if="loading"
|
||||||
ref="load"
|
ref="load"
|
||||||
|
@ -43,10 +43,10 @@
|
||||||
@mousewheel.prevent
|
@mousewheel.prevent
|
||||||
>
|
>
|
||||||
<preload-component />
|
<preload-component />
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div class="couponShow">
|
<div class="couponShow">
|
||||||
<span>
|
<!-- <span>
|
||||||
<img
|
<img
|
||||||
@click="backgoodsFn"
|
@click="backgoodsFn"
|
||||||
v-if="backAble"
|
v-if="backAble"
|
||||||
|
@ -54,36 +54,36 @@
|
||||||
src="https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/backprepageBtn.png"
|
src="https://lsxdmgoss.oss-cn-chengdu.aliyuncs.com/MarketingSystem/image/front/backprepageBtn.png"
|
||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
</span>
|
</span> -->
|
||||||
<div class="coupon-left">
|
<div class="coupon-left">
|
||||||
<p class="coupon_money" :style="{ fontSize: '32px' }">
|
<p class="coupon_money" :style="{ fontSize: fonts() }">
|
||||||
<span>¥</span>{{ parseFloat(reduceInfo.reduce_amount) }}
|
<span>¥</span>{{ parseFloat(info.amount || 1) }}
|
||||||
</p>
|
</p>
|
||||||
<p class="full_money">
|
<p class="full_money">
|
||||||
满{{ parseFloat(reduceInfo.denomination) }}可用
|
满{{ parseFloat(info.full_amount || 1.01) }}可用
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="coupon-right">
|
<div class="coupon-right">
|
||||||
<p class="title">
|
<p class="title">
|
||||||
{{ reduceInfo.batch_goods_name }}
|
{{ goods.name }}
|
||||||
<span class="send_num" v-if="reduceInfo.send_num > 1"
|
<span class="send_num" v-if="info.send_num > 1"
|
||||||
>x{{ reduceInfo.send_num }}</span
|
>x{{ info.send_num }}</span
|
||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
<p style="font-size: 11px">{{ reduceInfo.card_type }}可用</p>
|
<p style="font-size: 11px">{{ cardType(info.card_type) }}可用</p>
|
||||||
<p class="validity" v-if="receive_time.timer_show != 2">
|
<p class="validity" v-if="info.time_limit.start_date">
|
||||||
有效期:{{ receive_time.effect_time.start_time }}至{{
|
有效期:{{ info.time_limit.start_date }}至{{
|
||||||
receive_time.effect_time.end_time
|
info.time_limit.end_date
|
||||||
}}
|
}}
|
||||||
</p>
|
</p>
|
||||||
<p class="validity" v-if="receive_time.use_time.type == 'received'">
|
<p class="validity" v-if="info.time_limit.receive_type">
|
||||||
领取后{{
|
领取后{{
|
||||||
receive_time.use_time.effect_date_type == 0 ? "立即" : "次日凌晨"
|
info.time_limit.receive_type == 0 ? "立即" : "次日凌晨"
|
||||||
}}生效,有效期 {{ receive_time.use_time.effect_day }}天
|
}}生效,有效期 {{ info.time_limit.receive_day }}天
|
||||||
</p>
|
</p>
|
||||||
<p class="validity" v-if="receive_time.use_time.type == 'fiexd'">
|
<p class="validity" v-if="info.time_limit.start_time">
|
||||||
可用时间:{{ receive_time.use_time.fiexd_time.start_time }}-{{
|
可用时间:{{ info.time_limit.start_time }}-{{
|
||||||
receive_time.use_time.fiexd_time.end_time
|
info.time_limit.end_time
|
||||||
}}
|
}}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -91,7 +91,7 @@
|
||||||
<div
|
<div
|
||||||
class="receiveBtn"
|
class="receiveBtn"
|
||||||
@click="receiveFn"
|
@click="receiveFn"
|
||||||
:class="goodInfo.available != 1 ? 'readOnly' : ''"
|
:class="goods.err_code != 0 ? 'readOnly' : ''"
|
||||||
>
|
>
|
||||||
立即领取
|
立即领取
|
||||||
<!-- {{
|
<!-- {{
|
||||||
|
@ -102,7 +102,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="coupon_explain">
|
<div class="coupon_explain">
|
||||||
<h1>- 兑换说明 -</h1>
|
<h1>- 兑换说明 -</h1>
|
||||||
<div class="content">
|
<!-- <div class="content">
|
||||||
<h3
|
<h3
|
||||||
v-if="
|
v-if="
|
||||||
receive_time.use_time.type == 'week' ||
|
receive_time.use_time.type == 'week' ||
|
||||||
|
@ -137,30 +137,32 @@
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h3>使用须知</h3>
|
<h3>使用须知</h3>
|
||||||
<p v-html="goodInfo.entity.notice" v-if="goodInfo.entity.notice"></p>
|
<p v-html="info.notice" v-if="info.notice"></p>
|
||||||
<p v-else>
|
<p v-else>
|
||||||
1、在{{
|
1、在{{
|
||||||
reduceInfo.channel == 1 ? "支付宝H5" : "微信APP内打开链接"
|
info.channel == 1 ? "支付宝H5" : "微信APP内打开链接"
|
||||||
}},点击【一键领取】完成领取{{
|
}},点击【一键领取】完成领取{{
|
||||||
reduceInfo.channel == 1 ? "支付宝" : "微信"
|
info.channel == 1 ? "支付宝" : "微信"
|
||||||
}}立减金<br />
|
}}立减金<br />
|
||||||
2、{{
|
2、{{
|
||||||
reduceInfo.channel == 1 ? "支付宝" : "微信"
|
info.channel == 1 ? "支付宝" : "微信"
|
||||||
}}立减金一旦领取不可撤销、不可转让。注意不要将兑换券泄露给他人
|
}}立减金一旦领取不可撤销、不可转让。注意不要将兑换券泄露给他人
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h3>使用规则</h3>
|
<h3>使用规则</h3>
|
||||||
<p v-html="goodInfo.instruction"></p>
|
<p v-html="info.instruction" v-if="info.instruction"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import "./index.scss";
|
import "./index.scss";
|
||||||
|
import { getGoodsDetail, EXCHANGE } from "@/router/api";
|
||||||
|
|
||||||
let goodsDetail = 0,
|
let goodsDetail = 0,
|
||||||
goodsCount = 0;
|
goodsCount = 0;
|
||||||
export default {
|
export default {
|
||||||
|
@ -168,155 +170,36 @@ export default {
|
||||||
props: {},
|
props: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
plaflam: 1, //支付宝
|
// 新版
|
||||||
promtshow: false,
|
goodsID: 0, // 商品ID
|
||||||
promttip: "警告提示",
|
// 立减金商品信息
|
||||||
copyshow: false, //解决ios,必须触发按钮复制
|
info: {
|
||||||
copyLink: "", //存储链接
|
amount: 1, // 金额
|
||||||
popboxshow: false,
|
full_amount: 1.01, // 满减金额
|
||||||
maskshow: false,
|
send_num: 1, // 多少张立减金
|
||||||
openId: localStorage.getItem("openid"),
|
card_type: ["1"], // 卡种类型
|
||||||
bindClick: false,
|
// 领取时间
|
||||||
tiptext: "错误提示",
|
time_limit: {},
|
||||||
goodInfo: {
|
},
|
||||||
available: 0,
|
goods: {
|
||||||
instruction: "",
|
name: "立减金", // 商品名称
|
||||||
entity: {
|
|
||||||
notice: "",
|
|
||||||
},
|
|
||||||
}, //商品信息
|
|
||||||
reduceInfo: {
|
|
||||||
channel: 1,
|
|
||||||
reduce_amount: "",
|
|
||||||
denomination: "",
|
|
||||||
batch_goods_name: "",
|
|
||||||
send_num: 0,
|
|
||||||
card_type: 1,
|
|
||||||
}, //券信息
|
|
||||||
orderId: "",
|
|
||||||
backAble: true,
|
|
||||||
loading: false,
|
|
||||||
outTime: [],
|
|
||||||
receive_time: {
|
|
||||||
timer_show: 1,
|
|
||||||
use_time: {
|
|
||||||
week: "",
|
|
||||||
day: "",
|
|
||||||
time: "",
|
|
||||||
type: "",
|
|
||||||
effect_date_type: 0,
|
|
||||||
effect_day: 0,
|
|
||||||
fiexd_time: { start_time: "", end_time: "" },
|
|
||||||
},
|
|
||||||
effect_time: { start_time: "", end_time: "" },
|
|
||||||
}, //领取立减金时间
|
|
||||||
tip: `1、立减金自领取之日起0天有效,请在有效期内使用<br />
|
|
||||||
2、微信立减金自领取后每个立减金一次性使用,不兑换,不找零,到期后自动失效,逾期未使用不再补发。使用微信支付进行付款(大于立减金面额0.01元以上)即可自动抵扣<br />
|
|
||||||
3、多张立减金可在单笔微信支付订单中一起使用,但当用户的立减金超过8张时,系统会选取其中一部分使用,不保证在一张订单中全部使用<br />
|
|
||||||
4、在中国境内商户使用微信支付即可使用,少数特定商户(包括但不限于:CoCo奶茶、优衣库、星巴克、肯德基、必胜客、同程艺龙、热风、太平鸟、孩子王、航联保险、华为商城、Miss
|
|
||||||
Sixty、Ochirly、Apple商城、FivePlus、信用卡还款、零钱通、理财通等)、以及社交支付(如转账、红包、个人收款码支付等)及合单支付(微信支付订单号为44开头的交易)无法使用立减金<br />
|
|
||||||
5、使用立减金的微信支付订单,如发生全额退款,且立减金仍在有效期内,立减金将自动退还给用户,如立减金已过期,则不退还给用户;如发生部分退款,用户支付金额将按比例原路退还,立减金将不退还给用户<br />`,
|
|
||||||
goodsInfo: {
|
|
||||||
id: 68147,
|
|
||||||
type: 2,
|
|
||||||
code_batch_id: 9164,
|
|
||||||
weight: 0,
|
|
||||||
delete_time: null,
|
|
||||||
stock: 100,
|
|
||||||
entity: {
|
|
||||||
id: 2776,
|
|
||||||
goods_id: 68147,
|
|
||||||
channel: 1,
|
|
||||||
channel_activity_id: "23232323221jjk",
|
|
||||||
batch_goods_name: "支付宝立减金",
|
|
||||||
price: "10.0000",
|
|
||||||
recharge_amount: "100.00",
|
|
||||||
frozen_amount: "0.0000",
|
|
||||||
balance: "100.0000",
|
|
||||||
used_amount: "0.0000",
|
|
||||||
denomination: "1.01",
|
|
||||||
reduce_amount: "1.00",
|
|
||||||
all_budget: "100.00",
|
|
||||||
day_budget: "100.00",
|
|
||||||
receive_conf: { num: "1", type: "all" },
|
|
||||||
card_type: ["1"],
|
|
||||||
natural_limit: 1,
|
|
||||||
brush_limit: 1,
|
|
||||||
time_limit: {
|
|
||||||
use_time: {
|
|
||||||
type: "received",
|
|
||||||
effect_day: "1",
|
|
||||||
fiexd_time: [],
|
|
||||||
effect_date_type: "0",
|
|
||||||
},
|
|
||||||
timer_show: "1",
|
|
||||||
effect_time: {
|
|
||||||
end_time: "2024-09-30 23:59:59",
|
|
||||||
start_time: "2024-08-28 11:41:36",
|
|
||||||
},
|
|
||||||
receive_time: [],
|
|
||||||
},
|
|
||||||
instruction:
|
|
||||||
"<p>1、立减金自领取之日起7天有效,请在有效期内使用\n<br/>2、支付宝立减金自领取后每个立减金一次性使用,不兑换、不找零,到期后自动失效,逾期未使用不再补发。使用支付宝支付进行付款(大于立减金面额0.01元以上)即可自动抵扣\n<br/>3、多张立减金可在单笔支付宝支付订单中一起使用,但当用户的立减金超过8张时,系统会选取其中一部分使用,不保证在一张订单中全部使用\n<br/>4、使用立减金的支付宝支付订单,如发生全额退款,且立减金仍在有效期内,立减金将自动退还给用户,如立减金已过期,则不退还给用户;如发生部分退款,用户支付金额将按比例原路退还,立减金将不退还给用户</p>",
|
|
||||||
early_per: ["1"],
|
|
||||||
early_notifier: [{ mobile: "18202818112", real_name: "张城" }],
|
|
||||||
last_early_per: 0,
|
|
||||||
temp_no: "23232323",
|
|
||||||
create_time: "2024-08-28 11:46:17",
|
|
||||||
delete_time: null,
|
|
||||||
provider: "lsxd",
|
|
||||||
receive_mode: 1,
|
|
||||||
send_num: 1,
|
|
||||||
is_webview: 0,
|
|
||||||
notice:
|
|
||||||
"<p>1、在支付宝H5内打开链接,点击【一键领取】完成领取支付宝立减金<br/>\n2、支付宝立减金一旦领取不可撤销、不可转让。注意不要将兑换券泄露给他人</p>",
|
|
||||||
voucher_batch: ["23232323221jjk"],
|
|
||||||
},
|
|
||||||
begin_time: "2024-08-23 15:19:10",
|
|
||||||
end_time: "2024-09-30 23:59:59",
|
|
||||||
available: 1,
|
|
||||||
exchange: 0,
|
|
||||||
product_id: 68147,
|
|
||||||
key: "AAACsHAafZqcB5vd",
|
|
||||||
instruction:
|
|
||||||
"<p>1、立减金自领取之日起7天有效,请在有效期内使用\n<br/>2、支付宝立减金自领取后每个立减金一次性使用,不兑换、不找零,到期后自动失效,逾期未使用不再补发。使用支付宝支付进行付款(大于立减金面额0.01元以上)即可自动抵扣\n<br/>3、多张立减金可在单笔支付宝支付订单中一起使用,但当用户的立减金超过8张时,系统会选取其中一部分使用,不保证在一张订单中全部使用\n<br/>4、使用立减金的支付宝支付订单,如发生全额退款,且立减金仍在有效期内,立减金将自动退还给用户,如立减金已过期,则不退还给用户;如发生部分退款,用户支付金额将按比例原路退还,立减金将不退还给用户</p>",
|
|
||||||
recharge_type: 1,
|
|
||||||
origin_price: "1.00",
|
|
||||||
coupon_price: "1.00",
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
async created() {
|
||||||
document.title = localStorage.getItem("title") || "";
|
this.goodsID = localStorage.getItem("id") || 810;
|
||||||
/* 获取立减金信息*/
|
const { code, data } = await getGoodsDetail({ id: this.goodsID });
|
||||||
let goodsDetail = this.goodsInfo;
|
if (code === 200) {
|
||||||
this.goodInfo = goodsDetail;
|
Object.assign(this.info, data.info, {
|
||||||
/*默认显示*/
|
time_limit: data.info.time_limit
|
||||||
// if (goodsDetail.available != 1) {
|
? JSON.parse(data.info.time_limit)
|
||||||
// this.openErrorDialog(product_status(goodsDetail.available, goodsDetail));
|
: {},
|
||||||
// this.bindClick = true;
|
card_type: data.info.card_type || ["1"],
|
||||||
// }
|
});
|
||||||
const goodsCount: any = sessionStorage.getItem("goodsCount") || 12;
|
Object.assign(this.goods, data.goods);
|
||||||
this.backAble = goodsCount > 1; //多个商品才有返回
|
|
||||||
Object.assign(this.reduceInfo, goodsDetail.entity);
|
|
||||||
this.plaflam = goodsDetail.entity.channel;
|
|
||||||
if (
|
|
||||||
goodsDetail.entity.time_limit.use_time &&
|
|
||||||
goodsDetail.entity.time_limit.use_time.type == "week"
|
|
||||||
) {
|
|
||||||
//处理星期连贯操作
|
|
||||||
// goodsDetail.entity.time_limit.use_time.week = sortWeeks(
|
|
||||||
// goodsDetail.entity.time_limit.use_time.week
|
|
||||||
// );
|
|
||||||
}
|
}
|
||||||
Object.assign(this.receive_time, goodsDetail.entity.time_limit);
|
|
||||||
|
|
||||||
/* 倒计时 */
|
|
||||||
const key_expiration_time =
|
|
||||||
sessionStorage.getItem("key_expiration_time") || 0;
|
|
||||||
this.outTime = [];
|
|
||||||
},
|
},
|
||||||
filters: {
|
methods: {
|
||||||
cardType(val: any[]) {
|
cardType(val: any[]) {
|
||||||
return val
|
return val
|
||||||
.map((item) => {
|
.map((item) => {
|
||||||
|
@ -324,8 +207,6 @@ export default {
|
||||||
})
|
})
|
||||||
.join(" ");
|
.join(" ");
|
||||||
},
|
},
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
globalFormatStatus(type: any) {
|
globalFormatStatus(type: any) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -343,10 +224,23 @@ export default {
|
||||||
history.go(-2);
|
history.go(-2);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
receiveFn() {
|
async receiveFn() {
|
||||||
if (this.loading) return;
|
|
||||||
this.loading = true;
|
|
||||||
let self = this;
|
let self = this;
|
||||||
|
if (this.goods.err_code != 0) {
|
||||||
|
return showToast(this.goods.reason);
|
||||||
|
}
|
||||||
|
const params = {
|
||||||
|
id: [this.goodsID],
|
||||||
|
key:
|
||||||
|
localStorage.getItem("key") ||
|
||||||
|
"rPBVzOCs0FN4P7jNMqHo5IVfb0oaAyigbfNBmCKnavs=",
|
||||||
|
account: "123",
|
||||||
|
name: "123",
|
||||||
|
};
|
||||||
|
const res = await EXCHANGE(params);
|
||||||
|
// if(res.code === 200) {
|
||||||
|
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
|
|
||||||
/* 公众号领取 */
|
/* 公众号领取 */
|
||||||
|
@ -404,11 +298,10 @@ export default {
|
||||||
|
|
||||||
/* 动态font */
|
/* 动态font */
|
||||||
fonts() {
|
fonts() {
|
||||||
const defaultCss = "0.32rem";
|
const defaultCss = "32px";
|
||||||
const count =
|
const count = String(parseFloat(this.info.amount || 1)).length + 1;
|
||||||
String(parseFloat(this.reduceInfo.reduce_amount)).length + 1;
|
|
||||||
if (count > 4) {
|
if (count > 4) {
|
||||||
return 0.32 - ((count - 3) / 100) * 2.2 + "rem";
|
return 32 - (count - 3) * 2.2 + "px";
|
||||||
} else {
|
} else {
|
||||||
return defaultCss;
|
return defaultCss;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue