Authored by 梁志锋

Merge remote-tracking branch 'origin/master'

Showing 76 changed files with 2647 additions and 1522 deletions

Too many changes to show.

To preserve performance only 76 of 76+ files are displayed.

... ... @@ -103,12 +103,8 @@ class WebAction extends Controller_Abstract
if (empty($refer) || strstr($refer, 'signin.html') || strstr($refer, 'passport/')) {
$refer = SITE_MAIN;
}
$token = Helpers::makeToken($res['data']['uid']);
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $res['data']['uid']);
$this->setCookie('_TOKEN', $token);
$goUrl = Helpers::syncUserSession($res['data']['uid'], $refer);
$this->go($goUrl);
$this->syncUserSession($res['data']['uid']);
$this->go($refer);
}
else {
//登录失败-清空remem
... ... @@ -350,6 +346,9 @@ class WebAction extends Controller_Abstract
if ($this->_useSession) {
Session::start('www_yohobuy_session', null, 'yohobuy.com')->__set($name, $value);
}
else {
Session::fileStart('www_yohobuy_session')->__set($name, $value);
}
}
/**
... ... @@ -375,6 +374,23 @@ class WebAction extends Controller_Abstract
}
/**
* 登录完成后置cookie-_UID,session
*/
protected function syncUserSession($uid)
{
$userInfo = LoginData::profile($uid);
if (isset($userInfo['data']) && $userInfo['data']) {
$token = Helpers::makeToken($uid);
$uidCookie = $userInfo['data']['profile_name'] . '::' . $userInfo['data']['uid'] . '::' . $userInfo['data']['vip_info']['title'] . '::' . $token;
$this->setCookie('_UID',$uidCookie,time() + 86400 * 360);
}
$this->setSession('_TOKEN', $token);
$this->setSession('_LOGIN_UID', $uid);
$this->setSession('_SYS_USER_SESSION', 1);
$this->setCookie('_TOKEN', $token);
}
/**
* 获取当前登录的用户ID
*
* @param bool $useSession (true:从服务端session中检查, false:从客户端cookie中检查)
... ... @@ -386,7 +402,7 @@ class WebAction extends Controller_Abstract
if (!$this->_useSession) {
$useSession = false;
}
$useSession = false;//第三方登录没有上线,从cookie获取
$useSession = false;
if (!$this->_uid) {
$cookie = $this->getCookie('_UID');
... ... @@ -526,6 +542,12 @@ class WebAction extends Controller_Abstract
*/
protected function setWebNavHeader($channel = '')
{
$uid = $this->getUid(true);
//是否同步了session
$sysUserSession = intval($this->getSession('_SYS_USER_SESSION'));
if(empty($sysUserSession)) {
$sysUserSession = 1;
}
if (!empty($channel)) {//设置频道
//\Index\HomeModel::setSwitchToCookie($channel);
}
... ... @@ -538,8 +560,19 @@ class WebAction extends Controller_Abstract
'gobytype' => 'gobuy' . $channel,
'searchcate' => 'searchcate' . $channel,
'header' => true,
'apiDomain' => $apiDomain
'apiDomain' => $apiDomain,
'sysUserSession'=> '',
);
//同步session
if(!empty($uid) && $sysUserSession < 20) {
$header['sysUserSession'] = Helpers::syncUserSession($uid);
$sysUserSession = $sysUserSession + 1;
$this->setSession('_SYS_USER_SESSION', $sysUserSession);
}
else if(empty($uid) && $sysUserSession >= 20) {
$this->setSession('_SYS_USER_SESSION', 0);
}
$this->_view->assign('headerdata', $header);
}
... ... @@ -576,13 +609,17 @@ class WebAction extends Controller_Abstract
* 通过当前用户审判是否跳到登录
*
* @param int $useSession (true:从服务端session中检查, false:从客户端cookie中检查)
* @param null|string $refer 访问来源地址
* @return uid/跳转链接
*/
protected function auditJumpLogin($useSession = true)
protected function auditJumpLogin($useSession = true, $refer = null)
{
$uid = $this->getUid(false);//$this->getUid($useSession);第三方绑定没有上
$uid = $this->getUid($useSession);
if (!$uid) {
$this->go(Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', SITE_MAIN))));
if (empty($refer)) {
$refer = $this->server('HTTP_REFERER', SITE_MAIN);
}
$this->go(Helpers::url('/signin.html', array('refer' => $refer)));
}
else {
return $uid;
... ...
... ... @@ -22,8 +22,8 @@ class Yohobuy
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
//java API
const API_URL = 'http://api.yoho.yohoops.org/';
const API_URL2 = 'http://api.yoho.yohoops.org/';
const API_URL = 'http://api.yoho.yohoops.org/';//
const API_URL2 = 'http://api.yoho.yohoops.org/';//
const SERVICE_URL = 'http://service.yoho.yohoops.org/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_OLD = 'http://api2.open.yohobuy.com/';
... ...
... ... @@ -5,7 +5,7 @@ use Api\Sign;
class PlusstarData {
const URI_BRANDLIST = 'guang/api/v3/plustar/getlist';
/**
/**
* 获取品牌列表
*
* @param int $brandType
... ... @@ -20,6 +20,7 @@ class PlusstarData {
$param['brand_type'] = $brandType;
$param['gender'] = $gender;
$param['client_type'] = $type;
$param['private_key'] = Yohobuy::$privateKeyList[$type];
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_BRANDLIST, $param);
}
... ...
... ... @@ -57,26 +57,21 @@ class IndexData
* 邮箱订阅
*
* @param string $email
* @param string $uid
* @param int $uid
* @author sefon 2016-4-22 18:33:51
* @return array
*/
public static function emailSubscriber($email, $uid = 0)
{
//TODO 走老接口
// 构建必传参数
$param = Yohobuy::param();
$param['page'] = 1;
$param['open_key'] = '12345';
$param['method'] = 'open.subscriber.subscriber';
$param['email'] = $email;
$param['uid'] = $uid;
$param['client_type'] = 'web';
$param['private_key'] = Yohobuy::$privateKeyList['web'];
$param['client_secret'] = Sign::getSign($param);
unset($param['app_version']);
unset($param['client_type']);
unset($param['os_version']);
unset($param['screen_size']);
unset($param['v']);
return Yohobuy::post(Yohobuy::API_URL, $param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
... ... @@ -86,25 +81,21 @@ class IndexData
* @param int $question_id
* @param string $answer
* @param int $solution
* @author sefon 2016-4-22 18:34:02
* @return array
*/
public static function suggestFeedback($feedback_id, $question_id, $answer, $solution)
{
//TODO 走老接口
$param = Yohobuy::param();
$param['page'] = 1;
$param['open_key'] = '12345';
$param['method'] = 'open.feedback.submit';
$param['feedback_id'] = $feedback_id;
$param['question_id'] = $question_id;
$param['answer'] = $answer;
$param['solution'] = $solution;
unset($param['app_version']);
unset($param['client_type']);
unset($param['os_version']);
unset($param['screen_size']);
unset($param['v']);
return Yohobuy::post(Yohobuy::API_URL, $param);
$param['client_type'] = 'web';
$param['private_key'] = Yohobuy::$privateKeyList['web'];
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
... ...
... ... @@ -623,4 +623,13 @@ class UserData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
public static function passportGet($uid)
{
$param = Yohobuy::param();
$param['method'] = 'open.passport.get';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -28,11 +28,15 @@ class LoginData
*/
public static function signin($area, $profile, $password, $shoppingKey = null)
{
$type = 'web';
$param = Yohobuy::param();
$param['method'] = 'app.passport.signin';
$param['area'] = $area;
$param['profile'] = $profile;
$param['password'] = $password;
$param['app_version'] = '4.0.0';
$param['client_type'] = $type;
$param['private_key'] = Yohobuy::$privateKeyList[$type];
if (!empty($shoppingKey)) {
$param['shopping_key'] = $shoppingKey;
}
... ...
<?php
namespace LibModels\Web\Product;
use Api\Yohobuy;
/**
* sale操作类
* @name SaleData
* @package
* @copyright yoho.inc
* @version 1.0 (2016-01-07)
* @author
*/
class SaleData
{
const URL_SALE_SPECIAL = '/operating/service/v1/special';
/**
* @param $specialsaleId 专区ID
* @return array
*/
public static function getSpecial($specialsaleId)
{
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_SALE_SPECIAL, 'getOneSpecial', array($specialsaleId), 600);
}
}
<?php
namespace LibModels\Web\Product;
use Api\Yohobuy;
use Api\Sign;
/**
* sale操作类
* @name SaleData
* @package
* @copyright yoho.inc
* @version 1.0 (2016-01-07)
* @author
*/
class SaleData
{
/**
* @param $specialsaleId 专区ID
* @return array
*/
public static function getSpecial($specialsaleId)
{
$param = Yohobuy::param();
$param['special_id'] = $specialsaleId;
$param['method'] = 'app.resources.getOneSpecial';
$param['client_secret'] = Sign::getSign($param);
//TODO等待接口发布到测试环境
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -57,27 +57,27 @@ class SearchData
case 'preview':
if ($type == 'sort') {
return 'http://101.200.31.165/yohosearch/sortgroup.json';
return 'http://192.168.10.64:8080/yohosearch/sortgroup.json';
}
elseif ($type == 'discount') {
return 'http://101.200.31.165/yohosearch/discount.json';
return 'http://192.168.10.64:8080/yohosearch/discount.json';
}
elseif ($type == 'recent') {
return 'http://101.200.31.165/yohosearch/recent.json';
return 'http://192.168.10.64:8080/yohosearch/recent.json';
}
elseif ($type == 'suggest') {
return 'http://101.200.31.165/yohosearch/suggest.json';
return 'http://192.168.10.64:8080/yohosearch/suggest.json';
}
else if($type == 'new-shelve') {
return 'http://101.200.31.165/yohosearch/new-shelve.json';
return 'http://192.168.10.64:8080/yohosearch/new-shelve.json';
}
elseif ($type == 'shop') {
return 'http://101.200.31.165/yohosearch/shops.json';
return 'http://192.168.10.64:8080/yohosearch/shops.json';
}
elseif ($type == 'brand') {
return 'http://101.200.31.165/yohosearch/brand/list.json';
return 'http://192.168.10.64:8080/yohosearch/brand/list.json';
}
return 'http://101.200.31.165/yohosearch/search.json';
return 'http://192.168.10.64:8080/yohosearch/search.json';
case 'testing':
case 'developer':
default:
... ... @@ -420,9 +420,22 @@ class SearchData
* 获取品牌店铺接口地址
* @return string
*/
public static function getBannerData($positionId,$msort,$misort,$gender)
public static function getBannerData($positionId, $msort, $misort, $gender)
{
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_INDEX_BANNER, 'get', array($positionId,$msort,$misort,$gender,0,0,0,0,0), 600, 1000); // 有缓存10分钟
// 构建必传参数
$param = Yohobuy::param();
$param['method'] = 'web.search.banner';
$param['position_id'] = intval($positionId);
$param['max_sort_id'] = intval($msort);
$param['middle_sort_id'] = intval($misort);
$param['gender'] = $gender;
$param['brand'] = '0';
$param['style'] = '0';
$param['color'] = '0';
$param['price'] = '0';
$param['size_id'] = '0';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param, 600, false, 5);
}
/**
... ...
<?php
namespace LibModels\Web\Shop;
use Api\Yohobuy;
use Api\Sign;
/**
* 商家入驻的接口
*
* @name SettledData
* @package shop
* @copyright yoho.inc
* @author xiaoxiao.hao <xiaoxiao.hao@yoho.cn>
*/
class SettledData
{
/**
* 添加入驻申请保存
* @param type string $brand_name 品牌名称
* @param type string $registerStatus 品牌注册情况
* @param type string $sellerName 公司名称
* @param type string $sellerAddress 公司地址
* @param type int $zipCode 邮编
* @param type string $contacts 联系人
* @param type int $contactPhone 电话|手机
* @param type string $contactEmail 邮箱
* @param type string $sellerRole 与品牌关系
* @param type string $brandWebsite 品牌官网
* @param type string $onlineShopWebsite 店铺连接
* @param type json $categoryInfo 品类信息['category_one'=> '', 'category_two'=> '', 'category_price'=> '']
* @param type string $billingCycle 结算周期
* @param type string $warehouseAddress 仓库地址
* @param type string $producer 商品产地
* @param type string $invoiceType 发票类型
* @param type string $newCycle 商品上新周期
* @param type int $quarterNum 款式数量
* @param type string $supplyCycle 商品补货周期
* @param type int 1:有, 0:无 $haveStore 品牌线上店状况
* @param type json $storeInfo 品牌线下店 ['store_address' => '店铺地址', 'store_sales_volume' => '月均销售']
* @param type string $brandMaterial 品牌资料
* @param type string $goodsMaterial 当季产品
* @param type int $uid 用户ID
* @return type []
*/
public static function insertApply($brandName, $registerStatus, $sellerName, $sellerAddress, $zipCode,
$contacts, $contactPhone, $contactEmail, $sellerRole, $brandWebsite, $onlineShopWebsite, $categoryInfo,
$billingCycle, $warehouseAddress, $producer, $invoiceType, $newCycle, $quarterNum, $supplyCycle, $haveStore,
$storeInfo, $brandMaterial, $goodsMaterial, $uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.shops.insertApply';
$param['brandName'] = $brandName;
$param['registerStatus'] = $registerStatus;
$param['sellerName'] = $sellerName;
$param['sellerAddress'] = $sellerAddress;
$param['zipCode'] = $zipCode;
$param['contacts'] = $contacts;
$param['contactPhone'] = $contactPhone;
$param['contactEmail'] = $contactEmail;
$param['sellerRole'] = $sellerRole;
$param['brandWebsite'] = $brandWebsite;
$param['onlineShopWebsite'] = $onlineShopWebsite;
$param['categoryInfo'] = $categoryInfo;
$param['billingCycle'] = $billingCycle;
$param['warehouseAddress'] = $warehouseAddress;
$param['producer'] = $producer;
$param['invoiceType'] = $invoiceType;
$param['newCycle'] = $newCycle;
$param['quarterNum'] = $quarterNum;
$param['supplyCycle'] = $supplyCycle;
$param['haveStore'] = $haveStore;
$param['storeInfo'] = $storeInfo;
$param['brandMaterial'] = $brandMaterial;
$param['goodsMaterial'] = $goodsMaterial;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param);
}
/**
* 获取一级品类
* @return type []
*/
public static function getOneCategory()
{
$param = Yohobuy::param();
$param['method'] = 'app.category.queryMax';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 通过一级品类,获取二级分类
* @param type int $parentId 一级品类id
* @return type []
*/
public static function getTwoCategory($parentId)
{
$param = Yohobuy::param();
$param['method'] = 'app.category.queryMin';
$param['parent_id'] = intval($parentId);
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -376,4 +376,14 @@ class AuthCode
}
return true;
}
/**
* 对Str进行转码(主要防范+)
*
* @param String $input
* @return String
*/
public static function base64_str_encode($input)
{
return strtr($input, '+/=', '-_.');
}
}
\ No newline at end of file
... ...
... ... @@ -33,7 +33,7 @@ class Cache
* @param int $expire 缓存有效期(单位秒, 0表示永久)
* @return void
*/
public static function set($key, $value, $expire = 3600)
public static function set($key, $value, $expire = 300)
{
if (USE_CACHE) {
try {
... ...
... ... @@ -113,8 +113,8 @@ class Service extends PayAbstract
* http://www.yohobuy.com/pay/notice/alipayreturn?buyer_email=tds%40smartunite.com&buyer_id=2088302294447308&exterface=create_direct_pay_by_user&is_success=T&notify_id=RqPnCoPT3K9%252Fvwbh3I7xtEV5W65QRToFQ5fPrXsVxt12e%252FExCtC1XNiKnuRwupLaVLAR&notify_time=2011-06-11+07%3A48%3A10&notify_type=trade_status_sync&out_trade_no=1061003000&payment_type=1&seller_email=shop%40yoho.cn&seller_id=2088001550230585&subject=YOHO%E5%95%86%E5%93%81&total_fee=0.01&trade_no=2011061199833830&trade_status=TRADE_SUCCESS&sign=ca1c49f58d17eaa57aac308d0ac64434&sign_type=MD5
*/
$this->log->LogInfo("===开始解析支付宝银行的回调参数===");
$this->log->logInfo("-----回调参数为---");
$this->log->logInfo(var_export($arrResponse), true);
$this->log->LogInfo("-----回调参数为---");
$this->log->LogInfo(var_export($arrResponse, true));
if (isset($arrResponse['q'])) {
unset($arrResponse['q']);
... ...
... ... @@ -63,13 +63,13 @@ class Service extends PayAbstract
$rsp->tradeNo = $arrResponse['trade_no'];
$rsp->bankBillNo = "";
$this->log->logInfo(var_export($arrResponse, true));
$this->log->logInfo('======alimobilemini成功===');
$this->log->LogInfo(var_export($arrResponse, true));
$this->log->LogInfo('======alimobilemini成功===');
} else {
//不成功
$rsp->payResult = -1;
$this->log->logInfo(var_export($arrResponse, true));
$this->log->logInfo('======alimobilemini失败===订单号----->' . $arrResponse['out_trade_no']);
$this->log->LogInfo(var_export($arrResponse, true));
$this->log->LogInfo('======alimobilemini失败===订单号----->' . $arrResponse['out_trade_no']);
}
return $rsp;
... ...
... ... @@ -47,8 +47,8 @@ class Service extends PayAbstract
public function getPayRequestPars(Reqparams $params)
{
$this->log->LogInfo("===开始处理支付宝的请求参数===");
$this->log->logInfo("-----请求参数为---");
$this->log->logInfo(var_export($params, true));
$this->log->LogInfo("-----请求参数为---");
$this->log->LogInfo(var_export($params, true));
$baseUrl = $this->getBaseNoticeUrl($params->isTest);
// $loseTime = intval(($params->orderTime + 7200 -time())/60);
... ... @@ -101,7 +101,7 @@ class Service extends PayAbstract
'reqType' => 'get'
);
$this->log->LogInfo('----支付宝回调处理结果为----');
$this->log->LogInfo('----支付宝请求处理结果为----');
$this->log->LogInfo(var_export($result, true));
return $result;
... ... @@ -113,19 +113,19 @@ class Service extends PayAbstract
* http://www.yohobuy.com/pay/notice/alipayreturn?buyer_email=tds%40smartunite.com&buyer_id=2088302294447308&exterface=create_direct_pay_by_user&is_success=T&notify_id=RqPnCoPT3K9%252Fvwbh3I7xtEV5W65QRToFQ5fPrXsVxt12e%252FExCtC1XNiKnuRwupLaVLAR&notify_time=2011-06-11+07%3A48%3A10&notify_type=trade_status_sync&out_trade_no=1061003000&payment_type=1&seller_email=shop%40yoho.cn&seller_id=2088001550230585&subject=YOHO%E5%95%86%E5%93%81&total_fee=0.01&trade_no=2011061199833830&trade_status=TRADE_SUCCESS&sign=ca1c49f58d17eaa57aac308d0ac64434&sign_type=MD5
*/
$this->log->LogInfo("===开始解析支付宝的回调参数===");
$this->log->logInfo("-----回调参数为---");
$this->log->logInfo(var_export($arrResponse, true));
$this->log->LogInfo("-----回调参数为---");
$this->log->LogInfo(var_export($arrResponse, true));
if (isset($arrResponse['q'])) {
unset($arrResponse['q']);
}
$rsp = new Rspparams();
if (!$this->checkResponse($arrResponse)) {
$this->log->logInfo("-----支付宝回调参数验证签名失败---");
$this->log->LogInfo("-----支付宝回调参数验证签名失败---");
//验证不成功
$rsp->payResult = -1;
} else {
$this->log->logInfo("-----支付宝回调参数验证签名成功---");
$this->log->LogInfo("-----支付宝回调参数验证签名成功---");
$rsp->bankName = "";
$outTradeNo = $arrResponse["out_trade_no"];
$rsp->orderCode = $outTradeNo;
... ... @@ -138,6 +138,10 @@ class Service extends PayAbstract
$rsp->tradeNo = $arrResponse['trade_no'];
$rsp->bankBillNo = "";
}
$this->log->LogInfo("-----解析支付宝回调参数的结果为---");
$this->log->LogInfo(var_export($rsp, true));
return $rsp;
}
... ...
... ... @@ -68,16 +68,16 @@ class Service extends PayAbstract
public function parseResponse(array $arrResponse)
{
$this->log->LogInfo("===开始处理通联支付的回调参数===");
$this->log->logInfo("-----回调参数为---");
$this->log->logInfo(var_export($arrResponse, true));
$this->log->LogInfo("-----回调参数为---");
$this->log->LogInfo(var_export($arrResponse, true));
$rsp = new Rspparams();
if (!$this->checkResponse($arrResponse)) {
$this->log->logInfo("-----验证通联支付回调参数失败---");
$this->log->LogInfo("-----验证通联支付回调参数失败---");
$rsp->payResult = -1;
} else {
$this->log->logInfo("-----验证通联支付回调参数成功---");
$this->log->LogInfo("-----验证通联支付回调参数成功---");
$rsp->bankName = "";
$rsp->orderCode = $arrResponse["orderNo"];
... ...
... ... @@ -14,7 +14,7 @@ abstract class PayAbstract implements PayInterface {
*
* @var
*/
public $baseNoticeUrl = "http://www.yohobuy.com/pay/";
public $baseNoticeUrl = "http://gray.yohobuy.com/pay/";
// public $baseNoticeUrl = "http://www.yohobuy.com/pay/";
... ...
... ... @@ -32,8 +32,8 @@ class Service extends PayAbstract
{
$this->log->LogInfo("===开始处理盛付通的请求参数===");
$this->log->logInfo("-----请求参数为---");
$this->log->logInfo(var_export($params, true));
$this->log->LogInfo("-----请求参数为---");
$this->log->LogInfo(var_export($params, true));
$bankCode = $params->paymentParameter == 'platform' ? '' : $params->paymentParameter;
$baseUrl = $this->getBaseNoticeUrl($params->isTest);
... ... @@ -109,17 +109,17 @@ class Service extends PayAbstract
function parseResponse(Array $arrResponse)
{
$this->log->LogInfo("===开始处理盛付通的回调参数===");
$this->log->logInfo("-----回调参数为---");
$this->log->logInfo(var_export($arrResponse, true));
$this->log->LogInfo("-----回调参数为---");
$this->log->LogInfo(var_export($arrResponse, true));
$rsp = new Rspparams();
if (!$this->checkResponse($arrResponse)) {
$this->log->logInfo("-----验证盛付通回调参数失败---");
$this->log->LogInfo("-----验证盛付通回调参数失败---");
//验证不成功
$rsp->payResult = -1;
} else {
$this->log->logInfo("-----验证盛付通回调参数成功---");
$this->log->LogInfo("-----验证盛付通回调参数成功---");
$rsp->bankName = "";
$rsp->orderCode = $arrResponse["OrderNo"];
... ...
... ... @@ -35,8 +35,8 @@ class Service extends PayAbstract
public function getPayRequestPars(Reqparams $params)
{
$this->log->LogInfo("===开始处理财付通的请求参数===");
$this->log->logInfo("-----请求参数为---");
$this->log->logInfo(var_export($params, true));
$this->log->LogInfo("-----请求参数为---");
$this->log->LogInfo(var_export($params, true));
parent::getPayRequestPars($params);
$baseUrl = $this->getBaseNoticeUrl($params->isTest);
... ... @@ -77,8 +77,8 @@ class Service extends PayAbstract
public function parseResponse(array $arrResponse)
{
$this->log->LogInfo("===开始处理财付通的回调参数===");
$this->log->logInfo("-----回调参数为---");
$this->log->logInfo(var_export($arrResponse, true));
$this->log->LogInfo("-----回调参数为---");
$this->log->LogInfo(var_export($arrResponse, true));
$rsp = new Rspparams();
if (!$this->checkResponse($arrResponse)) {
... ...
... ... @@ -24,7 +24,7 @@ function sign(&$params)
$log->LogInfo("摘要sha1x16 >" . $params_sha1x16);
// 签名证书路径
$cert_path = dirname(__FILE__) . '/../' . SDK_SIGN_CERT_PATH;
$log->logInfo($cert_path);
$log->LogInfo($cert_path);
$private_key = getPrivateKey($cert_path);
// 签名
$sign_falg = openssl_sign($params_sha1x16, $signature, $private_key, OPENSSL_ALGO_SHA1);
... ...
... ... @@ -35,8 +35,8 @@ class Service extends PayAbstract
*/
public function parseResponse(array $package)
{
$this->log->logInfo("===开始解析银联支付的回调参数===");
$this->log->logInfo("===回调参数为===");
$this->log->LogInfo("===开始解析银联支付的回调参数===");
$this->log->LogInfo("===回调参数为===");
$this->log->LogInfo(var_export($package, true));
$verify = false;
... ... @@ -69,7 +69,7 @@ class Service extends PayAbstract
$responseData->payResult = -1;
}
$this->log->logInfo("===银联支付的回调参数处理结果为===");
$this->log->LogInfo("===银联支付的回调参数处理结果为===");
$this->log->LogInfo(var_export($responseData, true));
return $responseData;
... ...
... ... @@ -54,8 +54,8 @@ class Service extends PayAbstract
public function pay(array $orderInfo)
{
$this->log->LogInfo("===开始处理微信扫码支付的请求参数===");
$this->log->logInfo("-----请求参数为---");
$this->log->logInfo(var_export($orderInfo, true));
$this->log->LogInfo("-----请求参数为---");
$this->log->LogInfo(var_export($orderInfo, true));
//生成签名
$this->orderCode = $orderInfo['order_code'];
... ... @@ -85,8 +85,8 @@ class Service extends PayAbstract
);
$this->log->LogInfo("===开始处理微信扫码支付的支付地址===");
$this->log->logInfo("-----支付地址数据为---");
$this->log->logInfo(var_export($payUrlInfo, true));
$this->log->LogInfo("-----支付地址数据为---");
$this->log->LogInfo(var_export($payUrlInfo, true));
$payUrl = $payUrlInfo['pay_url'] . '?' . $payUrlInfo['pars'];
... ... @@ -107,8 +107,8 @@ class Service extends PayAbstract
$input->SetOut_trade_no($tradeNo);
$result = WxPayApi::orderQuery($input);
$this->log->logInfo("===查询微信扫码支付的结果结束,结果为===");
$this->log->logInfo(var_export($result, true));
$this->log->LogInfo("===查询微信扫码支付的结果结束,结果为===");
$this->log->LogInfo(var_export($result, true));
$rsp = new Rspparams();
// 支付成功
... ... @@ -124,10 +124,13 @@ class Service extends PayAbstract
$rsp->tradeNo = $result["out_trade_no"];
$rsp->bankBillNo = $result['bank_type'];
} else {
$this->log->logInfo("===微信扫码支付失败===");
$this->log->LogInfo("===微信扫码支付失败===");
$rsp->payResult = -1;
}
$this->log->LogInfo("===微信扫码支付回调参数解析结果为===");
$this->log->LogInfo(var_export($rsp, true));
return $rsp;
}
... ...
{{> layout/header}}
<div class="contact-about-page about-page center-content yoho-page">
<div class="about-nav right">
<ul>
<li><a href="/yohobuy.html">关于YOHO!有货</a></li>
<li><a href="/newpower.html">关于新力传媒</a></li>
<li class="act"><a>联系我们</a></li>
<li><a href="/privacy.html">隐私条款</a></li>
<li><a href="/link.html">友情链接</a></li>
</ul>
</div>
<div class="main-container">
<div class="text-title">联系我们</div>
<div class="text-info">
<p>
<strong>客户服务:</strong><br/>
电话:4008899646(工作日900-2230)<br/>
EMAIL:service#yoho.cn (发送邮件时请将#换成@)
</p><br/>
<p>
<strong>广告服务:</strong><br/>
北京:(+8610 56312657<br/>
上海:(+8621 51698833*8005<br/>
广州:(+8683831060<br/>
EMAIL:advertising#yoho.cn (发送邮件时请将#换成@)
</p><br/>
<p>
<strong>市场合作:</strong><br/>
北京:(+8610 56312548<br/>
上海:(+8621 51698833*8013<br/>
EMAIL:marketing#yoho.cn (发送邮件时请将#换成@)
</p><br/>
<p>
<strong>网站合作:</strong><br/>
EMAIL:community#yoho.cn (发送邮件时请将#换成@)
</p><br/>
<p>
<strong>有货品牌合作:</strong><br/>
上海:(+8621 51698833*8007<br/>
广州:(+8683831060<br/>
EMAIL:brands#yoho.cn (发送邮件时请将#换成@)
</p><br/>
<p>
<strong>有货推广合作:</strong><br/>
EMAIL:haizheng.zhao#yoho.cn (发送邮件时请将#换成@)
</p><br/>
<p>
<strong>南京新与力文化传播有限公司:</strong><br/>
地址:南京市建邺区嘉陵江东街18号国家广告产业园517,18楼<br/>
邮编:210017<br/>
电话:(+8625 87781000<br/>
传真:(+8625 87781155<br/>
</p><br/>
<p>
<strong>南京新与力文化传播有限公司北京分公司:</strong><br/>
地址:北京市朝阳区朝阳门外大街16号中国人寿大厦901室<br/>
邮编:100020<br/>
电话:(+8610 56312400<br/>
</p><br/>
<p>
<strong>南京新与力文化传播有限公司上海分公司:</strong><br/>
地址:上海市徐汇区富民路291号悟锦世纪大厦801室<br/>
邮编:200040<br/>
电话:(+8621 51698833
</p><br/>
<p>
<strong>南京新与力文化传播有限公司广州分公司:</strong><br/>
地址:广州市天河区林和西路157号保利中汇大厦A座602室<br/>
邮编:510610<br/>
电话:(+8620 83777600
</p><br/>
<p>
<strong>南京新与力文化传播有限公司香港分公司:</strong><br/>
地址:香港鰂魚涌海澤街28號東港中心1505室<br/>
电话:(+85234602671
</p><br/>
</div>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="link-about-page about-page center-content yoho-page">
<div class="about-nav right">
<ul>
<li><a href="/yohobuy.html">关于YOHO!有货</a></li>
<li><a href="/newpower.html">关于新力传媒</a></li>
<li><a href="/contact.html">联系我们</a></li>
<li><a href="/privacy.html">隐私条款</a></li>
<li class="act"><a>友情链接</a></li>
</ul>
</div>
<div class="main-container">
<div class="text-title">友情链接</div>
<div class="text-info">
<br>
<br>
<h2>文字链接:</h2>
<ul>
<li><a href="http://www.kuaidi100.com" target="_blank">快递查询</a></li>
</ul>
<h2>图片链接:</h2>
<ul class="linkpic">
<li><a href="http://www.yoho.cn" target="_blank"><img alt="YOHO!" src="http://static.yohobuy.com/images/links/yohocn.jpg"></a></li>
</ul>
</div>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="newpower-about-page about-page center-content yoho-page">
<div class="about-nav right">
<ul>
<li><a href="/yohobuy.html">关于YOHO!有货</a></li>
<li class="act"><a>关于新力传媒</a></li>
<li><a href="/contact.html">联系我们</a></li>
<li><a href="/privacy.html">隐私条款</a></li>
<li><a href="/link.html">友情链接</a></li>
</ul>
</div>
<div class="main-container">
<img src="http://static.yohobuy.com/images/aboutnewpower.jpg"/>
<div class="text-info">
<p style="font-family:微软雅黑; text-align:left;">
<span style="font-size:18px; line-height:68px;">一、公司概况:</span>
<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;YOHO!新力传媒(即南京新与力文化传播有限公司),中国潮流产业的传播者、引领者和创造者。公司致力于中国潮流产业的发展,先后推出了《YOHO!潮流志》、YOHO.CN潮流社区、YOHO!有货、YOHO!E移动客户端、YOHO!电子杂志、《YOHO! Girl》女性月刊等产品,通过媒体与商务结合,加速中国与世界潮流产业的对接,是目前中国最具影响力的多媒体平台。公司总部设立于南京,并在北京、上海、广州、香港、东京等地设立了分支机构。目前公司已经获得鼎晖投资、贝塔司曼风险投资基金、祥峰投资等投资机构融资,成为内地创新企业的代表。
<br/>
<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“年轻是种态度!”是YOHO!新力传媒的企业理念。将“YOHO!”打造成为中国年轻人最喜爱和最值得信赖的品牌,是所有YOHO!人的愿景和目标。
<br/>
<br/>
<span style="font-size:18px; line-height:68px;">二、公司主要项目:</span>
<br/>
1、平面及电子杂志
<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;《YOHO!潮流志》、《YOHO! Girl》为YOHO!旗下最具国内潮流影响力的杂志媒体。《YOHO!潮流志》200510月创刊。他是国内第一本完全原创版权的,提供潮流和lifestyle资讯,属于年轻人的潮流时尚半月刊,通过正规发行渠道(报刊亭、连锁商超等)发行至全国各大中城市,深受全国年轻人的喜爱。设计给国内年轻女性的中高端时装月刊《YOHO! Girl》,20133月正式创刊,在香港、大陆地区同步发行。以大量独家资讯加上独特的编采手法,改变读者的阅读习惯,扩阔大家在时装、美容、设计、生活、次文化等各方面的视野。深入结构品牌背后的哲学和时装趋势,带领各读者一探最新时尚。
<br/>
<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;YOHO! 电子杂志,《YOHO! 潮流志》、《YOHO! GIRL》于 iOS Android 平台触亮全球潮流资讯,7*24h 无休供应时装、运动、设计、科技、美容、家居、趣闻等严选潮流营养,并于每周发布特别线上专题,与读者 play and learn。《YOHO! 潮流志》和《YOHO! GIRL》亦于各自 app 內每周上架新鲜线上周刊,打包纸质版内容精华,汇通 YOHO! 潮流矩阵。
<br/>
<br/>
2、网络社区及移动客户端
<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;YOHO.CN —— 潮流分享社区(www.yoho.cn)。作为YOHO!跨媒体平台的第二个重要项目,20075月上线,是内地覆盖面最广、黏着性最强、活跃度最高的年轻人网络社区之一,目前已经成长为国内著名的潮流指标网站。2013年YOHO.CN全新升级,以图瀑形式为构架,以兴趣为集合点,以分享为扩散形式,结合最新的YOHO!E移动客户端,为用户提供发现潮流,分享潮流的平台!
<br/>
<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;YOHO!E,作为YOHO.CN的移动客户端,201112月上线伊始就连续被苹果官方推荐到社交频道以及app store首页,目前已经拥有超过250万下载用户,每月活跃用户高达100万。20133月新版手机端在iPhone、Andriod两大智能手机平台同步上架,带上手机便可及时获取潮流资讯、轻松关注潮流达人、拍摄编辑加标签上传,发布语音和评论等。
<br/>
<br/>
3、电子商务平台
<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;YOHO!有货 —— 年轻人潮流购物中心(www.yohobuy.com),目前是中国最大的潮流品牌商品销售平台。借助中国潮流产业的发展和YOHO!在平面媒体、网络社区、线下活动等产品的推广,从刚开始的零品牌合作发展到目前200多个品牌“入驻”销售,包括国际潮流品牌、港台知名品牌、内地原创品牌等。YOHO!有货所销售的品牌均与品牌直接签订代理协议,保持货品与国际国内实体店铺同步,并通过独家定制、限量货品等引领潮流消费。
<br/>
<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;移动版电商平台“YOHO!有货”,IOS及Android版本应用于2012年同步上线。顾客可以随时浏览最新的商品并进行购物,并在SNS平台上与朋友进行交流与分享。
<br/>
<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;目前YOHO!利用杂志、网络、移动终端、电子商务、以及线下活动等一体化跨媒体平台为潮流品牌、资源提供多元的跨媒体整合传播服务。
</p>
</div>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="privacy-about-page about-page center-content yoho-page">
<div class="about-nav right">
<ul>
<li><a href="/yohobuy.html">关于YOHO!有货</a></li>
<li><a href="/newpower.html">关于新力传媒</a></li>
<li><a href="/contact.html">联系我们</a></li>
<li class="act"><a>隐私条款</a></li>
<li><a href="/link.html">友情链接</a></li>
</ul>
</div>
<div class="main-container">
<div class="text-title">隐私条款</div>
<div class="text-info">
<p>
欢迎访问YOHO!有货!我们以本隐私申明声明对访问者隐私保护的许诺。<br>
<br>
<strong>YOHO!</strong>
<strong>有货的信息收集与使用</strong><br>
YOHO!有货收集用户提交的个人识别信息(下称“个人识别信息”), 一旦注册,YOHO!有货用户即可以建立由一页或多页网页组成的含有用户信息的用户档案。YOHO!有货 将收集用户发布在其用户档案中的数据,包括但不限于: 会员信息,联系信息,购物&amp;着装习惯和喜爱品牌(合称为“用户档案信息”),我们使用这些信息来获得用户的统计资料。我们将会用这些统计数据来给我们的用户分类,以便有针对性地向我们的用户提供新的服务。我们会通过您的邮件地址来通知您这些新的服务。<br>
<br>
YOHO!有货同样从用户处收集其他非个人识别信息(下称“非个人识别信息”),包括IP地址、集合的用户数据和浏览器类型。该等数据会被用来管理YOHO!有货网站,跟踪使用记录,改进YOHO!有货网站的服务。该等非个人识别信息通常被用于下列目的:研究和分析站点的使用情况,订制您浏览的广告和内容,满足您对服务的要求,以及改进我们的服务。出于安全和监管的目的,用户的IP地址将会被记录。<br>
<br>
YOHO!有货或其商业伙伴可能在YOHO!有货上不时地进行促销或者抽奖。用户可能会被要求提供个人识别信息,包括姓名,电子邮件地址或家庭住址。因进行促销或者抽奖而收集个人识别信息时,您将清楚地被告知个人识别信息的收集方以及适用的隐私政策。<br>
<br>
<strong>YOHO!</strong>
<strong>有货收集信息的共享与披露</strong><br>
除本隐私政策另有规定,YOHO!有货不会在未经您同意的情况下在YOHO!有货及其母公司、子公司或者关联公司(为本隐私政策之目的,包括遵守本隐私政策的技术提供者)之外泄露您的个人识别信息或者用户档案信息,除非我们认为这种披露是有必要的:(1)为遵守法律的要求或者回应YOHO!有货收到的传票、搜查令或者其他法律程序,而不论该等回应是否为适用法律所要求的;(2)为回应主管政府部门的要求;(3)为了保护公众和服务用户的安全;或者(4)为了维护YOHO!有货的法律权利和利益。<br>
当YOHO!有货出售YOHO!有货或其全部资产时,YOHO!有货保留向其继任者转让个人识别信息和用户档案信息的权利。<br>
YOHO!有货也可以向某些您明确同意接收其信息的广告合作伙伴转让您的个人识别信息和用户档案信息。因此进行个人识别信息的收集时,您将清楚地被告知适用的隐私政策。<br>
<br>
<br>
<br>
<strong>用户名和密码</strong><br>
YOHO!有货用户账号通过用户创设的密码确保其安全性。您应当对您密码的保密负全部责任。请不要和他人分享此信息。如果您泄漏了密码,您可能丢失了您的个人识别信息,并且有可能导致对您不利的司法行为。如果您和他人共享一台电脑,您应该在离开YOHO!服务时退出系统以保证您的信息不被后来使用该电脑者获取。<br>
因此不管任何原因使您的密码安全受到危及,您应该立即通过请与我们客服联系客服热线:400-889-9646和我们取得联系 。<br>
<br>
<strong>您的交易行为</strong><br>
我们跟踪IP地址仅仅只是为了安全的必要。如果我们没有发现任何安全问题,我们会及时删除我们收集到的IP地址。我们还跟踪全天的页面访问数据。全天页面访问数据被用来反映网站的流量,我们可以为未来的发展制定计划(例如,增加服务器)。<br>
<br>
<strong>邮件</strong>
<strong>/</strong>
<strong>短信</strong>
<strong>/</strong>
<strong>会刊服务</strong><br>
YOHO!有货保留通过邮件、短信、邮寄会刊的形式,对本网站注册、购物用户发送订单信息、促销活动等告知服务的权利。如果您在YOHO!有货注册、购物,表明您已默示同意接受此项服务。如果您不想接收来自YOHO!有货的邮件、短信或会刊,您可以向YOHO!有货客服提出退阅申请,并注明您的E-mail地址、手机号或相关地址信息,YOHO!有货会在收到申请后为您办理退阅。<br>
<br>
<strong>Cookies</strong>
<strong>的使用</strong><br>
YOHO!有货使用cookies来储存用户的喜好和记录活动信息以确保用户不会重复收到同样的广告和定制的时事通讯、广告以及基于浏览器类型和用户档案信息的网页内容。我们不会把在cookies中保存的信息与您在我们网站上提交的任何个人识别信息相连接。您可以通过设置您的浏览器以接受或者拒绝全部或部分的cookies,或要求在cookies被设置时通知您。由于每个浏览器是不同的,请查看浏览器的“帮助”菜单来了解如何更改您的cookies选择参数。但是,您应允许来自YOHO!有货的cookies以使您可以使用网站的更多的功能。<br>
<br>
<strong>外部链接</strong><br>
YOHO!有货包含其他网站的链接。YOHO!有货不对其他网站上的隐私政策和/或其执行承担责任。当链接到其他网站时,用户应该阅读该网站贴示的隐私政策。我们的隐私政策仅适用于YOHO!有货收集的信息。<br>
<br>
<strong>第三方广告</strong><br>
YOHO!有货可能会通过与第三方合作向用户提供YOHO!服务。因此,YOHO!有货可能向该第三方提供您提交给YOHO!有货的个人识别信息和用户档案信息;但该第三方应同意承担与YOHO!有货相同的责任以保护用户的隐私。另外,在不会披露用户的个人识别信息和用户档案信息的前提下,YOHO!有货可以对集合的用户个人识别信息和用户档案进行分析和商业性使用。<br>
<br>
<strong>安全</strong><br>
我们网站有相应的安全措施来确保我们掌握的信息不丢失,不被滥用和变造。这些安全措施包括向其它服务器备份数据和对用户密码。<br>
<br>
YOHO!有货会采取合理的防范措施以确保用户个人识别信息和用户档案信息的保密性。我们会采取合理措施保护存储在我们数据库中的用户个人识别信息和用户档案信息,并且对那些需要履行其工作职责的雇员,比如我们的客户服务人员和技术人员,获取用户个人识别信息和用户档案信息进行限制。请注意,我们无法保证用户个人识别信息和用户档案信息的安全性。未授权的登陆或使用、硬件或软件的故障、以及其他因素均可能在任何时候危及用户个人识别信息的安全性。<br>
<br>
<strong>隐私政策的变更</strong><br>
我们可能对本隐私政策不时进行修改。如果我们进行任何修改,我们将在YOHO!有货主页上发布为期30天的通知以使用户知道被修改内容的类型以及指示用户审阅更新的隐私政策。如果您在对本隐私政策任何细微修改发布后继续使用网站,则表示您同意遵守任何该等修改。<br>
<br>
<strong>联系我们</strong><br>
如果您就本隐私政策有任何疑问,请与我们客服联系客服热线:400-889-9646。<br>
</p>
</div>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="yohobuy-about-page about-page center-content yoho-page">
<div class="about-nav right">
<ul>
<li class="act"><a>关于YOHO!有货</a></li>
<li><a href="/newpower.html">关于新力传媒</a></li>
<li><a href="/contact.html">联系我们</a></li>
<li><a href="/privacy.html">隐私条款</a></li>
<li><a href="/link.html">友情链接</a></li>
</ul>
</div>
<div class="main-container">
<img src="http://static.yohobuy.com/images/about.jpg" />
<div class="text-info">
<p style="font-family:微软雅黑; text-align:left;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“YOHO!有货”——年轻人潮流购物中心,(
<a style=" font:#000;" href="http://www.yohobuy.com" target="_blank">www.yohobuy.com</a>
)Yoho!有货为南京新与力文化传播有限公司旗下网上商城,目前是中国最大的潮流品牌商品销售平台之一。借助中国潮流产业的发展和YOHO!在平面媒体、网络社区、线下活动等产品的推广,从刚开始的零品牌合作发展到目前200多个品牌“入驻”销售,包括国际潮流品牌、港台知名品牌、内地原创品牌等。<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;同样秉承YOHO!“年轻是种态度”的口号,YOHO!有货专注于中国潮流趋势和受众的需要,凭借专业的买手团队和对中国潮流趋势敏锐的嗅觉,积极开拓符合中国年轻人喜爱的品牌和商品。YOHO!有货所销售的品牌均与品牌直接签订销售协议,保持货品与国际国内实体店铺同步,并通过独家定制、限量货品等引领潮流消费。
</p>
<p><img src="http://static.yohobuy.com/images/v2/activity/about_yohobuy.jpg" /></p>
</div>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="app-download-page download-page yoho-page">
<div class="top-wrapper">
<div class="top-down">
<a href="http://itunes.apple.com/us/app/id490655927?ls=1&amp;mt=8" target="_blank" class="down-btns"></a>
<a href="http://yoho-apps.qiniudn.com/YohoBuy_YOHO.apk" target="_blank" class="down-btns"></a>
</div>
</div>
<div class="main-wrapper">
<div class="intro intro-1">
{{#if devEnv}}
<img src="http://webstatic.dev.yohobuy.com/img/download/intro-1.jpg">
{{^}}
<img src="http://cdn.yoho.cn/yohobuy/assets/img/download/intro-1.jpg">
{{/if}}
</div>
<div class="intro intro-2">
{{#if devEnv}}
<img src="http://webstatic.dev.yohobuy.com/img/download/intro-2.jpg">
{{^}}
<img src="http://cdn.yoho.cn/yohobuy/assets/img/download/intro-2.jpg">
{{/if}}
</div>
<div class="intro intro-3">
{{#if devEnv}}
<img src="http://webstatic.dev.yohobuy.com/img/download/intro-3.jpg">
{{^}}
<img src="http://cdn.yoho.cn/yohobuy/assets/img/download/intro-3.jpg">
{{/if}}
</div>
<div class="intro intro-4">
{{#if devEnv}}
<img src="http://webstatic.dev.yohobuy.com/img/download/intro-4.jpg">
{{^}}
<img src="http://cdn.yoho.cn/yohobuy/assets/img/download/intro-4.jpg">
{{/if}}
</div>
<div class="intro intro-5">
{{#if devEnv}}
<img src="http://webstatic.dev.yohobuy.com/img/download/intro-5.png">
{{^}}
<img src="http://cdn.yoho.cn/yohobuy/assets/img/download/intro-5.png">
{{/if}}
</div>
<div class="intro intro-6">
{{#if devEnv}}
<img src="http://webstatic.dev.yohobuy.com/img/download/intro-6.jpg">
{{^}}
<img src="http://cdn.yoho.cn/yohobuy/assets/img/download/intro-6.jpg">
{{/if}}
<div class="bottom-down">
<div class="qr-code right"></div>
<a href="http://itunes.apple.com/us/app/id490655927?ls=1&amp;mt=8" target="_blank" class="down-app-btn down-btns"></a>
<a href="http://yoho-apps.qiniudn.com/YohoBuy_YOHO.apk" target="_blank" class="down-apk-btn down-btns"></a>
</div>
</div>
</div>
<div class="foot-wrapper">
<a href="http://app.yohoshow.com/" target="_blank">
{{#if devEnv}}
<img src="http://webstatic.dev.yohobuy.com/img/download/main-bottom.jpg">
{{^}}
<img src="http://cdn.yoho.cn/yohobuy/assets/img/download/main-bottom.jpg">
{{/if}}
</a>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -637,7 +637,7 @@
{ event: "setAccount", account: 16184 },
{ event: "setCustomerId", id: "{{uid}}" },
{ event: "setSiteType", type: "d" },
{ event: "viewItem", item: "{{productId}}" }
{ event: "viewItem", item: "{{skn}}" }
);
</script>
<script type="text/javascript">
... ... @@ -645,10 +645,10 @@ var _mvq = _mvq || [];
_mvq.push(['$setAccount', 'm-23428-1']);
_mvq.push(['$setGeneral', 'goodsdetail', '', /*用户名*/ '', /*用户id*/ '']);
_mvq.push(['$logConversion']);
_mvq.push(['$addGoods', /*分类id*/ '', /*品牌id*/ '', /*商品名称*/ '',/*商品ID*/ '{{productId}}',/*商品售价*/ '',/*商品图片url*/ '', /*分类名*/ '',/*品牌名*/ '', /*商品库存状态1或是0*/ '', /*网络价*/ '',/*收藏人数*/ '']);
_mvq.push(['$addGoods', /*分类id*/ '', /*品牌id*/ '', /*商品名称*/ '',/*商品ID*/ '{{skn}}',/*商品售价*/ '',/*商品图片url*/ '', /*分类名*/ '',/*品牌名*/ '', /*商品库存状态1或是0*/ '', /*网络价*/ '',/*收藏人数*/ '']);
_mvq.push(['$logData']);
var _goodsData = {
id:'{{productId}}',// 商品ID
id:'{{skn}}',// 商品ID
name:'{{productName}}', // 商品名称
brand:'{{brandName}}', // 商品品牌(非必填)
origPrice:'{{marketPrice}}', // 商品原价(非必填)
... ...
{{> layout/header}}
<div class="settled-apply-page yoho-page">
{{#if devEnv}}
<img class="banner center-content" src="http://webstatic.dev.yohobuy.com/img/about/apply.png">
{{^}}
<img class="banner center-content" src="http://cdn.yoho.cn/yohobuy/assets/img/about/apply.png">
{{/if}}
<div class="apply-body center-content">
<div class="title">
{{#if devEnv}}
<img class="edit-img" src="http://webstatic.dev.yohobuy.com/img/about/edit.png">
{{^}}
<img class="edit-img" src="http://cdn.yoho.cn/yohobuy/assets/img/about/edit.png">
{{/if}}
<span>填写卖家信息:</span>
</div>
<form action="/shop/settled/applysave" method="post">
<div class="form-container">
<table class="signup-form">
<tbody><tr>
<td>
<span class="required-mark">*</span>
品牌名称:
</td>
<td>
<input id="brand-name" name="brand-name" class="long-input va va-null" type="text" placeholder="添加名称">
</td>
</tr>
<tr class="has-sub has-radio">
<td>
<span class="required-mark">*</span>
品牌注册情况:
</td>
<td>
<input type="radio" name="register-status" checked="" value="已申请">已申请
<input type="radio" name="register-status" value="已注册">已注册
<input type="radio" name="register-status" value="未注册">未注册
</td>
</tr>
<tr class="sub tip-sub">
<td></td>
<td class="tip-td">
<p class="tip">
(仅限中国区,港澳台除外)
</p>
</td>
</tr>
<tr class="has-sub">
<td>
<span class="required-mark">*</span>
公司名称:
</td>
<td>
<input id="company-name" name="seller-name" class="long-input va va-null" type="text" placeholder="添加名称">
</td>
</tr>
<tr class="sub tip-sub">
<td></td>
<td class="tip-td">
<p class="tip">
(需与收款开票的公司名称一致)
</p>
</td>
</tr>
<tr class="has-sub">
<td>
<span class="required-mark">*</span>
公司地址:
</td>
<td>
<input id="company-address" name="seller-address" class="long-input va va-null" type="text" placeholder="添加地址">
</td>
</tr>
<tr>
<td>
<span class="required-mark">*</span>
邮编:
</td>
<td>
<input id="postcode" name="zip-code" class="long-input va va-postcode" type="text" placeholder="添加邮编">
</td>
</tr>
<tr>
<td>
<span class="required-mark">*</span>
联系人:
</td>
<td>
<input id="contact-person" name="contacts" class="long-input va va-null" type="text" placeholder="添加联系人">
</td>
</tr>
<tr>
<td>
<span class="required-mark">*</span>
电话:
</td>
<td>
<input id="phone-number" name="contact-phone" class="long-input va va-phone" type="text" placeholder="添加电话">
</td>
</tr>
<tr>
<td>
<span class="required-mark">*</span>
邮箱:
</td>
<td>
<input id="email" name="contact-email" class="long-input va va-email" type="text" placeholder="添加邮箱">
</td>
</tr>
<tr class="has-radio">
<td>
<span class="required-mark">*</span>
与品牌关系:
</td>
<td>
<input type="radio" name="seller-role" checked="" value="品牌商">品牌商
<input type="radio" name="seller-role" value="代理商">代理商
<input type="radio" name="seller-role" value="经销商">经销商
<input type="radio" name="seller-role" value="">其他
<input id="other-brand-relation" class="hide for-other va" type="text" name="other-seller-role">
</td>
</tr>
<tr>
<td>
品牌官网:
</td>
<td>
<input class="long-input" name="brand-website" type="text" placeholder="输入官网url">
</td>
</tr>
<tr>
<td>
其他线上店铺链接:
</td>
<td>
<input class="long-input" name="online-shop-website" type="text" placeholder="输入店铺url">
</td>
</tr>
<tr>
<td>
<span class="required-mark">*</span>
主要品类:
</td>
<td>
{{> about/category}}
{{#if devEnv}}
<img id="category-add" class="category-add add-btn" src="http://webstatic.dev.yohobuy.com/img/about/add.png">
{{^}}
<img id="category-add" class="category-add add-btn" src="http://cdn.yoho.cn/yohobuy/assets/img/about/add.png">
{{/if}}
</td>
</tr>
<tr class="hide sub">
<td></td>
<td>
<ul id="category-list" class="category-list"></ul>
</td>
</tr>
<tr>
<td>
结算周期:
</td>
<td>
月结
<input type="hidden" name="billing-cycle" value="月结">
</td>
</tr>
<tr>
<td>
<span class="required-mark">*</span>
仓库地址:
</td>
<td>
<input id="warehouse-province" name="warehouse-province" class="short-input va va-null" type="text" placeholder="输入省份">
<input id="warehouse-city" name="warehouse-city" class="short-input va va-null" type="text" placeholder="输入市">
</td>
</tr>
<tr>
<td>
<span class="required-mark">*</span>
商品产地:
</td>
<td>
<input id="origin-country" name="origin-country" class="short-input va va-null" type="text" placeholder="输入国家">
<input id="origin-province" name="origin-province" class="short-input va va-null" type="text" placeholder="输入省份">
<input id="origin-city" name="origin-city" class="short-input va va-null" type="text" placeholder="输入市">
</td>
</tr>
<tr class="has-radio">
<td>
<span class="required-mark">*</span>
发票类型:
</td>
<td>
<input type="radio" name="invoice-type" checked="" value="17%的增值税发票">17%的增值税发票
<input type="radio" name="invoice-type" value="3%的代开增值税发票">3%的代开增值税发票
<input type="radio" name="invoice-type" value="普通商业发票">普通商业发票
</td>
</tr>
<tr class="has-radio">
<td>
<span class="required-mark">*</span>
商品上新周期:
</td>
<td>
<input type="radio" name="new-cycle" checked="" value="每周">每周
<input type="radio" name="new-cycle" value="每两周">每两周
<input type="radio" name="new-cycle" value="每月">每月
<input type="radio" name="new-cycle" value="每季度">每季度
<input type="radio" name="new-cycle" value="每半年">每半年
<input type="radio" name="new-cycle" value="">其他
<input id="other-new-period" class="hide for-other" type="text" name="orther-new-cycle">
</td>
</tr>
<tr>
<td>
<span class="required-mark">*</span>
每季度可提供款式数量:
</td>
<td>
<input id="style-count" class="long-input va va-null" name="quarter-num" type="text" placeholder="输入具体的数值">
</td>
</tr>
<tr class="has-radio">
<td>
<span class="required-mark">*</span>
商品补货周期:
</td>
<td>
<input type="radio" name="supply-cycle" checked="" value="每周">每周
<input type="radio" name="supply-cycle" value="每两周">每两周
<input type="radio" name="supply-cycle" value="每月">每月
<input type="radio" name="supply-cycle" value="每季度">每季度
<input type="radio" name="supply-cycle" value="不提供补货">不提供补货
<input type="radio" name="supply-cycle" value="">其他
<input id="other-replenishment-period" class="hide for-other" type="text" name="orther-supply-cycle">
</td>
</tr>
<tr class="has-sub has-radio">
<td>
品牌线下店状况:
</td>
<td>
<input type="radio" name="have-store" value="1">有
<input type="radio" name="have-store" value="0" checked="">无
</td>
</tr>
<tr id="shop-list" class="sub shop-list hide">
<td></td>
<td>
<ul id="shops">
<li>
<input class="shop-addres" name="store-address[]" type="text" placeholder="输入店铺地址">
月均销售:
<input class="shop-sales-volume" name="store-sales-volume[]" type="text" placeholder="输入价格">
{{#if devEnv}}
<img class="shop-add add-btn" src="http://webstatic.dev.yohobuy.com/img/about/add.png">
{{^}}
<img class="shop-add add-btn" src="http://cdn.yoho.cn/yohobuy/assets/img/about/add.png">
{{/if}}
</li>
</ul>
</td>
</tr>
<tr class="has-sub">
<td>
品牌资料:
</td>
<td>
<input type="file" id="upload-brand-material" name="brand-material" value="上传">
<input type="hidden" id="brand-material" name="brand-material" value="">
</td>
<td>
</td>
</tr>
<tr class="sub">
<td></td>
<td class="tip-td">
<p class="tip brand-tip">
(点击上传品牌资料,ppt / pdf,大小不超过10M, 提示上传成功后即可提交)
</p>
</td>
</tr>
<tr class="has-sub tip-sub">
<td>
当季产品:
</td>
<td>
<input type="file" id="upload-goods-material" value="上传">
<input type="hidden" id="goods-material" name="goods-material" value="">
</td>
</tr>
<tr class="sub tip-sub">
<td></td>
<td>
<p class="tip goods-tip">
(点击上传产品列表,excel表格,大小不超过10M, 提示上传成功后即可提交)
</p>
</td>
</tr>
</tbody></table>
</div>
<input type="button" id="apply-post" class="submit-btn" value="提交申请">
</form>
<input type="hidden" id="upload-key" value="{{uploadKey}}">
</div>
<script id="category-tpl" type="text/html">
{{> about/category}}
</script>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="settled-page center-content yoho-page">
<a href="/settled/apply">
{{#if devEnv}}
<img class="banner" src="http://webstatic.dev.yohobuy.com/img/about/banner.jpg">
{{^}}
<img class="banner" src="http://cdn.yoho.cn/yohobuy/assets/img/about/banner.jpg">
{{/if}}
</a>
<div class="flow-container">
{{#if devEnv}}
<img class="flow-path" src="http://webstatic.dev.yohobuy.com/img/about/flow.jpg">
{{^}}
<img class="flow-path" src="http://cdn.yoho.cn/yohobuy/assets/img/about/flow.jpg">
{{/if}}
<div id="fake-link" class="fake-link"></div>
</div>
<div id="mask" class="mask hide"></div>
<div id="notice-container" class="notice-container hide">
{{#if devEnv}}
<img src="http://webstatic.dev.yohobuy.com/img/about/note.png?1461857729">
{{^}}
<img src="http://cdn.yoho.cn/yohobuy/assets/img/about/note.png?1461857729">
{{/if}}
<div id="fake-close" class="fake-close"></div>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
<select id="category-one" name="category-one[]" class="category-item short-input category-one">
<option selected>选择一级品类</option>
{{# oneCategory}}
<option value="{{id}}">{{name}}</option>
{{/oneCategory}}
</select>
<select id="category-two" name="category-two[]" class="category-item short-input category-two">
<option selected="" value="">选择二级品类</option>
</select>
<span>价格段:</span>
<select id="category-price" name="category-price[]" class="category-item short-input">
<option selected>选择价格段</option>
<option value="100以下">100以下</option>
<option value="100-200">100-200</option>
<option value="200-300">200-300</option>
<option value="300-400">300-400</option>
<option value="400-500">400-500</option>
<option value="500-600">500-600</option>
<option value="700-800">700-800</option>
<option value="800-900">800-900</option>
<option value="900-1000">900-1000</option>
<option value="1000-1500">1000-1500</option>
<option value="1500-2000">1500-2000</option>
<option value="大于2000">大于2000</option>
</select>
\ No newline at end of file
... ...
... ... @@ -341,7 +341,7 @@
<p>
<a href="http://www.yohobuy.com">返回首页</a>
<span>|</span>
<a href="http://www.yohobuy.com">YOHO!有货</a>
<a href="http://www.yohobuy.com/yohobuy.html">YOHO!有货</a>
<span>|</span>
<a href="http://www.yohobuy.com/newpower.html">新力传媒</a>
<span>|</span>
... ...
... ... @@ -169,115 +169,15 @@
</div>
<div class="goods-price float-left">
<h3 class="priceandnum">
<span class="price">\{\{show_price\}\}</span>
<span class="price">\{\{show_price\}\}</span>
x
<span class="num">\{\{buy_number\}\}</span>
</h3>
<a href="javascript:void(0)" class="delete goodscardelete" goodsid=\{\{goods_incart_id\}\} cheapest=\{\{is_cheapest_free\}\}>删除</a>
<a href="javascript:void(0)" class="delete goodscardelete" product_sku=\{\{product_sku\}\} promotion_id=\{\{promotion_id\}\}>删除</a>
</div>
</li>
\{{/notzero}}
\{\{/main_goods\}\}
\{\{#advance_goods\}\}
\{{#notzero buy_number}}
<li class="goods-item">
<a href="\{\{product_url\}\}">
<img src="\{\{default_img\}\}" alt="" class="goods-img"></a>
<div class="goods-detail float-left">
<h3 class="content"><a href="\{\{product_url\}\}">\{\{product_name\}\}</a></h3>
<h3 class="style">
颜色:
<span class="color">\{\{color_name\}\}</span>
尺码:
<span class="size">\{\{size_name\}\}</span>
</h3>
</div>
<div class="goods-price float-left">
<h3 class="priceandnum">
<span class="price">\{\{show_price\}\}</span>
x
<span class="num">\{\{buy_number\}\}</span>
</h3>
<a href="javascript:void(0)" class="delete goodscardelete" goodsid=\{\{goods_incart_id\}\} cheapest=\{\{is_cheapest_free\}\}>删除</a>
</div>
</li>
\{{/notzero}}
\{\{/advance_goods\}\}
\{\{# outlet_goods\}\}
\{{#notzero buy_number}}
<li class="goods-item">
<a href="\{\{product_url\}\}">
<img src="\{\{default_img\}\}" alt="" class="goods-img"></a>
<div class="goods-detail float-left">
<h3 class="content"><a href="\{\{product_url\}\}">\{\{product_name\}\}</a></h3>
<h3 class="style">
颜色:
<span class="color">\{\{color_name\}\}</span>
尺码:
<span class="size">\{\{size_name\}\}</span>
</h3>
</div>
<div class="goods-price float-left">
<h3 class="priceandnum">
<span class="price">\{\{show_price\}\}</span>
x
<span class="num">\{\{buy_number\}\}</span>
</h3>
<a href="javascript:void(0)" class="delete goodscardelete" goodsid=\{\{goods_incart_id\}\} cheapest=\{\{is_cheapest_free\}\}>删除</a>
</div>
</li>
\{{/notzero}}
\{\{/outlet_goods\}\}
\{\{#gift_goods\}\}
\{{#notzero buy_number}}
<li class="goods-item">
<a href="\{\{product_url\}\}">
<img src="\{\{default_img\}\}" alt="" class="goods-img"></a>
<div class="goods-detail float-left">
<h3 class="content"><a href="\{\{product_url\}\}">\{\{product_name\}\}</a></h3>
<h3 class="style">
颜色:
<span class="color">\{\{color_name\}\}</span>
尺码:
<span class="size">\{\{size_name\}\}</span>
</h3>
</div>
<div class="goods-price float-left">
<h3 class="priceandnum">
<span class="price">\{\{show_price\}\}</span>
x
<span class="num">\{\{buy_number\}\}</span>
</h3>
<a href="javascript:void(0)" class="delete goodscardelete" goodsid=\{\{goods_incart_id\}\} cheapest=\{\{is_cheapest_free\}\}>删除</a>
</div>
</li>
\{{/notzero}}
\{\{/gift_goods\}\}
\{\{#need_pay_gifts\}\}
\{{#notzero buy_number}}
<li class="goods-item">
<a href="\{\{product_url\}\}">
<img src="\{\{default_img\}\}" alt="" class="goods-img"></a>
<div class="goods-detail float-left">
<h3 class="content"><a href="\{\{product_url\}\}">\{\{product_name\}\}</a></h3>
<h3 class="style">
颜色:
<span class="color">\{\{color_name\}\}</span>
尺码:
<span class="size">\{\{size_name\}\}</span>
</h3>
</div>
<div class="goods-price float-left">
<h3 class="priceandnum">
<span class="price">\{\{show_price\}\}</span>
x
<span class="num">\{\{buy_number\}\}</span>
</h3>
<a href="javascript:void(0)" class="delete goodscardelete" goodsid=\{\{goods_incart_id\}\} cheapest=\{\{is_cheapest_free\}\}>删除</a>
</div>
</li>
\{{/notzero}}
\{\{/need_pay_gifts\}\}
</ul>
<ul class="activity-list">
\{{#if has_promotion\}\}
... ... @@ -368,5 +268,6 @@
</script>
</div>
<input id="api-domain" type="hidden" value="{{apiDomain}}">
<script src="{{sysUserSession}}"></script>
{{/headerdata}}
... ...
<script>
seajs.use('js/common');
</script>
{{!-- 正常头部 --}}
{{#headerdata}}
<script>
seajs.use('js/header');
</script>
{{/headerdata}}
{{!-- 简单头部 --}}
{{#simpleHeader}}
<script>
seajs.use('js/simple-header');
</script>
{{/simpleHeader}}
{{!-- 首页 --}}
{{#if boysHomePage}}
<script>
seajs.use('js/index/index');
</script>
{{/if}}
{{!-- 搜索 --}}
{{#if searchListPage}}
<script>
seajs.use('js/product/brand');
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
product.init(5);
window.onresize = function () {
setTimeout(function () {
product.init(5);
}, 300);
};
});
</script>
{{/if}}
{{!-- 品牌 --}}
{{#if brandPage}}
<script>
seajs.use('js/product/brand');
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
product.init(4);
window.onresize = function () {
setTimeout(function () {
product.init(4);
}, 300);
};
});
</script>
{{/if}}
{{!-- 列表 --}}
{{#if productListPage}}
<script>
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
product.init(4);
window.onresize = function () {
setTimeout(function () {
product.init(4);
}, 300);
};
});
</script>
{{/if}}
{{!-- 商品详情页 --}}
{{#if productDetailPage}}
<script>
seajs.use('js/product/item');
</script>
{{/if}}
{{!-- 逛 --}}
{{#if guangIndexPage}}
<script>
seajs.use('js/guang/index');
</script>
{{/if}}
{{!-- 逛详情页 --}}
{{#if guangDetailPage}}
<script>
seajs.use('js/guang/detail');
</script>
{{/if}}
{{!-- 逛列表页 --}}
{{#if guangListPage}}
<script>
seajs.use('js/guang/list');
</script>
{{/if}}
{{!-- SALE --}}
{{#if saleIndexPage}}
<script>
seajs.use('js/sale/index');
</script>
{{/if}}
{{!-- sale列表 --}}
{{#if saleListPage}}
<script>
seajs.use(['js/product/list', 'js/product/product', 'js/sale/banner'], function (list, product) {
product.init(4);
window.onresize = function () {
setTimeout(function () {
product.init(4);
}, 300);
};
});
</script>
{{/if}}
{{!-- sale 分类列表 --}}
{{#if saleCatPage}}
<script>
seajs.use(['js/product/list', 'js/product/product', 'js/sale/banner'], function (list, product) {
product.init(4);
window.onresize = function () {
setTimeout(function () {
product.init(4);
}, 300);
};
});
</script>
{{/if}}
{{!-- 登录注册找回密码--}}
{{#if loginPage}}
<script>
seajs.use('js/passport/login');
</script>
{{/if}}
{{!-- 第三方绑定--}}
{{#if thirdLogin}}
<script>
seajs.use('js/passport/thirdlogin');
</script>
{{/if}}
{{#if enablePerfectInformation}}
<script>
seajs.use('js/passport/third-pwd');
</script>
{{/if}}
{{#if thirdRelatePage}}
<script>
seajs.use('js/passport/relate');
</script>
{{/if}}
{{!-- 注册页--}}
{{#if registerPage}}
<script>
seajs.use('js/passport/reg', function (reg) {
reg.init('reg');
});
</script>
{{/if}}
{{!-- 第三方登录完善信息页--}}
{{#if thirdPage}}
<script>
seajs.use('js/passport/reg', function (reg) {
reg.init('third');
});
</script>
{{/if}}
{{!-- 找回密码--}}
{{#if backPage}}
<script>
seajs.use('js/passport/back');
</script>
{{/if}}
{{!-- 重置密码--}}
{{#if resetPage}}
<script>
seajs.use('js/passport/reset');
</script>
{{/if}}
{{!-- 验证手机 --}}
{{#if vertificationPage}}
<script>
seajs.use('js/passport/vertification');
</script>
{{/if}}
{{!-- 热销排行--}}
{{#if hotrankPage}}
<script>
seajs.use('js/product/hotrank');
</script>
{{/if}}
{{!-- 品牌页 --}}
{{#if brandsHomePage}}
<script>
seajs.use('js/brand/index');
</script>
{{/if}}
{{!-- 订单确认--}}
{{#if orderEnsurePage}}
<script>
seajs.use('js/order/ensure');
</script>
{{/if}}
{{!-- 个人中心首页 --}}
{{#if meIndexPage}}
<script>
seajs.use('js/home/index');
</script>
{{/if}}
{{!-- 个人中心订单 --}}
{{#if meOrdersPage}}
<script>
seajs.use('js/home/orders');
</script>
{{/if}}
{{!-- 个人中心我的收藏 --}}
{{#if meFavoritePage}}
<script>
seajs.use('js/home/favorite');
</script>
{{/if}}
{{!-- 个人中心我的YOHO币 --}}
{{#if meCurrencyPage}}
<script>
seajs.use('js/home/currency');
</script>
{{/if}}
{{!-- 个人中心我的退换货 --}}
{{#if meReturnsPage}}
<script>
seajs.use('js/home/returns');
</script>
{{/if}}
{{!-- 个人中心我的评论 --}}
{{#if meCommentPage}}
<script>
seajs.use('js/home/comment');
</script>
{{/if}}
{{!-- 个人中心我的投诉 --}}
{{#if meComplaintsPage}}
<script>
seajs.use('js/home/complaints');
</script>
{{/if}}
{{!-- 个人中心我的信息 --}}
{{#if meMessagePage}}
<script>
seajs.use('js/home/message');
</script>
{{/if}}
{{!-- 个人中心编辑个人资料 --}}
{{#if meEditPage}}
<script>
seajs.use('js/home/edit');
</script>
{{/if}}
{{!-- 个人中心兑换礼品卡 --}}
{{#if meGiftPage}}
<script>
seajs.use('js/home/gift');
</script>
{{/if}}
{{!-- 个人中心账号安全验证 --}}
{{#if meValidatePage}}
<script>
seajs.use('js/home/validate');
seajs.use('js/passport/mail-phone-regx');
</script>
{{/if}}
{{!-- 个人中心地址管理 --}}
{{#if meAddressPage}}
<script>
seajs.use('js/home/address');
seajs.use('js/home/common-address');
</script>
{{/if}}
{{!-- 帮助中心搜索 --}}
{{#if helpSearchPage}}
<script>
seajs.use('js/help/search');
</script>
{{/if}}
{{!-- 购物车 --}}
{{#if cartEnsurePage}}
<script>
seajs.use('js/cart/cart');
</script>
{{/if}}
{{!-- 支付页面 --}}
{{#if payPage}}
<script>
seajs.use('js/shopping/pay');
</script>
{{/if}}
{{!-- 微信支付 --}}
{{#if wechatqrcodePage}}
<script>
seajs.use('js/pay/wechatqrcode');
</script>
{{/if}}
{{!-- 商家入驻 --}}
{{#if settledPage}}
<script>
seajs.use('js/about/settled');
</script>
{{/if}}
\ No newline at end of file
<script>
seajs.use('js/common');
</script>
{{!-- 正常头部 --}}
{{#headerdata}}
<script>
seajs.use('js/header');
</script>
{{/headerdata}}
{{!-- 简单头部 --}}
{{#simpleHeader}}
<script>
seajs.use('js/simple-header');
</script>
{{/simpleHeader}}
{{!-- 首页 --}}
{{#if boysHomePage}}
<script>
seajs.use('js/index/index');
</script>
{{/if}}
{{!-- 搜索 --}}
{{#if searchListPage}}
<script>
seajs.use('js/product/brand');
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
product.init(5);
window.onresize = function () {
setTimeout(function () {
product.init(5);
}, 300);
};
});
</script>
{{/if}}
{{!-- 品牌 --}}
{{#if brandPage}}
<script>
seajs.use('js/product/brand');
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
product.init(4);
window.onresize = function () {
setTimeout(function () {
product.init(4);
}, 300);
};
});
</script>
{{/if}}
{{!-- 列表 --}}
{{#if productListPage}}
<script>
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
product.init(4);
window.onresize = function () {
setTimeout(function () {
product.init(4);
}, 300);
};
});
</script>
{{/if}}
{{!-- 商品详情页 --}}
{{#if productDetailPage}}
<script>
seajs.use('js/product/item');
</script>
{{/if}}
{{!-- 逛 --}}
{{#if guangIndexPage}}
<script>
seajs.use('js/guang/index');
</script>
{{/if}}
{{!-- 逛详情页 --}}
{{#if guangDetailPage}}
<script>
seajs.use('js/guang/detail');
</script>
{{/if}}
{{!-- 逛列表页 --}}
{{#if guangListPage}}
<script>
seajs.use('js/guang/list');
</script>
{{/if}}
{{!-- SALE --}}
{{#if saleIndexPage}}
<script>
seajs.use('js/sale/index');
</script>
{{/if}}
{{!-- sale列表 --}}
{{#if saleListPage}}
<script>
seajs.use(['js/product/list', 'js/product/product', 'js/sale/banner'], function (list, product) {
product.init(4);
window.onresize = function () {
setTimeout(function () {
product.init(4);
}, 300);
};
});
</script>
{{/if}}
{{!-- sale 分类列表 --}}
{{#if saleCatPage}}
<script>
seajs.use(['js/product/list', 'js/product/product', 'js/sale/banner'], function (list, product) {
product.init(4);
window.onresize = function () {
setTimeout(function () {
product.init(4);
}, 300);
};
});
</script>
{{/if}}
{{!-- 登录注册找回密码--}}
{{#if loginPage}}
<script>
seajs.use('js/passport/login');
</script>
{{/if}}
{{!-- 第三方绑定--}}
{{#if thirdLogin}}
<script>
seajs.use('js/passport/thirdlogin');
</script>
{{/if}}
{{#if enablePerfectInformation}}
<script>
seajs.use('js/passport/third-pwd');
</script>
{{/if}}
{{#if thirdRelatePage}}
<script>
seajs.use('js/passport/relate');
</script>
{{/if}}
{{!-- 注册页--}}
{{#if registerPage}}
<script>
seajs.use('js/passport/reg', function (reg) {
reg.init('reg');
});
</script>
{{/if}}
{{!-- 第三方登录完善信息页--}}
{{#if thirdPage}}
<script>
seajs.use('js/passport/reg', function (reg) {
reg.init('third');
});
</script>
{{/if}}
{{!-- 找回密码--}}
{{#if backPage}}
<script>
seajs.use('js/passport/back');
</script>
{{/if}}
{{!-- 重置密码--}}
{{#if resetPage}}
<script>
seajs.use('js/passport/reset');
</script>
{{/if}}
{{!-- 验证手机 --}}
{{#if vertificationPage}}
<script>
seajs.use('js/passport/vertification');
</script>
{{/if}}
{{!-- 热销排行--}}
{{#if hotrankPage}}
<script>
seajs.use('js/product/hotrank');
</script>
{{/if}}
{{!-- 品牌页 --}}
{{#if brandsHomePage}}
<script>
seajs.use('js/brand/index');
</script>
{{/if}}
{{!-- 订单确认--}}
{{#if orderEnsurePage}}
<script>
seajs.use('js/order/ensure');
</script>
{{/if}}
{{!-- 个人中心首页 --}}
{{#if meIndexPage}}
<script>
seajs.use('js/home/index');
</script>
{{/if}}
{{!-- 个人中心订单 --}}
{{#if meOrdersPage}}
<script>
seajs.use('js/home/orders');
</script>
{{/if}}
{{!-- 个人中心我的收藏 --}}
{{#if meFavoritePage}}
<script>
seajs.use('js/home/favorite');
</script>
{{/if}}
{{!-- 个人中心我的YOHO币 --}}
{{#if meCurrencyPage}}
<script>
seajs.use('js/home/currency');
</script>
{{/if}}
{{!-- 个人中心我的退换货 --}}
{{#if meReturnsPage}}
<script>
seajs.use('js/home/returns');
</script>
{{/if}}
{{!-- 个人中心我的评论 --}}
{{#if meCommentPage}}
<script>
seajs.use('js/home/comment');
</script>
{{/if}}
{{!-- 个人中心我的投诉 --}}
{{#if meComplaintsPage}}
<script>
seajs.use('js/home/complaints');
</script>
{{/if}}
{{!-- 个人中心我的信息 --}}
{{#if meMessagePage}}
<script>
seajs.use('js/home/message');
</script>
{{/if}}
{{!-- 个人中心编辑个人资料 --}}
{{#if meEditPage}}
<script>
seajs.use('js/home/edit');
</script>
{{/if}}
{{!-- 个人中心兑换礼品卡 --}}
{{#if meGiftPage}}
<script>
seajs.use('js/home/gift');
</script>
{{/if}}
{{!-- 个人中心账号安全验证 --}}
{{#if meValidatePage}}
<script>
seajs.use('js/home/validate');
seajs.use('js/passport/mail-phone-regx');
</script>
{{/if}}
{{!-- 个人中心地址管理 --}}
{{#if meAddressPage}}
<script>
seajs.use('js/home/address');
seajs.use('js/home/common-address');
</script>
{{/if}}
{{!-- 帮助中心搜索 --}}
{{#if helpSearchPage}}
<script>
seajs.use('js/help/search');
</script>
{{/if}}
{{!-- 购物车 --}}
{{#if cartEnsurePage}}
<script>
seajs.use('js/cart/cart');
</script>
{{/if}}
{{!-- 支付页面 --}}
{{#if payPage}}
<script>
seajs.use('js/shopping/pay');
</script>
{{/if}}
{{!-- 微信支付 --}}
{{#if wechatqrcodePage}}
<script>
seajs.use('js/pay/wechatqrcode');
</script>
{{/if}}
{{!-- 商家入驻 --}}
{{#if settledPage}}
<script>
seajs.use('js/about/settled');
</script>
{{/if}}
{{!-- 领券频道 --}}
{{#if couponCenterPage}}
<script>
seajs.use('js/coupon/coupon');
</script>
{{/if}}
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.

29.4 KB | W: 0px | H: 0px

25.4 KB | W: 0px | H: 0px

  • 2-up
  • Swipe
  • Onion skin

29.4 KB | W: 0px | H: 0px

25.4 KB | W: 0px | H: 0px

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -42,4 +42,10 @@ require('./js/shopping/pay');
//微信扫码支付
require('./js/pay/wechatqrcode');
//关于我们
require('./js/about/entry');
//领券频道
//require('./js/coupon/entry');
module.exports = webYohobuy;
... ...
/**
* 逛打包入口
* @author: yyqing<yanqing.yang@yoho.cn>
* @date: 2016/4/14
*/
require('./settled');
... ...
/**
* 商家入驻
* @author: xuqi<qi.xu@yoho>
* @date: 2016/3/24
*/
var $ = require('yoho.jquery');
var reg = require('../passport/mail-phone-regx');
require('yoho.placeholder');
require('../../plugin/jquery.upload');
//入口页
(function() {
var $mask,
$dialog;
if ($('.settled-page').length === 0) {
return;
}
$mask = $('#mask');
$dialog = $('#notice-container');
function showNotice() {
$mask.removeClass('hide');
$dialog.removeClass('hide');
}
function hideNotice() {
$mask.addClass('hide');
$dialog.addClass('hide');
}
$('#fake-link').click(showNotice);
$('#fake-close').click(hideNotice);
$('#mask').click(hideNotice);
}());
//申请页
(function() {
var $otherBr,
$otherNp,
$otherRp,
$categoryUl,
$shopListTr,
$shops,
$panel;
var $postcode,
$email,
$phoneNum;
var categoryHtml = $('#category-tpl').html();
var Dialog = require('../common/dialog').Dialog;
var successDialog;
if ($('.settled-apply-page').length < 0) {
return;
}
$('[placeholder]').placeholder();
$otherBr = $('#other-brand-relation');
$otherNp = $('#other-new-period');
$otherRp = $('#other-replenishment-period');
$categoryUl = $('#category-list');
$shopListTr = $('#shop-list');
$shops = $('#shops');
$panel = $('#mask, #submit-success');
$postcode = $('#postcode');
$email = $('#email');
$phoneNum = $('#phone-number');
function initUpload(arr) {
$.each(arr, function(k, v) {
$('#' + v.dom).upload({
auto: true,
buttonClass: 'upload-btn',
uploadScript: v.url,
fileObjName: 'fileData',
fileSizeLimit: 10000,
buttonText: '上传',
height: 34,
width: 150,
multi: false,
onUploadComplete: function(file, data) {
v.callback(JSON.parse(data));
},
onError: function(info, fileType, data) {
var msg = '图片上传失败!';
if (info === 'FILE_SIZE_LIMIT_EXCEEDED') {
msg = '图片大小超出限制!';
}
alert(msg);
}
});
});
}
function validate() {
var pass = true,
postcodeReg = /[0-9]\d{5}(?!\d)/,
emailReg = reg.emailRegx,
phoneReg = reg.phoneRegx['+86'];
$('.va, .category-item select, .for-other, .category-item').removeClass('error');
$('.va-null').each(function() {
if ($(this).val() === '') {
$(this).addClass('error');
pass = false;
}
});
if ($postcode.val() === '' || !postcodeReg.test($postcode.val())) {
$postcode.addClass('error');
pass = false;
}
if ($email.val() === '' || !emailReg.test($email.val())) {
$email.addClass('error');
pass = false;
}
if ($phoneNum.val() === '' || !(phoneReg.test($phoneNum.val()))) {
$phoneNum.addClass('error');
pass = false;
}
$('.category-item').each(function() {
if ($(this).get(0).selectedIndex === 0) {
$(this).addClass('error');
pass = false;
}
});
if ($('input[name="seller-role"]:checked').index() === 3 &&
$otherBr.val() === '') {
pass = false;
$otherBr.addClass('error');
}
if ($('input[name="new_cycle"]:checked').index() === 5 &&
$otherNp.val() === '') {
pass = false;
$otherNp.addClass('error');
}
if ($('input[name="supply_cycle"]:checked').index() === 5 &&
$otherRp.val() === '') {
pass = false;
$otherRp.addClass('error');
}
return pass;
}
function addCategoryUI() {
$categoryUl.closest('tr').removeClass('hide');
$categoryUl.append('<li>' + categoryHtml + '</li>');
}
//获取二级分类的方法
function getCategoryTwo() {
var id = $(this).val();
var $categoryTwo = $(this).parent().find('.category-two');
var html = '<option>选择二级分类</option>';
if (id === '') {
$categoryTwo.html(html);
return;
}
$.ajax({
url: '/shop/settled/getTwoCategory',
type: 'GET',
data: {
id: id
}
}).then(function(data) {
var res = [];
var key;
if (data.code === 200) {
res = data.data;
for (key = 0; key < res.length; key++) {
html += '<option value="' + res[key].id + '" >' + res[key].name + '</option>';
}
}
$categoryTwo.html(html);
});
}
// 初始化上传插件
initUpload([
{
dom: 'upload-brand-material',
url: '/shop/settled/uploadPdf',
callback: function(data) {
if (data.code === 200) {
$('#brand-material').val(data.list[0].relUrl);
$('.brand-tip').html('上传成功');
alert('上传成功!');
} else {
$('.brand-tip').html('(点击上传品牌资料,ppt / pdf,大小不超过10M, 提示上传成功后即可提交)');
alert(data.message);
}
}
},
{
dom: 'upload-goods-material',
url: '/shop/settled/uploadExcel',
callback: function(data) {
if (data.code === 200) {
$('#goods-material').val(data.list[0].relUrl);
$('.goods-tip').html('上传成功');
alert('上传成功!');
} else {
$('.goods-tip').html('(点击上传产品列表,excel表格,大小不超过10M, 提示上传成功后即可提交)');
alert(data.message);
}
}
}
]);
// 提交成功
if (location.search.indexOf('state=1') > -1) {
successDialog = new Dialog({
className: 'settled-success',
closeIcon: false,
content: '<h1 class="main-title">恭喜您已提交成功</h1><h2 class="sub-title">我们将尽快与您联系</h2>',
btns: [
{
id: 'apply-success-ok',
btnClass: ['apply-success-ok'],
name: '确认',
cb: function() {
location.href = '/shop/settled/index';
}
}
]
});
successDialog.show();
return;
}
$('input[name="seller_role"]').change(function() {
if ($(this).index() === 3) {
$otherBr.removeClass('hide');
} else {
$otherBr.addClass('hide');
}
});
$('input[name="new-cycle"]').change(function() {
if ($(this).index() === 5) {
$otherNp.removeClass('hide');
} else {
$otherNp.addClass('hide');
}
});
$('input[name="supply-cycle"]').change(function() {
if ($(this).index() === 5) {
$otherRp.removeClass('hide');
} else {
$otherRp.addClass('hide');
}
});
$('input[name="have-store"]').change(function() {
if ($(this).index() === 1) {
$shopListTr.addClass('hide');
} else {
$shopListTr.removeClass('hide');
}
});
$('.form-container').on('change', '.category-one', getCategoryTwo);
$('#category-add').click(addCategoryUI);
$shops.delegate('.shop-add', 'click', function() {
$shops.append(
'<li>' +
'<input class="shop-addres" name="store-address[]" type="text" placeholder="输入店铺地址">' +
'<span>月均销售:</span>' +
'<input class="shop-sales-volume" type="text" name="store-sales-volume[]" placeholder="输入价格">' +
'<span>元</span>' +
'</li>'
);
});
$('#apply-post').click(function() {
var scrollTo;
if (validate()) {
$panel.removeClass('hide');
$('form').submit();
} else {
$('.error').first().focus();
scrollTo = $('.error').first().offset().top;
$(window).scrollTop(scrollTo - 10);
}
});
/**
* 商家入驻
* @author: xuqi<qi.xu@yoho>
* @date: 2016/3/24
*/
var $ = require('yoho.jquery');
var reg = require('../passport/mail-phone-regx');
require('yoho.placeholder');
require('../../plugin/jquery.qupload');
//入口页
(function() {
var $mask,
$dialog;
if ($('.settled-page').length === 0) {
return;
}
$mask = $('#mask');
$dialog = $('#notice-container');
function showNotice() {
var wh = $(window).height();
$mask.removeClass('hide');
$dialog.css({
'max-height': wh - 60
}).removeClass('hide');
}
function hideNotice() {
$mask.addClass('hide');
$dialog.addClass('hide');
}
$('#fake-link').click(showNotice);
$('#fake-close').click(hideNotice);
$('#mask').click(hideNotice);
}());
//申请页
(function() {
var $otherBr,
$otherNp,
$otherRp,
$categoryUl,
$shopListTr,
$shops,
$panel;
var $postcode,
$email,
$phoneNum,
$upKey,
$styleCount;
var categoryHtml = $('#category-tpl').html();
var Dialog = require('../common/dialog').Dialog;
var successDialog,
SWFUpload = window.SWFUpload,
upKey;
if ($('.settled-apply-page').length < 0) {
return;
}
$('[placeholder]').placeholder();
$otherBr = $('#other-brand-relation');
$otherNp = $('#other-new-period');
$otherRp = $('#other-replenishment-period');
$categoryUl = $('#category-list');
$shopListTr = $('#shop-list');
$shops = $('#shops');
$panel = $('#mask, #submit-success');
$postcode = $('#postcode');
$email = $('#email');
$phoneNum = $('#phone-number');
$upKey = $('#upload-key');
$styleCount = $('#style-count');
upKey = $upKey.val();
$upKey.remove();
function initUpload(arr) {
$.each(arr, function(k, v) {
$('#' + v.dom).qupload({
uploadKey: upKey,
button_image_url: '',
button_text: '<span class="btn_upload_text">上传</span>',
button_text_style:
'.btn_upload_text{color:#000;margin-left:30px;' +
'line-height: 2em;font-size:14px;}',
button_text_left_padding: 32,
button_text_top_padding: 8,
button_width: 160,
button_height: 35,
button_action: SWFUpload.BUTTON_ACTION.SELECT_FILE,//单选
file_size_limit: '10240',
file_types: v.type,
uploadSuccessed: function(serverData) {
var data = JSON.parse(serverData);
if (data.code !== 12) {
alert(data.message);
return false;
}
v.callback(data.data.hit.Filedata.return_file_path);
}
});
});
}
function validate() {
var pass = true,
postcodeReg = /[0-9]\d{5}(?!\d)/,
emailReg = reg.emailRegx,
phoneReg = reg.phoneRegx['+86'],
styleCountReg = /^(0|[1-9][0-9]*)$/;
$('.va, .category-item select, .for-other, .category-item').removeClass('error');
$('.va-null').each(function() {
if ($(this).val() === '') {
$(this).addClass('error');
pass = false;
}
});
if ($postcode.val() === '' || !postcodeReg.test($postcode.val())) {
$postcode.addClass('error');
pass = false;
}
if ($email.val() === '' || !emailReg.test($email.val())) {
$email.addClass('error');
pass = false;
}
if ($phoneNum.val() === '' || !(phoneReg.test($phoneNum.val()))) {
$phoneNum.addClass('error');
pass = false;
}
if ($styleCount.val() === '' || !(styleCountReg.test($styleCount.val()))) {
$styleCount.addClass('error');
pass = false;
}
$('.category-item').each(function() {
if ($(this).get(0).selectedIndex === 0) {
$(this).addClass('error');
pass = false;
}
});
if ($('input[name="seller-role"]:checked').index() === 3 &&
$otherBr.val() === '') {
pass = false;
$otherBr.addClass('error');
}
if ($('input[name="new_cycle"]:checked').index() === 5 &&
$otherNp.val() === '') {
pass = false;
$otherNp.addClass('error');
}
if ($('input[name="supply_cycle"]:checked').index() === 5 &&
$otherRp.val() === '') {
pass = false;
$otherRp.addClass('error');
}
return pass;
}
function addCategoryUI() {
$categoryUl.closest('tr').removeClass('hide');
$categoryUl.append('<li>' + categoryHtml + '</li>');
}
//获取二级分类的方法
function getCategoryTwo() {
var id = $(this).val();
var $categoryTwo = $(this).parent().find('.category-two');
var html = '<option>选择二级分类</option>';
if (id === '') {
$categoryTwo.html(html);
return;
}
$.ajax({
url: '/shop/settled/getTwoCategory',
type: 'GET',
data: {
id: id
}
}).then(function(data) {
var res = [];
var key;
if (data.code === 200) {
res = data.data;
for (key = 0; key < res.length; key++) {
html += '<option value="' + res[key].id + '" >' + res[key].name + '</option>';
}
}
$categoryTwo.html(html);
});
}
// 初始化上传插件
initUpload([
{
dom: 'upload-brand-material',
type: '*.ppt;*.pdf;*.zip;*.rar',
callback: function(data) {
$('#brand-material').val(data);
$('.brand-tip').html('上传成功');
alert('上传成功!');
}
},
{
dom: 'upload-goods-material',
type: '*.xls;*.xlsx;*.zip;*.rar',
callback: function(data) {
$('#goods-material').val(data);
$('.goods-tip').html('上传成功');
alert('上传成功!');
}
}
]);
// 提交成功
if (location.search.indexOf('state=1') > -1) {
successDialog = new Dialog({
className: 'settled-success',
closeIcon: false,
content: '<h1 class="main-title">恭喜您已提交成功</h1><h2 class="sub-title">我们将尽快与您联系</h2>',
btns: [
{
id: 'apply-success-ok',
btnClass: ['apply-success-ok'],
name: '确认',
cb: function() {
location.href = '/shop/settled/index';
}
}
]
});
successDialog.show();
return;
}
$('input[name="seller_role"]').change(function() {
if ($(this).index() === 3) {
$otherBr.removeClass('hide');
} else {
$otherBr.addClass('hide');
}
});
$('input[name="new-cycle"]').change(function() {
if ($(this).index() === 5) {
$otherNp.removeClass('hide');
} else {
$otherNp.addClass('hide');
}
});
$('input[name="supply-cycle"]').change(function() {
if ($(this).index() === 5) {
$otherRp.removeClass('hide');
} else {
$otherRp.addClass('hide');
}
});
$('input[name="have-store"]').change(function() {
if ($(this).index() === 1) {
$shopListTr.addClass('hide');
} else {
$shopListTr.removeClass('hide');
}
});
$('.form-container').on('change', '.category-one', getCategoryTwo);
$('#category-add').click(addCategoryUI);
$shops.delegate('.shop-add', 'click', function() {
$shops.append(
'<li>' +
'<input class="shop-addres" name="store-address[]" type="text" placeholder="输入店铺地址">' +
'<span>月均销售:</span>' +
'<input class="shop-sales-volume" type="text" name="store-sales-volume[]" placeholder="输入价格">' +
'<span>元</span>' +
'</li>'
);
});
$('#apply-post').click(function() {
var scrollTo;
if (validate()) {
$panel.removeClass('hide');
$('form').submit();
} else {
$('.error').first().focus();
scrollTo = $('.error').first().offset().top;
$(window).scrollTop(scrollTo - 10);
}
});
if (navigator.userAgent.indexOf('MSIE') >= 0) {
$('[placeholder]').focus(function() {
var $input = $(this);
$input.removeClass('placeholder');
}).blur(function() {
var $input = $(this);
if ($input.val() === '') {
$input.addClass('placeholder');
}
});
}
}());
\ No newline at end of file
... ...
... ... @@ -33,7 +33,7 @@ function actionSubscription() {
if (email !== '' && emailReg.test(email)) {
try {
$.ajax({
url: 'http://new.yohobuy.com/common/emailsubscriber',
url: 'http://www.yohobuy.com/common/emailSubscriber',
dataType: 'jsonp',
data: {
email: email,
... ... @@ -94,7 +94,7 @@ function actionhomeFootChange() {
});
$.ajax({
url: 'http://new.yohobuy.com/common/suggestfeedback',
url: 'http://www.yohobuy.com/common/suggestFeedback',
dataType: 'jsonp',
data: {
feedback_id: _feedback || 0,
... ...
... ... @@ -8,7 +8,7 @@ var handlebars = require('yoho.handlebars');
var json2 = require('json2');
var vipInfoCombine = null; //用户信息编译模板
var loginInfoCombine = null; //登录信息编译模板
var apiDomain = $('#api-domain').val(); //获取数据的地址
// var apiDomain = $('#api-domain').val(); //获取数据的地址
var cartTpl = ''; //购物车模板
/**
* 搜寻的时候过滤非法字符(+-/:等非法字符单独出现)
... ... @@ -253,9 +253,11 @@ function actionGoodsCart() {
}
params = $.extend(defaults, options);
params.page = params.page || 1;
if (params.method === '') {
return false;
}
// if (params.method === '') {
// return false;
// }
try {
$.getJSON(domain + '/?callback=?', params, function(_data) {
if (onSuccess !== '') {
... ... @@ -353,19 +355,18 @@ function JsonPCallBack(data) {
'style="height:36px;border:none;background-image:url(' + window.unescape(data.data.src) + ');' +
'background-position: center;display:block;">&nbsp;</a>';
} else {
topbanner = '<div class="noticewrapper">' +
'<div class="noticecontainer">' +
'<h1 class="noticetitle">关于系统升级的公告</h1>' +
'<div class="noticecontent">' +
'<p class="tips">尊敬的顾客:</p>' +
'<p class="detail">您好!为了向您提供更优质的服务,目前系统正在升级,请耐心等待。</p>' +
'<p class="detail">' +
'系统升级期间,部分地区用户体验会有暂时中断,如遇紧急事宜,欢迎垂询客服热线:400-889-9646 09:00-22:30(周一至周日)。稍后系统将恢复正常' +
'</p>' +
'<p class="detail">使用,欢迎您继续光顾YOHO!BUY有货!带来不便之处深表歉意,请您谅解!</p>' +
'</div>' +
topbanner = '<div class="yoho-notice">' +
'<div class="notice-container center-content">' +
'<h1 class="notice-title">关于系统升级的公告</h1>' +
'<div class="notice-content">' +
'<p class="tips">尊敬的顾客:</p>' +
'<p class="detail">您好!为了向您提供更优质的服务,目前系统正在升级,请耐心等待。</p>' +
'<p class="detail">系统升级期间,部分地区用户体验会有暂时中断,如遇紧急事宜,欢迎垂询客服热线:' +
'400-889-9646 09:00-22:30(周一至周日)。稍后系统将恢复正常' +
'使用,欢迎您继续光顾YOHO!BUY有货!带来不便之处深表歉意,请您谅解!</p>' +
'</div>' +
'</div>' +
'</div>';
'</div>';
}
$('body').prepend(topbanner);
}
... ... @@ -1107,10 +1108,7 @@ function loadCartData() {
shoppingData,
strK;
$.getData(apiDomain, {
method: 'open.Shoppingcart.getCartData',
shopping_key: $.getShoppingKey()
}, function(jsonData) {
$.getData('http://www.yohobuy.com/common/shoppingCart', '', function(jsonData) {
if (cartTpl === '') {
cartTpl = handlebars.compile($('#mini-cart-tpl').html());
}
... ... @@ -1143,12 +1141,14 @@ function loadCartData() {
* @param {Boolean} isreduce [description]
* @return {[type]} [description]
*/
function delCartGoods(id, isreduce) {
$.getData(apiDomain, {
method: 'open.Shoppingcart.delone',
shopping_key: $.getShoppingKey(),
id: id,
isreduce: isreduce
function delCartGoods(productSku, promotionId, productNum) {
$.getData('http://www.yohobuy.com/common/delCartGoods', {
// shopping_key: $.getShoppingKey(),
product_sku: productSku,
promotion_id: promotionId,
product_num: productNum
}, function(jsonData) {
var shoppingInfo = window.cookie('_g');
var shoppingData = json2.parse(shoppingInfo);
... ... @@ -1169,15 +1169,14 @@ function delCartGoods(id, isreduce) {
* @return {[type]} [description]
*/
function actionListenDelCarGoods() {
var $delcargoods;
var goodsid,
cheapest;
var $delcargoods, productSku, promotionId, productNum;
$(document).on('click', '.goodscardelete', function(e) {
$delcargoods = $(this);
goodsid = $delcargoods.attr('goodsid');
cheapest = $delcargoods.attr('cheapest');
delCartGoods(goodsid, cheapest);
productSku = $delcargoods.attr('product_sku');
promotionId = $delcargoods.attr('promotion_id');
productNum = $delcargoods.prev('h3').find('.num').html();
delCartGoods(productSku, promotionId, productNum);
});
}
/**
... ... @@ -1405,12 +1404,12 @@ function actionLoginState(_data) {
var char = '';
var user = info.split('::');
var userName = user[0] || ' ';
var _logout = 'http://www.yohobuy.com/logout_';
var _logout = 'http://www.yohobuy.com/logout.html';
var islogin = '1';
var _num = 0;
var data = {
user_name: name,
logout: _logout + _data.data.token + '.html',
logout: _logout,
random: Math.random()
};
... ... @@ -1459,7 +1458,7 @@ function actionLoginState(_data) {
if (/http:\/\//.test(user[3])) {
_logout = user[3].replace('www.yohobuy.com', 'www.yohobuy.com');
} else {
_logout = 'http://www.yohobuy.com/logout_' + user[3] + '.html';
_logout = 'http://www.yohobuy.com/logout.html';
}
if (_data.result === -1) {
islogin = '-1';
... ... @@ -1517,11 +1516,8 @@ function actionVipInfo(_data) {
* @return {[type]} [description]
*/
function actionLoginInfo() {
var param = {
method: 'open.passport.get'
};
$.getData(apiDomain, param, function(_data) {
$.getData('http://www.yohobuy.com/common/passport', '', function(_data) {
if (_data.result !== -1) {
actionLoginState(_data); // 更改登录状态
actionVipInfo(_data); //获得vip;
... ...
... ... @@ -20,7 +20,7 @@ var $latestWalkCount = $('#latest-walk-count');
tpl = Handlebars.compile($('#latest-walk-tpl').html());
$.ajax({
url: 'http://itemapi.yohobuy.com/item/item/recentreview',
url: 'http://www.yohobuy.com/common/recentReview',
dataType: 'jsonp',
data: {
limit: $latestWalkCount.val()
... ...
... ... @@ -71,7 +71,7 @@ function setLoginStatus(data) {
name = formatUsernName(info.profile_name);
loginHtml = '<span>Hi~</span>' +
'<a href="http://www.yohobuy.com/home?t=' + info.random + '">' + name + '</a>&nbsp;' +
'<a href="http://www.yohobuy.com/logout_' + info.token + '.html">[退出]</a>';
'<a href="http://www.yohobuy.com/logout.html">[退出]</a>';
} else {
loginHtml = '<span>Hi~</span>&nbsp;' +
'<a href="http://www.yohobuy.com/signin.html">[请登录]</a>&nbsp;' +
... ... @@ -86,11 +86,10 @@ function setLoginStatus(data) {
*/
function actionLoginInfo() {
var param = {
return_type: 'jsonp',
method: 'open.passport.get'
return_type: 'jsonp'
};
$.getJSON(apiDomain + '/?callback=?', param, function(_data) {
$.getJSON('http://www.yohobuy.com/common/passport' + '/?callback=?', param, function(_data) {
if (_data && _data.data) {
setLoginStatus(_data.data);
}
... ...
{
"name": "web-yohobuy",
"version": "0.0.21",
"version": "0.0.22",
"description": "web yohobuy static",
"keywords": [],
"homepage": "",
... ...
/* jscs: disable */
/* jshint ignore:start */
var jQuery = require('yoho.jquery');
(function(r) {
r.fn.qrcode = function(h) {
var s;
function u(a) {
this.mode = s;
this.data = a
}
function o(a, c) {
this.typeNumber = a;
this.errorCorrectLevel = c;
this.modules = null;
this.moduleCount = 0;
this.dataCache = null;
this.dataList = []
}
function q(a, c) {
if (void 0 == a.length) throw Error(a.length + "/" + c);
for (var d = 0; d < a.length && 0 == a[d];) d++;
this.num = Array(a.length - d + c);
for (var b = 0; b < a.length - d; b++) this.num[b] = a[b + d]
}
function p(a, c) {
this.totalCount = a;
this.dataCount = c
}
function t() {
this.buffer = [];
this.length = 0
}
u.prototype = {
getLength: function() {
return this.data.length
},
write: function(a) {
for (var c = 0; c < this.data.length; c++) a.put(this.data.charCodeAt(c), 8)
}
};
o.prototype = {
addData: function(a) {
this.dataList.push(new u(a));
this.dataCache = null
},
isDark: function(a, c) {
if (0 > a || this.moduleCount <= a || 0 > c || this.moduleCount <= c) throw Error(a + "," + c);
return this.modules[a][c]
},
getModuleCount: function() {
return this.moduleCount
},
make: function() {
if (1 > this.typeNumber) {
for (var a = 1, a = 1; 40 > a; a++) {
for (var c = p.getRSBlocks(a, this.errorCorrectLevel), d = new t, b = 0, e = 0; e < c.length; e++) b += c[e].dataCount;
for (e = 0; e < this.dataList.length; e++) c = this.dataList[e], d.put(c.mode, 4), d.put(c.getLength(), j.getLengthInBits(c.mode, a)), c.write(d);
if (d.getLengthInBits() <= 8 * b) break
}
this.typeNumber = a
}
this.makeImpl(!1, this.getBestMaskPattern())
},
makeImpl: function(a, c) {
this.moduleCount = 4 * this.typeNumber + 17;
this.modules = Array(this.moduleCount);
for (var d = 0; d < this.moduleCount; d++) {
this.modules[d] = Array(this.moduleCount);
for (var b = 0; b < this.moduleCount; b++) this.modules[d][b] = null
}
this.setupPositionProbePattern(0, 0);
this.setupPositionProbePattern(this.moduleCount -
7, 0);
this.setupPositionProbePattern(0, this.moduleCount - 7);
this.setupPositionAdjustPattern();
this.setupTimingPattern();
this.setupTypeInfo(a, c);
7 <= this.typeNumber && this.setupTypeNumber(a);
null == this.dataCache && (this.dataCache = o.createData(this.typeNumber, this.errorCorrectLevel, this.dataList));
this.mapData(this.dataCache, c)
},
setupPositionProbePattern: function(a, c) {
for (var d = -1; 7 >= d; d++)
if (!(-1 >= a + d || this.moduleCount <= a + d))
for (var b = -1; 7 >= b; b++) - 1 >= c + b || this.moduleCount <= c + b || (this.modules[a + d][c + b] =
0 <= d && 6 >= d && (0 == b || 6 == b) || 0 <= b && 6 >= b && (0 == d || 6 == d) || 2 <= d && 4 >= d && 2 <= b && 4 >= b ? !0 : !1)
},
getBestMaskPattern: function() {
for (var a = 0, c = 0, d = 0; 8 > d; d++) {
this.makeImpl(!0, d);
var b = j.getLostPoint(this);
if (0 == d || a > b) a = b, c = d
}
return c
},
createMovieClip: function(a, c, d) {
a = a.createEmptyMovieClip(c, d);
this.make();
for (c = 0; c < this.modules.length; c++)
for (var d = 1 * c, b = 0; b < this.modules[c].length; b++) {
var e = 1 * b;
this.modules[c][b] && (a.beginFill(0, 100), a.moveTo(e, d), a.lineTo(e + 1, d), a.lineTo(e + 1, d + 1), a.lineTo(e, d + 1), a.endFill())
}
return a
},
setupTimingPattern: function() {
for (var a = 8; a < this.moduleCount - 8; a++) null == this.modules[a][6] && (this.modules[a][6] = 0 == a % 2);
for (a = 8; a < this.moduleCount - 8; a++) null == this.modules[6][a] && (this.modules[6][a] = 0 == a % 2)
},
setupPositionAdjustPattern: function() {
for (var a = j.getPatternPosition(this.typeNumber), c = 0; c < a.length; c++)
for (var d = 0; d < a.length; d++) {
var b = a[c],
e = a[d];
if (null == this.modules[b][e])
for (var f = -2; 2 >= f; f++)
for (var i = -2; 2 >= i; i++) this.modules[b + f][e + i] = -2 == f || 2 == f || -2 == i || 2 == i || 0 == f && 0 == i ? !0 : !1
}
},
setupTypeNumber: function(a) {
for (var c =
j.getBCHTypeNumber(this.typeNumber), d = 0; 18 > d; d++) {
var b = !a && 1 == (c >> d & 1);
this.modules[Math.floor(d / 3)][d % 3 + this.moduleCount - 8 - 3] = b
}
for (d = 0; 18 > d; d++) b = !a && 1 == (c >> d & 1), this.modules[d % 3 + this.moduleCount - 8 - 3][Math.floor(d / 3)] = b
},
setupTypeInfo: function(a, c) {
for (var d = j.getBCHTypeInfo(this.errorCorrectLevel << 3 | c), b = 0; 15 > b; b++) {
var e = !a && 1 == (d >> b & 1);
6 > b ? this.modules[b][8] = e : 8 > b ? this.modules[b + 1][8] = e : this.modules[this.moduleCount - 15 + b][8] = e
}
for (b = 0; 15 > b; b++) e = !a && 1 == (d >> b & 1), 8 > b ? this.modules[8][this.moduleCount -
b - 1
] = e : 9 > b ? this.modules[8][15 - b - 1 + 1] = e : this.modules[8][15 - b - 1] = e;
this.modules[this.moduleCount - 8][8] = !a
},
mapData: function(a, c) {
for (var d = -1, b = this.moduleCount - 1, e = 7, f = 0, i = this.moduleCount - 1; 0 < i; i -= 2)
for (6 == i && i--;;) {
for (var g = 0; 2 > g; g++)
if (null == this.modules[b][i - g]) {
var n = !1;
f < a.length && (n = 1 == (a[f] >>> e & 1));
j.getMask(c, b, i - g) && (n = !n);
this.modules[b][i - g] = n;
e--; - 1 == e && (f++, e = 7)
}
b += d;
if (0 > b || this.moduleCount <= b) {
b -= d;
d = -d;
break
}
}
}
};
o.PAD0 = 236;
o.PAD1 = 17;
o.createData = function(a, c, d) {
for (var c = p.getRSBlocks(a,
c), b = new t, e = 0; e < d.length; e++) {
var f = d[e];
b.put(f.mode, 4);
b.put(f.getLength(), j.getLengthInBits(f.mode, a));
f.write(b)
}
for (e = a = 0; e < c.length; e++) a += c[e].dataCount;
if (b.getLengthInBits() > 8 * a) throw Error("code length overflow. (" + b.getLengthInBits() + ">" + 8 * a + ")");
for (b.getLengthInBits() + 4 <= 8 * a && b.put(0, 4); 0 != b.getLengthInBits() % 8;) b.putBit(!1);
for (; !(b.getLengthInBits() >= 8 * a);) {
b.put(o.PAD0, 8);
if (b.getLengthInBits() >= 8 * a) break;
b.put(o.PAD1, 8)
}
return o.createBytes(b, c)
};
o.createBytes = function(a, c) {
for (var d =
0, b = 0, e = 0, f = Array(c.length), i = Array(c.length), g = 0; g < c.length; g++) {
var n = c[g].dataCount,
h = c[g].totalCount - n,
b = Math.max(b, n),
e = Math.max(e, h);
f[g] = Array(n);
for (var k = 0; k < f[g].length; k++) f[g][k] = 255 & a.buffer[k + d];
d += n;
k = j.getErrorCorrectPolynomial(h);
n = (new q(f[g], k.getLength() - 1)).mod(k);
i[g] = Array(k.getLength() - 1);
for (k = 0; k < i[g].length; k++) h = k + n.getLength() - i[g].length, i[g][k] = 0 <= h ? n.get(h) : 0
}
for (k = g = 0; k < c.length; k++) g += c[k].totalCount;
d = Array(g);
for (k = n = 0; k < b; k++)
for (g = 0; g < c.length; g++) k < f[g].length &&
(d[n++] = f[g][k]);
for (k = 0; k < e; k++)
for (g = 0; g < c.length; g++) k < i[g].length && (d[n++] = i[g][k]);
return d
};
s = 4;
for (var j = {
PATTERN_POSITION_TABLE: [
[],
[6, 18],
[6, 22],
[6, 26],
[6, 30],
[6, 34],
[6, 22, 38],
[6, 24, 42],
[6, 26, 46],
[6, 28, 50],
[6, 30, 54],
[6, 32, 58],
[6, 34, 62],
[6, 26, 46, 66],
[6, 26, 48, 70],
[6, 26, 50, 74],
[6, 30, 54, 78],
[6, 30, 56, 82],
[6, 30, 58, 86],
[6, 34, 62, 90],
[6, 28, 50, 72, 94],
[6, 26, 50, 74, 98],
[6, 30, 54, 78, 102],
[6, 28, 54, 80, 106],
[6, 32, 58, 84, 110],
[6, 30, 58, 86, 114],
[6, 34, 62, 90, 118],
[6, 26, 50, 74, 98, 122],
[6, 30, 54, 78, 102, 126],
[6, 26, 52,
78, 104, 130
],
[6, 30, 56, 82, 108, 134],
[6, 34, 60, 86, 112, 138],
[6, 30, 58, 86, 114, 142],
[6, 34, 62, 90, 118, 146],
[6, 30, 54, 78, 102, 126, 150],
[6, 24, 50, 76, 102, 128, 154],
[6, 28, 54, 80, 106, 132, 158],
[6, 32, 58, 84, 110, 136, 162],
[6, 26, 54, 82, 110, 138, 166],
[6, 30, 58, 86, 114, 142, 170]
],
G15: 1335,
G18: 7973,
G15_MASK: 21522,
getBCHTypeInfo: function(a) {
for (var c = a << 10; 0 <= j.getBCHDigit(c) - j.getBCHDigit(j.G15);) c ^= j.G15 << j.getBCHDigit(c) - j.getBCHDigit(j.G15);
return (a << 10 | c) ^ j.G15_MASK
},
getBCHTypeNumber: function(a) {
for (var c = a << 12; 0 <= j.getBCHDigit(c) -
j.getBCHDigit(j.G18);) c ^= j.G18 << j.getBCHDigit(c) - j.getBCHDigit(j.G18);
return a << 12 | c
},
getBCHDigit: function(a) {
for (var c = 0; 0 != a;) c++, a >>>= 1;
return c
},
getPatternPosition: function(a) {
return j.PATTERN_POSITION_TABLE[a - 1]
},
getMask: function(a, c, d) {
switch (a) {
case 0:
return 0 == (c + d) % 2;
case 1:
return 0 == c % 2;
case 2:
return 0 == d % 3;
case 3:
return 0 == (c + d) % 3;
case 4:
return 0 == (Math.floor(c / 2) + Math.floor(d / 3)) % 2;
case 5:
return 0 == c * d % 2 + c * d % 3;
case 6:
return 0 == (c * d % 2 + c * d % 3) % 2;
case 7:
return 0 == (c * d % 3 + (c + d) % 2) % 2;
default:
throw Error("bad maskPattern:" +
a);
}
},
getErrorCorrectPolynomial: function(a) {
for (var c = new q([1], 0), d = 0; d < a; d++) c = c.multiply(new q([1, l.gexp(d)], 0));
return c
},
getLengthInBits: function(a, c) {
if (1 <= c && 10 > c) switch (a) {
case 1:
return 10;
case 2:
return 9;
case s:
return 8;
case 8:
return 8;
default:
throw Error("mode:" + a);
} else if (27 > c) switch (a) {
case 1:
return 12;
case 2:
return 11;
case s:
return 16;
case 8:
return 10;
default:
throw Error("mode:" + a);
} else if (41 > c) switch (a) {
case 1:
return 14;
case 2:
return 13;
case s:
return 16;
case 8:
return 12;
default:
throw Error("mode:" +
a);
} else throw Error("type:" + c);
},
getLostPoint: function(a) {
for (var c = a.getModuleCount(), d = 0, b = 0; b < c; b++)
for (var e = 0; e < c; e++) {
for (var f = 0, i = a.isDark(b, e), g = -1; 1 >= g; g++)
if (!(0 > b + g || c <= b + g))
for (var h = -1; 1 >= h; h++) 0 > e + h || c <= e + h || 0 == g && 0 == h || i == a.isDark(b + g, e + h) && f++;
5 < f && (d += 3 + f - 5)
}
for (b = 0; b < c - 1; b++)
for (e = 0; e < c - 1; e++)
if (f = 0, a.isDark(b, e) && f++, a.isDark(b + 1, e) && f++, a.isDark(b, e + 1) && f++, a.isDark(b + 1, e + 1) && f++, 0 == f || 4 == f) d += 3;
for (b = 0; b < c; b++)
for (e = 0; e < c - 6; e++) a.isDark(b, e) && !a.isDark(b, e + 1) && a.isDark(b, e +
2) && a.isDark(b, e + 3) && a.isDark(b, e + 4) && !a.isDark(b, e + 5) && a.isDark(b, e + 6) && (d += 40);
for (e = 0; e < c; e++)
for (b = 0; b < c - 6; b++) a.isDark(b, e) && !a.isDark(b + 1, e) && a.isDark(b + 2, e) && a.isDark(b + 3, e) && a.isDark(b + 4, e) && !a.isDark(b + 5, e) && a.isDark(b + 6, e) && (d += 40);
for (e = f = 0; e < c; e++)
for (b = 0; b < c; b++) a.isDark(b, e) && f++;
a = Math.abs(100 * f / c / c - 50) / 5;
return d + 10 * a
}
}, l = {
glog: function(a) {
if (1 > a) throw Error("glog(" + a + ")");
return l.LOG_TABLE[a]
},
gexp: function(a) {
for (; 0 > a;) a += 255;
for (; 256 <= a;) a -= 255;
return l.EXP_TABLE[a]
},
EXP_TABLE: Array(256),
LOG_TABLE: Array(256)
}, m = 0; 8 > m; m++) l.EXP_TABLE[m] = 1 << m;
for (m = 8; 256 > m; m++) l.EXP_TABLE[m] = l.EXP_TABLE[m - 4] ^ l.EXP_TABLE[m - 5] ^ l.EXP_TABLE[m - 6] ^ l.EXP_TABLE[m - 8];
for (m = 0; 255 > m; m++) l.LOG_TABLE[l.EXP_TABLE[m]] = m;
q.prototype = {
get: function(a) {
return this.num[a]
},
getLength: function() {
return this.num.length
},
multiply: function(a) {
for (var c = Array(this.getLength() + a.getLength() - 1), d = 0; d < this.getLength(); d++)
for (var b = 0; b < a.getLength(); b++) c[d + b] ^= l.gexp(l.glog(this.get(d)) + l.glog(a.get(b)));
return new q(c, 0)
},
mod: function(a) {
if (0 >
this.getLength() - a.getLength()) return this;
for (var c = l.glog(this.get(0)) - l.glog(a.get(0)), d = Array(this.getLength()), b = 0; b < this.getLength(); b++) d[b] = this.get(b);
for (b = 0; b < a.getLength(); b++) d[b] ^= l.gexp(l.glog(a.get(b)) + c);
return (new q(d, 0)).mod(a)
}
};
p.RS_BLOCK_TABLE = [
[1, 26, 19],
[1, 26, 16],
[1, 26, 13],
[1, 26, 9],
[1, 44, 34],
[1, 44, 28],
[1, 44, 22],
[1, 44, 16],
[1, 70, 55],
[1, 70, 44],
[2, 35, 17],
[2, 35, 13],
[1, 100, 80],
[2, 50, 32],
[2, 50, 24],
[4, 25, 9],
[1, 134, 108],
[2, 67, 43],
[2, 33, 15, 2, 34, 16],
[2, 33, 11, 2, 34, 12],
[2, 86, 68],
[4, 43, 27],
[4, 43, 19],
[4, 43, 15],
[2, 98, 78],
[4, 49, 31],
[2, 32, 14, 4, 33, 15],
[4, 39, 13, 1, 40, 14],
[2, 121, 97],
[2, 60, 38, 2, 61, 39],
[4, 40, 18, 2, 41, 19],
[4, 40, 14, 2, 41, 15],
[2, 146, 116],
[3, 58, 36, 2, 59, 37],
[4, 36, 16, 4, 37, 17],
[4, 36, 12, 4, 37, 13],
[2, 86, 68, 2, 87, 69],
[4, 69, 43, 1, 70, 44],
[6, 43, 19, 2, 44, 20],
[6, 43, 15, 2, 44, 16],
[4, 101, 81],
[1, 80, 50, 4, 81, 51],
[4, 50, 22, 4, 51, 23],
[3, 36, 12, 8, 37, 13],
[2, 116, 92, 2, 117, 93],
[6, 58, 36, 2, 59, 37],
[4, 46, 20, 6, 47, 21],
[7, 42, 14, 4, 43, 15],
[4, 133, 107],
[8, 59, 37, 1, 60, 38],
[8, 44, 20, 4, 45, 21],
[12, 33, 11, 4, 34, 12],
[3, 145, 115, 1, 146,
116
],
[4, 64, 40, 5, 65, 41],
[11, 36, 16, 5, 37, 17],
[11, 36, 12, 5, 37, 13],
[5, 109, 87, 1, 110, 88],
[5, 65, 41, 5, 66, 42],
[5, 54, 24, 7, 55, 25],
[11, 36, 12],
[5, 122, 98, 1, 123, 99],
[7, 73, 45, 3, 74, 46],
[15, 43, 19, 2, 44, 20],
[3, 45, 15, 13, 46, 16],
[1, 135, 107, 5, 136, 108],
[10, 74, 46, 1, 75, 47],
[1, 50, 22, 15, 51, 23],
[2, 42, 14, 17, 43, 15],
[5, 150, 120, 1, 151, 121],
[9, 69, 43, 4, 70, 44],
[17, 50, 22, 1, 51, 23],
[2, 42, 14, 19, 43, 15],
[3, 141, 113, 4, 142, 114],
[3, 70, 44, 11, 71, 45],
[17, 47, 21, 4, 48, 22],
[9, 39, 13, 16, 40, 14],
[3, 135, 107, 5, 136, 108],
[3, 67, 41, 13, 68, 42],
[15, 54, 24, 5, 55, 25],
[15,
43, 15, 10, 44, 16
],
[4, 144, 116, 4, 145, 117],
[17, 68, 42],
[17, 50, 22, 6, 51, 23],
[19, 46, 16, 6, 47, 17],
[2, 139, 111, 7, 140, 112],
[17, 74, 46],
[7, 54, 24, 16, 55, 25],
[34, 37, 13],
[4, 151, 121, 5, 152, 122],
[4, 75, 47, 14, 76, 48],
[11, 54, 24, 14, 55, 25],
[16, 45, 15, 14, 46, 16],
[6, 147, 117, 4, 148, 118],
[6, 73, 45, 14, 74, 46],
[11, 54, 24, 16, 55, 25],
[30, 46, 16, 2, 47, 17],
[8, 132, 106, 4, 133, 107],
[8, 75, 47, 13, 76, 48],
[7, 54, 24, 22, 55, 25],
[22, 45, 15, 13, 46, 16],
[10, 142, 114, 2, 143, 115],
[19, 74, 46, 4, 75, 47],
[28, 50, 22, 6, 51, 23],
[33, 46, 16, 4, 47, 17],
[8, 152, 122, 4, 153, 123],
[22, 73, 45,
3, 74, 46
],
[8, 53, 23, 26, 54, 24],
[12, 45, 15, 28, 46, 16],
[3, 147, 117, 10, 148, 118],
[3, 73, 45, 23, 74, 46],
[4, 54, 24, 31, 55, 25],
[11, 45, 15, 31, 46, 16],
[7, 146, 116, 7, 147, 117],
[21, 73, 45, 7, 74, 46],
[1, 53, 23, 37, 54, 24],
[19, 45, 15, 26, 46, 16],
[5, 145, 115, 10, 146, 116],
[19, 75, 47, 10, 76, 48],
[15, 54, 24, 25, 55, 25],
[23, 45, 15, 25, 46, 16],
[13, 145, 115, 3, 146, 116],
[2, 74, 46, 29, 75, 47],
[42, 54, 24, 1, 55, 25],
[23, 45, 15, 28, 46, 16],
[17, 145, 115],
[10, 74, 46, 23, 75, 47],
[10, 54, 24, 35, 55, 25],
[19, 45, 15, 35, 46, 16],
[17, 145, 115, 1, 146, 116],
[14, 74, 46, 21, 75, 47],
[29, 54, 24, 19,
55, 25
],
[11, 45, 15, 46, 46, 16],
[13, 145, 115, 6, 146, 116],
[14, 74, 46, 23, 75, 47],
[44, 54, 24, 7, 55, 25],
[59, 46, 16, 1, 47, 17],
[12, 151, 121, 7, 152, 122],
[12, 75, 47, 26, 76, 48],
[39, 54, 24, 14, 55, 25],
[22, 45, 15, 41, 46, 16],
[6, 151, 121, 14, 152, 122],
[6, 75, 47, 34, 76, 48],
[46, 54, 24, 10, 55, 25],
[2, 45, 15, 64, 46, 16],
[17, 152, 122, 4, 153, 123],
[29, 74, 46, 14, 75, 47],
[49, 54, 24, 10, 55, 25],
[24, 45, 15, 46, 46, 16],
[4, 152, 122, 18, 153, 123],
[13, 74, 46, 32, 75, 47],
[48, 54, 24, 14, 55, 25],
[42, 45, 15, 32, 46, 16],
[20, 147, 117, 4, 148, 118],
[40, 75, 47, 7, 76, 48],
[43, 54, 24, 22, 55, 25],
[10,
45, 15, 67, 46, 16
],
[19, 148, 118, 6, 149, 119],
[18, 75, 47, 31, 76, 48],
[34, 54, 24, 34, 55, 25],
[20, 45, 15, 61, 46, 16]
];
p.getRSBlocks = function(a, c) {
var d = p.getRsBlockTable(a, c);
if (void 0 == d) throw Error("bad rs block @ typeNumber:" + a + "/errorCorrectLevel:" + c);
for (var b = d.length / 3, e = [], f = 0; f < b; f++)
for (var h = d[3 * f + 0], g = d[3 * f + 1], j = d[3 * f + 2], l = 0; l < h; l++) e.push(new p(g, j));
return e
};
p.getRsBlockTable = function(a, c) {
switch (c) {
case 1:
return p.RS_BLOCK_TABLE[4 * (a - 1) + 0];
case 0:
return p.RS_BLOCK_TABLE[4 * (a - 1) + 1];
case 3:
return p.RS_BLOCK_TABLE[4 *
(a - 1) + 2];
case 2:
return p.RS_BLOCK_TABLE[4 * (a - 1) + 3]
}
};
t.prototype = {
get: function(a) {
return 1 == (this.buffer[Math.floor(a / 8)] >>> 7 - a % 8 & 1)
},
put: function(a, c) {
for (var d = 0; d < c; d++) this.putBit(1 == (a >>> c - d - 1 & 1))
},
getLengthInBits: function() {
return this.length
},
putBit: function(a) {
var c = Math.floor(this.length / 8);
this.buffer.length <= c && this.buffer.push(0);
a && (this.buffer[c] |= 128 >>> this.length % 8);
this.length++
}
};
"string" === typeof h && (h = {
text: h
});
h = r.extend({}, {
render: "canvas",
width: 256,
height: 256,
typeNumber: -1,
correctLevel: 2,
background: "#ffffff",
foreground: "#000000"
}, h);
return this.each(function() {
var a;
if ("canvas" == h.render) {
a = new o(h.typeNumber, h.correctLevel);
a.addData(h.text);
a.make();
var c = document.createElement("canvas");
c.width = h.width;
c.height = h.height;
for (var d = c.getContext("2d"), b = h.width / a.getModuleCount(), e = h.height / a.getModuleCount(), f = 0; f < a.getModuleCount(); f++)
for (var i = 0; i < a.getModuleCount(); i++) {
d.fillStyle = a.isDark(f, i) ? h.foreground : h.background;
var g = Math.ceil((i + 1) * b) - Math.floor(i * b),
j = Math.ceil((f + 1) * b) - Math.floor(f * b);
d.fillRect(Math.round(i * b), Math.round(f * e), g, j)
}
} else {
a = new o(h.typeNumber, h.correctLevel);
a.addData(h.text);
a.make();
c = r("<table></table>").css("width", h.width + "px").css("height", h.height + "px").css("border", "0px").css("border-collapse", "collapse").css("background-color", h.background);
d = h.width / a.getModuleCount();
b = h.height / a.getModuleCount();
for (e = 0; e < a.getModuleCount(); e++) {
f = r("<tr></tr>").css("height", b + "px").appendTo(c);
for (i = 0; i < a.getModuleCount(); i++) r("<td></td>").css("width",
d + "px").css("background-color", a.isDark(e, i) ? h.foreground : h.background).appendTo(f)
}
}
a = c;
jQuery(a).appendTo(this)
})
}
})(jQuery);
/* jscs: enable */
/* jscs: disable */
/* jshint ignore:start */
var jQuery = require('yoho.jquery');
(function(r) {
r.fn.qrcode = function(h) {
var s;
function u(a) {
this.mode = s;
this.data = a
}
function o(a, c) {
this.typeNumber = a;
this.errorCorrectLevel = c;
this.modules = null;
this.moduleCount = 0;
this.dataCache = null;
this.dataList = []
}
function q(a, c) {
if (void 0 == a.length) throw Error(a.length + "/" + c);
for (var d = 0; d < a.length && 0 == a[d];) d++;
this.num = Array(a.length - d + c);
for (var b = 0; b < a.length - d; b++) this.num[b] = a[b + d]
}
function p(a, c) {
this.totalCount = a;
this.dataCount = c
}
function t() {
this.buffer = [];
this.length = 0
}
u.prototype = {
getLength: function() {
return this.data.length
},
write: function(a) {
for (var c = 0; c < this.data.length; c++) a.put(this.data.charCodeAt(c), 8)
}
};
o.prototype = {
addData: function(a) {
this.dataList.push(new u(a));
this.dataCache = null
},
isDark: function(a, c) {
if (0 > a || this.moduleCount <= a || 0 > c || this.moduleCount <= c) throw Error(a + "," + c);
return this.modules[a][c]
},
getModuleCount: function() {
return this.moduleCount
},
make: function() {
if (1 > this.typeNumber) {
for (var a = 1, a = 1; 40 > a; a++) {
for (var c = p.getRSBlocks(a, this.errorCorrectLevel), d = new t, b = 0, e = 0; e < c.length; e++) b += c[e].dataCount;
for (e = 0; e < this.dataList.length; e++) c = this.dataList[e], d.put(c.mode, 4), d.put(c.getLength(), j.getLengthInBits(c.mode, a)), c.write(d);
if (d.getLengthInBits() <= 8 * b) break
}
this.typeNumber = a
}
this.makeImpl(!1, this.getBestMaskPattern())
},
makeImpl: function(a, c) {
this.moduleCount = 4 * this.typeNumber + 17;
this.modules = Array(this.moduleCount);
for (var d = 0; d < this.moduleCount; d++) {
this.modules[d] = Array(this.moduleCount);
for (var b = 0; b < this.moduleCount; b++) this.modules[d][b] = null
}
this.setupPositionProbePattern(0, 0);
this.setupPositionProbePattern(this.moduleCount -
7, 0);
this.setupPositionProbePattern(0, this.moduleCount - 7);
this.setupPositionAdjustPattern();
this.setupTimingPattern();
this.setupTypeInfo(a, c);
7 <= this.typeNumber && this.setupTypeNumber(a);
null == this.dataCache && (this.dataCache = o.createData(this.typeNumber, this.errorCorrectLevel, this.dataList));
this.mapData(this.dataCache, c)
},
setupPositionProbePattern: function(a, c) {
for (var d = -1; 7 >= d; d++)
if (!(-1 >= a + d || this.moduleCount <= a + d))
for (var b = -1; 7 >= b; b++) - 1 >= c + b || this.moduleCount <= c + b || (this.modules[a + d][c + b] =
0 <= d && 6 >= d && (0 == b || 6 == b) || 0 <= b && 6 >= b && (0 == d || 6 == d) || 2 <= d && 4 >= d && 2 <= b && 4 >= b ? !0 : !1)
},
getBestMaskPattern: function() {
for (var a = 0, c = 0, d = 0; 8 > d; d++) {
this.makeImpl(!0, d);
var b = j.getLostPoint(this);
if (0 == d || a > b) a = b, c = d
}
return c
},
createMovieClip: function(a, c, d) {
a = a.createEmptyMovieClip(c, d);
this.make();
for (c = 0; c < this.modules.length; c++)
for (var d = 1 * c, b = 0; b < this.modules[c].length; b++) {
var e = 1 * b;
this.modules[c][b] && (a.beginFill(0, 100), a.moveTo(e, d), a.lineTo(e + 1, d), a.lineTo(e + 1, d + 1), a.lineTo(e, d + 1), a.endFill())
}
return a
},
setupTimingPattern: function() {
for (var a = 8; a < this.moduleCount - 8; a++) null == this.modules[a][6] && (this.modules[a][6] = 0 == a % 2);
for (a = 8; a < this.moduleCount - 8; a++) null == this.modules[6][a] && (this.modules[6][a] = 0 == a % 2)
},
setupPositionAdjustPattern: function() {
for (var a = j.getPatternPosition(this.typeNumber), c = 0; c < a.length; c++)
for (var d = 0; d < a.length; d++) {
var b = a[c],
e = a[d];
if (null == this.modules[b][e])
for (var f = -2; 2 >= f; f++)
for (var i = -2; 2 >= i; i++) this.modules[b + f][e + i] = -2 == f || 2 == f || -2 == i || 2 == i || 0 == f && 0 == i ? !0 : !1
}
},
setupTypeNumber: function(a) {
for (var c =
j.getBCHTypeNumber(this.typeNumber), d = 0; 18 > d; d++) {
var b = !a && 1 == (c >> d & 1);
this.modules[Math.floor(d / 3)][d % 3 + this.moduleCount - 8 - 3] = b
}
for (d = 0; 18 > d; d++) b = !a && 1 == (c >> d & 1), this.modules[d % 3 + this.moduleCount - 8 - 3][Math.floor(d / 3)] = b
},
setupTypeInfo: function(a, c) {
for (var d = j.getBCHTypeInfo(this.errorCorrectLevel << 3 | c), b = 0; 15 > b; b++) {
var e = !a && 1 == (d >> b & 1);
6 > b ? this.modules[b][8] = e : 8 > b ? this.modules[b + 1][8] = e : this.modules[this.moduleCount - 15 + b][8] = e
}
for (b = 0; 15 > b; b++) e = !a && 1 == (d >> b & 1), 8 > b ? this.modules[8][this.moduleCount -
b - 1
] = e : 9 > b ? this.modules[8][15 - b - 1 + 1] = e : this.modules[8][15 - b - 1] = e;
this.modules[this.moduleCount - 8][8] = !a
},
mapData: function(a, c) {
for (var d = -1, b = this.moduleCount - 1, e = 7, f = 0, i = this.moduleCount - 1; 0 < i; i -= 2)
for (6 == i && i--;;) {
for (var g = 0; 2 > g; g++)
if (null == this.modules[b][i - g]) {
var n = !1;
f < a.length && (n = 1 == (a[f] >>> e & 1));
j.getMask(c, b, i - g) && (n = !n);
this.modules[b][i - g] = n;
e--; - 1 == e && (f++, e = 7)
}
b += d;
if (0 > b || this.moduleCount <= b) {
b -= d;
d = -d;
break
}
}
}
};
o.PAD0 = 236;
o.PAD1 = 17;
o.createData = function(a, c, d) {
for (var c = p.getRSBlocks(a,
c), b = new t, e = 0; e < d.length; e++) {
var f = d[e];
b.put(f.mode, 4);
b.put(f.getLength(), j.getLengthInBits(f.mode, a));
f.write(b)
}
for (e = a = 0; e < c.length; e++) a += c[e].dataCount;
if (b.getLengthInBits() > 8 * a) throw Error("code length overflow. (" + b.getLengthInBits() + ">" + 8 * a + ")");
for (b.getLengthInBits() + 4 <= 8 * a && b.put(0, 4); 0 != b.getLengthInBits() % 8;) b.putBit(!1);
for (; !(b.getLengthInBits() >= 8 * a);) {
b.put(o.PAD0, 8);
if (b.getLengthInBits() >= 8 * a) break;
b.put(o.PAD1, 8)
}
return o.createBytes(b, c)
};
o.createBytes = function(a, c) {
for (var d =
0, b = 0, e = 0, f = Array(c.length), i = Array(c.length), g = 0; g < c.length; g++) {
var n = c[g].dataCount,
h = c[g].totalCount - n,
b = Math.max(b, n),
e = Math.max(e, h);
f[g] = Array(n);
for (var k = 0; k < f[g].length; k++) f[g][k] = 255 & a.buffer[k + d];
d += n;
k = j.getErrorCorrectPolynomial(h);
n = (new q(f[g], k.getLength() - 1)).mod(k);
i[g] = Array(k.getLength() - 1);
for (k = 0; k < i[g].length; k++) h = k + n.getLength() - i[g].length, i[g][k] = 0 <= h ? n.get(h) : 0
}
for (k = g = 0; k < c.length; k++) g += c[k].totalCount;
d = Array(g);
for (k = n = 0; k < b; k++)
for (g = 0; g < c.length; g++) k < f[g].length &&
(d[n++] = f[g][k]);
for (k = 0; k < e; k++)
for (g = 0; g < c.length; g++) k < i[g].length && (d[n++] = i[g][k]);
return d
};
s = 4;
for (var j = {
PATTERN_POSITION_TABLE: [
[],
[6, 18],
[6, 22],
[6, 26],
[6, 30],
[6, 34],
[6, 22, 38],
[6, 24, 42],
[6, 26, 46],
[6, 28, 50],
[6, 30, 54],
[6, 32, 58],
[6, 34, 62],
[6, 26, 46, 66],
[6, 26, 48, 70],
[6, 26, 50, 74],
[6, 30, 54, 78],
[6, 30, 56, 82],
[6, 30, 58, 86],
[6, 34, 62, 90],
[6, 28, 50, 72, 94],
[6, 26, 50, 74, 98],
[6, 30, 54, 78, 102],
[6, 28, 54, 80, 106],
[6, 32, 58, 84, 110],
[6, 30, 58, 86, 114],
[6, 34, 62, 90, 118],
[6, 26, 50, 74, 98, 122],
[6, 30, 54, 78, 102, 126],
[6, 26, 52,
78, 104, 130
],
[6, 30, 56, 82, 108, 134],
[6, 34, 60, 86, 112, 138],
[6, 30, 58, 86, 114, 142],
[6, 34, 62, 90, 118, 146],
[6, 30, 54, 78, 102, 126, 150],
[6, 24, 50, 76, 102, 128, 154],
[6, 28, 54, 80, 106, 132, 158],
[6, 32, 58, 84, 110, 136, 162],
[6, 26, 54, 82, 110, 138, 166],
[6, 30, 58, 86, 114, 142, 170]
],
G15: 1335,
G18: 7973,
G15_MASK: 21522,
getBCHTypeInfo: function(a) {
for (var c = a << 10; 0 <= j.getBCHDigit(c) - j.getBCHDigit(j.G15);) c ^= j.G15 << j.getBCHDigit(c) - j.getBCHDigit(j.G15);
return (a << 10 | c) ^ j.G15_MASK
},
getBCHTypeNumber: function(a) {
for (var c = a << 12; 0 <= j.getBCHDigit(c) -
j.getBCHDigit(j.G18);) c ^= j.G18 << j.getBCHDigit(c) - j.getBCHDigit(j.G18);
return a << 12 | c
},
getBCHDigit: function(a) {
for (var c = 0; 0 != a;) c++, a >>>= 1;
return c
},
getPatternPosition: function(a) {
return j.PATTERN_POSITION_TABLE[a - 1]
},
getMask: function(a, c, d) {
switch (a) {
case 0:
return 0 == (c + d) % 2;
case 1:
return 0 == c % 2;
case 2:
return 0 == d % 3;
case 3:
return 0 == (c + d) % 3;
case 4:
return 0 == (Math.floor(c / 2) + Math.floor(d / 3)) % 2;
case 5:
return 0 == c * d % 2 + c * d % 3;
case 6:
return 0 == (c * d % 2 + c * d % 3) % 2;
case 7:
return 0 == (c * d % 3 + (c + d) % 2) % 2;
default:
throw Error("bad maskPattern:" +
a);
}
},
getErrorCorrectPolynomial: function(a) {
for (var c = new q([1], 0), d = 0; d < a; d++) c = c.multiply(new q([1, l.gexp(d)], 0));
return c
},
getLengthInBits: function(a, c) {
if (1 <= c && 10 > c) switch (a) {
case 1:
return 10;
case 2:
return 9;
case s:
return 8;
case 8:
return 8;
default:
throw Error("mode:" + a);
} else if (27 > c) switch (a) {
case 1:
return 12;
case 2:
return 11;
case s:
return 16;
case 8:
return 10;
default:
throw Error("mode:" + a);
} else if (41 > c) switch (a) {
case 1:
return 14;
case 2:
return 13;
case s:
return 16;
case 8:
return 12;
default:
throw Error("mode:" +
a);
} else throw Error("type:" + c);
},
getLostPoint: function(a) {
for (var c = a.getModuleCount(), d = 0, b = 0; b < c; b++)
for (var e = 0; e < c; e++) {
for (var f = 0, i = a.isDark(b, e), g = -1; 1 >= g; g++)
if (!(0 > b + g || c <= b + g))
for (var h = -1; 1 >= h; h++) 0 > e + h || c <= e + h || 0 == g && 0 == h || i == a.isDark(b + g, e + h) && f++;
5 < f && (d += 3 + f - 5)
}
for (b = 0; b < c - 1; b++)
for (e = 0; e < c - 1; e++)
if (f = 0, a.isDark(b, e) && f++, a.isDark(b + 1, e) && f++, a.isDark(b, e + 1) && f++, a.isDark(b + 1, e + 1) && f++, 0 == f || 4 == f) d += 3;
for (b = 0; b < c; b++)
for (e = 0; e < c - 6; e++) a.isDark(b, e) && !a.isDark(b, e + 1) && a.isDark(b, e +
2) && a.isDark(b, e + 3) && a.isDark(b, e + 4) && !a.isDark(b, e + 5) && a.isDark(b, e + 6) && (d += 40);
for (e = 0; e < c; e++)
for (b = 0; b < c - 6; b++) a.isDark(b, e) && !a.isDark(b + 1, e) && a.isDark(b + 2, e) && a.isDark(b + 3, e) && a.isDark(b + 4, e) && !a.isDark(b + 5, e) && a.isDark(b + 6, e) && (d += 40);
for (e = f = 0; e < c; e++)
for (b = 0; b < c; b++) a.isDark(b, e) && f++;
a = Math.abs(100 * f / c / c - 50) / 5;
return d + 10 * a
}
}, l = {
glog: function(a) {
if (1 > a) throw Error("glog(" + a + ")");
return l.LOG_TABLE[a]
},
gexp: function(a) {
for (; 0 > a;) a += 255;
for (; 256 <= a;) a -= 255;
return l.EXP_TABLE[a]
},
EXP_TABLE: Array(256),
LOG_TABLE: Array(256)
}, m = 0; 8 > m; m++) l.EXP_TABLE[m] = 1 << m;
for (m = 8; 256 > m; m++) l.EXP_TABLE[m] = l.EXP_TABLE[m - 4] ^ l.EXP_TABLE[m - 5] ^ l.EXP_TABLE[m - 6] ^ l.EXP_TABLE[m - 8];
for (m = 0; 255 > m; m++) l.LOG_TABLE[l.EXP_TABLE[m]] = m;
q.prototype = {
get: function(a) {
return this.num[a]
},
getLength: function() {
return this.num.length
},
multiply: function(a) {
for (var c = Array(this.getLength() + a.getLength() - 1), d = 0; d < this.getLength(); d++)
for (var b = 0; b < a.getLength(); b++) c[d + b] ^= l.gexp(l.glog(this.get(d)) + l.glog(a.get(b)));
return new q(c, 0)
},
mod: function(a) {
if (0 >
this.getLength() - a.getLength()) return this;
for (var c = l.glog(this.get(0)) - l.glog(a.get(0)), d = Array(this.getLength()), b = 0; b < this.getLength(); b++) d[b] = this.get(b);
for (b = 0; b < a.getLength(); b++) d[b] ^= l.gexp(l.glog(a.get(b)) + c);
return (new q(d, 0)).mod(a)
}
};
p.RS_BLOCK_TABLE = [
[1, 26, 19],
[1, 26, 16],
[1, 26, 13],
[1, 26, 9],
[1, 44, 34],
[1, 44, 28],
[1, 44, 22],
[1, 44, 16],
[1, 70, 55],
[1, 70, 44],
[2, 35, 17],
[2, 35, 13],
[1, 100, 80],
[2, 50, 32],
[2, 50, 24],
[4, 25, 9],
[1, 134, 108],
[2, 67, 43],
[2, 33, 15, 2, 34, 16],
[2, 33, 11, 2, 34, 12],
[2, 86, 68],
[4, 43, 27],
[4, 43, 19],
[4, 43, 15],
[2, 98, 78],
[4, 49, 31],
[2, 32, 14, 4, 33, 15],
[4, 39, 13, 1, 40, 14],
[2, 121, 97],
[2, 60, 38, 2, 61, 39],
[4, 40, 18, 2, 41, 19],
[4, 40, 14, 2, 41, 15],
[2, 146, 116],
[3, 58, 36, 2, 59, 37],
[4, 36, 16, 4, 37, 17],
[4, 36, 12, 4, 37, 13],
[2, 86, 68, 2, 87, 69],
[4, 69, 43, 1, 70, 44],
[6, 43, 19, 2, 44, 20],
[6, 43, 15, 2, 44, 16],
[4, 101, 81],
[1, 80, 50, 4, 81, 51],
[4, 50, 22, 4, 51, 23],
[3, 36, 12, 8, 37, 13],
[2, 116, 92, 2, 117, 93],
[6, 58, 36, 2, 59, 37],
[4, 46, 20, 6, 47, 21],
[7, 42, 14, 4, 43, 15],
[4, 133, 107],
[8, 59, 37, 1, 60, 38],
[8, 44, 20, 4, 45, 21],
[12, 33, 11, 4, 34, 12],
[3, 145, 115, 1, 146,
116
],
[4, 64, 40, 5, 65, 41],
[11, 36, 16, 5, 37, 17],
[11, 36, 12, 5, 37, 13],
[5, 109, 87, 1, 110, 88],
[5, 65, 41, 5, 66, 42],
[5, 54, 24, 7, 55, 25],
[11, 36, 12],
[5, 122, 98, 1, 123, 99],
[7, 73, 45, 3, 74, 46],
[15, 43, 19, 2, 44, 20],
[3, 45, 15, 13, 46, 16],
[1, 135, 107, 5, 136, 108],
[10, 74, 46, 1, 75, 47],
[1, 50, 22, 15, 51, 23],
[2, 42, 14, 17, 43, 15],
[5, 150, 120, 1, 151, 121],
[9, 69, 43, 4, 70, 44],
[17, 50, 22, 1, 51, 23],
[2, 42, 14, 19, 43, 15],
[3, 141, 113, 4, 142, 114],
[3, 70, 44, 11, 71, 45],
[17, 47, 21, 4, 48, 22],
[9, 39, 13, 16, 40, 14],
[3, 135, 107, 5, 136, 108],
[3, 67, 41, 13, 68, 42],
[15, 54, 24, 5, 55, 25],
[15,
43, 15, 10, 44, 16
],
[4, 144, 116, 4, 145, 117],
[17, 68, 42],
[17, 50, 22, 6, 51, 23],
[19, 46, 16, 6, 47, 17],
[2, 139, 111, 7, 140, 112],
[17, 74, 46],
[7, 54, 24, 16, 55, 25],
[34, 37, 13],
[4, 151, 121, 5, 152, 122],
[4, 75, 47, 14, 76, 48],
[11, 54, 24, 14, 55, 25],
[16, 45, 15, 14, 46, 16],
[6, 147, 117, 4, 148, 118],
[6, 73, 45, 14, 74, 46],
[11, 54, 24, 16, 55, 25],
[30, 46, 16, 2, 47, 17],
[8, 132, 106, 4, 133, 107],
[8, 75, 47, 13, 76, 48],
[7, 54, 24, 22, 55, 25],
[22, 45, 15, 13, 46, 16],
[10, 142, 114, 2, 143, 115],
[19, 74, 46, 4, 75, 47],
[28, 50, 22, 6, 51, 23],
[33, 46, 16, 4, 47, 17],
[8, 152, 122, 4, 153, 123],
[22, 73, 45,
3, 74, 46
],
[8, 53, 23, 26, 54, 24],
[12, 45, 15, 28, 46, 16],
[3, 147, 117, 10, 148, 118],
[3, 73, 45, 23, 74, 46],
[4, 54, 24, 31, 55, 25],
[11, 45, 15, 31, 46, 16],
[7, 146, 116, 7, 147, 117],
[21, 73, 45, 7, 74, 46],
[1, 53, 23, 37, 54, 24],
[19, 45, 15, 26, 46, 16],
[5, 145, 115, 10, 146, 116],
[19, 75, 47, 10, 76, 48],
[15, 54, 24, 25, 55, 25],
[23, 45, 15, 25, 46, 16],
[13, 145, 115, 3, 146, 116],
[2, 74, 46, 29, 75, 47],
[42, 54, 24, 1, 55, 25],
[23, 45, 15, 28, 46, 16],
[17, 145, 115],
[10, 74, 46, 23, 75, 47],
[10, 54, 24, 35, 55, 25],
[19, 45, 15, 35, 46, 16],
[17, 145, 115, 1, 146, 116],
[14, 74, 46, 21, 75, 47],
[29, 54, 24, 19,
55, 25
],
[11, 45, 15, 46, 46, 16],
[13, 145, 115, 6, 146, 116],
[14, 74, 46, 23, 75, 47],
[44, 54, 24, 7, 55, 25],
[59, 46, 16, 1, 47, 17],
[12, 151, 121, 7, 152, 122],
[12, 75, 47, 26, 76, 48],
[39, 54, 24, 14, 55, 25],
[22, 45, 15, 41, 46, 16],
[6, 151, 121, 14, 152, 122],
[6, 75, 47, 34, 76, 48],
[46, 54, 24, 10, 55, 25],
[2, 45, 15, 64, 46, 16],
[17, 152, 122, 4, 153, 123],
[29, 74, 46, 14, 75, 47],
[49, 54, 24, 10, 55, 25],
[24, 45, 15, 46, 46, 16],
[4, 152, 122, 18, 153, 123],
[13, 74, 46, 32, 75, 47],
[48, 54, 24, 14, 55, 25],
[42, 45, 15, 32, 46, 16],
[20, 147, 117, 4, 148, 118],
[40, 75, 47, 7, 76, 48],
[43, 54, 24, 22, 55, 25],
[10,
45, 15, 67, 46, 16
],
[19, 148, 118, 6, 149, 119],
[18, 75, 47, 31, 76, 48],
[34, 54, 24, 34, 55, 25],
[20, 45, 15, 61, 46, 16]
];
p.getRSBlocks = function(a, c) {
var d = p.getRsBlockTable(a, c);
if (void 0 == d) throw Error("bad rs block @ typeNumber:" + a + "/errorCorrectLevel:" + c);
for (var b = d.length / 3, e = [], f = 0; f < b; f++)
for (var h = d[3 * f + 0], g = d[3 * f + 1], j = d[3 * f + 2], l = 0; l < h; l++) e.push(new p(g, j));
return e
};
p.getRsBlockTable = function(a, c) {
switch (c) {
case 1:
return p.RS_BLOCK_TABLE[4 * (a - 1) + 0];
case 0:
return p.RS_BLOCK_TABLE[4 * (a - 1) + 1];
case 3:
return p.RS_BLOCK_TABLE[4 *
(a - 1) + 2];
case 2:
return p.RS_BLOCK_TABLE[4 * (a - 1) + 3]
}
};
t.prototype = {
get: function(a) {
return 1 == (this.buffer[Math.floor(a / 8)] >>> 7 - a % 8 & 1)
},
put: function(a, c) {
for (var d = 0; d < c; d++) this.putBit(1 == (a >>> c - d - 1 & 1))
},
getLengthInBits: function() {
return this.length
},
putBit: function(a) {
var c = Math.floor(this.length / 8);
this.buffer.length <= c && this.buffer.push(0);
a && (this.buffer[c] |= 128 >>> this.length % 8);
this.length++
}
};
"string" === typeof h && (h = {
text: h
});
h = r.extend({}, {
render: "canvas",
width: 256,
height: 256,
typeNumber: -1,
correctLevel: 2,
background: "#ffffff",
foreground: "#000000"
}, h);
return this.each(function() {
var a;
if ("canvas" == h.render) {
a = new o(h.typeNumber, h.correctLevel);
a.addData(h.text);
a.make();
var c = document.createElement("canvas");
c.width = h.width;
c.height = h.height;
for (var d = c.getContext("2d"), b = h.width / a.getModuleCount(), e = h.height / a.getModuleCount(), f = 0; f < a.getModuleCount(); f++)
for (var i = 0; i < a.getModuleCount(); i++) {
d.fillStyle = a.isDark(f, i) ? h.foreground : h.background;
var g = Math.ceil((i + 1) * b) - Math.floor(i * b),
j = Math.ceil((f + 1) * b) - Math.floor(f * b);
d.fillRect(Math.round(i * b), Math.round(f * e), g, j)
}
} else {
a = new o(h.typeNumber, h.correctLevel);
a.addData(h.text);
a.make();
c = r("<table></table>").css("width", h.width + "px").css("height", h.height + "px").css("border", "0px").css("border-collapse", "collapse").css("background-color", h.background);
d = h.width / a.getModuleCount();
b = h.height / a.getModuleCount();
for (e = 0; e < a.getModuleCount(); e++) {
f = r("<tr></tr>").css("height", b + "px").appendTo(c);
for (i = 0; i < a.getModuleCount(); i++) r("<td></td>").css("width",
d + "px").css("background-color", a.isDark(e, i) ? h.foreground : h.background).appendTo(f)
}
}
a = c;
jQuery(a).appendTo(this)
})
}
})(jQuery);
/* jscs: enable */
/* jshint ignore:end */
\ No newline at end of file
... ...
/**
* upload plugin
*
*/
var $ = require('yoho.jquery');
var SWFUpload = require('./swfupload.queue').SWFUpload;
var file_upload_limit = 6;
$.fn.extend({
qupload : function(options) {
writeProgressHtml();
initSwfUpload($(this).attr('id'), options);
}
});
var hasProgreeHtml = 0;
// 创建进度条的html
function writeProgressHtml() {
if (hasProgreeHtml == 0) // 一个页面只创建一次
{
$('body')
.append(
'<div id="progressDialog" style="display: none;width:370px;height:80px !important;"><div style="padding:10px 20px;"><span id="curUploadStatus">图片上传中……请稍等</span><div id="progress"></div></div></div>');
hasProgreeHtml = 1;
}
}
function setUploadStatus(uploadNum, totalUploadNum) {
$('#uploadNum').html(uploadNum);
$('#totalUploadNum').html(totalUploadNum);
}
// 初始化swf
function initSwfUpload(btnId, options) {
// 上传成功的回调函数
var uploadSuccessCallBack = null;
if (options.uploadSuccessed != undefined) {
uploadSuccessCallBack = options.uploadSuccessed;
}
// 上传的key
var uploadKeyValue = '';
if (options.uploadKey != undefined) {
uploadKeyValue = options.uploadKey;
}
// 上传之前可以做的操作参数
var preUploadCallBack = null;
if (options.preupload != undefined) {
preUploadCallBack = options.preupload;
}
// 弹出层ID
var progressDivId = 'progressDialog';
// 进度条ID
var progressTargetId = 'progress';
// 共有多少张需要上传
var totalUploadNum = 0;
// 当前已经上传的张数
var curUploadedNum = 0;
this.options = options;
var numTest = 0;
var errmsg_box = this.options.errmsg_box;
// 设置默认值函数
function setDefaultValue(optionName, optionValue) {
this.options[optionName] = options[optionName] == undefined ? optionValue
: options[optionName];
}
setDefaultValue('flash_url',
"http://static.yohobuy.com/admin/js/swfupload/swfupload.swf");
setDefaultValue('upload_url', "http://upload.yohobuy.com");
setDefaultValue('file_post_name', "Filedata");
setDefaultValue('file_size_limit', "2 MB");
setDefaultValue('file_types', "*.*");
setDefaultValue('file_types_description', "All Files");
setDefaultValue('file_upload_limit', file_upload_limit);
setDefaultValue('file_queue_limit', 0);
setDefaultValue('button_image_url',
"http://static.yohobuy.com/admin/images/btn_swfupload.png");
setDefaultValue('button_width', "104");
setDefaultValue('button_height', "20");
setDefaultValue('button_text', '<span class="btn_upload_xzzp">选择本地照片</span>');
setDefaultValue('button_text_style', '.btn_upload_xzzp{color:#ffffff}');
setDefaultValue('button_text_left_padding', 24);
setDefaultValue('button_text_top_padding', 0);
setDefaultValue('button_window_mode', 'TRANSPARENT');
setDefaultValue('button_cursor', '-2');
var settings = {
flash_url : this.options.flash_url,
upload_url : this.options.upload_url,
file_post_name : this.options.file_post_name,
// post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"},
file_size_limit : this.options.file_size_limit,
file_types : this.options.file_types,
file_types_description : this.options.file_types_description,
file_upload_limit : this.options.file_upload_limit,
file_queue_limit : this.options.file_queue_limit,
prevent_swf_caching : false,
preserve_relative_urls : false,
custom_settings : {
},
debug : false,
// Button settings
button_image_url : this.options.button_image_url,
button_width : this.options.button_width,
button_height : this.options.button_height,
button_placeholder_id : btnId,
button_text : this.options.button_text,
button_text_style : this.options.button_text_style,
button_text_left_padding : this.options.button_text_left_padding,
button_text_top_padding : this.options.button_text_top_padding,
button_window_mode : this.options.button_window_mode,
button_cursor : this.options.button_cursor,
// The event handler functions are defined in handlers.js
file_dialog_start_handler : fileDialogStart,
file_queued_handler : fileQueued,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_start_handler : uploadStart,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler : uploadComplete,
queue_complete_handler : queueComplete,
button_action: this.options.button_action
};
var swfu = new SWFUpload(settings);
function fileQueued(file) {
try {
} catch (ex) {
this.debug(ex);
}
}
function fileQueueError(file, errorCode, message) {
var errmsg;
try {
if (errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
alert("您尝试上传太多文件.\n"
+ (message === 0 ? "您已达到上传限制." : "您最多还可以 "
+ (message > 1 ? "上传 " + message + "文件."
: "一个文件.")));
return;
}
// var progress = new FileProgress(file,
// this.customSettings.progressTarget);
// progress.setError();
// progress.toggleCancel(false);
switch (errorCode) {
case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
// progress.setStatus("File is too big.");
errmsg = '文件超过'+settings.file_size_limit/1024+'M';
alert(errmsg);
this.debug("Error Code: File too big, File name: "
+ file.name + ", File size: " + file.size
+ ", Message: " + message);
break;
case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
// progress.setStatus("Cannot upload Zero Byte files.");
alert('请上传有内容的文件!');
this.debug("Error Code: Zero byte file, File name: "
+ file.name + ", File size: " + file.size
+ ", Message: " + message);
break;
case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
alert('请上传指定类型的文件!');
this.debug("Error Code: Invalid File Type, File name: "
+ file.name + ", File size: " + file.size
+ ", Message: " + message);
break;
default:
if (file !== null) {
// progress.setStatus("Unhandled Error");
}
alert('上传文件失败,请稍后在试!');
this.debug("Error Code: " + errorCode + ", File name: "
+ file.name + ", File size: " + file.size
+ ", Message: " + message);
break;
}
} catch (ex) {
this.debug(ex);
}
}
function fileDialogStart() {
if (preUploadCallBack != null) {
preUploadCallBack();
}
}
// 选择文件完成
function fileDialogComplete(numFilesSelected, numFilesQueued) {
try {
if (numFilesSelected > 0) {
// document.getElementById(this.customSettings.cancelButtonId).disabled
// = false;
totalUploadNum = numFilesSelected;
curUploadedNum = 1;
setUploadStatus(curUploadedNum, totalUploadNum);
this.startUpload();
}
} catch (ex) {
this.debug(ex);
}
}
// 开始上传
function uploadStart(file) {
this.addPostParam('_key', uploadKeyValue);
//$('#' + progressDivId).dialog();
}
// 上传进度
function uploadProgress(file, bytesLoaded, bytesTotal) {
// $('#uploadData').html(bytesLoaded + "/" + bytesTotal);
// $('#uploadData').html( $('#uploadData').html() + ' - ' + bytesLoaded
// + '+' + ',' + bytesTotal );
var percent = Math.ceil((bytesLoaded / bytesTotal) * 100);
//$("#progress").progressbar({
// value : percent
//});
}
// 上传成功
function uploadSuccess(file, serverData) {
curUploadedNum++;
setUploadStatus(curUploadedNum, totalUploadNum);
if (uploadSuccessCallBack != null) {
uploadSuccessCallBack(serverData);
}
}
// 上传出错
function uploadError(file, errorCode, message) {
try {
if (errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
alert("您尝试上传太多文件.\n"
+ (message === 0 ? "您已达到上传限制." : "您最多还可以 "
+ (message > 1 ? "上传 " + message + "文件."
: "一个文件.")));
return;
}
switch (errorCode) {
case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
alert("Error Code: 文件太大。 文件名为: " + file.name + ", 大小为: "
+ file.size + ", Message: " + message);
break;
case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
alert("Error Code: 文件为0, 文件名为: " + file.name + ", 大小为: "
+ file.size + ", Message: " + message);
break;
case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
alert("Error Code: 文件类型不合要求, 文件名为: " + file.name + ", 大小为: "
+ file.size + ", Message: " + message);
break;
default:
if (file !== null) {
}
alert("上传出错" + "Error Code: " + errorCode + ", File name: "
+ file.name + ", File size: " + file.size
+ ", Message: " + message);
break;
}
} catch (ex) {
this.debug(ex);
}
}
// 上传完成
function uploadComplete(file) {
//$('#' + progressDivId).dialog('close');
}
// This event comes from the Queue Plugin
function queueComplete(numFilesUploaded) {
}
}
window.SWFUpload = SWFUpload;
\ No newline at end of file
... ...