Commit 49e5e208 by 施宇

Merge branch 'master' of http://119.23.72.7/shiyu/icsales

# Conflicts:
#	Application/Home/View/public/header.html
parents 18a5a589 c25840e6
<?php
/**
* 传递数据以易于阅读的样式格式化后输出
*/
function p($data)
{
// 定义样式
$str='<pre style="display: block;padding: 9.5px;margin: 44px 0 0 0;font-size: 13px;line-height: 1.42857;color: #333;word-break: break-all;word-wrap: break-word;background-color: #F5F5F5;border: 1px solid #CCC;border-radius: 4px;">';
// 如果是boolean或者null直接显示文字;否则print
if (is_bool($data)) {
$show_data=$data ? 'true' : 'false';
}elseif (is_null($data)) {
$show_data='null';
}else{
$show_data=print_r($data,true);
}
$str.=$show_data;
$str.='</pre>';
echo $str;
}
/**
* 统一密码加密
* @param [type] $pwd [description]
* @return [type] [description]
*/
function pwdhash($pwd, $salt)
{
return md5(md5($pwd).$salt);
}
/**
* 获取浏览器及相关设备信息
* return array
*/
function getAgentInfo()
{
$agent = $_SERVER['HTTP_USER_AGENT'];
$brower = array(
'MSIE' => 1,
'Trident/' => 1,
'Firefox' => 2,
'MicroMessenger' => 9,
'QQBrowser' => 11,
'QQ/' => 3,
'UCBrowser' => 4,
'Edge' => 5,
'Chrome' => 6,
'Opera' => 7,
'OPR' => 7,
'Safari' => 8,
);
$system = array(
'Windows' => 1,
'Android' => 2,
'iPhone' => 3,
'Windows Phone' => 4,
'iPad' => 5
);
$browser_num = 0;//未知
$system_num = 0;//未知
foreach ($brower as $bro => $val) {
if (stripos($agent, $bro) !== false) {
$browser_num = $val;
break;
}
}
foreach ($system as $sys => $val) {
if (stripos($agent, $sys) !== false) {
$system_num = $val;
break;
}
}
return array('sys' => $system_num, 'bro' => $browser_num);
}
/**
* 判断访问站点(优先适用传过来的参数)
* @return [type] [description]
*/
function platform()
{
$pf = I('request.pf', -1, 'intval');
if ($pf == -1) {
if ($_SERVER['HTTP_HOST'] == 'api.liexin.com') {
return 1;
}
$url_arr = explode('//', $_SERVER['HTTP_HOST']);
$domain_arr = explode('/', $url_arr['0']);
switch ($domain_arr['0']) {
case 'www.liexin.com' :
case 'www.ichunt.com' :
case 't.ichunt.com' :
case 'sz.ichunt.com' :
case 'member.ichunt.net' :
return 1; break;
case 'm.liexin.com' :
case 'm.ichunt.com' :
case 'tm.ichunt.com' :
case 'szm.ichunt.com' :
return 2; break;
default :
return -1;
}
} else {
return $pf;
}
}
// curl post
function post_curl($url, $data, $headers = array(), $cookie = array())
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
if (strpos($url, 'https://') !== false) {
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
}
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
/**
* 生成随机数
*
* @param $length int 随机数长度
* @param $numeric boolean 是否为纯数字
* @return string 随机数
*/
function random($length, $numeric = 0) {
$seed = base_convert(md5(microtime().$_SERVER['DOCUMENT_ROOT']), 16, $numeric ? 10 : 35);
$seed = $numeric ? (str_replace('0', '', $seed).'012340567890') : ($seed.'zZ'.strtoupper($seed));
if($numeric) {
$hash = '';
} else {
$hash = chr(rand(1, 26) + rand(0, 1) * 32 + 64);
$length--;
}
$max = strlen($seed) - 1;
for($i = 0; $i < $length; $i++) {
$hash .= $seed{mt_rand(0, $max)};
}
return $hash;
}
//URL安全的字符串编码
function urlsafe_b64encode($string) {
$data = base64_encode($string);
$data = str_replace(array('+','/','='), array('-','_',''), $data);
return $data;
}
/**
* 验证整数
* @param string $str
* @param int $sign 是否带符号,0否 1是 2全部
* @return boolean
*/
function isInt($str, $sign = 2) {
if (strlen($str) === 1 && is_numeric($str)) {
return true;
}
$regStr = '/^[\-]?[1-9]{1}[0-9]{0,}$/';
if ($sign === 0) {
$regStr = '/^[1-9]{1}[0-9]{0,}$/';
} elseif ($sign === 1) {
$regStr = '/^[\-][1-9]{1}[0-9]{0,}$/';
}
return preg_match($regStr, $str) ? true : false;
}
/*移动端判断*/
function isMobile()
{
// 如果有HTTP_X_WAP_PROFILE则一定是移动设备
if (isset ($_SERVER['HTTP_X_WAP_PROFILE'])) {
return true;
}
// 如果via信息含有wap则一定是移动设备,部分服务商会屏蔽该信息
if (isset ($_SERVER['HTTP_VIA'])) {
// 找不到为flase,否则为true
return stristr($_SERVER['HTTP_VIA'], "wap") ? true : false;
}
// 脑残法,判断手机发送的客户端标志,兼容性有待提高
if (isset ($_SERVER['HTTP_USER_AGENT'])) {
$clientkeywords = array ('nokia',
'sony',
'ericsson',
'mot',
'samsung',
'htc',
'sgh',
'lg',
'sharp',
'sie-',
'philips',
'panasonic',
'alcatel',
'lenovo',
'iphone',
'ipod',
'blackberry',
'meizu',
'android',
'netfront',
'symbian',
'ucweb',
'windowsce',
'palm',
'operamini',
'operamobi',
'openwave',
'nexusone',
'cldc',
'midp',
'wap',
'mobile'
);
// 从HTTP_USER_AGENT中查找手机浏览器的关键字
if (preg_match("/(" . implode('|', $clientkeywords) . ")/i", strtolower($_SERVER['HTTP_USER_AGENT']))) {
return true;
}
}
// 协议法,因为有可能不准确,放到最后判断
if (isset ($_SERVER['HTTP_ACCEPT'])) {
// 如果只支持wml并且不支持html那一定是移动设备
// 如果支持wml和html但是wml在html之前则是移动设备
if ((strpos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') !== false) && (strpos($_SERVER['HTTP_ACCEPT'], 'text/html') === false || (strpos($_SERVER['HTTP_ACCEPT'], 'vnd.wap.wml') < strpos($_SERVER['HTTP_ACCEPT'], 'text/html')))) {
return true;
}
}
return false;
}
/**
* [get_curl description]
* @param [type] $url [description]
* @return [type] [description]
*/
function get_curl($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
if (strpos($url, 'https://') !== false) {
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
}
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
/**
* [request description]
* @param [type] $url [description]
* @param [type] $params [description]
* @param [type] $ispost [description]
* @param [type] $https [description]
* @return [type] [description]
*/
function request($url, $params = false, $ispost = 0, $https = 0)
{
$httpInfo = array();
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
if ($https) {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // 对认证证书来源的检查
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); // 从证书中检查SSL加密算法是否存在
}
if ($ispost) {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_URL, $url);
} else {
if ($params) {
if (is_array($params)) {
$params = http_build_query($params);
}
curl_setopt($ch, CURLOPT_URL, $url . '?' . $params);
} else {
curl_setopt($ch, CURLOPT_URL, $url);
}
}
$response = curl_exec($ch);
if ($response === FALSE) {
//echo "cURL Error: " . curl_error($ch);
return false;
}
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$httpInfo = array_merge($httpInfo, curl_getinfo($ch));
curl_close($ch);
return $response;
}
/**
* 使用专用redis读取写入
* @param [type] $key [description]
* @param string $value [description]
* @param [type] $option [description]
*/
function S_redis($key, $value = '', $option = null)
{
$options = array(
'type' => 'redisrw',
);
empty($option) && $option = array();
$options = array_merge($option, $options);
return S($key, $value, $options);
}
function getip() {
$unknown = 'unknown';
if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] && strcasecmp($_SERVER['HTTP_X_FORWARDED_FOR'], $unknown) ) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} elseif ( isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], $unknown) ) {
$ip = $_SERVER['REMOTE_ADDR'];
}/*处理多层代理的情况或者使用正则方式:$ip = preg_match("/[\d\.]{7,15}/", $ip, $matches) ? $matches[0] : $unknown;*/
if (false !== strpos($ip, ','))
$ip = reset(explode(',', $ip));
return $ip;
}
/**
* rabbitmq 消息推送
*
*/
function pushMsg($config,$list_name,$arr){
if(!$config || !$list_name || !$arr){
return false;
}
$con = C($config);
$con['queue_name'] = $list_name;
$con['route_key'] = $list_name;
$con['vhost'] = $con['vhost']? $con['vhost']:'';
$con['exchangeType'] = AMQP_EX_TYPE_DIRECT;
$con['flags'] = AMQP_DURABLE;
$con['exchangename'] = 'CREDITHC_CS';
vendor('Mq.RabbitMQ');
try{
$MQ = \RabbitMQ :: init();
$MQ -> config($con);
$MQ -> connect();
$MQ -> publish(json_encode($arr));
//$ret = $MQ -> getMsg();
//dump(json_decode($ret,true));
}catch(\Exception $e){
// var_dump($e);
}
return true;
}
/**
* 获取CMS缓存数据
* @param [type] $key [键]
* @param string $field [字段]
* @param string $column [列]
* @param string $sort [排序]
* @param integer $limit [限制数量]
*/
function S_cms($key, $field='', $column='', $sort='', $limit='')
{
$datas = array();
$option = array(
'host' => C('FS_REDIS_HOST'),
'port' => C('FS_REDIS_PORT'),
'password' => C('FS_REDIS_PASSWORD')
);
$redis = new \Think\Cache\Driver\Redisrw($option);
$res = $field ? $redis->hget($key, $field) : $redis->hgetAll($key);
if (!$res) return $datas;
// 判断是否为数组
if (is_array($res)) {
foreach ($res as $k=>$v) {
$datas[] = json_decode($v, true);
}
if ($sort) {
array_multisort(array_column($datas, $sort), SORT_DESC, $datas); // 指定列排序
}
$datas = $limit ? array_slice($datas, 0, $limit) : $datas;
} else {
$datas = json_decode($res, true);
return $column ? $datas[$column] : $datas; // 返回指定列值
}
return $datas;
}
<?php <?php
return array( return array(
'LOAD_EXT_CONFIG' => 'config_db,config_url,config_pwd,config_param,config_supplier,chain_config,footstone_config,config_pcb', 'LOAD_EXT_CONFIG' => 'config_db,config_url',
'VAR_PAGE' => 'p', 'VAR_PAGE' => 'p',
'APP_SUB_DOMAIN_DEPLOY' => true, 'APP_SUB_DOMAIN_DEPLOY' => true,
'APP_SUB_DOMAIN_RULES' => array( 'APP_SUB_DOMAIN_RULES' => array(
......
<?php
return array(
'DB_TYPE' => 'mysql', // 数据库类型
'DB_HOST' => '192.168.2.232', // 服务器地址
'DB_NAME' => 'liexin', // 数据库名
'DB_USER' => 'liexin', // 用户名
'DB_PWD' => 'liexin#zsyM', // 密码
'DB_PORT' => '3306', // 端口
'DB_PREFIX' => 'lie_', // 数据库表前缀
'DB_PARAMS' => array(), // 数据库连接参数
'DB_DEBUG' => true, // 数据库调试模式 开启后可以记录SQL日志
'DB_FIELDS_CACHE' => true, // 启用字段缓存
'DB_CHARSET' => 'utf8', // 数据库编码默认采用utf8
'DB_DEPLOY_TYPE' => 0, // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
'DB_RW_SEPARATE' => false, // 数据库读写是否分离 主从式有效
'DB_MASTER_NUM' => 1, // 读写分离后 主服务器数量
'DB_SLAVE_NO' => '', // 指定从服务器序号
'DB_OTHER' => array(
'CMS' => array(
'db_type' => 'mysql',
'db_user' => 'ichuntcms',
'db_pwd' => 'ichuntcms#zsyM',
'db_host' => '192.168.2.232',
'db_port' => '3306',
'db_name' => 'ichuntcms',
'db_charset'=>'utf8',
),
'FS' => array(
'db_type' => 'mysql',
'db_user' => 'spu',
'db_pwd' => 'spu',
'db_host' => '192.168.1.234',
'db_port' => '3306',
'db_name' => 'liexin_spu',
'db_charset'=>'utf8',
),
),
/*撮合数据库*/
"MATCHES_DB_CONFIG" => array(
'db_type' => 'mysql',
'db_user' => 'matches',
'db_pwd' => 'matches#zsyM',
'db_host' => 'db1.ichunt.com',
'db_port' => '3306',
'db_name' => 'matches',
'db_prefix' => 'lie_',
'db_charset'=>'utf8',
),
//数据中心mysql 后面记得要拼接数据库名称
'SUPPLIER_CENTER_MYSQL' => 'mysql://root:HuntxB9#zsyM@192.168.2.232:3306/',
//Mongo
'DB_MONGO' => array(
'db_type' => 'mongo',
'db_user' => 'ichunt',
'db_pwd' => 'huntmon6699',
'db_host' => '192.168.1.237',
'db_port' => '27017',
'db_name' => 'logs',
'db_charset'=>'utf8',
),
'SUPPLIER_CENTER_DB_CONFIG' => array(
/* 数据库配置 */
'db_type' => 'mongo', // 数据库类型
'db_host' => '192.168.1.237',// 服务器地址
'db_name' => 'ichunt', // 数据库名
'db_user' => 'ichunt', // 用户名
'db_pwd' => 'huntmon6699', // 密码
'db_port' => '27017', // 端口
'db_prefix' => '', // 数据库表前缀
),
//REDIS
'REDIS_HOST' => '192.168.1.235,192.168.1.237',
'REDIS_PORT' => 6379,
'REDIS_PASSWORD' => 'icDb29mLy2s',
'REDIS_RW_SEPARATE' => true,
'DATA_CACHE_TIMEOUT'=> false,
'DATA_CACHE_PERSISTENT' => false,
//基石系统redis
'FS_REDIS_HOST'=>'192.168.1.235,192.168.1.237',
'FS_REDIS_PORT' => 6379,
'FS_REDIS_PASSWORD' => 'icDb29mLy2s',
//spu与sku的数据库连接
'SPU_SKU_MYSQL' => 'mysql://spu:spu@192.168.1.234:3306/',
//rabbitmq链接信息
'RABBITMQ_FLAG'=>true,//为true时打开记录信息
'RABBITMQ_CONFIG'=>array(
"host" => "192.168.2.232",
"port" => "5672",
"user_name" => "guest",
"password" => "guest",
),
//神策
'RABBITMQ_SENSOR_CONFIG'=>array(
"host" => "192.168.2.232",
"port" => "5672",
"user_name" => "guest",
"password" => "guest",
'vhost'=>'/'
),
);
\ No newline at end of file
...@@ -13,18 +13,18 @@ return array( ...@@ -13,18 +13,18 @@ return array(
'__PUBLIC__' => STATIC_DOMAIN, '__PUBLIC__' => STATIC_DOMAIN,
//非必须登录 //非必须登录
//登录、注册、找回密码、登录状态、绑定第三方账户 //登录、注册、找回密码、登录状态、绑定第三方账户
'authapi' => 'authapi.icsales.com', 'authapi' => 'http://authapi.icsales.cc',
//非必须登录 //非必须登录
//询价中心、后台首页(部分接口)、抢单专区、后台搜索、前台搜索 //询价中心、后台首页(部分接口)、抢单专区、后台搜索、前台搜索
'soapi' => 'soapi.icsales.com', 'soapi' => 'http://soapi.icsales.cc',
//必须登录 //必须登录
//登录会员信息、会员认证(包含但不限于新增认证、认证列表)、积分、账户设置、站内消息通知 //登录会员信息、会员认证(包含但不限于新增认证、认证列表)、积分、账户设置、站内消息通知
'userapi' => 'userapi.icsales.com', 'userapi' => 'http://userapi.icsales.cc',
//非必须登录:商详 //非必须登录:商详
//必须登录:我的商品列表、编辑、新增、删除、下架、上架、批量上传、商品数量统计、批量上传任务状态 //必须登录:我的商品列表、编辑、新增、删除、下架、上架、批量上传、商品数量统计、批量上传任务状态
'goodsapi' => 'goodsapi.icsales.com', 'goodsapi' => 'http://goodsapi.icsales.cc',
//必须登录:我的询价列表、询价下架and上架、询价详情、询价数量统计、发布询价 报价列表、报价详情(询报价相关)、报价数量统计、发布报价 //必须登录:我的询价列表、询价下架and上架、询价详情、询价数量统计、发布询价 报价列表、报价详情(询报价相关)、报价数量统计、发布报价
'inquiryapi' => 'inquiryapi.icsales.com' 'inquiryapi' => 'http://inquiryapi.icsales.cc'
), ),
'URL_MAP_RULES' => array(//静态路由 'URL_MAP_RULES' => array(//静态路由
......
<?php
namespace Home\Controller;
use Think\Controller;
class BaseController extends Controller
{
public function _initialize()
{
$datas['logo'] = $this->apiBaseCache('pc_logo_set'); // logo
$datas['bottom_qrcode'] = $this->apiBaseCache('pc_bottom_qrcode'); // 底部二维码
foreach ($datas as $k => $v) {
$this->assign($k, $v['data']);
}
}
/**
* 通过bcat_id获取CMS分类数据 --- 图片、文字等
* @param [type] $tags [标签]
* @param [type] $where [搜索条件,用&连接,如:a=1&b=2]
* @param [type] $limit [数量]
* @return [type] [description]
*/
public function apiBaseCache($tags, $where='', $limit=1)
{
$cms = D('Home/Scms');
$datas = $cms->getBaseList($tags, $where, $limit);
if (!empty($datas)) {
return $this->apiReturn(0, '', $datas);
} else {
return $this->apiReturn(7004, '未找到数据');
}
}
/**
* 统一格式返回
* @param integer $code [description]
* @param string $msg [description]
* @param array $extend [description]
* @return [type] [description]
*/
protected function apiReturn($code = 0, $msg = '', $extend = array())
{
$data = array(
'err_code' => $code,
'err_msg' => $msg,
'data' => $extend,
);
if(isset($_GET['callback']) && !empty($_GET['callback'])){
echo $_GET['callback'].'('.json_encode($data).')';exit;
}else{
return $data;exit;
}
}
}
\ No newline at end of file
<?php <?php
namespace Home\Controller; namespace Home\Controller;
use Think\Controller; use Home\Controller\BaseController;
class IndexController extends Controller class IndexController extends BaseController
{ {
/** /**
...@@ -12,6 +11,12 @@ class IndexController extends Controller ...@@ -12,6 +11,12 @@ class IndexController extends Controller
*/ */
public function index() public function index()
{ {
$datas['cooperation_pf'] = $this->apiBaseCache('pc_home_cooperation_pf', '', ''); // 合作平台
foreach ($datas as $k => $v) {
$this->assign($k, $v['data']);
}
$this->display('Index/index'); $this->display('Index/index');
} }
......
<?php
/**
* 获取CMS缓存
*/
namespace Home\Model;
class ScmsModel
{
/**
* 获取bcat_id
* @param [type] $key [键]
* @param integer $type [取值类型:1-通过tags,2-通过tem_id(楼层类目)]
* @return [type] [description]
*/
public function getBcatId($key, $type=1)
{
return $type == 1 ? S_cms('icsales:lie_base_cat:tags', $key, 'bcat_id') : S_cms('icsales:lie_base_cat:tem_id:'.$key);
}
/**
* 获取base数据
* @param [type] $key [键]
* @param string $limit [限制数量]
* @param integer $type [取值类型:1-通过bcat_id, 2-通过tem_id,3-通过model_id]
* @return [type] $condition [搜索条件,用&连接,如:a=1&b=2]
* @param [type] $table [表名]
* @return [type] [description]
*/
public function getBase($key, $limit='', $condition='', $type=1, $table='lie_base')
{
if ($type == 1)
$datas = S_cms('icsales:'.$table.':bcat_id:'.$key, '', '', 'sort');
else if ($type == 2)
$datas = S_cms('icsales:'.$table.':tem_id:'.$key, '', '', 'sort');
else
$datas = S_cms('icsales:'.$table.':model_id:'.$key, '', '', 'sort');
if (!$datas) return $datas;
if ($condition) {
parse_str($condition, $arr); // 解析条件,输出数组
$isTrue = true;
$datas = array_filter($datas, function($base) use ($arr, $isTrue) {
foreach ($arr as $k=>$v) {
if (isset($base[$k]) && $base[$k] != $v) { // 判断每个搜索条件是否存在且值相等,若不相等,则过滤对应的datas数组值
$isTrue = false;
}
}
return $isTrue;
});
array_multisort($datas); // 重新索引
}
$datas = $limit ? array_slice($datas, 0, $limit) : $datas;
return $datas;
}
/**
* 获取Base表配置内容
* @param [type] $tags [tags值]
* @param string $where [条件]
* @param string $limit [限制数量]
* @return [type] [description]
*/
public function getBaseList($tags, $where='', $limit=1)
{
$bcat_id = $this->getBcatId($tags); // 分类ID
return $this->getBase($bcat_id, $limit, $where);
}
/**
* 获取楼层模板
* @param [type] $key [键]
* @return [type] [description]
*/
public function getTemplate($key)
{
return S_cms('icsales:lie_template:tag:'.$key, '', '', 'sort');
}
/**
* 获取模块
* @param [type] $field [字段值]
* @param string $column [指定列]
* @return [type] [description]
*/
public function getModel($field, $column='')
{
return $column ? S_cms('icsales:lie_model:model_key', $field, $column) : S_cms('icsales:lie_model:model_key', $field);
}
/**
* 获取导航
* @param integer $model_id [所属模块ID]
* @param integer $parent_id [所属父级ID] <先查找模块下所有导航,遍历后,根据nav_id查找对应子级>
* @return [type] [description]
*/
public function getNavigation($model_id, $parent_id=0)
{
return $parent_id == 0 ? S_cms('icsales:lie_navigation:model_id:'.$model_id, '', '', 'sort') : S_cms('icsales:lie_navigation:model_id:'.$model_id.':parent_id:'.$parent_id, '', '', 'sort');
}
/**
* 获取帮助中心分类
* @param integer $model_id [所属模块ID]
* @param integer $parent_id [所属父级ID] <先查找模块下所有分类,遍历后,根据hccat_id查找对应子级>
* @return [type] [description]
*/
public function getHelpCenterCat($model_id, $parent_id=0)
{
return $parent_id == 0 ? S_cms('icsales:lie_help_center_cat:model_id:'.$model_id, '', '', 'sort') : S_cms('icsales:lie_help_center_cat:model_id:'.$model_id.':parent_id:'.$parent_id, '', '', 'sort');
}
/**
* 获取帮助中心内容
* @param [type] $hccat_id [帮助中心分类ID]
* @return [type] [description]
*/
public function getHelpCenter($hccat_id)
{
return S_cms('icsales:lie_help_center:hccat_id:'.$hccat_id, '', '', 'sort');
}
/**
* 获取底部链接分类
* @param integer $fcat_key [所属模块ID]
* @param integer $column [指定字段]
* @param integer $parent_id [所属父级ID] <先查找模块下所有分类,遍历后,根据fcat_id查找对应子级>
* @return [type] [description]
*/
public function getFooterLinkCat($fcat_key, $column='', $parent_id=0)
{
return $parent_id == 0 ? S_cms('icsales:lie_footer_link_cat:fcat_key', $fcat_key, $column, 'sort') : S_cms('icsales:lie_footer_link_cat:parent_id:'.$parent_id, '', '', 'sort');
}
/**
* 获取底部链接内容
* @param [type] $fcat_id [帮助中心分类ID]
* @return [type] [description]
*/
public function getFooterLink($fcat_id)
{
return S_cms('icsales:lie_footer_link:fcat_id:'.$fcat_id, '', '', 'sort');
}
/**
* 获取页面分类
* @param integer $model_id [所属模块ID]
* @return [type] [description]
*/
public function getPageCat($model_id)
{
return S_cms('icsales:lie_page_cat:model_id:'.$model_id);
}
/**
* 获取页面内容
* @param [type] $pagecat_id [页面分类ID]
* @return [type] [description]
*/
public function getPage($pagecat_id)
{
return S_cms('icsales:lie_page:pagecat_id:'.$pagecat_id);
}
/************************************** 信宏泰配置 **************************************/
/**
* 获取公司
* @return [type] [description]
*/
public function getCompany()
{
return S_cms('icsales:xht:lie_company', '', '', 'sort');
}
/**
* 获取公司信息
* @param [type] $com_id [公司ID]
* @return [type] [description]
*/
public function getCompanyInfo($com_id)
{
return S_cms('icsales:xht:lie_company_info:com_id:'.$com_id, '', '', 'sort');
}
/**
* 获取公司图片
* @param [type] $com_id [公司ID]
* @return [type] [description]
*/
public function getCompanyImg($com_id)
{
return S_cms('icsales:xht:lie_company_img:com_id:'.$com_id, '', '', 'sort');
}
}
\ No newline at end of file
...@@ -2,187 +2,185 @@ ...@@ -2,187 +2,185 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<include file="public/header" /> <include file="public/header"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/goodmanage.css"> <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/goodmanage.css">
</head> </head>
<body> <body>
<div class="wrapper"> <div class="wrapper">
<include file="public/navleft" /> <include file="public/navleft"/>
<div class="wrapper_right"> <div class="wrapper_right">
<include file="public/top" /> <include file="public/top"/>
<div class="right_content good_manage_content"> <div class="right_content good_manage_content">
<div class="content"> <div class="content">
<div class="nav_title">商品管理 > 商品列表</div> <div class="nav_title">商品管理 > 商品列表</div>
<div class="good_total clr"> <div class="good_total clr">
<div class="fl my_good"> <div class="fl my_good">
<h3>85</h3> <h3>--</h3>
<p>我的商品</p> <p>我的商品</p>
</div> </div>
<div class="fl week_good"> <div class="fl week_good">
<h3>85</h3> <h3>--</h3>
<p>本周新增</p> <p>本周新增</p>
</div> </div>
<div class="fl no_good"> <div class="fl no_good">
<h3>85</h3> <h3>--</h3>
<p>等待完善</p> <p>等待完善</p>
</div>
<div class="center_line line1"></div>
<div class="center_line line2"></div>
</div> </div>
<div class="filter_section clr"> <div class="center_line line1"></div>
<div class="fr"> <div class="center_line line2"></div>
<div class="btn_div fr"> </div>
<a class="cx lineBlock btn nohover">查询</a> <div class="filter_section layui-form clr">
<div class="fr">
<div class="btn_div fr">
<a class="cx lineBlock btn nohover" lay-submit lay-filter="search">查询</a>
</div>
<div class="date_div fr">
<span class="fl">日期选择:</span>
<div class="start_date_div fl">
<div class="icon_div fl icon iconfont iconjuxing13"></div>
<input type="text" name="start_time" placeholder="开始日期" class="fl boxsiz" id="start_time">
</div> </div>
<div class="date_div fr"> <div class="fl heng"></div>
<span class="fl">日期选择:</span> <div class="end_date_div fl">
<div class="start_date_div fl"> <div class="icon_div fl icon iconfont iconjuxing13">
<div class="icon_div fl icon iconfont iconjuxing13">
</div>
<input type="text" placeholder="开始日期" class="fl boxsiz" id="start_date">
</div> </div>
<div class="fl heng"></div> <input type="text" name="end_time" placeholder="结束日期" class="fl boxsiz" id="end_time">
<div class="end_date_div fl">
<div class="icon_div fl icon iconfont iconjuxing13">
</div>
<input type="text" placeholder="结束日期" class="fl boxsiz" id="end_date">
</div>
</div>
<div class="layui-form fr">
<span class="lineBlock">状态:</span>
<select name="city" lay-verify="required">
<option value=""></option>
<option value="0">北京</option>
<option value="1">上海</option>
<option value="2">广州</option>
<option value="3">深圳</option>
<option value="4">杭州</option>
</select>
</div> </div>
</div> </div>
<div class="input_div boxsiz"> <div class="layui-form-style fr">
<span class="lineBlock">商品型号:</span> <span class="lineBlock">状态:</span>
<div class="boxsiz"> <select name="status">
<input type="text" placeholder="请输入型号" class="boxsiz"> <option value=""></option>
</div> <option value="1">上架</option>
<option value="2">下架</option>
<option value="3">禁用</option>
</select>
</div> </div>
</div> </div>
<div class="btn_group clr"> <div class="input_div boxsiz">
<div class="dgsc fl btn"> <span class="lineBlock">商品型号:</span>
<span class="icon iconfont iconjuxing16"></span> <div class="boxsiz">
上传商品 <input type="text" placeholder="请输入型号" class="boxsiz" name="goods_name">
</div>
<div class="xz fr boxsiz btn btn_border">
下载商品模板</div>
<div class="plsc fr btn btn_green">
<span class="icon iconfont iconjuxing16 "></span>
批量上传
</div> </div>
</div> </div>
<div class="good_data"> </div>
<div class="data_list"> <div class="btn_group clr">
<div class="data_item"> <div class="dgsc fl btn">
<div class="data_detail"> <span class="icon iconfont iconjuxing16"></span>
<div class="type fl ellipsis boxsiz"><span 上传商品
class="bold">STM32F103ZET6STM32F103ZET6</span><span </div>
class="icon iconfont iconjuxing17"></span></div> <div class="xz fr boxsiz btn btn_border">
<div class="brand fl ellipsis boxsiz">品牌:<span>Texas Instrument</span></div> 下载商品模板
<div class="num fl ellipsis boxsiz">库存:<span>PCS10,000</span></div> </div>
<div class="price fl ellipsis boxsiz bold">¥1.8835</div> <div class="plsc fr btn btn_green">
<div class="data_status fl boxsiz zs"><span class="mark lineBlock"></span><span <span class="icon iconfont iconjuxing16 "></span>
class="text">展示中</span></div> 批量上传
<div class="time fr ellipsis boxsiz">2019-05-22 15:35</div> </div>
</div>
<div class="good_data" id='listData'>
<!-- <div class="data_list">
<div class="data_item">
<div class="data_detail">
<div class="type fl ellipsis boxsiz">
<span class="bold">STM32F103ZET6STM32F103ZET6</span>
<span class="icon iconfont iconjuxing17"></span>
</div> </div>
<a class="xj fr">下架</a> <div class="brand fl ellipsis boxsiz">
<a class="edit fr">编辑</a> 品牌:<span>Texas Instrument</span>
</div>
<div class="data_item">
<div class="data_detail">
<div class="type fl ellipsis boxsiz"><span
class="bold">STM32F103ZET6STM32F103ZET6</span><span
class="icon iconfont iconjuxing17"></span></div>
<div class="brand fl ellipsis boxsiz">品牌:<span>Texas Instrument</span></div>
<div class="num fl ellipsis boxsiz">库存:<span>PCS10,000</span></div>
<div class="price fl ellipsis boxsiz bold">¥1.8835</div>
<div class="data_status fl boxsiz zs"><span class="mark lineBlock"></span><span
class="text">展示中</span></div>
<div class="time fr ellipsis boxsiz">2019-05-22 15:35</div>
</div> </div>
<a class="xj fr">下架</a> <div class="num fl ellipsis boxsiz">库存:
<a class="edit fr">编辑</a> <span>PCS10,000</span>
</div>
<div class="data_item">
<div class="data_detail">
<div class="type fl ellipsis boxsiz"><span
class="bold">STM32F103ZET6STM32F103ZET6</span><span
class="icon iconfont iconjuxing17"></span></div>
<div class="brand fl ellipsis boxsiz">品牌:<span>Texas Instrument</span></div>
<div class="num fl ellipsis boxsiz">库存:<span>PCS10,000</span></div>
<div class="price fl ellipsis boxsiz bold">¥1.8835</div>
<div class="data_status fl boxsiz zs"><span class="mark lineBlock"></span><span
class="text">展示中</span></div>
<div class="time fr ellipsis boxsiz">2019-05-22 15:35</div>
</div> </div>
<a class="xj fr">下架</a> <div class="price fl ellipsis boxsiz bold">¥1.8835</div>
<a class="edit fr">编辑</a> <div class="data_status fl boxsiz zs">
</div> <span class="mark lineBlock"></span>
<div class="data_item"> <span class="text">展示中</span>
<div class="data_detail">
<div class="type fl ellipsis boxsiz"><span
class="bold">STM32F103ZET6STM32F103ZET6</span><span
class="icon iconfont iconjuxing17"></span></div>
<div class="brand fl ellipsis boxsiz">品牌:<span>Texas Instrument</span></div>
<div class="num fl ellipsis boxsiz">库存:<span>PCS10,000</span></div>
<div class="price fl ellipsis boxsiz bold">¥1.8835</div>
<div class="data_status fl boxsiz zs"><span class="mark lineBlock"></span><span
class="text">展示中</span></div>
<div class="time fr ellipsis boxsiz">2019-05-22 15:35</div>
</div> </div>
<a class="xj fr">下架</a> <div class="time fr ellipsis boxsiz">2019-05-22 15:35</div>
<a class="edit fr">编辑</a>
</div> </div>
</div> <a class="xj fr">下架</a>
<div class="no_data" style="display: none"> <a class="edit fr">编辑</a>
<img src="__PUBLIC__/images/nosearchdata.png" alt="">
<p class="bold">未搜索到询价信息</p>
</div> </div>
</div> </div>
<div class="no_data" style="display: none">
<img src="__PUBLIC__/images/nosearchdata.png" alt="">
<p class="bold">未搜索到询价信息</p>
</div>-->
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<include file="public/foot" />
<script>
layui.use('laydate', function () {
var laydate = layui.laydate;
//执行一个laydate实例 </div>
laydate.render({ <include file="public/foot"/>
elem: '#start_date', //指定元素 <script src="__PUBLIC__/js/goodmanage/index.js"></script>
theme: '#0D84D1' <script type="text/html" id="listHtml">
}); <div class="data_list">
laydate.render({ {{# layui.each(d, function(index, item){ }}
elem: '#end_date', //指定元素 <div class="data_item">
theme: '#0D84D1' <div class="data_detail">
}); <div class="type fl ellipsis boxsiz">
}); <span class="bold">{{item.goods_name}}</span>
$('.dgsc').click(function () { <span class="icon iconfont iconjuxing17"></span>
window.location.href = '/uploadsingle' </div>
}) <div class="brand fl ellipsis boxsiz">
$('.plsc').click(function () { 品牌:<span>{{item.brand_name}}</span>
window.location.href = '/bulkupload' </div>
}) <div class="num fl ellipsis boxsiz">库存:
$('.xz').click(function () { <span>{{item.stock}}</span>
window.location.href = '/uploadresult' </div>
}) <div class="price fl ellipsis boxsiz bold">{{item.price}}</div>
$('.data_item').click(function () { <div class="data_status fl boxsiz zs">
window.location.href = '/gooddetail' <span class="mark lineBlock"></span>
}) <span class="text">展示中</span>
</script> </div>
<div class="time fr ellipsis boxsiz">{{ layui.util.toDateString(item.update_time * 1000)}}</div>
</div>
<a class="xj fr">下架</a>
<a class="edit fr">编辑</a>
</div>
{{# }); }}
{{# if(d.length === 0){ }}
<div class="no_data">
<img src="__PUBLIC__/images/nosearchdata.png" alt="">
<p class="bold">无商品信息</p>
</div>
{{# } }}
</div>
<div class="pagination-with" id="pagination" style="text-align: right;margin-top: 25px;"></div>
</script>
<script type="text/html" id="countHtml">
<div class="fl my_good">
<h3>{{d.mygoods}}</h3>
<p>我的商品</p>
</div>
<div class="fl week_good">
<h3>{{d.newadd}}</h3>
<p>本周新增</p>
</div>
<div class="fl no_good">
<h3>{{d.imperfect}}</h3>
<p>等待完善</p>
</div>
<div class="center_line line1"></div>
<div class="center_line line2"></div>
</script>
<script>
$('.dgsc').click(function () {
window.location.href = '/uploadsingle'
})
$('.plsc').click(function () {
window.location.href = '/bulkupload'
})
$('.xz').click(function () {
window.location.href = '/uploadresult'
})
$('.data_item').click(function () {
window.location.href = '/gooddetail'
})
</script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -26,60 +26,57 @@ ...@@ -26,60 +26,57 @@
<span class="icon iconfont iconjuxing19 va-m"></span> <span class="icon iconfont iconjuxing19 va-m"></span>
<span>上传的商品有图片,搜索排名会优先排前</span> <span>上传的商品有图片,搜索排名会优先排前</span>
</div> </div>
<div class="form_content clr"> <div class="form_content layui-form clr">
<div class="form_left fl layui-form"> <div class="form_left fl layui-form">
<div class="xh input_div "> <div class="xh input_div ">
<span class="input_title lineBlock">*型号:</span> <span class="input_title lineBlock">*型号:</span>
<div class="input_parent"> <div class="input_parent">
<input type="text" placeholder="请输入商品型号" class="input boxsiz"> <input type="text" name="goods_name" placeholder="请输入商品型号" class="input boxsiz" lay-verify="required">
</div> </div>
</div> </div>
<div class="brand input_div "> <div class="brand input_div ">
<span class="input_title lineBlock">*品牌:</span> <span class="input_title lineBlock">*品牌:</span>
<div class="input_parent"> <div class="input_parent">
<input type="text" placeholder="请输入品牌(必填)" class="input boxsiz"> <input type="text" name="brand_name" placeholder="请输入品牌" class="input boxsiz" lay-verify="required">
</div> </div>
</div> </div>
<div class="fz input_div "> <div class="fz input_div ">
<span class="input_title lineBlock">封装:</span> <span class="input_title lineBlock">封装:</span>
<div class="input_parent"> <div class="input_parent">
<input type="text" placeholder="请输入封装" class="input boxsiz"> <input type="text" name="encap" placeholder="请输入封装" class="input boxsiz">
</div> </div>
</div> </div>
<div class="num input_div "> <div class="num input_div ">
<span class="input_title lineBlock">*库存:</span> <span class="input_title lineBlock">*库存:</span>
<div class="input_parent"> <div class="input_parent">
<input type="text" placeholder="请输入需求数量(必填)" class="input boxsiz"> <input type="text" name="stock" placeholder="请输入需求数量" class="input boxsiz" lay-verify="required">
</div> </div>
</div> </div>
<div class="price input_div "> <div class="price input_div ">
<span class="input_title lineBlock">*单价:</span> <span class="input_title lineBlock">*单价:</span>
<div class="input_parent"> <div class="input_parent">
<input type="text" placeholder="请输入接受价格" class="input boxsiz price_input"> <input type="text" name="price" placeholder="请输入接受价格" class="input boxsiz price_input" lay-verify="required">
<div class="rmb layui-form"> <div class="rmb layui-form">
<select name="city" lay-verify="required"> <select name="city" lay-verify="required">
<option value=""></option> <option value="1">RMB</option>
<option value="0">北京</option> <option value="2">USD</option>
<option value="1">上海</option>
<option value="2">广州</option>
<option value="3">深圳</option>
<option value="4">杭州</option>
</select> </select>
</div> </div>
</div> </div>
</div> </div>
<div class="hq input_div "> <div class="hq input_div">
<span class="input_title lineBlock">*货期:</span> <span class="input_title lineBlock">*货期:</span>
<div class="input_parent"> <div class="input_parent" id="delivery">
<input type="radio" name="sex" value="现货" title="现货"> <input type="radio" name="delivery_time" lay-filter="delivery" value="现货" title="现货">
<input type="radio" name="sex" value="期货" title="期货" checked> <input type="radio" name="delivery_time" lay-filter="delivery" value="期货" title="期货" checked id="daytext">
<input type="text" placeholder="输入时间" class="boxsiz day_input input"> <div class="lineBlock" id="day">
<i class="day"></i> <input type="text" placeholder="输入时间" class="boxsiz day_input input" lay-verify="required|number" name="day">
<i class="day"></i>
</div>
</div> </div>
</div> </div>
<div class="btn_div"> <div class="btn_div">
<span class="lineBlock fb btn">发布</span> <span class="lineBlock fb btn" lay-submit lay-filter="add">发布</span>
<span class="lineBlock cz btn btn_border">重置</span> <span class="lineBlock cz btn btn_border">重置</span>
</div> </div>
</div> </div>
...@@ -97,6 +94,13 @@ ...@@ -97,6 +94,13 @@
</div> </div>
</div> </div>
<include file="public/foot" /> <include file="public/foot" />
<script src="__PUBLIC__/js/goodmanage/uploadsingle.js"></script>
<script type="text/html" id="deliveryHtml">
{{# if (d== 1) { }}
<input type="text" placeholder="输入时间" class="boxsiz day_input input" lay-verify="required|number" name="day">
<i class="day"></i>
{{# } }}
</script>
</body> </body>
</html> </html>
\ No newline at end of file
<script src="__PUBLIC__/js/global/x_public.min.js" type="text/javascript"></script> <script src="__PUBLIC__/js/global/x_public.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/global/api.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/global/global.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/layui/layui.all.js"></script> <script src="__PUBLIC__/js/layui/layui.all.js"></script>
<script src="__PUBLIC__/js/global/global.min.js" type="text/javascript"></script>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="keywords" content="" /> <meta name="keywords" content=""/>
<meta name="description" content="" /> <meta name="description" content=""/>
<meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1; user-scalable=0;" /> <meta name="viewport" content="width=device-width; initial-scale=1; maximum-scale=1; user-scalable=0;"/>
<title>IC业务助手</title> <title>IC业务助手</title>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/common/base.css"> <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/common/base.css">
<!--[if IE 8]> <!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/common/ie.css"> <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/common/ie.css">
<![endif]--> <![endif]-->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/layui/css/layui.css">
<script>
var auth = 'authapi',
so = 'soapi',
user = 'userapi',
goods = 'goodsapi',
inquiry = 'inquiryapi';
</script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/layui/css/layui.css"> <link rel="stylesheet" type="text/css" href="__PUBLIC__/js/layui/css/layui.css">
\ No newline at end of file
<?php
return array(
//'配置项'=>'配置值'
);
\ No newline at end of file
\ No newline at end of file
\ No newline at end of file
\ No newline at end of file
<?php
return array(
//'配置项'=>'配置值'
);
\ No newline at end of file
\ No newline at end of file
<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller
{
public function index()
{
$this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>欢迎使用 <b>ThinkPHP</b>!</p><br/>版本 V{$Think.version}</div><script type="text/javascript" src="http://ad.topthink.com/Public/static/client.js"></script><thinkad id="ad_55e75dfae343f5a1"></thinkad><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script>','utf-8');
}
}
\ No newline at end of file
\ No newline at end of file
\ No newline at end of file
\ No newline at end of file
\ No newline at end of file
{"version":3,"sources":["chat.less"],"names":[],"mappings":"AAAA,aACI;EACI,kBAAA;;AAFR,aACI,SAGI;EACI,kBAAA;EACA,SAAA;EACA,UAAA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;;AAVZ,aACI,SAGI,aAQI;EACI,YAAA;EACA,+BAAA;EACA,YAAA;EACA,gBAAA;EACA,gBAAA;EACA,sBAAA;;AAEA,aAnBZ,SAGI,aAQI,aAQK;EACG,UAAA;;AArBpB,aACI,SAGI,aAQI,aAYI;EACI,gBAAA;EACA,0BAAA;;AA1BpB,aACI,SAGI,aAQI,aAkBI;EACI,uBAAA;EACA,eAAA;EACA,gBAAA;EACA,kBAAA;;AAEA,aAnChB,SAGI,aAQI,aAkBI,iBAMK;AACD,aApChB,SAGI,aAQI,aAkBI,iBAOK;EACG,yCAAA;;AAtCxB,aACI,SAGI,aAQI,aAkBI,iBAWI;EACI,YAAA;EACA,WAAA;EACA,sBAAA;;AA5CxB,aACI,SAGI,aAQI,aAkBI,iBAiBI;EACI,kBAAA;EACA,MAAA;EACA,WAAA;EACA,UAAA;EACA,SAAA;;AAGI,aAtDxB,SAGI,aAQI,aAkBI,iBAiBI,YAOI,IACK;EACG,gBAAA;;AADJ,aAtDxB,SAGI,aAQI,aAkBI,iBAiBI,YAOI,IACK,IAGG;EACI,eAAA;EACA,cAAA;EACA,kBAAA;EACA,kBAAA;;AAIR,aAjExB,SAGI,aAQI,aAkBI,iBAiBI,YAOI,IAYK;EACG,eAAA;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AaI,aAeK,MAGG;EACI,kBAAA;;AAJR,aApKpB,SAGI,aAiGI,cAoCI,aAaI,aAeK,MAGG,gBAGI;EACI,yBAAA;;AA5KpC,aACI,SAGI,aAiGI,cAoCI,aAaI,aA2BI;EACI,YAAA;EACA,WAAA;EACA,sBAAA;;AApL5B,aACI,SAGI,aAiGI,cAoCI,aAaI,aAkCI,gBACI;EACI,qBAAA;EACA,eAAA;EACA,cAAA;EACA,kBAAA;EACA,kBAAA;;AA9LhC,aACI,SAGI,aAiGI,cAoCI,aAaI,aAkCI,gBAUI;EACI,eAAA;EACA,cAAA;EACA,kBAAA","file":"chat.css"} {"version":3,"sources":["chat.less"],"names":[],"mappings":"AAAA,aACI;EACI,kBAAA;;AAFR,aACI,SAGI;EACI,kBAAA;EACA,SAAA;EACA,UAAA;EACA,WAAA;EACA,YAAA;EACA,gBAAA;;AAVZ,aACI,SAGI,aAQI;EACI,YAAA;EACA,+BAAA;EACA,YAAA;EACA,gBAAA;EACA,gBAAA;EACA,sBAAA;;AAEA,aAnBZ,SAGI,aAQI,aAQK;EACG,UAAA;;AArBpB,aACI,SAGI,aAQI,aAYI;EACI,gBAAA;EACA,0BAAA;;AA1BpB,aACI,SAGI,aAQI,aAkBI;EACI,uBAAA;EACA,eAAA;EACA,gBAAA;EACA,kBAAA;;AAEA,aAnChB,SAGI,aAQI,aAkBI,iBAMK;AACD,aApChB,SAGI,aAQI,aAkBI,iBAOK;EACG,yCAAA;;AAtCxB,aACI,SAGI,aAQI,aAkBI,iBAWI;EACI,YAAA;EACA,WAAA;EACA,sBAAA;;AA5CxB,aACI,SAGI,aAQI,aAkBI,iBAiBI;EACI,kBAAA;EACA,MAAA;EACA,WAAA;EACA,UAAA;EACA,SAAA;;AAGI,aAtDxB,SAGI,aAQI,aAkBI,iBAiBI,YAOI,IACK;EACG,gBAAA;;AADJ,aAtDxB,SAGI,aAQI,aAkBI,iBAiBI,YAOI,IACK,IAGG;EACI,eAAA;EACA,cAAA;EACA,kBAAA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AAA;;AAJR,aA7JpB,SAGI,aAiGI,cAyCI,aAaI,aAGK,KAGG,gBAGI;EACI,yBAAA;;AAKZ,aAzKpB,SAGI,aAiGI,cAyCI,aAaI,aAeK;EACG,iBAAA;;AADJ,aAzKpB,SAGI,aAiGI,cAyCI,aAaI,aAeK,MAGG;EACI,kBAAA;;AAJR,aAzKpB,SAGI,aAiGI,cAyCI,aAaI,aAeK,MAGG,gBAGI;EACI,yBAAA;;AAjLpC,aACI,SAGI,aAiGI,cAyCI,aAaI,aA2BI;EACI,YAAA;EACA,WAAA;EACA,sBAAA;;AAzL5B,aACI,SAGI,aAiGI,cAyCI,aAaI,aAkCI,gBACI;EACI,qBAAA;EACA,eAAA;EACA,cAAA;EACA,kBAAA;EACA,kBAAA;;AAnMhC,aACI,SAGI,aAiGI,cAyCI,aAaI,aAkCI,gBAUI;EACI,eAAA;EACA,cAAA;EACA,kBAAA","file":"chat.css"}
\ No newline at end of file \ No newline at end of file
...@@ -101,15 +101,15 @@ ...@@ -101,15 +101,15 @@
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
} }
.good_manage_content .filter_section .layui-form { .good_manage_content .filter_section .layui-form-style {
margin-right: 20px; margin-right: 20px;
} }
.good_manage_content .filter_section .layui-form .layui-form-select { .good_manage_content .filter_section .layui-form-style .layui-form-select {
display: inline-block; display: inline-block;
width: 170px; width: 170px;
vertical-align: middle; vertical-align: middle;
} }
.good_manage_content .filter_section .layui-form .layui-form-select input { .good_manage_content .filter_section .layui-form-style .layui-form-select input {
border-radius: 4px; border-radius: 4px;
} }
.good_manage_content .filter_section .heng { .good_manage_content .filter_section .heng {
...@@ -232,3 +232,4 @@ ...@@ -232,3 +232,4 @@
.good_manage_content .good_data .data_list .data_item .xj.fb { .good_manage_content .good_data .data_list .data_item .xj.fb {
color: #0D84D1; color: #0D84D1;
} }
/*# sourceMappingURL=goodmanage.css.map */
\ No newline at end of file
{"version":3,"sources":["goodmanage.less"],"names":[],"mappings":"AAAA;EACI,eAA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AAA;;AAGJ,oBAlEhB,WACI,WAGI,WAoDI,aAUK,GACG;EACI,yBAAA;;AAIR,oBAxEhB,WACI,WAGI,WAoDI,aAgBK,GACG;EACI,yBAAA;;AA3P5B,oBAiLI,WACI,WAGI,WAoDI,aAsBI;EACI,cAAA;;AAhQxB,oBAiLI,WACI,WAGI,WA+EI;EACI,UAAA;;AArQpB,oBAiLI,WACI,WAGI,WAoFI;EACI,cAAA;EACA,UAAA;;AAGJ,mBAAqC;EAArC,oBA7FZ,WACI,WAGI,WA4FQ;IACI,UAAA;;EAJR,oBA7FZ,WACI,WAGI,WAgGQ;IACI,UAAA;;EARR,oBA7FZ,WACI,WAGI,WAoGQ;IACI,UAAA;;EAZR,oBA7FZ,WACI,WAGI,WAwGQ;IACI,aAAA;;;AA9RxB,oBAiLI,WACI,WAGI,WA6GI;EACI,cAAA;EACA,eAAA;;AApSpB,oBAiLI,WACI,WAGI,WAkHI;EACI,cAAA;EACA,eAAA;EACA,iBAAA;;AAEA,oBA3HhB,WACI,WAGI,WAkHI,IAKK;EACG,cAAA","file":"goodmanage.css"}
\ No newline at end of file
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
} }
} }
.layui-form { .layui-form-style {
margin-right: 20px; margin-right: 20px;
.layui-form-select { .layui-form-select {
......
/**
* 登录、注册、找回密码、登录状态、绑定第三方账户(非必须登录)
* auth => 'authapi.icsales.com'
*
* 询价中心、后台首页(部分接口)、抢单专区、后台搜索、前台搜索(非必须登录)
* so => 'soapi.icsales.com'
*
* 登录会员信息、会员认证(包含但不限于新增认证、认证列表)、积分、账户设置、站内消息通知(必须登录)
* user => 'userapi.icsales.com'
*
* 必须登录:我的商品列表、编辑、新增、删除、下架、上架、批量上传、商品数量统计、批量上传任务状态(非必须登录:商详)
* goods => 'goodsapi.icsales.com'
*
* 我的询价列表、询价下架and上架、询价详情、询价数量统计、发布询价 报价列表、报价详情(询报价相关)、报价数量统计、发布报价(必须登录)
* inquiry => 'inquiryapi.icsales.com
*/
(function (window) {
apis = {
/**
* 商品列表
*/
goodsInfo: goods + '/goods/info',
/**
* 商品搜索
*/
goodsSearch: goods + '/goods/search',
/**
* 商品数量
*/
goodsCount: goods + '/goods/count',
/**
* 商品新增
*/
goodsAdd: goods + '/goods/add',
/**
* 商品修改
*/
goodsSave: goods + '/goods/save'
};
if (typeof define === "function" && define.amd) {
return apis;
} else {
window.apis = apis;
}
})(window);
; ;!function () {
! function () {
window.IcController = { window.IcController = {
init: function () { init: function () {
this.mounted(this).handleBind(this); this.mounted(this).handleBind(this);
}, },
getData: function (url, type, param, callback, loading) { getData: function (url, type, param, callback) {
var index; var index = layer.load(1,{
offset: ['50%', "50%"], shade: false
if (loading == false) { })
index = null;
} else {
index = layer.load(1);
}
var platform = { var platform = {
pf: 20 pf: 20,
token: '1298dc6f00a017d9e94fc1e57792625d'
} }
var params = $.extend({}, platform, param); var params = $.extend({}, platform, param);
//跨域模式切换 兼容
var dataTypeXpx = "json";
if ((navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)) {
dataTypeXpx = "jsonp";
}
var cookieHostname = window.location.hostname.split(".")[1] + "." + window.location.hostname.split(".")[2];
$.ajax({ $.ajax({
type: type, type: type,
url: url, url: url,
...@@ -54,6 +57,7 @@ ...@@ -54,6 +57,7 @@
}) })
}(); }();
//工具类
(function (window) { (function (window) {
Util = { Util = {
/** /**
...@@ -124,7 +128,7 @@ ...@@ -124,7 +128,7 @@
* @param val * @param val
* @returns {string} * @returns {string}
*/ */
getDateStr(val) { getDateStr:function (val) {
var dd = new Date(); var dd = new Date();
dd.setDate(dd.getDate() + val); dd.setDate(dd.getDate() + val);
var y = dd.getFullYear(); var y = dd.getFullYear();
...@@ -139,10 +143,12 @@ ...@@ -139,10 +143,12 @@
window.Util = Util; window.Util = Util;
} }
})(window); })(window);
//api列表 //api列表
(function (window) { (function (window) {
Api = { Api = {
login:"sy" login: "sy"
}; };
if (typeof define === "function" && define.amd) { if (typeof define === "function" && define.amd) {
return Api; return Api;
...@@ -151,12 +157,6 @@ ...@@ -151,12 +157,6 @@
} }
})(window); })(window);
//跨域模式切换 兼容
// var dataTypeXpx = "json";
// if ((navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)) {
// dataTypeXpx = "jsonp";
// }
// var cookieHostname = window.location.hostname.split(".")[1] + "." + window.location.hostname.split(".")[2];
//form序列化json //form序列化json
$.fn.serializeJson = function () { $.fn.serializeJson = function () {
......
!function () {
window.GoodManage = {
init: function () {
this.created(this).mounted(this).listData(this, {offset: 10, p: 1}, 1).handleBind(this);
},
created: function (opt) {
//日期控件初始化
layui.laydate.render({
elem: '#start_time',
theme: '#0D84D1'
});
layui.laydate.render({
elem: '#end_time',
theme: '#0D84D1'
});
return this;
},
mounted: function (opt) {
//商品数量获取
IcController.getData(apis.goodsCount, 'POST', null, function (res) {
var getTpl = countHtml.innerHTML;
layui.laytpl(getTpl).render(res.count, function (html) {
$(".good_total").empty().html(html);
});
});
return this;
},
listData: function (opt, params, curr) {
//商品列表初始化
IcController.getData(apis.goodsInfo, 'POST', params, function (res) {
var getTpl = listHtml.innerHTML;
if (res.errcode == 0) {
layui.laytpl(getTpl).render(res.goods_list, function (html) {
$("#listData").empty().html(html);
layui.laypage.render({
elem: 'pagination',
theme: '#1080d0',
count: res.total,
limit: 10,
curr: curr,
jump: function (obj, first) {
if (!first) {
//分页回调调用
var json = {
p: obj.curr
}
var param = $.extend({}, params, json);
opt.mounted(opt, param, obj.curr);
}
}
});
});
} else if (res.errcode == 110001) {
layui.laytpl(getTpl).render([], function (html) {
$("#listData").empty().html(html);
});
}
});
return this;
},
handleBind: function (opt) {
//搜索
layui.form.on('submit(search)', function (data) {
IcController.getData(apis.goodsSearch, 'POST', data.field, function (res) {
});
});
return this;
},
}, $(function () {
GoodManage.init();
})
}();
\ No newline at end of file
!function () {
window.UploadSingle = {
isClick: false,
init: function () {
this.created(this).mounted(this).handleBind(this);
},
created: function (opt) {
return this;
},
mounted: function (opt, params, curr) {
return this;
},
handleBind: function (opt) {
//货期选择
layui.form.on('radio(delivery)', function (data) {
var val = 1;
if (data.value == '期货') {
val = 1
} else if (data.value == '现货') {
val = 2;
}
var getTpl = deliveryHtml.innerHTML;
layui.laytpl(getTpl).render(val, function (html) {
$("#day").empty().html(html);
});
});
//天数同步数据
$(document).on('input propertychange', 'input[name="day"]', function () {
var val = $(this).val();
$("#daytext").val(val + '天');
});
//上传商品
layui.form.on('submit(add)', function (data) {
$(data.elem).addClass("layui-btn-disabled");
if (!opt.isClick) {
opt.isClick = true;
IcController.getData(apis.goodsAdd, 'POST', data.field, function (res) {
if (res.errcode == 0) {
layer.msg('上传商品成功', {time: 2000}, function () {
window.location.href = '/goodmanage';
});
} else {
layer.msg(res.errmsg);
opt.isClick = false;
}
});
}
});
return this;
},
}, $(function () {
UploadSingle.init();
})
}();
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment