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

合并分支 'wangxiaogang' 到 'master'

我的订单与快递鸟



查看合并请求 !4
@@ -155,7 +155,7 @@ class BirdController extends HomeBaseController @@ -155,7 +155,7 @@ class BirdController extends HomeBaseController
155 $jsonResult = $this->getOrderTracesByJson($indent['order_number'],$indent['logistic_code']); 155 $jsonResult = $this->getOrderTracesByJson($indent['order_number'],$indent['logistic_code']);
156 $result = json_decode($jsonResult,true); 156 $result = json_decode($jsonResult,true);
157 if($result['Success'] == true){ 157 if($result['Success'] == true){
158 - return dump($result);['code'=>20000,'msg'=>'SUCCESS','data'=>['state'=>$result['State'],'traces'=>$result['Traces']]];//订单轨迹 158 + return ['code'=>20000,'msg'=>'SUCCESS','data'=>['state'=>$result['State'],'traces'=>$result['Traces']]];//订单轨迹
159 }else{ 159 }else{
160 return ['code'=>40000,'msg'=>$result['Reason']]; 160 return ['code'=>40000,'msg'=>$result['Reason']];
161 } 161 }
  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: Administrator
  5 + * Date: 2019/6/7
  6 + * Time: 19:11
  7 + */
  8 +
  9 +namespace app\portal\controller;
  10 +
  11 +
  12 +use app\portal\model\IndentGoodsModel;
  13 +use app\portal\model\IndentModel;
  14 +use cmf\controller\WeChatBaseController;
  15 +
  16 +class LogisticsController extends WeChatBaseController
  17 +{
  18 + public function index(){
  19 + $indent_id = $this->request->param('indent_id',0,'intval');
  20 + if(empty($indent_id)){
  21 + $this->error('缺少必要参数','','','');
  22 + }
  23 + $birdController = new BirdController();
  24 + $indentModel = new IndentModel();
  25 + $where['id'] = ['eq',$indent_id];
  26 + $data = $indentModel->findData($where);
  27 + if(empty($data)){
  28 + $this->error('查询为空','','','');
  29 + }
  30 + $result = $birdController->getOrder($indent_id);
  31 + if(empty($result)){
  32 + $this->error('未知错误','','');
  33 + }
  34 + if($result['code'] != 20000){
  35 + $this->error($result['msg'],'','','');
  36 + }
  37 + $indent = $indentModel->findData(['id'=>$indent_id])->toArray();
  38 + $indentGoodsModel = new IndentGoodsModel();
  39 + $indent_goods = $indentGoodsModel->selectData(['indent_id'=>$indent_id]);
  40 + $indent['indent_goods'] = $indent_goods;
  41 + $this->assign('data',$result['data']);
  42 + $this->assign('indent',$indent);
  43 + return $this->fetch();
  44 + }
  45 +
  46 +}
@@ -85,6 +85,6 @@ class OrderController extends WeChatBaseController @@ -85,6 +85,6 @@ class OrderController extends WeChatBaseController
85 if(empty($result)){ 85 if(empty($result)){
86 $this->error('sql执行失败','','',''); 86 $this->error('sql执行失败','','','');
87 } 87 }
88 - $this->redirect('order/get_all'); 88 + $this->success('SUCCESS');
89 } 89 }
90 } 90 }
  1 +<!DOCTYPE html>
  2 +<html lang="en">
  3 +
  4 +<head>
  5 + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  6 + <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
  7 + <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8 + <title>学考无忧-物流信息</title>
  9 + <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css">
  10 + <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css">
  11 +</head>
  12 +
  13 +<body>
  14 + <!-- 顶部 -->
  15 + <div class="order_top">
  16 + <img src="__TMPL__/public/assets/images/left.png" alt="">
  17 + <p>我的订单</p>
  18 + </div>
  19 + <div class="logistics_box">
  20 + <!-- 商品信息 -->
  21 + <div class="log_detail">
  22 + <div class="log_detailImg">
  23 + <img src="{:cmf_get_image_url($indent.indent_goods.0.thumbnail)}" alt="">
  24 + </div>
  25 + <div class="log_detailTxt">
  26 + <h1 class="one-txt-cut">{$indent.indent_goods.0.book_name}</h1>
  27 + <p>运单号:{$indent.order_number}</p>
  28 + <p>信息来源:顺丰快递</p>
  29 + </div>
  30 + </div>
  31 +
  32 +
  33 + <!-- 物流信息 -->
  34 + <div class="logistics_process">
  35 + <empty name="$data.traces">
  36 + 暂无物流信息
  37 + </empty>
  38 + <div class="logistics_left">
  39 + <foreach name="$data.traces" item="vo">
  40 + <div class="log_Li">
  41 + <div class="log_LiTime">
  42 + <p class="log_LiTime1">{:date('Y-m-d',strtotime($vo['AcceptTime']))}</p>
  43 + <p class="log_LiTime2">{:date('H:i:s',strtotime($vo['AcceptTime']))}</p>
  44 + </div>
  45 + <div class="log_Box">
  46 + <div class="log_Liround"></div>
  47 + <div class="log_line"></div>
  48 + </div>
  49 + </div>
  50 + </foreach>
  51 + </div>
  52 + <div class="logistics_right">
  53 + <foreach name="$data.traces" item="vo">
  54 + <div class="log_rightTxt">
  55 + <p class="log_rightTxt1">{$vo.AcceptStation}</p>
  56 + </div>
  57 + </foreach>
  58 + </div>
  59 + </div>
  60 + </div>
  61 + <script src="__TMPL__/public/assets/js/base.js"></script>
  62 + <script src="__TMPL__/public/assets/js/jquery.js"></script>
  63 + <script>
  64 + var circle = $(".log_Li");
  65 + // console.log(circle);
  66 + var list = $(".log_rightTxt");
  67 + // console.log(list)
  68 + for (var i = 0; i < circle.length; i++) {
  69 + for (var j = 0; j < list.length; j++) {
  70 + if (i == j && i == 0 && j == 0) {
  71 + var h = $(list[j]).css("height");
  72 + console.log(h)
  73 + h = h.split("p");
  74 + h = parseInt(h[0]);
  75 + h = h + 20;
  76 + console.log(h);
  77 + console.log(h);
  78 + $(circle[i]).css("height", h + "px");
  79 + $(circle[i]).find(".log_line").css("height", h + "px");
  80 + } else if (i == j != 0) {
  81 + var h = $(list[j]).css("height");
  82 + // console.log(h)
  83 + h = h.split("p");
  84 + console.log(h[0]);
  85 + h = parseInt(h[0]);
  86 + h = h + 20;
  87 + console.log(h);
  88 + $(circle[i]).css("height", h + "px");
  89 + $(circle[i]).find(".log_line").css("height", h + "px");
  90 + }
  91 +
  92 + }
  93 + }
  94 + </script>
  95 +</body>
  96 +
  97 +</html>
@@ -2,19 +2,19 @@ @@ -2,19 +2,19 @@
2 <html lang="en"> 2 <html lang="en">
3 3
4 <head> 4 <head>
5 - <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />  
6 - <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />  
7 - <meta http-equiv="X-UA-Compatible" content="ie=edge" /> 5 + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
  6 + <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/>
  7 + <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
8 <title>学考无忧-我的订单</title> 8 <title>学考无忧-我的订单</title>
9 - <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css" />  
10 - <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css" /> 9 + <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css"/>
  10 + <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css"/>
11 </head> 11 </head>
12 12
13 <body> 13 <body>
14 - <div class="myorder_box"> 14 +<div class="myorder_box">
15 <!-- 顶部 --> 15 <!-- 顶部 -->
16 <div class="order_top"> 16 <div class="order_top">
17 - <img src="__TMPL__/public/assets/images/left.png" alt="" /> 17 + <img src="__TMPL__/public/assets/images/left.png" alt=""/>
18 <p>我的订单</p> 18 <p>我的订单</p>
19 </div> 19 </div>
20 <!-- 头部 --> 20 <!-- 头部 -->
@@ -32,9 +32,9 @@ @@ -32,9 +32,9 @@
32 <!-- 全部 --> 32 <!-- 全部 -->
33 <div class="myorder_con1" style="display: block"> 33 <div class="myorder_con1" style="display: block">
34 <foreach name="data" item="vo"> 34 <foreach name="data" item="vo">
35 - <a href="{:url('order/get_one',array('id'=>$vo['id']))}">  
36 - <div class="myorder_information"> 35 + <div class="myorder_information dom_cancel_order_{$vo.id}" >
37 <!-- 订单 --> 36 <!-- 订单 -->
  37 + <a href="{:url('order/get_one',array('id'=>$vo['id']))}">
38 <div class="myorder_the"> 38 <div class="myorder_the">
39 <p class="order_dan">订单号:{$vo.order_number}</p> 39 <p class="order_dan">订单号:{$vo.order_number}</p>
40 <div class="myorder_state1"> 40 <div class="myorder_state1">
@@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
53 <foreach name="$vo.indent_goods" item="i_g"> 53 <foreach name="$vo.indent_goods" item="i_g">
54 <li> 54 <li>
55 <div class="order_newsImg"> 55 <div class="order_newsImg">
56 - <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" /> 56 + <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
57 </div> 57 </div>
58 <div class="order_newsCon"> 58 <div class="order_newsCon">
59 <div class="order_newsTxt1 txt-cut"> 59 <div class="order_newsTxt1 txt-cut">
@@ -72,24 +72,27 @@ @@ -72,24 +72,27 @@
72 <p>¥{$vo.money}</p> 72 <p>¥{$vo.money}</p>
73 </div> 73 </div>
74 </ul> 74 </ul>
  75 + </a>
