Authored by uedxwg

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

@@ -955,7 +955,7 @@ @@ -955,7 +955,7 @@
955 //订单 955 //订单
956 { 956 {
957 orderNum: '', 957 orderNum: '',
958 - tradingStatus: '', 958 + orderStatus: '',
959 goods: [ 959 goods: [
960 { 960 {
961 id: '', 961 id: '',
@@ -974,9 +974,52 @@ @@ -974,9 +974,52 @@
974 sumCost: '199.00', 974 sumCost: '199.00',
975 //status 975 //status
976 completed: true, //已完成 976 completed: true, //已完成
  977 + canceled: true, //已取消
977 unpaid: true, //or 未支付 978 unpaid: true, //or 未支付
978 - unshipped: true, //or 未发货  
979 - unreceived: '', //or 未收货,查看物流URL 979 + unreceived: '', //or 待收货(未发货/未收货),查看物流URL
  980 +
  981 + //待收货时传递物流参数
  982 + logisticsUrl: ''
  983 +
  984 + }
  985 +
  986 +### 订单详情页
  987 +
  988 + {
  989 + orderDetail: {
  990 + orderNum: '', //订单号
  991 +
  992 + name: '', //收货人姓名
  993 + phoneNum: '',
  994 + address: '',
  995 +
  996 + orderStatus: '订单成功', //订单取消...等订单状态
  997 + orderNum: '',
  998 + orderTime: '',
  999 +
  1000 + //订单状态
  1001 + canceled: true, //是否是取消的订单
  1002 + completed: true, //是否是已完成订单
  1003 + unpaid: true, //是否是未支付订单
  1004 + unreceived: true, //是否是未收货订单
  1005 +
  1006 + //如果是待收货(未发货和未收货),传物流信息参数
  1007 + logisticsUrl: '',
  1008 + logisticsCompany: '',
  1009 + logisticsNum: '',
  1010 + //end
  1011 +
  1012 + goods: [
  1013 + {
  1014 + ... //订单商品
  1015 + }
  1016 + ],
  1017 + sumPrice: '',
  1018 + salePrice: '',
  1019 + freight: '',
  1020 + yohoCoin: '',
  1021 + price: ''
  1022 + }
980 } 1023 }
981 1024
982 ### YOHO币 1025 ### YOHO币
  1 +<?php
  2 +
  3 +namespace LibModels\Wap\Home;
  4 +
  5 +use Api\Sign;
  6 +use Api\Yohobuy;
  7 +
  8 +/**
  9 + * 在线客服数据模型
  10 + *
  11 + * @name OnlineData
  12 + * @package LibModels/Wap/Home
  13 + * @copyright yoho.inc
  14 + * @version 1.0 (2015-11-13)
  15 + * @author xiaowei
  16 + */
  17 +class OnlineData
  18 +{
  19 + const ONLINE_URI = 'operations/api/v1/help/';
  20 +
  21 + //获取帮助列表(分类)
  22 + public static function getOnlineServiceInfo($clientType='iphone')
  23 + {
  24 + return Yohobuy::get(Yohobuy::SERVICE_URL .self::ONLINE_URI.'getCategory', array('client_type'=>$clientType));
  25 + }
  26 +
  27 + //获取问题详情
  28 + public static function getOnlineServiceDetail($cateId, $clientType = 'iphone')
  29 + {
  30 + return Yohobuy::get(Yohobuy::SERVICE_URL .self::ONLINE_URI.'getHelp', array('category_id'=>$cateId,'client_type'=>$clientType));
  31 + }
  32 +
  33 +}
@@ -161,7 +161,7 @@ class UserData @@ -161,7 +161,7 @@ class UserData
161 public static function couponData($uid, $status, $page = 1, $limit = 10) 161 public static function couponData($uid, $status, $page = 1, $limit = 10)
162 { 162 {
163 $param = Yohobuy::param(); 163 $param = Yohobuy::param();
164 - $param['method'] = 'app.yohocoin.lists'; 164 + $param['method'] = 'app.coupons.li';
165 $param['uid'] = $uid; 165 $param['uid'] = $uid;
166 $param['status'] = $status; 166 $param['status'] = $status;
167 $param['page'] = $page; 167 $param['page'] = $page;
@@ -188,6 +188,76 @@ class UserData @@ -188,6 +188,76 @@ class UserData
188 } 188 }
189 189
190 /** 190 /**
  191 + * 获取三级地址列表数据
  192 + *
  193 + * @param int $uid 用户ID
  194 + * @return array 地址接口返回的数据
  195 + */
  196 + public static function addressListData($uid)
  197 + {
  198 + $param = Yohobuy::param();
  199 + $param['method'] = 'app.address.getlist';
  200 + $param['uid'] = $uid;
  201 + $param['client_secret'] = Sign::getSign($param);
  202 +
  203 + return Yohobuy::get(Yohobuy::API_URL, $param);
  204 + }
  205 +
  206 + /**
  207 + * 保存地址数据
  208 + *
  209 + * @param int $uid 用户ID
  210 + * @param string $address 地址信息
  211 + * @param int $area_code 城市码
  212 + * @param string $consignee 收货人
  213 + * @param string $email 邮箱地址
  214 + * @param int $id 地址唯一标识符id
  215 + * @param string $mobile 手机号码
  216 + * @param string $zip_code 邮编
  217 + * @return array 地址接口返回的数据
  218 + */
  219 + public static function saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code)
  220 + {
  221 + $param = Yohobuy::param();
  222 + $param['address'] = $address;
  223 + $param['area_code'] = $area_code;
  224 + $param['consignee'] = $consignee;
  225 + $param['email'] = $email;
  226 +
  227 + if ($id !== null) { // 修改
  228 + $param['id'] = $id;
  229 + $param['method'] = 'app.address.update';
  230 + } else { // 添加
  231 + $param['method'] = 'app.address.add';
  232 + }
  233 +
  234 + $param['mobile'] = $mobile;
  235 + $param['zip_code'] = $zip_code;
  236 + $param['uid'] = $uid;
  237 + $param['client_secret'] = Sign::getSign($param);
  238 +
  239 + return Yohobuy::get(Yohobuy::API_URL, $param);
  240 + }
  241 +
  242 + /**
  243 + * 设置默认地址
  244 + *
  245 + * @param int $uid 用户ID
  246 + * @param int $id 地址唯一标识符id
  247 + * @return array 接口返回的数据
  248 + */
  249 + public static function setDefaultAddress($uid, $id)
  250 + {
  251 + $param = Yohobuy::param();
  252 + $param['id'] = $id;
  253 + $param['method'] = 'app.address.setdefault';
  254 + $param['uid'] = $uid;
  255 + $param['client_secret'] = Sign::getSign($param);
  256 +
  257 + return Yohobuy::get(Yohobuy::API_URL, $param);
  258 + }
  259 +
  260 + /**
191 * 意见反馈数据 261 * 意见反馈数据
192 * 262 *
193 * @param string $udid 客户端唯一标识 263 * @param string $udid 客户端唯一标识
No preview for this file type
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > 2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3 <svg xmlns="http://www.w3.org/2000/svg"> 3 <svg xmlns="http://www.w3.org/2000/svg">
4 <metadata> 4 <metadata>
5 -Created by FontForge 20120731 at Thu Nov 12 16:17:15 2015 5 +Created by FontForge 20120731 at Mon Nov 16 11:40:15 2015
6 By Ads 6 By Ads
7 </metadata> 7 </metadata>
8 <defs> 8 <defs>
@@ -19,7 +19,7 @@ Created by FontForge 20120731 at Thu Nov 12 16:17:15 2015 @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Thu Nov 12 16:17:15 2015
19 bbox="-0.75 -224 3943 812.871" 19 bbox="-0.75 -224 3943 812.871"
20 underline-thickness="50" 20 underline-thickness="50"
21 underline-position="-100" 21 underline-position="-100"
22 - unicode-range="U+0078-E62F" 22 + unicode-range="U+0078-E632"
23 /> 23 />
24 <missing-glyph horiz-adv-x="374" 24 <missing-glyph horiz-adv-x="374"
25 d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" /> 25 d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
@@ -179,5 +179,22 @@ q0 -66 47 -112.5t113.5 -46.5t113.5 46.5t47 112.5z" /> @@ -179,5 +179,22 @@ q0 -66 47 -112.5t113.5 -46.5t113.5 46.5t47 112.5z" />
179 d="M474 28v161h-167v50h167v74h-167v49h134l-168 265h87l152 -257v386q-48 0 -96.5 4t-83.5 10.5t-63.5 12.5t-42.5 10l-14 4q-2 -43 -16.5 -74t-34 -44t-38.5 -20t-33 -7h-13q0 -110 10.5 -203.5t20.5 -131.5l10 -38q15 -61 45 -120.5t65.5 -105.5t75.5 -87.5t76 -70.5 179 d="M474 28v161h-167v50h167v74h-167v49h134l-168 265h87l152 -257v386q-48 0 -96.5 4t-83.5 10.5t-63.5 12.5t-42.5 10l-14 4q-2 -43 -16.5 -74t-34 -44t-38.5 -20t-33 -7h-13q0 -110 10.5 -203.5t20.5 -131.5l10 -38q15 -61 45 -120.5t65.5 -105.5t75.5 -87.5t76 -70.5
180 t66.5 -50.5t47.5 -31.5t18 -10v225h-38zM550 28v161h167v50h-167v74h167v49h-134l168 265h-87l-152 -257v386q35 0 70.5 2t64 6t55.5 8.5t46.5 8.5t34 8t22.5 6l7 2q2 -43 16.5 -74t34 -44t38.5 -20t33 -7h13q0 -110 -10.5 -203.5t-20.5 -131.5l-10 -38q-15 -61 -45 -120.5 180 t66.5 -50.5t47.5 -31.5t18 -10v225h-38zM550 28v161h167v50h-167v74h167v49h-134l168 265h-87l-152 -257v386q35 0 70.5 2t64 6t55.5 8.5t46.5 8.5t34 8t22.5 6l7 2q2 -43 16.5 -74t34 -44t38.5 -20t33 -7h13q0 -110 -10.5 -203.5t-20.5 -131.5l-10 -38q-15 -61 -45 -120.5
181 t-65.5 -105.5t-75.5 -87.5t-76 -70.5t-66.5 -50.5t-47.5 -31.5t-18 -10v225h38z" /> 181 t-65.5 -105.5t-75.5 -87.5t-76 -70.5t-66.5 -50.5t-47.5 -31.5t-18 -10v225h38z" />
  182 + <glyph glyph-name="uniE630" unicode="&#xe630;"
  183 +d="M629 -71h-268v20q0 31 -21.5 53t-52.5 22t-52.5 -22t-21.5 -53v-20h-174v609h590v-609zM400 -30h188v527h-508v-527h94q7 41 39 68t74 27t74 -27t39 -68zM989 -71h-136v20q0 21 -10 38t-27 27t-37 10q-31 0 -52.5 -22t-21.5 -53v-20h-117v476h210q22 0 57 -34
  184 +q27 -26 58 -67q31 -40 52 -75q14 -25 19 -39t5 -23v-238zM892 -30h56v197q0 9 -18 40t-46 68q-7 9 -14 17.5t-13.5 16.5t-13 15t-12.5 14q-10 9 -18 16t-11 8.5t-5 1.5h-168v-394h37q7 41 39 68t74 27q28 0 52 -12.5t40.5 -34t20.5 -48.5zM989 137h-287v193h191l6 -8
  185 +q35 -43 61 -84q29 -48 29 -71v-30zM743 178h202q-6 15 -21 39q-21 34 -50 72h-131v-111zM779.5 -166q-47.5 0 -81.5 34t-34 81.5t34 81.5t81 34q24 0 45 -9.5t36.5 -25t24.5 -36.5t9 -45q0 -47 -33.5 -81t-81 -34zM779 24q-31 0 -52.5 -22t-21.5 -53q0 -15 6 -28.5t16 -23.5
  186 +t23.5 -16t28.5 -6q12 0 23.5 4t20.5 10.5t16 16t10.5 20.5t3.5 23q0 21 -10 38t-27 27t-37 10zM287 -166q-48 0 -81.5 34t-33.5 81.5t33.5 81.5t81.5 34t81.5 -34t33.5 -81.5t-33.5 -81.5t-81.5 -34zM287 24q-31 0 -52.5 -22t-21.5 -52.5t21.5 -52.5t52.5 -22t52.5 22
  187 +t21.5 52.5t-21.5 52.5t-52.5 22z" />
  188 + <glyph glyph-name="uniE631" unicode="&#xe631;"
  189 +d="M24 799zM47 799zM70 799zM94 799zM117 799zM140 799zM163 799zM187 799zM210 799zM233 799zM256 799zM280 799zM303 799zM326 799zM349 799zM373 799zM396 799zM419 799zM442 799zM466 799zM489 799zM512 799zM535 799zM558 799zM582 799zM605 799zM628 799zM651 799z
  190 +M675 799zM698 799zM721 799zM744 799zM768 799zM791 799zM814 799zM837 799zM861 799zM884 799zM907 799zM930 799zM954 799zM977 799zM1000 799zM1 776zM1 753zM1 730zM1 706zM1 683zM1 660zM1 637zM1 613zM1 590zM1 567zM1 544zM1 520zM1 497zM1 474zM1 451zM1 427zM1 404
  191 +zM1 381zM1 358zM1 334zM1 311zM1 288zM1 265zM1 242zM1 218zM1 195zM1 172zM1 149zM1 125zM1 102zM1 79zM1 56zM1 32zM1 9zM1 -14zM1 -37zM1 -61zM1 -84zM1 -107zM1 -130zM1 -154zM1 -177zM1 -200zM512 -223q-7 8 -18.5 22t-45.5 59t-64.5 91t-68 113.5t-64.5 131.5
  192 +t-45.5 139t-18.5 141q0 52 11 96.5t30 75.5t43 56.5t51 41t54 27t51.5 17t43.5 8.5t30 3h11q7 0 18.5 -0.5t45.5 -7t64.5 -17.5t68 -35.5t64.5 -57.5t45.5 -87t18.5 -120t-18 -140.5t-46.5 -140.5t-63 -130t-69.5 -114.5t-63.5 -90t-46.5 -60.5zM740 517q-16 85 -86 140
  193 +q-1 1 -4 3.5t-5 3.5q-5 4 -22 13l-4 2q-2 1 -3.5 2t-3.5 2l-4 2l-4 2q-1 0 -20 7q-2 0 -7.5 2t-9 3.5t-7.5 1.5q-24 5 -48 5v0q-24 0 -47 -5q-15 -3 -29.5 -8t-27.5 -11.5t-25 -14.5h-1q-12 -9 -27 -23q-2 -1 -5 -4l-3 -3q-2 -2 -4.5 -5t-4 -4.5t-4 -5t-3.5 -4.5
  194 +q-12 -16 -13 -17q-2 -3 -4.5 -7.5t-3.5 -5.5q0 -1 -1 -2q-2 -4 -3 -6.5t-3 -6t-3.5 -6.5t-2.5 -6q-1 -2 -2 -7q-1 -3 -2 -4q-7 -21 -9 -32q-4 -22 -4 -44q0 -183 175 -470l57 -88q9 13 25 36.5t56 92t70.5 133.5t55.5 148t25 148q0 11 -1 21.5t-3 21.5zM373 474
  195 +q0 58 40.5 98.5t98.5 40.5t98.5 -40.5t40.5 -98.5t-40.5 -99t-98.5 -41q-28 0 -54 11.5t-44.5 30t-29.5 44.5t-11 54z" />
  196 + <glyph glyph-name="uniE632" unicode="&#xe632;"
  197 +d="M313 163h397v69h-397v-69zM313 26h397v68h-397v-68zM611 747h-430q-4 0 -7 -0.5t-6 -2t-6 -3.5t-5 -4t-4 -5t-3 -6t-1.5 -6.5t-0.5 -6.5v-825q0 -5 1.5 -10.5t4.5 -9.5t7 -7.5t9 -5t11 -1.5h661q9 0 17 4.5t12.5 12.5t4.5 17v619zM644 626l131 -119h-131v119zM809 -77
  198 +h-595v755h364v-206q0 -14 9.5 -24t23.5 -10h198v-515zM313 300h397v69h-397v-69z" />
182 </font> 199 </font>
183 </defs></svg> 200 </defs></svg>
No preview for this file type
No preview for this file type
@@ -5,6 +5,8 @@ @@ -5,6 +5,8 @@
5 */ 5 */
6 6
7 require('./order'); 7 require('./order');
  8 +require('./order-detail');
8 require('./fav'); 9 require('./fav');
9 require('./index'); 10 require('./index');
10 -require('./coupons');  
  11 +require('./coupons');
  12 +require('./online-service');
@@ -4,12 +4,4 @@ @@ -4,12 +4,4 @@
4 * @date: 2015/11/12 4 * @date: 2015/11/12
5 */ 5 */
6 6
7 -var Swiper = require('yoho.iswiper');  
8 -  
9 -var recommendSwiper;  
10 -  
11 -recommendSwiper = new Swiper('.swiper-recommend', {  
12 - lazyLoading: true,  
13 - lazyLoadingInPrevNext: true,  
14 - slidesPerView: 'auto'  
15 -});  
  7 +require('../product/recommend-for-you.js');
  1 +/**
  2 + * 在线客服
  3 + * @author: bikai<kai.bi@yoho.cn>
  4 + * @date: 2015/11/16
  5 + */
  6 +var $ = require('jquery');
  7 +
  8 +var $questionTab = $('.question-tab .tab-item');
  9 +
  10 +$questionTab.on('touchend', function() {
  11 + var clickTab = $(this).data('tab');
  12 +
  13 + clickTab = '[data-tab-name="' + clickTab + '"]';
  14 +
  15 + $questionTab.removeClass('current');
  16 + $(this).addClass('current');
  17 +
  18 + $('.question-list').removeClass('current');
  19 + $(clickTab).addClass('current');
  20 +});
  1 +/**
  2 + * 订单详情页
  3 + * @author: xuqi<qi.xu@yoho.cn>
  4 + * @date: 2015/11/16
  5 + */
  6 +
  7 +var $ = require('jquery'),
  8 + lazyLoad = require('yoho.lazyload'),
  9 + Hammer = require('yoho.hammer');
  10 +
  11 +var orderId = $('#order-detail').data('id');
  12 +
  13 +var optHammer;
  14 +
  15 +lazyLoad();
  16 +
  17 +//订单删除
  18 +optHammer = new Hammer(document.getElementsByClassName('opt')[0]);
  19 +optHammer.on('tap', function(e) {
  20 + var $cur = $(e.target);
  21 +
  22 + if ($cur.hasClass('btn-del')) {
  23 +
  24 + //删除订单
  25 + if (confirm('确定删除订单吗?')) {
  26 + $.ajax({
  27 + type: 'GET',
  28 + url: '/home/delOrder',
  29 + data: {
  30 + id: orderId
  31 + }
  32 + });
  33 + }
  34 + } else if ($cur.hasClass('btn-cancel')) {
  35 +
  36 + //取消订单
  37 + if (confirm('确定取消订单吗?')) {
  38 + $.ajax({
  39 + type: 'GET',
  40 + url: '/home/cancelOrder',
  41 + data: {
  42 + id: orderId
  43 + }
  44 + });
  45 + }
  46 + }
  47 +});
  1 +/**
  2 + * 为您优选
  3 + * @author: bikai<kai.bi@yoho.cn>
  4 + * @date: 2015/11/16
  5 + */
  6 +
  7 +
  8 +var Swiper = require('yoho.iswiper');
  9 +
  10 +var recommendSwiper;
  11 +
  12 +recommendSwiper = new Swiper('.swiper-recommend', {
  13 +
  14 + // lazyLoading: true,
  15 + // lazyLoadingInPrevNext: true,
  16 + slidesPerView: 'auto'
  17 +});
1 -@import "home", "vip-grade", "order", "coupons", "personal-details", "yoho-coin", "recommend-for-you", "fav", "suggest", "address";  
  1 +@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service";
  2 +
  1 +@function rem($n) {
  2 + @return $n / 40 * 1rem;
  3 +}
  4 +
  5 +.online-service-page{
  6 + background: #f0f0f0;
  7 +
  8 + .question {
  9 + background: #fff;
  10 + }
  11 +
  12 + .question-title {
  13 + padding: rem(20) rem(30);
  14 + font-size: rem(28);
  15 + line-height: 1;
  16 + color: #b0b0b0;
  17 + }
  18 +
  19 + .question-tab {
  20 + padding: rem(10) rem(30) rem(30);
  21 + font-size: rem(32);
  22 + line-height: rem(58);
  23 + text-align: center;
  24 + color: #b0b0b0;
  25 +
  26 + .current {
  27 + color: #444;
  28 + }
  29 +
  30 + .line {
  31 + margin: 0 rem(32);
  32 + border-left: 1px solid #b0b0b0;
  33 + }
  34 + }
  35 +
  36 + .question-list {
  37 + display: none;
  38 + border-top: 1px solid #ccc;
  39 + border-bottom: 1px solid #ccc;
  40 +
  41 + &.current {
  42 + display: block;
  43 + }
  44 +
  45 + li {
  46 + margin-left: rem(30);
  47 + width: rem(610);
  48 + font-size: rem(28);
  49 + line-height: rem(90);
  50 + border-bottom: 1px solid #ccc;
  51 +
  52 + a {
  53 + display: block;
  54 + color: #444;
  55 + }
  56 +
  57 + .iconfont {
  58 + float: right;
  59 + margin-right: rem(30);
  60 + color: #ccc;
  61 + }
  62 +
  63 + &:last-child {
  64 + border-bottom: none;
  65 + }
  66 + }
  67 + }
  68 +
  69 + .connect-info {
  70 + margin-top: 30px;
  71 + font-size: rem(28);
  72 + line-height: rem(50);
  73 + background: #fff;
  74 + border-top: 1px solid #ccc;
  75 + border-bottom: 1px solid #ccc;
  76 +
  77 + p {
  78 + margin-top: rem(25);
  79 + margin-left: rem(-72);
  80 + line-height: 1.5;
  81 + }
  82 +
  83 + .icon-yoho-enter {
  84 + color: #ccc;
  85 + float: right;
  86 + }
  87 + .connect-item {
  88 + position: relative;
  89 + a {
  90 + display: block;
  91 + padding: rem(20) rem(30) rem(20) rem(94);
  92 + color: #444;
  93 + }
  94 + &:after {
  95 + content: '';
  96 + position: absolute;
  97 + right: 0;
  98 + bottom: 0;
  99 + width: rem(548);
  100 + height: 1px;
  101 + background: #ccc;
  102 + }
  103 + &:last-child {
  104 + &:after {
  105 + content: none;
  106 + }
  107 + }
  108 + }
  109 + .icon {
  110 + display: inline-block;
  111 + margin-right: rem(28);
  112 + margin-left: rem(-70);
  113 + vertical-align:middle;
  114 + }
  115 + }
  116 +}
  117 +
  118 +.online-service-detail-page {
  119 + background: #f0f0f0;
  120 +
  121 + .qa-list {
  122 + .question-item {
  123 + margin-bottom: rem(32);
  124 + border-top: 1px solid #c8c7cc;
  125 + border-bottom: 1px solid #c8c7cc;
  126 + color: #444;
  127 + background: #fff;
  128 + &:last-child {
  129 + margin-bottom: 0;
  130 + }
  131 + }
  132 + %qa {
  133 + margin-left: rem(30);
  134 + padding: 0 rem(40) 0 rem(10);
  135 + font-size: rem(30);
  136 + line-height: rem(76);
  137 + font-weight: bold;
  138 + }
  139 + .question {
  140 + @extend %qa;
  141 + position: relative;
  142 + &:after {
  143 + content: '';
  144 + position: absolute;
  145 + left: 0;
  146 + bottom: 0;
  147 + width: 100%;
  148 + border-top: 1px solid #c8c7cc;
  149 + }
  150 + }
  151 + .answer {
  152 + @extend %qa;
  153 + }
  154 + }
  155 +}
  1 +.order-detail-page {
  2 + background: #f0f0f0;
  3 +
  4 + .block {
  5 + position: relative;
  6 + background: #fff;
  7 + padding: 20rem / $pxConvertRem 30rem / $pxConvertRem;
  8 +
  9 + .iconfont {
  10 + position: absolute;
  11 + left: 30rem / $pxConvertRem;
  12 + top: 50%;
  13 + font-size: 40rem / $pxConvertRem;
  14 + margin-top: -30rem / $pxConvertRem;
  15 + }
  16 + }
  17 +
  18 + .sub {
  19 + position: relative;
  20 +
  21 + .iconfont {
  22 + left: 0;
  23 + }
  24 + }
  25 +
  26 + .logistics {
  27 + display: block;
  28 +
  29 + .icon-right {
  30 + right: 25rem / $pxConvertRem;
  31 + left: auto;
  32 + color: #b0b0b0;
  33 + }
  34 +
  35 + .sub-content {
  36 + border-top: 1px solid #e0e0e0;
  37 + margin-top: 20rem / $pxConvertRem;
  38 + padding-top: 20rem / $pxConvertRem;
  39 + }
  40 + }
  41 +
  42 + .owner-info {
  43 + border-bottom: 1px solid #e0e0e0;
  44 + line-height: 1.5;
  45 + }
  46 +
  47 + .beside-icon {
  48 + margin-left: 60rem / $pxConvertRem;
  49 + }
  50 +
  51 + .name-phone {
  52 + font-size: 30rem / $pxConvertRem;
  53 +
  54 + span {
  55 + float: right;
  56 + }
  57 + }
  58 +
  59 + .address {
  60 + font-size: 24rem / $pxConvertRem;
  61 + margin-top: 10rem / $pxConvertRem;
  62 + }
  63 +
  64 + .order-status {
  65 + margin: 20rem / $pxConvertRem 0;
  66 + border-top: 1px solid #e0e0e0;
  67 + border-bottom: 1px solid #e0e0e0;
  68 + padding-right: 0;
  69 + }
  70 +
  71 + .sub-content span {
  72 + display: block;
  73 + color: #b0b0b0;
  74 + font-size: 24rem / $pxConvertRem;
  75 + }
  76 +
  77 + .sub-content .sub-title {
  78 + display: block;
  79 + color: #000;
  80 + font-size: 26rem / $pxConvertRem;
  81 + }
  82 +
  83 + .goods {
  84 + padding: 0;
  85 + margin-top: 20rem / $pxConvertRem;
  86 + border-top: 1px solid #e0e0e0;
  87 + border-bottom: 1px solid #e0e0e0;
  88 + }
  89 +
  90 + .cost {
  91 + margin-bottom: 100rem / $pxConvertRem; /*排除被固定底部遮挡的影响*/
  92 +
  93 + li {
  94 + font-size: 28rem / $pxConvertRem;
  95 +
  96 + span {
  97 + float: right;
  98 + }
  99 +
  100 + &:last-child span {
  101 + color: #f00;
  102 + }
  103 + }
  104 + }
  105 +
  106 + .opt {
  107 + position: fixed;
  108 + bottom: 0;
  109 + left: 0;
  110 + right: 0;
  111 + text-align: right;
  112 + border-top: 1px solid #e0e0e0;
  113 + }
  114 +
  115 + .btn {
  116 + display: inline-block;
  117 + box-sizing: border-box;
  118 + width: 140rem / $pxConvertRem;
  119 + height: 60rem / $pxConvertRem;
  120 + line-height: 60rem / $pxConvertRem;
  121 + @include border-radius(5px);
  122 + font-size: 26rem / $pxConvertRem;
  123 + text-align: center;
  124 + border: 1px solid #000;
  125 + }
  126 +
  127 + .btn-pay {
  128 + color: #fff;
  129 + border: none;
  130 + background: #d0021b;
  131 + margin-left: 10rem / $pxConvertRem;
  132 + }
  133 +}
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 border-bottom: 1px solid #e0e0e0; 18 border-bottom: 1px solid #e0e0e0;
19 } 19 }
20 20
21 - .trading-status { 21 + .order-status {
22 float: right; 22 float: right;
23 } 23 }
24 24
@@ -45,15 +45,13 @@ @@ -45,15 +45,13 @@
45 width: 140rem / $pxConvertRem; 45 width: 140rem / $pxConvertRem;
46 font-size: 24rem / $pxConvertRem; 46 font-size: 24rem / $pxConvertRem;
47 text-align: center; 47 text-align: center;
48 - }  
49 -  
50 - .cancel {  
51 border: 1px solid #000; 48 border: 1px solid #000;
52 } 49 }
53 50
54 .pay { 51 .pay {
55 background: #d0021b; 52 background: #d0021b;
56 color: #fff; 53 color: #fff;
  54 + border: none;
57 margin-left: 20rem / $pxConvertRem; 55 margin-left: 20rem / $pxConvertRem;
58 } 56 }
59 } 57 }
1 -@import "new-arrival", "discount", "list", "detail", "suspend-cart", "hot-rank";  
  1 +@import "new-arrival", "discount", "list", "detail", "suspend-cart", "hot-rank", "_recommend-for-you.scss";
