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

我的订单与快递鸟

... ... @@ -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,39 +2,114 @@
<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="order_top">
<img src="__TMPL__/public/assets/images/left.png" alt="" />
<p>我的订单</p>
</div>
<!-- 头部 -->
<div class="myor_title">
<ul>
<li class="<if condition='$state eq 0'>myor_title_active</if>">全部</li>
<li class="<if condition='$state eq 4'>myor_title_active</if>">待付款</li>
<li class="<if condition='$state eq 2'>myor_title_active</if>">待发货</li>
<li class="<if condition='$state eq 5'>myor_title_active</if>">已发货</li>
<li class="<if condition='$state eq 3'>myor_title_active</if>">已完成</li>
</ul>
</div>
<!-- 内容 -->
<div class="myorder_content">
<!-- 全部 -->
<div class="myorder_con1" style="display: block">
<foreach name="data" item="vo">
<div class="myorder_box">
<!-- 顶部 -->
<div class="order_top">
<img src="__TMPL__/public/assets/images/left.png" alt=""/>
<p>我的订单</p>
</div>
<!-- 头部 -->
<div class="myor_title">
<ul>
<li class="<if condition='$state eq 0'>myor_title_active</if>">全部</li>
<li class="<if condition='$state eq 4'>myor_title_active</if>">待付款</li>
<li class="<if condition='$state eq 2'>myor_title_active</if>">待发货</li>
<li class="<if condition='$state eq 5'>myor_title_active</if>">已发货</li>
<li class="<if condition='$state eq 3'>myor_title_active</if>">已完成</li>
</ul>
</div>
<!-- 内容 -->
<div class="myorder_content">
<!-- 全部 -->
<div class="myorder_con1" style="display: block">
<foreach name="data" item="vo">
<div class="myorder_information dom_cancel_order_{$vo.id}" >
<!-- 订单 -->
<a href="{:url('order/get_one',array('id'=>$vo['id']))}">
<div class="myorder_information">
<!-- 订单 -->
<div class="myorder_the">
<p class="order_dan">订单号:{$vo.order_number}</p>
<div class="myorder_state1">
<if condition="$vo.state eq 4">
待付款
<elseif condition="$vo.state eq 2"/>
待发货
<elseif condition="$vo.state eq 5"/>
已发货
<elseif condition="$vo.state eq 3"/>
已完成
</if>
</div>
</div>
<ul class="order_newsUl myorder_border">
<foreach name="$vo.indent_goods" item="i_g">
<li>
<div class="order_newsImg">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
</div>
<div class="order_newsCon">
<div class="order_newsTxt1 txt-cut">
{$i_g.book_name}
</div>
<div class="order_newsTxt2">×<span>{$i_g.number}</span></div>
<div class="order_newsTxt3">
<p class="de_topTxt1_1"><span>{$i_g.price}</span></p>
<p class="de_topTxt1_2"><span>{$i_g.pricing}</span></p>
</div>
</div>
</li>
</foreach>
<div class="my_ordera">
<span>共{:count($vo.indent_goods)}件商品 合计:</span>
<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=""/>
</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 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="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
<div class="myorder_bottom2_2">查看物流</div>
</a>
<elseif condition="$vo.state eq 3"/>
<div class="myorder_bottom2_2">去评价</div>
</if>
</div>
</div>
</div>
</foreach>
</div>
<!-- 待付款 -->
<div class="myorder_con1">
<foreach name="data" item="vo">
<if condition="$vo.state eq 4">
<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 +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">
... ... @@ -72,358 +147,313 @@
<p>¥{$vo.money}</p>
</div>
</ul>
<!-- 时间/底部 -->
<div class="myorder_bottom">
<div class="myorder_bottom1">
<div class="myorder_bottom1Img">
<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>
</a>
<!-- 时间/底部 -->
<div class="myorder_bottom">
<div class="myorder_bottom1">
<div class="myorder_bottom1Img">
<img src="__TMPL__/public/assets/images/52.png" alt=""/>
</div>
<div class="myorder_bottom2">
<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 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="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
<div class="myorder_bottom2_2">查看物流</div>
</a>
<elseif condition="$vo.state eq 3"/>
<div class="myorder_bottom2_2">去评价</div>
</if>
</div>
</div>
</div>
</if>
</foreach>
</div>
<!-- 待发货 -->
<div class="myorder_con1">
<foreach name="data" item="vo">
<if condition="$vo.state eq 2">
<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">
<if condition="$vo.state eq 4">
<div class="myorder_bottom2_1">取消订单</div>
<div class="myorder_bottom2_2">去支付</div>
待付款
<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">
<div class="myorder_bottom2_2">查看物流</div>
</a>
已发货
<elseif condition="$vo.state eq 3"/>
<div class="myorder_bottom2_2">去评价</div>
已完成
</if>
</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_the">
<p class="order_dan">订单号:{$vo.order_number}</p>
<div class="myorder_state1">
<if condition="$vo.state eq 4">
待付款
<elseif condition="$vo.state eq 2"/>
待发货
<elseif condition="$vo.state eq 5"/>
已发货
<elseif condition="$vo.state eq 3"/>
已完成
</if>
</div>
</div>
<ul class="order_newsUl myorder_border">
<foreach name="$vo.indent_goods" item="i_g">
<li>
<div class="order_newsImg">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" />
<ul class="order_newsUl myorder_border">
<foreach name="$vo.indent_goods" item="i_g">
<li>
<div class="order_newsImg">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
</div>
<div class="order_newsCon">
<div class="order_newsTxt1 txt-cut">
{$i_g.book_name}
</div>
<div class="order_newsCon">
<div class="order_newsTxt1 txt-cut">
{$i_g.book_name}
</div>
<div class="order_newsTxt2">×<span>{$i_g.number}</span></div>
<div class="order_newsTxt3">
<p class="de_topTxt1_1"><span>{$i_g.price}</span></p>
<p class="de_topTxt1_2"><span>{$i_g.pricing}</span></p>
</div>
<div class="order_newsTxt2">×<span>{$i_g.number}</span></div>
<div class="order_newsTxt3">
<p class="de_topTxt1_1"><span>{$i_g.price}</span></p>
<p class="de_topTxt1_2"><span>{$i_g.pricing}</span></p>
</div>
</li>
</foreach>
<div class="my_ordera">
<span>共{:count($vo.indent_goods)}件商品 合计:</span>
<p>¥{$vo.money}</p>
</div>
</ul>
<!-- 时间/底部 -->
<div class="myorder_bottom">
<div class="myorder_bottom1">
<div class="myorder_bottom1Img">
<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>
<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">
<div class="myorder_bottom2_2">查看物流</div>
</a>
<elseif condition="$vo.state eq 3"/>
<div class="myorder_bottom2_2">去评价</div>
</if>
</div>
</li>
</foreach>
<div class="my_ordera">
<span>共{:count($vo.indent_goods)}件商品 合计:</span>
<p>¥{$vo.money}</p>
</div>
</div>
</ul>
</a>
</if>
</foreach>
</div>
<!-- 待发货 -->
<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_the">
<p class="order_dan">订单号:{$vo.order_number}</p>
<div class="myorder_state1">
<if condition="$vo.state eq 4">
待付款
<elseif condition="$vo.state eq 2"/>
待发货
<elseif condition="$vo.state eq 5"/>
已发货
<elseif condition="$vo.state eq 3"/>
已完成
</if>
</div>
</div>
<ul class="order_newsUl myorder_border">
<foreach name="$vo.indent_goods" item="i_g">
<li>
<div class="order_newsImg">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" />
</div>
<div class="order_newsCon">
<div class="order_newsTxt1 txt-cut">
{$i_g.book_name}
</div>
<div class="order_newsTxt2">×<span>{$i_g.number}</span></div>
<div class="order_newsTxt3">
<p class="de_topTxt1_1"><span>{$i_g.price}</span></p>
<p class="de_topTxt1_2"><span>{$i_g.pricing}</span></p>
</div>
</div>
</li>
</foreach>
<div class="my_ordera">
<span>共{:count($vo.indent_goods)}件商品 合计:</span>
<p>¥{$vo.money}</p>
</div>
</ul>
<!-- 时间/底部 -->
<div class="myorder_bottom">
<div class="myorder_bottom1">
<div class="myorder_bottom1Img">
<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>
<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">
<div class="myorder_bottom2_2">查看物流</div>
</a>
<elseif condition="$vo.state eq 3"/>
<div class="myorder_bottom2_2">去评价</div>
</if>
</div>
<!-- 时间/底部 -->
<div class="myorder_bottom">
<div class="myorder_bottom1">
<div class="myorder_bottom1Img">
<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>
</a>
</if>
</foreach>
</div>
<!-- 已发货 -->
<div class="myorder_con1">
<foreach name="data" item="vo">
<if condition="$vo.state eq 5">
<div class="myorder_bottom2">
<if condition="$vo.state eq 4">
<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="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
<div class="myorder_bottom2_2">查看物流</div>
</a>
<elseif condition="$vo.state eq 3"/>
<div class="myorder_bottom2_2">去评价</div>
</if>
</div>
</div>
</div>
</if>
</foreach>
</div>
<!-- 已发货 -->
<div class="myorder_con1">
<foreach name="data" item="vo">
<if condition="$vo.state eq 5">
<div class="myorder_information dom_cancel_order_{$vo.id}" >
<!-- 订单 -->
<a href="{:url('order/get_one',array('id'=>$vo['id']))}">
<div class="myorder_information">
<!-- 订单 -->
<div class="myorder_the">
<p class="order_dan">订单号:{$vo.order_number}</p>
<div class="myorder_state1">
<if condition="$vo.state eq 4">
待付款
<elseif condition="$vo.state eq 2"/>
待发货
<elseif condition="$vo.state eq 5"/>
已发货
<elseif condition="$vo.state eq 3"/>
已完成
</if>
</div>
<div class="myorder_the">
<p class="order_dan">订单号:{$vo.order_number}</p>
<div class="myorder_state1">
<if condition="$vo.state eq 4">
待付款
<elseif condition="$vo.state eq 2"/>
待发货
<elseif condition="$vo.state eq 5"/>
已发货
<elseif condition="$vo.state eq 3"/>
已完成
</if>
</div>
<ul class="order_newsUl myorder_border">
<foreach name="$vo.indent_goods" item="i_g">
<li>
<div class="order_newsImg">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" />
</div>
<ul class="order_newsUl myorder_border">
<foreach name="$vo.indent_goods" item="i_g">
<li>
<div class="order_newsImg">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
</div>
<div class="order_newsCon">
<div class="order_newsTxt1 txt-cut">
{$i_g.book_name}
</div>
<div class="order_newsCon">
<div class="order_newsTxt1 txt-cut">
{$i_g.book_name}
</div>
<div class="order_newsTxt2">×<span>{$i_g.number}</span></div>
<div class="order_newsTxt3">
<p class="de_topTxt1_1"><span>{$i_g.price}</span></p>
<p class="de_topTxt1_2"><span>{$i_g.pricing}</span></p>
</div>
<div class="order_newsTxt2">×<span>{$i_g.number}</span></div>
<div class="order_newsTxt3">
<p class="de_topTxt1_1"><span>{$i_g.price}</span></p>
<p class="de_topTxt1_2"><span>{$i_g.pricing}</span></p>
</div>
</li>
</foreach>
<div class="my_ordera">
<span>共{:count($vo.indent_goods)}件商品 合计:</span>
<p>¥{$vo.money}</p>
</div>
</ul>
<!-- 时间/底部 -->
<div class="myorder_bottom">
<div class="myorder_bottom1">
<div class="myorder_bottom1Img">
<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>
<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">
<div class="myorder_bottom2_2">查看物流</div>
</a>
<elseif condition="$vo.state eq 3"/>
<div class="myorder_bottom2_2">去评价</div>
</if>
</div>
</li>
</foreach>
<div class="my_ordera">
<span>共{:count($vo.indent_goods)}件商品 合计:</span>
<p>¥{$vo.money}</p>
</div>
</div>
</ul>
</a>
</if>
</foreach>
</div>
<!-- 已完成 -->
<div class="myorder_con1">
<foreach name="data" item="vo">
<if condition="$vo.state eq 3">
<!-- 时间/底部 -->
<div class="myorder_bottom">
<div class="myorder_bottom1">
<div class="myorder_bottom1Img">
<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 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="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
<div class="myorder_bottom2_2">查看物流</div>
</a>
<elseif condition="$vo.state eq 3"/>
<div class="myorder_bottom2_2">去评价</div>
</if>
</div>
</div>
</div>
</if>
</foreach>
</div>
<!-- 已完成 -->
<div class="myorder_con1">
<foreach name="data" item="vo">
<if condition="$vo.state eq 3">
<div class="myorder_information dom_cancel_order_{$vo.id}" >
<!-- 订单 -->
<a href="{:url('order/get_one',array('id'=>$vo['id']))}">
<div class="myorder_information">
<!-- 订单 -->
<div class="myorder_the">
<p class="order_dan">订单号:{$vo.order_number}</p>
<div class="myorder_state1">
<if condition="$vo.state eq 4">
待付款
<elseif condition="$vo.state eq 2"/>
待发货
<elseif condition="$vo.state eq 5"/>
已发货
<elseif condition="$vo.state eq 3"/>
已完成
</if>
</div>
<div class="myorder_the">
<p class="order_dan">订单号:{$vo.order_number}</p>
<div class="myorder_state1">
<if condition="$vo.state eq 4">
待付款
<elseif condition="$vo.state eq 2"/>
待发货
<elseif condition="$vo.state eq 5"/>
已发货
<elseif condition="$vo.state eq 3"/>
已完成
</if>
</div>
<ul class="order_newsUl myorder_border">
<foreach name="$vo.indent_goods" item="i_g">
<li>
<div class="order_newsImg">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" />
</div>
<ul class="order_newsUl myorder_border">
<foreach name="$vo.indent_goods" item="i_g">
<li>
<div class="order_newsImg">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
</div>
<div class="order_newsCon">
<div class="order_newsTxt1 txt-cut">
{$i_g.book_name}
</div>
<div class="order_newsCon">
<div class="order_newsTxt1 txt-cut">
{$i_g.book_name}
</div>
<div class="order_newsTxt2">×<span>{$i_g.number}</span></div>
<div class="order_newsTxt3">
<p class="de_topTxt1_1"><span>{$i_g.price}</span></p>
<p class="de_topTxt1_2"><span>{$i_g.pricing}</span></p>
</div>
<div class="order_newsTxt2">×<span>{$i_g.number}</span></div>
<div class="order_newsTxt3">
<p class="de_topTxt1_1"><span>{$i_g.price}</span></p>
<p class="de_topTxt1_2"><span>{$i_g.pricing}</span></p>
</div>
</li>
</foreach>
<div class="my_ordera">
<span>共{:count($vo.indent_goods)}件商品 合计:</span>
<p>¥{$vo.money}</p>
</div>
</ul>
<!-- 时间/底部 -->
<div class="myorder_bottom">
<div class="myorder_bottom1">
<div class="myorder_bottom1Img">
<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>
<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">
<div class="myorder_bottom2_2">查看物流</div>
</a>
<elseif condition="$vo.state eq 3"/>
<div class="myorder_bottom2_2">去评价</div>
</if>
</div>
</li>
</foreach>
<div class="my_ordera">
<span>共{:count($vo.indent_goods)}件商品 合计:</span>
<p>¥{$vo.money}</p>
</div>
</div>
</ul>
</a>
</if>
</foreach>
</div>
<!-- 时间/底部 -->
<div class="myorder_bottom">
<div class="myorder_bottom1">
<div class="myorder_bottom1Img">
<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 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="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
<div class="myorder_bottom2_2">查看物流</div>
</a>
<elseif condition="$vo.state eq 3"/>
<div class="myorder_bottom2_2">去评价</div>
</if>
</div>
</div>
</div>
</if>
</foreach>
</div>
</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() {
load();
// myor_title_active
$(".myor_title ul li").click(function() {
console.log($(this));
$(this)
.addClass("myor_title_active")
.siblings()
.removeClass("myor_title_active");
var index = $(this).index();
$(".myorder_con1")
.eq(index)
.show()
.siblings()
.hide();
});
</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 () {
load();
// myor_title_active
$(".myor_title ul li").click(function () {
console.log($(this));
$(this)
.addClass("myor_title_active")
.siblings()
.removeClass("myor_title_active");
var index = $(this).index();
$(".myorder_con1")
.eq(index)
.show()
.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%;
... ... @@ -15,7 +15,7 @@
background-size: cover;
background-image: url("__TMPL__/public/assets/images/55.png");
}
.order_address {
padding: 0.28rem 0 0.42rem;
box-sizing: border-box;
... ... @@ -28,113 +28,145 @@
</head>
<body>
<div class="Dpayment">
<!-- 顶部 -->
<div class="order_top">
<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="" />
</div>
<p>
<if condition="$data.state eq 4">
待付款
<elseif condition="$data.state eq 2"/>
待发货
<elseif condition="$data.state eq 5"/>
已发货
<elseif condition="$data.state eq 3"/>
已完成
</if>
</p>
<div class="Dpayment">
<!-- 顶部 -->
<div class="order_top">
<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=""/>
</div>
<p>
<if condition="$data.state eq 4">
待付款
<elseif condition="$data.state eq 2"/>
待发货
<elseif condition="$data.state eq 5"/>
已发货
<elseif condition="$data.state eq 3"/>
已完成
</if>
</p>
</div>
<!-- 地址 -->
<div class="order_address">
<!-- 有地址 -->
<a href="">
<div class="order_addressYes">
<div class="or_addressYesImg1">
<img src="__TMPL__/public/assets/images/38.png" alt="" />
</div>
<div class="or_addressYesTxt1">
<div class="or_addressYesTxt2">
<div class="or_addressName">{$data.address.name}</div>
<p class="or_addressPhone">{$data.phone}</p>
</div>
<p class="or_address_detailed">
{$data.address.region}{$data.address.detailed}
</p>
</div>
<div class="or_addressYesImg2">
<img src="__TMPL__/public/assets/images/29.png" alt="" />
</div>
<!-- 地址 -->
<div class="order_address">
<!-- 有地址 -->
<a href="">
<div class="order_addressYes">
<div class="or_addressYesImg1">
<img src="__TMPL__/public/assets/images/38.png" alt=""/>
</div>
<div class="or_addressYesTxt1">
<div class="or_addressYesTxt2">
<div class="or_addressName">{$data.address.name}</div>
<p class="or_addressPhone">{$data.phone}</p>
</div>
<p class="or_address_detailed">
{$data.address.region}{$data.address.detailed}
</p>
</div>
</a>
</div>
<!-- 订单信息 -->
<div class="order_news">
<h1 class="order_newsTit">订单信息</h1>
<ul class="order_newsUl">
<foreach name="$data.indent_goods" item="i_g">
<li>
<div class="order_newsImg">
<img src="{:cmf_get_image_url($i_g['thumbnail'])}" alt="" />
<div class="or_addressYesImg2">
<img src="__TMPL__/public/assets/images/29.png" alt=""/>
</div>
</div>
</a>
</div>
<!-- 订单信息 -->
<div class="order_news">
<h1 class="order_newsTit">订单信息</h1>
<ul class="order_newsUl">
<foreach name="$data.indent_goods" item="i_g">
<li>
<div class="order_newsImg">
<img src="{:cmf_get_image_url($i_g['thumbnail'])}" alt=""/>
</div>
<div class="order_newsCon">
<div class="order_newsTxt1 txt-cut">
{$i_g.book_name}
</div>
<div class="order_newsCon">
<div class="order_newsTxt1 txt-cut">
{$i_g.book_name}
</div>
<div class="order_newsTxt2">×<span>{$i_g.number}</span></div>
<div class="order_newsTxt3">
<p class="de_topTxt1_1"><span>{$i_g.price}</span></p>
<p class="de_topTxt1_2"><span>{$i_g.pricing}</span></p>
</div>
<div class="order_newsTxt2">×<span>{$i_g.number}</span></div>
<div class="order_newsTxt3">
<p class="de_topTxt1_1"><span>{$i_g.price}</span></p>
<p class="de_topTxt1_2"><span>{$i_g.pricing}</span></p>
</div>
</li>
<php>$sum[] = $i_g['price']*$i_g['number'];</php>
</foreach>
</ul>
</div>
</li>
<php>$sum[] = $i_g['price']*$i_g['number'];</php>
</foreach>
</ul>
</div>
<!-- 支付方式/配送方式 -->
<div class="order_Etc">
<div class="order_Etc1 ypayTxt">
<p>订单编号:</p>
<p>{$data.order_number}</p>
</div>
<!-- 支付方式/配送方式 -->
<div class="order_Etc">
<div class="order_Etc1 ypayTxt">
<p>订单编号:</p>
<p>{$data.order_number}</p>
</div>
<div class="order_Etc1 ypayTxt">
<p>下单时间:</p>
<p>{:date('Y-m-d H:i:s',$data.create_time)}</p>
</div>
<div class="order_Etc1 ypayTxt">
<p>配送方式:</p>
<if condition="$data.is_courier eq 0">
<p>统一配送(0元)</p>
<elseif condition="$data.id_courier eq 1"/>
<p>快递({$data.money-array_sum($sum)}元)</p>
</if>
</div>
<div class="order_Etc1 ypayTxt">
<p>下单时间:</p>
<p>{:date('Y-m-d H:i:s',$data.create_time)}</p>
</div>
<!-- 实付金额: -->
<div class="ypay_price">
<p class="ypay_price1">实付金额:</p>
<p class="de_topTxt1_1"><span>{$data.money}</span></p>
<div class="order_Etc1 ypayTxt">
<p>配送方式:</p>
<if condition="$data.is_courier eq 0">
<p>统一配送(0元)</p>
<elseif condition="$data.id_courier eq 1"/>
<p>快递({$data.money-array_sum($sum)}元)</p>
</if>
</div>
<!-- 底部 -->
<div class="pay_bottom">
<div class="pay_bottom2">
<a href="w_logistics.html">
</div>
<!-- 实付金额: -->
<div class="ypay_price">
<p class="ypay_price1">实付金额:</p>
<p class="de_topTxt1_1"><span>{$data.money}</span></p>
</div>
<!-- 底部 -->
<div class="pay_bottom">
<div class="pay_bottom2">
<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>
</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>
<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
... ...