Files
lucky_shop/pages_order/payment.vue
ZF sun 8e218bb663 feat: 新增多语言国际化页面配置,修复部分页面硬编码文案
1. 新增了zh-cn和en-us两套语言下的大量页面国际化配置文件,覆盖商品、订单、会员、营销活动等多个业务模块
2. 修复了分销页面、VR页面、支付页面、商品不存在页面的硬编码提示文案,替换为国际化调用
3. 删除了原有的i18n检查脚本文件
2026-06-25 11:00:50 +08:00

110 lines
3.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view :style="themeColor">
<common-payment :api="api" create-data-key="orderCreateData" ref="payment"></common-payment>
</view>
</template>
<script>
import commonPayment from './_components/common-payment/common-payment.vue';
export default {
components: {
commonPayment
},
data() {
return {
api: {
payment: '/api/ordercreate/payment',
calculate: '/api/ordercreate/calculate',
create: '/api/ordercreate/create',
}
}
},
provide() {
return {
promotion: this.promotion.bind(this)
}
},
onShow() {
if (this.$refs.payment) this.$refs.payment.pageShow();
},
methods: {
/**
* 处理活动信息 如不需要则定义为空方法
*/
promotion(data){
if (data.promotion && data.promotion.manjian && data.promotion.manjian.length) {
let promotionStr = {title: `满减送`, content: ''}
data.promotion.manjian.forEach((mItem,mIndex)=>{
let promotion = '';
let content = {};
let limit = mItem.type == 0 ? '元' : '件';
if(mItem.rule){
var item = mItem.discount_array.rule;
item.limit = mItem.type == 0 ? parseFloat(item.limit).toFixed(2) : parseInt(item.limit);
// 满减
if (item.discount_money != undefined) {
if (content.manjian == undefined) {
content.manjian = '购买可享受满' + item.limit + limit + '减' + item.discount_money + '元';
} else {
content.manjian += ';满' + item.limit + limit + '减' + item.discount_money + '元';
}
}
// 满送优惠券
if (item.coupon && item.coupon_list) {
let text = '';
item.coupon_list.forEach((couponItem, couponIndex) => {
if (couponItem.type == 'discount') {
if (text == '') text = '送'+ couponItem.give_num +'张' + parseFloat(couponItem.discount) + '折优惠券';
else text += '、送'+ couponItem.give_num +'张' + parseFloat(couponItem.discount) + '折优惠券';
} else {
if (text == '') text = '送'+ couponItem.give_num +'张' + parseFloat(couponItem.money) + '元优惠券';
else text += '、送'+ couponItem.give_num +'张' + parseFloat(couponItem.money) + '元优惠券';
}
})
if (content.mansong == undefined) {
content.mansong = '购物满' + item.limit + limit + text;
} else {
content.mansong += ';' + '满' + item.limit + limit + text;
}
}
// 满送积分
if (item.point) {
let point_text = '可得' + item.point + '积分';
if(content.point_text == undefined) {
content.point_text = '购物满' + item.limit + limit + point_text
}else {
content.point_text += ';' + '满' + item.limit + limit + point_text;
}
}
// 包邮
if (item.free_shipping != undefined) {
if (content.free_shipping == undefined) {
content.free_shipping = '购物满' + item.limit + limit + '包邮';
}
}
}
promotion = Object.values(content).join('\n');
promotionStr.content = promotionStr.content + promotion + '\n';
})
return (promotionStr.content ? promotionStr : null);
}
}
}
};
</script>
<style scoped lang="scss">
::v-deep .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
background: none;
max-height: unset !important;
overflow-y: hidden !important;
}
::v-deep .uni-popup__wrapper {
border-radius: 20rpx 20rpx 0 0;
}
::v-deep .uni-popup {
z-index: 8;
}
</style>