feat: 新增多语言国际化页面配置,修复部分页面硬编码文案
1. 新增了zh-cn和en-us两套语言下的大量页面国际化配置文件,覆盖商品、订单、会员、营销活动等多个业务模块 2. 修复了分销页面、VR页面、支付页面、商品不存在页面的硬编码提示文案,替换为国际化调用 3. 删除了原有的i18n检查脚本文件
This commit is contained in:
@@ -18,9 +18,9 @@
|
||||
<text class="iconfont" :class="payIndex == index ? 'icon-yuan_checked color-base-text' : 'icon-checkboxblank'"></text>
|
||||
</view>
|
||||
</view>
|
||||
<button type="primary" @click="confirm">{{ $lang("common.ns-payment.l39.t0") }}</button>
|
||||
<button type="primary" @click="confirm">确认支付</button>
|
||||
</block>
|
||||
<view v-else class="empty">{{ $lang("tool.pay.cashier.l23.t0") }}</view>
|
||||
<view v-else class="empty">店铺尚未配置支付方式!</view>
|
||||
</block>
|
||||
<ns-empty text="该支付单据已支付" :is-index="true" v-else></ns-empty>
|
||||
</block>
|
||||
@@ -40,12 +40,12 @@ export default {
|
||||
// #ifdef H5
|
||||
payTypeList: [
|
||||
{
|
||||
name: $lang('common.ns-payment.l75.t0'),
|
||||
name: '支付宝支付',
|
||||
icon: 'icon-zhifubaozhifu-',
|
||||
type: 'alipay'
|
||||
},
|
||||
{
|
||||
name: $lang('common.ns-payment.l80.t0'),
|
||||
name: '微信支付',
|
||||
icon: 'icon-weixin1',
|
||||
type: 'wechatpay'
|
||||
}
|
||||
@@ -54,7 +54,7 @@ export default {
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
payTypeList: [{
|
||||
name: $lang('common.ns-payment.l80.t0'),
|
||||
name: '微信支付',
|
||||
provider: 'wxpay',
|
||||
icon: 'icon-weixin1',
|
||||
type: 'wechatpay'
|
||||
@@ -131,12 +131,12 @@ export default {
|
||||
}
|
||||
if (this.payTypeList.length == 0 && this.payInfo.pay_money > 0) {
|
||||
this.$util.showToast({
|
||||
title: $lang('common.ns-payment.l161.t0')
|
||||
title: '请选择支付方式!'
|
||||
});
|
||||
return;
|
||||
}
|
||||
uni.showLoading({
|
||||
title: $lang('common.ns-payment.l166.t0'),
|
||||
title: '支付中...',
|
||||
mask: true
|
||||
});
|
||||
this.pay();
|
||||
@@ -265,7 +265,7 @@ export default {
|
||||
fail: res => {
|
||||
this.flag = false;
|
||||
if (res.errMsg == 'requestPayment:fail cancel') {
|
||||
this.$util.showToast({ title: $lang('common.ns-payment.l298.t0') });
|
||||
this.$util.showToast({ title: '您已取消支付' });
|
||||
} else {
|
||||
uni.showModal({ content: '支付失败,失败原因: ' + res.errMsg, showCancel: false });
|
||||
}
|
||||
|
||||
@@ -1,143 +1,143 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<scroll-view scroll-y="true" class="pay-container">
|
||||
<view class="payment-amount">
|
||||
<text class="amount-tit">{{ $lang('order.list.payment_amount') }}</text>
|
||||
<view class="amount-num">
|
||||
{{ $lang('common.currency_symbol') }}
|
||||
<text>{{ payInfo.pay_money }}</text>
|
||||
</view>
|
||||
<view class="payment-name">{{ payInfo.pay_body }}</view>
|
||||
</view>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
isIphoneX: false,
|
||||
payInfo: {},
|
||||
outTradeNo: '',
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.code) this.outTradeNo = option.code;
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
},
|
||||
onShow() {
|
||||
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.getPayInfo();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getPayInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/pay/info',
|
||||
data: {
|
||||
out_trade_no: this.outTradeNo
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.payInfo = res.data;
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: $lang('common.ns-payment.l185.t0')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.pay-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
@mixin flex-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@mixin flex-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.payment-amount {
|
||||
@include flex-column;
|
||||
margin: $margin-updown $margin-both;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx 0 58rpx 0;
|
||||
background-color: #fff;
|
||||
|
||||
.amount-tit {
|
||||
font-size: $font-size-base;
|
||||
color: #838383;
|
||||
line-height: 1;
|
||||
margin-top: 44rpx;
|
||||
}
|
||||
|
||||
.amount-num {
|
||||
color: #000;
|
||||
margin-top: 36rpx;
|
||||
line-height: 1;
|
||||
|
||||
text {
|
||||
font-size: $font-size-toolbar;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
.amount-desc {
|
||||
font-size: $font-size-tag;
|
||||
color: #838383;
|
||||
padding: 0 40rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
|
||||
text {
|
||||
width: 100%;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.payment-name {
|
||||
width: 90%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: #838383;
|
||||
margin-top: 30rpx;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<scroll-view scroll-y="true" class="pay-container">
|
||||
<view class="payment-amount">
|
||||
<text class="amount-tit">{{ $lang('paymentAmount') }}</text>
|
||||
<view class="amount-num">
|
||||
{{ $lang('common.currencySymbol') }}
|
||||
<text>{{ payInfo.pay_money }}</text>
|
||||
</view>
|
||||
<view class="payment-name">{{ payInfo.pay_body }}</view>
|
||||
</view>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
isIphoneX: false,
|
||||
payInfo: {},
|
||||
outTradeNo: '',
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.code) this.outTradeNo = option.code;
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
},
|
||||
onShow() {
|
||||
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.getPayInfo();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getPayInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/pay/info',
|
||||
data: {
|
||||
out_trade_no: this.outTradeNo
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.payInfo = res.data;
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '未获取到支付信息!'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.pay-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
@mixin flex-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@mixin flex-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.payment-amount {
|
||||
@include flex-column;
|
||||
margin: $margin-updown $margin-both;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx 0 58rpx 0;
|
||||
background-color: #fff;
|
||||
|
||||
.amount-tit {
|
||||
font-size: $font-size-base;
|
||||
color: #838383;
|
||||
line-height: 1;
|
||||
margin-top: 44rpx;
|
||||
}
|
||||
|
||||
.amount-num {
|
||||
color: #000;
|
||||
margin-top: 36rpx;
|
||||
line-height: 1;
|
||||
|
||||
text {
|
||||
font-size: $font-size-toolbar;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
.amount-desc {
|
||||
font-size: $font-size-tag;
|
||||
color: #838383;
|
||||
padding: 0 40rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
|
||||
text {
|
||||
width: 100%;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.payment-name {
|
||||
width: 90%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: #838383;
|
||||
margin-top: 30rpx;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,345 +1,345 @@
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<template v-if="payInfo.pay_status != undefined">
|
||||
<view class="result-box">
|
||||
<template v-if="payInfo.pay_status">
|
||||
<image :src="$util.img('public/uniapp/pay/pay_success.png')" mode="widthFix" lazy-load="true" class="result-image" show-menu-by-longpress/>
|
||||
<view class="msg success">{{ $lang('order.list.payment_success') }}</view>
|
||||
<view class="pay-amount">
|
||||
<text class="unit price-style small">{{ $lang('common.currency_symbol') }}</text>
|
||||
<text class="price-style large">{{ parseFloat(payInfo.pay_money).toFixed(2).split(".")[0] }}</text>
|
||||
<text class="price-style small">.{{ parseFloat(payInfo.pay_money).toFixed(2).split(".")[1] }}</text>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<image :src="$util.img('public/uniapp/pay/pay_fail.png')" mode="widthFix" class="result-image" show-menu-by-longpress/>
|
||||
<view class="msg fail">{{ $lang('order.list.payment_fail') }}</view>
|
||||
</template>
|
||||
|
||||
<view class="consume-box" v-if="addonIsExist.memberconsume && consumeStatus == 1 && payInfo.pay_status">
|
||||
<view class="consume-head">
|
||||
<view class="consume-head-text">{{ $lang("tool.pay.result.l21.t0") }}</view>
|
||||
</view>
|
||||
<view class="consume-list">
|
||||
<view class="consume-item" v-if="consumeInfo.point_num > 0">
|
||||
<image :src="$util.img('public/uniapp/pay/point.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="consume-value color-base-text">{{ consumeInfo.point_num }}</view>
|
||||
<view class="consume-type">{{ $lang("common.register-reward.l19.t0") }}</view>
|
||||
</view>
|
||||
<view class="consume-item" v-if="consumeInfo.growth_num > 0">
|
||||
<image :src="$util.img('public/uniapp/pay/growth.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="consume-value color-base-text">{{ consumeInfo.growth_num }}</view>
|
||||
<view class="consume-type">{{ $lang("common.register-reward.l27.t0") }}</view>
|
||||
</view>
|
||||
<view class="consume-item" v-if="consumeInfo.coupon_list.length > 0">
|
||||
<image :src="$util.img('public/uniapp/pay/coupon.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="consume-value color-base-text">{{ consumeInfo.coupon_list.length }}</view>
|
||||
<view class="consume-type">{{ $lang("tool.pay.result.l37.t0") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="action">
|
||||
<template v-if="storeToken">
|
||||
<view v-if="paySource == 'recharge'" class="btn" @click="toRecharge()">{{ $lang("member.balance.l56") }}</view>
|
||||
<view v-else-if="paySource == 'membercard'" class="btn" @click="toCard()">{{ $lang("order._components.common-payment.l393.t0") }}</view>
|
||||
<view v-else-if="paySource == 'presale'" class="btn" @click="toPresaleOrder()">{{ $lang("tool.pay.result.l46.t0") }}</view>
|
||||
<view v-else-if="paySource == 'giftcard'" class="btn" @click="toOrder()">{{ $lang("tool.pay.result.l46.t0") }}</view>
|
||||
<view v-else-if="paySource == 'pointexchange'" class="btn" @click="toExchangeOrder()">查看订单
|
||||
</view>
|
||||
<view v-else class="btn" @click="toOrderDetail(payInfo.order_id)">{{ $lang("tool.pay.result.l46.t0") }}</view>
|
||||
</template>
|
||||
<view class="btn go-home" @click="goHome()">{{ $lang('common.empty.goHome') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<ns-goods-recommend route="pay"></ns-goods-recommend>
|
||||
</template>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
payInfo: {},
|
||||
outTradeNo: '',
|
||||
paySource: '',
|
||||
consumeInfo: {},
|
||||
consumeStatus: 0,
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.code) this.outTradeNo = option.code;
|
||||
this.paySource = uni.getStorageSync('paySource');
|
||||
},
|
||||
onShow() {
|
||||
this.getPayInfo();
|
||||
this.getConsume();
|
||||
},
|
||||
methods: {
|
||||
consume(type) {
|
||||
switch (type) {
|
||||
case 'point':
|
||||
this.$util.redirectTo('/pages_tool/member/point_detail', {});
|
||||
break;
|
||||
case 'growth':
|
||||
this.$util.redirectTo('/pages_tool/member/level', {});
|
||||
break;
|
||||
case 'coupon':
|
||||
this.$util.redirectTo('/pages_tool/member/coupon', {});
|
||||
break;
|
||||
default:
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, 'reLaunch');
|
||||
break;
|
||||
}
|
||||
},
|
||||
getConsume() {
|
||||
this.$api.sendRequest({
|
||||
url: '/memberconsume/api/config/info',
|
||||
data: {
|
||||
out_trade_no: this.outTradeNo
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
let reward = res.data.value;
|
||||
if (res.data.is_use && (reward.point_num > 0 || reward.growth_num > 0 || reward.coupon_list.length)) {
|
||||
this.consumeStatus = res.data.is_use;
|
||||
this.consumeInfo = res.data.value;
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
getPayInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/pay/info',
|
||||
data: {
|
||||
out_trade_no: this.outTradeNo
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.payInfo = res.data;
|
||||
this.payInfo.pay_money = parseFloat(res.data.pay_money);
|
||||
this.payInfo.pay_money += parseFloat(res.data.balance);
|
||||
this.payInfo.pay_money += parseFloat(res.data.balance_money);
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: $lang('common.ns-payment.l185.t0')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL, {}, 'reLaunch');
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
goHome() {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL, {}, 'reLaunch');
|
||||
},
|
||||
toOrderDetail(id) {
|
||||
if (this.payInfo.order_type == 2) {
|
||||
this.$util.redirectTo('/pages_order/detail_pickup', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
} else if (this.payInfo.order_type == 3) {
|
||||
this.$util.redirectTo('/pages_order/detail_local_delivery', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
} else if (this.payInfo.order_type == 4) {
|
||||
this.$util.redirectTo('/pages_tool/order/detail_virtual', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
}
|
||||
},
|
||||
toOrder(id) {
|
||||
this.$util.redirectTo('/pages_promotion/giftcard/order_list', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
},
|
||||
toRecharge() {
|
||||
this.$util.redirectTo('/pages_tool/recharge/order_list', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
},
|
||||
toCard() {
|
||||
this.$util.redirectTo('/pages_tool/member/card', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
},
|
||||
toPresaleOrder() {
|
||||
this.$util.redirectTo('/pages_promotion/presale/order_list', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
},
|
||||
toExchangeOrder() {
|
||||
this.$util.redirectTo('/pages_promotion/point/order_list', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.consume-box {
|
||||
padding: $padding;
|
||||
background: #F8F8F8;
|
||||
width: calc(100% - 48rpx);
|
||||
margin: 0 24rpx 0 24rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.consume-head {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
|
||||
.consume-head-text {
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.consume-list {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.consume-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: $color-title;
|
||||
font-size: $font-size-base;
|
||||
margin-top: 10rpx;
|
||||
|
||||
image {
|
||||
width: 24rpx;
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
|
||||
.consume-value {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.consume-remark {
|
||||
color: $color-tip;
|
||||
font-size: $font-size-tag;
|
||||
padding: 10rpx 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.result-box {
|
||||
padding-top: 94rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background-color: #FFFFFF;
|
||||
width: 100%;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.result-image {
|
||||
width: 80rpx;
|
||||
height: auto;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.msg {
|
||||
font-size: 32rpx;
|
||||
margin-top: 25rpx;
|
||||
|
||||
&.success {
|
||||
color: #09BB07;
|
||||
}
|
||||
|
||||
&.fail {
|
||||
// P0: 失败提示色 → var(--base-color)
|
||||
// 兼容: 微信小程序 / 鸿蒙元服务 — color 接受 var() 无问题
|
||||
color: var(--base-color, #FF4646);
|
||||
}
|
||||
}
|
||||
|
||||
.pay-amount {
|
||||
font-size: 30rpx;
|
||||
margin: 40rpx 0 24rpx 0;
|
||||
font-weight: 600;
|
||||
line-height: 50rpx;
|
||||
|
||||
text {
|
||||
color: #333333 !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
.unit {
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
|
||||
.large {
|
||||
font-size: 60rpx !important;
|
||||
}
|
||||
|
||||
.small {
|
||||
font-size: 36rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
.action {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
margin-top: 24rpx;
|
||||
|
||||
.btn {
|
||||
font-size: 30rpx;
|
||||
width: 200rpx;
|
||||
height: 66rpx;
|
||||
line-height: 66rpx;
|
||||
text-align: center;
|
||||
border-radius: 66rpx;
|
||||
border: 1px solid $color-tip;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:last-child {
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.go-home {
|
||||
background-color: $base-color;
|
||||
color: #fff;
|
||||
border-color: $base-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .goods-recommend {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
::v-deep .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
}
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<template v-if="payInfo.pay_status != undefined">
|
||||
<view class="result-box">
|
||||
<template v-if="payInfo.pay_status">
|
||||
<image :src="$util.img('public/uniapp/pay/pay_success.png')" mode="widthFix" lazy-load="true" class="result-image" show-menu-by-longpress/>
|
||||
<view class="msg success">{{ $lang('paymentSuccess') }}</view>
|
||||
<view class="pay-amount">
|
||||
<text class="unit price-style small">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text class="price-style large">{{ parseFloat(payInfo.pay_money).toFixed(2).split(".")[0] }}</text>
|
||||
<text class="price-style small">.{{ parseFloat(payInfo.pay_money).toFixed(2).split(".")[1] }}</text>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<image :src="$util.img('public/uniapp/pay/pay_fail.png')" mode="widthFix" class="result-image" show-menu-by-longpress/>
|
||||
<view class="msg fail">{{ $lang('paymentFail') }}</view>
|
||||
</template>
|
||||
|
||||
<view class="consume-box" v-if="addonIsExist.memberconsume && consumeStatus == 1 && payInfo.pay_status">
|
||||
<view class="consume-head">
|
||||
<view class="consume-head-text">恭喜您获得</view>
|
||||
</view>
|
||||
<view class="consume-list">
|
||||
<view class="consume-item" v-if="consumeInfo.point_num > 0">
|
||||
<image :src="$util.img('public/uniapp/pay/point.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="consume-value color-base-text">{{ consumeInfo.point_num }}</view>
|
||||
<view class="consume-type">积分</view>
|
||||
</view>
|
||||
<view class="consume-item" v-if="consumeInfo.growth_num > 0">
|
||||
<image :src="$util.img('public/uniapp/pay/growth.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="consume-value color-base-text">{{ consumeInfo.growth_num }}</view>
|
||||
<view class="consume-type">成长值</view>
|
||||
</view>
|
||||
<view class="consume-item" v-if="consumeInfo.coupon_list.length > 0">
|
||||
<image :src="$util.img('public/uniapp/pay/coupon.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="consume-value color-base-text">{{ consumeInfo.coupon_list.length }}</view>
|
||||
<view class="consume-type">张优惠券</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="action">
|
||||
<template v-if="storeToken">
|
||||
<view v-if="paySource == 'recharge'" class="btn" @click="toRecharge()">充值记录</view>
|
||||
<view v-else-if="paySource == 'membercard'" class="btn" @click="toCard()">会员卡</view>
|
||||
<view v-else-if="paySource == 'presale'" class="btn" @click="toPresaleOrder()">查看订单</view>
|
||||
<view v-else-if="paySource == 'giftcard'" class="btn" @click="toOrder()">查看订单</view>
|
||||
<view v-else-if="paySource == 'pointexchange'" class="btn" @click="toExchangeOrder()">查看订单
|
||||
</view>
|
||||
<view v-else class="btn" @click="toOrderDetail(payInfo.order_id)">查看订单</view>
|
||||
</template>
|
||||
<view class="btn go-home" @click="goHome()">{{ $lang('goHome') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<ns-goods-recommend route="pay"></ns-goods-recommend>
|
||||
</template>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
payInfo: {},
|
||||
outTradeNo: '',
|
||||
paySource: '',
|
||||
consumeInfo: {},
|
||||
consumeStatus: 0,
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.code) this.outTradeNo = option.code;
|
||||
this.paySource = uni.getStorageSync('paySource');
|
||||
},
|
||||
onShow() {
|
||||
this.getPayInfo();
|
||||
this.getConsume();
|
||||
},
|
||||
methods: {
|
||||
consume(type) {
|
||||
switch (type) {
|
||||
case 'point':
|
||||
this.$util.redirectTo('/pages_tool/member/point_detail', {});
|
||||
break;
|
||||
case 'growth':
|
||||
this.$util.redirectTo('/pages_tool/member/level', {});
|
||||
break;
|
||||
case 'coupon':
|
||||
this.$util.redirectTo('/pages_tool/member/coupon', {});
|
||||
break;
|
||||
default:
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, 'reLaunch');
|
||||
break;
|
||||
}
|
||||
},
|
||||
getConsume() {
|
||||
this.$api.sendRequest({
|
||||
url: '/memberconsume/api/config/info',
|
||||
data: {
|
||||
out_trade_no: this.outTradeNo
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
let reward = res.data.value;
|
||||
if (res.data.is_use && (reward.point_num > 0 || reward.growth_num > 0 || reward.coupon_list.length)) {
|
||||
this.consumeStatus = res.data.is_use;
|
||||
this.consumeInfo = res.data.value;
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
getPayInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/pay/info',
|
||||
data: {
|
||||
out_trade_no: this.outTradeNo
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.payInfo = res.data;
|
||||
this.payInfo.pay_money = parseFloat(res.data.pay_money);
|
||||
this.payInfo.pay_money += parseFloat(res.data.balance);
|
||||
this.payInfo.pay_money += parseFloat(res.data.balance_money);
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '未获取到支付信息!'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL, {}, 'reLaunch');
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
goHome() {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL, {}, 'reLaunch');
|
||||
},
|
||||
toOrderDetail(id) {
|
||||
if (this.payInfo.order_type == 2) {
|
||||
this.$util.redirectTo('/pages_order/detail_pickup', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
} else if (this.payInfo.order_type == 3) {
|
||||
this.$util.redirectTo('/pages_order/detail_local_delivery', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
} else if (this.payInfo.order_type == 4) {
|
||||
this.$util.redirectTo('/pages_tool/order/detail_virtual', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
}
|
||||
},
|
||||
toOrder(id) {
|
||||
this.$util.redirectTo('/pages_promotion/giftcard/order_list', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
},
|
||||
toRecharge() {
|
||||
this.$util.redirectTo('/pages_tool/recharge/order_list', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
},
|
||||
toCard() {
|
||||
this.$util.redirectTo('/pages_tool/member/card', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
},
|
||||
toPresaleOrder() {
|
||||
this.$util.redirectTo('/pages_promotion/presale/order_list', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
},
|
||||
toExchangeOrder() {
|
||||
this.$util.redirectTo('/pages_promotion/point/order_list', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.consume-box {
|
||||
padding: $padding;
|
||||
background: #F8F8F8;
|
||||
width: calc(100% - 48rpx);
|
||||
margin: 0 24rpx 0 24rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.consume-head {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
|
||||
.consume-head-text {
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.consume-list {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.consume-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: $color-title;
|
||||
font-size: $font-size-base;
|
||||
margin-top: 10rpx;
|
||||
|
||||
image {
|
||||
width: 24rpx;
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
|
||||
.consume-value {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.consume-remark {
|
||||
color: $color-tip;
|
||||
font-size: $font-size-tag;
|
||||
padding: 10rpx 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.result-box {
|
||||
padding-top: 94rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background-color: #FFFFFF;
|
||||
width: 100%;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.result-image {
|
||||
width: 80rpx;
|
||||
height: auto;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.msg {
|
||||
font-size: 32rpx;
|
||||
margin-top: 25rpx;
|
||||
|
||||
&.success {
|
||||
color: #09BB07;
|
||||
}
|
||||
|
||||
&.fail {
|
||||
// P0: 失败提示色 → var(--base-color)
|
||||
// 兼容: 微信小程序 / 鸿蒙元服务 — color 接受 var() 无问题
|
||||
color: var(--base-color, #FF4646);
|
||||
}
|
||||
}
|
||||
|
||||
.pay-amount {
|
||||
font-size: 30rpx;
|
||||
margin: 40rpx 0 24rpx 0;
|
||||
font-weight: 600;
|
||||
line-height: 50rpx;
|
||||
|
||||
text {
|
||||
color: #333333 !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
.unit {
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
|
||||
.large {
|
||||
font-size: 60rpx !important;
|
||||
}
|
||||
|
||||
.small {
|
||||
font-size: 36rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
.action {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
margin-top: 24rpx;
|
||||
|
||||
.btn {
|
||||
font-size: 30rpx;
|
||||
width: 200rpx;
|
||||
height: 66rpx;
|
||||
line-height: 66rpx;
|
||||
text-align: center;
|
||||
border-radius: 66rpx;
|
||||
border: 1px solid $color-tip;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:last-child {
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.go-home {
|
||||
background-color: $base-color;
|
||||
color: #fff;
|
||||
border-color: $base-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .goods-recommend {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
::v-deep .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
}
|
||||
</style>
|
||||
@@ -3,7 +3,7 @@
|
||||
<view class="mask-img">
|
||||
<image :src="$util.img('public/uniapp/pay/invite_friends_share.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="mask-word">{{ $lang("tool.pay.wx_pay.l6.t0") }}</view>
|
||||
<view class="mask-word">点击右上角跳转到浏览器打开</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user