chore(组件): 组件尽量使用异步导入模式
This commit is contained in:
@@ -10,11 +10,14 @@
|
||||
<view class="datetime">{{ datetime(item) }}</view>
|
||||
<view class="goods-item" :class="{ manage: manage }">
|
||||
<view class="checkbox-wrap" v-if="manage" @click="singleElection(item)">
|
||||
<text class="iconfont" :class="$util.inArray(item.id, idArr) != -1 ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></text>
|
||||
<text class="iconfont"
|
||||
:class="$util.inArray(item.id, idArr) != -1 ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></text>
|
||||
</view>
|
||||
<view class="goods-img" @click="toDetail(item)">
|
||||
<image :src="goodsImg(item.goods_image)" mode="widthFix" @error="imgError(index)"></image>
|
||||
<view class="color-base-bg goods-tag" v-if="goodsTag(item) != ''">{{ goodsTag(item) }}</view>
|
||||
<image :src="goodsImg(item.goods_image)" mode="widthFix" @error="imgError(index)">
|
||||
</image>
|
||||
<view class="color-base-bg goods-tag" v-if="goodsTag(item) != ''">{{ goodsTag(item) }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-wrap" @click="toDetail(item)">
|
||||
<view class="name-wrap">
|
||||
@@ -24,22 +27,28 @@
|
||||
<view class="lineheight-clear">
|
||||
<view class="discount-price">
|
||||
<text class="unit price-style small">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text class="price price-style large">{{ parseFloat(showPrice(item)).toFixed(2).split('.')[0] }}</text>
|
||||
<text class="unit price-style small">.{{ parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
|
||||
<text class="price price-style large">{{
|
||||
parseFloat(showPrice(item)).toFixed(2).split('.')[0] }}</text>
|
||||
<text class="unit price-style small">.{{
|
||||
parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
|
||||
</view>
|
||||
<view class="member-price-tag" v-if="item.member_price && item.member_price == showPrice(item)">
|
||||
<view class="member-price-tag"
|
||||
v-if="item.member_price && item.member_price == showPrice(item)">
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="member-price-tag" v-else-if="item.promotion_type == 1">
|
||||
<image :src="$util.img('public/uniapp/index/discount.png')" mode="widthFix"></image>
|
||||
<image :src="$util.img('public/uniapp/index/discount.png')" mode="widthFix">
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pro-info">
|
||||
<view class="delete-price font-size-activity-tag color-tip price-font" v-if="showMarketPrice(item)">
|
||||
<view class="delete-price font-size-activity-tag color-tip price-font"
|
||||
v-if="showMarketPrice(item)">
|
||||
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text>{{ showMarketPrice(item) }}</text>
|
||||
</view>
|
||||
<view class="sale font-size-activity-tag color-tip" v-if="item.sale_show">已售{{ item.sale_num }}{{ item.unit ? item.unit : '件' }}</view>
|
||||
<view class="sale font-size-activity-tag color-tip" v-if="item.sale_show">已售{{
|
||||
item.sale_num }}{{ item.unit ? item.unit : '件' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -49,10 +58,12 @@
|
||||
|
||||
<view class="bottom-wrap" v-if="goodsList.length && manage">
|
||||
<view class="all-election" @click="allElection">
|
||||
<view class="iconfont" :class="isAll ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></view>
|
||||
<view class="iconfont"
|
||||
:class="isAll ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></view>
|
||||
<text>全选</text>
|
||||
</view>
|
||||
<view class="action-btn"><button type="primary" @click="deleteFootprint()" class="delete" :class="{ disabled: selected }">删除</button></view>
|
||||
<view class="action-btn"><button type="primary" @click="deleteFootprint()" class="delete"
|
||||
:class="{ disabled: selected }">删除</button></view>
|
||||
</view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
@@ -64,22 +75,15 @@
|
||||
|
||||
<script>
|
||||
var dateList = [];
|
||||
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
|
||||
import nsLogin from '@/components/ns-login/ns-login.vue';
|
||||
import loadingCover from '@/components/loading-cover/loading-cover.vue';
|
||||
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
|
||||
// #ifdef MP-WEIXIN
|
||||
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
|
||||
// #endif
|
||||
|
||||
export default {
|
||||
components: {
|
||||
nsEmpty,
|
||||
nsLogin,
|
||||
loadingCover,
|
||||
MescrollUni,
|
||||
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
|
||||
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
|
||||
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
|
||||
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
|
||||
// #ifdef MP-WEIXIN
|
||||
privacyPopup
|
||||
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue')
|
||||
// #endif
|
||||
},
|
||||
data() {
|
||||
@@ -179,8 +183,8 @@ export default {
|
||||
let imgs = imgStr.split(',');
|
||||
return imgs[0]
|
||||
? this.$util.img(imgs[0], {
|
||||
size: 'mid'
|
||||
})
|
||||
size: 'mid'
|
||||
})
|
||||
: this.$util.getDefaultImage().goods;
|
||||
},
|
||||
imgError(index) {
|
||||
@@ -250,7 +254,7 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
storeToken: function (nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user