作者 王晓刚
1 个管道 的构建 通过 耗费 0 秒

合并分支 'wangxiaogang' 到 'master'

我的订单与快递鸟



查看合并请求 !4
... ... @@ -155,7 +155,7 @@ class BirdController extends HomeBaseController
$jsonResult = $this->getOrderTracesByJson($indent['order_number'],$indent['logistic_code']);
$result = json_decode($jsonResult,true);
if($result['Success'] == true){
return dump($result);['code'=>20000,'msg'=>'SUCCESS','data'=>['state'=>$result['State'],'traces'=>$result['Traces']]];//订单轨迹
return ['code'=>20000,'msg'=>'SUCCESS','data'=>['state'=>$result['State'],'traces'=>$result['Traces']]];//订单轨迹
}else{
return ['code'=>40000,'msg'=>$result['Reason']];
}
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/6/7
* Time: 19:11
*/
namespace app\portal\controller;
use app\portal\model\IndentGoodsModel;
use app\portal\model\IndentModel;
use cmf\controller\WeChatBaseController;
class LogisticsController extends WeChatBaseController
{
public function index(){
$indent_id = $this->request->param('indent_id',0,'intval');
if(empty($indent_id)){
$this->error('缺少必要参数','','','');
}
$birdController = new BirdController();
$indentModel = new IndentModel();
$where['id'] = ['eq',$indent_id];
$data = $indentModel->findData($where);
if(empty($data)){
$this->error('查询为空','','','');
}
$result = $birdController->getOrder($indent_id);
if(empty($result)){
$this->error('未知错误','','');
}
if($result['code'] != 20000){
$this->error($result['msg'],'','','');
}
$indent = $indentModel->findData(['id'=>$indent_id])->toArray();
$indentGoodsModel = new IndentGoodsModel();
$indent_goods = $indentGoodsModel->selectData(['indent_id'=>$indent_id]);
$indent['indent_goods'] = $indent_goods;
$this->assign('data',$result['data']);
$this->assign('indent',$indent);
return $this->fetch();
}
}
\ No newline at end of file
... ...
... ... @@ -85,6 +85,6 @@ class OrderController extends WeChatBaseController
if(empty($result)){
$this->error('sql执行失败','','','');
}
$this->redirect('order/get_all');
$this->success('SUCCESS');
}
}
\ No newline at end of file
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>学考无忧-物流信息</title>
<link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css">
<link rel="stylesheet" href="__TMPL__/public/assets/css/base.css">
</head>
<body>
<!-- 顶部 -->
<div class="order_top">
<img src="__TMPL__/public/assets/images/left.png" alt="">
<p>我的订单</p>
</div>
<div class="logistics_box">
<!-- 商品信息 -->
<div class="log_detail">
<div class="log_detailImg">
<img src="{:cmf_get_image_url($indent.indent_goods.0.thumbnail)}" alt="">
</div>
<div class="log_detailTxt">
<h1 class="one-txt-cut">{$indent.indent_goods.0.book_name}</h1>
<p>运单号:{$indent.order_number}</p>
<p>信息来源:顺丰快递</p>
</div>
</div>
<!-- 物流信息 -->
<div class="logistics_process">
<empty name="$data.traces">
暂无物流信息
</empty>
<div class="logistics_left">
<foreach name="$data.traces" item="vo">
<div class="log_Li">
<div class="log_LiTime">
<p class="log_LiTime1">{:date('Y-m-d',strtotime($vo['AcceptTime']))}</p>
<p class="log_LiTime2">{:date('H:i:s',strtotime($vo['AcceptTime']))}</p>
</div>
<div class="log_Box">
<div class="log_Liround"></div>
<div class="log_line"></div>
</div>
</div>
</foreach>
</div>
<div class="logistics_right">
<foreach name="$data.traces" item="vo">
<div class="log_rightTxt">
<p class="log_rightTxt1">{$vo.AcceptStation}</p>
</div>
</foreach>
</div>
</div>
</div>
<script src="__TMPL__/public/assets/js/base.js"></script>
<script src="__TMPL__/public/assets/js/jquery.js"></script>
<script>
var circle = $(".log_Li");
// console.log(circle);
var list = $(".log_rightTxt");
// console.log(list)
for (var i = 0; i < circle.length; i++) {
for (var j = 0; j < list.length; j++) {
if (i == j && i == 0 && j == 0) {
var h = $(list[j]).css("height");
console.log(h)
h = h.split("p");
h = parseInt(h[0]);
h = h + 20;
console.log(h);
console.log(h);
$(circle[i]).css("height", h + "px");
$(circle[i]).find(".log_line").css("height", h + "px");
} else if (i == j != 0) {
var h = $(list[j]).css("height");
// console.log(h)
h = h.split("p");
console.log(h[0]);
h = parseInt(h[0]);
h = h + 20;
console.log(h);
$(circle[i]).css("height", h + "px");
$(circle[i]).find(".log_line").css("height", h + "px");
}
}
}
</script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -2,19 +2,19 @@
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/>
<meta http-equiv="X-UA-Compatible" content="ie=edge"/>
<title>学考无忧-我的订单</title>
<link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css" />
<link rel="stylesheet" href="__TMPL__/public/assets/css/base.css" />
<link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css"/>
<link rel="stylesheet" href="__TMPL__/public/assets/css/base.css"/>
</head>
<body>
<div class="myorder_box">
<div class="myorder_box">
<!-- 顶部 -->
<div class="order_top">
<img src="__TMPL__/public/assets/images/left.png" alt="" />
<img src="__TMPL__/public/assets/images/left.png" alt=""/>
<p>我的订单</p>
</div>
<!-- 头部 -->
... ... @@ -32,9 +32,9 @@
<!-- 全部 -->
<div class="myorder_con1" style="display: block">
<foreach name="data" item="vo">
<a href="{:url('order/get_one',array('id'=>$vo['id']))}">
<div class="myorder_information">
<div class="myorder_information dom_cancel_order_{$vo.id}" >
<!-- 订单 -->
<a href="{:url('order/get_one',array('id'=>$vo['id']))}">
<div class="myorder_the">
<p class="order_dan">订单号:{$vo.order_number}</p>
<div class="myorder_state1">
... ... @@ -53,7 +53,7 @@
<foreach name="$vo.indent_goods" item="i_g">
<li>
<div class="order_newsImg">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" />
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
</div>
<div class="order_newsCon">
<div class="order_newsTxt1 txt-cut">
... ... @@ -72,24 +72,27 @@
<p>¥{$vo.money}</p>
</div>
</ul>
</a>
<!-- 时间/底部 -->
<div class="myorder_bottom">
<div class="myorder_bottom1">
<div class="myorder_bottom1Img">
<img src="__TMPL__/public/assets/images/52.png" alt="" />
<img src="__TMPL__/public/assets/images/52.png" alt=""/>
</div>
<p class="myorder_bottom1Txt">{:date('Y-m-d H:i:s',$vo['create_time'])}</p>
</div>
<div class="myorder_bottom2">
<if condition="$vo.state eq 4">
<div class="myorder_bottom2_1">取消订单</div>
<div class="myorder_bottom2_2">去支付</div>
<div class="myorder_bottom2_1 cancel_order" data-id="{$vo.id}">取消订单</div>
<a href="{:url('portal/pay/index',array('id'=>$vo['id']))}">
<div class="myorder_bottom2_2" data-id="{$vo.id}">去支付</div>
</a>
<elseif condition="$vo.state eq 2"/>
<!--<a href="w_Ypayment.html">-->
<!--<div class="myorder_bottom2_2">查看订单</div>-->
<!--</a>-->
<elseif condition="$vo.state eq 5"/>
<a href="w_logistics.html">
<a href="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
<div class="myorder_bottom2_2">查看物流</div>
</a>
<elseif condition="$vo.state eq 3"/>
... ... @@ -98,16 +101,15 @@
</div>
</div>
</div>
</a>
</foreach>
</div>
<!-- 待付款 -->
<div class="myorder_con1">
<foreach name="data" item="vo">
<if condition="$vo.state eq 4">
<a href="{:url('order/get_one',array('id'=>$vo['id']))}">
<div class="myorder_information">
<div class="myorder_information dom_cancel_order_{$vo.id}" >
<!-- 订单 -->
<a href="{:url('order/get_one',array('id'=>$vo['id']))}">
<div class="myorder_the">
<p class="order_dan">订单号:{$vo.order_number}</p>
<div class="myorder_state1">
... ... @@ -126,7 +128,7 @@
<foreach name="$vo.indent_goods" item="i_g">
<li>
<div class="order_newsImg">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" />
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
</div>
<div class="order_newsCon">
<div class="order_newsTxt1 txt-cut">
... ... @@ -145,24 +147,27 @@
<p>¥{$vo.money}</p>
</div>
</ul>
</a>
<!-- 时间/底部 -->
<div class="myorder_bottom">
<div class="myorder_bottom1">
<div class="myorder_bottom1Img">
<img src="__TMPL__/public/assets/images/52.png" alt="" />
<img src="__TMPL__/public/assets/images/52.png" alt=""/>
</div>
<p class="myorder_bottom1Txt">{:date('Y-m-d H:i:s',$vo['create_time'])}</p>
</div>
<div class="myorder_bottom2">
<if condition="$vo.state eq 4">
<div class="myorder_bottom2_1">取消订单</div>
<div class="myorder_bottom2_2">去支付</div>
<div class="myorder_bottom2_1 cancel_order" data-id="{$vo.id}">取消订单</div>
<a href="{:url('portal/pay/index',array('id'=>$vo['id']))}">
<div class="myorder_bottom2_2" data-id="{$vo.id}">去支付</div>
</a>
<elseif condition="$vo.state eq 2"/>
<!--<a href="w_Ypayment.html">-->
<!--<div class="myorder_bottom2_2">查看订单</div>-->
<!--</a>-->
<elseif condition="$vo.state eq 5"/>
<a href="w_logistics.html">
<a href="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
<div class="myorder_bottom2_2">查看物流</div>
</a>
<elseif condition="$vo.state eq 3"/>
... ... @@ -171,7 +176,6 @@
</div>
</div>
</div>
</a>
</if>
</foreach>
</div>
... ... @@ -179,9 +183,9 @@
<div class="myorder_con1">
<foreach name="data" item="vo">
<if condition="$vo.state eq 2">
<a href="{:url('order/get_one',array('id'=>$vo['id']))}">
<div class="myorder_information">
<div class="myorder_information dom_cancel_order_{$vo.id}" >
<!-- 订单 -->
<a href="{:url('order/get_one',array('id'=>$vo['id']))}">
<div class="myorder_the">
<p class="order_dan">订单号:{$vo.order_number}</p>
<div class="myorder_state1">
... ... @@ -200,7 +204,7 @@
<foreach name="$vo.indent_goods" item="i_g">
<li>
<div class="order_newsImg">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" />
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
</div>
<div class="order_newsCon">
<div class="order_newsTxt1 txt-cut">
... ... @@ -219,24 +223,27 @@
<p>¥{$vo.money}</p>
</div>
</ul>
</a>
<!-- 时间/底部 -->
<div class="myorder_bottom">
<div class="myorder_bottom1">
<div class="myorder_bottom1Img">
<img src="__TMPL__/public/assets/images/52.png" alt="" />
<img src="__TMPL__/public/assets/images/52.png" alt=""/>
</div>
<p class="myorder_bottom1Txt">{:date('Y-m-d H:i:s',$vo['create_time'])}</p>
</div>
<div class="myorder_bottom2">
<if condition="$vo.state eq 4">
<div class="myorder_bottom2_1">取消订单</div>
<div class="myorder_bottom2_2">去支付</div>
<div class="myorder_bottom2_1 cancel_order" data-id="{$vo.id}">取消订单</div>
<a href="{:url('portal/pay/index',array('id'=>$vo['id']))}">
<div class="myorder_bottom2_2" data-id="{$vo.id}">去支付</div>
</a>
<elseif condition="$vo.state eq 2"/>
<!--<a href="w_Ypayment.html">-->
<!--<div class="myorder_bottom2_2">查看订单</div>-->
<!--</a>-->
<elseif condition="$vo.state eq 5"/>
<a href="w_logistics.html">
<a href="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
<div class="myorder_bottom2_2">查看物流</div>
</a>
<elseif condition="$vo.state eq 3"/>
... ... @@ -245,7 +252,6 @@
</div>
</div>
</div>
</a>
</if>
</foreach>
</div>
... ... @@ -253,9 +259,9 @@
<div class="myorder_con1">
<foreach name="data" item="vo">
<if condition="$vo.state eq 5">
<a href="{:url('order/get_one',array('id'=>$vo['id']))}">
<div class="myorder_information">
<div class="myorder_information dom_cancel_order_{$vo.id}" >
<!-- 订单 -->
<a href="{:url('order/get_one',array('id'=>$vo['id']))}">
<div class="myorder_the">
<p class="order_dan">订单号:{$vo.order_number}</p>
<div class="myorder_state1">
... ... @@ -274,7 +280,7 @@
<foreach name="$vo.indent_goods" item="i_g">
<li>
<div class="order_newsImg">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" />
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
</div>
<div class="order_newsCon">
<div class="order_newsTxt1 txt-cut">
... ... @@ -293,24 +299,27 @@
<p>¥{$vo.money}</p>
</div>
</ul>
</a>
<!-- 时间/底部 -->
<div class="myorder_bottom">
<div class="myorder_bottom1">
<div class="myorder_bottom1Img">
<img src="__TMPL__/public/assets/images/52.png" alt="" />
<img src="__TMPL__/public/assets/images/52.png" alt=""/>
</div>
<p class="myorder_bottom1Txt">{:date('Y-m-d H:i:s',$vo['create_time'])}</p>
</div>
<div class="myorder_bottom2">
<if condition="$vo.state eq 4">
<div class="myorder_bottom2_1">取消订单</div>
<div class="myorder_bottom2_2">去支付</div>
<div class="myorder_bottom2_1 cancel_order" data-id="{$vo.id}">取消订单</div>
<a href="{:url('portal/pay/index',array('id'=>$vo['id']))}">
<div class="myorder_bottom2_2" data-id="{$vo.id}">去支付</div>
</a>
<elseif condition="$vo.state eq 2"/>
<!--<a href="w_Ypayment.html">-->
<!--<div class="myorder_bottom2_2">查看订单</div>-->
<!--</a>-->
<elseif condition="$vo.state eq 5"/>
<a href="w_logistics.html">
<a href="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
<div class="myorder_bottom2_2">查看物流</div>
</a>
<elseif condition="$vo.state eq 3"/>
... ... @@ -319,7 +328,6 @@
</div>
</div>
</div>
</a>
</if>
</foreach>
</div>
... ... @@ -327,9 +335,9 @@
<div class="myorder_con1">
<foreach name="data" item="vo">
<if condition="$vo.state eq 3">
<a href="{:url('order/get_one',array('id'=>$vo['id']))}">
<div class="myorder_information">
<div class="myorder_information dom_cancel_order_{$vo.id}" >
<!-- 订单 -->
<a href="{:url('order/get_one',array('id'=>$vo['id']))}">
<div class="myorder_the">
<p class="order_dan">订单号:{$vo.order_number}</p>
<div class="myorder_state1">
... ... @@ -348,7 +356,7 @@
<foreach name="$vo.indent_goods" item="i_g">
<li>
<div class="order_newsImg">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" />
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
</div>
<div class="order_newsCon">
<div class="order_newsTxt1 txt-cut">
... ... @@ -367,24 +375,27 @@
<p>¥{$vo.money}</p>
</div>
</ul>
</a>
<!-- 时间/底部 -->
<div class="myorder_bottom">
<div class="myorder_bottom1">
<div class="myorder_bottom1Img">
<img src="__TMPL__/public/assets/images/52.png" alt="" />
<img src="__TMPL__/public/assets/images/52.png" alt=""/>
</div>
<p class="myorder_bottom1Txt">{:date('Y-m-d H:i:s',$vo['create_time'])}</p>
</div>
<div class="myorder_bottom2">
<if condition="$vo.state eq 4">
<div class="myorder_bottom2_1">取消订单</div>
<div class="myorder_bottom2_2">去支付</div>
<div class="myorder_bottom2_1 cancel_order" data-id="{$vo.id}">取消订单</div>
<a href="{:url('portal/pay/index',array('id'=>$vo['id']))}">
<div class="myorder_bottom2_2" data-id="{$vo.id}">去支付</div>
</a>
<elseif condition="$vo.state eq 2"/>
<!--<a href="w_Ypayment.html">-->
<!--<div class="myorder_bottom2_2">查看订单</div>-->
<!--</a>-->
<elseif condition="$vo.state eq 5"/>
<a href="w_logistics.html">
<a href="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
<div class="myorder_bottom2_2">查看物流</div>
</a>
<elseif condition="$vo.state eq 3"/>
... ... @@ -393,23 +404,23 @@
</div>
</div>
</div>
</a>
</if>
</foreach>
</div>
</div>
</div>
<script src="__TMPL__/public/assets/js/base.js"></script>
<script src="__TMPL__/public/assets/js/jquery.js"></script>
<script>
function load(){
</div>
<script src="__TMPL__/public/assets/js/base.js"></script>
<script src="__TMPL__/public/assets/js/jquery.js"></script>
<script>
function load() {
var index = $(".myor_title ul li").index($('.myor_title_active'));
$(".myorder_con1").eq(index).show().siblings().hide();
}
$(function() {
$(function () {
load();
// myor_title_active
$(".myor_title ul li").click(function() {
$(".myor_title ul li").click(function () {
console.log($(this));
$(this)
.addClass("myor_title_active")
... ... @@ -422,8 +433,27 @@
.siblings()
.hide();
});
$('.cancel_order').click(function () {
var indent_id = $(this).attr('data-id');
$.ajax({
url: "{:url('portal/order/cancel_order')}",
type: "POST",
data: {'id': indent_id},
success: function (data) {
if (data.code == 1) {
$('.dom_cancel_order_' + indent_id).remove();
alert('取消成功!')
} else {
alert('出错啦,请稍后再试!')
}
},
error: function (data) {
alert('与服务器断开连接');
}
})
})
})
</script>
</script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -2,12 +2,12 @@
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/>
<meta http-equiv="X-UA-Compatible" content="ie=edge"/>
<title>学考无忧</title>
<link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css" />
<link rel="stylesheet" href="__TMPL__/public/assets/css/base.css" />
<link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css"/>
<link rel="stylesheet" href="__TMPL__/public/assets/css/base.css"/>
<style>
.pay_banner {
width: 100%;
... ... @@ -28,17 +28,17 @@
</head>
<body>
<div class="Dpayment">
<div class="Dpayment">
<!-- 顶部 -->
<div class="order_top">
<img src="__TMPL__/public/assets/images/left.png" alt="" />
<img src="__TMPL__/public/assets/images/left.png" alt=""/>
<p>我的订单</p>
</div>
<!-- 顶部banner -->
<div class="pay_banner">
<div class="pay_bannerLeft">
<div class="pay_bannerImg">
<img src="__TMPL__/public/assets/images/53.png" alt="" />
<img src="__TMPL__/public/assets/images/53.png" alt=""/>
</div>
<p>
<if condition="$data.state eq 4">
... ... @@ -59,7 +59,7 @@
<a href="">
<div class="order_addressYes">
<div class="or_addressYesImg1">
<img src="__TMPL__/public/assets/images/38.png" alt="" />
<img src="__TMPL__/public/assets/images/38.png" alt=""/>
</div>
<div class="or_addressYesTxt1">
<div class="or_addressYesTxt2">
... ... @@ -71,7 +71,7 @@
</p>
</div>
<div class="or_addressYesImg2">
<img src="__TMPL__/public/assets/images/29.png" alt="" />
<img src="__TMPL__/public/assets/images/29.png" alt=""/>
</div>
</div>
</a>
... ... @@ -83,7 +83,7 @@
<foreach name="$data.indent_goods" item="i_g">
<li>
<div class="order_newsImg">
<img src="{:cmf_get_image_url($i_g['thumbnail'])}" alt="" />
<img src="{:cmf_get_image_url($i_g['thumbnail'])}" alt=""/>
</div>
<div class="order_newsCon">
<div class="order_newsTxt1 txt-cut">
... ... @@ -125,16 +125,48 @@
<p class="de_topTxt1_1"><span>{$data.money}</span></p>
</div>
<!-- 底部 -->
<div class="pay_bottom">
<div class="pay_bottom2">
<a href="w_logistics.html">
<if condition="$data.state eq 5">
<a href="{:url('logistics/index',array('indent_id'=>$data['id']))}">
<div class="pay_bottom2_1">物流信息</div>
</a>
<elseif condition="$data.state eq 5 || $data.state eq 3 || $data.state eq 2"/>
<div class="pay_bottom2_2">售后咨询</div>
<elseif condition="$data.state eq 4"/>
<div class="myorder_bottom2_1 cancel_order" data-id="{$data.id}">取消订单</div>
<a href="{:url('portal/pay/index',array('id'=>$data['id']))}">
<div class="myorder_bottom2_2">去支付</div>
</a>
</if>
</div>
</div>
</div>
<script src="__TMPL__/public/assets/js/base.js"></script>
</div>
<script src="__TMPL__/public/assets/js/base.js"></script>
<script src="__TMPL__/public/assets/js/jquery.js"></script>
</body>
<script>
$(function () {
$('.cancel_order').click(function () {
var indent_id = $(this).attr('data-id');
$.ajax({
url: "{:url('portal/order/cancel_order')}",
type: "POST",
data: {'id': indent_id},
success: function (data) {
if(data.code==1){
alert('取消成功!')
window.location.href = "{:url('portal/order/get_all')}";
}else{
alert('出错啦,请稍后再试!')
}
},
error: function (data) {
alert('与服务器断开连接');
}
})
})
})
</script>
</html>
\ No newline at end of file
... ...