app管理,用户基础使用提到公共层

master
gongfuxiang 2024-09-29 17:33:51 +08:00
parent 2bb8a68597
commit fc73e1e7ae
11 changed files with 132 additions and 151 deletions

View File

@ -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;
}

View File

@ -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();
}
},
//

View File

@ -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);
}
}
},

View File

@ -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>

View File

@ -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: {

View File

@ -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();
}
},

View File

@ -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();
}
},

View File

@ -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();
}
},
//

View File

@ -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

View File

@ -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();
}
},
//

View File

@ -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');
}
},
//