app管理,用户基础使用提到公共层
parent
2bb8a68597
commit
fc73e1e7ae
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
<!-- 关于我们中使用 -->
|
||||
<!-- #ifdef APP -->
|
||||
<view v-if="propType == 'about'" class="margin-top">
|
||||
<view v-if="is_about_page" class="margin-top">
|
||||
<text class="cr-grey-9">{{app_version_info}}</text>
|
||||
<block v-if="is_loading">
|
||||
<text v-if="(update_data || null) == null" class="cr-grey-c margin-left-lg text-size-xs">{{$t('common.already_latest_text')}}</text>
|
||||
|
|
@ -54,6 +54,7 @@
|
|||
update_tips_cache_key: app.globalData.data.cache_app_update_tips_interval_time_key,
|
||||
star_tips_cache_key: app.globalData.data.cache_app_star_tips_interval_time_key,
|
||||
app_version_info: app.globalData.data.app_version_info,
|
||||
is_about_page: false,
|
||||
is_loading: false,
|
||||
update_data: null,
|
||||
// 更新提示
|
||||
|
|
@ -65,16 +66,10 @@
|
|||
star_tips_await_time: 0,
|
||||
star_tips_interval_time: 0,
|
||||
star_alert_images: null,
|
||||
star_url: null
|
||||
star_url: null
|
||||
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
props: {
|
||||
propType: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
// 页面被展示
|
||||
created: function () {
|
||||
this.init();
|
||||
|
|
@ -83,7 +78,13 @@
|
|||
methods: {
|
||||
// 初始化、获取数据
|
||||
init(is_init = 0) {
|
||||
// #ifdef APP
|
||||
// #ifdef APP
|
||||
// 是否关于我们页面
|
||||
this.setData({
|
||||
is_about_page: app.globalData.current_page(false) == 'pages/about/about',
|
||||
});
|
||||
|
||||
// 请求接口获取版本数据
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'version', 'appadmin'),
|
||||
method: 'POST',
|
||||
|
|
@ -135,7 +136,7 @@
|
|||
}
|
||||
|
||||
// 关于我们页面则不直接展示
|
||||
if(this.propType == 'about') {
|
||||
if(this.is_about_page) {
|
||||
upd_data.is_update_status = false;
|
||||
upd_data.is_star_status = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,23 @@
|
|||
<template>
|
||||
<view>
|
||||
<!-- 底部菜单 -->
|
||||
<block v-if="is_tabbar">
|
||||
<componentDiyFooter :key="key" :propValue="app_tabber" @footer-height="footer_height_value_event"></componentDiyFooter>
|
||||
<component-diy-footer :key="key" :propValue="app_tabber" @footer-height="footer_height_value_event"></component-diy-footer>
|
||||
<view v-if="propIsFooterSeat && footer_height_value > 0" :style="'height:'+footer_height_value+'rpx;'"></view>
|
||||
</block>
|
||||
</block>
|
||||
|
||||
<!-- app管理 -->
|
||||
<component-app-admin ref="app_admin"></component-app-admin>
|
||||
|
||||
<!-- 用户基础 -->
|
||||
<component-user-base ref="user_base" :propIsGrayscale="propIsGrayscale"></component-user-base>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentDiyFooter from '@/components/diy/footer';
|
||||
import componentDiyFooter from '@/components/diy/footer';
|
||||
import componentAppAdmin from '@/components/app-admin/app-admin';
|
||||
import componentUserBase from '@/components/user-base/user-base';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -20,13 +29,31 @@
|
|||
};
|
||||
},
|
||||
props: {
|
||||
// 是否灰度
|
||||
propIsGrayscale: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 是否显示底部菜单占位
|
||||
propIsFooterSeat: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
}
|
||||
},
|
||||
// 是否引入app管理
|
||||
propIsAppAdmin: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
// 是否引入用户基础信息提示
|
||||
propIsUserBase: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
components: {
|
||||
componentDiyFooter
|
||||
componentDiyFooter,
|
||||
componentAppAdmin,
|
||||
componentUserBase
|
||||
},
|
||||
// 页面被展示
|
||||
created: function () {
|
||||
|
|
@ -66,7 +93,15 @@
|
|||
|
||||
// 显示响应方法
|
||||
on_show() {
|
||||
console.log('on show');
|
||||
// app管理
|
||||
if (this.propIsAppAdmin && (this.$refs.app_admin || null) != null) {
|
||||
this.$refs.app_admin.init();
|
||||
}
|
||||
|
||||
// 用户头像和昵称设置提示
|
||||
if (this.propIsUserBase && (this.$refs.user_base || null) != null) {
|
||||
this.$refs.user_base.init();
|
||||
}
|
||||
},
|
||||
|
||||
// 底部菜单高度
|
||||
|
|
|
|||
|
|
@ -90,37 +90,53 @@
|
|||
// 初始化配置
|
||||
this.init_config(true);
|
||||
|
||||
// 是否需要展示弹窗提示
|
||||
if (!this.popup_status && this.pages.indexOf(type) != -1 && this.client.indexOf(this.application_client_type) != -1) {
|
||||
// 当前缓存用户
|
||||
var user = app.globalData.get_user_cache_info() || null;
|
||||
// 默认昵称则赋空值
|
||||
var arr = [this.$t('user-base.user-base.8u9on2'), this.$t('user-base.user-base.t8i9l4'), this.$t('user-base.user-base.0imw74'), this.$t('user-base.user-base.27q5af'), this.$t('user-base.user-base.211pk4'), this.$t('user-base.user-base.5x8o43'), 'WeChat User', 'Usuarios de Wechat'];
|
||||
if (user != null && (user.nickname || null) != null && arr.indexOf(user.nickname) != -1) {
|
||||
user.nickname = '';
|
||||
}
|
||||
// 头像是默认则置为空
|
||||
if (user != null && (user.avatar || null) != null && user.avatar.indexOf('default-user-avatar') != -1) {
|
||||
user.avatar = '';
|
||||
}
|
||||
// 状态
|
||||
var status = user == null ? false : ((user.avatar || null) == null || (user.nickname || null) == null ? true : false);
|
||||
// 间隔时间
|
||||
var cache_time = parseInt(uni.getStorageSync(this.cache_key) || 0);
|
||||
var current_time = Date.parse(new Date()) / 1000;
|
||||
if (status && !this.popup_status && cache_time > 0 && current_time < cache_time + parseInt(this.interval_time)) {
|
||||
status = false;
|
||||
// 未指定类型则自动匹配页面
|
||||
if((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];
|
||||
}
|
||||
}
|
||||
if((type || null) == null) {
|
||||
// 是否需要展示弹窗提示
|
||||
if (!this.popup_status && this.pages.indexOf(type) != -1 && this.client.indexOf(this.application_client_type) != -1) {
|
||||
// 当前缓存用户
|
||||
var user = app.globalData.get_user_cache_info() || null;
|
||||
// 默认昵称则赋空值
|
||||
var arr = [this.$t('user-base.user-base.8u9on2'), this.$t('user-base.user-base.t8i9l4'), this.$t('user-base.user-base.0imw74'), this.$t('user-base.user-base.27q5af'), this.$t('user-base.user-base.211pk4'), this.$t('user-base.user-base.5x8o43'), 'WeChat User', 'Usuarios de Wechat'];
|
||||
if (user != null && (user.nickname || null) != null && arr.indexOf(user.nickname) != -1) {
|
||||
user.nickname = '';
|
||||
}
|
||||
// 头像是默认则置为空
|
||||
if (user != null && (user.avatar || null) != null && user.avatar.indexOf('default-user-avatar') != -1) {
|
||||
user.avatar = '';
|
||||
}
|
||||
// 状态
|
||||
var status = user == null ? false : ((user.avatar || null) == null || (user.nickname || null) == null ? true : false);
|
||||
// 间隔时间
|
||||
var cache_time = parseInt(uni.getStorageSync(this.cache_key) || 0);
|
||||
var current_time = Date.parse(new Date()) / 1000;
|
||||
if (status && !this.popup_status && cache_time > 0 && current_time < cache_time + parseInt(this.interval_time)) {
|
||||
status = false;
|
||||
}
|
||||
|
||||
// 1秒后再提示用户填写信息
|
||||
var self = this;
|
||||
clearTimeout(this.timer);
|
||||
this.timer = setTimeout(function () {
|
||||
self.setData({
|
||||
popup_status: status,
|
||||
user: user,
|
||||
});
|
||||
}, 500);
|
||||
// 1秒后再提示用户填写信息
|
||||
var self = this;
|
||||
clearTimeout(this.timer);
|
||||
this.timer = setTimeout(function () {
|
||||
self.setData({
|
||||
popup_status: status,
|
||||
user: user,
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<!-- 名称 -->
|
||||
<view class="margin-top-sm text-size">{{title}}</view>
|
||||
<!-- app管理 -->
|
||||
<component-app-admin ref="app_admin" propType="about"></component-app-admin>
|
||||
<component-app-admin ref="app_admin"></component-app-admin>
|
||||
<!-- 简介 -->
|
||||
<view class="margin-top-xxxxl cr-base text-size-sm">{{describe}}</view>
|
||||
<!-- 协议 -->
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
<component-common ref="common" :propIsAppAdmin="false"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<component-quick-nav :propIsBar="true"></component-quick-nav>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common @footer-height="footer_height_value_event" :propIsFooterSeat="false"></component-common>
|
||||
<component-common ref="common" @footer-height="footer_height_value_event" :propIsFooterSeat="false"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
|
@ -36,6 +36,11 @@
|
|||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -3,22 +3,14 @@
|
|||
<!-- 购物车 -->
|
||||
<component-cart ref="cart" :propCartNavBottomValue="footer_height_value"></component-cart>
|
||||
|
||||
<!-- 用户基础 -->
|
||||
<component-user-base ref="user_base"></component-user-base>
|
||||
|
||||
<!-- app管理 -->
|
||||
<component-app-admin ref="app_admin"></component-app-admin>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common @footer-height="footer_height_value_event" :propIsFooterSeat="false"></component-common>
|
||||
<component-common ref="common" @footer-height="footer_height_value_event" :propIsFooterSeat="false"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentCommon from '@/components/common/common';
|
||||
import componentCart from "@/components/cart/cart";
|
||||
import componentUserBase from '@/components/user-base/user-base';
|
||||
import componentAppAdmin from '@/components/app-admin/app-admin';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -28,9 +20,7 @@
|
|||
},
|
||||
components: {
|
||||
componentCommon,
|
||||
componentCart,
|
||||
componentUserBase,
|
||||
componentAppAdmin
|
||||
componentCart
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
|
|
@ -47,14 +37,9 @@
|
|||
this.$refs.cart.init();
|
||||
}
|
||||
|
||||
// app管理
|
||||
if ((this.$refs.app_admin || null) != null) {
|
||||
this.$refs.app_admin.init();
|
||||
}
|
||||
|
||||
// 用户头像和昵称设置提示
|
||||
if ((this.$refs.user_base || null) != null) {
|
||||
this.$refs.user_base.init('cart');
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -357,18 +357,12 @@
|
|||
|
||||
<!-- 商品购买 -->
|
||||
<component-goods-buy ref="goods_buy" :propCurrencySymbol="currency_symbol" v-on:CartSuccessEvent="goods_cart_back_event"></component-goods-buy>
|
||||
|
||||
<!-- 用户基础 -->
|
||||
<component-user-base ref="user_base"></component-user-base>
|
||||
|
||||
<!-- app管理 -->
|
||||
<component-app-admin ref="app_admin"></component-app-admin>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common @footer-height="footer_height_value_event" :propIsFooterSeat="false"></component-common>
|
||||
<component-common ref="common" @footer-height="footer_height_value_event" :propIsFooterSeat="false"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -382,9 +376,7 @@
|
|||
import componentPopup from '@/components/popup/popup';
|
||||
import componentBadge from '@/components/badge/badge';
|
||||
import componentCartParaCurve from '@/components/cart-para-curve/cart-para-curve';
|
||||
import componentUserBase from '@/components/user-base/user-base';
|
||||
import componentNavMore from '@/components/nav-more/nav-more';
|
||||
import componentAppAdmin from '@/components/app-admin/app-admin';
|
||||
|
||||
var theme_static_url = app.globalData.get_static_url('goods-category');
|
||||
var common_static_url = app.globalData.get_static_url('common');
|
||||
|
|
@ -469,9 +461,7 @@
|
|||
componentPopup,
|
||||
componentBadge,
|
||||
componentCartParaCurve,
|
||||
componentUserBase,
|
||||
componentNavMore,
|
||||
componentAppAdmin
|
||||
componentNavMore
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
|
|
@ -506,14 +496,9 @@
|
|||
// 清除tab参数
|
||||
app.globalData.remove_page_tabbar_switch_params();
|
||||
|
||||
// app管理
|
||||
if ((this.$refs.app_admin || null) != null) {
|
||||
this.$refs.app_admin.init();
|
||||
}
|
||||
|
||||
// 用户头像和昵称设置提示
|
||||
if ((this.$refs.user_base || null) != null) {
|
||||
this.$refs.user_base.init('goods-category');
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -611,7 +611,7 @@
|
|||
</block>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common @footer-height="footer_height_value_event"></component-common>
|
||||
<component-common ref="common" @footer-height="footer_height_value_event"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
|
@ -832,6 +832,11 @@
|
|||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
|
|
|
|||
|
|
@ -288,14 +288,8 @@
|
|||
<component-quick-nav :propIsNav="true" :propIsBar="true" :propIsGrayscale="plugins_mourning_data_is_app"></component-quick-nav>
|
||||
</block>
|
||||
|
||||
<!-- 用户基础 -->
|
||||
<component-user-base ref="user_base" :propIsGrayscale="plugins_mourning_data_is_app"></component-user-base>
|
||||
|
||||
<!-- app管理 -->
|
||||
<component-app-admin ref="app_admin"></component-app-admin>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
<component-common ref="common" :propIsGrayscale="plugins_mourning_data_is_app"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
|
@ -317,10 +311,8 @@
|
|||
import componentRealstoreList from '@/components/realstore-list/realstore-list';
|
||||
import componentShopList from '@/components/shop-list/shop-list';
|
||||
import componentGoodsList from '@/components/goods-list/goods-list';
|
||||
import componentUserBase from '@/components/user-base/user-base';
|
||||
import componentBindingList from '@/components/binding-list/binding-list';
|
||||
import componentMagicList from '@/components/magic-list/magic-list';
|
||||
import componentAppAdmin from '@/components/app-admin/app-admin';
|
||||
import componentDiy from '@/components/diy/diy';
|
||||
import componentChoiceLocation from '@/components/choice-location/choice-location';
|
||||
|
||||
|
|
@ -379,8 +371,6 @@
|
|||
// #endif
|
||||
// 是否单页预览
|
||||
is_single_page: app.globalData.is_current_single_page() || 0,
|
||||
// 用户位置信息
|
||||
user_location: {},
|
||||
// 轮播滚动时,背景色替换
|
||||
slider_bg: null,
|
||||
// 插件顺序列表
|
||||
|
|
@ -433,10 +423,8 @@
|
|||
componentRealstoreList,
|
||||
componentShopList,
|
||||
componentGoodsList,
|
||||
componentUserBase,
|
||||
componentBindingList,
|
||||
componentMagicList,
|
||||
componentAppAdmin,
|
||||
componentDiy,
|
||||
componentChoiceLocation
|
||||
},
|
||||
|
|
@ -450,12 +438,6 @@
|
|||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 加载数据
|
||||
if (this.is_home_location_choice == 1) {
|
||||
// 用户位置初始化
|
||||
this.user_location_init();
|
||||
}
|
||||
|
||||
// 数据加载
|
||||
this.init();
|
||||
|
||||
|
|
@ -466,16 +448,6 @@
|
|||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// app管理
|
||||
if ((this.$refs.app_admin || null) != null) {
|
||||
this.$refs.app_admin.init();
|
||||
}
|
||||
|
||||
// 用户头像和昵称设置提示
|
||||
if ((this.$refs.user_base || null) != null) {
|
||||
this.$refs.user_base.init('index');
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
|
|
@ -661,16 +633,8 @@
|
|||
|
||||
// 选择用户地理位置回调
|
||||
user_back_choice_location(e) {
|
||||
this.setData({
|
||||
user_location: e
|
||||
});
|
||||
},
|
||||
|
||||
// 用户地理位置初始化
|
||||
user_location_init() {
|
||||
this.setData({
|
||||
user_location: app.globalData.choice_user_location_init()
|
||||
});
|
||||
// 重新刷新数据
|
||||
this.init();
|
||||
},
|
||||
|
||||
// url事件
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@
|
|||
<component-share-popup ref="share"></component-share-popup>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common @footer-height="footer_height_value_event" :propIsFooterSeat="false"></component-common>
|
||||
<component-common ref="common" @footer-height="footer_height_value_event" :propIsFooterSeat="false"></component-common>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
|
@ -436,6 +436,11 @@
|
|||
setTimeout(function() {
|
||||
self.get_detail_init();
|
||||
}, 100);
|
||||
|
||||
// 公共onshow事件
|
||||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
|
|
|
|||
|
|
@ -161,12 +161,6 @@
|
|||
<!-- 快捷导航 -->
|
||||
<component-quick-nav :propIsNav="true" :propIsBar="true"></component-quick-nav>
|
||||
|
||||
<!-- 用户基础 -->
|
||||
<component-user-base ref="user_base"></component-user-base>
|
||||
|
||||
<!-- app管理 -->
|
||||
<component-app-admin ref="app_admin"></component-app-admin>
|
||||
|
||||
<!-- 公共 -->
|
||||
<component-common ref="common"></component-common>
|
||||
</view>
|
||||
|
|
@ -178,8 +172,6 @@
|
|||
import componentBadge from '@/components/badge/badge';
|
||||
import componentCopyright from '@/components/copyright/copyright';
|
||||
import componentOnlineService from '@/components/online-service/online-service';
|
||||
import componentUserBase from '@/components/user-base/user-base';
|
||||
import componentAppAdmin from '@/components/app-admin/app-admin';
|
||||
|
||||
var common_static_url = app.globalData.get_static_url('common');
|
||||
var static_url = app.globalData.get_static_url('user');
|
||||
|
|
@ -220,9 +212,7 @@
|
|||
componentQuickNav,
|
||||
componentBadge,
|
||||
componentCopyright,
|
||||
componentOnlineService,
|
||||
componentUserBase,
|
||||
componentAppAdmin
|
||||
componentOnlineService
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
|
|
@ -247,16 +237,6 @@
|
|||
if ((this.$refs.common || null) != null) {
|
||||
this.$refs.common.on_show();
|
||||
}
|
||||
|
||||
// app管理
|
||||
if ((this.$refs.app_admin || null) != null) {
|
||||
this.$refs.app_admin.init();
|
||||
}
|
||||
|
||||
// 用户头像和昵称设置提示
|
||||
if ((this.$refs.user_base || null) != null) {
|
||||
this.$refs.user_base.init('user');
|
||||
}
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
|
|
|
|||
Loading…
Reference in New Issue