Merge branch 'dev' into dev-yxl
commit
aaeb374481
42
App.vue
42
App.vue
|
|
@ -1000,17 +1000,41 @@
|
|||
*/
|
||||
is_tabbar_pages_handle(pages, url = null) {
|
||||
var value = (url == null) ? '/'+this.current_page() : url;
|
||||
if ((value || null) == null) {
|
||||
return false;
|
||||
if ((value || null) != null) {
|
||||
if(pages.indexOf(value) != -1) {
|
||||
return true;
|
||||
} else {
|
||||
// 存在参数,去掉参数再检索是否存在页面的tabbar
|
||||
if(value.indexOf('?') != -1) {
|
||||
var temp = value.split('?');
|
||||
if(pages.indexOf(temp[0]) != -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(pages.indexOf(value) != -1) {
|
||||
return true;
|
||||
} else {
|
||||
// 存在参数,去掉参数再检索是否存在页面的tabbar
|
||||
if(value.indexOf('?') != -1) {
|
||||
var temp = value.split('?');
|
||||
if(pages.indexOf(temp[0]) != -1) {
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* 当前地址是否存为首页
|
||||
* url url地址
|
||||
*/
|
||||
is_tabbar_home(url = null) {
|
||||
var pages = this.app_tabbar_pages() || [];
|
||||
if(pages.length > 0) {
|
||||
var value = (url == null) ? '/'+this.current_page() : url;
|
||||
if ((value || null) != null) {
|
||||
if(pages[0] == value) {
|
||||
return true;
|
||||
} else {
|
||||
// 存在参数,去掉参数再检索是否存在页面的tabbar
|
||||
if(value.indexOf('?') != -1) {
|
||||
var temp = value.split('?');
|
||||
if(pages[0] == temp[0]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,9 @@
|
|||
|
||||
<!-- 用户基础 -->
|
||||
<component-user-base ref="user_base" :propIsGrayscale="propIsGrayscale"></component-user-base>
|
||||
|
||||
<!-- 弹屏广告 -->
|
||||
<component-popupscreen ref="popupscreen" :propIsGrayscale="propIsGrayscale"></component-popupscreen>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
|
@ -44,6 +47,7 @@
|
|||
import componentDiyFooter from '@/components/diy/footer';
|
||||
import componentAppAdmin from '@/components/app-admin/app-admin';
|
||||
import componentUserBase from '@/components/user-base/user-base';
|
||||
import componentPopupscreen from '@/components/popupscreen/popupscreen';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -79,11 +83,17 @@
|
|||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
// 是否引入弹屏广告
|
||||
propIsPopupscreen: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
components: {
|
||||
componentDiyFooter,
|
||||
componentAppAdmin,
|
||||
componentUserBase
|
||||
componentUserBase,
|
||||
componentPopupscreen
|
||||
},
|
||||
// 页面被展示
|
||||
created: function () {
|
||||
|
|
@ -130,6 +140,11 @@
|
|||
this.$refs.user_base.init(params);
|
||||
}
|
||||
|
||||
// 弹屏广告
|
||||
if (this.propIsPopupscreen && (this.$refs.popupscreen || null) != null) {
|
||||
this.$refs.popupscreen.init(params);
|
||||
}
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
// 微信协议验证
|
||||
if (app.globalData.data.is_weixin_privacy_setting == 1) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<movable-area class="float-window-movable-container">
|
||||
<movable-view :x="x" :y="y" direction="all" class="float-window-spread flex-row align-c jc-c" @tap="url_open">
|
||||
<movable-view :x="x" :y="y" direction="all" class="float-window-spread flex-row align-c jc-c" @tap="btn_event">
|
||||
<block v-if="style.float_style == 'diffuse'">
|
||||
<view class="ring" :style="content_style"></view>
|
||||
<view class="ring" :style="content_style"></view>
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
</block>
|
||||
</view>
|
||||
</movable-view>
|
||||
<component-quick-nav ref="quick_nav" :propIsBtn="false"></component-quick-nav>
|
||||
</movable-area>
|
||||
</template>
|
||||
|
||||
|
|
@ -22,10 +23,12 @@
|
|||
import { isEmpty } from '@/common/js/common/common.js';
|
||||
import imageEmpty from '@/components/diy/modules/image-empty.vue';
|
||||
import componentOnlineService from '@/components/online-service/online-service';
|
||||
import componentQuickNav from '@/components/quick-nav/quick-nav';
|
||||
export default {
|
||||
components: {
|
||||
imageEmpty,
|
||||
componentOnlineService
|
||||
componentOnlineService,
|
||||
componentQuickNav
|
||||
},
|
||||
props: {
|
||||
propValue: {
|
||||
|
|
@ -83,11 +86,22 @@
|
|||
y: y
|
||||
});
|
||||
},
|
||||
url_open() {
|
||||
// 按钮事件
|
||||
btn_event() {
|
||||
const { button_jump, button_link } = this.form;
|
||||
// 如果是指定链接,并且链接不为空的情况下跳转
|
||||
if (button_jump == 'link' && !isEmpty(button_link)) {
|
||||
app.globalData.url_open(button_link.page);
|
||||
switch(button_jump) {
|
||||
// 链接
|
||||
case 'link' :
|
||||
if (!isEmpty(button_link)) {
|
||||
app.globalData.url_open(button_link.page);
|
||||
}
|
||||
break;
|
||||
// 快捷导航
|
||||
case 'quick_nav' :
|
||||
if ((this.$refs.quick_nav || null) != null) {
|
||||
this.$refs.quick_nav.quick_open_event();
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -0,0 +1,131 @@
|
|||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null && status == 1" class="plugins-popupscreen wh-auto ht-auto">
|
||||
<view class="content pr">
|
||||
<image class="dis-block auto" :src="data.images" mode="widthFix" :data-value="data.images_url || ''" @tap="url_event"></image>
|
||||
<view class="tc margin-top-xl">
|
||||
<view class="close cp round padding-sm auto" @tap.stop="close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#cacaca"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data: null,
|
||||
status: 0,
|
||||
cache_key: 'plugins_popupscreen_cache_key',
|
||||
timer: null,
|
||||
};
|
||||
},
|
||||
props: {},
|
||||
// 页面被展示
|
||||
created: function () {
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if ((status || false) == true) {
|
||||
this.setData({
|
||||
data: app.globalData.get_config('plugins_base.popupscreen.data') || null,
|
||||
});
|
||||
this.init();
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 初始化
|
||||
init() {
|
||||
var data = this.data || null;
|
||||
if (data != null && parseInt(data.is_app_enable || 0) == 1 && parseInt(data.is_valid || 0) == 1) {
|
||||
// 是否全局
|
||||
var temp_status = true;
|
||||
if(parseFloat(data.is_overall || 0) == 0) {
|
||||
// 非首页则不展示
|
||||
if(!app.globalData.is_tabbar_home()) {
|
||||
temp_status = false;
|
||||
}
|
||||
}
|
||||
if(temp_status) {
|
||||
// 不存在关闭缓存或者超过间隔时间则显示
|
||||
var key = this.cache_key;
|
||||
var cv = parseInt(uni.getStorageSync(key)) || 0;
|
||||
var pv = parseInt(data.interval_time) || 86400;
|
||||
if (cv == 0 || cv + pv < app.globalData.get_timestamp()) {
|
||||
// 是否开启自动关闭
|
||||
var timer = null;
|
||||
var ct = parseInt(data.close_time) || 0;
|
||||
if (ct > 0) {
|
||||
var self = this;
|
||||
timer = setTimeout(function () {
|
||||
self.setData({
|
||||
status: 0,
|
||||
});
|
||||
uni.setStorage({
|
||||
key: key,
|
||||
data: app.globalData.get_timestamp(),
|
||||
});
|
||||
}, ct * 1000);
|
||||
}
|
||||
this.setData({
|
||||
status: 1,
|
||||
timer: timer,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 关闭事件
|
||||
close_event(e) {
|
||||
this.setData({
|
||||
status: 0,
|
||||
});
|
||||
uni.setStorage({
|
||||
key: this.cache_key,
|
||||
data: app.globalData.get_timestamp(),
|
||||
});
|
||||
clearInterval(this.timer);
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.plugins-popupscreen {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 20;
|
||||
background-color: rgb(0 0 0 / 0.3);
|
||||
}
|
||||
.plugins-popupscreen .close {
|
||||
right: 10%;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
width: 46rpx;
|
||||
height: 46rpx;
|
||||
line-height: 46rpx;
|
||||
background-color: rgb(4 4 4 / 0.3);
|
||||
border: solid 1px #a9a9a9;
|
||||
}
|
||||
.plugins-popupscreen .content {
|
||||
margin-top: calc(50vh - 200rpx) !important;
|
||||
}
|
||||
.plugins-popupscreen .content image {
|
||||
width: 600rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view :class="theme_view">
|
||||
<!-- 开启事件 -->
|
||||
<movable-area v-if="quick_status == 1" :class="'quick-movable-container ' + common_ent" :style="'height: calc(100% - ' + height_dec + 'rpx);top:' + top + 'rpx;'">
|
||||
<movable-area v-if="propIsBtn && quick_status == 1" :class="'quick-movable-container ' + common_ent" :style="'height: calc(100% - ' + height_dec + 'rpx);top:' + top + 'rpx;'">
|
||||
<movable-view direction="all" :x="x" :y="y" :animation="false" class="quick-event-submit" @tap="quick_open_event">
|
||||
<image class="image" :src="common_static_url + 'quick-icon.png'" mode="widthFix"></image>
|
||||
</movable-view>
|
||||
|
|
@ -59,9 +59,13 @@
|
|||
componentNoData,
|
||||
},
|
||||
props: {
|
||||
propIsBar: {
|
||||
propIsBtn: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
default: true,
|
||||
},
|
||||
propIsBar: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
propIsNav: {
|
||||
type: Boolean,
|
||||
|
|
|
|||
|
|
@ -324,7 +324,7 @@
|
|||
this.setData({
|
||||
params: params,
|
||||
post_data: {
|
||||
wd: params.keywords || ''
|
||||
wd: (params.keywords || '').replace(/\+/g, ' ')
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -165,31 +165,4 @@
|
|||
}
|
||||
.plugins-homemiddleadv .item {
|
||||
flex: 1 1 calc(50% - 20rpx);
|
||||
}
|
||||
|
||||
/**
|
||||
* 弹屏广告 - 插件
|
||||
*/
|
||||
.plugins-popupscreen {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 20;
|
||||
background-color: rgb(0 0 0 / 0.3);
|
||||
}
|
||||
.plugins-popupscreen .close {
|
||||
right: 10%;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
width: 46rpx;
|
||||
height: 46rpx;
|
||||
line-height: 46rpx;
|
||||
background-color: rgb(4 4 4 / 0.3);
|
||||
border: solid 1px #a9a9a9;
|
||||
}
|
||||
.plugins-popupscreen .content {
|
||||
margin-top: calc(50vh - 200rpx) !important;
|
||||
}
|
||||
.plugins-popupscreen .content image {
|
||||
width: 600rpx;
|
||||
}
|
||||
|
|
@ -261,16 +261,6 @@
|
|||
</view>
|
||||
</block>
|
||||
</block>
|
||||
|
||||
<!-- 弹屏广告 - 插件 -->
|
||||
<view v-if="(plugins_popupscreen_data || null) != null && plugins_popupscreen_status == 1" class="plugins-popupscreen wh-auto ht-auto">
|
||||
<view class="content pr">
|
||||
<view class="close pa cp round padding-sm tc" @tap.stop="plugins_popupscreen_close_event">
|
||||
<iconfont name="icon-close-o" size="28rpx" color="#cacaca"></iconfont>
|
||||
</view>
|
||||
<image class="dis-block auto" :src="plugins_popupscreen_data.images" mode="widthFix" :data-value="plugins_popupscreen_data.images_url || ''" @tap="url_event"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
|
|
@ -392,11 +382,6 @@
|
|||
plugins_label_data: null,
|
||||
// 首页中间广告插件
|
||||
plugins_homemiddleadv_data: null,
|
||||
// 弹屏广告、这里设置一天后可以再次显示
|
||||
plugins_popupscreen_data: null,
|
||||
plugins_popupscreen_status: 0,
|
||||
plugins_popupscreen_cache_key: 'plugins_popupscreen_cache_key',
|
||||
plugins_popupscreen_timer: null,
|
||||
// 哀悼灰度插件
|
||||
plugins_mourning_data_is_app: app.globalData.is_app_mourning(),
|
||||
// 标签插件
|
||||
|
|
@ -554,7 +539,6 @@
|
|||
plugins_activity_data: (data.plugins_activity_data || null) == null || data.plugins_activity_data.length <= 0 ? null : data.plugins_activity_data,
|
||||
plugins_label_data: (data.plugins_label_data || null) == null || (data.plugins_label_data.base || null) == null || (data.plugins_label_data.data || null) == null || data.plugins_label_data.data.length <= 0 ? null : data.plugins_label_data,
|
||||
plugins_homemiddleadv_data: (data.plugins_homemiddleadv_data || null) == null || data.plugins_homemiddleadv_data.length <= 0 ? null : data.plugins_homemiddleadv_data,
|
||||
plugins_popupscreen_data: data.plugins_popupscreen_data || null,
|
||||
plugins_mourning_data_is_app: parseInt(data.plugins_mourning_data || 0) == 1,
|
||||
plugins_blog_data: data.plugins_blog_data || null,
|
||||
plugins_realstore_data: data.plugins_realstore_data || null,
|
||||
|
|
@ -574,9 +558,6 @@
|
|||
// 设置顶部导航的默认颜色
|
||||
this.set_navigation_bar_color();
|
||||
|
||||
// 弹屏广告插件处理
|
||||
this.plugins_popupscreen_handle();
|
||||
|
||||
// 是否需要重新加载数据
|
||||
if (parseInt(data.is_result_data_cache || 0) == 1) {
|
||||
this.init({ is_cache: 0 });
|
||||
|
|
@ -661,48 +642,6 @@
|
|||
app.globalData.url_event(e);
|
||||
},
|
||||
|
||||
// 弹屏广告插件处理
|
||||
plugins_popupscreen_handle() {
|
||||
if (this.plugins_popupscreen_data != null) {
|
||||
// 不存在关闭缓存或者超过间隔时间则显示
|
||||
var cv = parseInt(uni.getStorageSync(this.plugins_popupscreen_cache_key)) || 0;
|
||||
var pv = parseInt(this.plugins_popupscreen_data.interval_time) || 86400;
|
||||
if (cv == 0 || cv + pv < app.globalData.get_timestamp()) {
|
||||
// 是否开启自动关闭
|
||||
var timer = null;
|
||||
var ct = parseInt(this.plugins_popupscreen_data.close_time) || 0;
|
||||
if (ct > 0) {
|
||||
var self = this;
|
||||
timer = setTimeout(function () {
|
||||
self.setData({
|
||||
plugins_popupscreen_status: 0,
|
||||
});
|
||||
uni.setStorage({
|
||||
key: self.plugins_popupscreen_cache_key,
|
||||
data: app.globalData.get_timestamp(),
|
||||
});
|
||||
}, ct * 1000);
|
||||
}
|
||||
this.setData({
|
||||
plugins_popupscreen_status: 1,
|
||||
plugins_popupscreen_timer: timer,
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 弹屏广告 - 插件 关闭事件
|
||||
plugins_popupscreen_close_event(e) {
|
||||
this.setData({
|
||||
plugins_popupscreen_status: 0,
|
||||
});
|
||||
uni.setStorage({
|
||||
key: this.plugins_popupscreen_cache_key,
|
||||
data: app.globalData.get_timestamp(),
|
||||
});
|
||||
clearInterval(this.plugins_popupscreen_timer);
|
||||
},
|
||||
|
||||
// 轮播改变、背景色处理
|
||||
change_banner(color) {
|
||||
if ((color || null) == null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue