Init Repo

This commit is contained in:
root
2019-09-06 23:53:10 +08:00
commit f0ef89dfbb
7905 changed files with 914138 additions and 0 deletions

142
addons/kuaidi/Kuaidi.php Executable file
View File

@ -0,0 +1,142 @@
<?php
namespace addons\kuaidi; // 注意命名空间规范
use think\addons\Addons;
use addons\kuaidi\model\Kuaidi as DM;
/**
* 快递100
* @author HSF
*/
class Kuaidi extends Addons{
// 该插件的基础信息
public $info = [
'name' => 'Kuaidi', // 插件标识
'title' => '快递100', // 插件名称
'description' => '为您更好的跟踪您的订单动态', // 插件简介
'status' => 0, // 状态
'author' => 'HSF',
'version' => '1.0.1'
];
/**
* 插件安装方法
* @return bool
*/
public function install(){
$m = new DM();
$flag = $m->install();
WSTClearHookCache();
cache('hooks',null);
return $flag;
}
/**
* 插件卸载方法
* @return bool
*/
public function uninstall(){
$m = new DM();
$flag = $m->uninstall();
WSTClearHookCache();
cache('hooks',null);
return $flag;
}
/**
* 插件启用方法
* @return bool
*/
public function enable(){
WSTClearHookCache();
cache('hooks',null);
return true;
}
/**
* 插件禁用方法
* @return bool
*/
public function disable(){
WSTClearHookCache();
cache('hooks',null);
return true;
}
/**
* 插件设置方法
* @return bool
*/
public function saveConfig(){
$m = new DM();
WSTClearHookCache();
cache('hooks',null);
return true;
}
/**
* 跳转订单详情【admin】
*/
public function adminDocumentOrderView($params){
$m = new DM();
$rs = $m->getOrderDeliver($params['orderId']);
if($rs["deliverType"]==0 && $rs["orderStatus"]>0){
$express = $m->getExpress($params['orderId']);
if($express["expressNo"]!=""){
$rs = $m->getOrderExpress($params['orderId']);
$expressLogs = json_decode($rs, true);
$this->assign('expressLogs', $expressLogs);
return $this->fetch('view/admin/view');
}
}
}
/**
* 跳转订单详情【home】
*/
public function homeDocumentOrderView($params){
$m = new DM();
$rs = $m->getOrderDeliver($params['orderId']);
if($rs["deliverType"]==0 && $rs["orderStatus"]>0){//货到付款的并且是未付款以上状态
$express = $m->getExpress($params['orderId']);//获取订单号及物流信息
if($express["expressNo"]!=""){
$rs = $m->getOrderExpress($params['orderId']);//返回订单信息
$expressLogs = json_decode($rs, true);//将json转换为数组
$this->assign('expressLogs', $expressLogs);
return $this->fetch('view/home/view');
}
}
}
public function afterQueryUserOrders($params){
$m = new DM();
foreach ($params["page"]["Rows"] as $key => $v){
$rs = $m->getOrderDeliver($v['orderId']);
if($rs["deliverType"]==0 && $rs["orderStatus"]>0 && $rs["expressNo"]!=""){
$bnt = '<button class="ui-btn o-btn o-cancel-btn" onclick="checkExpress('.$v['orderId'].')">查看物流</button>';
$params["page"]["Rows"][$key]['hook'] = ($v['orderStatus']==1 || $v['orderStatus']==2)?$bnt:"";
}else{
$params["page"]["Rows"][$key]['hook'] = "";
}
}
}
/**
* 订单列表【mobile】
*/
public function mobileDocumentOrderList(){
return $this->fetch('view/mobile/view');
}
/**
* 订单列表【wechat】
*/
public function wechatDocumentOrderList(){
return $this->fetch('view/wechat/view');
}
}

15
addons/kuaidi/config.php Executable file
View File

@ -0,0 +1,15 @@
<?php
return array(
'kd_tips1'=>array(
'title'=>'快递代码是用于物流查询,可点击<a href="https://www.kuaidi100.com/download/api_kuaidi100_com(20140729).doc" target="_blank" style="font-weight:bold;">这里</a>查看,到“首页->基础设置->快递管理”中进行设置',
'type'=>'hidden',
'value'=>''
),
'kuaidiKey'=>array(
'title'=>'快递100授权密匙(Key)&nbsp;&nbsp;&nbsp;&nbsp;<span ><a target="_blank" href="https://www.kuaidi100.com/openapi/applyapi.shtml" style="color:blue">在线申请密匙(Key)</a></span>',
'type'=>'text',
'value'=>'',
'tips'=>''
)
);

View File

@ -0,0 +1,60 @@
<?php
namespace addons\kuaidi\controller;
use think\addons\Controller;
use addons\kuaidi\model\Kuaidi as M;
/**
* ============================================================================
* 快递查询控制器
*/
class Kuaidi extends Controller{
public function __construct(){
parent::__construct();
$this->assign("v",WSTConf('CONF.wstVersion')."_".WSTConf('CONF.wsthomeStyleId'));
}
/**
* 跳转订单详情【mobile】
*/
public function checkMobileExpress(){
$m = new M();
$rs = $m->getOrderExpress(input("orderId"));
$express = json_decode($rs, true);
$state = isset($express["state"])?$express["state"]:'-1';
$data = $m->getOrderInfo();
$data["express"]["stateTxt"] = $this->getExpressState($state);
$express["express"] = $data["express"];
$express["goodlist"] = $data["goodlist"];
return $express;
}
/**
* 跳转订单详情【wechat】
*/
public function checkWechatExpress(){
$m = new M();
$rs = $m->getOrderExpress(input("orderId"));
$express = json_decode($rs, true);
$state = isset($express["state"])?$express["state"]:'-1';
$data = $m->getOrderInfo();
$data["express"]["stateTxt"] = $this->getExpressState($state);
$express["express"] = $data["express"];
$express["goodlist"] = $data["goodlist"];
return $express;
}
public function getExpressState($state){
$stateTxt = "";
switch ($state) {
case '0':$stateTxt="运输中";break;
case '1':$stateTxt="揽件";break;
case '2':$stateTxt="疑难";break;
case '3':$stateTxt="收件人已签收";break;
case '4':$stateTxt="已退签";break;
case '5':$stateTxt="派件中";break;
case '6':$stateTxt="退回";break;
default:$stateTxt="暂未获取到状态";break;
}
return $stateTxt;
}
}

0
addons/kuaidi/install.sql Executable file
View File

148
addons/kuaidi/model/Kuaidi.php Executable file
View File

@ -0,0 +1,148 @@
<?php
namespace addons\kuaidi\model;
use think\addons\BaseModel as Base;
use think\Db;
/**
* ============================================================================
* 快递查询业务处理
*/
class Kuaidi extends Base{
/**
* 绑定勾子
*/
public function install(){
Db::startTrans();
try{
$hooks = array("adminDocumentOrderView","homeDocumentOrderView","afterQueryUserOrders","mobileDocumentOrderList","wechatDocumentOrderList");
$this->bindHoods("Kuaidi", $hooks);
Db::commit();
return true;
}catch (\Exception $e) {
Db::rollback();
return false;
}
}
/**
* 解绑勾子
*/
public function uninstall(){
Db::startTrans();
try{
$hooks = array("adminDocumentOrderView","homeDocumentOrderView","afterQueryUserOrders","mobileDocumentOrderList","wechatDocumentOrderList");
$this->unbindHoods("Kuaidi", $hooks);
Db::commit();
return true;
}catch (\Exception $e) {
Db::rollback();
return false;
}
}
public function getExpress($orderId){
$conf = $this->getConf("Kuaidi");
$express = Db::name('orders')->where(["orderId"=>$orderId])->field(['expressId','expressNo'])->find();
return $express;
}
public function getOrderExpress($orderId){
$conf = $this->getConf("Kuaidi");
$express = Db::name('orders')->where(["orderId"=>$orderId])->field(['expressId','expressNo'])->find();
if($express["expressId"]>0){
$expressId = $express["expressId"];
$row = Db::name('express')->where(["expressId"=>$expressId])->find();
$typeCom = strtolower($row["expressCode"]); //快递公司
$typeNu = $express["expressNo"]; //快递单号
$appKey= $conf["kuaidiKey"];
$expressLogs = null;
$post_data['param'] = json_encode(['com'=>$typeCom,'num'=>$typeNu]);
$key ='jMIRnHZa5264';
$post_data['customer'] ='466DC9B2C8C2CA140FFB2E6FAFE705DF';
$post_data['sign']= strtoupper(md5($post_data['param'].$key.$post_data['customer']));
$expressLogs = $this->curl_request('http://poll.kuaidi100.com/poll/query.do',$post_data);
//$url ='http://api.kuaidi100.com/api?id='.$appKey.'&com='.$typeCom.'&nu='.$typeNu.'&show=0&muti=1&order=asc';
//$companys = array('ems','shentong','yuantong','shunfeng','yunda','tiantian','zhongtong','zengyisudi');
// if(in_array($typeCom,$companys)){
// $url = 'http://www.kuaidi100.com/query?type=' . $typeCom . '&postid=' . $typeNu;
// }else{
// $url ='http://api.kuaidi100.com/api?id='.$appKey.'&com='.$typeCom.'&nu='.$typeNu.'&show=0&muti=1&order=asc';
// }
//$expressLogs = $this -> curl($url);
return $expressLogs;
}
}
//参数1访问的URL参数2post数据(不填则为GET)参数3提交的$cookies,参数4是否返回$cookies
function curl_request($url,$post='',$cookie='', $returnCookie=0){
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)');
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_AUTOREFERER, 1);
curl_setopt($curl, CURLOPT_REFERER, "http://XXX");
if($post) {
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
}
if($cookie) {
curl_setopt($curl, CURLOPT_COOKIE, $cookie);
}
curl_setopt($curl, CURLOPT_HEADER, $returnCookie);
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($curl);
if (curl_errno($curl)) {
return curl_error($curl);
}
curl_close($curl);
if($returnCookie){
list($header, $body) = explode("\r\n\r\n", $data, 2);
preg_match_all("/Set\-Cookie:([^;]*);/", $header, $matches);
$info['cookie'] = substr($matches[1][0], 1);
$info['content'] = $body;
return $info;
}else{
return $data;
}
}
public function getOrderInfo($orderId = 0){//添加可传订单号方法 mark hsf 20171130
$data = array();
if(!$orderId){
$orderId = input("orderId");
}
$data["express"] = Db::name('orders o')->join('__EXPRESS__ e', 'o.expressId=e.expressId')->where(["orderId"=>$orderId])->field(['e.expressId','e.expressImg','o.expressNo','e.expressName'])->find();
$data["express"]['expressImg'] = WSTImg($data["express"]['expressImg'],3);
$data["goodsImg"] = Db::name('orders o')->join('__ORDER_GOODS__ og','o.orderId=og.orderId')->where(["o.orderId"=>$orderId])->value('og.goodsImg');//这个只返回一个数据
return $data;
}
public function curl($url) {
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, $url);
curl_setopt ($curl, CURLOPT_HEADER,0);
curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($curl, CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
curl_setopt ($curl, CURLOPT_TIMEOUT,5);
$content = curl_exec($curl);
curl_close ($curl);
return $content;
}
public function getOrderDeliver($orderId){
$rs = Db::name('orders o')->where(["orderId"=>$orderId])->field("deliverType,orderStatus,expressNo")->find();
return $rs;
}
}

0
addons/kuaidi/uninstall.sql Executable file
View File

View File

@ -0,0 +1,2 @@
#wst-express td,#wst-express th{text-align: left;}
#wst-express .title{font-weight: bold;}

View File

@ -0,0 +1,27 @@
<link href="__ROOT__/addons/kuaidi/view/admin/express.css" rel="stylesheet">
<div class='order-box'>
<div class='box-head'>物流信息</div>
<table class='wst-form' id="wst-express">
<tr>
<th width='200' class="title">时间</th>
<th class="title">地点和跟踪进度</th>
</tr>
<?php if(isset($expressLogs['data'])){ ?>
{volist name="expressLogs['data']" id="vo"}
<tr>
<th width='200'>{$vo['time']} {:WSTgetWeek($vo['time'])}</th>
<td>{$vo['context']}</td>
</tr>
{/volist}
{empty name="$expressLogs['data']"}
<tr>
<th colspan="2">物流单暂无结果!</th>
</tr>
{/empty}
<?php }else{ ?>
<tr>
<th colspan="2">物流单暂无结果!</th>
</tr>
<?php } ?>
</table>
</div>

View File

@ -0,0 +1,2 @@
#wst-express td,#wst-express th{text-align: left;}
#wst-express .title{font-weight: bold;}

View File

@ -0,0 +1,27 @@
<link href="__ROOT__/addons/kuaidi/view/home/express.css" rel="stylesheet">
<div class='order-box'>
<div class='box-head'>物流信息</div>
<table class='wst-form' id="wst-express">
<tr>
<th width='200' class="title">时间</th>
<th class="title">地点和跟踪进度</th>
</tr>
<?php if(isset($expressLogs['data'])){ ?>
{volist name="expressLogs['data']" id="vo"}
<tr>
<th width='200'>{$vo['time']} {:WSTgetWeek($vo['time'])}</th>
<td>{$vo['context']}</td>
</tr>
{/volist}
{empty name="$expressLogs['data']"}
<tr>
<th colspan="2">物流单暂无结果!</th>
</tr>
{/empty}
<?php }else{ ?>
<tr>
<th colspan="2">物流单暂无结果!</th>
</tr>
<?php } ?>
</table>
</div>

View File

@ -0,0 +1,265 @@
html * {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
*, *:after, *:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.cd-container {
width: 90%;
max-width: 1170px;
margin: 0 auto;
}
.cd-container::after {
content: '';
display: table;
clear: both;
}
#cd-timeline {
position: relative;
margin-top: 2em;
margin-bottom: 2em;
}
#cd-timeline::before {
content: '';
position: absolute;
top: 0;
left: 18px;
height: 100%;
width: 4px;
background: #d7e4ed;
}
@media only screen and (min-width: 1170px) {
#cd-timeline {
margin-top: 3em;
margin-bottom: 3em;
}
#cd-timeline::before {
left: 50%;
margin-left: -2px;
}
}
.cd-timeline-block {
position: relative;
margin: 1em 0;
}
.cd-timeline-block:after {
content: "";
display: table;
clear: both;
}
.cd-timeline-block:first-child {
margin-top: 0;
}
.cd-timeline-block:last-child {
margin-bottom: 0;
}
@media only screen and (min-width: 1170px) {
.cd-timeline-block {
margin: 4em 0;
}
.cd-timeline-block:first-child {
margin-top: 0;
}
.cd-timeline-block:last-child {
margin-bottom: 0;
}
}
.cd-timeline-img {
position: absolute;
top: 2px;
left: 10px;
width: 20px;
height: 20px;
border-radius: 50%;
box-shadow: 0 0 0 4px white, inset 0 2px 0 rgba(0, 0, 0, 0.08), 0 3px 0 4px rgba(0, 0, 0, 0.05);
}
.cd-timeline-img img {
display: block;
width: 24px;
height: 24px;
position: relative;
left: 50%;
top: 50%;
margin-left: -12px;
margin-top: -12px;
}
.curr-picture {
color: #75ce66;
position: absolute;
left: -2px;
top: -2px;
}
.cd-timeline-img.cd-movie {
background: #c03b44;
}
.cd-timeline-img.cd-location {
background: #f0ca45;
}
@media only screen and (min-width: 1170px) {
.cd-timeline-img {
width: 60px;
height: 60px;
left: 50%;
margin-left: -30px;
-webkit-transform: translateZ(0);
-webkit-backface-visibility: hidden;
}
.cssanimations .cd-timeline-img.is-hidden {
visibility: hidden;
}
.cssanimations .cd-timeline-img.bounce-in {
visibility: visible;
-webkit-animation: cd-bounce-1 0.6s;
-moz-animation: cd-bounce-1 0.6s;
animation: cd-bounce-1 0.6s;
}
}
.cd-timeline-content {
position: relative;
margin-left: 50px;
background: white;
border-radius: 0.25em;
padding: 1em;
box-shadow: 0 2px 0 #e0e4e3;
}
.cd-timeline-content:after {
content: "";
display: table;
clear: both;
}
.cd-timeline-content h2 {
color: #303e49;
}
.cd-timeline-content .cd-read-more, .cd-timeline-content .cd-date {
display: inline-block;
}
.cd-timeline-content .cd-read-more {
float: right;
padding: .8em 1em;
background: #acb7c0;
color: white;
border-radius: 0.25em;
}
.no-touch .cd-timeline-content .cd-read-more:hover {
background-color: #bac4cb;
}
a.cd-read-more:hover{text-decoration:none; background-color: #424242; }
.cd-timeline-content .cd-date {
float: left;
padding: .8em 0;
opacity: .7;
}
.cd-timeline-content::before {
content: '';
position: absolute;
top: 16px;
right: 100%;
height: 0;
width: 0;
border: 7px solid transparent;
border-right: 7px solid white;
}
@media only screen and (min-width: 768px) {
.cd-timeline-content h2 {
font-size: 20px;
font-size: 1.25rem;
}
.cd-timeline-content .cd-read-more, .cd-timeline-content .cd-date {
font-size: 14px;
font-size: 0.875rem;
}
}
@media only screen and (min-width: 1170px) {
.cd-timeline-content {
margin-left: 0;
padding: 1.6em;
width: 45%;
}
.cd-timeline-content::before {
top: 24px;
left: 100%;
border-color: transparent;
border-left-color: white;
}
.cd-timeline-content .cd-read-more {
float: left;
}
.cd-timeline-content .cd-date {
position: absolute;
width: 100%;
left: 122%;
top: 6px;
font-size: 16px;
font-size: 1rem;
}
.cd-timeline-block:nth-child(even) .cd-timeline-content {
float: right;
}
.cd-timeline-block:nth-child(even) .cd-timeline-content::before {
top: 24px;
left: auto;
right: 100%;
border-color: transparent;
border-right-color: white;
}
.cd-timeline-block:nth-child(even) .cd-timeline-content .cd-read-more {
float: right;
}
.cd-timeline-block:nth-child(even) .cd-timeline-content .cd-date {
left: auto;
right: 122%;
text-align: right;
}
.cssanimations .cd-timeline-content.is-hidden {
visibility: hidden;
}
.cssanimations .cd-timeline-content.bounce-in {
visibility: visible;
-webkit-animation: cd-bounce-2 0.6s;
-moz-animation: cd-bounce-2 0.6s;
animation: cd-bounce-2 0.6s;
}
}
@media only screen and (min-width: 1170px) {
.cssanimations .cd-timeline-block:nth-child(even) .cd-timeline-content.bounce-in {
-webkit-animation: cd-bounce-2-inverse 0.6s;
-moz-animation: cd-bounce-2-inverse 0.6s;
animation: cd-bounce-2-inverse 0.6s;
}
}
.o-Img {
max-width: 60px;
max-height: 60px;
width: 60px;
height: 60px;
margin-top: 5px;
padding-top: 0;
}
.wst-fr-box {
position: fixed;
z-index: 9999;
right: -999px;
bottom: 0px;
width: 100%;
min-height: 40%;
background: #f2f2f2;
font-size: 0.14rem;
}
.d-goodsitme {
background: #fff;
border-bottom: none;
margin-bottom: 5px;
font-size: 0.14rem;
}

View File

@ -0,0 +1,62 @@
<link href="__ROOT__/addons/kuaidi/view/mobile/express.css" rel="stylesheet">
<script type="text/html" id="expressBox">
<div id="expressBox">
<div class="ui-row-flex ui-whitespace border-b d-goodsitme">
<div class="ui-col">
<img src="__ROOT__/{{d.goodlist[0].goodsImg}}" class="o-Img">
</div>
<div class="ui-col ui-col-3 o-gInfo">
<p class="o-gName ui-nowrap-multi">物流状态&nbsp;<span style="font-weight:bold;color:red;">{{ d.express['stateTxt'] }}</span></p>
<p class="o-gName ui-nowrap-multi">运单号{{ (d.express && d.express['expressNo'])?d.express['expressNo']:'--' }}</p>
<p class="o-gName ui-nowrap-multi">信息来源{{ (d.express && d.express['expressName'])?d.express['expressName']:'--' }}</p>
</div>
</div>
{{# if(d.data){ }}
<section id="cd-timeline" class="cd-container">
{{# for(var i=0;i<d.data.length;i++){ }}
<div class="cd-timeline-block">
<div class="cd-timeline-img cd-picture">
{{# if(i==0){ }}
<i class="ui-icon-checked" style=" color: #75ce66;position: absolute;left: -2px;top: -2px;font-size:24px;line-height:25px;"></i>
{{# }else{ }}
<i class="ui-icon-checked" style="color: rgba(0, 0, 0, 0.2);position: absolute;left: -2px;top: -2px;font-size:24px;line-height:25px;"></i>
{{# } }}
</div>
<div class="cd-timeline-content">
<p class="o-gName ui-nowrap-multi">{{ d.data[i].context }}</p>
<p style='color:#d2d2d2'>{{ d.data[i].time }}</p>
</div>
</div>
{{# } }}
{{# }else{ }}
<div class="ui-col ui-col o-gInfo">暂无获取到物流信息</div>
{{# } }}
</section>
</div>
</script>
<script>
function checkExpress(oid){
$.post(WST.U('addon/kuaidi-kuaidi-checkmobileexpress'),{orderId:oid},function(data){
var json = WST.toJson(data);
if(json.status!=-1){
var gettpl1 = document.getElementById('expressBox').innerHTML;
laytpl(gettpl1).render(json, function(html){
$('#content').html(html);
// 弹出层滚动条
var clientH = WST.pageHeight();// 屏幕高度
var boxheadH = $('#boxTitle').height();// 弹出层标题高度
var contentH = $('#content').height(); // 弹出层内容高度
if((clientH-boxheadH) < contentH){
$('#content').css('height',clientH-boxheadH+'px');
}
dataShow();
});
}else{
WST.msg(json.msg,'info');
}
});
}
</script>

View File

@ -0,0 +1,265 @@
html * {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
*, *:after, *:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.cd-container {
width: 90%;
max-width: 1170px;
margin: 0 auto;
}
.cd-container::after {
content: '';
display: table;
clear: both;
}
#cd-timeline {
position: relative;
margin-top: 2em;
margin-bottom: 2em;
}
#cd-timeline::before {
content: '';
position: absolute;
top: 0;
left: 18px;
height: 100%;
width: 4px;
background: #d7e4ed;
}
@media only screen and (min-width: 1170px) {
#cd-timeline {
margin-top: 3em;
margin-bottom: 3em;
}
#cd-timeline::before {
left: 50%;
margin-left: -2px;
}
}
.cd-timeline-block {
position: relative;
margin: 1em 0;
}
.cd-timeline-block:after {
content: "";
display: table;
clear: both;
}
.cd-timeline-block:first-child {
margin-top: 0;
}
.cd-timeline-block:last-child {
margin-bottom: 0;
}
@media only screen and (min-width: 1170px) {
.cd-timeline-block {
margin: 4em 0;
}
.cd-timeline-block:first-child {
margin-top: 0;
}
.cd-timeline-block:last-child {
margin-bottom: 0;
}
}
.cd-timeline-img {
position: absolute;
top: 2px;
left: 10px;
width: 20px;
height: 20px;
border-radius: 50%;
box-shadow: 0 0 0 4px white, inset 0 2px 0 rgba(0, 0, 0, 0.08), 0 3px 0 4px rgba(0, 0, 0, 0.05);
}
.cd-timeline-img img {
display: block;
width: 24px;
height: 24px;
position: relative;
left: 50%;
top: 50%;
margin-left: -12px;
margin-top: -12px;
}
.curr-picture {
color: #75ce66;
position: absolute;
left: -2px;
top: -2px;
}
.cd-timeline-img.cd-movie {
background: #c03b44;
}
.cd-timeline-img.cd-location {
background: #f0ca45;
}
@media only screen and (min-width: 1170px) {
.cd-timeline-img {
width: 60px;
height: 60px;
left: 50%;
margin-left: -30px;
-webkit-transform: translateZ(0);
-webkit-backface-visibility: hidden;
}
.cssanimations .cd-timeline-img.is-hidden {
visibility: hidden;
}
.cssanimations .cd-timeline-img.bounce-in {
visibility: visible;
-webkit-animation: cd-bounce-1 0.6s;
-moz-animation: cd-bounce-1 0.6s;
animation: cd-bounce-1 0.6s;
}
}
.cd-timeline-content {
position: relative;
margin-left: 50px;
background: white;
border-radius: 0.25em;
padding: 1em;
box-shadow: 0 2px 0 #e0e4e3;
}
.cd-timeline-content:after {
content: "";
display: table;
clear: both;
}
.cd-timeline-content h2 {
color: #303e49;
}
.cd-timeline-content .cd-read-more, .cd-timeline-content .cd-date {
display: inline-block;
}
.cd-timeline-content .cd-read-more {
float: right;
padding: .8em 1em;
background: #acb7c0;
color: white;
border-radius: 0.25em;
}
.no-touch .cd-timeline-content .cd-read-more:hover {
background-color: #bac4cb;
}
a.cd-read-more:hover{text-decoration:none; background-color: #424242; }
.cd-timeline-content .cd-date {
float: left;
padding: .8em 0;
opacity: .7;
}
.cd-timeline-content::before {
content: '';
position: absolute;
top: 16px;
right: 100%;
height: 0;
width: 0;
border: 7px solid transparent;
border-right: 7px solid white;
}
@media only screen and (min-width: 768px) {
.cd-timeline-content h2 {
font-size: 20px;
font-size: 1.25rem;
}
.cd-timeline-content .cd-read-more, .cd-timeline-content .cd-date {
font-size: 14px;
font-size: 0.875rem;
}
}
@media only screen and (min-width: 1170px) {
.cd-timeline-content {
margin-left: 0;
padding: 1.6em;
width: 45%;
}
.cd-timeline-content::before {
top: 24px;
left: 100%;
border-color: transparent;
border-left-color: white;
}
.cd-timeline-content .cd-read-more {
float: left;
}
.cd-timeline-content .cd-date {
position: absolute;
width: 100%;
left: 122%;
top: 6px;
font-size: 16px;
font-size: 1rem;
}
.cd-timeline-block:nth-child(even) .cd-timeline-content {
float: right;
}
.cd-timeline-block:nth-child(even) .cd-timeline-content::before {
top: 24px;
left: auto;
right: 100%;
border-color: transparent;
border-right-color: white;
}
.cd-timeline-block:nth-child(even) .cd-timeline-content .cd-read-more {
float: right;
}
.cd-timeline-block:nth-child(even) .cd-timeline-content .cd-date {
left: auto;
right: 122%;
text-align: right;
}
.cssanimations .cd-timeline-content.is-hidden {
visibility: hidden;
}
.cssanimations .cd-timeline-content.bounce-in {
visibility: visible;
-webkit-animation: cd-bounce-2 0.6s;
-moz-animation: cd-bounce-2 0.6s;
animation: cd-bounce-2 0.6s;
}
}
@media only screen and (min-width: 1170px) {
.cssanimations .cd-timeline-block:nth-child(even) .cd-timeline-content.bounce-in {
-webkit-animation: cd-bounce-2-inverse 0.6s;
-moz-animation: cd-bounce-2-inverse 0.6s;
animation: cd-bounce-2-inverse 0.6s;
}
}
.o-Img {
max-width: 60px;
max-height: 60px;
width: 60px;
height: 60px;
margin-top: 5px;
padding-top: 0;
}
.wst-fr-box {
position: fixed;
z-index: 9999;
right: -999px;
bottom: 0px;
width: 100%;
min-height: 40%;
background: #f2f2f2;
font-size: 0.14rem;
}
.d-goodsitme {
background: #fff;
border-bottom: none;
margin-bottom: 5px;
font-size: 0.14rem;
}

View File

@ -0,0 +1,62 @@
<link href="__ROOT__/addons/kuaidi/view/wechat/express.css" rel="stylesheet">
<script type="text/html" id="expressBox">
<div id="expressBox">
<div class="ui-row-flex ui-whitespace border-b d-goodsitme">
<div class="ui-col">
<img src="__ROOT__/{{d.goodlist[0].goodsImg}}" class="o-Img">
</div>
<div class="ui-col ui-col-3 o-gInfo">
<p class="o-gName ui-nowrap-multi">物流状态&nbsp;<span style="font-weight:bold;color:red;">{{ d.express['stateTxt'] }}</span></p>
<p class="o-gName ui-nowrap-multi">运单号{{ (d.express && d.express['expressNo'])?d.express['expressNo']:'--' }}</p>
<p class="o-gName ui-nowrap-multi">信息来源{{ (d.express && d.express['expressName'])?d.express['expressName']:'--' }}</p>
</div>
</div>
{{# if(d.data){ }}
<section id="cd-timeline" class="cd-container">
{{# for(var i=0;i<d.data.length;i++){ }}
<div class="cd-timeline-block">
<div class="cd-timeline-img cd-picture">
{{# if(i==0){ }}
<i class="ui-icon-checked" style=" color: #75ce66;position: absolute;left: -2px;top: -2px;font-size:24px;line-height:25px;"></i>
{{# }else{ }}
<i class="ui-icon-checked" style="color: rgba(0, 0, 0, 0.2);position: absolute;left: -2px;top: -2px;font-size:24px;line-height:25px;"></i>
{{# } }}
</div>
<div class="cd-timeline-content">
<p class="o-gName ui-nowrap-multi">{{ d.data[i].context }}</p>
<p style='color:#d2d2d2'>{{ d.data[i].time }}</p>
</div>
</div>
{{# } }}
{{# }else{ }}
<div class="ui-col ui-col o-gInfo">暂无获取到物流信息</div>
{{# } }}
</section>
</div>
</script>
<script>
function checkExpress(oid){
$.post(WST.U('addon/kuaidi-kuaidi-checkwechatexpress'),{orderId:oid},function(data){
var json = WST.toJson(data);
if(json.status!=-1){
var gettpl1 = document.getElementById('expressBox').innerHTML;
laytpl(gettpl1).render(json, function(html){
$('#content').html(html);
// 弹出层滚动条
var clientH = WST.pageHeight();// 屏幕高度
var boxheadH = $('#boxTitle').height();// 弹出层标题高度
var contentH = $('#content').height(); // 弹出层内容高度
if((clientH-boxheadH) < contentH){
$('#content').css('height',clientH-boxheadH+'px');
}
dataShow();
});
}else{
WST.msg(json.msg,'info');
}
});
}
</script>