Authored by Rock Zhang

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

Conflicts:
	yohobuy/m.yohobuy.com/application/controllers/Home.php
... ... @@ -1043,8 +1043,11 @@
### 我的逛
{
myGuang: [
{...} //逛资讯
..
]
myGuang: {
infos: [
{...} //逛资讯
..
],
//若无收藏则不传infos
}
}
\ No newline at end of file
... ...
commit 7229af7cecf40861c6fb3987c1f38ac3da2faef9
Author: Lynnic <gunix@foxmail.com>
Date: Fri Nov 13 17:45:31 2015 +0800
update
commit 2c21a46be447a1bc1982d8ad3cad7f8c00a63a0f
Author: xuqi <xuqi9010@gmail.com>
Date: Fri Nov 13 17:27:02 2015 +0800
rm temp file
commit 34763241edf84698b24ecb2aa2f2bfa1e37afc32
Author: liangzhifeng <zhifeng.liang@yoho.cn>
Date: Fri Nov 13 16:58:28 2015 +0800
update yas version
commit 3b4a6cd6177ec9cef8ab953b165da1d222974382
Merge: c1b68bb 7ccb30d
Author: liangzhifeng <zhifeng.liang@yoho.cn>
Date: Fri Nov 13 16:39:59 2015 +0800
Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
commit c1b68bb739bb2535d9d8a205aa198ccc1844752d
Author: liangzhifeng <zhifeng.liang@yoho.cn>
Date: Fri Nov 13 16:39:26 2015 +0800
update yas version
commit 7ccb30d2ca3d45bf82638f63c8ae0e0db27b3a5f
Author: Lynnic <gunix@foxmail.com>
Date: Fri Nov 13 15:37:18 2015 +0800
changed the name of conflicted function
commit e5569a46931588f42607e84bec1db64a8cf46bcd
Merge: a7552b8 b4b964e
Author: Lynnic <gunix@foxmail.com>
Date: Fri Nov 13 14:50:09 2015 +0800
Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
commit b4b964e589b88c0821e1138e46d56dca3f139bcd
Merge: 6f68082 7a6895e
Author: ccbikai <ccbikai@qq.com>
Date: Fri Nov 13 14:35:33 2015 +0800
Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
commit 6f6808272a6a6e40e425bc3df69eff26512e5c80
Author: ccbikai <ccbikai@qq.com>
Date: Fri Nov 13 14:35:28 2015 +0800
修改地址页面样式
commit 7a6895ebfa302d46b791f78196614b9a6d9404ce
Merge: 8413e20 0ff1e35
Author: uedxwg <xieweiguang11@163.com>
Date: Fri Nov 13 14:23:11 2015 +0800
Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
commit 8413e2059464cec3c386bbcb25cd5f7f9bc3e2da
Author: uedxwg <xieweiguang11@163.com>
Date: Fri Nov 13 14:22:31 2015 +0800
'hotrank'
commit a7552b8af3de3fba625736b885aac3d6aeb57b0a
Author: lynnic <gunix@foxmail.com>
Date: Fri Nov 13 13:40:22 2015 +0800
update
commit 9ce2bf2913bc9909a5fac0fa4a30777ba4db23c3
Author: ccbikai <ccbikai@qq.com>
Date: Fri Nov 13 13:35:07 2015 +0800
commit 0ff1e35337c656c288243a40602bd0cb7a85fdb4
Merge: 88ef01d cdba827
Author: ccbikai <ccbikai@qq.com>
Date: Fri Nov 13 13:30:37 2015 +0800
merge code
commit 88ef01d3931dc8b61657019bde2e02186c0222e3
Author: ccbikai <ccbikai@qq.com>
Date: Fri Nov 13 13:29:45 2015 +0800
地址模板修改
commit 072785ab101cff6bcd3f5548165cad6d18c79aa1
Merge: 5e3e194 cdba827
Author: liangzhifeng <zhifeng.liang@yoho.cn>
Date: Fri Nov 13 13:25:15 2015 +0800
Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
commit cdba82787e574d2274025227bdcfd97553fbe30e
Merge: 91cebbc 35dbe8b
Author: hf <fei.hong@yoho.cn>
Date: Fri Nov 13 13:24:46 2015 +0800
merge master css js code
commit 91cebbc682532eab919ea903c7668f3ff9fb01a1
Author: hf <fei.hong@yoho.cn>
Date: Fri Nov 13 13:24:01 2015 +0800
merge master css js code
commit 5e3e194ef858a371f65b0a6e2965f79ec65fdb49
Merge: 9cb6944 35dbe8b
Author: liangzhifeng <zhifeng.liang@yoho.cn>
Date: Fri Nov 13 13:23:02 2015 +0800
Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
commit 35dbe8bc57c1accce337e199df6d323d4e7b7ead
Author: ccbikai <ccbikai@qq.com>
Date: Fri Nov 13 13:22:34 2015 +0800
地址管理增加数据
commit 9cb6944ea59db8f2958f10de518db079aa0bc3ad
Merge: 09500b4 bfaf6f7
Author: liangzhifeng <zhifeng.liang@yoho.cn>
Date: Fri Nov 13 13:22:11 2015 +0800
Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
commit f735917c59165291cfb3fcb064e06bb424e64b40
Author: lynnic <gunix@foxmail.com>
Date: Fri Nov 13 13:19:56 2015 +0800
product detail
commit bfaf6f7da9e7b3f15ca3e2223af4b04e890f7181
Merge: ddb8634 da2dd89
Author: ccbikai <ccbikai@qq.com>
Date: Fri Nov 13 11:47:23 2015 +0800
Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
commit ddb8634a6229dafd38b4380cdb4861d768cb207c
Author: ccbikai <ccbikai@qq.com>
Date: Fri Nov 13 11:47:18 2015 +0800
地址管理页面样式
commit 09500b4de29d35d7edb9526feaef5cfda53bc48b
Merge: b3d45dc da2dd89
Author: liangzhifeng <zhifeng.liang@yoho.cn>
Date: Fri Nov 13 11:18:17 2015 +0800
Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
commit b3d45dcfe30770f888ccde298a1aa65c7b06c829
Author: liangzhifeng <zhifeng.liang@yoho.cn>
Date: Fri Nov 13 11:17:43 2015 +0800
update the version of yas
commit da2dd89e32be5bb319141af09fe5b8f1404e192d
Author: hf <fei.hong@yoho.cn>
Date: Fri Nov 13 11:15:06 2015 +0800
merge master css js code
commit e677bad09bfc0959d667a29a035375cf9feba5d2
Merge: cef0926 f1ec957
Author: hf <fei.hong@yoho.cn>
Date: Fri Nov 13 10:52:10 2015 +0800
merge master css js code
commit cef09262f23a1ba1fadef9c56fb2088cfd75cde5
Merge: d927c9f 1483b13
Author: hf <fei.hong@yoho.cn>
Date: Fri Nov 13 10:51:02 2015 +0800
do merge master code
commit 1483b137ec3273153d3dfa8f47aadd6b4b88fb9c
Author: ccbikai <ccbikai@qq.com>
Date: Fri Nov 13 10:18:43 2015 +0800
个人中心首页完善
commit 2b3507b2e6319697d96723e7ca3d72fcdce8bedc
Merge: a772911 67b011f
Author: ccbikai <ccbikai@qq.com>
Date: Fri Nov 13 09:39:53 2015 +0800
Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
commit 67b011f1647426d9d4e59daf67cd75e2e29d1acb
Merge: 9c12951 a7a3613
Author: uedxwg <xieweiguang11@163.com>
Date: Thu Nov 12 18:40:33 2015 +0800
Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
commit 9c12951e3d4aaa06cc99b8d76da2d8aa1b3bfcc1
Author: uedxwg <xieweiguang11@163.com>
Date: Thu Nov 12 18:39:49 2015 +0800
'hotrank'
commit a7a36134fbca6e9d5f4cb60e40fb9a9a83cb2c1a
Merge: d336ffb 47f54e6
Author: Rock Zhang <iamgtskk@gmail.com>
Date: Thu Nov 12 18:30:47 2015 +0800
Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Conflicts:
framework
commit d336ffb79bb7ead39b230b751f6a7a296cec4b78
Author: Rock Zhang <iamgtskk@gmail.com>
Date: Thu Nov 12 18:30:23 2015 +0800
完成个人中心部分功能
commit f1ec957452269f97436356c5e718460847d32b52
Author: hf <fei.hong@yoho.cn>
Date: Thu Nov 12 18:18:41 2015 +0800
modify to search goods list style
commit 47f54e6c63dbfdf87d125c17c7538cfd73c9fab9
Merge: 1ba211d a72e1a2
Author: lore-w <metro-cpu@hotmail.com>
Date: Thu Nov 12 18:16:56 2015 +0800
Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Conflicts:
static/js/me/entry.js
static/sass/me/_index.scss
template/m.yohobuy.com/partials/layout/use.phtml
commit afe58b17129e155698bf1114ef95ea25e867f43b
Author: hf <fei.hong@yoho.cn>
Date: Thu Nov 12 18:12:58 2015 +0800
modify to search goods list style
commit 32827f6aa9b9c3fe39a213e3c4001399868a10f0
Merge: 76c5106 80adb41
Author: hf <fei.hong@yoho.cn>
Date: Thu Nov 12 18:12:27 2015 +0800
Merge remote-tracking branch 'origin/hotfix'
commit 1ba211d6670de1f88538065b9276bdd63be55aef
Author: lore-w <metro-cpu@hotmail.com>
Date: Thu Nov 12 18:11:25 2015 +0800
收藏、意见反馈
commit 80adb4135a73c332ce435693a83fd5610c20721e
Author: ccbikai <ccbikai@qq.com>
Date: Thu Nov 12 18:09:40 2015 +0800
取消搜索不 focus
commit 76c51067fd3afdb2e04ece7f3cf21c7a3d98fb8d
Author: hf <fei.hong@yoho.cn>
Date: Thu Nov 12 18:01:57 2015 +0800
modify to search goods list style
commit ebf90d5f499facf9b0b38d3afe3a421273e319f7
Author: hf <fei.hong@yoho.cn>
Date: Thu Nov 12 18:01:37 2015 +0800
modify to search goods list style
commit 74c6939a6c0af5dea824447eedd57b40d5d36e8e
Merge: d874739 4be2273
Author: hf <fei.hong@yoho.cn>
Date: Thu Nov 12 18:
\ No newline at end of file
framework @ 75bbc3b0
Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05
Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
... ...
... ... @@ -29,7 +29,6 @@ class GuangData
$param['limit'] = $limit;
$param['yh_channel'] = $yh_channel;
$param['client_secret'] = Sign::getSign($param);
// return Yohobuy::post(Yohobuy::API_URL, $param);
return Yohobuy::post(Yohobuy::SERVICE_URL . self::GUANG_URI . 'getUserFavArticleList', $param);
}
... ...
... ... @@ -46,6 +46,7 @@ class OrderData
*/
static function cancelOrderData($order_code, $uid, $gender, $yh_channel, $method) {
//构建必传参数
$param = Yohobuy::param();
$param['order_code'] = $order_code;
$param['uid'] = $uid;
... ... @@ -53,6 +54,7 @@ class OrderData
$param['yh_channel'] = $yh_channel;
$param['method'] = $method;
$param['client_secret'] = Sign::getSign($param);
//调用接口获得数据
return Yohobuy::get(Yohobuy::API_URL, $param);
}
... ... @@ -63,6 +65,7 @@ class OrderData
*/
static function deleteOrderData($order_code, $uid, $gender, $yh_channel, $method) {
//构建必传参数
$param = Yohobuy::param();
$param['order_code'] = $order_code;
$param['uid'] = $uid;
... ... @@ -70,23 +73,56 @@ class OrderData
$param['yh_channel'] = $yh_channel;
$param['method'] = $method;
$param['client_secret'] = Sign::getSign($param);
//调用接口删除订单
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/*
* 支付订单
* 我的订单-查看物流
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
static function getPaymentData($contentCode, $gender, $yh_channel) {
static function LogisticsData() {
//构建必传参数
$param = Yohobuy::param();
$param['method'] = 'app.express.li';
//$param['gender'] = $gender;
//$param['yh_channel'] = $yh_channel;
$param['client_secret'] = Sign::getSign($param);
//调用接口获得数据
return Yohobuy::get('http://api.open.yohobuy.com/', $param);
}
/*
* 支付url
* To change this template file, choose Tools | Templates
*/
static function paymentData($gender, $yh_channel, $code) {
//构建必传参数
$param = Yohobuy::param();
$param['content_code'] = $contentCode;
$param['content_code'] = $code;
$param['gender'] = $gender;
$param['yh_channel'] = $yh_channel;
$param['client_secret'] = Sign::getSign($param);
//print_r($param);
//调用接口获得数据
return Yohobuy::get(Yohobuy::SERVICE_URL . '/operations/api/v5/resource/get', $param);
}
/*
* 随便逛逛url
* To change this template file, choose Tools | Templates
*/
static function strollData($gender, $yh_channel, $code) {
//构建必传参数
$param = Yohobuy::param();
$param['content_code'] = $code;
$param['gender'] = $gender;
$param['yh_channel'] = $yh_channel;
$param['client_secret'] = Sign::getSign($param);
//调用接口获得数据
return Yohobuy::get(Yohobuy::SERVICE_URL . '/operations/api/v5/resource/get', $param);
}
... ...
... ... @@ -5,7 +5,8 @@
*/
var $ = require('jquery');
var $footer = $('#yoho-footer');
var $footer = $('#yoho-footer'),
$header = $('.yoho-header');
function cookie(name) {
var cookies = document.cookie,
... ... @@ -152,6 +153,13 @@ function rePosFooter() {
}
}());
$header.on('touchstart', 'a', function() {
$header.find('a').removeClass('highlight');
$(this).addClass('highlight');
}).on('touchend touchcancel', 'a', function() {
$(this).removeClass('highlight');
});
//暴露公共接口
window.cookie = cookie;
... ...
... ... @@ -130,8 +130,11 @@ function initInfosEvt($container) {
/**
* 资讯LoadMore
* @param $container 资讯容器 jqyeryObject
* @param opt 请求参数
* @param url[可选], 扩展请求的url而不使用默认值
*/
function loadMore($container, opt) {
function loadMore($container, opt, url) {
var num;
if (searching) {
... ... @@ -152,7 +155,7 @@ function loadMore($container, opt) {
searching = true;
$.ajax({
type: 'GET',
url: ' /guang/index/page',
url: url ? url : '/guang/index/page',//对于指定url的使用指定url(存在不同的控制器)
data: opt,
success: function(data) {
var $newItems;
... ...
... ... @@ -214,8 +214,13 @@ function tsAnimate() {
setTimeout(tsAnimate, 3000);
// 底部留出tab 的高度
$('.home-header .search-btn').on('touchstart', function() {
$(this).addClass('highlight');
}).on('touchend touchcancel', function() {
$(this).removeClass('highlight');
});
// 底部留出tab 的高度
$('#yoho-footer').css({
'margin-bottom': '2.5rem'
});
... ...
... ... @@ -18,10 +18,13 @@ var setting = {
end: false
};
info.initInfoEvt($infoList);
//对于有逛收藏的页面进行事件处理
if ($infoList.length > 0) {
info.initInfosEvt($infoList);
$(window).scroll(function() {
if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $infoList.height()) {
loadMore($infoList, setting);
}
});
\ No newline at end of file
$(window).scroll(function() {
if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $infoList.height()) {
loadMore($infoList, setting, '/home/myguang');
}
});
}
\ No newline at end of file
... ...
/**
* 商品详情
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/11/18
*/
\ No newline at end of file
... ...
... ... @@ -7,4 +7,5 @@
require('./newsale/newarrival');
require('./newsale/discount');
require('./list');
require('./detail/detail');
\ No newline at end of file
require('./detail/detail');
require('./detail/desc');
\ No newline at end of file
... ...
... ... @@ -63,11 +63,21 @@
.search-btn {
position: absolute;
right: 32rem / $pxConvertRem;
right: 0;
top: 0;
bottom: 0;
a{
width: 90rem / $pxConvertRem;
height: 90rem / $pxConvertRem;
text-align: center;
a {
display: block;
color: #fff;
font-size: 40rem / $pxConvertRem;
line-height: 90rem / $pxConvertRem;
}
&.highlight {
background: rgba(200,200,200,.4);
}
}
}
... ...
... ... @@ -24,26 +24,31 @@
background: #4f4138;
}
.nav-back {
a.highlight {
background: rgba(200,200,200,.1);
}
%nav {
display: block;
position: absolute;
left: 34rem / $pxConvertRem;
top: 28rem / $pxConvertRem;
width: 18rem / $pxConvertRem;
height: 32rem / $pxConvertRem;
background: image-url('layout/back.png') no-repeat;
background-size: 100% 100%;
top: 0;
width: 90rem / $pxConvertRem;
height: 90rem / $pxConvertRem;
font-size: 40rem / $pxConvertRem;
line-height: 90rem / $pxConvertRem;
color: #fff;
text-align: center;
outline: none;
}
.nav-back {
@extend %nav;
left: 0;
}
.nav-home {
position: absolute;
top: 28rem / $pxConvertRem;
right: 34rem / $pxConvertRem;
width: 20px;
height: 20px;
background: image-url('layout/home.png') no-repeat;
background-size: 100% 100%;
outline: none;
@extend %nav;
right: 0;
}
.nav-title {
... ...
$fav: sprite-map("me/fav/*.png",$spacing: 5px);
.yoho-favorite-page {
width: 100%;
height: auto;
... ...
$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";
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang";
... ...
.my-guang-page {
.null {
height: 240rem / $pxConvertRem;
width: 100%;
position: absolute;
text-align: center;
top: 50%;
margin-top: -120rem / $pxConvertRem;
span {
color: #b0b0b0;
font-size: 24rem / $pxConvertRem;
margin-top: 20rem / $pxConvertRem;
}
}
.icon-null {
width: pxToRem(188px);
height: pxToRem(171px);
@include rem-sprite($fav, fav-null);
margin: 0 auto;
margin-bottom: 30rem / $pxConvertRem;
}
}
\ No newline at end of file
... ...
{{> me/my-guang/infos}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="my-guang-page yoho-page">
<div id="info-list" class="info-list">
{{# myGuang}}
{{> guang/info}}
{{/ myGuang}}
</div>
{{# myGuang}}
{{#if infos}}
<div id="info-list" class="info-list">
{{> me/my-guang/infos}}
</div>
{{^}}
<div class="null">
<div class="icon-null"></div>
<span>您当前还未收藏任何资讯!</span>
</div>
{{/if}}
{{/ myGuang}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{#pageHeader}}
<header class="yoho-header{{#if boys}} boys{{/if}}{{#if girls}} girls{{/if}}{{#if kids}} kids{{/if}}{{#if lifeStyle}} life-style{{/if}}">
{{#if navBack}}
<a href="javascript:history.go(-1);" class="nav-back"></a>
<a href="javascript:history.go(-1);" class="iconfont nav-back">&#xe610;</a>
{{/if}}
{{#navHome}}
<a href="{{.}}" class="nav-home"></a>
<a href="{{.}}" class="iconfont nav-home">&#xe611;</a>
{{/navHome}}
{{#navTitle}}
<p class="nav-title">{{.}}</p>
... ...
{{#each infos}}
{{> guang/info}}
{{/each}}
\ No newline at end of file
... ...
... ... @@ -68,13 +68,14 @@ class HomeController extends AbstractAction
$this->setTitle('我的收藏');
$this->setNavHeader('我的收藏', true, SITE_MAIN);
$tab = $this->get('tab', '');
$tab = $this->get('tab', '');
$uid = $this->getUid();
$uid = 8826435;
$gender = Helpers::getGenderByCookie();
$favProducts = \Index\UserModel::getFavProductData($uid);
$favBrands = \Index\UserModel::getFavBrandData($uid, $gender);
$data = array(
'favPage' => true, //加载js
'pageFooter' => true,
... ... @@ -97,16 +98,20 @@ class HomeController extends AbstractAction
{
$result = array();
if ($this->isAjax()) {
if ($this->isAjax())
{
$uid = $this->getUid();
$fav_id = $this->post('fav_id', 0);
$result = \Index\UserModel::favoriteDelete($uid, $fav_id);
}
if (empty($result)) {
if (empty($result))
{
echo ' ';
} else {
}
else
{
$this->echoJson($result);
}
}
... ... @@ -207,7 +212,8 @@ class HomeController extends AbstractAction
{
$result = array();
if ($this->isAjax()) {
if ($this->isAjax())
{
// $uid = $this->getUid();
$uid = 8826435;
$address = $this->post('address', '');
... ... @@ -221,9 +227,12 @@ class HomeController extends AbstractAction
$result = \Index\UserModel::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
}
if (empty($result)) {
if (empty($result))
{
echo ' ';
} else {
}
else
{
$this->echoJson($result);
}
}
... ... @@ -235,7 +244,8 @@ class HomeController extends AbstractAction
{
$result = array();
if ($this->isAjax()) {
if ($this->isAjax())
{
// $uid = $this->getUid();
$uid = 8826435;
$id = $this->post('id', '');
... ... @@ -243,9 +253,12 @@ class HomeController extends AbstractAction
$result = \Index\UserModel::setDefaultAddress($uid, $id);
}
if (empty($result)) {
if (empty($result))
{
echo ' ';
} else {
}
else
{
$this->echoJson($result);
}
}
... ... @@ -257,7 +270,8 @@ class HomeController extends AbstractAction
{
$result = array();
if ($this->isAjax()) {
if ($this->isAjax())
{
// $uid = $this->getUid();
$uid = 8826435;
$id = $this->post('id', '');
... ... @@ -265,9 +279,12 @@ class HomeController extends AbstractAction
$result = \Index\UserModel::deleteAddress($uid, $id);
}
if (empty($result)) {
if (empty($result))
{
echo ' ';
} else {
}
else
{
$this->echoJson($result);
}
}
... ... @@ -294,7 +311,8 @@ class HomeController extends AbstractAction
$service = array();
$cateId = $this->get('cateId', 0);
$cateName = $this->get('cateName', '');
if ($cateId > 0) {
if ($cateId > 0)
{
$service = home\OnlineModel::getOnlineServiceDetail($cateId);
}
$this->setTitle('在线客服');
... ... @@ -310,11 +328,25 @@ class HomeController extends AbstractAction
$page = $this->get('page', 1);
$limit = $this->get('limit', 10);
$uid = $this->getUid();
$yh_channel = Helpers::getChannelByCookie();
$uid=5687179;
$gender = Helpers::getGenderByCookie();
$guangInfo = \home\GuangModel::getMyGuang($uid, $page,$yh_channel,$gender, $limit);
$this->_view->display('my-guang', array('myGuang'=>$guangInfo));
$yh_channel = Helpers::getChannelByCookie();
$guangInfo = \home\GuangModel::getMyGuang($uid, $page, $yh_channel, $gender, $limit);
$totalPage = $guangInfo['totalPage'];
unset($guangInfo['totalPage']);
if ($page == 1)
{
$this->setTitle('我收藏的');
$this->setNavHeader('我收藏的', true, '');
$this->_view->display('my-guang', array('myGuangPage' => true, 'myGuang' => array('infos' => $guangInfo), 'pageFooter' => true));
}
else if ($page > 1 && $page<=$totalPage)
{
$this->_view->display('my-guang-partial', array('infos' => $guangInfo));
}
else if ($page > 1 && $page>$totalPage)
{
echo '';//退出循环
}
}
/**
... ... @@ -379,7 +411,8 @@ class HomeController extends AbstractAction
*/
public function savesuggestAction()
{
if ($this->isAjax()) {
if ($this->isAjax())
{
$uid = $this->getUid();
$content = $this->post('content', '');
$suggest_type = $this->get('suggest_type', 2);
... ... @@ -427,22 +460,25 @@ class HomeController extends AbstractAction
}
/*
* 我的订单页面
* 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders)
*/
public function orderAction()
{
//获得type值
//获得type值,type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论。
$type = $this->get('type', 1);
$this->setTitle('我的订单');
$this->setNavHeader('我的订单');
$data = OrderModel::getNavs($type);
if (!empty($data)) {
if (!empty($data))
{
$order['navs'] = $data;
} else {
}
else
{
$this->error();
}
//渲染模板
$this->_view->display('order', array(
'order' => $order,
'pageFooter' => true,
... ... @@ -454,7 +490,8 @@ class HomeController extends AbstractAction
public function getOrdersAction()
{
//判断是不是ajax请求
if (!$this->isAjax()) {
if (!$this->isAjax())
{
$this->error();
}
//获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论
... ... @@ -467,15 +504,24 @@ class HomeController extends AbstractAction
$uid = '10267443'; //测试用
//调用模型层getOrder方法获得并处理数据
$data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
//如果没有订单数据,就给一个随便逛逛链接
/* 如果取不到订单数据时,分两种情况:
1、page>1时,echo一个空格字符串到浏览器。
2、page=1时,就给一个随便逛逛的链接。
* */
$order = array();
if (!empty($data)) {
if (!empty($data))
{
$order['orders'] = $data;
} else {
if ($page > 1) {
}
else
{
if ($page > 1)
{
echo " ";
} else {
$order['walkwayUrl'] = 'http://www.baidu.com';
}
elseif ($page = 1)
{
$order['walkwayUrl'] = self::strollAction();
}
}
//渲染模板
... ... @@ -490,17 +536,20 @@ class HomeController extends AbstractAction
{
//判断是不是ajax请求
if (!$this->isAjax()) {
if (!$this->isAjax())
{
$this->error();
}
//传入order_code和uid以取消订单
$order_code = $this->get('orderCode');
$order_code = $this->get('id');
$uid = $this->getUid();
$uid = '10267443'; //测试用
$gender = Helpers::getGenderByCookie();
$yh_channel = $this->get('yh_channel', 1);
$method = 'app.SpaceOrders.close';
//调用取消订单接口,返回订单取消状态
$data = OrderData::cancelOrderData($order_code, $uid, $gender, $yh_channel, $method);
//将取消状态返回至浏览器
$this->echoJson($data);
}
... ... @@ -511,7 +560,8 @@ class HomeController extends AbstractAction
public function delOrderAction()
{
//判断是不是ajax请求
if (!$this->isAjax()) {
if (!$this->isAjax())
{
$this->error();
}
//传入order_code和uid以删除订单
... ... @@ -521,10 +571,37 @@ class HomeController extends AbstractAction
$gender = Helpers::getGenderByCookie();
$yh_channel = $this->get('yh_channel', 1);
$method = 'app.SpaceOrders.delOrderByCode';
//调用接口删除订单,并返回订单删除状态
$data = OrderData::deleteOrderData($order_code, $uid, $gender, $yh_channel, $method);
//将订单删除状态返回至浏览器
$this->echoJson($data);
}
/*
* 我的订单-支付链接获取
*/
private function paymentAction()
{
$gender = Helpers::getGenderByCookie();
$yh_channel = $this->get('yh_channel', 1);
OrderModel::payment($gender, $yh_channel);
}
/*
* 我的订单-随便逛逛链接获取
*/
private function strollAction()
{
//获取性别、频道数据
$gender = Helpers::getGenderByCookie();
$yh_channel = $this->get('yh_channel', 1);
//调用接口获取随便逛逛url地址,并return数据
$data = OrderModel::stroll($gender, $yh_channel);
return $data;
}
/**
* 订单详情页
*/
... ...
... ... @@ -13,68 +13,20 @@ class GuangModel
{
//获取我的逛列表
public static function getMyGuang($uid, $page,$yh_channel=1, $gender = '1,3', $limit = 10)
public static function getMyGuang($uid, $page, $yh_channel = 1, $gender = '1,3', $limit = 10)
{
$result = array();
//调用接口获取数据
$res = GuangData::getGuangInfo($uid, $page, $yh_channel,$gender, $limit);
$guangInfo = $res['data']['data'];
if ($guangInfo)
$res = GuangData::getGuangInfo($uid, $page, $yh_channel, $gender, $limit);
$result['totalPage']=intval($res['data']['totalPage']);
if (!empty($res['data']['data']))
{
foreach ($guangInfo as $k => $v)
foreach ($res['data']['data'] as $k => $v)
{
$result[$k]['id'] = $v['id'];
$result[$k]['author'] = $v['author'];
$tag = self::getTag(TRUE, intval($v['category_id']));
$result[$k]['url'] = $v['url'];
$result[$k]['img'] = $v['src'];
$result[$k]['title'] = $v['title'];
$result[$k]['text'] = $v['intro'];
$result[$k]['pageView'] = $v['views_num'];
$result[$k]['publish_time'] = $v['publish_time'];
$like = ($v['isPraise'] == "Y") ? true : false;
$collect = ($v['isFavor'] == "Y") ? true : false;
$result[$k]['like'] = array('isLiked' => $like, 'count' => $v['praise_num']);
$result[$k]['collect'] = array('isCollected' => $collect, 'url' => $v['url']);
$result[$k] += $tag;
$result[$k]['share'] = $v['url'];
$result[$k] = Helpers::formatArticle($v, true, false, true, $uid);
}
}
return $result;
}
//【标签】isTip-小贴士;isCollocation-搭配 isFashionMan-潮人 isFashionGood-潮品 isTopic-话题
private static function getTag($isShow, $tagId)
{
$ret['showTags'] = $isShow;
$ret['isTopic'] = false;
$ret['isCollocation'] = false;
$ret['isFashionMan'] = false;
$ret['isFashionGood'] = false;
$ret['isTip'] = false;
switch ($tagId)
{
case 1:
$ret['isTopic'] = true;
break;
case 2:
$ret['isCollocation'] = true;
break;
case 3:
$ret['isFashionMan'] = true;
break;
case 4:
$ret['isFashionGood'] = true;
break;
case 5:
$ret['isTip'] = true;
break;
default:
$ret['showTags'] = FALSE;
break;
}
return $ret;
}
}
... ...
... ... @@ -18,11 +18,16 @@ use Configs\CacheConfig;
*/
class OrderModel
{
/* 频道选择页取背景图片的位置码 */
const CODE_PAYMENT = '04cf5abaa7c20178325a07c4a833782c'; //支付订单资源码
const CODE_STROLL = 'a7989369aa86681c678bc40f171b8f1d'; //随便逛逛url地址资源码
/**
* 订单相关数据处理
*/
public function getOrder($type = 1, $page = 1, $limit, $gender, $yh_channel, $uid) {
static function getOrder($type = 1, $page = 1, $limit, $gender, $yh_channel, $uid) {
$result = array();
if (USE_CACHE) {
$key = CacheConfig::KEY_ACTION_HOME_ORDER_ORDER;
... ... @@ -37,32 +42,37 @@ class OrderModel
//检查数据返回是否正常,正常则处理数据
if ($data['code'] == 200 && isset($data['data'])) {
foreach ($data['data']['order_list'] as $key => $vo) {
//订单号,支付状态,订单商品数量,订单总价格
//订单号,支付状态,订单商品数量,订单总价格(订单总价加上运费)
$result[$key]['orderNum'] = $vo['order_code'];
$result[$key]['orderStatus'] = $vo['status_str'];
$result[$key]['count'] = count($vo['order_goods']);
$result[$key]['sumCost'] = $vo['amount'] + $vo['shipping_cost'];
//订单商品列表数据
//类内调用格式化订单商品数据方法
$result[$key]['goods'] = self::formatOrderGoods($vo['order_goods']);
//订单status判断订单处于什么状态。
//根据订单status判断订单处于什么状态。
do {
//订单取消状态
//订单取消状态 = Y 时,跳出判断订单状态循环,并设置订单状态为已取消。
if ($vo['is_cancel'] === 'Y') {
$result[$key]['canceled'] = true;
break;
}
//支付方式不是货到付款时,计算订单状态
/* 先判断订单付款方式,根据不同的付款方式计算订单状态。(注:货到付款没有待付款状态)
* 付款方式:1 => 在线支付,2 => 货到付款,3 => 现金支付,4 => 抵消支付;
*/
//支付方式为非货到付款时,计算订单状态。
if ($vo['payment_type'] != 2) {
switch ($vo['status']) {
case 0:
$result[$key]['unpaid'] = true;
break;
//未发货&未收货 状态,统一合并到待收货状态。
case 1:
case 2:
case 3:
case 4:
case 5:
$result[$key]['unreceived'] = true;
//待收货状态,给查看物流url
$result[$key]['logisticsUrl'] = "暂无logisticsUrl数据";
break;
case 6:
... ... @@ -72,11 +82,11 @@ class OrderModel
break;
}
} elseif ($vo['payment_type'] == 2) {
//订单为货到付款订单时,订单没有未支付状态
//订单为货到付款订单时,计算订单状态。(货到付款没有待付款状态)
switch ($vo['status']) {
case 0 || 1 || 2 || 3 || 4 || 5:
$result[$key]['unreceived'] = true;
//此处备注,接口没有返回logisticsUrl数据
//待收货状态,给查看物流url
$resault[$key]['logisticsUrl'] = "备注:暂无logisticsUrl数据";
break;
case 6:
... ... @@ -113,6 +123,7 @@ class OrderModel
$arr[$key]['size'] = $vo['size_name'];
$arr[$key]['price'] = $vo['goods_price'];
$arr[$key]['count'] = $vo['buy_number'];
//gift=>是否赠品,advanceBuy=>是否加价购;
if ($vo['goods_type'] == 'gift') {
$arr[$key]['gift'] = true;
} elseif ($vo['goods_type'] == 'price_gift') {
... ... @@ -123,7 +134,7 @@ class OrderModel
}
//根据type值设置nav属性
public function getNavs($type) {
static function getNavs($type) {
$nav = array(
array(
'name' => '全部',
... ... @@ -174,8 +185,29 @@ class OrderModel
}
return $nav;
}
//获得支付链接
static function payment($gender, $yh_channel) {
$code = self::CODE_PAYMENT;
$data = OrderData::paymentData($gender, $yh_channel, $code);
}
//查看物流
// static function Logistics(){
// OrderData::LogisticsData();
// }
//随便逛逛url获取
static function stroll($gender, $yh_channel) {
//获取随便逛逛url资源码
$code = self::CODE_STROLL;
//调用接口获得数据
$data = OrderData::strollData($gender, $yh_channel, $code);
$stroll = 1;
//检查数据返回是否正常,正常则处理数据
if ($data['code'] == 200) {
$strollUrl = $data['data'][0]['data'][0]['url'];
}
return $strollUrl;
}
}
... ...