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

@@ -420,12 +420,7 @@
<script>
// 商品详情视图
import uniPopup from '@/components/uni-popup/uni-popup.vue';
import nsGoodsRecommend from '@/components/ns-goods-recommend/ns-goods-recommend.vue';
import pengpaiFadeinOut from '@/components/pengpai-fadein-out/pengpai-fadein-out.vue';
import xiaoStarComponent from '@/components/xiao-star-component/xiao-star-component.vue';
import scroll from '@/common/js/scroll-view.js';
import toTop from '@/components/toTop/toTop.vue';
import detail from './detail.js';
export default {
@@ -439,11 +434,11 @@
}
},
components: {
uniPopup,
nsGoodsRecommend,
pengpaiFadeinOut,
toTop,
xiaoStarComponent
uniPopup: () => import('@/components/uni-popup/uni-popup.vue'),
nsGoodsRecommend: () => import('@/components/ns-goods-recommend/ns-goods-recommend.vue'),
pengpaiFadeinOut: () => import('@/components/pengpai-fadein-out/pengpai-fadein-out.vue'),
toTop: () => import('@/components/toTop/toTop.vue'),
xiaoStarComponent: () => import('@/components/xiao-star-component/xiao-star-component.vue')
},
mixins: [scroll, detail]
};

View File

@@ -2,44 +2,51 @@
<!-- 当前商品参与的营销活动入口 -->
<view class="ns-goods-promotion" v-if="goodsPromotion.length">
<view v-for="(item, index) in goodsPromotion" v-if="promotion != item.promotion_type" :key="index">
<view v-if="item.promotion_type == 'discount'" class="item" @click="redirectTo('/pages_goods/detail', { goods_id: item.goods_id })">
<view v-if="item.promotion_type == 'discount'" class="item"
@click="redirectTo('/pages_goods/detail', { goods_id: item.goods_id })">
<text class="promotion-mark ">限时折扣</text>
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
<text class="iconfont icon-right"></text>
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" /></view> -->
</view>
<view v-else-if="item.promotion_type == 'groupbuy'" class="item" @click="redirectTo('/pages_promotion/groupbuy/detail', { groupbuy_id: item.groupbuy_id })">
<view v-else-if="item.promotion_type == 'groupbuy'" class="item"
@click="redirectTo('/pages_promotion/groupbuy/detail', { groupbuy_id: item.groupbuy_id })">
<!-- <view v-else-if="item.promotion_type == 'groupbuy'" class="item" @click="redirectTo('/pages_promotion/groupbuy/detail', { id: item.groupbuy_id })"> -->
<text class="promotion-mark ">团购</text>
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
<text class="iconfont icon-right"></text>
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" /></view> -->
</view>
<view v-else-if="item.promotion_type == 'pintuan'" class="item" @click="redirectTo('/pages_promotion/pintuan/detail', { pintuan_id: item.pintuan_id })">
<view v-else-if="item.promotion_type == 'pintuan'" class="item"
@click="redirectTo('/pages_promotion/pintuan/detail', { pintuan_id: item.pintuan_id })">
<text class="promotion-mark ">拼团</text>
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
<text class="iconfont icon-right"></text>
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" /></view> -->
</view>
<view v-else-if="item.promotion_type == 'seckill'" class="item" @click="redirectTo('/pages_promotion/seckill/detail', { seckill_id: item.id })">
<view v-else-if="item.promotion_type == 'seckill'" class="item"
@click="redirectTo('/pages_promotion/seckill/detail', { seckill_id: item.id })">
<text class="promotion-mark ">秒杀</text>
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
<text class="iconfont icon-right"></text>
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" /></view> -->
</view>
<view v-else-if="item.promotion_type == 'topic'" class="item" @click="redirectTo('/pages_promotion/topics/goods_detail', { id: item.id })">
<view v-else-if="item.promotion_type == 'topic'" class="item"
@click="redirectTo('/pages_promotion/topics/goods_detail', { id: item.id })">
<text class="promotion-mark ">专题活动</text>
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
<text class="iconfont icon-right"></text>
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" /></view> -->
</view>
<view v-else-if="item.promotion_type == 'bargain'" class="item" @click="redirectTo('/pages_promotion/bargain/detail', { b_id: item.bargain_id })">
<view v-else-if="item.promotion_type == 'bargain'" class="item"
@click="redirectTo('/pages_promotion/bargain/detail', { b_id: item.bargain_id })">
<text class="promotion-mark ">砍价</text>
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
<text class="iconfont icon-right"></text>
<!-- <view class="img-wrap"><image :src="$util.img('public/uniapp/goods/detail_more.png')" mode="aspectFit" /></view> -->
</view>
<view v-else-if="item.promotion_type == 'pinfan'" class="item" @click="redirectTo('/pages_promotion/pinfan/detail', { pinfan_id: item.pintuan_id })">
<view v-else-if="item.promotion_type == 'pinfan'" class="item"
@click="redirectTo('/pages_promotion/pinfan/detail', { pinfan_id: item.pintuan_id })">
<text class="promotion-mark ">拼团返利</text>
<text class="title">当前商品正在参加{{ item.promotion_name }}</text>
<text class="iconfont icon-right"></text>
@@ -64,7 +71,7 @@ export default {
}
};
},
created() {},
created() { },
methods: {
refresh(goodsPromotion) {
this.goodsPromotion = goodsPromotion;
@@ -79,14 +86,16 @@ export default {
<style lang="scss">
.ns-goods-promotion {
background-color: #fff;
& > view {
}
&>view {}
.item {
display: flex;
font-size: $font-size-base;
align-items: center;
padding: 20rpx 0;
border-bottom: 2rpx solid $color-line;
&:last-child {
border-bottom: none;
}
@@ -115,6 +124,7 @@ export default {
.img-wrap {
width: 38rpx;
height: 38rpx;
image {
width: 100%;
height: 100%;