@@ -87,6 +87,6 @@ @@ -87,6 +87,6 @@
87 </div> 87 </div>
88 </div> 88 </div>
89 89
90 - {{> me/recommend-for-you}} 90 + {{> product/recommend-for-you}}
91 </div> 91 </div>
92 {{> layout/footer}} 92 {{> layout/footer}}
1 {{> layout/header}} 1 {{> layout/header}}
2 <div class="online-service-page yoho-page"> 2 <div class="online-service-page yoho-page">
3 - <form class="question-search">  
4 -  
5 - </form>  
6 - <ul class="question-list">  
7 - <li class="question-item">  
8 - 问题问  
9 - <span class="iconfont">&#xe604;</span>  
10 - </li>  
11 - <li class="question-item">  
12 - 问题问  
13 - <span class="iconfont">&#xe604;</span>  
14 - </li>  
15 - <li class="question-item">  
16 - 问题问  
17 - <span class="iconfont">&#xe604;</span>  
18 - </li>  
19 - </ul> 3 + {{# service}}
  4 + <div class="question">
  5 + <div class="question-title">问题查询</div>
  6 + <div class="question-tab">
  7 + {{#tab}}
  8 + <span class="tab-item {{#current}}current{{/current}}" data-tab="{{tabid}}">{{tabname}}</span>
  9 + {{#iscut}}<span class="line"></span>{{/iscut}}
  10 + {{/tab}}
  11 + </div>
  12 + {{#question}}
  13 + <ul class="question-list {{#current}}current{{/current}}" data-tab-name="{{name}}">
  14 + {{#list}}
  15 + <li class="question-item">
  16 + <a href="{{link}}" title="{{title}}">
  17 + {{title}}
  18 + <span class="iconfont icon-yoho-enter">&#xe604;</span>
  19 + </a>
  20 + </li>
  21 + {{/list}}
  22 + </ul>
  23 + {{/question}}
  24 + </div>
  25 + {{/ service}}
  26 + <div class="connect-info">
  27 + <div class="connect-item connect-online">
  28 + <a href="http://chat80.live800.com/live800/chatClient/chatbox.jsp?companyID=493979&amp;configID=123576&amp;jid=9277320930" target="_blank" title="在线客服">
  29 + <span class="icon iconfont icon-chat">&#xe620;</span>
  30 + 在线客服
  31 + <span class="iconfont icon-yoho-enter">&#xe604;</span>
  32 + </a>
  33 + </div>
  34 + <div class="connect-item connect-tel">
  35 + <a href="tel:400-889-9649" title="电话客服">
  36 + <span class="icon iconfont icon-tel">&#xe620;</span>
  37 + 电话客服
  38 + <p>
  39 + 400-889-9649 &nbsp;&nbsp; 09:00 - 22:30 &nbsp; (周一至周日)
  40 + </p>
  41 + </a>
  42 +
  43 + </div>
  44 + </div>
20 </div> 45 </div>
21 {{> layout/footer}} 46 {{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="online-service-detail-page yoho-page">
  3 + <div class="qa-list">
  4 + {{# list}}
  5 + <div class="question-item">
  6 + <div class="question">Q:{{q}}</div>
  7 + <div class="answer">{{a}}</div>
  8 + </div>
  9 + {{/ list}}
  10 + </div>
  11 +</div>
  12 +{{> layout/footer}}
  1 +{{> layout/header}}
  2 +<div class="order-detail-page yoho-page">
  3 + {{# orderDetail}}
  4 + <div id="order-detail" data-id="{{orderNum}}">
  5 + <section class="owner-info block">
  6 + <span class="iconfont">&#xe631;</span>
  7 + <div class="beside-icon">
  8 + <p class="name-phone">
  9 + {{name}}
  10 + <span>{{phoneNum}}</span>
  11 + </p>
  12 + <p class="address">
  13 + {{address}}
  14 + </p>
  15 + </div>
  16 + </section>
  17 +
  18 + <section class="order-status block">
  19 + <div class="status sub">
  20 + <span class="iconfont">&#xe632;</span>
  21 + <p class="beside-icon sub-content">
  22 + <span class="sub-title">{{orderStatus}}</span>
  23 + <span>订单编号:{{orderNum}}</span>
  24 + <span>下单时间:{{orderTime}}</span>
  25 + </p>
  26 + </div>
  27 + {{#if unreceived}}
  28 + <a class="logistics sub" href="{{logisticsUrl}}">
  29 + <span class="iconfont">&#xe630;</span>
  30 + <p class="beside-icon sub-content">
  31 + <span class="sub-title">物流信息</span>
  32 + <span>物流公司:{{logisticsCompany}}</span>
  33 + <span>快递单号:{{logisticsNum}}</span>
  34 + </p>
  35 + <span class="iconfont icon-right">&#xe614;</span>
  36 + </a>
  37 + {{/if}}
  38 + </section>
  39 +
  40 + <section class="goods block">
  41 + {{# goods}}
  42 + {{> me/order/good}}
  43 + {{/ goods}}
  44 + </section>
  45 +
  46 + <ul class="cost block">
  47 + <li>
  48 + 商品总金额
  49 + <span>¥{{sumPrice}}</span>
  50 + </li>
  51 + <li>
  52 + 活动金额
  53 + <span>-¥{{salePrice}}</span>
  54 + </li>
  55 + <li>
  56 + 运费
  57 + <span>+¥{{freight}}</span>
  58 + </li>
  59 + <li>
  60 + YOHO币
  61 + <span>-¥{{yohoCoin}}</span>
  62 + </li>
  63 + <li>
  64 + 实付金额
  65 + <span>¥{{price}}</span>
  66 + </li>
  67 + </ul>
  68 +
  69 + <div class="opt block">
  70 + {{#unless unreceived}}
  71 + {{#unless unpaid}}
  72 + <span class="btn btn-del">删除订单</span>
  73 + {{/unless}}
  74 + {{/unless}}
  75 +
  76 + {{#if unpaid}}
  77 + <span class="btn btn-cancel">取消订单</span>
  78 + <a href="{{payUrl}}">
  79 + <span class="btn btn-pay">立即付款</span>
  80 + </a>
  81 + {{/if}}
  82 +
  83 + {{#if unreceived}}
  84 + <a href="{{logisticsUrl}}">
  85 + <span class="btn btn-check-logistics">查看物流</span>
  86 + </a>
  87 + {{/if}}
  88 + </div>
  89 + </div>
  90 + {{/ orderDetail}}
  91 +</div>
  92 +{{> layout/footer}}
@@ -201,7 +201,6 @@ @@ -201,7 +201,6 @@
201 </script> 201 </script>
202 {{/if}} 202 {{/if}}
203 {{!-- 个人中心 --}} 203 {{!-- 个人中心 --}}
204 -{{!-- 个人中心首页 --}}  
205 {{#if myIndexPage}} 204 {{#if myIndexPage}}
206 <script> 205 <script>
207 seajs.use('js/me/index'); 206 seajs.use('js/me/index');
@@ -212,16 +211,23 @@ @@ -212,16 +211,23 @@
212 seajs.use('js/me/order'); 211 seajs.use('js/me/order');
213 </script> 212 </script>
214 {{/if}} 213 {{/if}}
215 -  
216 -{{!-- 个人中心: 商品收藏&品牌收藏 --}} 214 +{{#if orderDetailPage}}
  215 +<script>
  216 + seajs.use('js/me/order-detail');
  217 +</script>
  218 +{{/if}}
217 {{#if favPage}} 219 {{#if favPage}}
218 <script> 220 <script>
219 seajs.use('js/me/fav'); 221 seajs.use('js/me/fav');
220 </script> 222 </script>
221 {{/if}} 223 {{/if}}
222 -  
223 {{#if couponsPage}} 224 {{#if couponsPage}}
224 <script> 225 <script>
225 seajs.use('js/me/coupons'); 226 seajs.use('js/me/coupons');
226 </script> 227 </script>
  228 +{{/if}}
  229 +{{#if onlineServicePage}}
  230 +<script>
  231 + seajs.use('js/me/online-service');
  232 +</script>
227 {{/if}} 233 {{/if}}
1 <div class="order" data-id="{{orderNum}}"> 1 <div class="order" data-id="{{orderNum}}">
2 <header class="header"> 2 <header class="header">
3 订单编号:{{orderNum}} 3 订单编号:{{orderNum}}
4 - <span class="trading-status">{{tradingStatus}}</span> 4 + <span class="order-status">{{orderStatus}}</span>
5 </header> 5 </header>
6 <section class="order-goods"> 6 <section class="order-goods">
7 {{# goods}} 7 {{# goods}}
@@ -12,6 +12,17 @@ @@ -12,6 +12,17 @@
12 共{{count}}件商品 实付<span class="sum-cost">¥{{sumCost}}</span> 12 共{{count}}件商品 实付<span class="sum-cost">¥{{sumCost}}</span>
13 </footer> 13 </footer>
14 14
  15 + {{!-- 对应订单状态的操作逻辑 --}}
  16 +
  17 + {{!-- 完成和取消订单显示删除按钮 --}}
  18 + {{#unless unpaid}}
  19 + {{#unless unreceived}}
  20 + <div class="order-opt">
  21 + <span class="btn del">删除订单</span>
  22 + </div>
  23 + {{/unless}}
  24 + {{/unless}}
  25 +
15 {{#if unpaid}} 26 {{#if unpaid}}
16 <div class="order-opt"> 27 <div class="order-opt">
17 <span class="btn cancel">取消订单</span> 28 <span class="btn cancel">取消订单</span>
@@ -19,9 +30,9 @@ @@ -19,9 +30,9 @@
19 </div> 30 </div>
20 {{/if}} 31 {{/if}}
21 32
22 - {{#with unreceived}} 33 + {{#if unreceived}}
23 <div class="order-opt"> 34 <div class="order-opt">
24 - <a class="check-logistics" href="{{.}}">查看物流</a> 35 + <a class="check-logistics" href="{{logisticsUrl}}">查看物流</a>
25 </div> 36 </div>
26 - {{/with}} 37 + {{/if}}
27 </div> 38 </div>
@@ -2,17 +2,17 @@ @@ -2,17 +2,17 @@
2 <div class="recommend-for-you"> 2 <div class="recommend-for-you">
3 <div class="title">为您优选新品</div> 3 <div class="title">为您优选新品</div>
4 <div class="swiper-recommend"> 4 <div class="swiper-recommend">
5 - <div class="swiper-wrapper"> 5 + <ul class="swiper-wrapper">
6 {{#recommendList}} 6 {{#recommendList}}
7 - <div class="swiper-slider"> 7 + <li class="swiper-slider">
8 <img class="img-box" src="{{thumb}}"> 8 <img class="img-box" src="{{thumb}}">
9 <div class="price"> 9 <div class="price">
10 <span class="sale-price"{{salePrice}}</span> 10 <span class="sale-price"{{salePrice}}</span>
11 <span class="old-price"{{price}}</span> 11 <span class="old-price"{{price}}</span>
12 </div> 12 </div>
13 - </div> 13 + </li>
14 {{/recommendList}} 14 {{/recommendList}}
15 - </div> 15 + </ul>
16 </div> 16 </div>
17 </div> 17 </div>
18 {{/ recommendForYou}} 18 {{/ recommendForYou}}
@@ -167,13 +167,14 @@ class HomeController extends AbstractAction @@ -167,13 +167,14 @@ class HomeController extends AbstractAction
167 $this->setNavHeader('优惠券', true, SITE_MAIN); 167 $this->setNavHeader('优惠券', true, SITE_MAIN);
168 // $uid = $this->getUid(); 168 // $uid = $this->getUid();
169 $uid = 8826435; 169 $uid = 8826435;
170 - $status = $this->get('status', 0);  
171 $coupons = array( 170 $coupons = array(
172 - 'couponsUrl' => \Index\UserModel::getCouponData($uid, $status), 171 + 'couponsUrl' => array(
  172 + \Index\UserModel::getCouponData($uid, 0),
  173 + \Index\UserModel::getCouponData($uid, 1),
  174 + ),
173 'couponsPage' => true 175 'couponsPage' => true
174 ); 176 );
175 177
176 - print_r($coupons);  
177 $this->_view->display('coupons', $coupons); 178 $this->_view->display('coupons', $coupons);
178 179
179 } 180 }
@@ -207,56 +208,102 @@ class HomeController extends AbstractAction @@ -207,56 +208,102 @@ class HomeController extends AbstractAction
207 $uid = 967016; 208 $uid = 967016;
208 209
209 $address = \Index\UserModel::getAddressData($uid); 210 $address = \Index\UserModel::getAddressData($uid);
  211 + $addressList = \Index\UserModel::getAddressListData($uid);
210 212
211 // print_r($address); 213 // print_r($address);
212 214
213 $this->_view->display('address', array( 215 $this->_view->display('address', array(
214 'addressPage' => true, 216 'addressPage' => true,
215 'pageFooter' => true, 217 'pageFooter' => true,
216 - 'address' => $address 218 + 'address' => $address,
  219 + 'addressList' => $addressList
217 )); 220 ));
218 } 221 }
219 222
220 - /**  
221 - * 修改地址  
222 - */  
223 - public function editAddressAction()  
224 - {  
225 - // 设置网站标题  
226 - $this->setTitle('修改地址');  
227 - $this->setNavHeader('修改地址', true, SITE_MAIN);  
228 -  
229 - // $uid = $this->getUid();  
230 - $uid = 967016;  
231 -  
232 - $address = \Index\UserModel::getAddressData($uid); 223 + /**
  224 + * 修改地址或者添加新地址
  225 + */
  226 + public function saveAddressAction()
  227 + {
  228 + $result = array();
  229 +
  230 + if ($this->isAjax()) {
  231 + // $uid = $this->getUid();
  232 + $uid = 967016;
  233 + $address = $this->post('address', '');
  234 + $area_code = $this->post('area_code', '');
  235 + $consignee = $this->post('consignee', '');
  236 + $email = $this->post('email', '');
  237 + $id = $this->post('id', null);
  238 + $mobile = $this->post('mobile', '');
  239 + $zip_code = $this->post('zip_code', '');
  240 +
  241 + $result = \Index\UserModel::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
  242 + }
233 243
234 - // print_r($address); 244 + if (empty($result)) {
  245 + echo ' ';
  246 + } else {
  247 + $this->echoJson($result);
  248 + }
235 249
236 - $this->_view->display('edit_address', array(  
237 - 'editAddressPage' => true,  
238 - 'pageFooter' => true,  
239 - 'address' => $address  
240 - ));  
241 - } 250 + }
242 251
243 /** 252 /**
244 - * 在线客服 253 + * 设置默认地址
245 */ 254 */
246 - public function onlineServiceAction() 255 + public function defaultAddressAction()
247 { 256 {
248 - $service = \Index\UserModel::getOnlineServiceData(); 257 + $result = array();
  258 +
  259 + if ($this->isAjax()) {
  260 + // $uid = $this->getUid();
  261 + $uid = 967016;
  262 + $id = $this->post('id', '');
  263 +
  264 + $result = \Index\UserModel::setDefaultAddress($uid, $id);
  265 + }
  266 +
  267 + if (empty($result)) {
  268 + echo ' ';
  269 + } else {
  270 + $this->echoJson($result);
  271 + }
  272 +
  273 + }
249 274
250 - print_r($service); 275 + //在线客服
  276 + public function onlineServiceAction()
  277 + {
  278 + // 设置网站标题
  279 + $this->setTitle('在线客服');
  280 + $this->setNavHeader('在线客服', true, SITE_MAIN);
  281 +
  282 + $service = home\OnlineModel::getOnlineServiceInfo();
251 283
252 $this->_view->display('online_service', array( 284 $this->_view->display('online_service', array(
253 'onlineServicePage' => true, 285 'onlineServicePage' => true,
254 - 'pageFooter' => true, 286 + // 'pageFooter' => true,
255 'service' => $service 287 'service' => $service
256 )); 288 ));
257 - } 289 + }
258 290
259 - /** 291 + //在线客服-具体详情
  292 + public function onlineServiceDetailAction()
  293 + {
  294 + $service = array();
  295 + $cateId = $this->get('cateId', 0);
  296 + $cateName = $this->get('cateName', '');
  297 + if ($cateId > 0)
  298 + {
  299 + $service = home\OnlineModel::getOnlineServiceDetail($cateId);
  300 + }
  301 + $this->setTitle('在线客服');
  302 + $this->setNavHeader($cateName, true, '');
  303 + $this->_view->display('online_service_detail', $service);
  304 + }
  305 +
  306 + /**
260 * 我的逛 307 * 我的逛
261 */ 308 */
262 public function myGuangAction() 309 public function myGuangAction()
@@ -385,4 +432,53 @@ class HomeController extends AbstractAction @@ -385,4 +432,53 @@ class HomeController extends AbstractAction
385 while(false); 432 while(false);
386 //$this -> _view -> display('order',$data); 433 //$this -> _view -> display('order',$data);
387 } 434 }
  435 +
  436 + /**
  437 + * 订单详情页
  438 + */
  439 + public function orderDetailAction()
  440 + {
  441 + $data = array(
  442 + 'name' => '毛毛莉Lydia',
  443 + 'phoneNum' => '18600001133',
  444 + 'address' => '南京市建邺区嘉陵江东街18号国家广告产业园5栋17楼',
  445 + 'orderStatus' => '待收货',
  446 + 'orderNum' => '418358063',
  447 + 'orderTime' => '2014-03-10 17:25:10',
  448 +
  449 + 'unreceived' => true,
  450 + 'logisticsUrl' => '',
  451 + 'logisticsCompany' => '顺丰',
  452 + 'logisticsNum' => '51537443456',
  453 +
  454 + 'goods' => array(
  455 + array(
  456 + 'id' => 1,
  457 + 'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  458 + 'name' => 'Adidas Originals ZX FLUXM22508',
  459 + 'color' => '黄',
  460 + 'size' => '43',
  461 + 'price' => '699.00',
  462 + 'count' => '2'
  463 + ),
  464 + array(
  465 + 'id' => 1,
  466 + 'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/11/04/05/0188f1aca49ac478a565ec029b5d2d4a6c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
  467 + 'name' => 'B.Duck浴室玩伴mini浮水鸭',
  468 + 'gift' => true,
  469 + 'color' => '黄',
  470 + 'size' => '43',
  471 + 'price' => '0.00',
  472 + 'count' => '1'
  473 + )
  474 + ),
  475 +
  476 + 'sumPrice' => 799,
  477 + 'salePrice' => 80,
  478 + 'freight' => 5,
  479 + 'yohoCoin' => 5,
  480 + 'price' => 719
  481 + );
  482 + $this->_view->display('order-detail', array('orderDetail' => $data, 'orderDetailPage' => true));
  483 + }
388 } 484 }
@@ -218,7 +218,7 @@ class UserModel @@ -218,7 +218,7 @@ class UserModel
218 218
219 // 处理优惠券数据 219 // 处理优惠券数据
220 if (isset($coupons['data']) && !empty($coupons['data'])) { 220 if (isset($coupons['data']) && !empty($coupons['data'])) {
221 - $result = $coupons['data']; 221 + $result = $coupons['data']['info'];
222 } 222 }
223 223
224 return $result; 224 return $result;
@@ -246,6 +246,96 @@ class UserModel @@ -246,6 +246,96 @@ class UserModel
246 } 246 }
247 247
248 /** 248 /**
  249 + * 处理地址列表数据
  250 + *
  251 + * @param int $uid 用户ID
  252 + * @return array|mixed 处理之后的地址列表数据
  253 + */
  254 + public static function getAddressListData($uid)
  255 + {
  256 + $result = array();
  257 +
  258 + // 调用接口获取地址列表数据
  259 + $address = UserData::addressListData($uid);
  260 +
  261 + // 处理地址数据
  262 + if (isset($address['data']) && !empty($address['data'])) {
  263 + $result = $address['data'];
  264 + }
  265 +
  266 + return $result;
  267 + }
  268 +
  269 + /**
  270 + * 保存地址数据
  271 + *
  272 + * @param int $uid 用户ID
  273 + * @param string $address 地址信息
  274 + * @param int $area_code 城市码
  275 + * @param string $consignee 收货人
  276 + * @param string $email 邮箱地址
  277 + * @param int $id 地址唯一标识符id
  278 + * @param string $mobile 手机号码
  279 + * @param string $zip_code 邮编
  280 + * @return array|mixed 处理之后的地址列表数据
  281 + */
  282 + public static function saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code)
  283 + {
  284 + $result = array();
  285 +
  286 + // 参数验证
  287 + if (empty($uid)) {
  288 + $result['code'] = 400;
  289 + $result['message'] = '用户不可用';
  290 + } else if (empty($address)) {
  291 + $result['code'] = 401;
  292 + $result['message'] = '请输入可用的地址信息';
  293 + } else if (empty($area_code)) {
  294 + $result['code'] = 402;
  295 + $result['message'] = '地区码不可用';
  296 + } else if (empty($consignee)) {
  297 + $result['code'] = 403;
  298 + $result['message'] = '请输入收件人姓名';
  299 + } else if (!empty($email) && Helpers::verifyEmail($email)) {
  300 + $result['code'] = 404;
  301 + $result['message'] = '输入的邮箱地址格式不正确';
  302 + } else if (!empty($mobile) && Helpers::verifyMobile($mobile)) {
  303 + $result['code'] = 404;
  304 + $result['message'] = '输入的手机号码格式不正确';
  305 + } else {
  306 + // 调用接口保存地址数据
  307 + $address = UserData::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
  308 + // 处理返回结果
  309 + if (isset($address['code']) && $address['code'] == 200) {
  310 + $result = $address['data'];
  311 + }
  312 + }
  313 +
  314 + return $result;
  315 + }
  316 +
  317 + /**
  318 + * 设置默认地址
  319 + *
  320 + * @param int $uid 用户ID
  321 + * @param int $id 地址唯一标识符id
  322 + * @return array|mixed 处理之后的返回数据
  323 + */
  324 + public static function setDefaultAddress($uid, $id)
  325 + {
  326 + $result = array('code' => 400, 'message' => '错误');
  327 +
  328 + // 调用接口设置默认地址
  329 + $address = UserData::setDefaultAddress($uid, $id);
  330 + // 处理返回结果
  331 + if ($address && isset($address['code'])) {
  332 + $result = $address;
  333 + }
  334 +
  335 + return $result;
  336 + }
  337 +
  338 + /**
249 * 处理意见反馈数据 339 * 处理意见反馈数据
250 * 340 *
251 * @param string $udid 客户端唯一标识 341 * @param string $udid 客户端唯一标识
@@ -227,19 +227,30 @@ class NewsaleModel @@ -227,19 +227,30 @@ class NewsaleModel
227 return $result; 227 return $result;
228 } 228 }
229 229
230 - /**  
231 - * 筛选出来的热销排行榜商品数据处理  
232 - *  
233 - * @param array $data 筛选出来的原数据  
234 - * @return array 处理之后的数据  
235 - */  
236 - public static function selectTopData($data) 230 + /**
  231 + * 筛选出来的热销排行榜商品数据处理
  232 + *
  233 + * @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
  234 + * @param string|null $sort 品类ID查询参数
  235 + * @param integer|null $tab_id Tab的ID
  236 + * @param boolean $notab 时候返回顶部tab的数据,默认返回
  237 + * @param integer $limit 查询返回的最大限制数, 默认为50
  238 + * @param integer $page 分页第几页, 默认第1页
  239 + * @return array 处理之后的数据
  240 + */
  241 + public static function selectTopData($gender, $sort, $tab_id, $notab, $limit, $page)
237 { 242 {
238 $result = array(); 243 $result = array();
239 244
  245 + $data = NewsaleData::getTopProducts($gender, $sort, $tab_id, $limit, $page);
  246 +
240 if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) { 247 if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) {
241 $result = NewSaleProcess::newSaleData($data['data']); 248 $result = NewSaleProcess::newSaleData($data['data']);
242 unset($result['filter']); 249 unset($result['filter']);
  250 +
  251 + if ($notab) {
  252 + unset($result['tabs']);
  253 + }
243 } 254 }
244 255
245 return $result; 256 return $result;
  1 +<?php
  2 +
  3 +namespace home;
  4 +
  5 +use LibModels\Wap\Home\OnlineData;
  6 +use Action\AbstractAction;
  7 +use Plugin\Helpers;
  8 +
  9 +/**
  10 + * 在线客服相关数据处理
  11 + */
  12 +class OnlineModel
  13 +{
  14 +
  15 + //获取在线帮助分类
  16 + public static function getOnlineServiceInfo($clientType = 'iphone')
  17 + {
  18 + //调用接口获取数据
  19 + $res = OnlineData::getOnlineServiceInfo($clientType);
  20 + $cateInfo = $res['data'];
  21 + $question = array();
  22 + $tab = array();
  23 + if ($cateInfo)
  24 + {
  25 + foreach ($cateInfo as $key => $value)
  26 + {
  27 + //强制截成3个tab
  28 + if ($key > 2)
  29 + {
  30 + break;
  31 + }
  32 + $tab[$key]['tabid'] = 'tab' . $value['id'];
  33 + $tab[$key]['tabname'] = $value['category_name'];
  34 + $tab[$key]['iscut'] = true;
  35 + $tab[$key]['current'] = (!$key) ? TRUE : FALSE;
  36 + $question[$key]['name'] = 'tab' . $value['id'];
  37 + $question[$key]['current'] = (!$key) ? TRUE : FALSE;
  38 + $sub = $value['sub'];
  39 + $qTmp = array();
  40 + if ($sub)
  41 + {
  42 + foreach ($sub as $sk => $sv)
  43 + {
  44 + $qTmp[$sk]['title'] = $sv['category_name'];
  45 + $qTmp[$sk]['link'] = '/home/onlineservicedetail?cateId=' . $sv['id'].'&cateName='.$sv['category_name'];
  46 + }
  47 + }
  48 + $question[$key]['list'] = $qTmp;
  49 + }
  50 + $question[0]['current'] = true;
  51 + $tab[count($tab) - 1]['iscut'] = false;
  52 + }
  53 + //处理返回信息
  54 + $result = array(
  55 + 'header' => array('title' => '在线客服'),
  56 + 'tab' => $tab,
  57 + 'question' => $question
  58 + );
  59 +
  60 + return $result;
  61 + }
  62 +
  63 + //加载分类下的问题和解决方法
  64 + public static function getOnlineServiceDetail($cateId, $clinetType = 'iphone')
  65 + {
  66 + $result = array();
  67 + if (!$cateId)
  68 + {
  69 + return $result;
  70 + }
  71 + $res = OnlineData::getOnlineServiceDetail($cateId, $clinetType);
  72 + $questionInfo = $res['data'];
  73 + if ($questionInfo)
  74 + {
  75 + $list = array();
  76 + if ($questionInfo)
  77 + {
  78 + foreach ($questionInfo as $qk => $qv)
  79 + {
  80 + $list[$qk]['q'] = $qv['title'];
  81 + $list[$qk]['a'] = $qv['content'];
  82 + }
  83 + }
  84 + //处理返回信息
  85 + $result = array(
  86 + 'header' => array('title' => '在线客服'),
  87 + 'list' => $list
  88 + );
  89 + }
  90 + return $result;
  91 + }
  92 +
  93 +}
@@ -106,12 +106,11 @@ class NewsaleController extends AbstractAction @@ -106,12 +106,11 @@ class NewsaleController extends AbstractAction
106 $tab_id = $this->get('tab_id', null); 106 $tab_id = $this->get('tab_id', null);
107 $limit = $this->get('limit', 50); 107 $limit = $this->get('limit', 50);
108 $page = $this->get('page', 1); 108 $page = $this->get('page', 1);
  109 + $notab = (boolean)$this->get('notab', false);
109 110
110 // 获取性别 111 // 获取性别
111 $gender = Helpers::getGenderByCookie(); 112 $gender = Helpers::getGenderByCookie();
112 -  
113 - $data = NewsaleData::getTopProducts($gender, $sort, $tab_id, $limit, $page);  
114 - $result = \Product\NewsaleModel::selectTopData($data); 113 + $result = \Product\NewsaleModel::selectTopData($gender, $sort, $tab_id, $notab, $limit, $page);
115 } 114 }
116 115
117 if (empty($result)) { 116 if (empty($result)) {