正在显示
2 个修改的文件
包含
38 行增加
和
2 行删除
@@ -290,4 +290,19 @@ class CenterController extends HomeBaseController | @@ -290,4 +290,19 @@ class CenterController extends HomeBaseController | ||
290 | ]); | 290 | ]); |
291 | } | 291 | } |
292 | 292 | ||
293 | + //确认收货 | ||
294 | + public function confirm() { | ||
295 | + $request = request(); | ||
296 | + if($request->isAjax()) { | ||
297 | + $data = [ | ||
298 | + 'id' => $request->param('oid'), | ||
299 | + 'step' => 5, | ||
300 | + 'end_time' => time() | ||
301 | + ]; | ||
302 | + if(Db::name('zj_order')->update($data)) { | ||
303 | + $this->success('', '', true); | ||
304 | + } | ||
305 | + } | ||
306 | + } | ||
307 | + | ||
293 | } | 308 | } |
@@ -101,7 +101,7 @@ | @@ -101,7 +101,7 @@ | ||
101 | <if condition="$vo['step'] eq '3'"> | 101 | <if condition="$vo['step'] eq '3'"> |
102 | <div class="unpay"> | 102 | <div class="unpay"> |
103 | <a href="{:url('user/Center/tracking',['oid'=>$vo['id']])}"><p class="tracking">物流跟踪</p></a> | 103 | <a href="{:url('user/Center/tracking',['oid'=>$vo['id']])}"><p class="tracking">物流跟踪</p></a> |
104 | - <p class="confirm">确认收货</p> | 104 | + <p class="confirm" data-id="{$vo.id}">确认收货</p> |
105 | </div> | 105 | </div> |
106 | </if> | 106 | </if> |
107 | <if condition="$vo['step'] eq '5'"> | 107 | <if condition="$vo['step'] eq '5'"> |
@@ -223,7 +223,7 @@ | @@ -223,7 +223,7 @@ | ||
223 | </div> | 223 | </div> |
224 | <div class="unpay"> | 224 | <div class="unpay"> |
225 | <a href="{:url('user/Center/tracking',['oid'=>$vo['id']])}"><p class="tracking">物流跟踪</p></a> | 225 | <a href="{:url('user/Center/tracking',['oid'=>$vo['id']])}"><p class="tracking">物流跟踪</p></a> |
226 | - <p class="confirm">确认收货</p> | 226 | + <p class="confirm" data-id="{$vo.id}">确认收货</p> |
227 | </div> | 227 | </div> |
228 | </div> | 228 | </div> |
229 | </volist> | 229 | </volist> |
@@ -400,6 +400,27 @@ | @@ -400,6 +400,27 @@ | ||
400 | }) | 400 | }) |
401 | }) | 401 | }) |
402 | 402 | ||
403 | + $(".confirm").click(function () { | ||
404 | + if(!window.confirm('是否确认收货?')) { | ||
405 | + return false; | ||
406 | + }else { | ||
407 | + $.ajax({ | ||
408 | + url:"{:url('user/Center/confirm')}", | ||
409 | + data:{ | ||
410 | + oid:$(this).attr('data-id') | ||
411 | + }, | ||
412 | + type:"POST", | ||
413 | + dataType:"JSON", | ||
414 | + | ||
415 | + success: function (data) { | ||
416 | + if(data.data === true) { | ||
417 | + window.location.reload(); | ||
418 | + } | ||
419 | + } | ||
420 | + }) | ||
421 | + } | ||
422 | + }) | ||
423 | + | ||
403 | wx.config({ | 424 | wx.config({ |
404 | debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 | 425 | debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 |
405 | appId: '{$js_sdk.appId}', // 必填,公众号的唯一标识 | 426 | appId: '{$js_sdk.appId}', // 必填,公众号的唯一标识 |
-
请 注册 或 登录 后发表评论