Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
13 changed files
with
247 additions
and
3 deletions
5.14 KB
318 KB
8.64 KB
8.33 KB
24 KB
314 KB
@@ -37,10 +37,18 @@ | @@ -37,10 +37,18 @@ | ||
37 | } | 37 | } |
38 | } | 38 | } |
39 | } | 39 | } |
40 | + .sale-name { | ||
41 | + overflow: hidden; | ||
42 | + text-overflow: ellipsis; | ||
43 | + width: 100%; | ||
44 | + white-space: nowrap; | ||
45 | + margin-top: pxToRem(20px); | ||
46 | + color: gray; | ||
47 | + } | ||
40 | 48 | ||
41 | .price { | 49 | .price { |
42 | position: relative; | 50 | position: relative; |
43 | - margin-top: pxToRem(20px); | 51 | + margin-top: pxToRem(8px); |
44 | font-size: pxToRem(24px); | 52 | font-size: pxToRem(24px); |
45 | line-height: 1; | 53 | line-height: 1; |
46 | 54 |
1 | +<!DOCTYPE html> | ||
2 | +<html> | ||
3 | +<head> | ||
4 | + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
5 | + <meta charset="utf-8"> | ||
6 | + <title>{{staticTitle}}</title> | ||
7 | + <meta name="apple-mobile-web-app-title" content="SUMMER SALE"> | ||
8 | + <meta name="format-detection" content="telephone=no"> | ||
9 | + <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no,minimal-ui" media="(device-height: 568px)"> | ||
10 | + <meta name="apple-mobile-web-app-capable" content="yes"> | ||
11 | + <meta name="apple-mobile-web-app-status-bar-style" content="grey"> | ||
12 | + <link rel="stylesheet" href="{{imgUrl}}/cuxiao/css/newyear/index.css"> | ||
13 | + <script> | ||
14 | + (function(doc, win) { | ||
15 | + var docEl = doc.documentElement; | ||
16 | + (function() { | ||
17 | + var clientWidth = docEl.clientWidth; | ||
18 | + if (!clientWidth) { | ||
19 | + return; | ||
20 | + } | ||
21 | + docEl.style.fontSize = 20 * (clientWidth / 320) + 'px'; | ||
22 | + }()); | ||
23 | + })(document, window); | ||
24 | + </script> | ||
25 | +</head> | ||
26 | +<body class="keBody"> | ||
27 | +<div class="coupon-container" show="{{showPopupFlag}}"> | ||
28 | + <div class="coupon-top"> | ||
29 | + <img src="{{imgUrl}}/cuxiao/img/newyear/160105/top-bg.png" alt=""> | ||
30 | + <a class="go-check" href="{{myCouponUrl}}"></a> | ||
31 | + <a class="app-btn app1" href="http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445"></a> | ||
32 | + <a class="app-btn app2" href="http://www.yohoshow.com/about/index/yohoboysqr"></a> | ||
33 | + </div> | ||
34 | + <div class="coupon-bottom"> | ||
35 | + <div class="coupon-banner"> | ||
36 | + <a href="{{bannerUrl_1}}"></a> | ||
37 | + <a href="{{bannerUrl_2}}"></a> | ||
38 | + <a href="{{bannerUrl_3}}"></a> | ||
39 | + <a href="{{bannerUrl_4}}"></a> | ||
40 | + </div> | ||
41 | + <a class="follow-yoho" href="http://mp.weixin.qq.com/s?__biz=MjM5ODI5MDA4MA==&mid=201849402&idx=1&sn=c0089812f9769d82e0075f69d771f6e1#rd"></a> | ||
42 | + <div class="bottom-btn"> | ||
43 | + <a class="play-again" href="javascript:;"></a> | ||
44 | + <a class="share-btn" href="javascript:;"></a> | ||
45 | + </div> | ||
46 | + </div> | ||
47 | + <div class="coupon-ft"> | ||
48 | + <img src="{{imgUrl}}/cuxiao/img/newyear/160105/14.png"> | ||
49 | + </div> | ||
50 | +</div> | ||
51 | +<div class="modal"></div> | ||
52 | +<div class="dialog-box geted"> | ||
53 | + <div class="dialog-inner"> | ||
54 | + <img src="{{imgUrl}}/cuxiao/img/newyear/160105/geted.png" alt=""/> | ||
55 | + <span class="dialog-close"></span> | ||
56 | + </div> | ||
57 | +</div> | ||
58 | + | ||
59 | +<div class="dialog-box fail"> | ||
60 | + <div class="dialog-inner"> | ||
61 | + <img src="{{imgUrl}}/cuxiao/img/newyear/160105/fail.png" alt=""/> | ||
62 | + <span class="refresh-btn"></span> | ||
63 | + </div> | ||
64 | +</div> | ||
65 | +<input id="shareLink" type="hidden" value="{{shareLink}}"> | ||
66 | +<input id="shareImg" type="hidden" value="{{shareImg}}"> | ||
67 | +<input id="shareTitle" type="hidden" value="{{shareTitle}}"> | ||
68 | +<input id="shareDesc" type="hidden" value="{{shareDesc}}"> | ||
69 | +<script type="text/javascript" src="{{imgUrl}}/cuxiao/js/jquery.min.js"></script> | ||
70 | +<script> | ||
71 | + //提示分享 | ||
72 | + $('.share-btn').click(function () { | ||
73 | + $('.modal').fadeIn(); | ||
74 | + }); | ||
75 | + //关闭提示分享 | ||
76 | + $('.modal').click(function () { | ||
77 | + $(this).fadeOut(); | ||
78 | + }); | ||
79 | + | ||
80 | + //提示已领过券 | ||
81 | + if ($('.coupon-container').attr('show') === '1') { | ||
82 | + $('.dialog-box.geted').show(); | ||
83 | + } | ||
84 | + //提示领券失败 | ||
85 | + else if ($('.coupon-container').attr('show') === '2') { | ||
86 | + $('.dialog-box.fail').show(); | ||
87 | + } | ||
88 | + | ||
89 | + //关闭提示 | ||
90 | + $('.dialog-close').click(function(){ | ||
91 | + $(this).parents('.dialog-box').fadeOut(); | ||
92 | + }); | ||
93 | + //刷新页面 | ||
94 | + $('.refresh-btn').click(function() { | ||
95 | + location.reload(); | ||
96 | + }); | ||
97 | +</script> | ||
98 | +{{#if weixinShare}} | ||
99 | +<script type="text/javascript" charset="utf-8" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script> | ||
100 | +<script type="text/javascript" charset="utf-8" src="{{jsUrl}}/cuxiao/js/share.weixin.js"></script> | ||
101 | +{{/if}} | ||
102 | +{{> layout/analysis}} | ||
103 | +</body> | ||
104 | +</html> |
@@ -4,6 +4,9 @@ | @@ -4,6 +4,9 @@ | ||
4 | {{#recommendList}} | 4 | {{#recommendList}} |
5 | <a class="swiper-slide" href="{{url}}"> | 5 | <a class="swiper-slide" href="{{url}}"> |
6 | <img class="swiper-lazy img-box" data-src="{{thumb}}"> | 6 | <img class="swiper-lazy img-box" data-src="{{thumb}}"> |
7 | + <div class="sale-name"> | ||
8 | + {{name}} | ||
9 | + </div> | ||
7 | <div class="price"> | 10 | <div class="price"> |
8 | <span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span> | 11 | <span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span> |
9 | {{#price}}<span class="old-price">¥{{.}}</span>{{/price}} | 12 | {{#price}}<span class="old-price">¥{{.}}</span>{{/price}} |
@@ -348,6 +348,9 @@ | @@ -348,6 +348,9 @@ | ||
348 | .tpl-brands{ | 348 | .tpl-brands{ |
349 | margin-top:-8px!important; | 349 | margin-top:-8px!important; |
350 | } | 350 | } |
351 | + | ||
352 | +} | ||
353 | +.boys,.lifestyle{ | ||
351 | .goods-container{ | 354 | .goods-container{ |
352 | .good-info{ | 355 | .good-info{ |
353 | width: 188px; | 356 | width: 188px; |
@@ -357,7 +360,6 @@ | @@ -357,7 +360,6 @@ | ||
357 | } | 360 | } |
358 | } | 361 | } |
359 | } | 362 | } |
360 | - | ||
361 | } | 363 | } |
362 | 364 | ||
363 | 365 | ||
@@ -486,6 +488,8 @@ | @@ -486,6 +488,8 @@ | ||
486 | } | 488 | } |
487 | } | 489 | } |
488 | } | 490 | } |
491 | + } | ||
492 | + .boys,.lifestyle{ | ||
489 | .goods-container{ | 493 | .goods-container{ |
490 | .good-info{ | 494 | .good-info{ |
491 | width: 222px!important; | 495 | width: 222px!important; |
@@ -495,7 +499,6 @@ | @@ -495,7 +499,6 @@ | ||
495 | } | 499 | } |
496 | } | 500 | } |
497 | } | 501 | } |
498 | - | ||
499 | } | 502 | } |
500 | } | 503 | } |
501 | 504 |
1 | +<?php | ||
2 | +use Action\HuodongAction; | ||
3 | +use LibModels\Wap\Cuxiao\ActivityData; | ||
4 | +use Plugin\Helpers; | ||
5 | + | ||
6 | +/** | ||
7 | + * | ||
8 | + * @name Newyear | ||
9 | + * @package | ||
10 | + * @copyright yoho.inc | ||
11 | + * @version 1.0 (2015-12-30 20:39:50) | ||
12 | + * @author fei.hong <fei.hong@yoho.cn> | ||
13 | + */ | ||
14 | +class NewyearController extends HuodongAction | ||
15 | +{ | ||
16 | + /** | ||
17 | + * 利是封领券 | ||
18 | + * | ||
19 | + * 备注:2016年1月5号上线 | ||
20 | + */ | ||
21 | + public function couponAction() | ||
22 | + { | ||
23 | + //获取登录者ID,未登录返回false | ||
24 | + $uid = $this->getLoggedUid(); | ||
25 | + if (!$uid || !is_numeric($uid)) { | ||
26 | + //未登录的用户访问,跳转到登录页面。并且在登陆后跳转回本页面 | ||
27 | + $this->go(Helpers::url('/signin.html', array('refer' => Helpers::url('/cuxiao/newyear/coupon')), 'default')); | ||
28 | + } | ||
29 | + | ||
30 | + // 该变量用来控制和显示页面的弹出提示 | ||
31 | + $showPopupFlag = '0'; | ||
32 | + | ||
33 | + //获取跳转到个人中心-我的优惠券链接,并调用接口,完成领券操作 | ||
34 | + $myCouponUrl = Helpers::url('/home/coupons', null, 'default') . '?openby:yohobuy={"action":"go.coupon"}'; | ||
35 | + $activityId = $this->getActivityId(); | ||
36 | + $result = ActivityData::getCouponAll($uid, $activityId); | ||
37 | + if (isset($result['code'])) { | ||
38 | + switch (intval($result['code'])) { | ||
39 | + case 200: // 领取成功, 发送站内信消息 | ||
40 | + $showPopupFlag = '0'; | ||
41 | + $this->sendMessage($uid, '【优惠券】您有1000元套券', '尊敬的客户:恭喜您成功获得1000元套券 !您可以在个人中心的交易管理中查看‘我的优惠券’。'); | ||
42 | + break; | ||
43 | + case 201: // 已领取过, 提示重复领券 | ||
44 | + $showPopupFlag = '1'; | ||
45 | + break; | ||
46 | + default: // 领取失败, 提示领券失败 | ||
47 | + $showPopupFlag = '2'; | ||
48 | + break; | ||
49 | + } | ||
50 | + } | ||
51 | + | ||
52 | + $this->_view->display('coupon', array( | ||
53 | + 'staticTitle' => 'YOHO!BUY有货新年寻宝大作战', | ||
54 | + 'weixinShare' => $this->_isApp ? false : true, // 是否需要微信分享 | ||
55 | + 'shareLink' => 'http://feature.yoho.cn/2016lishifeng/index.html', | ||
56 | + 'shareTitle' => 'YOHO!BUY有货新年寻宝大作战,千元利是等你赢!', | ||
57 | + 'shareDesc' => 'YOHO!BUY有货,全球800+潮流品牌每日上新!', | ||
58 | + 'shareImg' => 'http://img12.static.yhbimg.com/couponImg/2015/12/30/12/02008a9724b898dee56852de9f1a3978bf.jpg', | ||
59 | + 'showPopupFlag' => $showPopupFlag, | ||
60 | + 'myCouponUrl' => $myCouponUrl, | ||
61 | + 'bannerUrl_1' => 'http://m.yohobuy.com/boys?openby:yohobuy={"action":"go.home","params":{"channel":"1"}}', | ||
62 | + 'bannerUrl_2' => 'http://m.yohobuy.com/girls?openby:yohobuy={"action":"go.home","params":{"channel":"2"}}', | ||
63 | + 'bannerUrl_3' => 'http://m.yohobuy.com/kids?openby:yohobuy={"action":"go.home","params":{"channel":"3"}}', | ||
64 | + 'bannerUrl_4' => 'http://m.yohobuy.com/lifestyle?openby:yohobuy={"action":"go.home","params":{"channel":"4"}}', | ||
65 | + )); | ||
66 | + } | ||
67 | + | ||
68 | + /** | ||
69 | + * 检测登录状态 | ||
70 | + * | ||
71 | + * @return int | ||
72 | + */ | ||
73 | + private function getLoggedUid() | ||
74 | + { | ||
75 | + // 判断是否是应用访问, 拼接APP需要的URL参数 | ||
76 | + $this->_isApp = (null !== $this->get('app_version') || null !== $this->get('uid')); | ||
77 | + $uid = false; | ||
78 | + if ($this->_isApp) { | ||
79 | + $uid = $this->get('uid'); | ||
80 | + } else { | ||
81 | + $uid = $this->getUid(); | ||
82 | + } | ||
83 | + | ||
84 | + return $uid; | ||
85 | + } | ||
86 | + | ||
87 | + /** | ||
88 | + * 发送站内信 | ||
89 | + * | ||
90 | + * @param int $uid 用户ID | ||
91 | + */ | ||
92 | + private function sendMessage($uid, $title, $content) | ||
93 | + { | ||
94 | + try { | ||
95 | + ActivityData::message($uid, $title, $content); | ||
96 | + } catch (Exception $e) { | ||
97 | + // do nothing | ||
98 | + } | ||
99 | + } | ||
100 | + | ||
101 | + /** | ||
102 | + * 根据环境来获取活动ID | ||
103 | + * | ||
104 | + * @return int | ||
105 | + */ | ||
106 | + private function getActivityId() | ||
107 | + { | ||
108 | + // 设置环境变量 | ||
109 | + switch (APPLICATION_ENV) { | ||
110 | + case 'production': // 生产 | ||
111 | + return 462; | ||
112 | + case 'preview': // 预览 | ||
113 | + case 'testing': // 测试 | ||
114 | + case 'develop': // 开发 | ||
115 | + default: | ||
116 | + return 88; | ||
117 | + } | ||
118 | + } | ||
119 | + | ||
120 | +} |
@@ -800,6 +800,11 @@ class HomeController extends AbstractAction | @@ -800,6 +800,11 @@ class HomeController extends AbstractAction | ||
800 | $this->error(); | 800 | $this->error(); |
801 | } | 801 | } |
802 | 802 | ||
803 | + /* 判断订单是否已付款, 已付款跳到订单详情页 */ | ||
804 | + if (!empty($orderDetail['isPay'])) { | ||
805 | + $this->go(Helpers::url('/home/orderdetail', array('order_code' => $orderCode)) ); | ||
806 | + } | ||
807 | + | ||
803 | $hasWxShare = strpos($this->server('HTTP_USER_AGENT', ''), 'MicroMessenger') !== false; | 808 | $hasWxShare = strpos($this->server('HTTP_USER_AGENT', ''), 'MicroMessenger') !== false; |
804 | if ($hasWxShare) { | 809 | if ($hasWxShare) { |
805 | $tools = new JsApiPay(); | 810 | $tools = new JsApiPay(); |
@@ -152,6 +152,7 @@ class OrderModel | @@ -152,6 +152,7 @@ class OrderModel | ||
152 | $result['price'] = $orderDetail['data']['amount']; // 实付金额 | 152 | $result['price'] = $orderDetail['data']['amount']; // 实付金额 |
153 | $result['goodsAmount'] = $orderDetail['data']['payment_amount']; // 商品总金额没有人民币符号 | 153 | $result['goodsAmount'] = $orderDetail['data']['payment_amount']; // 商品总金额没有人民币符号 |
154 | $result['orderCount'] = $count; // 订单总件数 | 154 | $result['orderCount'] = $count; // 订单总件数 |
155 | + $result['isPay'] = $orderDetail['data']['payment_status'] === 'Y'; | ||
155 | } | 156 | } |
156 | } | 157 | } |
157 | 158 |
-
Please register or login to post a comment