正在显示
15 个修改的文件
包含
1303 行增加
和
248 行删除
app/portal/controller/AddressController.php
0 → 100644
1 | +<?php | ||
2 | +// +---------------------------------------------------------------------- | ||
3 | +// | bronet [ 以客户为中心 以奋斗者为本 ] | ||
4 | +// +---------------------------------------------------------------------- | ||
5 | +// | Copyright (c) 2013-2017 http://www.bronet.cn All rights reserved. | ||
6 | +// +---------------------------------------------------------------------- | ||
7 | +// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) | ||
8 | +// +---------------------------------------------------------------------- | ||
9 | +namespace app\portal\controller; | ||
10 | + | ||
11 | +use app\portal\model\ShoppingModel; | ||
12 | +use cmf\controller\HomeBaseController; | ||
13 | +use EasyWeChat\Foundation\Application; | ||
14 | +use think\Db; | ||
15 | +use think\Session; | ||
16 | + | ||
17 | +//地址 | ||
18 | +class AddressController extends CommentController | ||
19 | +{ | ||
20 | +// 地址列表 | ||
21 | + public function index(){ | ||
22 | + $where_address['user_id'] = Session::get('uid'); | ||
23 | + $where_address['status'] = array('neq',9); | ||
24 | + $address = Db::name('Address')->where($where_address)->order('is_check desc,create_time desc')->select()->toArray(); | ||
25 | + $this->assign('list',$address); | ||
26 | + return $this->fetch(); | ||
27 | + } | ||
28 | + // 添加地址 | ||
29 | + public function add(){ | ||
30 | + $data = $this->request->param(); | ||
31 | + if($this->request->isPost()){ | ||
32 | + $add = $data; | ||
33 | + $add['user_id'] = Session::get('uid'); | ||
34 | + $add['create_time'] = time(); | ||
35 | + $add['update_time'] = time(); | ||
36 | + $res = Db::name('Address')->insertGetId($add); | ||
37 | + if($res){ | ||
38 | + $this->apiResponse('1','添加成功'); | ||
39 | + }else{ | ||
40 | + $this->apiResponse('0','添加失败'); | ||
41 | + } | ||
42 | + }else{ | ||
43 | + return $this->fetch(); | ||
44 | + } | ||
45 | + } | ||
46 | + | ||
47 | + // 修改地址 | ||
48 | + public function edit(){ | ||
49 | + $data = $this->request->param(); | ||
50 | + $where_find['id'] = $data['id']; | ||
51 | + $where_find['status'] = array('neq',9); | ||
52 | + $address = Db::name('Address')->where($where_find)->find(); | ||
53 | + $this->assign('list',$address); | ||
54 | + if($this->request->isPost()){ | ||
55 | + $where_up['user_id'] = Session::get('uid'); | ||
56 | + $where_up['id'] = $address['id']; | ||
57 | + $add = $data; | ||
58 | + $add['update_time'] = time(); | ||
59 | + $res = Db::name('Address')->where($where_up)->update($add); | ||
60 | + if($res){ | ||
61 | + $this->apiResponse('1','修改成功'); | ||
62 | + }else{ | ||
63 | + $this->apiResponse('0','添加失败'); | ||
64 | + } | ||
65 | + }else{ | ||
66 | + | ||
67 | + return $this->fetch(); | ||
68 | + } | ||
69 | + } | ||
70 | + | ||
71 | +// 默认地址 | ||
72 | + public function isCheck(){ | ||
73 | + $data = $this->request->param(); | ||
74 | + $user_id = Session::get('uid'); | ||
75 | + $where_find['user_id'] = $user_id; | ||
76 | + $where_find['status'] = array('neq',9); | ||
77 | + $up_find['is_check'] = 0; | ||
78 | + $up_find['update_time'] = time(); | ||
79 | + $find = Db::name('Address')->where($where_find)->update($up_find); | ||
80 | + if($find){ | ||
81 | + $where_check['id'] = $data['address_id']; | ||
82 | + $where_check['user_id'] = $user_id; | ||
83 | + $where_check['status'] = array('neq',9); | ||
84 | + $up_check['is_check'] = 1; | ||
85 | + $up_check['update_time'] = time(); | ||
86 | + $res = Db::name('Address')->where($where_check)->update($up_check); | ||
87 | + if($res){ | ||
88 | + $this->apiResponse('1','成功'); | ||
89 | + }else{ | ||
90 | + $this->apiResponse('0','失败'); | ||
91 | + } | ||
92 | + } | ||
93 | + } | ||
94 | +// 地址删除 | ||
95 | + public function del(){ | ||
96 | + $data = $this->request->param(); | ||
97 | + $where_find['id'] = $data['id']; | ||
98 | + $where_find['user_id'] = Session::get('uid'); | ||
99 | + $where_find['status'] = array('neq',9); | ||
100 | + $update['status'] = 9; | ||
101 | + $update['update_time'] = time(); | ||
102 | + $address = Db::name('Address')->where($where_find)->update($update); | ||
103 | + if($address){ | ||
104 | + $this->apiResponse('1','删除成功'); | ||
105 | + }else{ | ||
106 | + $this->apiResponse('0','删除失败'); | ||
107 | + } | ||
108 | + } | ||
109 | +} |
@@ -96,7 +96,21 @@ class RentController extends CommentController | @@ -96,7 +96,21 @@ class RentController extends CommentController | ||
96 | return $this->fetch('Rent/detail'); | 96 | return $this->fetch('Rent/detail'); |
97 | } | 97 | } |
98 | 98 | ||
99 | -// 买商品详情 | 99 | +// 租车确认 |
100 | + public function rentSure(){ | ||
101 | +// 时间处理 | ||
102 | + $start_time = Session::get('start_time'); | ||
103 | + $end_time = Session::get('end_time'); | ||
104 | + $middle_start = empty($start_time)?time():strtotime(Session::get('start_time')); | ||
105 | + $middle_end = empty($end_time)?time():strtotime(Session::get('end_time')); | ||
106 | + $time['start_time'] = date('Y-m-d',$middle_start); | ||
107 | + $time['end_time'] = date('Y-m-d',$middle_end); | ||
108 | + $time['time_num'] = ceil((strtotime($time['end_time']) - strtotime($time['start_time']))/86400)+1; | ||
109 | + $this->assign('time',$time); | ||
110 | + return $this->fetch('Rent/rent_sure'); | ||
111 | + } | ||
112 | + | ||
113 | + // 买商品详情 | ||
100 | public function vehicleDetail() | 114 | public function vehicleDetail() |
101 | { | 115 | { |
102 | $data = $this->request->param(); | 116 | $data = $this->request->param(); |
@@ -120,14 +134,18 @@ class RentController extends CommentController | @@ -120,14 +134,18 @@ class RentController extends CommentController | ||
120 | // 购物车 | 134 | // 购物车 |
121 | $where_shopping['user_id'] = Session::get('uid'); | 135 | $where_shopping['user_id'] = Session::get('uid'); |
122 | $where_shopping['status'] = array('neq',9); | 136 | $where_shopping['status'] = array('neq',9); |
123 | - $cart = Db::name('Shopping')->where($where_shopping)->count(); | ||
124 | - $this->assign('cart',$cart); | 137 | + $cart = Db::name('Shopping')->where($where_shopping)->field('num')->select()->toArray(); |
138 | + $count_shopping = 0; | ||
139 | + foreach ($cart as $ck=>$cv){ | ||
140 | + $count_shopping += $cv['num']; | ||
141 | + } | ||
142 | + $this->assign('cart',$count_shopping); | ||
125 | return $this->fetch('Rent/buy_detail'); | 143 | return $this->fetch('Rent/buy_detail'); |
126 | } | 144 | } |
127 | 145 | ||
128 | 146 | ||
129 | -// 租车确认 | ||
130 | - public function rentSure(){ | 147 | + // 租车确认 |
148 | + public function buySure(){ | ||
131 | // 时间处理 | 149 | // 时间处理 |
132 | $start_time = Session::get('start_time'); | 150 | $start_time = Session::get('start_time'); |
133 | $end_time = Session::get('end_time'); | 151 | $end_time = Session::get('end_time'); |
@@ -137,7 +155,7 @@ class RentController extends CommentController | @@ -137,7 +155,7 @@ class RentController extends CommentController | ||
137 | $time['end_time'] = date('Y-m-d',$middle_end); | 155 | $time['end_time'] = date('Y-m-d',$middle_end); |
138 | $time['time_num'] = ceil((strtotime($time['end_time']) - strtotime($time['start_time']))/86400)+1; | 156 | $time['time_num'] = ceil((strtotime($time['end_time']) - strtotime($time['start_time']))/86400)+1; |
139 | $this->assign('time',$time); | 157 | $this->assign('time',$time); |
140 | - return $this->fetch('Rent/rent_sure'); | 158 | + return $this->fetch('Rent/buy_sure'); |
141 | } | 159 | } |
142 | 160 | ||
143 | // 我要免押金 | 161 | // 我要免押金 |
@@ -39,8 +39,12 @@ class ShoppingController extends CommentController | @@ -39,8 +39,12 @@ class ShoppingController extends CommentController | ||
39 | if($res){ | 39 | if($res){ |
40 | $where_count['user_id'] = Session::get('uid'); | 40 | $where_count['user_id'] = Session::get('uid'); |
41 | $where_count['status'] = array('neq',9); | 41 | $where_count['status'] = array('neq',9); |
42 | - $cart = $model->where($where_count)->count(); | ||
43 | - $this->apiResponse('1','成功',$cart); | 42 | + $cart = $model->where($where_count)->field('num')->select()->toArray(); |
43 | + $count_shopping = 0; | ||
44 | + foreach ($cart as $ck=>$cv){ | ||
45 | + $count_shopping += $cv['num']; | ||
46 | + } | ||
47 | + $this->apiResponse('1','成功',$count_shopping); | ||
44 | }else{ | 48 | }else{ |
45 | $this->apiResponse('0','加入购物车失败'); | 49 | $this->apiResponse('0','加入购物车失败'); |
46 | } | 50 | } |
@@ -49,11 +53,93 @@ class ShoppingController extends CommentController | @@ -49,11 +53,93 @@ class ShoppingController extends CommentController | ||
49 | // 购物车列表 | 53 | // 购物车列表 |
50 | public function index(){ | 54 | public function index(){ |
51 | $model = new ShoppingModel(); | 55 | $model = new ShoppingModel(); |
52 | - $where_shopping['user_id'] = Session::get('uid'); | ||
53 | - $where_shopping['status'] = array('neq',9); | ||
54 | - $cart = $model->where($where_shopping)->select()->toArray(); | 56 | + $where_shopping['s.user_id'] = Session::get('uid'); |
57 | + $where_shopping['s.status'] = array('neq',9); | ||
58 | + $cart = $model->alias('s') | ||
59 | + ->where($where_shopping) | ||
60 | + ->join("Vehicle v",'v.id = s.vehicle_id') | ||
61 | + ->field('s.id,s.num , v.name,v.pic,v.intro,v.money,v.now_stock') | ||
62 | + ->select()->toArray(); | ||
63 | +// 判断库存是否充足 | ||
64 | + foreach ($cart as $cartk=>$cartv){ | ||
65 | + $cart[$cartk]['adequate'] = 1; | ||
66 | + if($cartv['num'] > $cartv['now_stock']){ | ||
67 | + $cart[$cartk]['adequate'] = 2; | ||
68 | + } | ||
69 | + } | ||
55 | $this->assign('cart',$cart); | 70 | $this->assign('cart',$cart); |
71 | +// 合计 | ||
72 | + $all_price = 0; | ||
73 | + foreach ($cart as $k=>$v){ | ||
74 | + $all_price += $v['money'] * $v['num']; | ||
75 | + } | ||
76 | + $all_price = number_format($all_price,2); | ||
77 | + $this->assign('all_price',$all_price); | ||
56 | return $this->fetch(); | 78 | return $this->fetch(); |
57 | } | 79 | } |
80 | +// 更改购物车数量 | ||
81 | + public function changeShopping(){ | ||
82 | + $data = $this->request->param(); | ||
83 | + $where_find['s.id'] = $data['shopping_id']; | ||
84 | + $where_find['s.user_id'] = Session::get('uid'); | ||
85 | + $where_find['s.status'] = array('neq',9); | ||
86 | + $find_num = Db::name('Shopping')->alias('s') | ||
87 | + ->where($where_find) | ||
88 | + ->join("Vehicle v",'v.id = s.vehicle_id') | ||
89 | + ->field('s.num , v.now_stock') | ||
90 | + ->find(); | ||
91 | + $where_shopping['id'] = $data['shopping_id']; | ||
92 | + $where_shopping['status'] = array('neq',9); | ||
93 | + if($data['is_add'] == 1){ | ||
94 | + if($find_num['num'] >= $find_num['now_stock']){ | ||
95 | + $this->apiResponse('0','库存不足'); | ||
96 | + }else{ | ||
97 | + $res = Db::name('Shopping')->where($where_shopping)->setInc('num',1); | ||
98 | + } | ||
99 | + | ||
100 | + }else if($data['is_add'] == 2){ | ||
101 | + | ||
102 | + if($find_num['num'] <= 1){ | ||
103 | + $this->apiResponse('0','不能再少啦'); | ||
104 | + }else{ | ||
105 | + $res = Db::name('Shopping')->where($where_shopping)->setDec('num',1); | ||
106 | + } | ||
107 | + } | ||
108 | + if($res){ | ||
109 | + $where_count['s.user_id'] = Session::get('uid'); | ||
110 | + $where_count['s.status'] = array('neq',9); | ||
111 | + $cart = Db::name('Shopping')->alias('s') | ||
112 | + ->where($where_count) | ||
113 | + ->join("Vehicle v",'v.id = s.vehicle_id') | ||
114 | + ->field('s.num,s.id , v.money') | ||
115 | + ->select()->toArray(); | ||
116 | + // 合计 | ||
117 | + $all_price = 0; | ||
118 | + foreach ($cart as $k=>$v){ | ||
119 | + $all_price += $v['money'] * $v['num']; | ||
120 | + if($v['id'] == $data['shopping_id']){ | ||
121 | + $return['number'] = $v['num']; | ||
122 | + } | ||
123 | + } | ||
124 | + $all_price = number_format($all_price,2); | ||
125 | + $return['all_price'] = $all_price; | ||
126 | + $this->apiResponse('1','成功',$return); | ||
127 | + }else{ | ||
128 | + $this->apiResponse('0','加入购物车失败'); | ||
129 | + } | ||
130 | + } | ||
131 | +// 删除购物车 | ||
132 | + public function delShopping(){ | ||
133 | + $data = $this->request->param(); | ||
134 | + $where_shopping['id'] = array('in',$data['shopping_id']); | ||
135 | + $up_shopping['status'] = 9; | ||
136 | + $up_shopping['update_time'] = time(); | ||
137 | + $res = Db::name('Shopping')->where($where_shopping)->update($up_shopping); | ||
138 | + if($res){ | ||
139 | + $this->apiResponse('1','删除成功'); | ||
140 | + }else{ | ||
141 | + $this->apiResponse('0','删除失败'); | ||
142 | + } | ||
143 | + } | ||
58 | 144 | ||
59 | } | 145 | } |
@@ -11,6 +11,7 @@ namespace app\portal\controller; | @@ -11,6 +11,7 @@ namespace app\portal\controller; | ||
11 | use cmf\controller\HomeBaseController; | 11 | use cmf\controller\HomeBaseController; |
12 | use EasyWeChat\Foundation\Application; | 12 | use EasyWeChat\Foundation\Application; |
13 | use think\Db; | 13 | use think\Db; |
14 | +use think\Session; | ||
14 | 15 | ||
15 | //个人中心 | 16 | //个人中心 |
16 | class UserController extends CommentController | 17 | class UserController extends CommentController |
@@ -18,24 +19,43 @@ class UserController extends CommentController | @@ -18,24 +19,43 @@ class UserController extends CommentController | ||
18 | // 个人中心首页 | 19 | // 个人中心首页 |
19 | public function index() | 20 | public function index() |
20 | { | 21 | { |
21 | -// $where_art['type'] = 3; | ||
22 | -// $where_art['status'] = array('neq',9); | ||
23 | -// $art = Db::name('Art')->where($where_art)->order('score desc,create_time desc')->limit(1)->find(); | ||
24 | -// if($art){ | ||
25 | -// $art['content'] = htmlspecialchars_decode($art['content']); | ||
26 | -// } | ||
27 | -// $this->assign('art',$art); | 22 | + |
28 | return $this->fetch('User/index'); | 23 | return $this->fetch('User/index'); |
29 | } | 24 | } |
30 | -// 地址列表 | ||
31 | - public function address() | 25 | +// 孝力等级 |
26 | + public function grade() | ||
32 | { | 27 | { |
33 | - | 28 | + $where_art['type'] = 4; |
29 | + $where_art['status'] = array('neq',9); | ||
30 | + $art = Db::name('Art')->where($where_art)->order('score desc,create_time desc')->find(); | ||
31 | + $art['content'] = htmlspecialchars_decode($art['content']); | ||
32 | + $this->assign('art',$art); | ||
34 | return $this->fetch(); | 33 | return $this->fetch(); |
35 | } | 34 | } |
36 | - // 修改地址 | ||
37 | - public function editAddress() | 35 | + |
36 | + // 租赁协议 | ||
37 | + public function rentGrade() | ||
38 | + { | ||
39 | + $where_art['type'] = 5; | ||
40 | + $where_art['status'] = array('neq',9); | ||
41 | + $art = Db::name('Art')->where($where_art)->order('score desc,create_time desc')->find(); | ||
42 | + $art['content'] = htmlspecialchars_decode($art['content']); | ||
43 | + $this->assign('art',$art); | ||
44 | + return $this->fetch('User/rent_grade'); | ||
45 | + } | ||
46 | + // 我的积分 | ||
47 | + public function score() | ||
38 | { | 48 | { |
39 | - return $this->fetch('User/edit_address'); | 49 | + $where_member['id'] = Session::get('uid'); |
50 | + $where_member['status'] = array('neq',9); | ||
51 | + $member = Db::name('Member')->where($where_member)->value('all_score'); | ||
52 | + $this->assign('member',$member); | ||
53 | + | ||
54 | + $where_art['user_id'] = Session::get('uid'); | ||
55 | + $where_art['status'] = array('neq',9); | ||
56 | + $art = Db::name('ScoreLog')->where($where_art)->order('create_time desc')->select()->toArray(); | ||
57 | + $this->assign('art',$art); | ||
58 | + return $this->fetch(); | ||
40 | } | 59 | } |
60 | + | ||
41 | } | 61 | } |
1 | +<!DOCTYPE html> | ||
2 | +<html lang="zh-CN"> | ||
3 | + | ||
4 | +<head> | ||
5 | + <meta charset="UTF-8"> | ||
6 | + <title>2.6新增地址</title> | ||
7 | + <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1"> | ||
8 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css"> | ||
9 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/swiper.min.css"> | ||
10 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/weui.css"> | ||
11 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/myweui.css"> | ||
12 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/common/add_address.css"> | ||
13 | + <script src="__TMPL__/public/assets/js/jquery.min.js" type="text/javascript" charset="utf-8"></script> | ||
14 | + <script src="__TMPL__/public/assets/js/weui.js" type="text/javascript" charset="utf-8"></script> | ||
15 | + <script src="__TMPL__/public/assets/js/myweui.js" type="text/javascript" charset="utf-8"></script> | ||
16 | + <script src="__TMPL__/public/assets/js/base.js" type="text/javascript" charset="utf-8"></script> | ||
17 | + <script src="__TMPL__/public/assets/js/citypicker.js" type="text/javascript" charset="utf-8"></script> | ||
18 | + <style> | ||
19 | + | ||
20 | + </style> | ||
21 | +</head> | ||
22 | + | ||
23 | +<body> | ||
24 | + <div class="container"> | ||
25 | + <p class="link_man"><img class="user_pic" src="__TMPL__/public/assets/images/user.png" alt="">联系人</p> | ||
26 | + <div class="user_box"> | ||
27 | + <p class="user_name"><span>姓名:</span> | ||
28 | + <input type="text" placeholder="请输入姓名" class="name"> | ||
29 | + </p> | ||
30 | + <p class="user_tel"><span>电话:</span> | ||
31 | + <input type="text" placeholder="请输入手机或固定电话" class="tel"> | ||
32 | + </p> | ||
33 | + </div> | ||
34 | + <p class="link_man"><img class="user_pic" src="__TMPL__/public/assets/images/dizhi.png" alt="">收货地址</p> | ||
35 | + <div class="address_box"> | ||
36 | + <p class="user_diqu"><span>选择地区:</span> | ||
37 | + <input class="select_city" type="text" placeholder="请选择省份/城市/地区" readonly> | ||
38 | + <input class="city_number" type="hidden" > | ||
39 | + <!--<img class="local_icon" src="__TMPL__/public/assets/images/aaaaaa@2x.png" alt="">--> | ||
40 | + </p> | ||
41 | + <p class="user_dizhi"><span>详细地址:</span> | ||
42 | + <input type="text" placeholder="请输入街道/楼层/门牌号" class="address"> | ||
43 | + </p> | ||
44 | + </div> | ||
45 | + </div> | ||
46 | + </div> | ||
47 | + <footer class="footer"> | ||
48 | + <p class="add_address">保存收货地址</p> | ||
49 | + </footer> | ||
50 | + </div> | ||
51 | + <script> | ||
52 | + $('.select_city').on('click', function() { | ||
53 | + weui.picker(rawCitiesData, { | ||
54 | + defaultValue: ["110000", "110000", "110101"], | ||
55 | + onConfirm: function(result) { | ||
56 | + console.log(result) | ||
57 | + $('.select_city').val(result[0].label + '-' + result[1].label + '-' + result[2].label); | ||
58 | + $('.city_number').val(result[0].value + '-' + result[1].value + '-' + result[2].value); | ||
59 | + } | ||
60 | + }); | ||
61 | + }) | ||
62 | + | ||
63 | + // 提交 | ||
64 | + $('.add_address').click(function () { | ||
65 | + var name = $('.name').val(); | ||
66 | + var tel = $('.tel').val(); | ||
67 | + var city = $('.select_city').val(); | ||
68 | + var address = $('.address').val(); | ||
69 | + var city_number = $('.city_number').val(); | ||
70 | + var nameReg = /^[\u4e00-\u9fa5]+$/; | ||
71 | + if (!nameReg.test(name)){ | ||
72 | + alert("姓名只能是汉字"); | ||
73 | + }else if(tel.length == 0){ | ||
74 | + alert("手机号不能为空"); | ||
75 | + }else if(city.length == 0){ | ||
76 | + alert("地区不能为空"); | ||
77 | + }else if(address.length == 0){ | ||
78 | + alert("详细地址不能为空"); | ||
79 | + }else{ | ||
80 | + $.ajax({ | ||
81 | + type:"POST", | ||
82 | + url:"{:url('Address/add')}", | ||
83 | + data:{ | ||
84 | + "name":name, | ||
85 | + "tel":tel, | ||
86 | + "city":city, | ||
87 | + "address":address, | ||
88 | + "city_number":city_number, | ||
89 | + }, | ||
90 | + success:function (data) { | ||
91 | + alert(data.message); | ||
92 | + if(data.code == 1){ | ||
93 | + window.location.href = "{:url('Address/index')}"; | ||
94 | + } | ||
95 | + }, | ||
96 | + error:function () { | ||
97 | + } | ||
98 | + }) | ||
99 | + } | ||
100 | + // var pattern = /^1[3|4|5|6|7|8|9]\d{1}\s\d{4}\s\d{4}$/; | ||
101 | + | ||
102 | + }) | ||
103 | + </script> | ||
104 | +</body> | ||
105 | + | ||
106 | +</html> |
1 | +<!DOCTYPE html> | ||
2 | +<html lang="zh-CN"> | ||
3 | + | ||
4 | +<head> | ||
5 | + <meta charset="UTF-8"> | ||
6 | + <title>2.6新增地址</title> | ||
7 | + <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1"> | ||
8 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css"> | ||
9 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/swiper.min.css"> | ||
10 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/weui.css"> | ||
11 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/myweui.css"> | ||
12 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/common/add_address.css"> | ||
13 | + <script src="__TMPL__/public/assets/js/jquery.min.js" type="text/javascript" charset="utf-8"></script> | ||
14 | + <script src="__TMPL__/public/assets/js/weui.js" type="text/javascript" charset="utf-8"></script> | ||
15 | + <script src="__TMPL__/public/assets/js/myweui.js" type="text/javascript" charset="utf-8"></script> | ||
16 | + <script src="__TMPL__/public/assets/js/base.js" type="text/javascript" charset="utf-8"></script> | ||
17 | + <script src="__TMPL__/public/assets/js/citypicker.js" type="text/javascript" charset="utf-8"></script> | ||
18 | + <style> | ||
19 | + | ||
20 | + </style> | ||
21 | +</head> | ||
22 | + | ||
23 | +<body> | ||
24 | + <div class="container"> | ||
25 | + <p class="link_man"><img class="user_pic" src="__TMPL__/public/assets/images/user.png" alt="">联系人</p> | ||
26 | + <div class="user_box"> | ||
27 | + <p class="user_name"><span>姓名:</span> | ||
28 | + <input type="text" placeholder="请输入姓名" class="name" value="{$list.name}"> | ||
29 | + </p> | ||
30 | + <p class="user_tel"><span>电话:</span> | ||
31 | + <input type="text" placeholder="请输入手机或固定电话" class="tel" value="{$list.tel}"> | ||
32 | + </p> | ||
33 | + </div> | ||
34 | + <p class="link_man"><img class="user_pic" src="__TMPL__/public/assets/images/dizhi.png" alt="">收货地址</p> | ||
35 | + <div class="address_box"> | ||
36 | + <p class="user_diqu"><span>选择地区:</span> | ||
37 | + <input class="select_city" type="text" placeholder="请选择省份/城市/地区" readonly value="{$list.city}"> | ||
38 | + <input class="city_number" type="hidden" > | ||
39 | + <!--<img class="local_icon" src="__TMPL__/public/assets/images/aaaaaa@2x.png" alt="">--> | ||
40 | + </p> | ||
41 | + <p class="user_dizhi"><span>详细地址:</span> | ||
42 | + <input type="text" placeholder="请输入街道/楼层/门牌号" class="address" value="{$list.address}"> | ||
43 | + </p> | ||
44 | + </div> | ||
45 | + </div> | ||
46 | + </div> | ||
47 | + <footer class="footer"> | ||
48 | + <p class="add_address">保存收货地址</p> | ||
49 | + </footer> | ||
50 | + </div> | ||
51 | + <script> | ||
52 | + $('.select_city').on('click', function() { | ||
53 | + weui.picker(rawCitiesData, { | ||
54 | + defaultValue: ["110000", "110000", "110101"], | ||
55 | + onConfirm: function(result) { | ||
56 | + $('.select_city').val(result[0].label + '-' + result[1].label + '-' + result[2].label); | ||
57 | + $('.city_number').val(result[0].value + '-' + result[1].value + '-' + result[2].value); | ||
58 | + | ||
59 | + } | ||
60 | + }); | ||
61 | + }) | ||
62 | + | ||
63 | + // 提交 | ||
64 | + $('.add_address').click(function () { | ||
65 | + var id = "{$list.id}"; | ||
66 | + var name = $('.name').val(); | ||
67 | + var tel = $('.tel').val(); | ||
68 | + var city = $('.select_city').val(); | ||
69 | + var address = $('.address').val(); | ||
70 | + var city_number = $('.city_number').val(); | ||
71 | + var nameReg = /^[\u4e00-\u9fa5]+$/; | ||
72 | + if (!nameReg.test(name)){ | ||
73 | + alert("姓名只能是汉字"); | ||
74 | + }else if(tel.length == 0){ | ||
75 | + alert("手机号不能为空"); | ||
76 | + }else if(city.length == 0){ | ||
77 | + alert("地区不能为空"); | ||
78 | + }else if(address.length == 0){ | ||
79 | + alert("详细地址不能为空"); | ||
80 | + }else{ | ||
81 | + $.ajax({ | ||
82 | + type:"POST", | ||
83 | + url:"{:url('Address/edit')}", | ||
84 | + data:{ | ||
85 | + "id":id, | ||
86 | + "name":name, | ||
87 | + "tel":tel, | ||
88 | + "city":city, | ||
89 | + "address":address, | ||
90 | + "city_number":city_number, | ||
91 | + }, | ||
92 | + success:function (data) { | ||
93 | + alert(data.message); | ||
94 | + if(data.code == 1){ | ||
95 | + window.location.href = "{:url('Address/index')}"; | ||
96 | + } | ||
97 | + }, | ||
98 | + error:function () { | ||
99 | + } | ||
100 | + }) | ||
101 | + } | ||
102 | + // var pattern = /^1[3|4|5|6|7|8|9]\d{1}\s\d{4}\s\d{4}$/; | ||
103 | + | ||
104 | + }) | ||
105 | + </script> | ||
106 | +</body> | ||
107 | + | ||
108 | +</html> |
1 | +<!DOCTYPE html> | ||
2 | +<html lang="zh-CN"> | ||
3 | + | ||
4 | +<head> | ||
5 | + <meta charset="UTF-8"> | ||
6 | + <title>2.5地址管理</title> | ||
7 | + <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1"> | ||
8 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css"> | ||
9 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/swiper.min.css"> | ||
10 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/common/address_manage.css"> | ||
11 | + <script src="__TMPL__/public/assets/js/jquery.min.js" type="text/javascript" charset="utf-8"></script> | ||
12 | + <script src="__TMPL__/public/assets/js/swiper.min.js" type="text/javascript" charset="utf-8"></script> | ||
13 | + <script src="__TMPL__/public/assets/js/base.js" type="text/javascript" charset="utf-8"></script> | ||
14 | + <style> | ||
15 | + | ||
16 | + </style> | ||
17 | +</head> | ||
18 | + | ||
19 | +<body> | ||
20 | + <div class="container"> | ||
21 | + <div class="address_out_box" style="padding-bottom: 1.5rem;"> | ||
22 | + <volist name="list" id="list"> | ||
23 | + <div class="address_in_box"> | ||
24 | + <div class="user_box"> | ||
25 | + <div class="left_ltem"> | ||
26 | + <p class="user_name">{$list.name}</p> | ||
27 | + <span class="phone"> {$list.tel}</span> | ||
28 | + </div> | ||
29 | + <div class="right_item"> | ||
30 | + <p class="moren"> | ||
31 | + <p class="moren_box <eq name='list.is_check' value='1'>choose_box</eq>" index="{$list.id}"> | ||
32 | + <img class="duigou" src="__TMPL__/public/assets/images/duigou.png" alt=""></p> 默认地址 | ||
33 | + </p> | ||
34 | + </div> | ||
35 | + </div> | ||
36 | + <div class="address_box" index="{$list.id}"> | ||
37 | + <p class="user_address">{$list.city}{$list.address} | ||
38 | + <span class="edit_box" index="{$list.id}"> | ||
39 | + <a href="{:url('Address/edit',array('id'=>$list.id))}"> | ||
40 | + <img class="add_pic" src="__TMPL__/public/assets/images/edit.png" alt=""> | ||
41 | + </a> | ||
42 | + <img class="del_icon" src="__TMPL__/public/assets/images/delete.png" alt=""> | ||
43 | + </span> | ||
44 | + </p> | ||
45 | + </div> | ||
46 | + </div> | ||
47 | + </volist> | ||
48 | + </div> | ||
49 | + </div> | ||
50 | + <footer class="footer"> | ||
51 | + <p class="add_address">新增收货地址</p> | ||
52 | + </footer> | ||
53 | + </div> | ||
54 | + <script> | ||
55 | + | ||
56 | + //默认地址勾选 | ||
57 | + $('.moren_box').on('click', function() { | ||
58 | + var address_id = $(this).attr('index'); | ||
59 | + var obj = $(this); | ||
60 | + console.log(address_id) | ||
61 | + $.ajax({ | ||
62 | + type: "POST", | ||
63 | + url: "{:url('Address/isCheck')}", | ||
64 | + data: { | ||
65 | + "address_id": address_id, | ||
66 | + }, | ||
67 | + success: function (data) { | ||
68 | + if (data.code == '1') { | ||
69 | + $('.moren_box').removeClass('choose_box'); | ||
70 | + obj.addClass('choose_box'); | ||
71 | + } else { | ||
72 | + alert(data.message); | ||
73 | + } | ||
74 | + }, | ||
75 | + error: function () { | ||
76 | + } | ||
77 | + }) | ||
78 | + }) | ||
79 | + | ||
80 | + //添加地址跳转 | ||
81 | + $('.add_address').on('click', function() { | ||
82 | + window.location.href = "{:url('Address/add')}" | ||
83 | + }) | ||
84 | + | ||
85 | + // 删除 | ||
86 | + $('.del_icon').click(function () { | ||
87 | + var id = "{$list.id}"; | ||
88 | + $.ajax({ | ||
89 | + type:"POST", | ||
90 | + url:"{:url('Address/del')}", | ||
91 | + data:{ | ||
92 | + "id":id, | ||
93 | + }, | ||
94 | + success:function (data) { | ||
95 | + alert(data.message); | ||
96 | + window.location.reload() | ||
97 | + }, | ||
98 | + error:function () { | ||
99 | + } | ||
100 | + }) | ||
101 | + }) | ||
102 | + </script> | ||
103 | +</body> | ||
104 | + | ||
105 | +</html> |
@@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
38 | </div> | 38 | </div> |
39 | </div> | 39 | </div> |
40 | <div class="goods_detail_desc"> | 40 | <div class="goods_detail_desc"> |
41 | - <p class="goods_detail_desc_money">¥{$art.money}.00 <span>联系客服<img src="__TMPL__/public/assets/images/kefu_icon.png" alt=""></span></p> | 41 | + <p class="goods_detail_desc_money">¥{$art.money}<span>联系客服<img src="__TMPL__/public/assets/images/kefu_icon.png" alt=""></span></p> |
42 | <p class="goods_detail_desc_title">{$art.name}</p> | 42 | <p class="goods_detail_desc_title">{$art.name}</p> |
43 | <p class="goods_detail_desc_content">{$art.intro}</p> | 43 | <p class="goods_detail_desc_content">{$art.intro}</p> |
44 | </div> | 44 | </div> |
@@ -66,7 +66,7 @@ | @@ -66,7 +66,7 @@ | ||
66 | <div class="head_img_box"> | 66 | <div class="head_img_box"> |
67 | <img src="__TMPL__/public/assets/images/detail_head_img.png" alt=""> | 67 | <img src="__TMPL__/public/assets/images/detail_head_img.png" alt=""> |
68 | <p class="user_name">穷艾尔雅</p> | 68 | <p class="user_name">穷艾尔雅</p> |
69 | - <span class="release_time">2018-07-14<span> | 69 | + <span class="release_time">2018-07-14</span> |
70 | </div> | 70 | </div> |
71 | <div class="pingjia_box"> | 71 | <div class="pingjia_box"> |
72 | <p class="pingjia_content">出行收纳更方便,体积更小轻松放入汽车后备箱,非常好的 | 72 | <p class="pingjia_content">出行收纳更方便,体积更小轻松放入汽车后备箱,非常好的 |
@@ -89,6 +89,7 @@ | @@ -89,6 +89,7 @@ | ||
89 | 89 | ||
90 | </div> | 90 | </div> |
91 | <footer class="footer"> | 91 | <footer class="footer"> |
92 | + <a href="{:url('Shopping/index')}"> | ||
92 | <div class="buycar_box"> | 93 | <div class="buycar_box"> |
93 | <span class="goods_num">{$cart}</span> | 94 | <span class="goods_num">{$cart}</span> |
94 | <eq name="cart" value="0"> | 95 | <eq name="cart" value="0"> |
@@ -97,6 +98,7 @@ | @@ -97,6 +98,7 @@ | ||
97 | <img class="footer_buycar_img" src="__TMPL__/public/assets/images/cdvcd@2x.png" alt=""> | 98 | <img class="footer_buycar_img" src="__TMPL__/public/assets/images/cdvcd@2x.png" alt=""> |
98 | </eq> | 99 | </eq> |
99 | </div> | 100 | </div> |
101 | + </a> | ||
100 | <p class="footer_pay">前往支付</p> | 102 | <p class="footer_pay">前往支付</p> |
101 | <p class="footer_buycar">加入购物车</p> | 103 | <p class="footer_buycar">加入购物车</p> |
102 | </footer> | 104 | </footer> |
@@ -154,7 +156,7 @@ | @@ -154,7 +156,7 @@ | ||
154 | }) | 156 | }) |
155 | //去购买 | 157 | //去购买 |
156 | $('.footer_pay').on('click', function() { | 158 | $('.footer_pay').on('click', function() { |
157 | - window.location.href = "sure_buy.html" | 159 | + window.location.href = "{:url('Rent/buySure')}" |
158 | }) | 160 | }) |
159 | </script> | 161 | </script> |
160 | </body> | 162 | </body> |
1 | +<!DOCTYPE html> | ||
2 | +<html lang="zh-CN"> | ||
3 | + | ||
4 | +<head> | ||
5 | + <meta charset="UTF-8"> | ||
6 | + <title>2-4确认购买</title> | ||
7 | + <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1"> | ||
8 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css"> | ||
9 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/swiper.min.css"> | ||
10 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/common/sure_buy.css"> | ||
11 | + <script src="__TMPL__/public/assets/js/jquery.min.js" type="text/javascript" charset="utf-8"></script> | ||
12 | + <script src="__TMPL__/public/assets/js/swiper.min.js" type="text/javascript" charset="utf-8"></script> | ||
13 | + <style> | ||
14 | + .shuru { | ||
15 | + width: 2rem; | ||
16 | + outline: none; | ||
17 | + } | ||
18 | + | ||
19 | + .beizhu_title { | ||
20 | + display: inline-block; | ||
21 | + vertical-align: top; | ||
22 | + margin-top: 0.08rem; | ||
23 | + } | ||
24 | + | ||
25 | + textarea { | ||
26 | + outline: none; | ||
27 | + margin: 0 auto; | ||
28 | + margin-top: 0.1rem; | ||
29 | + margin-left: 0.1rem; | ||
30 | + margin-right: 0.1rem; | ||
31 | + line-height: 0.35rem; | ||
32 | + } | ||
33 | + | ||
34 | + .beizhu_content { | ||
35 | + display: inline-block; | ||
36 | + border-radius: 0.1rem; | ||
37 | + border: 0.01rem solid #EBEBEB; | ||
38 | + } | ||
39 | + </style> | ||
40 | +</head> | ||
41 | + | ||
42 | +<body> | ||
43 | + <div class="container"> | ||
44 | + <div class="address_box"> | ||
45 | + <img class="youjiantou" src="__TMPL__/public/assets/images/youjiantou1.png" alt=""> | ||
46 | + <div class="user_box"> | ||
47 | + <img class="head_img" src="__TMPL__/public/assets/images/head_img.png" alt=""> | ||
48 | + <p class="user_name"> | ||
49 | + <input class="shuru" type="text" maxlength="5" placeholder="赵先生"> | ||
50 | + </p> | ||
51 | + <p class="user_phone"> | ||
52 | + <input class="shuru" type="number" maxlength="11" onkeyup="this.value = this.value.slice(0,11)" placeholder="15122953260"> | ||
53 | + </p> | ||
54 | + </div> | ||
55 | + <div class="local_box"> | ||
56 | + <img class="location_img" src="__TMPL__/public/assets/images/3336556@2x.png" alt=""> | ||
57 | + <span class="address_content">天津阿达宽大的</span> | ||
58 | + </div> | ||
59 | + </div> | ||
60 | + <div class="con_warp"> | ||
61 | + <p class="buy_message buy_message_top"> 购买信息</p> | ||
62 | + <ul class="con_list_ul"> | ||
63 | + <li class="con_list_li"> | ||
64 | + <img class="con_list_img" src="__TMPL__/public/assets/images/5653ceba1a219@2x.png" alt=""> | ||
65 | + <div class="goods_box"> | ||
66 | + <p class="goods_title">HO56C手动轮椅车</p> | ||
67 | + <span class="goods_content">体积更小轻松放入汽车后备箱</span> | ||
68 | + <p class="goods_money">$2000.06</p> | ||
69 | + <span class="goods_nums"> X1</span> | ||
70 | + </div> | ||
71 | + </li> | ||
72 | + </ul> | ||
73 | + <div class="join"> | ||
74 | + <img class="subtract_img" src="__TMPL__/public/assets/images/item_reduce.png " alt=""> | ||
75 | + <p>1 </p> | ||
76 | + <img class="add_img" src="__TMPL__/public/assets/images/item_add.png" alt=""> | ||
77 | + </div> | ||
78 | + <p class="buy_message buy_message_bot"> 购买数量 </p> | ||
79 | + </div> | ||
80 | + <div class="peisong"> | ||
81 | + <div class="peisong_box"> | ||
82 | + <p> 配送方式<span> 快递:¥8.00</span></p> | ||
83 | + </div> | ||
84 | + <div class="beizhu_box"> | ||
85 | + <p class="beizhu_title"> 备注信息: </p> | ||
86 | + <p class="beizhu_content"> | ||
87 | + <textarea name="" id="" cols="35" rows="3">晚一些的发货发的撒佛挡杀佛的萨芬</textarea> | ||
88 | + </p> | ||
89 | + </div> | ||
90 | + </div> | ||
91 | + <div class="xiaoji_box"> | ||
92 | + <p class="xiaoji">共一件商品 小计 : ¥2000.00</p> | ||
93 | + </div> | ||
94 | + <div class="zhifu"> | ||
95 | + <div class=" pay_method"> | ||
96 | + <div class="method_choose"> | ||
97 | + <p class="wx_pay pay_item"> 微信支付<span><img class="hand" src="__TMPL__/public/assets/images/hand.png" alt="">推荐使用</span> </p> | ||
98 | + <p class="ali_pay pay_item"> 支付宝支付 </p> | ||
99 | + </div> | ||
100 | + <div class="methood_pic"> | ||
101 | + <img class="sure sure_item" src="__TMPL__/public/assets/images/sure.png" alt=""> | ||
102 | + <img class="cancel sure_item" src="__TMPL__/public/assets/images/sure_1.png" alt=""> | ||
103 | + </div> | ||
104 | + </div> | ||
105 | + </div> | ||
106 | + </div> | ||
107 | + <footer class="footer"> | ||
108 | + <div class="buycar_box"> | ||
109 | + <p> 微信支付</p> | ||
110 | + <span class="buycar_box_money">$2000.00</span> | ||
111 | + </div> | ||
112 | + <p class="footer_buycar">前往支付</p> | ||
113 | + </footer> | ||
114 | + </div> | ||
115 | + <script src="__TMPL__/public/assets/js/picker.min.js"></script> | ||
116 | + <script src="__TMPL__/public/assets/js/base.js" type="text/javascript" charset="utf-8"></script> | ||
117 | + <script src="__TMPL__/public/assets/js/common.js" type="text/javascript" charset="utf-8"></script> | ||
118 | + <script> | ||
119 | + $(document).ready(function() { | ||
120 | + get_main_content(); | ||
121 | + | ||
122 | + var $menu_box = $('.content_body .con_title>li'); | ||
123 | + $menu_box.click(function() { | ||
124 | + $(this).addClass('con_curr').siblings().removeClass('con_curr'); | ||
125 | + var index = $menu_box.index(this); | ||
126 | + $('.con_all .con_warp').eq(index).show().siblings().hide(); | ||
127 | + }); | ||
128 | + }) | ||
129 | + | ||
130 | + function get_main_content() { | ||
131 | + | ||
132 | + } | ||
133 | + | ||
134 | + //地址管理 | ||
135 | + $('.youjiantou').on('click', function() { | ||
136 | + window.location.href = "{:url('Address/index')}"; | ||
137 | + }) | ||
138 | + </script> | ||
139 | +</body> | ||
140 | + | ||
141 | +</html> |
1 | +<!DOCTYPE html> | ||
2 | +<html lang="zh-CN"> | ||
3 | + | ||
4 | +<head> | ||
5 | + <meta charset="UTF-8"> | ||
6 | + <title>3-9效力等级说明</title> | ||
7 | + <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1"> | ||
8 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css"> | ||
9 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/swiper.min.css"> | ||
10 | + | ||
11 | + <script src="__TMPL__/public/assets/js/jquery.min.js" type="text/javascript" charset="utf-8"></script> | ||
12 | + <script src="__TMPL__/public/assets/js/swiper.min.js" type="text/javascript" charset="utf-8"></script> | ||
13 | + <script src="__TMPL__/public/assets/js/base.js" type="text/javascript" charset="utf-8"></script> | ||
14 | + <style> | ||
15 | + | ||
16 | + </style> | ||
17 | +</head> | ||
18 | + | ||
19 | +<body> | ||
20 | + | ||
21 | + <div class="container"> | ||
22 | + | ||
23 | + <div class="content_text_box"> | ||
24 | + <p class="text_title">{$art.title}</p> | ||
25 | + <p class="content_text">{$art.content}</p> | ||
26 | + | ||
27 | + </div> | ||
28 | + | ||
29 | + </div> | ||
30 | + <script> | ||
31 | + $(document).ready(function() { | ||
32 | + get_main_content(); | ||
33 | + | ||
34 | + var $menu_box = $('.content_body .con_title>li'); | ||
35 | + $menu_box.click(function() { | ||
36 | + $(this).addClass('con_curr').siblings().removeClass('con_curr'); | ||
37 | + var index = $menu_box.index(this); | ||
38 | + $('.con_all .con_warp').eq(index).show().siblings().hide(); | ||
39 | + }); | ||
40 | + }) | ||
41 | + | ||
42 | + function get_main_content() { | ||
43 | + | ||
44 | + } | ||
45 | + </script> | ||
46 | +</body> | ||
47 | + | ||
48 | +</html> |
@@ -12,102 +12,120 @@ | @@ -12,102 +12,120 @@ | ||
12 | <script src="__TMPL__/public/assets/js/swiper.min.js" type="text/javascript" charset="utf-8"></script> | 12 | <script src="__TMPL__/public/assets/js/swiper.min.js" type="text/javascript" charset="utf-8"></script> |
13 | <script src="__TMPL__/public/assets/js/base.js" type="text/javascript" charset="utf-8"></script> | 13 | <script src="__TMPL__/public/assets/js/base.js" type="text/javascript" charset="utf-8"></script> |
14 | <style> | 14 | <style> |
15 | - | 15 | + .pic_item { |
16 | + width: 0.68rem; | ||
17 | + height: 0.73rem; | ||
18 | + } | ||
16 | </style> | 19 | </style> |
17 | </head> | 20 | </head> |
18 | 21 | ||
19 | <body> | 22 | <body> |
20 | - | ||
21 | - <div class="container"> | ||
22 | - <div class="head_box"> | ||
23 | - <div class="pic_box"> | ||
24 | - <img class="head_pic" src="__TMPL__/public/assets/images/user_pic.png" alt=""> | ||
25 | - </div> | ||
26 | - <p class="user_name">合欢花</p> | ||
27 | - </div> | ||
28 | - <div class="jifen_box"> | ||
29 | - <img class="jifen" src="__TMPL__/public/assets/images/asvfvadv@2x.png" alt=""> | ||
30 | - </div> | ||
31 | - <div class="order"> | ||
32 | - <p class="my_order"> | ||
33 | - <span class="order_left">我的订单</span> | ||
34 | - <span class="order_right">查看更多订单<img src="__TMPL__/public/assets/images/youjiantou1.png" alt=""></span> | ||
35 | - </p> | ||
36 | - <ul class="person_list"> | ||
37 | - <li class="person_botlist"><img src="__TMPL__/public/assets/images/SDFAGFDAW@2x.png" alt=""><span>待支付</span></li> | ||
38 | - <li class="person_botlist"><img src="__TMPL__/public/assets/images/orderclick.png" alt=""><span>待完成</span></li> | ||
39 | - <li class="person_botlist"><img src="__TMPL__/public/assets/images/orderpingjia.png" alt=""><span>待评价</span></li> | ||
40 | - <li class="person_botlist"><img src="__TMPL__/public/assets/images/ordersure.png" alt=""><span>待完成</span></li> | ||
41 | - </ul> | ||
42 | - </div> | ||
43 | - <div class="list_box"> | ||
44 | - <ul> | ||
45 | - <li class="list_item"> | ||
46 | - <span class="list_left"><img src="__TMPL__/public/assets/images/ACSACA@2x.png" alt="">我的积分</span> | ||
47 | - <span class="list_right chakan">查看全部积分<img src="__TMPL__/public/assets/images/youjiantou1.png" alt=""></span> | ||
48 | - </li> | ||
49 | - <li class="list_item"> | ||
50 | - <a href="{:url('User/address')}"> | ||
51 | - <span class="list_left"><img src="__TMPL__/public/assets/images/acsc@2x.png" alt="">地址管理</span> | ||
52 | - <span class="list_right"><img src="__TMPL__/public/assets/images/youjiantou1.png" alt=""></span> | ||
53 | - </a> | ||
54 | - </li> | ||
55 | - <li class="list_item xiaoli"> | ||
56 | - <span class="list_left"><img src="__TMPL__/public/assets/images/acsc@2x.png" alt="">效力等级说明</span> | ||
57 | - <span class="list_right"><img src="__TMPL__/public/assets/images/youjiantou1.png" alt=""></span> | ||
58 | - </li> | ||
59 | - <li class="list_item lease"> | ||
60 | - <span class="list_left"><img src="__TMPL__/public/assets/images/acsc@2x.png" alt="">租赁协议</span> | ||
61 | - <span class="list_right"><img src="__TMPL__/public/assets/images/youjiantou1.png" alt=""></span> | ||
62 | - </li> | ||
63 | - <li class="list_item share"> | ||
64 | - <span class="list_left"><img src="__TMPL__/public/assets/images/acsc@2x.png" alt="">分享有礼</span> | ||
65 | - <span class="list_right"><img src="__TMPL__/public/assets/images/youjiantou1.png" alt=""></span> | ||
66 | - </li> | ||
67 | - </ul> | 23 | +<div class="container"> |
24 | + <div class="head_box"> | ||
25 | + <div class="pic_box"> | ||
26 | + <img class="head_pic" src="__TMPL__/public/assets/images/user_pic.png" alt=""> | ||
68 | </div> | 27 | </div> |
28 | + <p class="user_name">合欢花</p> | ||
69 | </div> | 29 | </div> |
70 | - <footer class="footer"> | ||
71 | - <ul class="bottom_list"> | ||
72 | - <li id="index_bar" class="mainpage_botlist index"><img src="__TMPL__/public/assets/images/index.png" alt=""><span>首页</span></li> | ||
73 | - <li id="buy_car" class="mainpage_botlist buy_car"><img src="__TMPL__/public/assets/images/cdvcd@1x.png" alt=""><span>购物车</span></li> | ||
74 | - <li id="personal_center" class="mainpage_botlist personal_center"><img src="__TMPL__/public/assets/images/personal_checked.png" alt=""><span>我的</span></li> | 30 | + <div class="jifen_box"> |
31 | + <img class="jifen" src="__TMPL__/public/assets/images/asvfvadv@2x.png" alt=""> | ||
32 | + </div> | ||
33 | + <div class="order"> | ||
34 | + <p class="my_order"> | ||
35 | + <span class="order_left">我的订单</span> | ||
36 | + <span class="order_right">查看更多订单<img src="__TMPL__/public/assets/images/youjiantou1.png" alt=""></span> | ||
37 | + </p> | ||
38 | + <ul class="person_list"> | ||
39 | + <li class="person_botlist"> | ||
40 | + <div class="box"> | ||
41 | + <img class="pic_item " src="__TMPL__/public/assets/images/orderyin2.png" alt=""> | ||
42 | + <span class="order_nums">2</span> | ||
43 | + </div> | ||
44 | + <span>待支付</span> | ||
45 | + </li> | ||
46 | + <li class="person_botlist"> | ||
47 | + <div class="box"> | ||
48 | + <img class=" pic_item_usual" src="__TMPL__/public/assets/images/orderclick.png" alt=""> | ||
49 | + </div> | ||
50 | + <span>待完成</span> | ||
51 | + </li> | ||
52 | + <li class="person_botlist"> | ||
53 | + <div class="box"> | ||
54 | + <img class=" pic_item_usual" src="__TMPL__/public/assets/images/orderpingjia.png" alt=""> | ||
55 | + </div> | ||
56 | + <span>待评价</span> | ||
57 | + </li> | ||
58 | + <li class="person_botlist"> | ||
59 | + <div class="box"> | ||
60 | + <img class=" pic_item_usual" src="__TMPL__/public/assets/images/ordersure.png" alt=""> | ||
61 | + </div> | ||
62 | + <span>已完成</span> | ||
63 | + </li> | ||
64 | + </ul> | ||
65 | + </div> | ||
66 | + <div class="list_box"> | ||
67 | + <ul> | ||
68 | + <li class="list_item"> | ||
69 | + <span class="list_left"><img src="__TMPL__/public/assets/images/ACSACA@2x.png" alt="">我的积分</span> | ||
70 | + <span class="list_right chakan">查看全部积分<img src="__TMPL__/public/assets/images/youjiantou1.png" alt=""></span> | ||
71 | + </li> | ||
72 | + <li class="list_item adress"> | ||
73 | + <span class="list_left"><img src="__TMPL__/public/assets/images/acsc@2x.png" alt="">地址管理</span> | ||
74 | + <span class="list_right"><img src="__TMPL__/public/assets/images/youjiantou1.png" alt=""></span> | ||
75 | + </li> | ||
76 | + <li class="list_item xiaoli"> | ||
77 | + <span class="list_left"><img src="__TMPL__/public/assets/images/ASFAfs@2x.png" alt="">效力等级说明</span> | ||
78 | + <span class="list_right"><img src="__TMPL__/public/assets/images/youjiantou1.png" alt=""></span> | ||
79 | + </li> | ||
80 | + <li class="list_item lease"> | ||
81 | + <span class="list_left"><img class="tiaozheng" src="__TMPL__/public/assets/images/SCAC@2x.png" alt="">租赁协议</span> | ||
82 | + <span class="list_right"><img src="__TMPL__/public/assets/images/youjiantou1.png" alt=""></span> | ||
83 | + </li> | ||
84 | + <li class="list_item share"> | ||
85 | + <span class="list_left"><img src="__TMPL__/public/assets/images/zan.png" alt="">分享有礼</span> | ||
86 | + <span class="list_right"><img src="__TMPL__/public/assets/images/youjiantou1.png" alt=""></span> | ||
87 | + </li> | ||
75 | </ul> | 88 | </ul> |
76 | - </footer> | ||
77 | </div> | 89 | </div> |
78 | - <script src="__TMPL__/public/assets/js/common.js"></script> | ||
79 | - <script> | ||
80 | - $(document).ready(function() { | ||
81 | - get_main_content(); | 90 | +</div> |
91 | +<footer class="footer"> | ||
92 | + <ul class="bottom_list"> | ||
93 | + <li id="index_bar" class="mainpage_botlist index"><img src="__TMPL__/public/assets/images/index.png" alt=""><span>首页</span></li> | ||
94 | + <li id="buy_car" class="mainpage_botlist buy_car"><img src="__TMPL__/public/assets/images/cdvcd@1x.png" alt=""><span>购物车</span></li> | ||
95 | + <li id="personal_center" class="mainpage_botlist personal_center"><img src="__TMPL__/public/assets/images/personal_checked.png" alt=""><span>我的</span></li> | ||
96 | + </ul> | ||
97 | +</footer> | ||
98 | +</div> | ||
99 | +<script src="__TMPL__/public/assets/js/common.js"></script> | ||
100 | +<script> | ||
101 | + //我的积分 | ||
102 | + $('.chakan').on('click', function() { | ||
103 | + window.location.href = "{:url('User/score')}" | ||
104 | + }) | ||
105 | + // 地址管理 | ||
106 | + $('.adress').on('click', function() { window.location.href = "{:url('Address/index')}" }); | ||
107 | + // 孝力等级 | ||
108 | + $('.xiaoli').on('click', function() { window.location.href = "{:url('User/grade')}" }); | ||
109 | + // 租赁协议 | ||
110 | + $('.lease').on('click', function() { window.location.href = "{:url('User/rentGrade')}" }); | ||
82 | 111 | ||
83 | 112 | ||
84 | - }) | ||
85 | 113 | ||
86 | - function get_main_content() { | 114 | + //导航栏跳转 |
115 | + $('#index_bar').on('click', function() { window.location.href = "{:url('Index/index')}" }); | ||
116 | + $('#buy_car').on('click', function() { window.location.href = "{:url('Shopping/index')}" }) | ||
117 | + | ||
118 | + | ||
87 | 119 | ||
88 | - } | ||
89 | 120 | ||
90 | - //导航栏跳转 | ||
91 | - $('#index_bar').on('click', function() { window.location.href = '../index.html' }); | ||
92 | - $('#buy_car').on('click', function() { window.location.href = '../common/buy_car.html' }) | ||
93 | - //分享跳转 | ||
94 | - $('.jifen').on('click', function() { window.location.href = 'share.html' }) | ||
95 | - //租赁指南跳转 | ||
96 | - $('.adress').on('click', function() { window.location.href = 'address_manage.html' }); | ||
97 | - $('.xiaoli').on('click', function() { window.location.href = 'class_desc.html' }); | ||
98 | - $('.lease').on('click', function() { window.location.href = '../common/distribution_rule.html' }); | 121 | + $('.jifen').on('click', function() { window.location.href = "{:url('Address/score')}" }) |
122 | + | ||
99 | $('.share').on('click', function() { window.location.href = 'share.html' }); | 123 | $('.share').on('click', function() { window.location.href = 'share.html' }); |
100 | //订单跳转 | 124 | //订单跳转 |
101 | $('.order_right').on('click', function() { window.location.href = 'myorder.html' }); | 125 | $('.order_right').on('click', function() { window.location.href = 'myorder.html' }); |
102 | - $('.zulin').on('click', function() { | ||
103 | - window.location.href = 'common/zhinan.html' | ||
104 | - }); | ||
105 | 126 | ||
106 | - //积分跳转 | ||
107 | - $('.chakan').on('click', function() { | ||
108 | - window.location.href = 'jifen.html' | ||
109 | - }) | ||
110 | - </script> | 127 | + |
128 | +</script> | ||
111 | </body> | 129 | </body> |
112 | 130 | ||
113 | </html> | 131 | </html> |
1 | +<!DOCTYPE html> | ||
2 | +<html lang="zh-CN"> | ||
3 | + | ||
4 | +<head> | ||
5 | + <meta charset="UTF-8"> | ||
6 | + <title>3-9效力等级说明</title> | ||
7 | + <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1"> | ||
8 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css"> | ||
9 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/swiper.min.css"> | ||
10 | + | ||
11 | + <script src="__TMPL__/public/assets/js/jquery.min.js" type="text/javascript" charset="utf-8"></script> | ||
12 | + <script src="__TMPL__/public/assets/js/swiper.min.js" type="text/javascript" charset="utf-8"></script> | ||
13 | + <script src="__TMPL__/public/assets/js/base.js" type="text/javascript" charset="utf-8"></script> | ||
14 | + <style> | ||
15 | + | ||
16 | + </style> | ||
17 | +</head> | ||
18 | + | ||
19 | +<body> | ||
20 | + | ||
21 | + <div class="container"> | ||
22 | + | ||
23 | + <div class="content_text_box"> | ||
24 | + <p class="text_title">{$art.title}</p> | ||
25 | + <p class="content_text">{$art.content}</p> | ||
26 | + | ||
27 | + </div> | ||
28 | + | ||
29 | + </div> | ||
30 | + <script> | ||
31 | + $(document).ready(function() { | ||
32 | + get_main_content(); | ||
33 | + | ||
34 | + var $menu_box = $('.content_body .con_title>li'); | ||
35 | + $menu_box.click(function() { | ||
36 | + $(this).addClass('con_curr').siblings().removeClass('con_curr'); | ||
37 | + var index = $menu_box.index(this); | ||
38 | + $('.con_all .con_warp').eq(index).show().siblings().hide(); | ||
39 | + }); | ||
40 | + }) | ||
41 | + | ||
42 | + function get_main_content() { | ||
43 | + | ||
44 | + } | ||
45 | + </script> | ||
46 | +</body> | ||
47 | + | ||
48 | +</html> |
1 | +<!DOCTYPE html> | ||
2 | +<html lang="zh-CN"> | ||
3 | + | ||
4 | +<head> | ||
5 | + <meta charset="UTF-8"> | ||
6 | + <title>3-我的积分</title> | ||
7 | + <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1"> | ||
8 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css"> | ||
9 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/swiper.min.css"> | ||
10 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/user/jifen.css"> | ||
11 | + <script src="__TMPL__/public/assets/js/jquery.min.js" type="text/javascript" charset="utf-8"></script> | ||
12 | + <script src="__TMPL__/public/assets/js/swiper.min.js" type="text/javascript" charset="utf-8"></script> | ||
13 | + <script src="__TMPL__/public/assets/js/base.js" type="text/javascript" charset="utf-8"></script> | ||
14 | + <style> | ||
15 | + | ||
16 | + </style> | ||
17 | +</head> | ||
18 | + | ||
19 | +<body> | ||
20 | + <div class="container"> | ||
21 | + <div class="head_box"> | ||
22 | + <p class="all_jifen">{$member}</p> | ||
23 | + <p class="use_jifen">可用积分</p> | ||
24 | + </div> | ||
25 | + <div class="jifen_card"> | ||
26 | + <div class="content_head"> | ||
27 | + <ul class="select_card con_title"> | ||
28 | + <li class="select_card_list con_curr" > | ||
29 | + <img src="__TMPL__/public/assets/images/dscfv@2x.png" alt=""> | ||
30 | + <p>积分明细</p> | ||
31 | + </li> | ||
32 | + <li class="select_card_list " > | ||
33 | + <img src="__TMPL__/public/assets/images/dsfvafds@2x.png" alt=""> | ||
34 | + <p>积分使用记录</p> | ||
35 | + </li> | ||
36 | + </ul> | ||
37 | + </div> | ||
38 | + </div> | ||
39 | + <div class="con_all"> | ||
40 | + <div class="con_warp"> | ||
41 | + <div class="list_box"> | ||
42 | + <ul> | ||
43 | + <volist name="art" id="list"> | ||
44 | + <eq name="list.status" value="2"> | ||
45 | + <li class="list_item list_item_first"> | ||
46 | + <p class="list_left">{$list.reason}</p> | ||
47 | + <p class="use_date">{$list.create_time|date='Y-m-d',###}</p> | ||
48 | + <p class="add_num">+{$list.score}</p> | ||
49 | + </li> | ||
50 | + </eq> | ||
51 | + </volist> | ||
52 | + </ul> | ||
53 | + <img class="juchi" src="__TMPL__/public/assets/images/juchixing.png" alt=""> | ||
54 | + </div> | ||
55 | + </div> | ||
56 | + <div class="con_warp" style="display: none"> | ||
57 | + <div class="list_box"> | ||
58 | + <ul> | ||
59 | + <volist name="art" id="list"> | ||
60 | + <eq name="list.status" value="3"> | ||
61 | + <li class="list_item list_item_first"> | ||
62 | + <p class="list_left">{$list.reason}</p> | ||
63 | + <p class="use_date">{$list.create_time|date='Y-m-d',###}</p> | ||
64 | + <p class="add_num">-{$list.score}</p> | ||
65 | + </li> | ||
66 | + </eq> | ||
67 | + </volist> | ||
68 | + | ||
69 | + </ul> | ||
70 | + <img class="juchi" src="__TMPL__/public/assets/images/juchixing.png" alt=""> | ||
71 | + </div> | ||
72 | + </div> | ||
73 | + </div> | ||
74 | + </div> | ||
75 | + </div> | ||
76 | + <script> | ||
77 | + $(document).ready(function() { | ||
78 | + get_main_content(); | ||
79 | + | ||
80 | + var $menu_box = $('.content_head .con_title>li'); | ||
81 | + $menu_box.click(function() { | ||
82 | + $(this).attr('background', "#000"); | ||
83 | + $(this).addClass('con_curr').siblings().removeClass('con_curr'); | ||
84 | + var index = $menu_box.index(this); | ||
85 | + $('.con_all .con_warp').eq(index).show().siblings().hide(); | ||
86 | + }); | ||
87 | + }) | ||
88 | + | ||
89 | + function get_main_content() { | ||
90 | + | ||
91 | + } | ||
92 | + //首页轮播图 | ||
93 | + var swiper = new Swiper('.swiper-container', { | ||
94 | + | ||
95 | + pagination: { | ||
96 | + el: '.swiper-pagination', | ||
97 | + clickable: true, | ||
98 | + }, | ||
99 | + }); | ||
100 | + //我要租赁-查找器材跳转 | ||
101 | + $('.lookup_equipment').on('click', function() { | ||
102 | + window.location.href = 'common/zhinan.html' | ||
103 | + }) | ||
104 | + //地理位置跳转 | ||
105 | + $('.local_location').on('click', function() { | ||
106 | + window.location.href = 'common/map.html' | ||
107 | + }) | ||
108 | + //我要购买-去挑选商品跳转 | ||
109 | + | ||
110 | + //租赁指南跳转 | ||
111 | + $('.zulin').on('click', function() { | ||
112 | + window.location.href = 'common/zhinan.html' | ||
113 | + }); | ||
114 | + //关于我们跳转 | ||
115 | + $('.us').on('click', function() { | ||
116 | + window.location.href = 'common/zhinan.html' | ||
117 | + }) | ||
118 | + </script> | ||
119 | +</body> | ||
120 | + | ||
121 | +</html> |
1 | +<!DOCTYPE html> | ||
2 | +<html lang="zh-CN"> | ||
3 | + | ||
4 | +<head> | ||
5 | + <meta charset="UTF-8"> | ||
6 | + <title>购物车</title> | ||
7 | + <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1"> | ||
8 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css"> | ||
9 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/swiper.min.css"> | ||
10 | + <link rel="stylesheet" href="__TMPL__/public/assets/css/common/buy_car.css"> | ||
11 | + <script src="__TMPL__/public/assets/js/jquery.min.js" type="text/javascript" charset="utf-8"></script> | ||
12 | + <script src="__TMPL__/public/assets/js/swiper.min.js" type="text/javascript" charset="utf-8"></script> | ||
13 | + <script src="__TMPL__/public/assets/js/base.js" type="text/javascript" charset="utf-8"></script> | ||
14 | + <style> | ||
15 | + .changeNone{ | ||
16 | + display: none; | ||
17 | + } | ||
18 | + .show{ | ||
19 | + display: block; | ||
20 | + } | ||
21 | + </style> | ||
22 | +</head> | ||
23 | + | ||
24 | +<body> | ||
25 | + <header class="mui_bar"> | ||
26 | + <div class="delete_box"> | ||
27 | + <img class="del_img" src="__TMPL__/public/assets/images/sdfadgas@2x.png" alt=""> | ||
28 | + <p class="del_p">删除</p> | ||
29 | + </div> | ||
30 | + <h1 class="mui_title">购物车</h1> | ||
31 | + </header> | ||
32 | + <div class="container"> | ||
33 | + <div class="con_warp"> | ||
34 | + <ul class="con_list_ul first_ul"> | ||
35 | + <volist name="cart" id="cart"> | ||
36 | + <li class="con_list_li"> | ||
37 | + <div class="check_radio first_radio"> | ||
38 | + <!-- <input type="radio"> --> | ||
39 | + <img class="sel_img changeNone" src="__TMPL__/public/assets/images/sure.png" alt=""> | ||
40 | + </div> | ||
41 | + <img class="con_list_img" src="{:cmf_get_image_url($cart.pic)}" alt=""> | ||
42 | + <div class="goods_box" index="{$cart.id}"> | ||
43 | + <p class="goods_title">{$cart.name}</p> | ||
44 | + <span class="goods_content">{$cart.intro}</span> | ||
45 | + <p class="goods_money">¥<span class="onlyMoney">{$cart.money}</span></p> | ||
46 | + <div class="join"> | ||
47 | + <img class="subtract_img" src="__TMPL__/public/assets/images/item_reduce.png " alt=""> | ||
48 | + <p class="number">{$cart.num} </p> | ||
49 | + <img class="add_img" src="__TMPL__/public/assets/images/item_add.png" alt=""> | ||
50 | + </div> | ||
51 | + </div> | ||
52 | + </li> | ||
53 | + </volist> | ||
54 | + </ul> | ||
55 | + </div> | ||
56 | + </div> | ||
57 | + <div class="zhifu"> | ||
58 | + <div class="radio_box"> | ||
59 | + <div class="all_ckeck "> | ||
60 | + <!-- <input type="radio"> --> | ||
61 | + <img class="all changeNone" src="__TMPL__/public/assets/images/sure.png" alt=""> | ||
62 | + </div> | ||
63 | + <p>全选</p> | ||
64 | + </div> | ||
65 | + <div class="pay"> | ||
66 | + <p class="to_pay">前往支付</p> | ||
67 | + <p class="all_price"> 合计:<span>¥<span class="change_money">0.00</span></span></p> | ||
68 | + </div> | ||
69 | + </div> | ||
70 | + <footer class="footer"> | ||
71 | + <ul class="bottom_list"> | ||
72 | + <li id="index_bar" class="mainpage_botlist index_bar"><img src="__TMPL__/public/assets/images/index.png" alt=""><span>首页</span></li> | ||
73 | + <li id="buy_car" class="mainpage_botlist buy_car"><img src="__TMPL__/public/assets/images/cdvcd@1x_checked.png" alt=""><span>购物车</span></li> | ||
74 | + <li id="personal_center" class="mainpage_botlist personal_center"><img src="__TMPL__/public/assets/images/personal.png" alt=""><span>我的</span></li> | ||
75 | + </ul> | ||
76 | + </footer> | ||
77 | + </div> | ||
78 | + <script src="__TMPL__/public/assets/js/common.js"></script> | ||
79 | + <script> | ||
80 | + // 购物车数量 start | ||
81 | + var shopping_id = 0; | ||
82 | + var is_add = 0; | ||
83 | + // 购物车数量减少 | ||
84 | + $('.subtract_img').click(function () { | ||
85 | + shopping_id = $(this).parent().parent().attr('index'); | ||
86 | + is_add = 2; | ||
87 | + changenum($(this)); | ||
88 | + }); | ||
89 | + // 购物车数量增加 | ||
90 | + $('.add_img').click(function () { | ||
91 | + shopping_id = $(this).parent().parent().attr('index'); | ||
92 | + is_add = 1; | ||
93 | + changenum($(this)); | ||
94 | + }); | ||
95 | + function changenum(k) { | ||
96 | + $.ajax({ | ||
97 | + type:"POST", | ||
98 | + url:"{:url('Shopping/changeShopping')}", | ||
99 | + data:{ | ||
100 | + "shopping_id":shopping_id, | ||
101 | + "is_add":is_add, | ||
102 | + }, | ||
103 | + success:function (data) { | ||
104 | + var count_allFirst = 0; | ||
105 | + if(data.code == '1'){ | ||
106 | + k.parent().find('.number').html(data.data.number); | ||
107 | + var is_has = k.parent().parent().parent().find('.sel_img').hasClass('show'); | ||
108 | + if(is_has == true){ | ||
109 | + $('.show').map(function () { | ||
110 | + var money = $(this).parent().parent().find('.onlyMoney').text(); | ||
111 | + var num = $(this).parent().parent().find('.number').text(); | ||
112 | + count_allFirst += parseFloat(money)*parseFloat(num); | ||
113 | + }) | ||
114 | + // 更改总额 | ||
115 | + var final = count_allFirst.toFixed(2); | ||
116 | + $('.change_money').text(final); | ||
117 | + } | ||
118 | + }else{ | ||
119 | + alert(data.message); | ||
120 | + } | ||
121 | + }, | ||
122 | + error:function () { | ||
123 | + } | ||
124 | + }) | ||
125 | + } | ||
126 | + | ||
127 | + // end | ||
128 | + // 选中 | ||
129 | + $('.first_radio').click(function () { | ||
130 | + // 增加样式 | ||
131 | + var count_all = 0; | ||
132 | + if($(this).find('.sel_img').hasClass('show')){ | ||
133 | + $(this).find('.sel_img').removeClass('show'); | ||
134 | + $(this).find('.sel_img').addClass('changeNone'); | ||
135 | + }else{ | ||
136 | + $(this).find('.sel_img').removeClass('changeNone'); | ||
137 | + $(this).find('.sel_img').addClass('show'); | ||
138 | + | ||
139 | + } | ||
140 | + $('.first_radio .show').map(function () { | ||
141 | + var money = $(this).parent().parent().find('.onlyMoney').text(); | ||
142 | + var num = $(this).parent().parent().find('.number').text(); | ||
143 | + count_all += parseFloat(money)*parseFloat(num); | ||
144 | + }) | ||
145 | + // 更改总额 | ||
146 | + var final = count_all.toFixed(2); | ||
147 | + $('.change_money').text(final); | ||
148 | + // 全选 | ||
149 | + var all_con = $(".first_ul .con_list_li").length; | ||
150 | + var choose_con = $(".first_ul .show").length; | ||
151 | + if(all_con == choose_con){ | ||
152 | + $('.all_ckeck').find('.all').removeClass('changeNone'); | ||
153 | + $('.all_ckeck').find('.all').addClass('show'); | ||
154 | + }else{ | ||
155 | + $('.all_ckeck').find('.all').removeClass('show'); | ||
156 | + $('.all_ckeck').find('.all').addClass('changeNone'); | ||
157 | + } | ||
158 | + }); | ||
159 | + // 全选 | ||
160 | + $('.all_ckeck').click(function () { | ||
161 | + if($('.all_ckeck').find('img').hasClass('show')){ | ||
162 | + $('.first_ul li').find('.sel_img').removeClass('show'); | ||
163 | + $('.first_ul li').find('.sel_img').addClass('changeNone'); | ||
164 | + $('.all_ckeck').find('img').removeClass('show'); | ||
165 | + $('.all_ckeck').find('img').addClass('changeNone'); | ||
166 | + }else{ | ||
167 | + $('.first_ul li').find('.sel_img').removeClass('changeNone'); | ||
168 | + $('.first_ul li').find('.sel_img').addClass('show'); | ||
169 | + $('.all_ckeck').find('img').removeClass('changeNone'); | ||
170 | + $('.all_ckeck').find('img').addClass('show'); | ||
171 | + } | ||
172 | + var count_all = 0; | ||
173 | + $('.first_radio .show').map(function () { | ||
174 | + var money = $(this).parent().parent().find('.onlyMoney').text(); | ||
175 | + var num = $(this).parent().parent().find('.number').text(); | ||
176 | + count_all += parseFloat(money)*parseFloat(num); | ||
177 | + }) | ||
178 | + // 更改总额 | ||
179 | + var final = count_all.toFixed(2); | ||
180 | + $('.change_money').text(final); | ||
181 | + }) | ||
182 | + | ||
183 | + | ||
184 | + //删除 | ||
185 | + $('.delete_box').on('click', function() { | ||
186 | + var del_arr = []; | ||
187 | + $('.first_ul').find('.show').map(function () { | ||
188 | + var del_id = $(this).parent().parent().find('.goods_box').attr('index'); | ||
189 | + del_arr.push(del_id); | ||
190 | + }) | ||
191 | + if(del_arr.length == 0){ | ||
192 | + alert('请选择您要删除的物品!') | ||
193 | + }else{ | ||
194 | + $.ajax({ | ||
195 | + type:"POST", | ||
196 | + url:"{:url('Shopping/delShopping')}", | ||
197 | + data:{ | ||
198 | + "shopping_id":del_arr, | ||
199 | + }, | ||
200 | + success:function (data) { | ||
201 | + alert(data.message); | ||
202 | + if(data.code == 1){ | ||
203 | + window.location.reload(); | ||
204 | + } | ||
205 | + }, | ||
206 | + error:function () { | ||
207 | + } | ||
208 | + }) | ||
209 | + } | ||
210 | + | ||
211 | + }); | ||
212 | + | ||
213 | + | ||
214 | + | ||
215 | + | ||
216 | + // $(document).ready(function() { | ||
217 | + // var $menu_box = $('.content_body .con_title>li'); | ||
218 | + // $menu_box.click(function() { | ||
219 | + // $(this).addClass('con_curr').siblings().removeClass('con_curr'); | ||
220 | + // var index = $menu_box.index(this); | ||
221 | + // $('.con_all .con_warp').eq(index).show().siblings().hide(); | ||
222 | + // }); | ||
223 | + // }) | ||
224 | + //勾选 | ||
225 | + // $('.check_radio').on('click', function() { | ||
226 | + // | ||
227 | + // if ($('.check_radio img').is(':hidden')) { //如果当前隐藏 | ||
228 | + // $('.check_radio img').show(); //那么就显示div | ||
229 | + // $('.check_radio').css('border', '0.01rem solid #FFF'); | ||
230 | + // | ||
231 | + // } else { //否则 | ||
232 | + // $('.check_radio img').hide(); //就隐藏div | ||
233 | + // $('.check_radio').css('border', '0.01rem solid rgba(0,0,0,0.4)'); | ||
234 | + // } | ||
235 | + // if ($('.con_list_li').length == 1 && $('.check_radio img').is(':hidden') == false) { | ||
236 | + // $('.all_ckeck img').show(); | ||
237 | + // $('.all_ckeck').css('border', '0.01rem solid #FFF'); | ||
238 | + // } else { | ||
239 | + // $('.all_ckeck img').hide(); | ||
240 | + // $('.all_ckeck').css('border', '0.01rem solid rgba(0,0,0,0.4)'); | ||
241 | + // | ||
242 | + // } | ||
243 | + // }) | ||
244 | + // //全部勾选 | ||
245 | + // $('.all_ckeck').on('click', function() { | ||
246 | + // if ($('.all_ckeck img').is(':hidden')) { //如果当前隐藏 | ||
247 | + // $('.all_ckeck img').show(); //那么就显示tupain | ||
248 | + // $('.all_ckeck').css('border', '0.01rem solid #FFF'); | ||
249 | + // $('.check_radio img').show(); //那么就显示div | ||
250 | + // $('.check_radio').css('border', '0.01rem solid #FFF'); | ||
251 | + // } else { | ||
252 | + // $('.check_radio img').hide(); | ||
253 | + // $('.check_radio').css('border', 'none') | ||
254 | + // $('.check_radio').css('border', '0.01em solid rgba(0,0,0,0.4)'); | ||
255 | + // $('.all_ckeck img').hide(); //那么就显示div | ||
256 | + // $('.all_ckeck ').css('border', '0.01rem solid rgba(0,0,0,0.4)'); | ||
257 | + // | ||
258 | + // } | ||
259 | + // | ||
260 | + // }) | ||
261 | + //导航栏跳转 | ||
262 | + $('#index_bar').on('click', function() { window.location.href = "{:url('Index/index')}" }); | ||
263 | + $('#personal_center').on('click', function() { window.location.href = "{:url('User/index')}"}) | ||
264 | + </script> | ||
265 | +</body> | ||
266 | + | ||
267 | +</html> |
1 | -<!DOCTYPE html> | ||
2 | -<html lang="zh-CN"> | ||
3 | - | ||
4 | -<head> | ||
5 | - <meta charset="UTF-8"> | ||
6 | - <title>2-7购物车</title> | ||
7 | - <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1"> | ||
8 | - <link rel="stylesheet" href="../css/base.css"> | ||
9 | - <link rel="stylesheet" href="../css/swiper.min.css"> | ||
10 | - <link rel="stylesheet" href="../css/common/buy_car.css"> | ||
11 | - <script src="__TMPL__/public/assets/js/jquery.min.js" type="text/javascript" charset="utf-8"></script> | ||
12 | - <script src="__TMPL__/public/assets/js/swiper.min.js" type="text/javascript" charset="utf-8"></script> | ||
13 | - <script src="__TMPL__/public/assets/js/base.js" type="text/javascript" charset="utf-8"></script> | ||
14 | - <style> | ||
15 | - | ||
16 | - </style> | ||
17 | -</head> | ||
18 | - | ||
19 | -<body> | ||
20 | - <header class="mui_bar"> | ||
21 | - <div class="delete_box"> | ||
22 | - <img class="del_img" src="__TMPL__/public/assets/images/sdfadgas@2x.png" alt=""> | ||
23 | - <p class="del_p">删除</p> | ||
24 | - </div> | ||
25 | - <h1 class="mui_title">购物车</h1> | ||
26 | - </header> | ||
27 | - <div class="container"> | ||
28 | - <div class="con_warp"> | ||
29 | - <ul class="con_list_ul first_ul"> | ||
30 | - <volist name="cart" id="cart"> | ||
31 | - <li class="con_list_li"> | ||
32 | - <div class="check_radio"> | ||
33 | - <!-- <input type="radio"> --> | ||
34 | - <img class="sel_img" style="display: none;" src="__TMPL__/public/assets/images/sure.png" alt=""> | ||
35 | - </div> | ||
36 | - <img class="con_list_img" src="__TMPL__/public/assets/images/5653ceba1a219@2x.png" alt=""> | ||
37 | - <div class="goods_box"> | ||
38 | - <p class="goods_title">HO56C手动轮椅车</p> | ||
39 | - <span class="goods_content">体积更小轻松放入汽车后备箱</span> | ||
40 | - <p class="goods_money">¥2000.00</p> | ||
41 | - <div class="join"> | ||
42 | - <img class="subtract_img" src="__TMPL__/public/assets/images/item_reduce.png " alt=""> | ||
43 | - <p>1 </p> | ||
44 | - <img class="add_img" src="__TMPL__/public/assets/images/item_add.png" alt=""> | ||
45 | - </div> | ||
46 | - </div> | ||
47 | - </li> | ||
48 | - </volist> | ||
49 | - </ul> | ||
50 | - </div> | ||
51 | - </div> | ||
52 | - <div class="zhifu"> | ||
53 | - <div class="radio_box"> | ||
54 | - <div class="all_ckeck "> | ||
55 | - <!-- <input type="radio"> --> | ||
56 | - <img style="display: none;" src="__TMPL__/public/assets/images/sure.png" alt=""> | ||
57 | - </div> | ||
58 | - <p>全选</p> | ||
59 | - </div> | ||
60 | - <div class="pay"> | ||
61 | - <p class="to_pay">前往支付</p> | ||
62 | - <p class="all_price"> 合计:<span>¥4000.00</span></p> | ||
63 | - </div> | ||
64 | - </div> | ||
65 | - <footer class="footer"> | ||
66 | - <ul class="bottom_list"> | ||
67 | - <li id="index_bar" class="mainpage_botlist index_bar"><img src="__TMPL__/public/assets/images/index.png" alt=""><span>首页</span></li> | ||
68 | - <li id="buy_car" class="mainpage_botlist buy_car"><img src="__TMPL__/public/assets/images/cdvcd@1x_checked.png" alt=""><span>购物车</span></li> | ||
69 | - <li id="personal_center" class="mainpage_botlist personal_center"><img src="__TMPL__/public/assets/images/personal.png" alt=""><span>我的</span></li> | ||
70 | - </ul> | ||
71 | - </footer> | ||
72 | - </div> | ||
73 | - <script src="__TMPL__/public/assets/js/common.js"></script> | ||
74 | - <script> | ||
75 | - $(document).ready(function() { | ||
76 | - get_main_content(); | ||
77 | - | ||
78 | - var $menu_box = $('.content_body .con_title>li'); | ||
79 | - $menu_box.click(function() { | ||
80 | - $(this).addClass('con_curr').siblings().removeClass('con_curr'); | ||
81 | - var index = $menu_box.index(this); | ||
82 | - $('.con_all .con_warp').eq(index).show().siblings().hide(); | ||
83 | - }); | ||
84 | - }) | ||
85 | - | ||
86 | - function get_main_content() { | ||
87 | - | ||
88 | - } | ||
89 | - //删除 | ||
90 | - $('.delete_box').on('click', function() { | ||
91 | - if ($('.con_list_li .sel_img').is(':hidden')) { | ||
92 | - | ||
93 | - } else { | ||
94 | - $('.con_list_li').hide(); | ||
95 | - $('.all_ckeck img').hide(); | ||
96 | - } | ||
97 | - | ||
98 | - }); | ||
99 | - //勾选 | ||
100 | - $('.check_radio').on('click', function() { | ||
101 | - | ||
102 | - if ($('.check_radio img').is(':hidden')) { //如果当前隐藏 | ||
103 | - $('.check_radio img').show(); //那么就显示div | ||
104 | - $('.check_radio').css('border', '0.01rem solid #FFF'); | ||
105 | - | ||
106 | - } else { //否则 | ||
107 | - $('.check_radio img').hide(); //就隐藏div | ||
108 | - $('.check_radio').css('border', '0.01rem solid rgba(0,0,0,0.4)'); | ||
109 | - } | ||
110 | - if ($('.con_list_li').length == 1 && $('.check_radio img').is(':hidden') == false) { | ||
111 | - $('.all_ckeck img').show(); | ||
112 | - $('.all_ckeck').css('border', '0.01rem solid #FFF'); | ||
113 | - } else { | ||
114 | - $('.all_ckeck img').hide(); | ||
115 | - $('.all_ckeck').css('border', '0.01rem solid rgba(0,0,0,0.4)'); | ||
116 | - | ||
117 | - } | ||
118 | - }) | ||
119 | - //全部勾选 | ||
120 | - $('.all_ckeck').on('click', function() { | ||
121 | - if ($('.all_ckeck img').is(':hidden')) { //如果当前隐藏 | ||
122 | - $('.all_ckeck img').show(); //那么就显示tupain | ||
123 | - $('.all_ckeck').css('border', '0.01rem solid #FFF'); | ||
124 | - $('.check_radio img').show(); //那么就显示div | ||
125 | - $('.check_radio').css('border', '0.01rem solid #FFF'); | ||
126 | - } else { | ||
127 | - $('.check_radio img').hide(); | ||
128 | - $('.check_radio').css('border', 'none') | ||
129 | - $('.check_radio').css('border', '0.01em solid rgba(0,0,0,0.4)'); | ||
130 | - $('.all_ckeck img').hide(); //那么就显示div | ||
131 | - $('.all_ckeck ').css('border', '0.01rem solid rgba(0,0,0,0.4)'); | ||
132 | - | ||
133 | - } | ||
134 | - | ||
135 | - }) | ||
136 | - //导航栏跳转 | ||
137 | - $('#index_bar').on('click', function() { window.location.href = '../index.html' }); | ||
138 | - $('#personal_center').on('click', function() { window.location.href = '../user/personal_center.html' }) | ||
139 | - </script> | ||
140 | -</body> | ||
141 | - | ||
142 | -</html> |
-
请 注册 或 登录 后发表评论