正在显示
8 个修改的文件
包含
103 行增加
和
54 行删除
@@ -18,6 +18,14 @@ class Car extends Frontend | @@ -18,6 +18,14 @@ class Car extends Frontend | ||
18 | protected $noNeedLogin = ['']; | 18 | protected $noNeedLogin = ['']; |
19 | protected $noNeedRight = ['*']; | 19 | protected $noNeedRight = ['*']; |
20 | 20 | ||
21 | + public function _initialize() | ||
22 | + { | ||
23 | + parent::_initialize(); // TODO: Change the autogenerated stub | ||
24 | + $this->view->assign('is_search', 0); | ||
25 | + $this->view->assign('is_active', 0); | ||
26 | + $this->view->assign('title', '购物车'); | ||
27 | + } | ||
28 | + | ||
21 | /** | 29 | /** |
22 | * 购物车页面 | 30 | * 购物车页面 |
23 | * @return mixed | 31 | * @return mixed |
@@ -33,12 +33,12 @@ class Order extends Frontend | @@ -33,12 +33,12 @@ class Order extends Frontend | ||
33 | public function confirm(){ | 33 | public function confirm(){ |
34 | $user_id = $this->auth->id; | 34 | $user_id = $this->auth->id; |
35 | // $car_ids = $this->request->param('car_ids'); | 35 | // $car_ids = $this->request->param('car_ids'); |
36 | - $data = $this->request->param('data'); | 36 | + $car_data = $this->request->param('data'); |
37 | $province_id = $this->request->param('province_id',0,'intval'); | 37 | $province_id = $this->request->param('province_id',0,'intval'); |
38 | - if(empty($data) || empty($province_id)){ | 38 | + if(empty($car_data) || empty($province_id)){ |
39 | $this->error('缺少必要参数'); | 39 | $this->error('缺少必要参数'); |
40 | } | 40 | } |
41 | - $data = json_decode($data,true); | 41 | +// $data = json_decode($data,true); |
42 | /*if(!empty($car_ids)){ | 42 | /*if(!empty($car_ids)){ |
43 | $car_ids = explode(',',$car_ids); | 43 | $car_ids = explode(',',$car_ids); |
44 | $carModel = new \app\index\model\Car(); | 44 | $carModel = new \app\index\model\Car(); |
@@ -47,6 +47,8 @@ class Order extends Frontend | @@ -47,6 +47,8 @@ class Order extends Frontend | ||
47 | $this->error('sql执行失败'); | 47 | $this->error('sql执行失败'); |
48 | } | 48 | } |
49 | }*/ | 49 | }*/ |
50 | + $car_model = new \app\index\model\Car(); | ||
51 | + $data = $car_model->field('id,store_id,goods_id,number')->whereIn('id',$car_data)->select(); | ||
50 | $goodsModel = new \app\index\model\Goods(); | 52 | $goodsModel = new \app\index\model\Goods(); |
51 | $goods_price = []; | 53 | $goods_price = []; |
52 | $store_ids = []; | 54 | $store_ids = []; |
@@ -123,7 +125,8 @@ class Order extends Frontend | @@ -123,7 +125,8 @@ class Order extends Frontend | ||
123 | $this->assign('goods_total',$goods_total1); | 125 | $this->assign('goods_total',$goods_total1); |
124 | $this->assign('postage_total',$postage_total1); | 126 | $this->assign('postage_total',$postage_total1); |
125 | $this->assign('address',$address); | 127 | $this->assign('address',$address); |
126 | - $this->assign('data',json_encode($data)); | 128 | +// $this->assign('data',json_encode($data)); |
129 | + $this->assign('data',$car_data); | ||
127 | $this->assign('province_id',$province_id); | 130 | $this->assign('province_id',$province_id); |
128 | $this->assign('title','确认订单'); | 131 | $this->assign('title','确认订单'); |
129 | return $this->fetch(); | 132 | return $this->fetch(); |
@@ -227,7 +230,7 @@ class Order extends Frontend | @@ -227,7 +230,7 @@ class Order extends Frontend | ||
227 | $express = $this->request->param('express',0,'intval'); | 230 | $express = $this->request->param('express',0,'intval'); |
228 | $address_id = $this->request->param('address_id',0,'intval'); | 231 | $address_id = $this->request->param('address_id',0,'intval'); |
229 | $pay_type = $this->request->param('pay_type',0,'intval'); | 232 | $pay_type = $this->request->param('pay_type',0,'intval'); |
230 | - $car_ids = $this->request->param('car_ids'); | 233 | + $car_ids = $this->request->param('data'); |
231 | $province_id = $this->request->param('province_id',0,'intval'); | 234 | $province_id = $this->request->param('province_id',0,'intval'); |
232 | if(empty($data) || empty($express) || empty($pay_type) || empty($province_id)){ | 235 | if(empty($data) || empty($express) || empty($pay_type) || empty($province_id)){ |
233 | $this->error('缺少必要参数'); | 236 | $this->error('缺少必要参数'); |
@@ -239,12 +242,14 @@ class Order extends Frontend | @@ -239,12 +242,14 @@ class Order extends Frontend | ||
239 | $addressModel = new Address(); | 242 | $addressModel = new Address(); |
240 | $address = $addressModel->findData(['id'=>$address_id]); | 243 | $address = $addressModel->findData(['id'=>$address_id]); |
241 | } | 244 | } |
242 | - $data = json_decode($data,true); | 245 | + $car_model = new \app\index\model\Car(); |
246 | + $data = $car_model->field('id,store_id,goods_id,number')->whereIn('id',$car_ids)->select(); | ||
247 | +// $data = json_decode($data,true); | ||
243 | Db::startTrans(); | 248 | Db::startTrans(); |
244 | if(!empty($car_ids)){ | 249 | if(!empty($car_ids)){ |
245 | $car_ids = explode(',',$car_ids); | 250 | $car_ids = explode(',',$car_ids); |
246 | $carModel = new \app\index\model\Car(); | 251 | $carModel = new \app\index\model\Car(); |
247 | - $result = $carModel->where(['id'=>$car_ids])->delete(); | 252 | + $result = $carModel->whereIn('id',$car_ids)->delete(); |
248 | if(empty($result)){ | 253 | if(empty($result)){ |
249 | $this->error('sql执行失败'); | 254 | $this->error('sql执行失败'); |
250 | } | 255 | } |
@@ -158,7 +158,7 @@ | @@ -158,7 +158,7 @@ | ||
158 | 158 | ||
159 | } | 159 | } |
160 | .content .shopListBox .shopBox ul li .commodityNameBox{ | 160 | .content .shopListBox .shopBox ul li .commodityNameBox{ |
161 | - width: 416px; | 161 | + width: 412px; |
162 | height: 100%; | 162 | height: 100%; |
163 | } | 163 | } |
164 | .content .shopListBox .shopBox ul li .commodityNameBox p{ | 164 | .content .shopListBox .shopBox ul li .commodityNameBox p{ |
@@ -284,16 +284,7 @@ | @@ -284,16 +284,7 @@ | ||
284 | {include file="public/header"/} | 284 | {include file="public/header"/} |
285 | <!--主要内容--> | 285 | <!--主要内容--> |
286 | <div class="content"> | 286 | <div class="content"> |
287 | - <div class="navBarBox"> | ||
288 | - <ul> | ||
289 | - <li><a href="{:url('index/index')}">首页</a></li> | ||
290 | - <li><a href="{:url('goods/index')}">采购中心</a></li> | ||
291 | - <li><a href="">帮买服务</a></li> | ||
292 | - <li><a href="">产品维修</a></li> | ||
293 | - <li><a href="">关于我们</a></li> | ||
294 | - </ul> | ||
295 | - </div> | ||
296 | - | 287 | + {include file="public/nav"} |
297 | <div class="shoppingCartBox"> | 288 | <div class="shoppingCartBox"> |
298 | <!--购物车头部部分--> | 289 | <!--购物车头部部分--> |
299 | <div class="shoppingCartTitleBox"> | 290 | <div class="shoppingCartTitleBox"> |
@@ -338,7 +329,7 @@ | @@ -338,7 +329,7 @@ | ||
338 | <ul> | 329 | <ul> |
339 | {foreach name="$vo.car" item="c"} | 330 | {foreach name="$vo.car" item="c"} |
340 | <li> | 331 | <li> |
341 | - <div class="radioBox"><input class="commodityCheck" type="checkbox" data-goods_id="{$c.goods_id}" data-number="{$c.number}" value="{$c.id}"></div> | 332 | + <div class="radioBox"><input class="commodityCheck" type="checkbox" data-car_id="{$c.id}" data-goods_id="{$c.goods_id}" data-number="{$c.number}" value="{$c.id}"></div> |
342 | <div class="borderBox"> | 333 | <div class="borderBox"> |
343 | <div class="imgBox"> | 334 | <div class="imgBox"> |
344 | <img src="{$c.goods.thumbnail}" alt="img"> | 335 | <img src="{$c.goods.thumbnail}" alt="img"> |
@@ -443,16 +434,20 @@ | @@ -443,16 +434,20 @@ | ||
443 | } | 434 | } |
444 | var data = []; | 435 | var data = []; |
445 | for(var i=0;i<$("input[class='commodityCheck']:checked").length;i++){ | 436 | for(var i=0;i<$("input[class='commodityCheck']:checked").length;i++){ |
446 | - var obj = {}; | ||
447 | - var goods_id = $("input[class='commodityCheck']:checked").eq(i).attr('data-goods_id'); | ||
448 | - var number = $("input[class='commodityCheck']:checked").eq(i).attr('data-number'); | ||
449 | - obj.goods_id = goods_id; | ||
450 | - obj.number = number; | ||
451 | - data.push(obj); | 437 | + // var obj = {}; |
438 | + // var goods_id = $("input[class='commodityCheck']:checked").eq(i).attr('data-goods_id'); | ||
439 | + // var number = $("input[class='commodityCheck']:checked").eq(i).attr('data-number'); | ||
440 | + // obj.goods_id = goods_id; | ||
441 | + // obj.number = number; | ||
442 | + // data.push(obj); | ||
443 | + var car_id = $("input[class='commodityCheck']:checked").eq(i).attr('data-car_id'); | ||
444 | + data.push(car_id); | ||
452 | } | 445 | } |
453 | - data = JSON.stringify(data); | 446 | + // data = JSON.stringify(data); |
454 | var str = "{:url('index/order/confirm',array('data'=>'DATA','province_id'=>'PROVINCE_ID'))}"; | 447 | var str = "{:url('index/order/confirm',array('data'=>'DATA','province_id'=>'PROVINCE_ID'))}"; |
455 | - window.location.href = str.replace("DATA",data).replace("PROVINCE_ID",province_id); | 448 | + // window.location.href = str.replace("DATA",data).replace("PROVINCE_ID",province_id); |
449 | + var car_ids = data.join(','); | ||
450 | + window.location.href = str.replace("DATA",car_ids).replace("PROVINCE_ID",province_id); | ||
456 | } | 451 | } |
457 | 452 | ||
458 | //单个删除按钮 | 453 | //单个删除按钮 |
@@ -688,11 +683,9 @@ | @@ -688,11 +683,9 @@ | ||
688 | totalPrice -= totalFreight; | 683 | totalPrice -= totalFreight; |
689 | } | 684 | } |
690 | } | 685 | } |
691 | - | ||
692 | $('#totalCount').html(totalCount.toFixed(0)); | 686 | $('#totalCount').html(totalCount.toFixed(0)); |
693 | $('#totalPrice').html(totalPrice.toFixed(2)); | 687 | $('#totalPrice').html(totalPrice.toFixed(2)); |
694 | } | 688 | } |
695 | - | ||
696 | </script> | 689 | </script> |
697 | </body> | 690 | </body> |
698 | </html> | 691 | </html> |
@@ -547,16 +547,7 @@ | @@ -547,16 +547,7 @@ | ||
547 | {include file="public/header"/} | 547 | {include file="public/header"/} |
548 | <!--主要内容--> | 548 | <!--主要内容--> |
549 | <div class="content"> | 549 | <div class="content"> |
550 | - <div class="navBarBox"> | ||
551 | - <ul> | ||
552 | - <li><a href="{:url('index/index/index')}">首页</a></li> | ||
553 | - <li><a href="{:url('index/goods/index')}">采购中心</a></li> | ||
554 | - <li><a href="">帮买服务</a></li> | ||
555 | - <li><a href="">产品维修</a></li> | ||
556 | - <li><a href="">关于我们</a></li> | ||
557 | - </ul> | ||
558 | - </div> | ||
559 | - | 550 | + {include file="public/nav"} |
560 | <!--面包屑--> | 551 | <!--面包屑--> |
561 | <div class="crumbsBox"> | 552 | <div class="crumbsBox"> |
562 | <div class="crumbsMain"> | 553 | <div class="crumbsMain"> |
@@ -324,15 +324,7 @@ | @@ -324,15 +324,7 @@ | ||
324 | {include file="public/header"/} | 324 | {include file="public/header"/} |
325 | <!--主要内容--> | 325 | <!--主要内容--> |
326 | <div class="content"> | 326 | <div class="content"> |
327 | - <div class="navBarBox"> | ||
328 | - <ul> | ||
329 | - <li><a href="{:url('index/index/index')}">首页</a></li> | ||
330 | - <li class="active"><a href="{:url('index/goods/index')}">采购中心</a></li> | ||
331 | - <li><a href="">帮买服务</a></li> | ||
332 | - <li><a href="">产品维修</a></li> | ||
333 | - <li><a href="">关于我们</a></li> | ||
334 | - </ul> | ||
335 | - </div> | 327 | + {include file="public/nav"} |
336 | <!--轮播图--> | 328 | <!--轮播图--> |
337 | <div class="bannerBox"> | 329 | <div class="bannerBox"> |
338 | <div id="banner-container" class="swiper-container"> | 330 | <div id="banner-container" class="swiper-container"> |
@@ -418,7 +418,7 @@ | @@ -418,7 +418,7 @@ | ||
418 | <div class="bestSellersList goods_dom"> | 418 | <div class="bestSellersList goods_dom"> |
419 | {foreach name="$goods" item="g"} | 419 | {foreach name="$goods" item="g"} |
420 | <div class="commodityBox"> | 420 | <div class="commodityBox"> |
421 | - <a href="{:url('index/goods/detail',array('goods_id'=>$g.id))}"> | 421 | + <a href="{:url('index/goods/detail',array('goods_id'=>$g.id))}" target="_blank"> |
422 | <div class="imgBox"> | 422 | <div class="imgBox"> |
423 | <img src="{$g.thumbnail}" alt="img"> | 423 | <img src="{$g.thumbnail}" alt="img"> |
424 | <span>{$g.store_name}</span> | 424 | <span>{$g.store_name}</span> |
@@ -506,7 +506,7 @@ | @@ -506,7 +506,7 @@ | ||
506 | var clearance_goods_html = ""; | 506 | var clearance_goods_html = ""; |
507 | $(res.data).each(function (key, vo) { | 507 | $(res.data).each(function (key, vo) { |
508 | var str = "<div class=\"swiper-slide\">\n" + | 508 | var str = "<div class=\"swiper-slide\">\n" + |
509 | - " <a href=\"{:url('index/goods/detail',array('goods_id'=>'GOODS_ID'))}\">\n" + | 509 | + " <a href=\"{:url('index/goods/detail',array('goods_id'=>'GOODS_ID'))}\" target='_blank'>\n" + |
510 | " <img src=\""+vo.thumbnail+"\" alt=\"img\">\n" + | 510 | " <img src=\""+vo.thumbnail+"\" alt=\"img\">\n" + |
511 | " <p class=\"commodityTitle\">"+vo.goodsname+"</p>\n" + | 511 | " <p class=\"commodityTitle\">"+vo.goodsname+"</p>\n" + |
512 | " <div class=\"priceBox\">\n" + | 512 | " <div class=\"priceBox\">\n" + |
@@ -553,7 +553,7 @@ | @@ -553,7 +553,7 @@ | ||
553 | insurance = "<img class=\"insurance_icon\" src=\"__CDN__/assets/store/images/insurance_icon.png\" alt=\"img\">" | 553 | insurance = "<img class=\"insurance_icon\" src=\"__CDN__/assets/store/images/insurance_icon.png\" alt=\"img\">" |
554 | } | 554 | } |
555 | var str = "<div class=\"commodityBox\">\n" + | 555 | var str = "<div class=\"commodityBox\">\n" + |
556 | - " <a href=\"{:url('index/goods/detail',array('goods_id'=>'GOODS_ID'))}\">\n" + | 556 | + " <a href=\"{:url('index/goods/detail',array('goods_id'=>'GOODS_ID'))}\" target='_blank'>\n" + |
557 | " <div class=\"imgBox\">\n" + | 557 | " <div class=\"imgBox\">\n" + |
558 | " <img src=\""+vo.thumbnail+"\" alt=\"img\">\n" + | 558 | " <img src=\""+vo.thumbnail+"\" alt=\"img\">\n" + |
559 | " <span>"+vo.store_name+"</span>\n" + | 559 | " <span>"+vo.store_name+"</span>\n" + |
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <html lang="zh"> | 2 | <html lang="zh"> |
3 | {include file="public/head"} | 3 | {include file="public/head"} |
4 | +<!--图片上传--> | ||
5 | +<script type="text/javascript" src="__CDN__/assets/store/js/fileupLoad/imgFileupload.js"></script> | ||
6 | +<link rel="stylesheet" href="__CDN__/assets/store/js/fileupLoad/imgFileupload.css"> | ||
7 | +<!--swiper引入--> | ||
8 | +<link rel="stylesheet" href="__CDN__/assets/store/js/Swiper-3.4.2/css/swiper.min.css"> | ||
9 | +<script type="text/javascript" src="__CDN__/assets/store/js/Swiper-3.4.2/js/swiper.min.js"></script> | ||
4 | <style> | 10 | <style> |
5 | li{ | 11 | li{ |
6 | list-style-type: none; | 12 | list-style-type: none; |
@@ -73,10 +79,14 @@ | @@ -73,10 +79,14 @@ | ||
73 | -webkit-background-size: 26px; | 79 | -webkit-background-size: 26px; |
74 | } | 80 | } |
75 | .swiper-button-next, .swiper-container-rtl .swiper-button-prev{ | 81 | .swiper-button-next, .swiper-container-rtl .swiper-button-prev{ |
76 | - background-image: url("images/right_icon.png"); | 82 | + background-image: url("/assets/store/images/right_icon.png"); |
77 | } | 83 | } |
78 | .swiper-button-prev, .swiper-container-rtl .swiper-button-next{ | 84 | .swiper-button-prev, .swiper-container-rtl .swiper-button-next{ |
79 | - background-image: url("images/left_icon.png"); | 85 | + background-image: url("/assets/store/images/left_icon.png"); |
86 | + } | ||
87 | + .swiper-slide img { | ||
88 | + width: 175px; | ||
89 | + height: 175px; | ||
80 | } | 90 | } |
81 | 91 | ||
82 | /*title样式*/ | 92 | /*title样式*/ |
@@ -381,7 +391,6 @@ | @@ -381,7 +391,6 @@ | ||
381 | {include file="public/footer"} | 391 | {include file="public/footer"} |
382 | <script> | 392 | <script> |
383 | $(function () { | 393 | $(function () { |
384 | - getPersonalIntroduction(); | ||
385 | initSwiper(); | 394 | initSwiper(); |
386 | initUploadImg(); | 395 | initUploadImg(); |
387 | }); | 396 | }); |
public/assets/js/backend/link.js
0 → 100644
1 | +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { | ||
2 | + | ||
3 | + var Controller = { | ||
4 | + index: function () { | ||
5 | + // 初始化表格参数配置 | ||
6 | + Table.api.init({ | ||
7 | + extend: { | ||
8 | + index_url: 'link/index' + location.search, | ||
9 | + add_url: 'link/add', | ||
10 | + edit_url: 'link/edit', | ||
11 | + del_url: 'link/del', | ||
12 | + table: 'link', | ||
13 | + } | ||
14 | + }); | ||
15 | + | ||
16 | + var table = $("#table"); | ||
17 | + | ||
18 | + // 初始化表格 | ||
19 | + table.bootstrapTable({ | ||
20 | + url: $.fn.bootstrapTable.defaults.extend.index_url, | ||
21 | + pk: 'id', | ||
22 | + sortName: 'id', | ||
23 | + columns: [ | ||
24 | + [ | ||
25 | + {checkbox: true}, | ||
26 | + {field: 'id', title: __('Id')}, | ||
27 | + {field: 'name', title: __('Name')}, | ||
28 | + {field: 'href', title: __('Href'),formatter: Table.api.formatter.url}, | ||
29 | + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, | ||
30 | + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} | ||
31 | + ] | ||
32 | + ] | ||
33 | + }); | ||
34 | + | ||
35 | + // 为表格绑定事件 | ||
36 | + Table.api.bindevent(table); | ||
37 | + }, | ||
38 | + add: function () { | ||
39 | + Controller.api.bindevent(); | ||
40 | + }, | ||
41 | + edit: function () { | ||
42 | + Controller.api.bindevent(); | ||
43 | + }, | ||
44 | + api: { | ||
45 | + bindevent: function () { | ||
46 | + Form.api.bindevent($("form[role=form]")); | ||
47 | + } | ||
48 | + } | ||
49 | + }; | ||
50 | + return Controller; | ||
51 | +}); |
-
请 注册 或 登录 后发表评论