Authored by ccbikai

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -1085,6 +1085,9 @@
},
{
is_advance: true //再到着
},
{
is_soon_sold_out: true //即将售罄
}
],
... ...
... ... @@ -399,10 +399,8 @@ class AbstractAction extends Controller_Abstract
$header['lifeStyle'] = true;
break;
}
$this->_view->assign('pageHeader', $header);
}
/**
* 设置网站导航底部信息
*
... ...
... ... @@ -32,4 +32,58 @@ class CartData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 移出购物车
*
* @param int $uid 用户ID
* @param string $sku 商品sku列表
* @return array 接口返回的数据
*/
public static function removeFromCart($uid, $sku)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.remove';
$param['product_sku_list'] = $sku;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 修改购物车商品数据
*
* @param int $uid 用户ID
* @param string $swapData 商品数据
* @return array 接口返回的数据
*/
public static function modifyCartProduct($uid, $swapData)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.swap';
$param['swap_data'] = $swapData;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 移入收藏夹
*
* @param int $uid 用户ID
* @param string $sku 商品sku列表
* @return array 接口返回的数据
*/
public static function addToFav($uid, $sku)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.addfavorite';
$param['product_sku_list'] = $sku;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -22,15 +22,16 @@ class BrandData
*
* @param int $id 品牌ID
* @param int $uid 用户ID
* @param bool $isBrand 是品牌还是商品
* @return array
*/
public static function favorite($id, $uid)
public static function favorite($id, $uid, $isBrand = true)
{
$param = Yohobuy::param();
$param['method'] = 'app.favorite.add';
$param['id'] = $id;
$param['uid'] = $uid;
$param['type'] = 'brand';
$param['type'] = $isBrand ? 'brand' : 'product';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param);
... ... @@ -41,15 +42,16 @@ class BrandData
*
* @param int $id 品牌ID
* @param int $uid 用户ID
* @param bool $isBrand 是品牌还是商品
* @return array
*/
public static function favoriteCancel($id, $uid)
public static function favoriteCancel($id, $uid, $isBrand = true)
{
$param = Yohobuy::param();
$param['method'] = 'app.favorite.cancel';
$param['fav_id'] = $id;
$param['uid'] = $uid;
$param['type'] = 'brand';
$param['type'] = $isBrand ? 'brand' : 'product';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param);
... ...
... ... @@ -205,14 +205,14 @@ class Helpers
$result['name'] = $productData['product_name'];
$result['price'] = empty($productData['market_price']) ? false : $productData['market_price'];
$result['salePrice'] = $productData['sales_price'];
if ($showPoint) {
$result['price'] && $result['price'] .= '.00';
$result['salePrice'] && $result['salePrice'] .= '.00';
}
if ($showPoint) {
$result['price'] && $result['price'] .= '.00';
$result['salePrice'] && $result['salePrice'] .= '.00';
}
$result['is_soon_sold_out'] = ($productData['is_soon_sold_out'] === 'Y');
$result['url'] = SITE_MAIN . '/product/pro_' . $productData['product_id'] . '_'
. $productData['goods_list'][0]['goods_id']
. '/' . $productData['cn_alphabet'] . '.html';
. $productData['goods_list'][0]['goods_id']
. '/' . $productData['cn_alphabet'] . '.html';
// APP访问需要加附加的参数
// 备注:如果以后APP的接口太多,可以把这边参数提取出来,变成一个公共的方法来生成,便于以后管理维护
if ($isApp) {
... ...
... ... @@ -82,22 +82,22 @@ headerNavHammer.on('tap', function(e) {
}
});
formHammer = new Hammer(document.getElementById('img-form'));
if (document.getElementById('img-form') !== null) {
formHammer = new Hammer(document.getElementById('img-form'));
formHammer.on('tap', function(e) {
if ($(e.target).hasClass('upload-img-remove')) {
$uploadImgList.html('');
imgStr = '';
setTimeout(function() {
$imgAdd.show();
}, 50);
formHammer.on('tap', function(e) {
if ($(e.target).hasClass('upload-img-remove')) {
$uploadImgList.html('');
imgStr = '';
setTimeout(function() {
$imgAdd.show();
}, 50);
}
});
}
});
}
// 点赞与取消点赞
// suggestContentHammer = new Hammer(document.getElementById('suggest-content'));
$likeBtn.bind('click', function() {
var id = $(this).closest('.suggest-item').attr('data-id'),
$that = $(this);
... ...
... ... @@ -5,9 +5,8 @@
*/
var $ = require('jquery'),
lazyLoad = require('yoho.lazyload'),
Swiper = require('yoho.iswiper');
var loading = require('../../plugin/loading'),
Swiper = require('yoho.iswiper'),
loading = require('../../plugin/loading'),
tip = require('../../plugin/tip');
var introUrl = $('#introUrl').val(),
... ... @@ -17,8 +16,7 @@ var introUrl = $('#introUrl').val(),
end = false;
var sizeSwiper,
refSwiper,
recommendSwiper;
refSwiper;
require('../recommend-for-you.js');
... ... @@ -50,13 +48,13 @@ function search() {
});
//优选
recommendSwiper = new Swiper('#swiper-recommend', {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'li',
lazyLoading: true,
watchSlidesVisibility: true
});
// recommendSwiper = new Swiper('#swiper-recommend', {
// slidesPerView: 'auto',
// grabCursor: true,
// slideElement: 'li',
// lazyLoading: true,
// watchSlidesVisibility: true
// });
searching = false;
end = true;
... ...
... ... @@ -11,8 +11,8 @@ var goodsSwiper;
require('./desc');
require('./comments-consults');
// require('../recommend-for-you.js');
require('./like.js');
require('../recommend-for-you.js');
lazyLoad($('img.lazy'));
... ...
/**
* 商品详情
* @author: Lynnic
* @date: 2015/11/24
*/
var $ = require('jquery'),
Hammer = require('yoho.hammer'),
tip = require('../../plugin/tip');
var likeHammer = new Hammer('#likeBtn');
likeHammer.on('tap', function(e) {
var productId = $('#productId').val(),
opt;
var $this = $(this);
if ($this.hasClass('liked')) {
opt = 'cancel';
} else {
opt = 'ok';
}
$.ajax({
type: 'POST',
url: '/product/opt/favoriteProduct',
data: {
id: productId,
opt: opt
},
success: function(data) {
if (data.code === 200) {
$this.toggleClass('liked');
} else if (data.code === 400) {
location.href = data.data;//未登录跳转登录页
} else {
tip.show(data.message);
}
},
error: function() {
tip.show('网络断开连接了~');
}
});
});
\ No newline at end of file
... ...
... ... @@ -64,7 +64,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
id = $this.closest('.shopping-cart-good').data('id'),
url;
if ($this.closest('.put-in-favorite')) {
if ($this.closest('.put-in-favorite').length > 0) {
//移入收藏夹
url = '/shoppingCart/col';
... ...
... ... @@ -78,4 +78,31 @@
color: #b0b0b0;
padding-right: pxToRem(32px);
}
}
.systemUpdate{
width: 100%;
height: 90rem / $pxConvertRem;
overflow: hidden;
line-height: 90rem / $pxConvertRem;
display: none;
@include background-image(linear-gradient(#323232, #414141));
.systemHeader{
width: 85%;
height: 100%;
overflow: hidden;
font-size: 60em / $pxConvertRem;
color:#fff;
float: left;
text-align: center;
}
span{
width: 14%;
height: 100%;
overflow: hidden;
float: left;
text-align: center;
font-size: 80em / $pxConvertRem;
font-weight: bold;
color: #fff;
}
}
\ No newline at end of file
... ...
.iHelp{
width: 100%;
height: auto;
overflow: hidden;
.helpSearch{
width: 90%;
height: 84rem / $pxConvertRem;
overflow: hidden;
position: relative;
margin: 0 auto;
input{
width: 100%;
height: 100%;
overflow: hidden;
border:none;
font-size: 54em / $pxConvertRem;
}
i{
height: 100%;
line-height: 88rem / $pxConvertRem;
position: absolute;
right: 20rem / $pxConvertRem;
top: 0;
color: #e0e0e0;
}
}
ul{
width: 100%;
height: auto;
overflow: hidden;
display: block;
border-top: 1px solid #e0e0e0;
li{
width: 95%;
height: 80rem / $pxConvertRem;
line-height: 84rem / $pxConvertRem;
overflow: hidden;
font-size: 54em / $pxConvertRem;
border-bottom: 1px solid #e0e0e0;
float: right;
color: #444444;
&:last-of-type{
border-bottom:none;
}
span{
width: 88%;
height: 100%;
overflow: hidden;
float: left;
}
i{
color: #e0e0e0;
}
}
}
}
\ No newline at end of file
... ...
$vip: sprite-map("me/vip/*.png", $spacing: 10px);
$fav: sprite-map("me/fav/*.png", $spacing: 5px);
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang";
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp";
... ...
... ... @@ -110,7 +110,7 @@ $suggest: sprite-map("me/suggest/*.png",$spacing: 5px);
//发表意见
.create-new-suggest {
display: block;
display: inline-block;
color: #444;
width: 100%;
height: pxToRem(88px);
... ...
... ... @@ -69,6 +69,10 @@ $basicBtnC:#eb0313;
border: 1px solid #000;
color: #000;
}
.soonSoldOut-tag{
background-color:#ffac5b;
color:#fff;
}
}
.good-detail-page {
overflow: hidden;
... ... @@ -344,8 +348,12 @@ $basicBtnC:#eb0313;
}
&.favorite {
font-size: pxToRem(34px);
color: $basicBtnC;
color: #ccc
}
&.favorite.liked{
color:$basicBtnC;;
}
&.addto-cart,
&.sold-out {
height: pxToRem(80px);
... ... @@ -374,6 +382,10 @@ $basicBtnC:#eb0313;
font-size: pxToRem(24px);
}
}
.recommend-for-you{
margin-bottom: pxToRem(120px);
}
}
@import "comments-consults";
@import "product-description";
\ No newline at end of file
... ...
... ... @@ -90,7 +90,7 @@
}
}
margin-top: pxToRem(30px);
margin-bottom: pxToRem(120px);
margin-bottom: pxToRem(30px);
}
.detail-swiper {
.swiper-wrapper {
... ...
{{> layout/header}}
<div class="iHelp">
<div class="helpSearch">
<input type="text">
<i class="iconfont">&#xe60f;</i>
</div>
<ul>
{{# iHelp}}
<li><a href="{{ url }}"><span>{{ name }}</span><i class="iconfont num">&#xe604;</i></a></li>
{{/ iHelp}}
</ul>
</div>
{{> layout/footer}}
... ...
... ... @@ -94,7 +94,7 @@
</a>
</div>
<div class="group-list">
<a class="list-item" href="/help.html">
<a class="list-item" href="/home/IHelp">
<span class="iconfont icon">&#xe639;</span>
帮助
<span class="iconfont num">&#xe604;</span>
... ...
... ... @@ -2,6 +2,7 @@
<div class="good-detail-page yoho-page">
<div class="banner-container">
<div class="tag-container">
<p class="good-tag soonSoldOut-tag">即将售罄</p>
{{# tags}}
{{# is_new}}
<p class="good-tag new-tag">NEW</p>
... ... @@ -18,6 +19,9 @@
{{# is_limited}}
<p class="good-tag limit-tag">限量商品</p>
{{/ is_limited}}
{{# is_soon_sold_out}}
<p class="good-tag soonSoldOut-tag">即将售罄</p>
{{/ is_soon_sold_out}}
{{/ tags}}
</div>
{{# bannerTop}}
... ... @@ -101,6 +105,7 @@
{{/ enterStore}}
<div id="productDesc"></div>
{{> product/recommend-for-you}}
{{#cartInfo}}
<div class="cart-bar">
... ... @@ -113,13 +118,21 @@
{{else}}
<a href="" class="sold-out">已售罄</a>
{{/if}}
{{#if favorite}}
<a href="" id="likeBtn" class="favorite iconfont liked">&#xe605;</a>
{{else}}
<a href="" class="favorite iconfont">&#xe605;</a>
{{/if}}
</div>
{{/cartInfo}}
{{#if introUrl}}
<input id="introUrl" type="hidden" value={{introUrl}}>
{{/if}}
{{#if id}}
<input id="productId" type="hidden" value={{id}}>
{{/if}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -43,4 +43,10 @@
<link rel="apple-touch-startup-image" sizes="320x460" href="http://static.yohobuy.com/m/v1/img/startup/startup.png" media="screen and (max-device-width: 320)">
</head>
<body {{#if isPassportPage}}class=passport-body{{/if}}>
{{#if systemUpdate}}
<div class="systemUpdate">
<a href="systemUpdate" class="systemHeader">YOHO!BUY关于系统升级的公告</a>
<span>X</span>
</div>
{{/if}}
{{> layout/page_header}}
\ No newline at end of file
... ...
... ... @@ -130,6 +130,4 @@
{{/list}}
</div>
</div>
{{/productDetail}}
{{> product/recommend-for-you}}
\ No newline at end of file
{{/productDetail}}
\ No newline at end of file
... ...
... ... @@ -14,7 +14,6 @@ use Index\UserModel as UserModel;
* @package
* @copyright yoho.inc
* @version 1.0 (2015-10-28 16:28:32)
* @author fei.hong <fei.hong@yoho.cn>
*/
class HomeController extends AbstractAction
{
... ... @@ -27,7 +26,12 @@ class HomeController extends AbstractAction
public function init()
{
// 检查用户是否登录, 未登录则跳转到登录页
$uid = 8826435; //$this->getUid(true);
// @todo 为了方便测试,支持传uid参数
$uid = $this->getUid();
if (!$uid) {
$uid = $this->_uid = $this->get('uid', 8826435); //$this->getUid(true);
}
$action = $this->getRequest()->getActionName();
if (!$uid && $action !== 'index') {
$this->go(Helpers::url('/signin.html'));
... ... @@ -654,4 +658,28 @@ class HomeController extends AbstractAction
$this->_view->display('order-detail', array('orderDetail' => $data, 'orderDetailPage' => true));
}
}
/**
* 帮助列表页
*/
private function IHelpAction()
{
$this->setTitle('帮助中心');
$this->setNavHeader('帮助中心');
$data = array(
'iHelp' => array(
array('name' => '新用户注册','url' => 'http://m.dev.yohobuy.com/' ),
array('name' => '交款须知' ,'url' => 'http://m.dev.yohobuy.com/'),
array('name' => '服务条款' ,'url' => 'http://m.dev.yohobuy.com/'),
array('name' => '网站订购流程' ,'url' => 'http://m.dev.yohobuy.com/'),
array('name' => '会员登录' ,'url' => 'http://m.dev.yohobuy.com/'),
array('name' => '网站订单修改' ,'url' => 'http://m.dev.yohobuy.com/'),
array('name' => 'YOHO币' ,'url' => 'http://m.dev.yohobuy.com/'),
array('name' => '常见问题' ,'url' => 'http://m.dev.yohobuy.com/'),
array('name' => '支付方式' ,'url' => 'http://m.dev.yohobuy.com/'),
array('name' => '发票制度说明' ,'url' => 'http://m.dev.yohobuy.com/'),
array('name' => '配送时间' ,'url' => 'http://m.dev.yohobuy.com/')
)
);
$this->_view->display('i-help', $data);
}
}
... ...
... ... @@ -33,5 +33,14 @@ class IndexController extends AbstractAction
'pageFooter' => true,
));
}
/**
* 设置升级公告路由
*
*/
public function systemUpdate()
{
$this->_view->display('systemUpdate','');
}
}
... ...
<?php
use Action\AbstractAction;
use Index\CartModel;
use Plugin\Helpers;
/**
* 购物车
*/
class ShoppingCartController extends AbstractAction
{
protected $_uid;
/**
* 初始化
*/
public function init()
{
// 检查用户是否登录, 未登录则跳转到登录页
$this->_uid = $this->getUid();
if (!$this->_uid) {
$this->go(Helpers::url('/signin.html'));
}
parent::init();
}
/*
* 首页
*/
public function indexAction()
{
$this->setTitle('购物车');
$this->setNavHeader('购物车');
$uid = $this->getUid();
$data = array(
'shoppingCartPage' => true,
'shoppingCart' => \Index\CartModel::getCartData($uid)
'shoppingCart' => CartModel::getCartData($this->_uid)
);
// 渲染模板
$this->_view->display('index', $data);
}
/**
* 移出购物车
*/
public function delAction()
{
$result = array();
if ($this->isAjax()) {
$productId = $this->post('id', 0);
$result = CartModel::removeFromCart($this->_uid, $productId);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/**
* 移入收藏夹
*/
public function colAction()
{
$result = array();
if ($this->isAjax()) {
$productId = $this->post('id', 0);
$result = CartModel::addToFav($this->_uid, $productId);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/**
* 修改购物车商品数据
*/
public function modifyAction()
{
$result = array();
if ($this->isAjax()) {
$params = array();
$params['old_product_sku']= $this->post('old_product_sku', 0);
$params['new_product_sku']= $this->post('new_product_sku', 0);
$params['buy_number']= $this->post('buy_number', 0);
$params['selected']= $this->post('selected', null);
$result = CartModel::modifyCartProduct($this->_uid, $params);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
public function giftAdvanceAction()
{
$data = array(
... ...
... ... @@ -51,6 +51,75 @@ class CartModel
return $result;
}
/**
* 移出购物车
*
* @param int $uid 用户ID
* @param string $sku 商品sku列表
* @return array 接口返回的数据
*/
public static function removeFromCart($uid, $sku)
{
$result = array('code' => 400, 'message' => '出错啦~');
// 处理sku
$sku_list = json_encode(array($sku => 1));
$remove = CartData::removeFromCart($uid, $sku_list);
if ($remove && isset($remove['code'])) {
$result['code'] = $remove['code'];
$result['message'] = $remove['message'];
}
return $result;
}
/**
* 移入收藏夹
*
* @param int $uid 用户ID
* @param string $sku 商品sku列表
* @return array 接口返回的数据
*/
public static function addToFav($uid, $sku)
{
$result = array('code' => 400, 'message' => '出错啦~');
// 处理sku
$sku_list = json_encode(array($sku => 1));
$add = CartData::addToFav($uid, $sku_list);
if ($add && isset($add['code'])) {
$result['code'] = $add['code'];
$result['message'] = $add['message'];
}
return $result;
}
/**
* 修改购物车商品数据
*
* @param int $uid 用户ID
* @param string $param 要更改的数据
* @return array 接口返回的数据
*/
public static function modifyCartProduct($uid, $param)
{
$result = array('code' => 400, 'message' => '出错啦~');
// 处理要更改的数据
$swapData = json_encode(array($param));
$modify = CartData::addToFav($uid, $swapData);
if ($modify && isset($modify['code'])) {
$result['code'] = $modify['code'];
$result['message'] = $modify['message'];
}
return $result;
}
/**
* 处理不同类型的购物车数据
... ... @@ -65,7 +134,7 @@ class CartModel
$oneGoods = array();
// 购买的商品列表
foreach ($data['goods_list'] as $value) {
$oneGoods['id'] = $value['product_id'];
$oneGoods['id'] = $value['product_sku'];
$oneGoods['name'] = $value['product_name'];
$oneGoods['thumb'] = Images::getImageUrl($value['goods_images'], 120, 120);
$oneGoods['color'] = $value['color_name'];
... ...
... ... @@ -31,15 +31,44 @@ class DetailModel
if (is_numeric($productId) && is_numeric($goodsId)) {
// 调用服务
$baseInfo = DetailData::baseInfo($productId, $uid);
$baseInfo = DetailData::baseInfo($productId, $uid);
// 判断商品是否在架
if (empty($baseInfo['status'])) {
return $result;
}
// 商品名称
if (isset($baseInfo['productName'])) {
$result['goodsName'] = $baseInfo['productName'];
} else {
return $result;
}
}
// 商品标签
if (!empty($baseInfo['productTagBoList'])) {
foreach ($baseInfo['productTagBoList'] as $value) {
switch ($value['tagLabel']) {
case 'is_soon_sold_out': // 即将售磬
$result['tags']['is_soon_sold_out'] = true;
break;
case 'is_new': // 新品
$result['tags']['is_new'] = true;
break;
case 'is_discount': // 在售
$result['tags']['is_discount'] = true;
break;
case 'is_limited': // 限量
$result['tags']['is_limited'] = true;
break;
case 'is_yohood': // YOHOOD
$result['tags']['is_yohood'] = true;
break;
case 'is_advance': // 再到着
$result['tags']['is_advance'] = true;
break;
}
}
}
// 商品价格
if (isset($baseInfo['productPriceBo'])) {
$result['goodsPrice'] = array();
... ... @@ -176,6 +205,7 @@ class DetailModel
// 底部简介的URL链接
$result['introUrl'] = Helpers::url('/product/intro_' . $baseInfo['erpProductId'] . '/' . $baseInfo['cnAlphabet'] . '.html');
$result['id'] = $productId;
}
return $result;
... ...
... ... @@ -60,7 +60,55 @@ class OptController extends AbstractAction
$result = array('code' => 401, 'message' => '参数不正确', 'data' => false);
break;
}
} while (false);
$this->echoJson($result);
}
/**
* 商品收藏/取消收藏
*
* @param int id 商品ID
* @param string opt 操作标识("ok":表示收藏,"cancel":表示取消收藏)
* @return json
*/
public function favoriteProductAction()
{
$result = array('code' => 401, 'message' => '参数不正确', 'data' => false);
do {
/* 判断是否是AJAX请求 */
if (!$this->isAjax()) {
break;
}
/* 判断品牌ID是否有效 */
$id = $this->post('id');
if (!is_numeric($id)) {
break;
}
/* 判断用户是否登录 */
$uid = $this->getUid();
if (!$uid) {
$referer = $this->server('HTTP_REFERER', SITE_MAIN);
$result = array('code' => 400, 'message' => '未登录', 'data' => Helpers::url('/signin.html', array('refer' => $referer)));
break;
}
/* 取消收藏 */
$opt = $this->post('opt', 'ok');
if ($opt !== 'ok') {
$result = BrandData::favoriteCancel($id, $uid, false);
break;
}
/* 收藏 */
$result = BrandData::favorite($id, $uid, false);
if (!isset($result['code'])) {
$result = array('code' => 401, 'message' => '参数不正确', 'data' => false);
break;
}
} while (false);
$this->echoJson($result);
... ...
... ... @@ -33,12 +33,12 @@ application.debug = False
application.servers.config = APPLICATION_PATH "/configs/core"
;出错的时候是否抛出异常
application.dispatcher.throwException = False
application.dispatcher.throwException = True
;是否使用默认的异常 捕获Controller, 如果开启, 在有未捕获的异常的时候,
;控制权会交给ErrorController的errorAction 方法,
;可以通过$request->getException()获得此异常对象
application.dispatcher.catchException = False
application.dispatcher.catchException = True
;模板预编译目录,该目录需要有读写权限
application.template.compile = ROOT_PATH "/compile/m.yohobuy.com"
... ...
... ... @@ -126,10 +126,10 @@ routes.product.route.action = Index
routes.product.map.1 = productId
routes.product.map.2 = goodsId
routes.buy.type = "regex"
routes.buy.match = "#/product/intro_([0-9]+)/(.*).html#"
routes.buy.route.module = Product
routes.buy.route.controller = Detail
routes.buy.route.action = Intro
routes.buy.map.1 = productSkn
routes.productintro.type = "regex"
routes.productintro.match = "#/product/intro_([0-9]+)/(.*).html#"
routes.productintro.route.module = Product
routes.productintro.route.controller = Detail
routes.productintro.route.action = Intro
routes.productintro.map.1 = productSkn
... ...
<?php
use Yaf\Application;
define('SITE_MAIN', 'http://m.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://m.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.m.yohobuy.com'); // COOKIE作用域
define('SUB_DOMAIN', '.m.yohobuy.com'); // 子域名后缀
define('USE_CACHE', false); // 缓存的开关
define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'preview');
$application = new Application(APPLICATION_PATH . '/configs/application.preview.ini');
$application->bootstrap()->run();
\ No newline at end of file
... ...