Merge branch 'youda' of http://123.207.203.228:3000/shang/yfs into youda

This commit is contained in:
18631081161 2025-04-22 12:36:00 +08:00
commit 10b0c35c07
25 changed files with 1120 additions and 446 deletions

View File

@ -5,6 +5,7 @@
*/
import Vue from 'vue'
import config from '@/common/config.js'
import { navigateTo as routerNavigateTo, navigateBack as routerNavigateBack } from '@/common/router.js'
// 防止处理多次点击
function noMultipleClicks(methods, info) {
@ -444,27 +445,35 @@ export default {
return
}
if (Object.keys(query).length > 0) {
url += this.qs(query)
// 确定跳转类型
let navigationType = 'navigateTo';
switch (type) {
case 2:
navigationType = 'redirectTo';
break;
case 3:
navigationType = 'switchTab';
break;
case 4:
navigationType = 'reLaunch';
break;
default:
navigationType = 'navigateTo';
}
const opt = {
url,
success,
fail,
complete
}
const dic = {
1: uni.navigateTo,
2: uni.redirectTo,
3: uni.switchTab,
4: uni.reLaunch
}
const action = dic[type]
action(opt)
// 使用导入的路由方法而不是this.$router
return routerNavigateTo(url, query, navigationType)
.then(res => {
if (typeof success === 'function') success(res);
return res;
})
.catch(err => {
if (typeof fail === 'function') fail(err);
throw err;
})
.finally(() => {
if (typeof complete === 'function') complete();
});
},
/**
@ -474,32 +483,17 @@ export default {
*/
back(e) {
/* 判断传入的是否是数字 */
let pages = getCurrentPages()
console.log('pgaes', pages)
if (pages.length >= 2) {
if (typeof e === 'number' && !isNaN(e)) {
/* 如果要跳转的长度小于页面栈数量 */
if (e < pages.length) {
uni.navigateBack({
delta: e
})
/* 否则回首页 */
} else {
uni.switchTab({
url: '/pages/shouye/index'
})
}
/* 默认返回上一级 */
} else {
uni.navigateBack({
delta: 1
})
}
} else {
uni.switchTab({
url: '/pages/shouye/index'
})
let delta = 1;
if (typeof e === 'number' && !isNaN(e)) {
delta = e;
}
// 使用导入的routerNavigateBack而不是this.$router
routerNavigateBack(delta)
.catch(() => {
// 如果返回失败,则回到首页
routerNavigateTo('/pages/shouye/index', {}, 'switchTab');
});
},
/**
@ -519,14 +513,11 @@ export default {
$navBack(num = 1, time = 0) {
// 页面返回
setTimeout(() => {
uni.navigateBack({
delta: num,
fail: () => {
uni.reLaunch({
url: '/pages/shouye/index'
})
}
})
routerNavigateBack(num)
.catch(() => {
// 如果返回失败,则回到首页
routerNavigateTo('/pages/shouye/index', {}, 'reLaunch');
});
}, time * 1000)
},
/**
@ -617,14 +608,27 @@ export default {
// #endif
},
nav(url) {
uni.navigateTo({
url: url,
fail: () => {
uni.switchTab({
url: url
// 解析URL和参数
let urlPath = url;
let params = {};
if (url.includes('?')) {
const parts = url.split('?');
urlPath = parts[0];
// 解析参数
if (parts[1]) {
parts[1].split('&').forEach(param => {
const keyValue = param.split('=');
if (keyValue.length === 2) {
params[keyValue[0]] = decodeURIComponent(keyValue[1]);
}
});
}
})
}
// 使用导入的路由方法
return routerNavigateTo(urlPath, params);
},
red(url) {
uni.redirectTo({

View File

@ -9,6 +9,35 @@ let configData = null;
let isLoading = false;
let loadPromise = null;
const wx_version = "104";
// 白名单页面(不需要登录即可访问)
export const whiteList = [
"pages/shouye/index", // 首页
"pages/shouye/detail", // 详情页
"pages/shouye/huanxiang", // 换箱页面
"pages/mall/index", // 商城首页
"pages/shouye/detail_wuxian", // 无限详情页
"pages/sangdai/sangdai", // 盒柜页面
"pages/infinite/index", // 福利首页
"pages/user/index", // 用户中心
"pages/infinite/daily_check_in", // 每日签到
"pages/infinite/bonus_house", // 福利屋
"pages/other/prize_draw", // 每日奖品抽取
"pages/shouye/danye", // 单页
"pages/guize/guize", // 规则页面
"pages/shouye/dada_ranking", // 达达排行榜
"pages/shouye/yaoqing_ranking", // 邀请排行榜
"pages/user/login" // 登录页面
];
// API白名单不需要登录即可访问的API
export const apiWhiteList = [
'login_record',
'api/warehouse_index',
'api/user',
'api/warehouse_send_record'
];
const defaultConfig = {
"good_type": [{ "value": 0, "sort_order": 0, "is_show": 1, "name": "全部", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 1, "sort_order": 1, "is_show": 0, "name": "一番赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 2, "sort_order": 2, "is_show": 1, "name": "无限赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 3, "sort_order": 3, "is_show": 0, "name": "擂台赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 5, "sort_order": 4, "is_show": 0, "name": "积分赏", "pay_wechat": 0, "pay_balance": 0, "pay_currency": 0, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 0 }, { "value": 6, "sort_order": 5, "is_show": 1, "name": "限时活动", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 8, "sort_order": 6, "is_show": 1, "name": "领主赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 9, "sort_order": 7, "is_show": 0, "name": "连击赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 10, "sort_order": 8, "is_show": 0, "name": "商城赏", "pay_wechat": 1, "pay_balance": 0, "pay_currency": 0, "pay_currency2": 1, "pay_coupon": 0, "is_deduction": 0 }, { "value": 11, "sort_order": 9, "is_show": 0, "name": "自制赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 15, "sort_order": 15, "is_show": 0, "name": "福利屋", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 0, "pay_currency2": 0, "pay_coupon": 0, "is_deduction": 0 }, { "value": 16, "sort_order": 16, "is_show": 1, "name": "翻倍赏", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 1, "pay_currency2": 1, "pay_coupon": 1, "is_deduction": 1 }, { "value": 17, "sort_order": 17, "is_show": 0, "name": "外卖盒子", "pay_wechat": 1, "pay_balance": 1, "pay_currency": 0, "pay_currency2": 0, "pay_coupon": 0, "is_deduction": 0 }],
"app_setting": {

View File

@ -1,4 +1,7 @@
// import config from '../config.js'
// 导入路由模块
import { navigateTo as routerNavigateTo } from '@/common/router.js';
/*导航菜单白名单*/
const tabBarLinks = [
'/pages/index/index',
@ -28,27 +31,33 @@ export const gotopage = (url, type) => {
return false;
}
// 从URL中提取路径和参数
let path = url;
let params = {};
// tabBar页面
if (type == 'switch') {
uni.reLaunch({
url: url
});
} else {
if (url.includes('?')) {
const [basePath, queryString] = url.split('?');
path = basePath;
if(type == 'redirect'){
uni.redirectTo({
url: url
});
}
if(type == 'reLaunch'){
uni.reLaunch({
url: url
});
}
// 普通页面
uni.navigateTo({
url: url
// 解析参数
queryString.split('&').forEach(param => {
const [key, value] = param.split('=');
if (key && value) {
params[key] = decodeURIComponent(value);
}
});
}
// 使用新的路由方法进行导航
let navigationType = 'navigateTo';
if (type === 'switch') {
navigationType = 'reLaunch';
} else if (type === 'redirect') {
navigationType = 'redirectTo';
} else if (type === 'reLaunch') {
navigationType = 'reLaunch';
}
// 使用导入的路由方法
return routerNavigateTo(path, params, navigationType);
}

View File

@ -6,7 +6,8 @@
import EnvConfig from '@/common/env.js'
import md5 from 'js-md5'
import ConfigManager from '@/common/config.js'
import { apiWhiteList } from '@/common/config.js'
import RouterManager from '@/common/router.js'
class RequestManager {
/**
* 判断URL是否在白名单中
@ -14,26 +15,16 @@ class RequestManager {
* @returns {Boolean} 是否在白名单中
*/
static isUrlInWhitelist(url) {
// 白名单URL列表
const whitelistUrls = [
'login_record',
'api/warehouse_index',
'api/user',
'api/warehouse_send_record'
]
// 白名单URL列表
const whitelistUrls2 = [
'login_record',
]
let iswx = ConfigManager.GetVersion();
// let iswx = ConfigManager.GetVersion();
// // 根据版本使用不同的白名单
// if (!iswx) {
// // 非微信版本只允许 login_record
// return apiWhiteList.includes('login_record') && url.indexOf('login_record') > -1;
// }
if (!iswx) {
return whitelistUrls2.some(whiteItem => url.indexOf(whiteItem) > -1)
}
// 检查URL是否包含白名单中的任一项
return whitelistUrls.some(whiteItem => url.indexOf(whiteItem) > -1)
return apiWhiteList.some(whiteItem => url.indexOf(whiteItem) > -1);
}
/**
@ -208,6 +199,7 @@ class RequestManager {
data: data,
success: res => {
console.log("res.data.status", res.data.status)
var pages = getCurrentPages()
if (res.data.status == 1) {
// 请求成功
resolve(res.data)
@ -245,19 +237,37 @@ class RequestManager {
icon: 'none'
})
}, 100)
reject(res.data)
} else if (res.data.status < 0) {
var pages = getCurrentPages()
for (var a = 0; a < pages.length; a++) {
console.log(pages[a].route)
if (pages[a].route == 'pages/user/index') {
uni.setStorageSync('lgurl', pages[a].route)
uni.setStorageSync('lgurldata', JSON.stringify(pages[a].options))
// 获取当前页面路径和参数
var currentPage = pages[pages.length - 1];
if (currentPage) {
var currentRoute = currentPage.route;
var currentParams = currentPage.options || {};
// 只有非登录页面才保存重定向信息
if (currentRoute && currentRoute !== 'pages/user/login') {
// 构建完整的重定向URL
var redirectPath = '/' + currentRoute;
// 如果有参数,拼接参数
if (Object.keys(currentParams).length > 0) {
var paramString = Object.keys(currentParams)
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(currentParams[key])}`)
.join('&');
redirectPath += '?' + paramString;
}
// 保存重定向URL到缓存
console.log('保存重定向URL:', redirectPath);
uni.setStorageSync('redirect', redirectPath);
}
}
console.log(requestUrl);
if (RequestManager.isUrlInWhitelist(requestUrl)) {
reject(res.data)
return;
}
@ -267,11 +277,13 @@ class RequestManager {
icon: 'none'
})
}, 100)
uni.redirectTo({
url: '/pages/user/login',
// animationType: 'pop-in',
// animationDuration: 500
})
// 使用新的路由守卫方法进行跳转
RouterManager.navigateTo('/pages/user/login', {}, 'navigateTo')
.catch(err => {
console.error('登录页面跳转失败:', err);
});
reject(res.data)
} else {
reject(res.data)

253
common/router.js Normal file
View File

@ -0,0 +1,253 @@
/**
* 通用路由守卫
*/
import { whiteList } from '@/common/config.js'
/**
* 判断用户是否已登录
* @returns {Boolean} true表示已登录false表示未登录
*/
function isLogin() {
// 从本地存储获取用户token或其他登录凭证
const token = uni.getStorageSync('token');
return !!token;
}
/**
* 判断URL是否在白名单中
* @param {String} url 需要检查的URL
* @returns {Boolean} 是否在白名单中
*/
function isInWhiteList(url) {
if (!url) return false;
// 去除URL开头的斜杠以便与白名单匹配
const cleanUrl = url.startsWith('/') ? url.substring(1) : url;
// 提取路径部分(不含参数)
const pathPart = cleanUrl.split('?')[0];
// 检查是否在白名单中
return whiteList.some(item => {
// 确保白名单项目不带/开头,以实现一致的比较
const cleanItem = item.startsWith('/') ? item.substring(1) : item;
return pathPart === cleanItem || pathPart.startsWith(cleanItem + '/') || pathPart.startsWith(cleanItem + '?');
});
}
/**
* 返回上一页如果上一页是登录页则跳过它
* @returns {Promise} 返回操作结果的Promise
*/
export function navigateBack(delta = 1) {
return new Promise((resolve, reject) => {
const pages = getCurrentPages();
// 如果页面栈不足,直接返回首页
if (pages.length <= 1) {
return navigateTo('/pages/shouye/index', {}, 'reLaunch')
.then(resolve)
.catch(reject);
}
// 查看前一个页面是否是登录页
if (pages.length > 1 && pages[pages.length - 2].route === 'pages/user/login') {
// 如果前一个页面是登录页,则返回两步
uni.navigateBack({
delta: 2,
success: resolve,
fail: reject
});
} else {
// 正常返回
uni.navigateBack({
delta,
success: resolve,
fail: reject
});
}
});
}
/**
* 通用路由跳转方法
* @param {Object} options 跳转配置
* @param {String} options.url 跳转地址
* @param {Object} options.params 请求参数可选
* @param {String} options.type 跳转方式可选navigateTo(默认)switchTabredirectToreLaunch
* @returns {Promise} 返回一个Promise对象
*/
export function routerTo(options) {
return new Promise((resolve, reject) => {
// 处理参数
let { url, params, type } = options;
// 判断url是否存在
if (!url || url.length === 0) {
reject('跳转地址不能为空');
return;
}
// 拼接参数
if (params && Object.keys(params).length > 0) {
const queryString = Object.keys(params)
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`)
.join('&');
url += (url.indexOf('?') === -1 ? '?' : '&') + queryString;
}
// 检查是否需要登录
const needLogin = !isInWhiteList(url);
if (needLogin && !isLogin()) {
// 需要登录但未登录,跳转到登录页面
// 先保存当前URL用于登录后重定向
uni.setStorageSync('redirect', url);
// 使用navigateTo而非redirectTo保留页面栈
uni.navigateTo({
url: '/pages/user/login',
success: () => {
console.log('跳转到登录页面成功,保存的重定向地址:', url);
},
fail: (err) => {
console.error('跳转到登录页面失败:', err);
reject(err);
}
});
// 拒绝当前的导航请求
return reject(new Error('需要登录'));
}
// 根据type选择跳转方式
if (type) {
// 指定了跳转方式,直接使用
switch (type) {
case 'switchTab':
uni.switchTab({
url,
success: resolve,
fail: reject
});
break;
case 'redirectTo':
uni.redirectTo({
url,
success: resolve,
fail: reject
});
break;
case 'reLaunch':
uni.reLaunch({
url,
success: resolve,
fail: reject
});
break;
case 'navigateTo':
default:
uni.navigateTo({
url,
success: resolve,
fail: reject
});
break;
}
} else {
// 未指定跳转方式先尝试navigateTo失败后尝试switchTab
uni.navigateTo({
url,
success: resolve,
fail: (err) => {
// navigateTo失败尝试switchTab
uni.switchTab({
url,
success: resolve,
fail: (switchErr) => {
// 两种方式都失败,返回错误
reject(switchErr);
}
});
}
});
}
});
}
/**
* 简化版路由跳转方法
* @param {String} url 跳转地址
* @param {Object} params 请求参数可选
* @param {String} type 跳转方式可选
* @returns {Promise} 返回Promise对象
*/
export function navigateTo(url, params = {}, type = '') {
return routerTo({
url,
params,
type
});
}
/**
* 收集白名单路径
* @param {String} path 需要添加到白名单的路径
* @returns {Array} 返回更新后的白名单数组
*/
export function collectWhitePath(path) {
// 缓存的键名
const WHITELIST_CACHE_KEY = 'APP_WHITELIST_PATHS';
// 从缓存中获取现有白名单
let cachedWhitelist = uni.getStorageSync(WHITELIST_CACHE_KEY) || [];
// 如果不是数组,则初始化为空数组
if (!Array.isArray(cachedWhitelist)) {
cachedWhitelist = [];
}
// 检查路径是否已存在于白名单中
if (path && path.trim() && !cachedWhitelist.includes(path)) {
// 添加新路径到白名单
cachedWhitelist.push(path);
// 保存更新后的白名单到缓存
uni.setStorageSync(WHITELIST_CACHE_KEY, cachedWhitelist);
console.log('添加白名单路径成功:', path);
}
return cachedWhitelist;
}
/**
* 获取已收集的白名单路径
* @returns {Array} 返回缓存中的白名单数组
*/
export function getCollectedWhitePaths() {
const WHITELIST_CACHE_KEY = 'APP_WHITELIST_PATHS';
return uni.getStorageSync(WHITELIST_CACHE_KEY) || [];
}
/**
* 清空已收集的白名单路径
* @returns {Boolean} 返回操作结果
*/
export function clearCollectedWhitePaths() {
const WHITELIST_CACHE_KEY = 'APP_WHITELIST_PATHS';
uni.setStorageSync(WHITELIST_CACHE_KEY, []);
return true;
}
// 更新默认导出
export default {
routerTo,
navigateTo,
navigateBack,
collectWhitePath,
getCollectedWhitePaths,
clearCollectedWhitePaths
};

View File

@ -1,16 +1,51 @@
<template>
<view class="nav-header">
<uni-nav-bar :color="color" :backgroundColor="backgroundColor" :fixed="fixed" :statusBar="statusBar"
:border="border">
<template #left>
<view v-if="showBack" class="nav-header__back" @click="goBack">
<uni-icons :color="color" type="left" size="20" />
<view class="custom-nav-header" :class="{'custom-nav-header--dark': dark}">
<!-- 导航栏内容 -->
<view class="custom-nav-header__content" :class="{ 'custom-nav-header--fixed': fixed, 'custom-nav-header--shadow': shadow }"
:style="{ 'background-color': themeBgColor }">
<!-- 状态栏 -->
<view v-if="statusBar" class="custom-nav-header__status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
<!-- 导航内容 -->
<view class="custom-nav-header__header" :style="{ color: themeColor, backgroundColor: themeBgColor, height: navbarHeight + 'px' }">
<!-- 左侧区域 -->
<view @click="onClickLeft" class="custom-nav-header__header-btns custom-nav-header__header-btns-left" :style="{ width: leftWidth + 'px' }">
<slot name="left">
<view class="custom-nav-header__content-view" v-if="leftIcon">
<view class="custom-nav-header__icon" :style="{ 'border-color': themeColor }"></view>
</view>
<view class="custom-nav-header-btn-text" v-if="leftText">
<text :style="{ color: themeColor, fontSize: '14px' }">{{ leftText }}</text>
</view>
</slot>
</view>
<!-- 中间标题区域 -->
<view class="custom-nav-header__header-container" @click="onClickTitle">
<slot>
<view class="custom-nav-header__header-container-inner" v-if="innerTitle">
<text class="custom-nav-bar-text custom-nav-ellipsis-1" :style="{ color: themeColor }">{{ innerTitle }}</text>
</view>
</slot>
</view>
<!-- 右侧区域 -->
<view @click="onClickRight" class="custom-nav-header__header-btns custom-nav-header__header-btns-right" :style="{ width: rightWidth + 'px' }">
<slot name="right">
<view class="custom-nav-header-btn-text" v-if="rightText">
<text class="custom-nav-bar-right-text" :style="{ color: themeColor }">{{ rightText }}</text>
</view>
</slot>
</view>
</template>
<view style="font-size: 34rpx; width: 100%; display: flex; justify-content: center; align-items: center;">
{{ title }}
</view>
</uni-nav-bar>
</view>
<!-- 占位符 -->
<view class="custom-nav-header__placeholder" v-if="fixed">
<view v-if="statusBar" :style="{ height: statusBarHeight + 'px' }"></view>
<view class="custom-nav-header__placeholder-view" :style="{ height: navbarHeight + 'px' }"></view>
</view>
</view>
</template>
@ -18,16 +53,46 @@
export default {
name: 'NavHeader',
props: {
//
dark: {
type: Boolean,
default: false
},
//
title: {
type: String,
default: ''
},
//
leftText: {
type: String,
default: ''
},
//
rightText: {
type: String,
default: ''
},
//
leftIcon: {
type: String,
default: ''
},
//
rightIcon: {
type: String,
default: ''
},
//
showBack: {
type: Boolean,
default: false
},
//
showBackText: {
type: Boolean,
default: false
},
//
backUrl: {
type: String,
@ -36,12 +101,12 @@ export default {
//
color: {
type: String,
default: '#000000'
default: ''
},
//
backgroundColor: {
type: String,
default: 'transparent'
default: ''
},
//
fixed: {
@ -53,36 +118,97 @@ export default {
type: Boolean,
default: true
},
//
border: {
//
shadow: {
type: Boolean,
default: false
},
//
height: {
type: [Number, String],
default: 44
},
//
leftWidth: {
type: [Number, String],
default: 60
},
//
rightWidth: {
type: [Number, String],
default: 60
}
},
data() {
return {
statusBarHeight: 20, //
innerTitle: '', // 使
navbarHeight: 44 //
}
},
computed: {
//
themeBgColor() {
if (this.dark) {
if (this.backgroundColor) {
return this.backgroundColor;
} else {
return this.dark ? '#333' : '#FFF';
}
}
return this.backgroundColor || '#FFF';
},
//
themeColor() {
if (this.dark) {
if (this.color) {
return this.color;
} else {
return this.dark ? '#fff' : '#333';
}
}
return this.color || '#333';
}
},
created() {
this.getStatusBarHeight();
this.innerTitle = this.title;
//
this.navbarHeight = typeof this.height === 'number' ? this.height : parseInt(this.height);
},
watch: {
title(newVal) {
this.innerTitle = newVal;
}
},
methods: {
//
getStatusBarHeight() {
uni.getSystemInfo({
success: (res) => {
this.statusBarHeight = res.statusBarHeight || 20;
}
});
},
//
goBack() {
this.onClickLeft();
},
//
onClickLeft() {
this.$emit('clickLeft');
if (this.backUrl) {
//
uni.redirectTo({
url: this.backUrl,
success: () => {
},
fail: (err) => {
this.$router.navigateTo(this.backUrl, {}, 'redirectTo')
.catch(err => {
console.log('返回页面失败', err);
uni.switchTab({
url: this.backUrl,
success: () => {
},
fail: (err) => {
this.$router.navigateTo(this.backUrl, {}, 'switchTab')
.catch(err => {
console.log('返回页面失败1', err);
}
});
}
});
});
});
} else {
var pages = getCurrentPages();
if (pages.length > 1) {
@ -93,23 +219,155 @@ export default {
}
});
} else {
uni.switchTab({
url: '/pages/shouye/index',
});
this.$router.navigateTo('/pages/shouye/index', {}, 'switchTab');
}
}
},
//
onClickRight() {
this.$emit('clickRight');
},
//
onClickTitle() {
this.$emit('clickTitle');
}
}
}
</script>
<style lang="scss">
.nav-header {
&__back {
$nav-height: 44px;
.custom-nav-header {
/* 整体容器 */
width: 100%;
&__content {
/* 内容区 */
position: relative;
background-color: transparent;
}
&__status-bar {
/* 状态栏 */
height: 20px;
}
&__header {
/* 头部导航 */
display: flex;
flex-direction: row;
height: $nav-height;
padding: 0 10px;
font-size: 14px;
}
&__header-btns {
/* 按钮通用样式 */
display: flex;
flex-wrap: nowrap;
flex-direction: row;
width: 120rpx;
justify-content: center;
align-items: center;
}
&__header-btns-left {
/* 左侧按钮 */
display: flex;
justify-content: flex-start;
align-items: center;
}
&__header-btns-right {
/* 右侧按钮 */
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
}
&__header-container {
/* 标题容器 */
display: flex;
flex: 1;
padding: 0 10px;
overflow: hidden;
}
&__header-container-inner {
/* 标题内部容器 */
display: flex;
flex: 1;
flex-direction: row;
align-items: center;
justify-content: center;
font-size: 14px;
overflow: hidden;
}
&__icon {
/* 返回图标 */
width: 12px;
height: 12px;
border-left: 2px solid;
border-bottom: 2px solid;
transform: rotate(45deg);
}
&__content-view {
display: flex;
align-items: center;
height: 44px;
padding-left: 10px;
justify-content: center;
}
&__placeholder {
/* 占位符 */
width: 100%;
}
&__placeholder-view {
height: $nav-height;
}
/* 修饰样式 */
&--fixed {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 998;
}
&--shadow {
box-shadow: 0 1px 6px #ccc;
}
&--dark {
background-color: #333;
}
}
.custom-nav-header-btn-text {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
line-height: 12px;
}
.custom-nav-bar-text {
font-size: 16px;
font-weight: 500;
}
.custom-nav-bar-right-text {
font-size: 12px;
}
.custom-nav-ellipsis-1 {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style>

View File

@ -1,9 +1,28 @@
<template>
<view class="page-container" :style="{ backgroundColor: backgroundColor }">
<nav-header :title="title" :showBack="showBack" :backUrl="backUrl" :color="navColor"
:backgroundColor="navBackgroundColor" :fixed="fixed" :statusBar="statusBar" :border="border">
<nav-header
:title="navTitle"
:showBack="showBack"
:backUrl="backUrl"
:color="navColor"
:backgroundColor="navBackgroundColor"
:fixed="fixed"
:statusBar="statusBar"
:shadow="shadow"
:dark="dark"
:height="navHeight"
:leftText="leftText"
:rightText="rightText"
:leftIcon="showBack ? 'back' : ''"
@clickLeft="onClickLeft"
@clickRight="onClickRight"
@clickTitle="onClickTitle">
<template #right>
<slot name="nav-right"></slot>
</template>
</nav-header>
<view class="page-container__content" :style="{ paddingBottom: paddingBottom }">
<view class="page-container__content" :style="contentStyle">
<view class="page-container__divider" v-if="divider"></view>
<slot></slot>
</view>
</view>
@ -17,17 +36,33 @@ export default {
components: {
NavHeader
},
emits: ['clickLeft', 'clickRight', 'clickTitle'],
props: {
//
title: {
type: String,
default: ''
},
//
dark: {
type: Boolean,
default: false
},
//
showBack: {
type: Boolean,
default: false
},
//
leftText: {
type: String,
default: ''
},
//
rightText: {
type: String,
default: ''
},
//
backUrl: {
type: String,
@ -58,16 +93,88 @@ export default {
type: Boolean,
default: true
},
//
border: {
//
shadow: {
type: Boolean,
default: false
},
// 线
divider: {
type: Boolean,
default: true
},
//
navHeight: {
type: [Number, String],
default: 44
},
//
paddingBottom: {
type: String,
default: '0px'
}
},
data() {
return {
statusBarHeight: 20, //
navbarHeight: 44, //
navTitle: '' // 使prop
}
},
computed: {
//
contentStyle() {
let style = {
'padding-bottom': this.paddingBottom
};
//
if (this.fixed) {
let paddingTop = this.statusBar ? (this.statusBarHeight + this.navbarHeight) : this.navbarHeight;
style['padding-top'] = paddingTop + 'px';
}
return style;
}
},
created() {
this.getStatusBarHeight();
//
this.navbarHeight = typeof this.navHeight === 'number' ? this.navHeight : parseInt(this.navHeight);
//
this.navTitle = this.title;
},
watch: {
// title
title(newVal) {
this.navTitle = newVal;
}
},
methods: {
//
getStatusBarHeight() {
uni.getSystemInfo({
success: (res) => {
this.statusBarHeight = res.statusBarHeight || 20;
}
});
},
//
onClickLeft() {
this.$emit('clickLeft');
},
//
onClickRight() {
this.$emit('clickRight');
},
//
onClickTitle() {
this.$emit('clickTitle');
},
//
setNavTitle(title) {
this.navTitle = title;
}
}
}
</script>
@ -81,6 +188,19 @@ export default {
&__content {
width: 100%;
box-sizing: border-box;
position: relative;
}
&__divider {
width: 100%;
height: 4rpx;
background-color: #e5e5e5; /* 使用较浅的灰色 */
position: relative;
top: 0;
left: 0;
right: 0;
z-index: 1;
margin-bottom: 10rpx; /* 在分割线下方添加一些间距 */
}
}
</style>

View File

@ -3,6 +3,7 @@ import App from './App'
import Mixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js'
import common from '@/common/common.js'
import { gotopage } from '@/common/gotopage.js'
import router from '@/common/router.js'
import ConfigManager from '@/common/config.js'
import RequestManager from '@/common/request.js'
import EnvConfig from '@/common/env.js'
@ -24,6 +25,8 @@ Vue.prototype.$wxloginPage = EnvConfig.wxLoginUrl
// 公共方法
Vue.prototype.gotoPage = gotopage
Vue.prototype.$router = router
Vue.prototype.$navigateTo = router.navigateTo
Vue.prototype.$noMultipleClicks = common.noMultipleClicks
Vue.prototype.$c = common
// 全局配置管理器

View File

@ -181,9 +181,7 @@
})
},
todetails(e) {
uni.navigateTo({
url: 'cardDetail?goods_id=' + e.id
})
this.$router.navigateTo('cardDetail', { goods_id: e.id });
},
getlist(v) {
this.show = v;

View File

@ -60,9 +60,7 @@ export default {
getlist(index) {
this.current = index
if (index == 1) {
uni.navigateTo({
url: 'UnlimitedOrder'
})
this.$router.navigateTo('UnlimitedOrder');
}
}
},

View File

@ -691,9 +691,7 @@ export default {
},
toHome() {
uni.reLaunch({
url: '/pages/shouye/index'
});
this.$router.navigateTo('/pages/shouye/index', {}, 'reLaunch');
},
applyPageTransitions() {

View File

@ -4,7 +4,8 @@
<page-container title="福利">
<banner :type-id="6" :height="326"></banner>
<view class="grid-container" style="width: 100%; padding: 0 32rpx; margin-top: 40rpx;">
<view class="grid-item" v-for="(item, index) in list" :key="item.id" @click="toPage(item)" style="height: 184rpx;">
<view class="grid-item" v-for="(item, index) in list" :key="item.id" @click="toPage(item)"
style="height: 184rpx;">
<image v-if="item.image" :src="item.image" mode="aspectFill" class="grid-item-bg"></image>
<text v-if="!item.image">{{ item.name }}</text>
</view>
@ -13,161 +14,166 @@
</template>
<script>
import RequestManager from '@/common/request.js'
import PageContainer from '@/components/page-container/page-container.vue'
import RequestManager from '@/common/request.js'
import PageContainer from '@/components/page-container/page-container.vue'
export default {
components: {
PageContainer
},
data() {
return {
list: []
}
},
methods: {
//
getWelfareList() {
RequestManager.post('/welfare_house_list')
.then(res => {
if (res.status === 1 && res.data) {
this.list = res.data;
} else {
uni.showToast({
title: res.msg || '获取福利列表失败',
icon: 'none'
});
}
})
.catch(err => {
console.error('获取福利列表失败:', err);
export default {
components: {
PageContainer
},
data() {
return {
list: []
}
},
methods: {
//
getWelfareList() {
RequestManager.post('/welfare_house_list')
.then(res => {
if (res.status === 1 && res.data) {
this.list = res.data;
} else {
uni.showToast({
title: '获取福利列表失败',
title: res.msg || '获取福利列表失败',
icon: 'none'
});
}
})
.catch(err => {
console.error('获取福利列表失败:', err);
uni.showToast({
title: '获取福利列表失败',
icon: 'none'
});
},
//
toPage(item) {
if (item.url) {
console.log(item);
uni.setStorageSync('fuliwu_title', item.name)
this.$c.to({
url: item.url
});
}
}
},
onShow() {
this.current = 0
const curPages = getCurrentPages()[0]; //
if (typeof curPages.getTabBar === 'function' && curPages.getTabBar()) {
this.$mp.page.getTabBar().setData({
selected: 1
});
}
},
onLoad() {
this.getWelfareList();
//
toPage(item) {
if (item.url) {
console.log(item);
uni.setStorageSync('fuliwu_title', item.name)
this.$router.navigateTo(item.url);
// this.$c.to({
// type:1,
// url: item.url,
// });
}
}
},
onShow() {
this.current = 0
const curPages = getCurrentPages()[0]; //
if (typeof curPages.getTabBar === 'function' && curPages.getTabBar()) {
this.$mp.page.getTabBar().setData({
selected: 1
});
}
},
onLoad() {
this.getWelfareList();
}
}
</script>
<style lang="scss">
.grid-container {
display: grid;
grid-template-columns: repeat(2, 324rpx);
/* 三列,每列宽度相等 */
gap: 40rpx 42rpx;
/* 网格之间的间隔 */
animation: fadeIn 0.5s ease-out;
.grid-container {
display: grid;
grid-template-columns: repeat(2, 324rpx);
/* 三列,每列宽度相等 */
gap: 40rpx 42rpx;
/* 网格之间的间隔 */
animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(20rpx);
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(20rpx);
}
to {
opacity: 1;
transform: translateY(0);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.grid-item {
position: relative;
text-align: center;
border-radius: 16rpx;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
animation-fill-mode: both;
transition: all 0.3s ease;
&:active {
transform: scale(0.95);
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
}
.grid-item {
position: relative;
text-align: center;
border-radius: 16rpx;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
animation-fill-mode: both;
transition: all 0.3s ease;
&:active {
transform: scale(0.95);
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
}
&::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.2);
border-radius: 50%;
transform: translate(-50%, -50%) scale(0);
opacity: 0;
transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}
&:active::after {
transform: translate(-50%, -50%) scale(2);
opacity: 0;
}
}
@keyframes scaleIn {
from {
opacity: 0;
transform: scale(0.8);
}
to {
opacity: 1;
transform: scale(1);
}
}
.grid-item-bg {
&::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 1;
transition: transform 0.3s ease;
background: rgba(255, 255, 255, 0.2);
border-radius: 50%;
transform: translate(-50%, -50%) scale(0);
opacity: 0;
transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}
.grid-item text {
z-index: 2;
color: #333;
font-size: 28rpx;
transition: all 0.3s ease;
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
&:active::after {
transform: translate(-50%, -50%) scale(2);
opacity: 0;
}
}
@keyframes scaleIn {
from {
opacity: 0;
transform: scale(0.8);
}
//
.grid-item {
@for $i from 1 through 10 {
&:nth-child(#{$i}) {
animation-delay: #{$i * 0.1}s;
}
to {
opacity: 1;
transform: scale(1);
}
}
.grid-item-bg {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 1;
transition: transform 0.3s ease;
}
.grid-item text {
z-index: 2;
color: #333;
font-size: 28rpx;
transition: all 0.3s ease;
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
}
//
.grid-item {
@for $i from 1 through 10 {
&:nth-child(#{$i}) {
animation-delay: #{$i * 0.1}s;
}
}
}
</style>

View File

@ -89,9 +89,7 @@ export default {
},
goOrderDetail(item) {
uni.navigateTo({
url: `/pages/other/order_info?order_num=${item.order_num}`
});
this.$router.navigateTo('/pages/other/order_info', { order_num: item.order_num });
}
}
}

View File

@ -229,9 +229,7 @@
setTimeout(() => {
that.$refs.order_show.close()
//
uni.redirectTo({
url: '/pages/miaosha/shop_order'
})
that.$router.navigateTo('/pages/miaosha/shop_order', {}, 'redirectTo');
}, 1500)
}
}
@ -245,9 +243,7 @@
setTimeout(() => {
that.$refs.order_show.close()
//
uni.redirectTo({
url: '/pages/miaosha/shop_order'
})
that.$router.navigateTo('/pages/miaosha/shop_order', {}, 'redirectTo');
}, 1500)
}
} else {

View File

@ -100,21 +100,14 @@
},
openUrl(e) {
if (e.target == 1) {
uni.navigateTo({
url: '../shouye/detail?id=' + e.goods_id
})
this.$router.navigateTo('../shouye/detail', { id: e.goods_id });
}
if (e.target == 2) {
uni.navigateTo({
url: 'detail?goods_id=' + e.product_id
})
this.$router.navigateTo('detail', { goods_id: e.product_id });
}
if (e.target == 3) {
uni.navigateTo({
url: '../web-view?url=' + e.url
})
this.$router.navigateTo('../web-view', { url: e.url });
}
},

View File

@ -1,5 +1,5 @@
<template>
<page-container :title="title" :showBack="true">
<page-container ref="pageContainer" :title="title" :showBack="true">
<view class="content minHeight100">
<view class="header relative" v-if="pageData && pageData.goods"
:style="{ background: 'url(' + pageData.goods.imgurl_detail + ') no-repeat 0 0 / 100% 100%' }">
@ -713,6 +713,8 @@ export default {
})
if (res.data.goods.type_text) {
this.title = res.data.goods.type_text
// 使$refs访page-container
// this.$refs.pageContainer.setNavTitle(res.data.goods.type_text);
}
this.pageData = res.data
let goodType = this.$config.getGoodTypeFind(this.pageData.goods.type);

View File

@ -107,25 +107,18 @@
todetail(e) {
if (this.type == '3') {
uni.redirectTo({
url: '/package/index/leitai?goods_id=' +
this.id +
'&goods_num=' +
e +
'&type_text=' +
this.type_text
})
this.$router.navigateTo('/package/index/leitai', {
goods_id: this.id,
goods_num: e,
type_text: this.type_text
}, 'redirectTo');
} else {
uni.redirectTo({
url: 'detail?goods_id=' +
this.id +
'&goods_num=' +
e +
'&type_text=' +
this.type_text
})
this.$router.navigateTo('detail', {
goods_id: this.id,
goods_num: e,
type_text: this.type_text
}, 'redirectTo');
}
},
change_saixuan(a, b) {
this.saixuan_index = a

View File

@ -396,6 +396,10 @@ export default {
todetails(e) {
//
let url = "/pages/shouye/detail";
let params = {
goods_id: e.id,
type_text: e.type_text
};
if (e.type == 2 || e.type == 8 || e.type == 16) {
url = "/pages/shouye/detail_wuxian";
@ -408,13 +412,7 @@ export default {
url = "/package/index/leitai";
}
this.$c.to({
url,
query: {
goods_id: e.id,
type_text: e.type_text,
},
});
this.$router.navigateTo(url, params);
},
getlist(v) {
this.tabCur = v;
@ -426,14 +424,10 @@ export default {
},
toRanking() {
uni.navigateTo({
url: "/pages/shouye/ranking",
});
this.$router.navigateTo("/pages/shouye/ranking");
},
toyaqingRanking() {
uni.navigateTo({
url: "/pages/shouye/yaoqing_ranking",
});
this.$router.navigateTo("/pages/shouye/yaoqing_ranking");
},
},
};

View File

@ -40,9 +40,7 @@
// })
// } else {
if (e.goods_id !== 0) {
uni.navigateTo({
url: 'detail?goods_id=' + e.goods_id
})
this.$router.navigateTo('detail', { goods_id: e.goods_id });
}
// }

View File

@ -39,10 +39,14 @@ export default {
},
methods: {
back() {
// uni.navigateBack()
uni.reLaunch({
url: 'index'
})
//
let that = this;
uni.navigateBack({
fail: function() {
//
that.$router.navigateTo('/pages/user/index', {}, 'reLaunch');
}
});
},
getPhoneNumber(e) {
// console.log(e)
@ -69,20 +73,13 @@ export default {
// var pageurl = uni.getStorageSync(
// 'page');
setTimeout(() => {
uni.reLaunch({
url: 'index'
})
// console.log(pageurl);
// if (pageurl != null &&
// pageurl != '') {
// console.log(pageurl +
// "12321312");
// // uni.reLaunch({
// // url: pageurl
// // })
// } else {
// uni.navigateBack()
// }
//
uni.navigateBack({
fail: function() {
//
that.$router.navigateTo('/pages/user/index', {}, 'reLaunch');
}
});
}, 1000)
}
})

View File

@ -144,9 +144,7 @@
//
setTimeout(() => {
uni.redirectTo({
url: "./index",
});
this.$router.navigateTo("./index", {}, 'redirectTo');
}, 1000);
} else {
uni.showToast({

View File

@ -106,9 +106,7 @@
methods: {
toUse(item) {
if (this.pageType == 1) {
uni.switchTab({
url: '/pages/shouye/index'
})
this.$router.navigateTo('/pages/shouye/index', {}, 'switchTab');
}
if (this.pageType == 2) {

View File

@ -219,14 +219,13 @@ export default {
})
},
toorder(e) {
uni.navigateTo({
url: 'order?id=' + e
this.$router.navigateTo('/pages/shouye/detail', {
goods_id: e,
goods_num: 1
})
},
towuliu(e) {
uni.navigateTo({
url: 'wuliu_detail?id=' + e
})
this.$router.navigateTo('/pages/shouye/wuliu_detail', { id: e })
},
getlist(v) {
this.show = v

View File

@ -560,16 +560,12 @@ export default {
},
todetail(a) {
if (a.type == 2) {
uni.navigateTo({
url: '/pages/shouye/detail_wuxian?goods_id=' + a.goods_id
})
this.$router.navigateTo('/pages/shouye/detail_wuxian', { goods_id: a.goods_id });
} else {
uni.navigateTo({
url: '/pages/shouye/detail?goods_id=' +
a.goods_id +
'&goods_num=' +
a.num
})
this.$router.navigateTo('/pages/shouye/detail', {
goods_id: a.goods_id,
goods_num: a.num
});
}
},

View File

@ -19,18 +19,18 @@
<view class="agree-r">
我已阅读并同意
<text @click.stop="$c.to({ url: '/pages/guize/guize?type=4' })">
<text @click.stop="$router.navigateTo('/pages/guize/guize', {type: 4})">
用户协议
</text>
<text @click.stop="$c.to({ url: '/pages/guize/guize?type=5' })">
<text @click.stop="$router.navigateTo('/pages/guize/guize', {type: 5})">
隐私政策
</text>
</view>
</view>
<view class="btn-list">
<view @click="$c.to({ type: 3, url: '/pages/shouye/index' })" class="cancel">
<view @click="$router.navigateTo('/pages/shouye/index', {}, 'switchTab')" class="cancel">
拒绝
</view>
@ -80,9 +80,10 @@ export default {
//===
getUserProfile(e) {
if (!this.isAgree) {
return this.$c.toast({
title: '请阅读并同意《用户协议》和《隐私政策》'
})
return uni.showToast({
title: '请阅读并同意《用户协议》和《隐私政策》',
icon: 'none'
});
}
// #ifdef MP-WEIXIN
@ -90,6 +91,56 @@ export default {
// #endif
},
/**
* 处理登录成功后的重定向逻辑
* @param {String} redirectUrl 重定向URL
*/
handleRedirect(redirectUrl) {
let that = this;
//
const pages = getCurrentPages();
// redirect URL
if (pages.length > 1) {
const prevPage = pages[pages.length - 2];
// ()
let prevPageUrl = '/' + prevPage.route;
if (prevPage.options && Object.keys(prevPage.options).length > 0) {
const paramStr = Object.keys(prevPage.options)
.map(key => `${key}=${prevPage.options[key]}`)
.join('&');
prevPageUrl += '?' + paramStr;
}
// redirect URLURL
const redirectUrlPath = redirectUrl.split('?')[0];
const prevPageUrlPath = prevPageUrl.split('?')[0];
if (redirectUrlPath === prevPageUrlPath) {
//
console.log('重定向URL与上一页相同直接返回');
setTimeout(() => {
uni.navigateBack();
}, 1000);
return true;
}
}
// URL
setTimeout(() => {
that.$router.routerTo({
url: redirectUrl,
type: 'navigateTo'
}).catch(err => {
console.error('重定向跳转失败:', err)
//
that.$router.navigateTo('/pages/user/index', {}, 'navigateTo')
})
}, 1000);
return true;
},
wxUserProfile() {
var that = this
@ -112,35 +163,21 @@ export default {
if (res.status == 1) {
uni.setStorageSync('token', res.data)
that.$c.msg("登录成功")
var lgurl = uni.getStorageSync('lgurl') //
var lgdata = uni.getStorageSync('lgurldata') //
if (lgurl) {
lgdata = JSON.parse(lgdata)
//
let param = ''
for (let key in lgdata) {
param += '&' + key + '=' + lgdata[
key]
}
param = '/' + lgurl + param.replace(
'&', '?')
uni.setStorageSync('lgurl', '')
uni.setStorageSync('lgurldata', '')
console.log(param)
setTimeout(() => {
uni.reLaunch({
url: param
})
}, 1000)
// URL
const redirectUrl = uni.getStorageSync('redirect')
if (redirectUrl) {
//
uni.removeStorageSync('redirect')
// 使
that.handleRedirect(redirectUrl);
} else {
//
setTimeout(() => {
that.getdata();
}, 1000)
// uni.reLaunch({
// url: 'index'
// })
}
} else {
that.$c.msg("登录失败!" + res.msg)
@ -180,32 +217,21 @@ export default {
success: function (res) {
if (res.status == 1) {
uni.setStorageSync('token', res.data)
var lgurl = uni.getStorageSync(
'lgurl') //
var lgdata = uni.getStorageSync(
'lgurldata') //
if (lgurl) {
lgdata = JSON.parse(lgdata)
//
let param = ''
for (let key in lgdata) {
param += '&' + key + '=' + lgdata[
key]
}
param = '/' + lgurl + param.replace(
'&', '?')
uni.setStorageSync('lgurl', '')
uni.setStorageSync('lgurldata', '')
console.log(param)
setTimeout(() => {
uni.reLaunch({
url: param
})
}, 1000)
// URL
const redirectUrl = uni.getStorageSync('redirect')
if (redirectUrl) {
//
uni.removeStorageSync('redirect')
// 使
that.handleRedirect(redirectUrl);
} else {
uni.reLaunch({
url: 'index'
})
//
setTimeout(() => {
that.getdata();
}, 1000)
}
}
}
@ -224,13 +250,11 @@ export default {
success(res) {
if (res.status == 1 && res.data.userinfo != null && res.data.userinfo.mobile_is == 0) {
console.log("判断用户有没有手机号", res.data.userinfo.mobile_is);
uni.reLaunch({
url: 'bangding'
})
// 使
that.$router.navigateTo('/pages/user/bangding', {}, 'navigateTo');
} else {
uni.reLaunch({
url: 'index'
})
// 使
that.$router.navigateTo('/pages/user/index', {}, 'navigateTo');
}
}
})