75 <!-- 时间/底部 --> 76 <!-- 时间/底部 -->
76 <div class="myorder_bottom"> 77 <div class="myorder_bottom">
77 <div class="myorder_bottom1"> 78 <div class="myorder_bottom1">
78 <div class="myorder_bottom1Img"> 79 <div class="myorder_bottom1Img">
79 - <img src="__TMPL__/public/assets/images/52.png" alt="" /> 80 + <img src="__TMPL__/public/assets/images/52.png" alt=""/>
80 </div> 81 </div>
81 <p class="myorder_bottom1Txt">{:date('Y-m-d H:i:s',$vo['create_time'])}</p> 82 <p class="myorder_bottom1Txt">{:date('Y-m-d H:i:s',$vo['create_time'])}</p>
82 </div> 83 </div>
83 <div class="myorder_bottom2"> 84 <div class="myorder_bottom2">
84 <if condition="$vo.state eq 4"> 85 <if condition="$vo.state eq 4">
85 - <div class="myorder_bottom2_1">取消订单</div>  
86 - <div class="myorder_bottom2_2">去支付</div> 86 + <div class="myorder_bottom2_1 cancel_order" data-id="{$vo.id}">取消订单</div>
  87 + <a href="{:url('portal/pay/index',array('id'=>$vo['id']))}">
  88 + <div class="myorder_bottom2_2" data-id="{$vo.id}">去支付</div>
  89 + </a>
87 <elseif condition="$vo.state eq 2"/> 90 <elseif condition="$vo.state eq 2"/>
88 <!--<a href="w_Ypayment.html">--> 91 <!--<a href="w_Ypayment.html">-->
89 <!--<div class="myorder_bottom2_2">查看订单</div>--> 92 <!--<div class="myorder_bottom2_2">查看订单</div>-->
90 <!--</a>--> 93 <!--</a>-->
91 <elseif condition="$vo.state eq 5"/> 94 <elseif condition="$vo.state eq 5"/>
92 - <a href="w_logistics.html"> 95 + <a href="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
93 <div class="myorder_bottom2_2">查看物流</div> 96 <div class="myorder_bottom2_2">查看物流</div>
94 </a> 97 </a>
95 <elseif condition="$vo.state eq 3"/> 98 <elseif condition="$vo.state eq 3"/>
@@ -98,16 +101,15 @@ @@ -98,16 +101,15 @@
98 </div> 101 </div>
99 </div> 102 </div>
100 </div> 103 </div>
101 - </a>  
102 </foreach> 104 </foreach>
103 </div> 105 </div>
104 <!-- 待付款 --> 106 <!-- 待付款 -->
105 <div class="myorder_con1"> 107 <div class="myorder_con1">
106 <foreach name="data" item="vo"> 108 <foreach name="data" item="vo">
107 <if condition="$vo.state eq 4"> 109 <if condition="$vo.state eq 4">
108 - <a href="{:url('order/get_one',array('id'=>$vo['id']))}">  
109 - <div class="myorder_information"> 110 + <div class="myorder_information dom_cancel_order_{$vo.id}" >
110 <!-- 订单 --> 111 <!-- 订单 -->
  112 + <a href="{:url('order/get_one',array('id'=>$vo['id']))}">
111 <div class="myorder_the"> 113 <div class="myorder_the">
112 <p class="order_dan">订单号:{$vo.order_number}</p> 114 <p class="order_dan">订单号:{$vo.order_number}</p>
113 <div class="myorder_state1"> 115 <div class="myorder_state1">
@@ -126,7 +128,7 @@ @@ -126,7 +128,7 @@
126 <foreach name="$vo.indent_goods" item="i_g"> 128 <foreach name="$vo.indent_goods" item="i_g">
127 <li> 129 <li>
128 <div class="order_newsImg"> 130 <div class="order_newsImg">
129 - <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" /> 131 + <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
130 </div> 132 </div>
131 <div class="order_newsCon"> 133 <div class="order_newsCon">
132 <div class="order_newsTxt1 txt-cut"> 134 <div class="order_newsTxt1 txt-cut">
@@ -145,24 +147,27 @@ @@ -145,24 +147,27 @@
145 <p>¥{$vo.money}</p> 147 <p>¥{$vo.money}</p>
146 </div> 148 </div>
147 </ul> 149 </ul>
  150 + </a>
148 <!-- 时间/底部 --> 151 <!-- 时间/底部 -->
149 <div class="myorder_bottom"> 152 <div class="myorder_bottom">
150 <div class="myorder_bottom1"> 153 <div class="myorder_bottom1">
151 <div class="myorder_bottom1Img"> 154 <div class="myorder_bottom1Img">
152 - <img src="__TMPL__/public/assets/images/52.png" alt="" /> 155 + <img src="__TMPL__/public/assets/images/52.png" alt=""/>
153 </div> 156 </div>
154 <p class="myorder_bottom1Txt">{:date('Y-m-d H:i:s',$vo['create_time'])}</p> 157 <p class="myorder_bottom1Txt">{:date('Y-m-d H:i:s',$vo['create_time'])}</p>
155 </div> 158 </div>
156 <div class="myorder_bottom2"> 159 <div class="myorder_bottom2">
157 <if condition="$vo.state eq 4"> 160 <if condition="$vo.state eq 4">
158 - <div class="myorder_bottom2_1">取消订单</div>  
159 - <div class="myorder_bottom2_2">去支付</div> 161 + <div class="myorder_bottom2_1 cancel_order" data-id="{$vo.id}">取消订单</div>
  162 + <a href="{:url('portal/pay/index',array('id'=>$vo['id']))}">
  163 + <div class="myorder_bottom2_2" data-id="{$vo.id}">去支付</div>
  164 + </a>
160 <elseif condition="$vo.state eq 2"/> 165 <elseif condition="$vo.state eq 2"/>
161 <!--<a href="w_Ypayment.html">--> 166 <!--<a href="w_Ypayment.html">-->
162 <!--<div class="myorder_bottom2_2">查看订单</div>--> 167 <!--<div class="myorder_bottom2_2">查看订单</div>-->
163 <!--</a>--> 168 <!--</a>-->
164 <elseif condition="$vo.state eq 5"/> 169 <elseif condition="$vo.state eq 5"/>
165 - <a href="w_logistics.html"> 170 + <a href="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
166 <div class="myorder_bottom2_2">查看物流</div> 171 <div class="myorder_bottom2_2">查看物流</div>
167 </a> 172 </a>
168 <elseif condition="$vo.state eq 3"/> 173 <elseif condition="$vo.state eq 3"/>
@@ -171,7 +176,6 @@ @@ -171,7 +176,6 @@
171 </div> 176 </div>
172 </div> 177 </div>
173 </div> 178 </div>
174 - </a>  
175 </if> 179 </if>
176 </foreach> 180 </foreach>
177 </div> 181 </div>
@@ -179,9 +183,9 @@ @@ -179,9 +183,9 @@
179 <div class="myorder_con1"> 183 <div class="myorder_con1">
180 <foreach name="data" item="vo"> 184 <foreach name="data" item="vo">
181 <if condition="$vo.state eq 2"> 185 <if condition="$vo.state eq 2">
182 - <a href="{:url('order/get_one',array('id'=>$vo['id']))}">  
183 - <div class="myorder_information"> 186 + <div class="myorder_information dom_cancel_order_{$vo.id}" >
184 <!-- 订单 --> 187 <!-- 订单 -->
  188 + <a href="{:url('order/get_one',array('id'=>$vo['id']))}">
185 <div class="myorder_the"> 189 <div class="myorder_the">
186 <p class="order_dan">订单号:{$vo.order_number}</p> 190 <p class="order_dan">订单号:{$vo.order_number}</p>
187 <div class="myorder_state1"> 191 <div class="myorder_state1">
@@ -200,7 +204,7 @@ @@ -200,7 +204,7 @@
200 <foreach name="$vo.indent_goods" item="i_g"> 204 <foreach name="$vo.indent_goods" item="i_g">
201 <li> 205 <li>
202 <div class="order_newsImg"> 206 <div class="order_newsImg">
203 - <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" /> 207 + <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
204 </div> 208 </div>
205 <div class="order_newsCon"> 209 <div class="order_newsCon">
206 <div class="order_newsTxt1 txt-cut"> 210 <div class="order_newsTxt1 txt-cut">
@@ -219,24 +223,27 @@ @@ -219,24 +223,27 @@
219 <p>¥{$vo.money}</p> 223 <p>¥{$vo.money}</p>
220 </div> 224 </div>
221 </ul> 225 </ul>
  226 + </a>
222 <!-- 时间/底部 --> 227 <!-- 时间/底部 -->
223 <div class="myorder_bottom"> 228 <div class="myorder_bottom">
224 <div class="myorder_bottom1"> 229 <div class="myorder_bottom1">
225 <div class="myorder_bottom1Img"> 230 <div class="myorder_bottom1Img">
226 - <img src="__TMPL__/public/assets/images/52.png" alt="" /> 231 + <img src="__TMPL__/public/assets/images/52.png" alt=""/>
227 </div> 232 </div>
228 <p class="myorder_bottom1Txt">{:date('Y-m-d H:i:s',$vo['create_time'])}</p> 233 <p class="myorder_bottom1Txt">{:date('Y-m-d H:i:s',$vo['create_time'])}</p>
229 </div> 234 </div>
230 <div class="myorder_bottom2"> 235 <div class="myorder_bottom2">
231 <if condition="$vo.state eq 4"> 236 <if condition="$vo.state eq 4">
232 - <div class="myorder_bottom2_1">取消订单</div>  
233 - <div class="myorder_bottom2_2">去支付</div> 237 + <div class="myorder_bottom2_1 cancel_order" data-id="{$vo.id}">取消订单</div>
  238 + <a href="{:url('portal/pay/index',array('id'=>$vo['id']))}">
  239 + <div class="myorder_bottom2_2" data-id="{$vo.id}">去支付</div>
  240 + </a>
234 <elseif condition="$vo.state eq 2"/> 241 <elseif condition="$vo.state eq 2"/>
235 <!--<a href="w_Ypayment.html">--> 242 <!--<a href="w_Ypayment.html">-->
236 <!--<div class="myorder_bottom2_2">查看订单</div>--> 243 <!--<div class="myorder_bottom2_2">查看订单</div>-->
237 <!--</a>--> 244 <!--</a>-->
238 <elseif condition="$vo.state eq 5"/> 245 <elseif condition="$vo.state eq 5"/>
239 - <a href="w_logistics.html"> 246 + <a href="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
240 <div class="myorder_bottom2_2">查看物流</div> 247 <div class="myorder_bottom2_2">查看物流</div>
241 </a> 248 </a>
242 <elseif condition="$vo.state eq 3"/> 249 <elseif condition="$vo.state eq 3"/>
@@ -245,7 +252,6 @@ @@ -245,7 +252,6 @@
245 </div> 252 </div>
246 </div> 253 </div>
247 </div> 254 </div>
248 - </a>  
249 </if> 255 </if>
250 </foreach> 256 </foreach>
251 </div> 257 </div>
@@ -253,9 +259,9 @@ @@ -253,9 +259,9 @@
253 <div class="myorder_con1"> 259 <div class="myorder_con1">
254 <foreach name="data" item="vo"> 260 <foreach name="data" item="vo">
255 <if condition="$vo.state eq 5"> 261 <if condition="$vo.state eq 5">
256 - <a href="{:url('order/get_one',array('id'=>$vo['id']))}">  
257 - <div class="myorder_information"> 262 + <div class="myorder_information dom_cancel_order_{$vo.id}" >
258 <!-- 订单 --> 263 <!-- 订单 -->
  264 + <a href="{:url('order/get_one',array('id'=>$vo['id']))}">
259 <div class="myorder_the"> 265 <div class="myorder_the">
260 <p class="order_dan">订单号:{$vo.order_number}</p> 266 <p class="order_dan">订单号:{$vo.order_number}</p>
261 <div class="myorder_state1"> 267 <div class="myorder_state1">
@@ -274,7 +280,7 @@ @@ -274,7 +280,7 @@
274 <foreach name="$vo.indent_goods" item="i_g"> 280 <foreach name="$vo.indent_goods" item="i_g">
275 <li> 281 <li>
276 <div class="order_newsImg"> 282 <div class="order_newsImg">
277 - <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" /> 283 + <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
278 </div> 284 </div>
279 <div class="order_newsCon"> 285 <div class="order_newsCon">
280 <div class="order_newsTxt1 txt-cut"> 286 <div class="order_newsTxt1 txt-cut">
@@ -293,24 +299,27 @@ @@ -293,24 +299,27 @@
293 <p>¥{$vo.money}</p> 299 <p>¥{$vo.money}</p>
294 </div> 300 </div>
295 </ul> 301 </ul>
  302 + </a>
296 <!-- 时间/底部 --> 303 <!-- 时间/底部 -->
297 <div class="myorder_bottom"> 304 <div class="myorder_bottom">
298 <div class="myorder_bottom1"> 305 <div class="myorder_bottom1">
299 <div class="myorder_bottom1Img"> 306 <div class="myorder_bottom1Img">
300 - <img src="__TMPL__/public/assets/images/52.png" alt="" /> 307 + <img src="__TMPL__/public/assets/images/52.png" alt=""/>
301 </div> 308 </div>
302 <p class="myorder_bottom1Txt">{:date('Y-m-d H:i:s',$vo['create_time'])}</p> 309 <p class="myorder_bottom1Txt">{:date('Y-m-d H:i:s',$vo['create_time'])}</p>
303 </div> 310 </div>
304 <div class="myorder_bottom2"> 311 <div class="myorder_bottom2">
305 <if condition="$vo.state eq 4"> 312 <if condition="$vo.state eq 4">
306 - <div class="myorder_bottom2_1">取消订单</div>  
307 - <div class="myorder_bottom2_2">去支付</div> 313 + <div class="myorder_bottom2_1 cancel_order" data-id="{$vo.id}">取消订单</div>
  314 + <a href="{:url('portal/pay/index',array('id'=>$vo['id']))}">
  315 + <div class="myorder_bottom2_2" data-id="{$vo.id}">去支付</div>
  316 + </a>
308 <elseif condition="$vo.state eq 2"/> 317 <elseif condition="$vo.state eq 2"/>
309 <!--<a href="w_Ypayment.html">--> 318 <!--<a href="w_Ypayment.html">-->
310 <!--<div class="myorder_bottom2_2">查看订单</div>--> 319 <!--<div class="myorder_bottom2_2">查看订单</div>-->
311 <!--</a>--> 320 <!--</a>-->
312 <elseif condition="$vo.state eq 5"/> 321 <elseif condition="$vo.state eq 5"/>
313 - <a href="w_logistics.html"> 322 + <a href="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
314 <div class="myorder_bottom2_2">查看物流</div> 323 <div class="myorder_bottom2_2">查看物流</div>
315 </a> 324 </a>
316 <elseif condition="$vo.state eq 3"/> 325 <elseif condition="$vo.state eq 3"/>
@@ -319,7 +328,6 @@ @@ -319,7 +328,6 @@
319 </div> 328 </div>
320 </div> 329 </div>
321 </div> 330 </div>
322 - </a>  
323 </if> 331 </if>
324 </foreach> 332 </foreach>
325 </div> 333 </div>
@@ -327,9 +335,9 @@ @@ -327,9 +335,9 @@
327 <div class="myorder_con1"> 335 <div class="myorder_con1">
328 <foreach name="data" item="vo"> 336 <foreach name="data" item="vo">
329 <if condition="$vo.state eq 3"> 337 <if condition="$vo.state eq 3">
330 - <a href="{:url('order/get_one',array('id'=>$vo['id']))}">  
331 - <div class="myorder_information"> 338 + <div class="myorder_information dom_cancel_order_{$vo.id}" >
332 <!-- 订单 --> 339 <!-- 订单 -->
  340 + <a href="{:url('order/get_one',array('id'=>$vo['id']))}">
333 <div class="myorder_the"> 341 <div class="myorder_the">
334 <p class="order_dan">订单号:{$vo.order_number}</p> 342 <p class="order_dan">订单号:{$vo.order_number}</p>
335 <div class="myorder_state1"> 343 <div class="myorder_state1">
@@ -348,7 +356,7 @@ @@ -348,7 +356,7 @@
348 <foreach name="$vo.indent_goods" item="i_g"> 356 <foreach name="$vo.indent_goods" item="i_g">
349 <li> 357 <li>
350 <div class="order_newsImg"> 358 <div class="order_newsImg">
351 - <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" /> 359 + <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
352 </div> 360 </div>
353 <div class="order_newsCon"> 361 <div class="order_newsCon">
354 <div class="order_newsTxt1 txt-cut"> 362 <div class="order_newsTxt1 txt-cut">
@@ -367,24 +375,27 @@ @@ -367,24 +375,27 @@
367 <p>¥{$vo.money}</p> 375 <p>¥{$vo.money}</p>
368 </div> 376 </div>
369 </ul> 377 </ul>
  378 + </a>
370 <!-- 时间/底部 --> 379 <!-- 时间/底部 -->
371 <div class="myorder_bottom"> 380 <div class="myorder_bottom">
372 <div class="myorder_bottom1"> 381 <div class="myorder_bottom1">
373 <div class="myorder_bottom1Img"> 382 <div class="myorder_bottom1Img">
374 - <img src="__TMPL__/public/assets/images/52.png" alt="" /> 383 + <img src="__TMPL__/public/assets/images/52.png" alt=""/>
375 </div> 384 </div>
376 <p class="myorder_bottom1Txt">{:date('Y-m-d H:i:s',$vo['create_time'])}</p> 385 <p class="myorder_bottom1Txt">{:date('Y-m-d H:i:s',$vo['create_time'])}</p>
377 </div> 386 </div>
378 <div class="myorder_bottom2"> 387 <div class="myorder_bottom2">
379 <if condition="$vo.state eq 4"> 388 <if condition="$vo.state eq 4">
380 - <div class="myorder_bottom2_1">取消订单</div>  
381 - <div class="myorder_bottom2_2">去支付</div> 389 + <div class="myorder_bottom2_1 cancel_order" data-id="{$vo.id}">取消订单</div>
  390 + <a href="{:url('portal/pay/index',array('id'=>$vo['id']))}">
  391 + <div class="myorder_bottom2_2" data-id="{$vo.id}">去支付</div>
  392 + </a>
