开屏广告优化

master
gongfuxiang 2026-03-03 18:54:54 +08:00
parent ed6ae34839
commit aa8a6580b9
5 changed files with 385 additions and 318 deletions

23
App.vue
View File

@ -7,10 +7,10 @@
data: {
//
//
request_url:'http://shopxo.com/',
request_url:'https://new.shopxo.vip/',
// publicpublichttps://d1.shopxo.vip/public/
static_url:'http://shopxo.com/',
static_url:'https://new.shopxo.vip/',
// default
system_type: 'default',
@ -23,10 +23,10 @@
application_logo: '',
// : v1.0.0
version: 'v6.7.1',
version: 'v6.8.0',
// app: v1.0.0 20180118
app_version_info: 'v6.7.1 20251028',
app_version_info: 'v6.8.0 20260305',
//
currency_symbol: '¥',
@ -1625,6 +1625,12 @@
// true
is_init_config_success_pages_begin(self = this) {
// 广
return this.is_plugins_startad_status(self);
},
// 广
is_plugins_startad_status(self = this) {
// 广
let pages = self.app_tabbar_pages() || [];
let current_page = '/'+self.current_page(false);
@ -3158,6 +3164,9 @@
this.data.network_type_page_record_timer = null;
//
clearInterval(this.data.get_user_location_timer);
// 广
uni.setStorageSync('plugins_startad_cache_key', null);
},
// 访
@ -3267,6 +3276,12 @@
page_event_onload_handle(params) {
//
this.get_user_location();
// 广
if(this.is_plugins_startad_status()) {
// 广
uni.setStorageSync('plugins_startad_cache_key', null);
}
},
//

View File

@ -1,20 +1,22 @@
<template>
<view :class="theme_view">
<!-- 底部菜单 -->
<block v-if="is_tabbar">
<block v-if="propIsFooter && is_tabbar">
<component-diy-footer :propKey="key" :propValue="app_tabbar" @onFooterHeight="footer_height_value_event"></component-diy-footer>
<view v-if="propIsFooterSeat && footer_height_value > 0" :style="'height:'+footer_height_value+'rpx;'"></view>
</block>
<!-- 弹窗业务 -->
<component-modal-business ref="modal_business"
:propIsGrayscale="propIsGrayscale"
:propIsFooterSeat="propIsFooterSeat"
:propIsAppAdmin="propIsAppAdmin"
:propIsUserBase="propIsUserBase"
:propIsPopupscreen="propIsPopupscreen"
:propIsCertificate="propIsCertificate"
></component-modal-business>
<block v-if="propIsModalBusiness">
<component-modal-business ref="modal_business"
:propIsGrayscale="propIsGrayscale"
:propIsFooterSeat="propIsFooterSeat"
:propIsAppAdmin="propIsAppAdmin"
:propIsUserBase="propIsUserBase"
:propIsPopupscreen="propIsPopupscreen"
:propIsCertificate="propIsCertificate"
></component-modal-business>
</block>
</view>
</template>
<script>
@ -26,12 +28,23 @@
return {
theme_view: app.globalData.get_theme_value_view(),
key: '',
is_first: 0,
is_tabbar: false,
app_tabbar: null,
footer_height_value: 0,
};
},
props: {
//
propIsFooter: {
type: Boolean,
default: true,
},
//
propIsModalBusiness: {
type: Boolean,
default: true,
},
//
propIsGrayscale: {
type: Boolean,
@ -69,7 +82,6 @@
},
//
created: function () {
//
this.init_config();
},
methods: {
@ -88,14 +100,7 @@
init_config(status = false, params = {}) {
if (status) {
//
if(app.globalData.is_init_config_success_pages_begin()) {
let self = this;
setTimeout(function() {
self.init(params);
}, 500);
} else {
this.init(params);
}
this.init(params);
} else {
app.globalData.is_config(this, 'init_config', params);
}
@ -104,10 +109,19 @@
//
init(params = {}) {
//
this.footer_init();
if(this.propIsFooter) {
if(this.is_first && app.globalData.is_init_config_success_pages_begin()) {
let self = this;
setTimeout(function() {
self.footer_init();
}, 500);
} else {
this.footer_init();
}
}
//
if ((this.$refs.modal_business || null) != null) {
if (this.propIsModalBusiness && (this.$refs.modal_business || null) != null && (this.$refs.modal_business.init || null) != null) {
this.$refs.modal_business.init(params);
}
},
@ -116,6 +130,7 @@
footer_init(status = 0) {
var is_use_native_tabbar = app.globalData.data.is_use_native_tabbar == 1;
var upd_data = {
is_first: false,
is_tabbar: is_use_native_tabbar ? false : app.globalData.is_tabbar_pages()
};
if(upd_data['is_tabbar']) {

View File

@ -31,8 +31,7 @@
return {
theme_view: app.globalData.get_theme_value_view(),
theme_color: app.globalData.get_theme_color(),
//
is_first: true,
cache_key: 'plugins_startad_cache_key',
//
data: [],
//
@ -64,7 +63,11 @@
}
},
created: function () {
this.init_config();
if(app.globalData.data.common_data_init_status == 1) {
this.init();
} else {
this.init_config();
}
},
methods: {
//
@ -78,28 +81,35 @@
//
init() {
let pages = app.globalData.app_tabbar_pages() || [];
let current_page = '/'+app.globalData.current_page(false);
if(this.is_first && pages.length > 0 && pages[0] == current_page) {
let base = app.globalData.get_config('plugins_base.startad.data') || {};
this.setData({
is_first: false,
data: app.globalData.get_config('plugins_startad_list') || [],
skip_time: parseInt(base.skip_time || 6),
interval_time: parseInt(base.interval_time || 3)*1000,
show: parseInt(base.is_status || 0) == 1,
});
if(this.show) {
if (app.globalData.data.is_use_native_tabbar == 1) {
uni.hideTabBar();
}
let self = this;
self.timer = setInterval(() => {
self.skip_time--;
if(self.skip_time <= 0) {
self.skip_event();
let key = this.cache_key;
let status = parseInt(uni.getStorageSync(key) || 0);
if(status == 0) {
let pages = app.globalData.app_tabbar_pages() || [];
let current_page = '/'+app.globalData.current_page(false);
if(pages.length > 0 && pages[0] == current_page) {
let base = app.globalData.get_config('plugins_base.startad.data') || {};
this.setData({
data: app.globalData.get_config('plugins_startad_list') || [],
skip_time: parseInt(base.skip_time || 6),
interval_time: parseInt(base.interval_time || 3)*1000,
show: parseInt(base.is_status || 0) == 1,
});
if(this.show) {
if (app.globalData.data.is_use_native_tabbar == 1) {
uni.hideTabBar();
}
}, 1000);
let self = this;
self.timer = setInterval(() => {
self.skip_time--;
if(self.skip_time <= 0) {
self.skip_event();
}
}, 1000);
uni.setStorage({
key: key,
data: 1,
});
}
}
}
},

View File

@ -1,294 +1,309 @@
<template>
<view :class="theme_view">
<view :class="(plugins_mourning_data_is_app ? ' grayscale' : '') + (is_single_page == 1 ? ' single-page-top' : '')">
<!-- diy模式 -->
<block v-if="data_mode == 3">
<block v-if="(data_list || null) != null && (data_list.config || null) != null">
<component-diy :propValue="data_list.config" :propDataId="data_list.id" :propKey="random_value" @onLocationBack="user_back_choice_location">
<!-- 由于diy组件异步加载默认先加载骨架屏展示 -->
<component-no-data propStatus="1" :propLoadingUseSkeleton="true" propPage="home"></component-no-data>
<!-- 底部内容 -->
<template slot="diy-bottom-content">
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
<!-- 版权信息 -->
<component-copyright></component-copyright>
</template>
<!-- 底部公共 -->
<template slot="diy-bottom-common">
<component-common ref="common" :propIsGrayscale="plugins_mourning_data_is_app"></component-common>
</template>
</component-diy>
</block>
<block v-else>
<component-no-data propStatus="0" propPage="home"></component-no-data>
</block>
</block>
<!-- 自动和手动模式 -->
<block v-else>
<!-- 顶部内容如果没有轮播和导航则使用矮的浮动导航背景样式则使用高的背景样式 -->
<view v-if="load_status == 1" class="home-top-nav-content pr" :style="(banner_list.length > 0 || navigation.length > 0 ? top_content_bg_color : top_content_search_bg_color) + top_content_style">
<!-- 顶部背景图片 -->
<view class="pa top-0 left-0 right-0">
<image class="bg-img wh-auto" mode="widthFix" :src="static_url + 'nav-top.png'"></image>
</view>
<!-- 搜索 -->
<view v-if="common_app_is_header_nav_fixed == 1" :class="'search-fixed-seat ' + (common_app_is_enable_search == 1 ? 'nav-enable-search' : '')"></view>
<view :class="'pr ' + (common_app_is_header_nav_fixed == 1 ? 'search-content-fixed' : '')" :style="common_app_is_header_nav_fixed == 1 ? top_content_search_bg_color : ''">
<view :class="'search-content-fixed-content ' + (common_app_is_enable_search == 1 ? 'nav-enable-search' : '')" :style="(common_app_is_header_nav_fixed == 1 ? top_content_style : '') + (common_app_is_header_nav_fixed == 1 ? top_content_search_content_style : '')">
<view class="home-top-nav margin-bottom-sm pr padding-right-main">
<!-- 定位 -->
<view v-if="is_home_location_choice == 1" class="home-top-nav-location dis-inline-block va-m single-text cr-white pr bs-bb padding-left-main padding-right-lg">
<component-choice-location @onBack="user_back_choice_location"></component-choice-location>
</view>
<block v-else>
<!-- logo/标题 -->
<view class="home-top-nav-logo dis-inline-block va-m padding-left-main">
<block v-if="is_home_logo_use_text == 0 && (application_logo || null) != null">
<image :src="application_logo" mode="heightFix" class="home-top-nav-logo-image"></image>
</block>
<block v-else>
<view v-if="(application_title || null) != null" class="home-top-nav-logo-title cr-white single-text">{{ application_title }}</view>
</block>
</view>
</block>
<!-- #ifdef H5 || APP -->
<!-- 右上角icon列表 -->
<view v-if="(right_icon_list || null) != null && right_icon_list.length > 0" class="nav-top-right-icon fr">
<block v-for="(item, index) in right_icon_list">
<view class="item dis-inline-block cp pr" :data-value="item.url || ''" @tap="url_event">
<iconfont :name="item.icon" size="38rpx" color="#fff"></iconfont>
<view v-if="(item.badge || null) != null" class="badge-icon pa">
<component-badge :propNumber="item.badge"></component-badge>
</view>
</view>
</block>
</view>
<!-- #endif -->
</view>
<view v-if="common_app_is_enable_search == 1" class="search-content-input padding-horizontal-main">
<!-- 是否开启搜索框前面icon扫一扫 -->
<block v-if="is_home_search_scan == 1">
<component-search :propIsEnterSearchStart="true" :propIsBtn="true" propSize="sm" :propPlaceholder="$t('customview.customview.726k7y')" propPlaceholderClass="cr-grey-c" propIconColor="#999" propBgColor="#fff"
<!-- #ifndef H5 -->
@onicon="search_icon_event" propIcon="icon-scan" :propIsIconOnEvent="true"
<!-- #endif -->
></component-search>
</block>
<block v-else>
<component-search :propIsEnterSearchStart="true" :propIsBtn="true" propSize="sm" :propPlaceholder="$t('customview.customview.726k7y')" propPlaceholderClass="cr-grey-c" propIconColor="#999" propBgColor="#fff"></component-search>
</block>
</view>
</view>
</view>
<!-- 轮播 -->
<view class="banner-content padding-horizontal-main margin-top-xs" v-if="banner_list.length > 0">
<component-banner :propData="banner_list" @changeBanner="change_banner"></component-banner>
</view>
<!-- 导航 -->
<view v-if="navigation.length > 0" class="spacing-mt" :class="load_status == 1 && (common_shop_notice || null) != null ? '' : ' spacing-mb'">
<view class="padding-horizontal-main">
<view class="bg-white border-radius-main">
<component-icon-nav :propData="{ ...{ data: navigation }, ...{ random: random_value } }"></component-icon-nav>
</view>
</view>
</view>
</view>
<!-- 内容 -->
<view class="content padding-horizontal-main pr">
<!-- 商城公告 -->
<view v-if="load_status == 1 && (common_shop_notice || null) != null" class="notice">
<uni-notice-bar show-icon scrollable :text="common_shop_notice" background-color="transparent" color="#666" />
</view>
<!-- 推荐文章 -->
<view v-if="article_list.length > 0" class="article-list padding-main border-radius-main oh bg-white spacing-mb">
<view mode="aspectFit" class="new-icon va-m fl cp pr divider-r" data-value="/pages/article-category/article-category" @tap="url_event">
<text>{{ $t('index.index.t8bll8') }}</text
><text class="cr-red">{{ $t('index.index.t8bll9') }}</text>
</view>
<view class="right-content fr va-m">
<swiper :vertical="true" :autoplay="true" :circular="true" display-multiple-items="1" interval="3000">
<block v-for="(item, index) in article_list" :key="index">
<swiper-item class="single-text">
<text class="cr-base text-size-sm cp" :data-value="item.category_url" @tap="url_event">[{{ item.article_category_name }}]</text>
<text class="cr-base text-size-sm margin-left-xs cp" :style="(item.title_color || null) != null ? 'color:' + item.title_color + ' !important;' : ''" :data-value="item.url" @tap="url_event">{{ item.title }}</text>
</swiper-item>
</block>
</swiper>
</view>
</view>
<!-- 按照插件顺序渲染插件数据 -->
<block v-if="plugins_sort_list.length > 0">
<block v-for="(pv, pi) in plugins_sort_list" :key="pi">
<!-- 首页中间广告 - 插件 -->
<view v-if="pv.plugins == 'homemiddleadv' && (plugins_homemiddleadv_data || null) != null && plugins_homemiddleadv_data.length > 0" class="plugins-homemiddleadv oh spacing-mb">
<view v-for="(item, index) in plugins_homemiddleadv_data" :key="index" class="item border-radius-main oh cp" :data-value="item.url || ''" @tap="url_event">
<image class="dis-block wh-auto border-radius-main" :src="item.images" mode="widthFix"> </image>
</view>
</view>
<!-- 限时秒杀 - 插件 -->
<view v-if="pv.plugins == 'seckill' && (plugins_seckill_data || null) != null && (plugins_seckill_data.data || null) != null && (plugins_seckill_data.data.goods || null) != null && plugins_seckill_data.data.goods.length > 0" class="plugins-seckill-data border-radius-main spacing-mb bg-white" :style="'background-image: url(' + plugins_seckill_data.data.home_bg + ');'">
<view class="flex-row jc-sb align-c padding-top-main padding-horizontal-main">
<view class="flex-1">
<image class="dis-inline-block va-m icon" :src="plugins_seckill_data.data.home_title_icon" mode="widthFix"></image>
<view class="dis-inline-block va-m margin-left-sm">
<component-countdown :propHour="plugins_seckill_data.data.time.hours" :propMinute="plugins_seckill_data.data.time.minutes" :propSecond="plugins_seckill_data.data.time.seconds"></component-countdown>
</view>
</view>
<text data-value="/pages/plugins/seckill/index/index" @tap="url_event" class="arrow-right padding-right cr-grey text-size-xs cp">{{ $t('common.more') }}</text>
</view>
<component-goods-list :propData="{ style_type: 2, goods_list: plugins_seckill_data.data.goods }" :propLabel="plugins_label_data" :propCurrencySymbol="currency_symbol" :propIsCartParaCurve="true" propSource="index" :propOpenCart="false"></component-goods-list>
</view>
<!-- 活动配置-楼层顶部 - 插件 -->
<view v-if="pv.plugins == 'activity' && (plugins_activity_data || null) != null">
<component-activity-list :propConfig="plugins_activity_data.base" :propData="plugins_activity_data.data" propLocation="0" :propLabel="plugins_label_data" :propCurrencySymbol="currency_symbol" :propIsCartParaCurve="true" propSource="index"></component-activity-list>
</view>
<!-- 门店 - 插件 -->
<view v-if="pv.plugins == 'realstore' && (plugins_realstore_data || null) != null">
<view v-if="(plugins_realstore_data.base.home_data_list_title || null) != null" class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ plugins_realstore_data.base.home_data_list_title }}</text>
<text data-value="/pages/plugins/realstore/search/search" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
</view>
<component-realstore-list :propData="{ ...{ data: plugins_realstore_data.data }, ...{ random: random_value } }"></component-realstore-list>
</view>
<!-- 多商户 - 插件 -->
<view v-if="pv.plugins == 'shop' && (plugins_shop_data || null) != null">
<view v-if="(plugins_shop_data.base.home_data_list_title || null) != null" class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ plugins_shop_data.base.home_data_list_title }}</text>
<text data-value="/pages/plugins/shop/index/index" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
</view>
<component-shop-list :propConfig="plugins_shop_data.base" :propData="{ ...{ data: plugins_shop_data.data }, ...{ random: random_value } }"></component-shop-list>
</view>
<!-- 组合搭配 - 插件 -->
<view v-if="pv.plugins == 'binding' && (plugins_binding_data || null) != null">
<view v-if="(plugins_binding_data.base.home_data_list_title || null) != null" class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ plugins_binding_data.base.home_data_list_title }}</text>
<text data-value="/pages/plugins/binding/index/index" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
</view>
<component-binding-list :propConfig="plugins_binding_data.base" :propData="{ ...{ data: plugins_binding_data.data }, ...{ random: random_value } }" :propCurrencySymbol="currency_symbol"></component-binding-list>
</view>
<!-- 博客-楼层顶部 - 插件 -->
<view v-if="pv.plugins == 'blog' && (plugins_blog_data || null) != null">
<component-blog-list :propConfig="plugins_blog_data.base" :propData="plugins_blog_data.data" propLocation="0"></component-blog-list>
</view>
<!-- 魔方 - 插件 -->
<view v-if="pv.plugins == 'magic' && (plugins_magic_data || null) != null">
<component-magic-list :propData="{ ...plugins_magic_data, ...{ random: random_value } }" :propCurrencySymbol="currency_symbol" :propLabel="plugins_label_data"></component-magic-list>
</view>
</block>
</block>
<!-- 楼层数据 -->
<block v-if="(data_list || null) != null && data_list.length > 0">
<!-- 数据模式0,1自动+手动2拖拽 -->
<block v-if="data_mode == 2">
<!-- 引入拖拽数据模块 -->
<component-layout :propData="data_list"></component-layout>
<block v-if="page_load_status == 1">
<view :class="(plugins_mourning_data_is_app ? ' grayscale' : '') + (is_single_page == 1 ? ' single-page-top' : '')">
<!-- diy模式 -->
<block v-if="data_mode == 3">
<block v-if="load_status == 1">
<block v-if="(data_list || null) != null && (data_list.config || null) != null">
<component-diy :propValue="data_list.config" :propDataId="data_list.id" :propKey="random_value" @onLocationBack="user_back_choice_location">
<!-- 由于diy组件异步加载默认先加载骨架屏展示 -->
<component-no-data propStatus="1" :propLoadingUseSkeleton="true" propPage="home"></component-no-data>
<!-- 底部内容 -->
<template slot="diy-bottom-content">
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
<!-- 版权信息 -->
<component-copyright></component-copyright>
</template>
<!-- 底部公共 -->
<template slot="diy-bottom-common">
<component-common ref="common_footer" :propIsModalBusiness="false" :propIsGrayscale="plugins_mourning_data_is_app"></component-common>
</template>
</component-diy>
</block>
<block v-else>
<!-- 自动+手动 -->
<view v-for="(floor, index) in data_list" :key="index" class="floor">
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
<view class="title-left">
<text class="text-wrapper title-left-border" :style="'color:' + (floor.bg_color || '#333') + ';'">{{ floor.name }}</text>
<text v-if="(floor.describe || null) != null" class="vice-name margin-left-lg cr-grey">{{ floor.describe }}</text>
<component-no-data propStatus="0" propPage="home"></component-no-data>
</block>
</block>
<block v-else>
<component-no-data propStatus="1" propPage="home"></component-no-data>
</block>
<!-- 底部公共 -->
<component-common ref="common" :propIsFooter="false" :propIsGrayscale="plugins_mourning_data_is_app"></component-common>
</block>
<!-- 自动和手动模式 -->
<block v-else>
<!-- 顶部内容如果没有轮播和导航则使用矮的浮动导航背景样式则使用高的背景样式 -->
<view v-if="load_status == 1" class="home-top-nav-content pr" :style="(banner_list.length > 0 || navigation.length > 0 ? top_content_bg_color : top_content_search_bg_color) + top_content_style">
<!-- 顶部背景图片 -->
<view class="pa top-0 left-0 right-0">
<image class="bg-img wh-auto" mode="widthFix" :src="static_url + 'nav-top.png'"></image>
</view>
<!-- 搜索 -->
<view v-if="common_app_is_header_nav_fixed == 1" :class="'search-fixed-seat ' + (common_app_is_enable_search == 1 ? 'nav-enable-search' : '')"></view>
<view :class="'pr ' + (common_app_is_header_nav_fixed == 1 ? 'search-content-fixed' : '')" :style="common_app_is_header_nav_fixed == 1 ? top_content_search_bg_color : ''">
<view :class="'search-content-fixed-content ' + (common_app_is_enable_search == 1 ? 'nav-enable-search' : '')" :style="(common_app_is_header_nav_fixed == 1 ? top_content_style : '') + (common_app_is_header_nav_fixed == 1 ? top_content_search_content_style : '')">
<view class="home-top-nav margin-bottom-sm pr padding-right-main">
<!-- 定位 -->
<view v-if="is_home_location_choice == 1" class="home-top-nav-location dis-inline-block va-m single-text cr-white pr bs-bb padding-left-main padding-right-lg">
<component-choice-location @onBack="user_back_choice_location"></component-choice-location>
</view>
<text :data-value="'/pages/goods-search/goods-search?category_id=' + floor.id" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
<block v-else>
<!-- logo/标题 -->
<view class="home-top-nav-logo dis-inline-block va-m padding-left-main">
<block v-if="is_home_logo_use_text == 0 && (application_logo || null) != null">
<image :src="application_logo" mode="heightFix" class="home-top-nav-logo-image"></image>
</block>
<block v-else>
<view v-if="(application_title || null) != null" class="home-top-nav-logo-title cr-white single-text">{{ application_title }}</view>
</block>
</view>
</block>
<!-- #ifdef H5 || APP -->
<!-- 右上角icon列表 -->
<view v-if="(right_icon_list || null) != null && right_icon_list.length > 0" class="nav-top-right-icon fr">
<block v-for="(item, index) in right_icon_list">
<view class="item dis-inline-block cp pr" :data-value="item.url || ''" @tap="url_event">
<iconfont :name="item.icon" size="38rpx" color="#fff"></iconfont>
<view v-if="(item.badge || null) != null" class="badge-icon pa">
<component-badge :propNumber="item.badge"></component-badge>
</view>
</view>
</block>
</view>
<!-- #endif -->
</view>
<view class="floor-list wh-auto oh pr">
<block v-if="(floor.goods || null) != null && floor.goods.length > 0">
<component-goods-list :propData="{ style_type: 1, goods_list: floor.goods }" :propLabel="plugins_label_data" :propCurrencySymbol="currency_symbol" :propIsCartParaCurve="true" propSource="index"></component-goods-list>
<view v-if="common_app_is_enable_search == 1" class="search-content-input padding-horizontal-main">
<!-- 是否开启搜索框前面icon扫一扫 -->
<block v-if="is_home_search_scan == 1">
<component-search :propIsEnterSearchStart="true" :propIsBtn="true" propSize="sm" :propPlaceholder="$t('customview.customview.726k7y')" propPlaceholderClass="cr-grey-c" propIconColor="#999" propBgColor="#fff"
<!-- #ifndef H5 -->
@onicon="search_icon_event" propIcon="icon-scan" :propIsIconOnEvent="true"
<!-- #endif -->
></component-search>
</block>
<block v-else>
<component-search :propIsEnterSearchStart="true" :propIsBtn="true" propSize="sm" :propPlaceholder="$t('customview.customview.726k7y')" propPlaceholderClass="cr-grey-c" propIconColor="#999" propBgColor="#fff"></component-search>
</block>
</view>
</view>
</block>
</block>
</view>
<!-- 按照插件顺序渲染插件数据 -->
<block v-if="plugins_sort_list.length > 0">
<block v-for="(pv, pi) in plugins_sort_list" :key="pi">
<!-- 活动配置-楼层底部 - 插件 -->
<view v-if="pv.plugins == 'activity' && (plugins_activity_data || null) != null">
<component-activity-list :propConfig="plugins_activity_data.base" :propData="plugins_activity_data.data" propLocation="1" :propLabel="plugins_label_data" :propCurrencySymbol="currency_symbol" propSource="index" :propOpenCart="false"></component-activity-list>
<!-- 轮播 -->
<view class="banner-content padding-horizontal-main margin-top-xs" v-if="banner_list.length > 0">
<component-banner :propData="banner_list" @changeBanner="change_banner"></component-banner>
</view>
<!-- 导航 -->
<view v-if="navigation.length > 0" class="spacing-mt" :class="load_status == 1 && (common_shop_notice || null) != null ? '' : ' spacing-mb'">
<view class="padding-horizontal-main">
<view class="bg-white border-radius-main">
<component-icon-nav :propData="{ ...{ data: navigation }, ...{ random: random_value } }"></component-icon-nav>
</view>
</view>
</view>
</view>
<!-- 博客-楼层底部 - 插件 -->
<view v-if="pv.plugins == 'blog' && (plugins_blog_data || null) != null">
<component-blog-list :propConfig="plugins_blog_data.base" :propData="plugins_blog_data.data" propLocation="1"></component-blog-list>
<!-- 内容 -->
<view class="content padding-horizontal-main pr">
<!-- 商城公告 -->
<view v-if="load_status == 1 && (common_shop_notice || null) != null" class="notice">
<uni-notice-bar show-icon scrollable :text="common_shop_notice" background-color="transparent" color="#666" />
</view>
<!-- 推荐文章 -->
<view v-if="article_list.length > 0" class="article-list padding-main border-radius-main oh bg-white spacing-mb">
<view mode="aspectFit" class="new-icon va-m fl cp pr divider-r" data-value="/pages/article-category/article-category" @tap="url_event">
<text>{{ $t('index.index.t8bll8') }}</text
><text class="cr-red">{{ $t('index.index.t8bll9') }}</text>
</view>
<view class="right-content fr va-m">
<swiper :vertical="true" :autoplay="true" :circular="true" display-multiple-items="1" interval="3000">
<block v-for="(item, index) in article_list" :key="index">
<swiper-item class="single-text">
<text class="cr-base text-size-sm cp" :data-value="item.category_url" @tap="url_event">[{{ item.article_category_name }}]</text>
<text class="cr-base text-size-sm margin-left-xs cp" :style="(item.title_color || null) != null ? 'color:' + item.title_color + ' !important;' : ''" :data-value="item.url" @tap="url_event">{{ item.title }}</text>
</swiper-item>
</block>
</swiper>
</view>
</view>
<!--- 底部购买记录 - 插件 -->
<view v-if="pv.plugins == 'salerecords' && (plugins_salerecords_data || null) != null && (plugins_salerecords_data.data || null) != null && plugins_salerecords_data.data.length > 0" class="plugins-salerecords bg-white border-radius-main padding-main spacing-mb">
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
<view class="title-left">
<text class="text-wrapper">{{ plugins_salerecords_data.base.home_bottom_title || $t('index.index.s5r784') }}</text>
<text v-if="(plugins_salerecords_data.base || null) != null && (plugins_salerecords_data.base.home_bottom_desc || null) != null" class="vice-name margin-left-sm cr-grey-9">{{ plugins_salerecords_data.base.home_bottom_desc }}</text>
<!-- 按照插件顺序渲染插件数据 -->
<block v-if="plugins_sort_list.length > 0">
<block v-for="(pv, pi) in plugins_sort_list" :key="pi">
<!-- 首页中间广告 - 插件 -->
<view v-if="pv.plugins == 'homemiddleadv' && (plugins_homemiddleadv_data || null) != null && plugins_homemiddleadv_data.length > 0" class="plugins-homemiddleadv oh spacing-mb">
<view v-for="(item, index) in plugins_homemiddleadv_data" :key="index" class="item border-radius-main oh cp" :data-value="item.url || ''" @tap="url_event">
<image class="dis-block wh-auto border-radius-main" :src="item.images" mode="widthFix"> </image>
</view>
</view>
<view class="oh">
<swiper :vertical="true" :autoplay="true" :circular="true" :display-multiple-items="plugins_salerecords_data.data.length < 6 ? plugins_salerecords_data.data.length : 6" interval="3000" :style="plugins_salerecords_data.data.length < 6 ? 'height:' + plugins_salerecords_data.data.length * 84.33 + 'rpx;' : ''">
<block v-for="(item, index) in plugins_salerecords_data.data" :key="index">
<swiper-item>
<view class="item oh padding-vertical-main">
<view class="item-content single-text fl">
<image mode="widthFix" :src="item.user.avatar" class="va-m br"> </image>
<text class="margin-left-sm">{{ item.user.user_name_view }}</text>
<text v-if="(item.user.province || null) != null"><text class="padding-left-xs padding-right-xs">-</text>{{ item.user.province }}</text>
</view>
<view class="item-content fl">
<view :data-value="item.goods_url" @tap="url_event" class="cp single-text">
<image mode="widthFix" :src="item.images" class="va-m br"> </image>
<text class="margin-left-sm single-text">{{ item.title }}</text>
<!-- 限时秒杀 - 插件 -->
<view v-if="pv.plugins == 'seckill' && (plugins_seckill_data || null) != null && (plugins_seckill_data.data || null) != null && (plugins_seckill_data.data.goods || null) != null && plugins_seckill_data.data.goods.length > 0" class="plugins-seckill-data border-radius-main spacing-mb bg-white" :style="'background-image: url(' + plugins_seckill_data.data.home_bg + ');'">
<view class="flex-row jc-sb align-c padding-top-main padding-horizontal-main">
<view class="flex-1">
<image class="dis-inline-block va-m icon" :src="plugins_seckill_data.data.home_title_icon" mode="widthFix"></image>
<view class="dis-inline-block va-m margin-left-sm">
<component-countdown :propHour="plugins_seckill_data.data.time.hours" :propMinute="plugins_seckill_data.data.time.minutes" :propSecond="plugins_seckill_data.data.time.seconds"></component-countdown>
</view>
</view>
<text data-value="/pages/plugins/seckill/index/index" @tap="url_event" class="arrow-right padding-right cr-grey text-size-xs cp">{{ $t('common.more') }}</text>
</view>
<component-goods-list :propData="{ style_type: 2, goods_list: plugins_seckill_data.data.goods }" :propLabel="plugins_label_data" :propCurrencySymbol="currency_symbol" :propIsCartParaCurve="true" propSource="index" :propOpenCart="false"></component-goods-list>
</view>
<!-- 活动配置-楼层顶部 - 插件 -->
<view v-if="pv.plugins == 'activity' && (plugins_activity_data || null) != null">
<component-activity-list :propConfig="plugins_activity_data.base" :propData="plugins_activity_data.data" propLocation="0" :propLabel="plugins_label_data" :propCurrencySymbol="currency_symbol" :propIsCartParaCurve="true" propSource="index"></component-activity-list>
</view>
<!-- 门店 - 插件 -->
<view v-if="pv.plugins == 'realstore' && (plugins_realstore_data || null) != null">
<view v-if="(plugins_realstore_data.base.home_data_list_title || null) != null" class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ plugins_realstore_data.base.home_data_list_title }}</text>
<text data-value="/pages/plugins/realstore/search/search" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
</view>
<component-realstore-list :propData="{ ...{ data: plugins_realstore_data.data }, ...{ random: random_value } }"></component-realstore-list>
</view>
<!-- 多商户 - 插件 -->
<view v-if="pv.plugins == 'shop' && (plugins_shop_data || null) != null">
<view v-if="(plugins_shop_data.base.home_data_list_title || null) != null" class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ plugins_shop_data.base.home_data_list_title }}</text>
<text data-value="/pages/plugins/shop/index/index" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
</view>
<component-shop-list :propConfig="plugins_shop_data.base" :propData="{ ...{ data: plugins_shop_data.data }, ...{ random: random_value } }"></component-shop-list>
</view>
<!-- 组合搭配 - 插件 -->
<view v-if="pv.plugins == 'binding' && (plugins_binding_data || null) != null">
<view v-if="(plugins_binding_data.base.home_data_list_title || null) != null" class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
<text class="text-wrapper title-left-border single-text flex-1 flex-width padding-right-main">{{ plugins_binding_data.base.home_data_list_title }}</text>
<text data-value="/pages/plugins/binding/index/index" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
</view>
<component-binding-list :propConfig="plugins_binding_data.base" :propData="{ ...{ data: plugins_binding_data.data }, ...{ random: random_value } }" :propCurrencySymbol="currency_symbol"></component-binding-list>
</view>
<!-- 博客-楼层顶部 - 插件 -->
<view v-if="pv.plugins == 'blog' && (plugins_blog_data || null) != null">
<component-blog-list :propConfig="plugins_blog_data.base" :propData="plugins_blog_data.data" propLocation="0"></component-blog-list>
</view>
<!-- 魔方 - 插件 -->
<view v-if="pv.plugins == 'magic' && (plugins_magic_data || null) != null">
<component-magic-list :propData="{ ...plugins_magic_data, ...{ random: random_value } }" :propCurrencySymbol="currency_symbol" :propLabel="plugins_label_data"></component-magic-list>
</view>
</block>
</block>
<!-- 楼层数据 -->
<block v-if="(data_list || null) != null && data_list.length > 0">
<!-- 数据模式0,1自动+手动2拖拽 -->
<block v-if="data_mode == 2">
<!-- 引入拖拽数据模块 -->
<component-layout :propData="data_list"></component-layout>
</block>
<block v-else>
<!-- 自动+手动 -->
<view v-for="(floor, index) in data_list" :key="index" class="floor">
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
<view class="title-left">
<text class="text-wrapper title-left-border" :style="'color:' + (floor.bg_color || '#333') + ';'">{{ floor.name }}</text>
<text v-if="(floor.describe || null) != null" class="vice-name margin-left-lg cr-grey">{{ floor.describe }}</text>
</view>
<text :data-value="'/pages/goods-search/goods-search?category_id=' + floor.id" @tap="url_event" class="arrow-right padding-right cr-grey cp">{{ $t('common.more') }}</text>
</view>
<view class="floor-list wh-auto oh pr">
<block v-if="(floor.goods || null) != null && floor.goods.length > 0">
<component-goods-list :propData="{ style_type: 1, goods_list: floor.goods }" :propLabel="plugins_label_data" :propCurrencySymbol="currency_symbol" :propIsCartParaCurve="true" propSource="index"></component-goods-list>
</block>
</view>
</view>
</block>
</block>
<!-- 按照插件顺序渲染插件数据 -->
<block v-if="plugins_sort_list.length > 0">
<block v-for="(pv, pi) in plugins_sort_list" :key="pi">
<!-- 活动配置-楼层底部 - 插件 -->
<view v-if="pv.plugins == 'activity' && (plugins_activity_data || null) != null">
<component-activity-list :propConfig="plugins_activity_data.base" :propData="plugins_activity_data.data" propLocation="1" :propLabel="plugins_label_data" :propCurrencySymbol="currency_symbol" propSource="index" :propOpenCart="false"></component-activity-list>
</view>
<!-- 博客-楼层底部 - 插件 -->
<view v-if="pv.plugins == 'blog' && (plugins_blog_data || null) != null">
<component-blog-list :propConfig="plugins_blog_data.base" :propData="plugins_blog_data.data" propLocation="1"></component-blog-list>
</view>
<!--- 底部购买记录 - 插件 -->
<view v-if="pv.plugins == 'salerecords' && (plugins_salerecords_data || null) != null && (plugins_salerecords_data.data || null) != null && plugins_salerecords_data.data.length > 0" class="plugins-salerecords bg-white border-radius-main padding-main spacing-mb">
<view class="spacing-nav-title flex-row align-c jc-sb text-size-xs">
<view class="title-left">
<text class="text-wrapper">{{ plugins_salerecords_data.base.home_bottom_title || $t('index.index.s5r784') }}</text>
<text v-if="(plugins_salerecords_data.base || null) != null && (plugins_salerecords_data.base.home_bottom_desc || null) != null" class="vice-name margin-left-sm cr-grey-9">{{ plugins_salerecords_data.base.home_bottom_desc }}</text>
</view>
</view>
<view class="oh">
<swiper :vertical="true" :autoplay="true" :circular="true" :display-multiple-items="plugins_salerecords_data.data.length < 6 ? plugins_salerecords_data.data.length : 6" interval="3000" :style="plugins_salerecords_data.data.length < 6 ? 'height:' + plugins_salerecords_data.data.length * 84.33 + 'rpx;' : ''">
<block v-for="(item, index) in plugins_salerecords_data.data" :key="index">
<swiper-item>
<view class="item oh padding-vertical-main">
<view class="item-content single-text fl">
<image mode="widthFix" :src="item.user.avatar" class="va-m br"> </image>
<text class="margin-left-sm">{{ item.user.user_name_view }}</text>
<text v-if="(item.user.province || null) != null"><text class="padding-left-xs padding-right-xs">-</text>{{ item.user.province }}</text>
</view>
<view class="item-content fl">
<view :data-value="item.goods_url" @tap="url_event" class="cp single-text">
<image mode="widthFix" :src="item.images" class="va-m br"> </image>
<text class="margin-left-sm single-text">{{ item.title }}</text>
</view>
</view>
<view class="item-content single-text fr tr cr-grey padding-top-xs">
{{ item.add_time }}
</view>
</view>
<view class="item-content single-text fr tr cr-grey padding-top-xs">
{{ item.add_time }}
</view>
</view>
</swiper-item>
</block>
</swiper>
</swiper-item>
</block>
</swiper>
</view>
</view>
</view>
</block>
</block>
</block>
</view>
</view>
</block>
<!-- 提示信息 -->
<block v-if="load_status == 0">
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg" propPage="home" :propIsHeader="true"></component-no-data>
</block>
</view>
<!-- 模式 -->
<block v-if="data_mode != 3">
<!-- 页面已加载 -->
<block v-if="load_status == 1">
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
<!-- 版权信息 -->
<component-copyright></component-copyright>
<!-- 在线客服 -->
<component-online-service :propIsNav="true" :propIsBar="true" :propIsGrayscale="plugins_mourning_data_is_app"></component-online-service>
<!-- 快捷导航 -->
<component-quick-nav :propIsNav="true" :propIsBar="true" :propIsGrayscale="plugins_mourning_data_is_app"></component-quick-nav>
</block>
<!-- 公共 -->
<component-common ref="common" :propIsGrayscale="plugins_mourning_data_is_app"></component-common>
</block>
<!-- 提示信息 -->
<block v-if="load_status == 0">
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg" propPage="home" :propIsHeader="true"></component-no-data>
</block>
</view>
<!-- 页面已加载模式 -->
<block v-if="load_status == 1 && data_mode != 3">
<!-- 结尾 -->
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
<!-- 版权信息 -->
<component-copyright></component-copyright>
<!-- 在线客服 -->
<component-online-service :propIsNav="true" :propIsBar="true" :propIsGrayscale="plugins_mourning_data_is_app"></component-online-service>
<!-- 快捷导航 -->
<component-quick-nav :propIsNav="true" :propIsBar="true" :propIsGrayscale="plugins_mourning_data_is_app"></component-quick-nav>
<block v-else>
<component-no-data propStatus="1" propPage="home" :propIsHeader="true"></component-no-data>
</block>
<!-- 公共 -->
<component-common ref="common" :propIsGrayscale="plugins_mourning_data_is_app"></component-common>
</view>
</template>
<script>
@ -331,6 +346,7 @@
data_list_loding_status: 1,
data_list_loding_msg: '',
data_bottom_line_status: false,
page_load_status: 0,
load_status: 0,
currency_symbol: app.globalData.currency_symbol(),
is_home_search_scan: app.globalData.data.is_home_search_scan,
@ -453,6 +469,9 @@
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show({object: this, method: 'init'});
}
if ((this.$refs.common_footer || null) != null) {
this.$refs.common_footer.on_show({object: this, method: 'init'});
}
//
this.set_navigation_bar_color();
@ -472,7 +491,9 @@
init_config(status) {
if ((status || false) == true) {
this.setData({
page_load_status: 1,
currency_symbol: app.globalData.get_config('currency_symbol'),
data_mode: parseInt(app.globalData.get_config('config.home_index_floor_data_type', 0)),
common_shop_notice: app.globalData.get_config('config.common_shop_notice'),
common_app_is_enable_search: app.globalData.get_config('config.common_app_is_enable_search'),
common_app_is_header_nav_fixed: app.globalData.get_config('config.common_app_is_header_nav_fixed'),
@ -536,6 +557,7 @@
var data_list = data.data_list || null;
var upd_data = {
random_value: Math.random(),
page_load_status: 1,
data_bottom_line_status: true,
banner_list: data.banner_list || [],
navigation: data.navigation || [],

View File

@ -21,13 +21,15 @@
</template>
<!-- 底部公共 -->
<template slot="diy-bottom-common">
<component-common ref="common"></component-common>
<component-common ref="common_footer" :propIsModalBusiness="false"></component-common>
</template>
</component-diy>
</block>
<block v-else>
<component-no-data propStatus="0" propPage="home"></component-no-data>
</block>
</block>
<!-- 底部公共 -->
<component-common ref="common" :propIsFooter="false"></component-common>
</block>
<!-- 自动和手动模式 -->
<block v-else>
@ -180,6 +182,9 @@
// onshow
if ((this.$refs.common || null) != null) {
this.$refs.common.on_show();
}
if ((this.$refs.common_footer || null) != null) {
this.$refs.common_footer.on_show();
}
},