JS 路由功能 - 友好速搭 -- 开发文档

友好速搭

主题开发
快速入门 修改主题 制作主题 销售主题 升级主题

JS 路由功能

为了优化和提升页面性能,可以使用全局的 JS 路由功能,选择性的在不同页面运行所需的 JS 代码。

使用:

$(document).ready(function(){
  var oRouteCustom = {};
  // 设置 首页
  oRouteCustom['index'] = function(path){
    // Index Code
  };
  // 设置 商品详情 页
  oRouteCustom['productDetail'] = function(path){
    // Product Detail Code
  };
  // 初始化
  $yhsd.route.init(oRouteCustom);
});

路由名:

名称 页面
all 所有页面
index 首页
cart 购物车
accountIndex 个人信息
accountLogin 登录
accountRegister 注册
accountRegisterWithEmail 注册 - 邮箱
accountRegisterWithUsername 注册 - 用户名
accountRegisterWithMobile 注册 - 手机号码
accountChangePassword 修改密码
accountForgetPassword 忘记密码
accountResetPasswordWithEmail 忘记密码 - 邮箱
accountResetPasswordWithMobile 忘记密码 - 手机号码
accountReset 重设密码
accountValidateEmail 邮箱注册成功 - 验证邮箱
orderCreate 创建订单
orderAll 订单列表
orderDetail 订单详情
productAll 所有商品
productDetail 商品详情
discounts 参加某个优惠活动的商品列表
types 拥有某个分类的商品列表
vendors 拥有某个品牌的商品列表
search 搜索结果
page 所有自定义页面
blogAll 所有博客
blogDetail 博客详情
联系客服
微信咨询
微信二维码

领取免费试用资格

姓名 *

电话 *

公司名称

所在地区

意向产品

提交

提交成功

你好, XXX女士/先生 ,你的需求已提交成功,后续会有专门的客户经理与你电话联系。谢谢!