Commit 55cddd21 by 施宇

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

parents df3c95cb ea59284c
......@@ -411,3 +411,39 @@ function S_cms($key, $field='', $column='', $sort='', $limit='')
return $datas;
}
//随机生成字符串
function createNonceStr($length = 8)
{
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$str = "";
for ($i = 0; $i < $length; $i++) {
$str .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
}
return $str;
}
/**
* 生成签名
* @param $timeStamp 时间戳
* @param $randomStr 随机字符串
* @return string 返回签名
*/
function createSignature($timestamp, $random)
{
$arr['timestamp'] = $timestamp;
$arr['random'] = $random;
$arr['token'] = C('API_TOKEN'); // token
sort($arr, SORT_STRING); // 按照首字母大小写顺序排序
$str = implode($arr); // 拼接成字符串
$signature = sha1($str); // 进行加密
return strtoupper($signature); // 转换成大写
}
......@@ -37,4 +37,5 @@ return array(
'HOME_TEMPLATE_REDIS' => 'home_template_datas',
'H5_HOME_TEMPLATE_REDIS' => 'h5_home_template_datas',
'API_TOKEN' => 'zbPx8gDXDfIh3ZoJcO4EH', // api接口token
);
\ No newline at end of file
......@@ -54,4 +54,24 @@ class BaseController extends Controller
return $data;exit;
}
}
// 校验接口
protected function checkApi($request)
{
$timestamp = I('request.timestamp', '');
$random = I('request.random', '');
$signature = I('request.signature', '');
if (!$timestamp && !$random && !$signature) return false;
if ($timestamp < time() - 300) return false;
$sign = createSignature($timestamp, $random);
if ($signature != $sign) return false;
return true;
}
}
\ No newline at end of file
......@@ -8,6 +8,10 @@ class CmsController extends BaseController
// 获取热门商品
public function getHotGoods()
{
$res = $this->checkApi(); // 接口校验
if ($res === false) return $this->jsonReturn(11001, '接口校验失败');
$datas = $this->apiBaseCache('pc_hot_goods', '', 5); // 热门商品
return $this->jsonReturn(0, '', $datas['data']);
......@@ -27,7 +31,7 @@ class CmsController extends BaseController
'err_msg' => $msg,
'data' => $extend,
);
if(isset($_GET['callback']) && !empty($_GET['callback'])){
echo $_GET['callback'].'('.json_encode($data).')';exit;
}else{
......
......@@ -14,138 +14,192 @@
<div class="right_content inquiry_detail_content">
<div class="content">
<div class="nav_title">
询报价 > 我的询价 > 询价详情 STM32F103ZET6
<span class="fr">2019-05-22 15:35</span>
</div>
<div class="goods_detail clr">
<img src="__PUBLIC__/images/test.jpg" alt="" class="fr">
<div class=" goods_desc boxsiz">
<div class="title">
<h3 class="bold fl">STM32F103ZET6</h3>
<div class="fr">
<span class="mark lineBlock"></span><span class="text">展示中</span>
</div>
</div>
<div class="bj_detail">
</div>
<div class="pagination-with" id="pagination"
style="text-align: right;margin-top: 25px;display:none"></div>
</div>
</div>
</div>
</div>
<include file="public/foot" />
<script src="__PUBLIC__/js/quoteprice/inquirydetail.js"></script>
<script type="text/html" id="navTpl">
<!-- 导航的详情 -->
询报价
>
我的询价
>
询价详情
{{d.goods_name}}
<span class="fr">{{layui.util.toDateString(d.add_time * 1000)}}</span>
</script>
<script type="text/html" id="detailTpl">
<!-- 商品详情 -->
{{# if(d['goods_images']){ }}
<img src="{{d.goods_images}}" alt="" class="fr xj_img">
{{# } else { }}
<img src="__PUBLIC__/images/defaultgood.png" alt="" class="fr xj_img">
{{# } }}
<div class=" goods_desc boxsiz">
<div class="title">
<h3 class="bold fl">{{d.goods_name}}</h3>
<div class="fr">
{{# if(d['audit_status'] == 1){ }}
{{# if(d['status'] == 1){ }}
<span class="mark lineBlock zs"></span><span class="text">展示中</span>
{{# } else { }}
<span class="mark lineBlock xj"></span><span class="text">已下架</span>
{{# } }}
{{# } else { }}
<span class="mark lineBlock jy"></span><span class="text">禁用中</span>
{{# } }}
</div>
</div>
<div class="desc inquiry_desc" style="margin-right:224px">
<div class="brand fl boxsiz ellipsis">
品牌:<span> {{d.brand_name}}</span>
</div>
<div class="fz fl boxsiz ellipsis">
封装:<span> {{d.encap}}</span>
</div>
<div class="price fl boxsiz"> 接受价:
{{# if(!d.price){ }}
<span></span>
{{# } else { }}
<span class="red">
{{# if(d.currency == 1){ }}
{{# } else { }}
$
{{# } }}
{{d.price}}
</span>
{{# } }}
</div>
<div class="num fl boxsiz ellipsis"> 数量:<span class="bold"> {{d.number}} PCS</span></div>
<div class="hq fl boxsiz ellipsis"> 货期:<span>{{d.delivery_time}}</span></div>
<div class="bz fl boxsiz ellipsis"> 备注:<span> {{d.remark||'--'}}</span></div>
</div>
</div>
</script>
<script type="text/html" id="bjTpl">
<div class="bj_title">
<span class="lineBlock"></span>
<b>收到的报价</b>
<b class="bj_num">{{d.length}}</b>
</div>
<div class="bj_lists">
{{# layui.each(d, function(index, item){ }}
<div class="bj_item clr">
<div class="item_right fr boxsiz">
<div class="top">
<!-- <div class="top_right icon iconfont iconjuxing2 fr"></div> -->
<div class="top_left boxsiz ellipsis" style="padding-right:0">
<span class="lineBlock mark">报价</span>
<span class="name bold">{{item.company_name||'--'}}</span>
</div>
</div>
<div class="center">
<div class="center_left boxsiz clr" style="padding-right:0">
{{# if(item.auth_type!==""){ }}
<div class="fl">
<span class="icon iconfont iconjuxing10"></span>
{{# if(item.auth_type==0){ }}
未认证
{{# } }}
{{# if(item.auth_type==1){ }}
个人认证
{{# } }}
{{# if(item.auth_type==2){ }}
企业认证
{{# } }}
</div>
<div class="desc inquiry_desc">
<div class="brand fl boxsiz ellipsis">
品牌:<span>Texas InstrumentsTexas</span>
</div>
<div class="fz fl boxsiz ellipsis">
封装:<span>LQFP-144</span>
</div>
<div class="price fl boxsiz ellipsis "> 接受价:<span></span></div>
<div class="num fl boxsiz ellipsis"> 数量:<span class="bold">100,000 PCS</span></div>
<div class="hq fl boxsiz ellipsis"> 货期:<span>现货</span></div>
<div class="bz fl boxsiz ellipsis"> 备注:<span>有货的商家请尽快联系,谢谢!</span></div>
{{# } }}
{{# if(item.company_type!==""){ }}
<div class="fl">
<span class="icon iconfont iconjuxing10"></span>
{{# if(item.company_type==1){ }}
贸易商
{{# } }}
{{# if(item.company_type==2){ }}
代理商
{{# } }}
{{# if(item.company_type==3){ }}
原厂
{{# } }}
{{# if(item.company_type==4){ }}
制造商
{{# } }}
{{# if(item.company_type==5){ }}
个人用户
{{# } }}
</div>
{{# } }}
</div>
<!-- <div class="center_right ellipsis">
报价:<span class="bold">21</span>
</div> -->
</div>
<div class="bj_detail">
<div class="bj_title">
<span class="lineBlock"></span>
<b>收到的报价</b>
<b class="bj_num">2</b>
<div class="bottom clr">
<div class="gt_div fl btn btn_yellow" imid="{{item.im_username}}" userid="{{item.user_id}}" avatar="{{item.avatar}}">
<span class="icon iconfont iconjuxing7 va-m"></span>
在线沟通
</div>
<div class="bj_lists">
<div class="bj_item clr">
<div class="item_right fr boxsiz">
<div class="top">
<div class="top_right icon iconfont iconjuxing2 fr"></div>
<div class="top_left boxsiz ellipsis">
<span class="lineBlock mark">报价</span>
<span class="name bold">深圳邦马特科技有限公司深圳邦马特科技有限公司</span>
</div>
</div>
<div class="center">
<div class="center_left boxsiz clr">
<div class="fl">
<span class="icon iconfont iconjuxing10"></span>
公司认证
</div>
<div class="fl">
<span class="icon iconfont iconjuxing10"></span>
贸易商
</div>
<div class="fl">
<span class="icon iconfont iconjuxing10"></span>
贸易商
</div>
<div class="fl">
<span class="icon iconfont iconjuxing10"></span>
贸易商
</div>
<div class="fl">
<span class="icon iconfont iconjuxing10"></span>
贸易商
</div>
</div>
<div class="center_right ellipsis">
报价:<span class="bold">21次</span>
</div>
</div>
<div class="bottom clr">
<div class="gt_div fl btn btn_yellow">
<span class="icon iconfont iconjuxing7 va-m"></span>
在线沟通
</div>
<div class="phone_div fl btn btn_border">
<span class="icon iconfont iconjuxing23 va-m"></span>
18271408714
</div>
</div>
<div class="time">
报价时间:<span>2019-05-23 15:57</span>
</div>
</div>
<div class="item_left boxsiz">
<div class="item_left_top">
<h3 class="bold fl ellipsis boxsiz">STM32F103ZET6</h3>
<div class="price fl bold ellipsis boxsiz">¥67.9800</div>
</div>
<div class="desc">
<div class="brand fl boxsiz ellipsis">
品牌:<span>Texas Instruments
</span>
</div>
<div class="fz fl boxsiz ellipsis">
封装:<span>LQFP-144</span>
</div>
<div class="num fl boxsiz ellipsis"> 数量:<span class="bold">100,000 PCS</span>
</div>
<div class="hq fl boxsiz ellipsis"> 货期:<span>现货</span></div>
<div class="bz fl boxsiz ellipsis">
备注:<span>我们有大量的现货,随时都可以出库。我们有大量的现货,随时都可以出库。</span></div>
</div>
</div>
</div>
<!-- <div class="phone_div fl btn btn_border">
<span class="icon iconfont iconjuxing23 va-m"></span>
18271408714
</div> -->
</div>
<div class="time">
报价时间:<span>{{layui.util.toDateString(d.add_time * 1000)}}</span>
</div>
</div>
<div class="item_left boxsiz" style="padding-right:474px;">
<div class="item_left_top">
<h3 class="bold fl ellipsis boxsiz goods_name">{{item.goods_name}}</h3>
<div class="price fl bold ellipsis boxsiz">
{{# if(item.currency == 1){ }}
{{# } else { }}
$
{{# } }}
{{item.price}}
</div>
</div>
<div class="desc">
<div class="brand fl boxsiz ellipsis">
品牌:<span>{{item.brand_name}}
</span>
</div>
<div class="no_data" style="display: none">
<img src="__PUBLIC__/images/nodata.png" alt="">
<p>暂无报价信息</p>
<div class="fz fl boxsiz ellipsis">
封装:<span>{{item.encap}}</span>
</div>
<div class="num fl boxsiz ellipsis"> 数量:<span class="bold">{{item.number}} PCS</span>
</div>
<div class="hq fl boxsiz ellipsis"> 货期:<span>{{item.delivery_time}}</span></div>
<div class="bz fl boxsiz ellipsis">
备注:<span>{{item.remark||'--'}}</span></div>
</div>
</div>
</div>
{{# }); }}
</div>
</div>
<include file="public/foot" />
<script>
$('.gt_div ').on('click', function () {
var obj = {
userId: '18271408717',
type: "STM32F103ZET6",
price: "67.9800",
brand: "Texas Instruments",
fz: "LQFP-144",
num: "100,000",
hq: "现货",
};
Util.setCookie('template', JSON.stringify(obj), 1)
window.location.href = '/chat'
})
{{# if(d.length === 0){ }}
<div class="no_data">
<img src="__PUBLIC__/images/nodata.png" alt="">
<p>暂无报价信息</p>
</div>
{{# } }}
</script>
</body>
......
......@@ -105,7 +105,7 @@
--
{{# } }}
</span>
<div class="fl name ellipsis">{{item.company_name || '--'}}</div>
<div class="fl name ellipsis">{{item.company || ''}}</div>
</div>
</div>
{{# }); }}
......
......@@ -24,7 +24,7 @@
<span class="li_right icon iconfont">
</a>
<dl <if condition="(ACTION_NAME eq 'inquiry') || (ACTION_NAME eq 'releaseinquiry') || (ACTION_NAME eq 'inquirydetail') || (ACTION_NAME eq 'quote') || (ACTION_NAME eq 'quotedetail')">style="display:block"</if>>
<dd <if condition="(ACTION_NAME eq 'inquiry') || (ACTION_NAME eq 'releaseinquiry') || (ACTION_NAME eq 'inquirydetail')">class="active"</if>><a href="/inquiry">我的询价</a></dd>
<dd <if condition="(ACTION_NAME eq 'inquiry') || (ACTION_NAME eq 'releaseinquiry') || (ACTION_NAME eq 'inquirydetail')">class="active"</if>><a href="homeicsales/inquiry">我的询价</a></dd>
<dd <if condition="(ACTION_NAME eq 'quote') || (ACTION_NAME eq 'quotedetail')">class="active"</if>><a href="homeicsales/quote">我的报价</a></dd>
</dl>
</li>
......
......@@ -181,11 +181,7 @@
/**
* 标记会员通知(已读)
*/
userMarkmsg: user_url + '/user/markmsg',
/***
* 热门搜索
*/
hotgoods:home_url+'/hotgoods'
userMarkmsg: user_url + '/user/markmsg'
};
if (typeof define === "function" && define.amd) {
return apis;
......
......@@ -4,19 +4,6 @@ $(function () {
this.bindFun();
this.getXbData(1);
this.getNewXj();
this.getHot();
},
getHot:function(){
IcController.getData(apis.hotgoods, 'GET', {},
function (res) {
if (res.errcode === 0) {
} else{
}
})
},
getXbData: function (type) { //1报价 2询价
var url;
......
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