382 <elseif condition="$vo.state eq 2"/> 393 <elseif condition="$vo.state eq 2"/>
383 <!--<a href="w_Ypayment.html">--> 394 <!--<a href="w_Ypayment.html">-->
384 <!--<div class="myorder_bottom2_2">查看订单</div>--> 395 <!--<div class="myorder_bottom2_2">查看订单</div>-->
385 <!--</a>--> 396 <!--</a>-->
386 <elseif condition="$vo.state eq 5"/> 397 <elseif condition="$vo.state eq 5"/>
387 - <a href="w_logistics.html"> 398 + <a href="{:url('logistics/index',array('indent_id'=>$vo['id']))}">
388 <div class="myorder_bottom2_2">查看物流</div> 399 <div class="myorder_bottom2_2">查看物流</div>
389 </a> 400 </a>
390 <elseif condition="$vo.state eq 3"/> 401 <elseif condition="$vo.state eq 3"/>
@@ -393,23 +404,23 @@ @@ -393,23 +404,23 @@
393 </div> 404 </div>
394 </div> 405 </div>
395 </div> 406 </div>
396 - </a>  
397 </if> 407 </if>
398 </foreach> 408 </foreach>
399 </div> 409 </div>
400 </div> 410 </div>
401 - </div>  
402 - <script src="__TMPL__/public/assets/js/base.js"></script>  
403 - <script src="__TMPL__/public/assets/js/jquery.js"></script>  
404 - <script>  
405 - function load(){ 411 +</div>
  412 +<script src="__TMPL__/public/assets/js/base.js"></script>
  413 +<script src="__TMPL__/public/assets/js/jquery.js"></script>
  414 +<script>
  415 + function load() {
406 var index = $(".myor_title ul li").index($('.myor_title_active')); 416 var index = $(".myor_title ul li").index($('.myor_title_active'));
407 $(".myorder_con1").eq(index).show().siblings().hide(); 417 $(".myorder_con1").eq(index).show().siblings().hide();
408 } 418 }
409 - $(function() { 419 +
  420 + $(function () {
410 load(); 421 load();
411 // myor_title_active 422 // myor_title_active
412 - $(".myor_title ul li").click(function() { 423 + $(".myor_title ul li").click(function () {
413 console.log($(this)); 424 console.log($(this));
414 $(this) 425 $(this)
415 .addClass("myor_title_active") 426 .addClass("myor_title_active")
@@ -422,8 +433,27 @@ @@ -422,8 +433,27 @@
422 .siblings() 433 .siblings()
423 .hide(); 434 .hide();
424 }); 435 });
  436 + $('.cancel_order').click(function () {
  437 + var indent_id = $(this).attr('data-id');
  438 + $.ajax({
  439 + url: "{:url('portal/order/cancel_order')}",
  440 + type: "POST",
  441 + data: {'id': indent_id},
  442 + success: function (data) {
  443 + if (data.code == 1) {
  444 + $('.dom_cancel_order_' + indent_id).remove();
  445 + alert('取消成功!')
  446 + } else {
  447 + alert('出错啦,请稍后再试!')
  448 + }
  449 + },
  450 + error: function (data) {
  451 + alert('与服务器断开连接');
  452 + }
  453 + })
  454 + })
425 }) 455 })
426 - </script> 456 +</script>
427 </body> 457 </body>
428 458
429 </html> 459 </html>
@@ -2,12 +2,12 @@ @@ -2,12 +2,12 @@
2 <html lang="en"> 2 <html lang="en">
3 3
4 <head> 4 <head>
5 - <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />  
6 - <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />  
7 - <meta http-equiv="X-UA-Compatible" content="ie=edge" /> 5 + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
  6 + <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/>
  7 + <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
8 <title>学考无忧</title> 8 <title>学考无忧</title>
9 - <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css" />  
10 - <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css" /> 9 + <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css"/>
  10 + <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css"/>
11 <style> 11 <style>
12 .pay_banner { 12 .pay_banner {
13 width: 100%; 13 width: 100%;
@@ -28,17 +28,17 @@ @@ -28,17 +28,17 @@
28 </head> 28 </head>
29 29
30 <body> 30 <body>
31 - <div class="Dpayment"> 31 +<div class="Dpayment">
32 <!-- 顶部 --> 32 <!-- 顶部 -->
33 <div class="order_top"> 33 <div class="order_top">
34 - <img src="__TMPL__/public/assets/images/left.png" alt="" /> 34 + <img src="__TMPL__/public/assets/images/left.png" alt=""/>
35 <p>我的订单</p> 35 <p>我的订单</p>
36 </div> 36 </div>
37 <!-- 顶部banner --> 37 <!-- 顶部banner -->
38 <div class="pay_banner"> 38 <div class="pay_banner">
39 <div class="pay_bannerLeft"> 39 <div class="pay_bannerLeft">
40 <div class="pay_bannerImg"> 40 <div class="pay_bannerImg">
41 - <img src="__TMPL__/public/assets/images/53.png" alt="" /> 41 + <img src="__TMPL__/public/assets/images/53.png" alt=""/>
42 </div> 42 </div>
43 <p> 43 <p>
44 <if condition="$data.state eq 4"> 44 <if condition="$data.state eq 4">
@@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
59 <a href=""> 59 <a href="">
60 <div class="order_addressYes"> 60 <div class="order_addressYes">
61 <div class="or_addressYesImg1"> 61 <div class="or_addressYesImg1">
62 - <img src="__TMPL__/public/assets/images/38.png" alt="" /> 62 + <img src="__TMPL__/public/assets/images/38.png" alt=""/>
63 </div> 63 </div>
64 <div class="or_addressYesTxt1"> 64 <div class="or_addressYesTxt1">
65 <div class="or_addressYesTxt2"> 65 <div class="or_addressYesTxt2">
@@ -71,7 +71,7 @@ @@ -71,7 +71,7 @@
71 </p> 71 </p>
72 </div> 72 </div>
73 <div class="or_addressYesImg2"> 73 <div class="or_addressYesImg2">
74 - <img src="__TMPL__/public/assets/images/29.png" alt="" /> 74 + <img src="__TMPL__/public/assets/images/29.png" alt=""/>
75 </div> 75 </div>
76 </div> 76 </div>
77 </a> 77 </a>
@@ -83,7 +83,7 @@ @@ -83,7 +83,7 @@
83 <foreach name="$data.indent_goods" item="i_g"> 83 <foreach name="$data.indent_goods" item="i_g">
84 <li> 84 <li>
85 <div class="order_newsImg"> 85 <div class="order_newsImg">
86 - <img src="{:cmf_get_image_url($i_g['thumbnail'])}" alt="" /> 86 + <img src="{:cmf_get_image_url($i_g['thumbnail'])}" alt=""/>
87 </div> 87 </div>
88 <div class="order_newsCon"> 88 <div class="order_newsCon">
89 <div class="order_newsTxt1 txt-cut"> 89 <div class="order_newsTxt1 txt-cut">
@@ -125,16 +125,48 @@ @@ -125,16 +125,48 @@
125 <p class="de_topTxt1_1"><span>{$data.money}</span></p> 125 <p class="de_topTxt1_1"><span>{$data.money}</span></p>
126 </div> 126 </div>
127 <!-- 底部 --> 127 <!-- 底部 -->
  128 +
128 <div class="pay_bottom"> 129 <div class="pay_bottom">
129 <div class="pay_bottom2"> 130 <div class="pay_bottom2">
130 - <a href="w_logistics.html"> 131 + <if condition="$data.state eq 5">
  132 + <a href="{:url('logistics/index',array('indent_id'=>$data['id']))}">
131 <div class="pay_bottom2_1">物流信息</div> 133 <div class="pay_bottom2_1">物流信息</div>
132 </a> 134 </a>
  135 + <elseif condition="$data.state eq 5 || $data.state eq 3 || $data.state eq 2"/>
133 <div class="pay_bottom2_2">售后咨询</div> 136 <div class="pay_bottom2_2">售后咨询</div>
  137 + <elseif condition="$data.state eq 4"/>
  138 + <div class="myorder_bottom2_1 cancel_order" data-id="{$data.id}">取消订单</div>
  139 + <a href="{:url('portal/pay/index',array('id'=>$data['id']))}">
  140 + <div class="myorder_bottom2_2">去支付</div>
  141 + </a>
  142 + </if>
134 </div> 143 </div>
135 </div> 144 </div>
136 - </div>  
137 - <script src="__TMPL__/public/assets/js/base.js"></script> 145 +</div>
  146 +<script src="__TMPL__/public/assets/js/base.js"></script>
  147 +<script src="__TMPL__/public/assets/js/jquery.js"></script>
138 </body> 148 </body>
139 - 149 +<script>
  150 + $(function () {
  151 + $('.cancel_order').click(function () {
  152 + var indent_id = $(this).attr('data-id');
  153 + $.ajax({
  154 + url: "{:url('portal/order/cancel_order')}",
  155 + type: "POST",
  156 + data: {'id': indent_id},
  157 + success: function (data) {
  158 + if(data.code==1){
  159 + alert('取消成功!')
  160 + window.location.href = "{:url('portal/order/get_all')}";
  161 + }else{
  162 + alert('出错啦,请稍后再试!')
  163 + }
  164 + },
  165 + error: function (data) {
  166 + alert('与服务器断开连接');
  167 + }
  168 + })
  169 + })
  170 + })
  171 +</script>
140 </html> 172 </html>