chore(组件): 组件尽量使用异步导入模式

This commit is contained in:
2026-01-04 14:40:00 +08:00
parent 4da852944e
commit 9415f397d2
172 changed files with 11520 additions and 10979 deletions

View File

@@ -7,15 +7,17 @@
<text class="unit price-font"></text>
<text class="money price-font">{{ payInfo.pay_money | moneyFormat }}</text>
</view>
<block v-if="payTypeList.length > 0">
<view class="pay-type">
<view class="payment-item" v-for="(item, index) in payTypeList" :key="index" @click="payIndex = index">
<view class="payment-item" v-for="(item, index) in payTypeList" :key="index"
@click="payIndex = index">
<view>
<text class="iconfont" :class="item.icon"></text>
<text class="name">{{ item.name }}</text>
</view>
<text class="iconfont" :class="payIndex == index ? 'icon-yuan_checked color-base-text' : 'icon-checkboxblank'"></text>
<text class="iconfont"
:class="payIndex == index ? 'icon-yuan_checked color-base-text' : 'icon-checkboxblank'"></text>
</view>
</view>
<button type="primary" @click="confirm">确认支付</button>
@@ -31,11 +33,13 @@
<script>
import { Weixin } from 'common/js/wx-jssdk.js';
import nsLogin from '@/components/ns-login/ns-login.vue';
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
export default {
components: { nsLogin, nsEmpty },
components: {
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
},
data() {
return {
payIndex: 0,
@@ -86,7 +90,7 @@ export default {
this.autoPay();
}, 500)
}
}
}
}
});
},
@@ -106,10 +110,10 @@ export default {
}
});
},
autoPay(){
autoPay() {
if (!this.payTypeList.length) return;
if (this.$util.isWeiXin()) {
this.payTypeList.forEach((item, index) => {
this.payTypeList.forEach((item, index) => {
if (item.type == 'wechatpay') {
this.payIndex = index;
this.confirm();
@@ -286,7 +290,7 @@ export default {
// #endif
},
watch: {
storeToken: function(nVal, oVal) {
storeToken: function (nVal, oVal) {
if (nVal) {
this.getPayInfo();
}
@@ -310,6 +314,7 @@ export default {
align-items: center;
flex-direction: column;
padding: 80rpx 26rpx;
.content {
white-space: nowrap;
overflow: hidden;
@@ -318,13 +323,16 @@ export default {
padding: 0 60rpx;
text-align: center;
}
.money-wrap {
font-weight: bold;
margin: 40rpx 0;
.unit {
font-size: 40rpx;
margin-right: 6rpx;
}
.money {
font-size: 70rpx;
}
@@ -334,6 +342,7 @@ export default {
width: 100%;
background: #fff;
border-radius: 20rpx;
.payment-item {
display: flex;
align-items: center;
@@ -341,34 +350,43 @@ export default {
height: 90rpx;
border-bottom: 2rpx solid $color-line;
padding: 20rpx 30rpx;
&:last-of-type {
border-bottom: none;
}
> view {
>view {
display: flex;
align-items: center;
.name {
margin-left: 20rpx;
}
}
.iconfont {
font-size: 64rpx;
}
.icon-weixin1 {
color: #24af41;
}
.icon-zhifubaozhifu- {
color: #00a0e9;
}
.icon-yuan_checked {
font-size: 40rpx;
color: $base-color;
}
.icon-checkboxblank {
font-size: 40rpx;
}
}
}
button {
width: 100%;
margin-top: 80rpx !important;