Authored by biao

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

AnyPicker @ 6206acd1
Subproject commit 6206acd137894609015041be1d59d9684690f8fe
... ...
... ... @@ -24,6 +24,15 @@ server
proxy_set_header Accept-Encoding "gzip";
}
location = /rn/v1 {
proxy_redirect off;
proxy_pass http://yohobuy;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location = /appembed {
default_type application/json;
return 200 '{"code":200,"message":"app embed","data":{"open":"N","url":"http://m.yohobuy.com"}}';
... ...
... ... @@ -12,23 +12,27 @@
<div class="title">
昵称
</div>
<input type="text" name="nick" placeholder="请输入您帅气的名字!" value="" maxlength="5">
<input type="text" name="nick" placeholder="请输入您帅气的名字!" value="" maxlength="20">
</div>
<div class="user-info birthday">
<div class="title">
生日
</div>
<input type="date" name="birthday" value="{{birthday}}" min="1900-01-01" max="2016-01-01">
<input class="birthday-picker" type="text" name="birthday" value="{{birthday}}" min="1900-01-01" max="2016-02-29" readonly>
<!-- <div class="birthday-div">
<span>{{birthday}}</span>
<input class="birthday-input" type="date" name="birthday" value="{{birthday}}" min="1900-01-01" max="2016-02-29">
</div> -->
</div>
<div class="gender">
<div class="title">
性<br>别
</div>
<div class="icon boy">
<span class="check {{#if gender}}checked{{/if}}" data-gender="{{#if gender}}1{{/if}}"></span>
<span class="check {{#if isBoy}}checked{{/if}}" data-gender="1"></span>
</div>
<div class="icon girl">
<span class="check {{#unless gender}}checked{{/if}}" data-gender="{{#if gender}}2{{/if}}"></span>
<span class="check {{#unless isBoy}}checked{{/if}}" data-gender="2"></span>
</div>
<input type="hidden" name="gender" id="gender" value="{{gender}}">
</div>
... ... @@ -44,7 +48,9 @@
<div class="modal">
<div class="icon close"></div>
<div class="text">
你还没有<br>完善信息哦
请输入您
<br>
帅气的名字!
</div>
<div class="btn close">
现在就完善
... ... @@ -52,4 +58,5 @@
</div>
</div>
</div>
<link rel="stylesheet" type="text/css" href="http://cdn.yoho.cn/huodong/2016yuanxiao/AnyPicker/dist/anypicker-all.min.css" />
{{> cuxiao/yuanxiao/footer}}
... ...
... ... @@ -18,10 +18,21 @@
</div>
<div class="footer">
{{#if needShare}}
<div class="share">
分享2016年潮流运势
</div>
{{/if}}
</div>
<div class="mask hide">
<div class="share-icon">
</div>
</div>
</div>
<input type="hidden" id="shareTitle" value="{{shareTitle}}">
<input type="hidden" id="shareDesc" value="{{shareDesc}}">
<input type="hidden" id="shareImg" value="{{shareImg}}">
<input type="hidden" id="shareLink" value="{{shareUrl}}">
{{> cuxiao/yuanxiao/type}}
{{> cuxiao/yuanxiao/footer}}
... ...
... ... @@ -2,4 +2,5 @@
{{#staticJS}}
<script type="text/javascript" src="{{../staticFile}}/js/{{.}}"></script>
{{/staticJS}}
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
</body>
... ...
... ... @@ -9,8 +9,8 @@ use Plugin\Helpers;
*/
class YuanxiaoController extends HuodongAction
{
// const STATIC_FILE = 'http://localhost:2222/assets/1.0.2';
const STATIC_FILE = 'http://cdn.yoho.cn/huodong/2016yuanxiao/1.0.2';
// const STATIC_FILE = 'http://localhost:2222/assets/1.0.6';
const STATIC_FILE = 'http://cdn.yoho.cn/huodong/2016yuanxiao/1.0.6';
const ENCRYPT_KEY = 'iamgtskkwhoareyou';
/**
... ... @@ -66,7 +66,7 @@ class YuanxiaoController extends HuodongAction
'name' => $nickName,
'type' => $result['data']['randomCode']
);
$this->setCookie('yuanxiaochouqian', json_encode($cookieData), time() + 15*60);
$this->setCookie('yuanxiaochouqian', json_encode($cookieData), time() + 15 * 60);
$this->go(Helpers::url('/cuxiao/yuanxiao/wait'));
} else { // 不成功就显示返回的错误信息
$this->_view->display('info', array(
... ... @@ -77,6 +77,7 @@ class YuanxiaoController extends HuodongAction
),
'birthday' => $birthday,
'gender' => $gender,
'isBoy' => $gender == 1, // 性别是否是女标志位
'message' => $result['message']
));
}
... ... @@ -91,6 +92,7 @@ class YuanxiaoController extends HuodongAction
),
'birthday' => $userData['birthday'],
'gender' => $userData['gender'],
'isBoy' => $userData['gender'] == 1 // 性别是否是女标志位
));
}
}
... ... @@ -121,9 +123,9 @@ class YuanxiaoController extends HuodongAction
$this->auditJumpLogin();
$result = $this->getCookie('yuanxiaochouqian', null);
// if (empty($result)) { // 未取到信息就重新测试
// $this->go(Helpers::url('/cuxiao/yuanxiao/info'));
// }
if (empty($result)) { // 未取到信息就重新测试
$this->go(Helpers::url('/cuxiao/yuanxiao/info')); }
// cookie中存的结果
$result = json_decode($result, true);
$shareUrl = Helpers::url('/cuxiao/yuanxiao/share', array(
... ... @@ -132,9 +134,12 @@ class YuanxiaoController extends HuodongAction
$this->_view->display('result', array(
'staticTitle' => '元宵抽签',
'weixinShare' => $this->_isApp ? false : true, // 是否需要微信分享
'needShare' => $this->checkNeedShare(), // 是否需要微信分享
'staticFile' => self::STATIC_FILE,
'result' => $result,
'shareTitle' => $result['name'] . '的2016年潮流运势是' . $this->getChouqianTitle($result['type']),
'shareDesc' => '元宵快乐!一起来YOHO!BUY有货玩2016年潮流开运测试!',
'shareImg' => 'http://img02.yohoboys.com/staticimg/2016/02/19/16/02dbd38c84eccf1097b7e240452f0de856.png',
'shareUrl' => $shareUrl,
'staticJS' => array(
'result.js'
... ... @@ -170,6 +175,33 @@ class YuanxiaoController extends HuodongAction
));
}
/**
* 根据结果类型获取抽签结果标题
* @param $type
*/
private function getChouqianTitle($type)
{
$data = array(
'P1' => '成为一个大写加粗的潮人!',
'P2' => '逼格满载盐值爆表!',
'P3' => '运气爆棚,拥有Yeezy不是梦!',
'P4' => '街拍不断,成为网红不是梦!',
'M1' => '穿着MA-1飞行夹克一飞冲天!',
'M2' => '把妹不花钱!买鞋不排队!',
'M3' => '穿着跑鞋到达人生巅峰!',
'M4' => '帅气多金颜值高!',
'F1' => '拥有拆不完的快递和礼物!
',
'F2' => '被男神强势壁咚!',
'F3' => '腿细胸大屁股翘!',
'F4' => '任何style都轻松驾驭!
'
);
return $data[$type];
}
/**
* 检测登录状态
*
... ... @@ -187,6 +219,19 @@ class YuanxiaoController extends HuodongAction
}
/**
* 判断是否需要微信分享
* @return bool
*/
private function checkNeedShare()
{
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false || $this->_isApp) {
return true;
}
return false;
}
/**
* 加密字符串
*
* @param string $data 需要加密的字符串
... ...
<?php
use Action\AbstractAction;
/**
* Created by PhpStorm.
* User: Leo
* Date: 16/2/17
* Time: 上午11:48
*/
class RnController extends AbstractAction
{
const PRIVATE_KEY = 'fd4ad5fcsa0de589af23234ks1923ks';
/**
* V1版本
*
* 参数列表
* -------------------------------------------------------------------------
* 字段 描述 类型 示例
* app_version 当前版本号 string 3.8.0
* uid 用户ID string 13423331
* client_type 用户手机系统:Android,IOS string Android
* screen_size 屏幕尺寸 string 1080x1920
* udid 设备唯一码 string 1d123sadao3
* os_version 设备版本号 string 1d123sadao3
* rnv bundle版本号,如果本地没有补丁,传空 string 100
* minv 最低支持的版本号
*
* 返回列表
* -------------------------------------------------------------------------
* 字段 描述 类型 示例
* code 返回的code,200,304等,具体的服务器定义 int 200
* message 信息 string "Config Success"
* md5 当前请求的唯一码 string "1234567890123456"
* data 配置参数数据,参考data列表 object
* [
* url 补丁url地址,没有传空 string http://yohocdn.com/fpath/fpkk.js
* rnv 当前bundle的版本号,没有就传空 string "100"
* filecode md5(md5(文件内容) + "yohorn2016") string "1233321121212332"
* ]
* echo md5(file_get_contents('http://cdn.yoho.cn/app-hotfix/yohobuy/4.0.0/main2.js'));
*/
public function v1Action()
{
$result = array('code' => 200, 'message' => 'Config Success', 'md5' => '', 'data' => array());
// 根据版本号返回补丁文件信息
$version = $this->post('app_version');
switch ($version) {
case '4.0.0': // 版本号
$result['data']['url'] = '';
$result['data']['rnv'] = '';
$result['data']['minv'] = '';
// $result['data']['filecode'] = md5('b3e54e59cb41453623360a55e9588361' . 'yohorn2016');
$result['data']['filecode'] = '';
$result['md5'] = md5(self::PRIVATE_KEY . ':' . json_encode($result['data']));
break;
default: // 默认
$result['data']['url'] = '';
$result['data']['rnv'] = '';
$result['data']['filecode'] = '';
$result['md5'] = md5(self::PRIVATE_KEY . ':' . json_encode($result['data']));
}
$this->echoJson($result);
}
}
... ...