去除多余的语言,登录提示优化
parent
44118d73fd
commit
c791bd9e18
37
App.vue
37
App.vue
|
|
@ -351,7 +351,7 @@
|
|||
|
||||
// #ifdef H5
|
||||
// h5登录注册
|
||||
self.login_confirm_tips_modal();
|
||||
self.login_confirm_tips_modal(self, object, method, params);
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
|
|
@ -470,37 +470,30 @@
|
|||
});
|
||||
},
|
||||
fail(res) {
|
||||
self.login_confirm_tips_modal();
|
||||
self.login_confirm_tips_modal(self, object, method, params);
|
||||
},
|
||||
});
|
||||
} else {
|
||||
self.login_confirm_tips_modal();
|
||||
self.login_confirm_tips_modal(self, object, method, params);
|
||||
}
|
||||
},
|
||||
fail(res) {
|
||||
self.login_confirm_tips_modal();
|
||||
self.login_confirm_tips_modal(self, object, method, params);
|
||||
},
|
||||
});
|
||||
} else {
|
||||
self.login_confirm_tips_modal();
|
||||
self.login_confirm_tips_modal(self, object, method, params);
|
||||
}
|
||||
},
|
||||
|
||||
// 确认提示登录弹窗
|
||||
login_confirm_tips_modal() {
|
||||
uni.showModal({
|
||||
title: i18n.t('common.warm_tips'),
|
||||
content: i18n.t('shopxo-uniapp.app.n67w8p'),
|
||||
confirmText: i18n.t('common.confirm'),
|
||||
cancelText: i18n.t('common.not_yet'),
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login',
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
// 未登录确认处理
|
||||
login_confirm_tips_modal(self, object, method, params) {
|
||||
// 非init初始化调用 或者 非tabbar页面则直接跳转到登录页面
|
||||
if(method != 'init' || !self.is_tabbar_pages('/'+self.current_page(false))) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login',
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -1978,12 +1971,14 @@
|
|||
|
||||
// 清除用户缓存
|
||||
remove_user_cache_event() {
|
||||
// 当前平台
|
||||
var client_value = this.application_client();
|
||||
// 用户登录缓存
|
||||
uni.removeStorageSync(this.data.cache_user_login_key);
|
||||
// 用户信息缓存
|
||||
uni.removeStorageSync(this.data.cache_user_info_key);
|
||||
// 非小程序则两秒后回到首页
|
||||
this.showToast(i18n.t('shopxo-uniapp.app.0gwt7z'), 'success');
|
||||
this.showToast(i18n.t('shopxo-uniapp.app.'+(client_value == 'mp' ? '0gwt7z' : '87yghj')), 'success');
|
||||
var url = this.data.tabbar_pages[0];
|
||||
setTimeout(function () {
|
||||
uni.switchTab({
|
||||
|
|
|
|||
|
|
@ -113,10 +113,10 @@
|
|||
<!-- 空购物车 -->
|
||||
<view v-if="data_list.length == 0 && data_list_loding_status == 0" class="cart-no-data-box tc">
|
||||
<image :src="common_static_url + 'cart-empty.png'" mode="widthFix" class="margin-bottom-lg"></image>
|
||||
<view class="cr-grey text-size-sm">{{ data_list_loding_msg || $t('cart.cart.j8on74') }}</view>
|
||||
<navigator class="dis-inline-block" :url="home_page_url" open-type="switchTab" hover-class="none">
|
||||
<button class="bg-main br-main cr-white text-size-md round margin-top-xxl" type="default" size="mini" hover-class="none">{{ $t('cart.cart.wb5465') }}</button>
|
||||
</navigator>
|
||||
<view class="cr-grey text-size-sm">{{ data_list_loding_msg || $t('cart.cart.j8on74') }}</view>
|
||||
<view class="margin-top-xxl">
|
||||
<button class="bg-main br-main cr-white text-size-md round" type="default" size="mini" hover-class="none" @tap="no_cart_data_btn_event">{{no_cart_data_btn_text}}</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 猜你喜欢 -->
|
||||
|
|
@ -335,7 +335,9 @@
|
|||
status_bar_height: status_bar_height,
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
theme_color: app.globalData.get_theme_color(),
|
||||
common_static_url: common_static_url,
|
||||
common_static_url: common_static_url,
|
||||
user: null,
|
||||
no_cart_data_btn_text: this.$t('login.login.6yfr9g'),
|
||||
is_first: 1,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
|
|
@ -483,7 +485,12 @@
|
|||
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle();
|
||||
} else {
|
||||
} else {
|
||||
this.setData({
|
||||
user: user,
|
||||
no_cart_data_btn_text: this.$t('cart.cart.wb5465')
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
|
||||
|
|
@ -501,7 +508,12 @@
|
|||
}
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
this.setData({
|
||||
user: null,
|
||||
data_list: [],
|
||||
goods_list: [],
|
||||
plugins_realstore_info: null,
|
||||
no_cart_data_btn_text: this.$t('login.login.6yfr9g'),
|
||||
data_list_loding_status: 0,
|
||||
data_list_loding_msg: this.$t('extraction-apply.extraction-apply.m3xdif'),
|
||||
});
|
||||
|
|
@ -1273,7 +1285,13 @@
|
|||
discount_detail_goods_list_status: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
// 无购物车数据按钮事件
|
||||
no_cart_data_btn_event(e) {
|
||||
uni.navigateTo({
|
||||
url: ((this.user || null) == null) ? '/pages/login/login?event_callback=init' : this.home_page_url
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@
|
|||
import componentGoodsBuy from '../../components/goods-buy/goods-buy';
|
||||
import componentCartParaCurve from '../../components/cart-para-curve/cart-para-curve';
|
||||
import componentBadge from '../../components/badge/badge';
|
||||
import componentNoData from '../../components/no-data/no-data';
|
||||
|
||||
var static_url = app.globalData.get_static_url('realstore', true);
|
||||
export default {
|
||||
|
|
@ -182,7 +183,8 @@
|
|||
componentPopup,
|
||||
componentGoodsBuy,
|
||||
componentCartParaCurve,
|
||||
componentBadge
|
||||
componentBadge,
|
||||
componentNoData
|
||||
},
|
||||
props: {
|
||||
propCurrencySymbol: {
|
||||
|
|
|
|||
1696
lang/cht.json
1696
lang/cht.json
File diff suppressed because it is too large
Load Diff
|
|
@ -1,9 +1,7 @@
|
|||
{
|
||||
"language": {
|
||||
"zh-Hans": "Simplified Chinese",
|
||||
"zh-Hant": "Traditional Chinese",
|
||||
"en": "English",
|
||||
"es": "Spanish"
|
||||
"en": "English"
|
||||
},
|
||||
"common": {
|
||||
"home": "Home",
|
||||
|
|
@ -233,7 +231,7 @@
|
|||
"qe8a37": "User name/phone/email",
|
||||
"08fchn": "Login password",
|
||||
"db1rf4": "E-mail",
|
||||
"6yfr9g": "user name",
|
||||
"6yfr9g": "login/register",
|
||||
"d178m0": "Mobile/email",
|
||||
"9wx3ch": "Set login password",
|
||||
"s665h5": "Obtain verification code",
|
||||
|
|
@ -1690,7 +1688,6 @@
|
|||
"28r5dr": "Service Agreement",
|
||||
"lb493k": "Privacy Policy",
|
||||
"ch1pd2": "Failed to call up the local phone number component",
|
||||
"n67w8p": "Please log in or register first",
|
||||
"5y1c52": "The event value format is incorrect",
|
||||
"t754n6": "Prompt message is empty alert",
|
||||
"iq66pg": "Please copy the address to the webpage map for viewing!",
|
||||
|
|
@ -1704,6 +1701,7 @@
|
|||
"3eqv71": "Please go to the mini program to use the complete service",
|
||||
"08cg8y": "The customer service address is incorrect",
|
||||
"0gwt7z": "Clear successful",
|
||||
"87yghj": "Logout successful",
|
||||
"di6v5t": "Please obtain authorization first",
|
||||
"nu5058": "Geographic location selection is not supported!",
|
||||
"4v6q86": "No location selected"
|
||||
|
|
|
|||
|
|
@ -1,19 +1,15 @@
|
|||
import VueI18n from 'vue-i18n';
|
||||
import Vue from 'vue';
|
||||
|
||||
import zhHans from './zh.json'
|
||||
import zhHant from './cht.json'
|
||||
import en from './en.json'
|
||||
import spa from './spa.json'
|
||||
import zhHans from './zh.json';
|
||||
import en from './en.json';
|
||||
|
||||
let i18nConfig = {
|
||||
locale: uni.getLocale(),
|
||||
silentTranslationWarn: true,
|
||||
messages: {
|
||||
"zh-Hans": zhHans,
|
||||
"zh-Hant": zhHant,
|
||||
"en": en,
|
||||
"es": spa
|
||||
"en": en
|
||||
}
|
||||
}
|
||||
Vue.use(VueI18n)
|
||||
|
|
|
|||
1696
lang/spa.json
1696
lang/spa.json
File diff suppressed because it is too large
Load Diff
|
|
@ -1,9 +1,7 @@
|
|||
{
|
||||
"language": {
|
||||
"zh-Hans": "简体中文",
|
||||
"zh-Hant": "繁体中文",
|
||||
"en": "英语",
|
||||
"es": "西班牙语"
|
||||
"en": "英语"
|
||||
},
|
||||
"common": {
|
||||
"home": "首页",
|
||||
|
|
@ -236,7 +234,7 @@
|
|||
"qe8a37": "用户名/手机/邮箱",
|
||||
"08fchn": "登录密码",
|
||||
"db1rf4": "电子邮箱",
|
||||
"6yfr9g": "用户名",
|
||||
"6yfr9g": "登录/注册",
|
||||
"d178m0": "手机/邮箱",
|
||||
"9wx3ch": "设置登录密码",
|
||||
"s665h5": "获取验证码",
|
||||
|
|
@ -1680,7 +1678,6 @@
|
|||
"28r5dr": "服务协议",
|
||||
"lb493k": "隐私权政策",
|
||||
"ch1pd2": "本机号码组件调起失败",
|
||||
"n67w8p": "请先登录或注册",
|
||||
"5y1c52": "事件值格式有误",
|
||||
"t754n6": "提示信息为空 alert",
|
||||
"iq66pg": "请复制地址到网页地图中查看!",
|
||||
|
|
@ -1694,6 +1691,7 @@
|
|||
"3eqv71": "请前往小程序使用完整服务",
|
||||
"08cg8y": "客服地址有误",
|
||||
"0gwt7z": "清除成功",
|
||||
"87yghj": "退出成功",
|
||||
"di6v5t": "请先获取授权",
|
||||
"nu5058": "不支持地理位置选择!",
|
||||
"4v6q86": "未选择位置"
|
||||
|
|
|
|||
|
|
@ -885,7 +885,7 @@
|
|||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info(this);
|
||||
var user = app.globalData.get_user_info(this, 'buy_number_event', e);
|
||||
if (user != false) {
|
||||
// 用户未绑定手机则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
|
|
@ -999,7 +999,7 @@
|
|||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info(this);
|
||||
var user = app.globalData.get_user_info(this, 'cart_buy_number_event', e);
|
||||
if (user != false) {
|
||||
// 用户未绑定手机则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@
|
|||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info();
|
||||
var user = app.globalData.get_user_info(this, 'modal_open_event', e);
|
||||
if (user != false) {
|
||||
// 用户未绑定手机则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
|
|
@ -370,11 +370,11 @@
|
|||
},
|
||||
|
||||
// 评论
|
||||
comments_event() {
|
||||
comments_event(e) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info();
|
||||
var user = app.globalData.get_user_info(this, 'comments_event', e);
|
||||
if (user != false) {
|
||||
// 用户未绑定手机则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
|
|
@ -452,7 +452,7 @@
|
|||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info();
|
||||
var user = app.globalData.get_user_info(this, 'give_thumbs_event', e);
|
||||
if (user != false) {
|
||||
// 用户未绑定手机则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@
|
|||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info();
|
||||
var user = app.globalData.get_user_info(this, 'modal_open_event', e);
|
||||
if (user != false) {
|
||||
// 用户未绑定手机则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
|
|
@ -380,11 +380,11 @@
|
|||
},
|
||||
|
||||
// 评论
|
||||
comments_event() {
|
||||
comments_event(e) {
|
||||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info();
|
||||
var user = app.globalData.get_user_info(this, 'comments_event', e);
|
||||
if (user != false) {
|
||||
// 用户未绑定手机则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
|
|
@ -462,7 +462,7 @@
|
|||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info();
|
||||
var user = app.globalData.get_user_info(this, 'give_thumbs_event', e);
|
||||
if (user != false) {
|
||||
// 用户未绑定手机则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
|
|
|
|||
|
|
@ -647,7 +647,7 @@
|
|||
if (!app.globalData.is_single_page_check()) {
|
||||
return false;
|
||||
}
|
||||
var user = app.globalData.get_user_info(this);
|
||||
var user = app.globalData.get_user_info(this, 'buy_number_event', e);
|
||||
if (user != false) {
|
||||
// 用户未绑定手机则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@
|
|||
<view class="va-m dis-inline-block margin-left-lg">
|
||||
<view class="flex-col align-b" data-value="/pages/personal/personal" @tap="url_event">
|
||||
<text class="va-m fw-b text-size">{{ nickname }}</text>
|
||||
<view v-if="(user_id || null) != null" class="head-id border-radius-sm padding-horizontal-sm margin-top-sm dis-inline-block fw-b">
|
||||
<view v-if="(user || null) != null && (user.number_code || null) != null" class="head-id border-radius-sm padding-horizontal-sm margin-top-sm dis-inline-block fw-b">
|
||||
<text class="text-size-xs">ID </text>
|
||||
<text class="text-size-xss padding-left-xs pr bottom-xs">{{ user_id }}</text>
|
||||
<text class="text-size-xss padding-left-xs pr bottom-xs">{{ user.number_code }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -35,12 +35,12 @@
|
|||
<!-- 副导航 -->
|
||||
<view v-if="common_app_is_head_vice_nav == 1 && head_nav_list.length > 0" class="head-nav oh padding-main flex-row align-c jc-sa tc">
|
||||
<block v-for="(item, index) in head_nav_list" :key="index">
|
||||
<navigator :url="'/pages/' + item.url + '/' + item.url" hover-class="none" class="flex-1 flex-width">
|
||||
<view class="flex-1 flex-width cp" :data-value="'/pages/' + item.url + '/' + item.url" @tap="url_event">
|
||||
<view class="head-nav-item">
|
||||
<view class="nav-value fw-b text-size margin-bottom-sm">{{ item.count }}</view>
|
||||
<view class="nav-name text-size-sm">{{ item.name }}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 会员码 付款码 -->
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
<!-- 副导航 -->
|
||||
<view class="nav-list-sub oh flex-row jc-sa align-c flex-1">
|
||||
<block v-for="(items, index2) in item.extension_data" :key="index2">
|
||||
<navigator :url="items.url" hover-class="none" class="flex-1">
|
||||
<view class="flex-1 cp" :data-value="items.url" @tap="url_event">
|
||||
<view class="item pr tc">
|
||||
<view class="badge-icon pa">
|
||||
<component-badge :propNumber="items.count"></component-badge>
|
||||
|
|
@ -79,16 +79,16 @@
|
|||
<image class="item-icon margin-bottom-xs" :src="items.icon" mode="aspectFill"></image>
|
||||
<view class="item-name cr-base text-size-sm">{{ items.name }}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 主导航 -->
|
||||
<navigator :url="item.url || item.event_value" hover-class="none" class="nav-all-order-goods pr">
|
||||
<view class="nav-all-order-goods pr" :data-value="item.url || item.event_value" @tap="url_event">
|
||||
<view class="item pr tc">
|
||||
<image class="item-icon margin-bottom-xs" :src="item.icon || item.images_url" mode="aspectFill"></image>
|
||||
<view class="item-name cr-base text-size-sm">{{ item.name }}</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
|
@ -186,7 +186,7 @@
|
|||
common_static_url: common_static_url,
|
||||
static_url: static_url,
|
||||
avatar: app.globalData.data.default_user_head_src,
|
||||
user_id: '',
|
||||
user: null,
|
||||
nickname: '',
|
||||
message_total: 0,
|
||||
nav_logout_data: null,
|
||||
|
|
@ -351,11 +351,9 @@
|
|||
|
||||
// 设置用户基础信息
|
||||
set_user_base(user) {
|
||||
if ((user.id || null) != null) {
|
||||
this.setData({
|
||||
user_id: user.number_code,
|
||||
});
|
||||
}
|
||||
this.setData({
|
||||
user: user || null,
|
||||
});
|
||||
if ((user.avatar || null) != null) {
|
||||
this.setData({
|
||||
avatar: user.avatar,
|
||||
|
|
@ -496,6 +494,17 @@
|
|||
|
||||
// 清除缓存
|
||||
remove_user_cache_event(e) {
|
||||
// 当前页面处理
|
||||
this.setData({
|
||||
message_total: 0,
|
||||
navigation: [],
|
||||
main_navigation_data: [],
|
||||
user: null,
|
||||
avatar: app.globalData.data.default_user_head_src,
|
||||
nickname: this.$t('login.login.6yfr9g')
|
||||
});
|
||||
|
||||
// 调用公共方法处理
|
||||
app.globalData.remove_user_cache_event();
|
||||
},
|
||||
|
||||
|
|
@ -517,13 +526,28 @@
|
|||
|
||||
// 远程自定义导航事件
|
||||
navigation_event(e) {
|
||||
app.globalData.operation_event(e);
|
||||
if(this.is_login()) {
|
||||
app.globalData.operation_event(e);
|
||||
}
|
||||
},
|
||||
|
||||
// url事件
|
||||
url_event(e) {
|
||||
app.globalData.url_event(e);
|
||||
if(this.is_login()) {
|
||||
app.globalData.url_event(e);
|
||||
}
|
||||
},
|
||||
|
||||
// 是否登录
|
||||
is_login() {
|
||||
if((this.user || null) == null) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login?event_callback=init',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue