资质认证提示
parent
3e37cb4423
commit
9fe63258bc
4
App.vue
4
App.vue
|
|
@ -7,10 +7,10 @@
|
|||
data: {
|
||||
// 基础配置
|
||||
// 数据接口请求地址
|
||||
request_url:'http://shopxo.com/',
|
||||
request_url:'https://new.shopxo.vip/',
|
||||
|
||||
// 静态资源地址(如系统根目录不在public目录下面请在静态地址后面加public目录、如:https://d1.shopxo.vip/public/)
|
||||
static_url:'http://shopxo.com/',
|
||||
static_url:'https://new.shopxo.vip/',
|
||||
|
||||
// 系统类型(默认default、如额外独立小程序、可与程序分身插件实现不同主体小程序及支付独立)
|
||||
system_type: 'default',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,91 @@
|
|||
<template>
|
||||
<view :class="theme_view">
|
||||
<component-popup :propShow="popup_status" propPosition="bottom" @onclose="popup_close_event">
|
||||
<view :class="'certificate-popup bg-white ' + (propIsGrayscale ? 'grayscale' : '')">
|
||||
<view class="close fr oh">
|
||||
<view class="fr" @tap.stop="popup_close_event">
|
||||
<iconfont name="icon-close-o" size="24rpx" color="#999"></iconfont>
|
||||
</view>
|
||||
</view>
|
||||
<view class="padding-main">
|
||||
hello
|
||||
</view>
|
||||
</view>
|
||||
</component-popup>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentPopup from '@/components/popup/popup';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
popup_status: false,
|
||||
cconfig: null
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentPopup,
|
||||
},
|
||||
props: {
|
||||
propIsGrayscale: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
|
||||
created: function () {
|
||||
// 初始化配置
|
||||
this.init_config();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化配置
|
||||
init_config(status) {
|
||||
if ((status || false) == true) {
|
||||
this.setData({
|
||||
config: app.globalData.get_config('plugins_base.certificate.data') || null,
|
||||
});
|
||||
} else {
|
||||
app.globalData.is_config(this, 'init_config');
|
||||
}
|
||||
},
|
||||
|
||||
// 初始配置
|
||||
init(params = {}) {
|
||||
// 初始化配置
|
||||
this.init_config(true);
|
||||
// 公共接口已初始化完成
|
||||
if(app.globalData.data.common_data_init_status == 1) {
|
||||
// 业务数据
|
||||
if((this.config || null) != null && (this.config.business_type_data || null) != null) {
|
||||
this.setData({
|
||||
popup_status: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 弹层关闭
|
||||
popup_close_event(e) {
|
||||
this.setData({
|
||||
popup_status: false,
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.certificate-popup {
|
||||
padding: 36rpx;
|
||||
position: relative;
|
||||
}
|
||||
.certificate-popup .close {
|
||||
position: absolute;
|
||||
top: 36rpx;
|
||||
right: 36rpx;
|
||||
z-index: 2;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -40,6 +40,9 @@
|
|||
|
||||
<!-- 弹屏广告 -->
|
||||
<component-popupscreen ref="popupscreen" :propIsGrayscale="propIsGrayscale"></component-popupscreen>
|
||||
|
||||
<!-- 资质认证 -->
|
||||
<component-certificate ref="certificate" :propIsGrayscale="propIsGrayscale"></component-certificate>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
|
@ -48,6 +51,7 @@
|
|||
import componentAppAdmin from '@/components/app-admin/app-admin';
|
||||
import componentUserBase from '@/components/user-base/user-base';
|
||||
import componentPopupscreen from '@/components/popupscreen/popupscreen';
|
||||
import componentCertificate from '@/components/certificate/certificate';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -93,7 +97,8 @@
|
|||
componentDiyFooter,
|
||||
componentAppAdmin,
|
||||
componentUserBase,
|
||||
componentPopupscreen
|
||||
componentPopupscreen,
|
||||
componentCertificate
|
||||
},
|
||||
// 页面被展示
|
||||
created: function () {
|
||||
|
|
@ -145,6 +150,11 @@
|
|||
this.$refs.popupscreen.init(params);
|
||||
}
|
||||
|
||||
// 资质认证
|
||||
if (this.propIsPopupscreen && (this.$refs.certificate || null) != null) {
|
||||
this.$refs.certificate.init(params);
|
||||
}
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
// 微信协议验证
|
||||
if (app.globalData.data.is_weixin_privacy_setting == 1) {
|
||||
|
|
|
|||
|
|
@ -112,57 +112,59 @@
|
|||
init(params = {}) {
|
||||
// 初始化配置
|
||||
this.init_config(true);
|
||||
|
||||
// 未指定类型则自动匹配页面
|
||||
var type = '';
|
||||
if((params.type || null) == null) {
|
||||
var page = '/'+app.globalData.current_page(false);
|
||||
var obj = {
|
||||
'index': '/pages/index/index',
|
||||
'goods-category': '/pages/goods-category/goods-category',
|
||||
'cart': '/pages/cart/cart',
|
||||
'user': '/pages/user/user',
|
||||
};
|
||||
var index = Object.values(obj).indexOf(page);
|
||||
if(index != -1) {
|
||||
type = Object.keys(obj)[index];
|
||||
}
|
||||
} else {
|
||||
type = params.type;
|
||||
}
|
||||
if((type || null) != null) {
|
||||
// 是否需要展示弹窗提示
|
||||
if (!this.popup_status && this.pages.indexOf(type) != -1 && this.client.indexOf(this.client_value) != -1) {
|
||||
// 当前缓存用户
|
||||
var user = app.globalData.get_user_cache_info() || null;
|
||||
// 需要填写字段数据
|
||||
var result = this.form_write_field_check_data(user);
|
||||
// 非微信 或者 微信小程序是否强制填写基础信息、强制则不验证时间
|
||||
if(this.client_value != 'weixin' || !this.is_weixin_force) {
|
||||
// 间隔时间
|
||||
var cache_time = parseInt(uni.getStorageSync(this.cache_key) || 0);
|
||||
var current_time = Date.parse(new Date()) / 1000;
|
||||
if (result.popup_status && !this.popup_status && cache_time > 0 && current_time < cache_time + parseInt(this.interval_time)) {
|
||||
result['popup_status'] = false;
|
||||
}
|
||||
// 公共接口已初始化完成
|
||||
if(app.globalData.data.common_data_init_status == 1) {
|
||||
// 未指定类型则自动匹配页面
|
||||
var type = '';
|
||||
if((params.type || null) == null) {
|
||||
var page = '/'+app.globalData.current_page(false);
|
||||
var obj = {
|
||||
'index': '/pages/index/index',
|
||||
'goods-category': '/pages/goods-category/goods-category',
|
||||
'cart': '/pages/cart/cart',
|
||||
'user': '/pages/user/user',
|
||||
};
|
||||
var index = Object.values(obj).indexOf(page);
|
||||
if(index != -1) {
|
||||
type = Object.keys(obj)[index];
|
||||
}
|
||||
|
||||
// 1秒后再提示用户填写信息
|
||||
clearTimeout(this.timer);
|
||||
var self = this;
|
||||
var timer = setTimeout(function () {
|
||||
self.setData({
|
||||
...result,
|
||||
...{
|
||||
back_object: params.object || null,
|
||||
back_method: params.method || null,
|
||||
back_params: params.params || params,
|
||||
} else {
|
||||
type = params.type;
|
||||
}
|
||||
if((type || null) != null) {
|
||||
// 是否需要展示弹窗提示
|
||||
if (!this.popup_status && this.pages.indexOf(type) != -1 && this.client.indexOf(this.client_value) != -1) {
|
||||
// 当前缓存用户
|
||||
var user = app.globalData.get_user_cache_info() || null;
|
||||
// 需要填写字段数据
|
||||
var result = this.form_write_field_check_data(user);
|
||||
// 非微信 或者 微信小程序是否强制填写基础信息、强制则不验证时间
|
||||
if(this.client_value != 'weixin' || !this.is_weixin_force) {
|
||||
// 间隔时间
|
||||
var cache_time = parseInt(uni.getStorageSync(this.cache_key) || 0);
|
||||
var current_time = Date.parse(new Date()) / 1000;
|
||||
if (result.popup_status && !this.popup_status && cache_time > 0 && current_time < cache_time + parseInt(this.interval_time)) {
|
||||
result['popup_status'] = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 1秒后再提示用户填写信息
|
||||
clearTimeout(this.timer);
|
||||
var self = this;
|
||||
var timer = setTimeout(function () {
|
||||
self.setData({
|
||||
...result,
|
||||
...{
|
||||
back_object: params.object || null,
|
||||
back_method: params.method || null,
|
||||
back_params: params.params || params,
|
||||
}
|
||||
});
|
||||
}, 500);
|
||||
this.setData({
|
||||
timer: timer
|
||||
});
|
||||
}, 500);
|
||||
this.setData({
|
||||
timer: timer
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue