Commit 166cb0a290ae909632162c7679b81ecb7a727d66
1 parent
90827590
Exists in
master
app-wx(v0.1.0 build 6)
1. F 订单详情界面调整 2. F 报价界面增加操作 3. F 评论界面增加操作
Showing
19 changed files
with
630 additions
and
202 deletions
Show diff stats
app-wx/config/params.php
app-wx/modules/order/controllers/BaseController.php
... | ... | @@ -19,6 +19,6 @@ class BaseController extends AppBaseController |
19 | 19 | public function init() |
20 | 20 | { |
21 | 21 | parent::init(); // TODO: Change the autogenerated stub |
22 | - $this->handleMallAccessCtrl(); | |
22 | + //$this->handleMallAccessCtrl(); | |
23 | 23 | } |
24 | 24 | } |
25 | 25 | \ No newline at end of file | ... | ... |
app-wx/modules/order/controllers/DefaultController.php
... | ... | @@ -97,4 +97,76 @@ class DefaultController extends BaseController |
97 | 97 | |
98 | 98 | return [$count, $pageCount, $items]; |
99 | 99 | } |
100 | + | |
101 | + /** | |
102 | + * @return string | |
103 | + */ | |
104 | + public function actionOrderDetails() | |
105 | + { | |
106 | + $e = new stdClass(); | |
107 | + $e->success = false; | |
108 | + $e->message = 'ok'; | |
109 | + | |
110 | + $e->success = true; | |
111 | + $e->item = [ | |
112 | + 'carNo' => 'XX12345', | |
113 | + 'carModel' => '宝马X3', | |
114 | + 'customer' => '李先生', | |
115 | + 'mobile' => '13900139001', | |
116 | + 'preRepair' => '更换轮胎', | |
117 | + 'repairPrice' => '300元', | |
118 | + 'preFinishDate' => '2019-12-15 15:00', | |
119 | + 'orderDateTime' => '2019-12-14 15:00', | |
120 | + 'status' => 'finish', | |
121 | + 'hasComment' => false, | |
122 | + 'brokenImages' => [ | |
123 | + Yii::$app->request->baseUrl.'/i/order/demo.jpg', Yii::$app->request->baseUrl.'/i/order/demo.jpg', Yii::$app->request->baseUrl.'/i/order/demo.jpg' | |
124 | + ], | |
125 | + 'repairPlans' => [ | |
126 | + ['content' => '更换车胎', | |
127 | + 'price' => 450], | |
128 | + ['content' => '更换车胎', | |
129 | + 'price' => 450], | |
130 | + ['content' => '更换车胎', | |
131 | + 'price' => 450], | |
132 | + ], | |
133 | + 'totalPrice' => 1350, | |
134 | + 'finishImages' => [ | |
135 | + Yii::$app->request->baseUrl.'/i/order/demo.jpg', Yii::$app->request->baseUrl.'/i/order/demo.jpg', Yii::$app->request->baseUrl.'/i/order/demo.jpg' | |
136 | + ] | |
137 | + ]; | |
138 | + | |
139 | + return $this->renderJson($e); | |
140 | + } | |
141 | + | |
142 | + /** | |
143 | + * @return string | |
144 | + */ | |
145 | + public function actionSubmitRepairPlans() | |
146 | + { | |
147 | + $e = new stdClass(); | |
148 | + $e->success = false; | |
149 | + $e->message = 'ok'; | |
150 | + $repairPlans = $this->request->post('plans'); | |
151 | + $images = $this->request->post('images'); | |
152 | + | |
153 | + //print_r($images); | |
154 | + //print_r($repairPlans); | |
155 | + $e->success = true; | |
156 | + return $this->renderJson($e); | |
157 | + } | |
158 | + | |
159 | + public function actionSubmitRate() | |
160 | + { | |
161 | + $e = new stdClass(); | |
162 | + $e->success = false; | |
163 | + $e->message = 'ok'; | |
164 | + $star = $this->request->post('star'); | |
165 | + $comment = $this->request->post('comment'); | |
166 | + | |
167 | + echo $star.'_'.$comment; | |
168 | + $e->success = true; | |
169 | + return $this->renderJson($e); | |
170 | + } | |
171 | + | |
100 | 172 | } |
101 | 173 | \ No newline at end of file | ... | ... |
app-wx/modules/order/views/default/index.php
... | ... | @@ -24,7 +24,7 @@ function img($file, $path = '/i/') |
24 | 24 | <?=$this->render('pages/rate-template', ['asset' => $asset])?> |
25 | 25 | <?=$this->render('pages/submit-template', ['asset' => $asset])?> |
26 | 26 | <?=$this->render('pages/cost-list-template', ['asset' => $asset])?> |
27 | -<?=$this->render('pages/repairing-template', ['asset' => $asset])?> | |
27 | +<?=$this->render('pages/order-details-template', ['asset' => $asset])?> | |
28 | 28 | |
29 | 29 | <script> |
30 | 30 | require.config({baseUrl: $site.assets_url + '/js/',urlArgs : "v=" + require.version}); | ... | ... |
app-wx/modules/order/views/default/pages/cost-list-template.php
... | ... | @@ -3,36 +3,50 @@ use yii\helpers\Url; |
3 | 3 | $baseUrl = Url::base(true); |
4 | 4 | ?> |
5 | 5 | <style> |
6 | - body,div,p,span,input{padding: 0;margin: 0} | |
6 | + body,div,p,span,input,ul,li{padding: 0;margin: 0} | |
7 | 7 | input{-webkit-appearance: none;} |
8 | 8 | #cost-list .content-div { background: #fff; height: auto;padding: 1rem} |
9 | - #cost-list .content-div-two { background: #fff; height: auto;padding: 1rem;margin-top: 0.63rem} | |
9 | + | |
10 | 10 | #cost-list .page-content{ background-color: #ECF0F2 } |
11 | 11 | #cost-list .cost-list-title { width:100%; font-size:1.07rem; font-weight:bold; color:rgba(0,0,0,1); line-height:1.81rem;} |
12 | - #cost-list .title-tip{ font-size:1rem; font-weight:400; color:rgba(255,135,40,1); line-height:1.82rem; float: right} | |
13 | - #cost-list .cost-list-title-two { font-size:1rem; font-weight:400; color:rgba(0,0,0,1); line-height:1.81rem;} | |
12 | + #cost-list .title-tip{ font-size:1rem; font-weight:400; color:rgba(255,135,40,1); line-height:1.82rem; float: right;display: flex;align-items: center;} | |
13 | + | |
14 | 14 | #cost-list .cost-list-div {width:100%;margin-top: 1rem; } |
15 | 15 | #cost-list .cost-list-add {width:100%;margin-top: 0.5rem; } |
16 | 16 | #cost-list .pic-div {width:100%;margin-top: 0.5rem; } |
17 | 17 | #cost-list .cost-total-list-div {width:100%;margin-top: 1rem; text-align: right} |
18 | 18 | #cost-list .cost-total-title {font-size:0.81rem;font-weight:400;color:rgba(85,85,85,1);line-height:1.69rem;} |
19 | 19 | #cost-list .cost-total-price { font-size:1.13rem; font-weight:400; color:rgba(0,0,0,1); line-height:1.69rem;} |
20 | + | |
21 | + #cost-list .repair-item-cls{display: flex;width: 100%;line-height: 1rem;position:relative} | |
20 | 22 | #cost-list .img-plus {width: 1rem; height: 1rem; vertical-align: text-top; margin-right: 0.2rem} |
21 | - #cost-list .item-title { font-size:0.88rem; font-weight:400; color:rgba(186,186,186,1); line-height:1.81rem;} | |
23 | + #cost-list .item-title { font-size:0.88rem;display:inline-block;font-weight:400; color:rgba(186,186,186,1); line-height:1.81rem;} | |
24 | + #cost-list .input-cls{font-size: 1rem;line-height: inherit} | |
22 | 25 | #cost-list .input-left {width:70%; padding: 0 0.5rem; height:2.47rem; background:rgba(255,255,255,1); border:1px solid rgba(221,221,221,1); border-radius:0rem 0rem 0rem 0rem;} |
23 | 26 | #cost-list .input-right {width:30%; height:2.47rem; padding: 0 0.5rem; text-align: center; background:rgba(255,255,255,1); border:1px solid rgba(221,221,221,1); border-radius:0rem 0rem 0rem 0rem; border-left: none} |
24 | - #cost-list .two-tip{ font-size:0.75rem; font-weight:400; color:rgba(85,85,85,1); line-height:1.81rem;} | |
25 | - #cost-list .add-pic{width: 3.91rem;height: 3.91rem} | |
26 | - #cost-list .btn-submit{width:85%;text-align: center;line-height: 3.06rem; | |
27 | - height:3.06rem; | |
27 | + #cost-list .repair-item-cls .del-plan{width:1.2rem;position: absolute;top: -18px;right: -2px;height: 1.2rem;background: url('<?=$baseUrl?>/i/order/trash.png');background-repeat: no-repeat;background-size: 1rem auto;background-position: 1px 1px;display:inline-block;z-index:12} | |
28 | + #cost-list .upload-box{padding: 1rem;box-sizing: border-box;background:#fff;margin-top:1rem;} | |
29 | + #cost-list .upload-box .upload-title{line-height: 1.5rem;color:#000000;margin-bottom: 0.5rem;font-size:1rem;} | |
30 | + #cost-list .upload-box .note-cls{color:#555555;font-size:0.75rem} | |
31 | + #cost-list .img-box-cls{width:100%;} | |
32 | + #cost-list .img-box-cls .upload-li{width:25%;display:block;padding-right:0.2rem;padding-bottom: 0.2rem;float:left;box-sizing: border-box;position:relative} | |
33 | + #cost-list .upload-box .upload-item{width:100%;height:0;padding-bottom: 100%;overflow:hidden; | |
34 | + background-position: center center; | |
35 | + background-repeat: no-repeat; | |
36 | + -webkit-background-size:cover; | |
37 | + -moz-background-size:cover;background-size:cover;position: relative} | |
38 | + #cost-list .upload-box .upload-item{background-image:url('<?=$baseUrl?>/i/order/upload-convert.png');background-repeat: no-repeat;background-position: 1px 1px;} | |
39 | + #cost-list .upload-box .upload-input-cls{width: 100%;display: block;background: rgba(0,0,0,0);opacity: 0;height: 0;padding-bottom: 100%;} | |
40 | + #cost-list .upload-box .upload-btn-cls{background-size: 4.75rem auto;} | |
41 | + #cost-list .upload-box .del-img{position: absolute;top: 0;left: 0;width: 0.8rem;height: 0.9rem;background-image:url('<?=$baseUrl?>/i/order/trash.png');background-repeat: no-repeat;background-size: 0.8rem auto;background-color:#fff;border-radius: 0.2rem;} | |
42 | + #cost-list .btn-submit{width:85%;text-align: center;line-height: 1rem; | |
43 | + margin: 2.5rem auto 2rem auto; | |
44 | + padding: 0.9rem 0; | |
28 | 45 | background:rgba(255,135,40,1); |
29 | 46 | border-radius:2rem; |
30 | 47 | font-size:1.06rem; |
31 | 48 | font-weight:400; |
32 | 49 | color:rgba(255,255,255,1); |
33 | - margin: 0 auto; | |
34 | - margin-top: 9rem; | |
35 | - margin-bottom: 2rem; | |
36 | 50 | } |
37 | 51 | </style> |
38 | 52 | <script id="cost-list-template" type="text/template"> |
... | ... | @@ -41,30 +55,32 @@ $baseUrl = Url::base(true); |
41 | 55 | <div class="page-content"> |
42 | 56 | <div class="content-div"> |
43 | 57 | <div class="cost-list-title">维修费用清单 |
44 | - <span class="title-tip"> | |
58 | + <span class="title-tip add-repair-plan"> | |
45 | 59 | <img src="<?= $baseUrl . "/i/order/plus.png"?>" class="img-plus">添加 |
46 | 60 | </span> |
47 | 61 | </div> |
48 | 62 | <div class="cost-list-div"> |
49 | 63 | <p class="item-title">第1项</p> |
50 | - <div style="display: flex;width: 100%"> | |
51 | - <input type="text" class="input-left" placeholder="填写维修内容" value="更换车轮胎"/><input type="text" class="input-right" placeholder="填写价格" value="250"/> | |
52 | - </div> | |
53 | - </div> | |
54 | - <div class="cost-list-add"> | |
55 | - <p class="item-title">第2项</p> | |
56 | - <div style="display: flex;width: 100%"> | |
57 | - <input type="text" class="input-left" placeholder="填写维修内容"/><input type="text" class="input-right" placeholder="填写价格"/> | |
64 | + <div class="repair-item-cls"> | |
65 | + <input type="text" class="input-left input-cls" placeholder="填写维修内容" value=""/><input type="number" class="input-right input-cls" placeholder="填写价格" value="0"/> | |
66 | + | |
58 | 67 | </div> |
59 | 68 | </div> |
69 | + | |
60 | 70 | <div class="cost-total-list-div"> |
61 | - <span class="cost-total-title">总金额:</span><span class="cost-total-price">¥250</span> | |
71 | + <span class="cost-total-title">总金额:</span><span class="cost-total-price">¥<span class="total-plan-price">0</span></span> | |
62 | 72 | </div> |
63 | 73 | </div> |
64 | - <div class="content-div-two"> | |
65 | - <div class="cost-list-title-two">维修完成照片 <span class="two-tip">(选传,最多9张)</span></div> | |
66 | - <div class="pic-div"> | |
67 | - <img src="<?= $baseUrl . "/i/order/add_pic.png"?>" class="add-pic"> | |
74 | + <div class="upload-box"> | |
75 | + <div class="upload-title">维修完成照片 <span class="note-cls">(选传,最多9张)</span></div> | |
76 | + <div class="img-box-cls"> | |
77 | + <ul id ="image-list" style="overflow: hidden;margin-top:1rem"> | |
78 | + <li class="upload-li upload-btn-li"> | |
79 | + <div class="upload-item upload-btn-cls"> | |
80 | + <input type="file" id="upload-btn" class="upload-input-cls" name="file" accept="image/*"/> | |
81 | + </div> | |
82 | + </li> | |
83 | + </ul> | |
68 | 84 | </div> |
69 | 85 | </div> |
70 | 86 | <div class="btn-submit"> 提交 </div> | ... | ... |
app-wx/modules/order/views/default/pages/order-details-template.php
0 → 100644
... | ... | @@ -0,0 +1,197 @@ |
1 | +<?php | |
2 | +use yii\helpers\Url; | |
3 | +$baseUrl = Url::base(true); | |
4 | +?> | |
5 | +<style> | |
6 | + body,div,p,span,input{padding: 0;margin: 0} | |
7 | + input{-webkit-appearance: none;} | |
8 | + ul,li{list-style: none } | |
9 | + #order-details .content-div { width:100%; background: #fff; display:inline-flex;padding-top: 1rem} | |
10 | + #order-details .left-title-div {width:33%; font-size:1rem; font-weight:400; color:rgba(0,0,0,1); line-height:1.81rem;} | |
11 | + #order-details .center-content-div {width:47%; font-size:1rem; font-weight:400; color:rgba(118,118,118,1); line-height:1.81rem;} | |
12 | + #order-details .right-content-div {width:20%;font-size:0.94rem; font-weight:400; color:rgba(255,255,255,1);line-height:1.81rem;} | |
13 | + #order-details .content-div-two {width:100%; background: #fff; display:inline-flex;height: 1.81rem;} | |
14 | + #order-details .page-content{ background-color: #ECF0F2 } | |
15 | + #order-details .content-list-div {padding-bottom: 1rem} | |
16 | + #order-details .status-tip {width: 4.81rem; | |
17 | + padding: 0.2rem 0; | |
18 | + height: 1.81rem; | |
19 | + background-color:#ff7b24; | |
20 | + border-top-left-radius: 1rem; | |
21 | + border-bottom-left-radius: 1rem; | |
22 | + text-align: center; | |
23 | + float: right;} | |
24 | + #order-details .btn-submit-cls{width:85%;text-align: center;margin: 2rem auto;margin-top:2.5rem; | |
25 | + background:rgba(255,135,40,1); border-radius:2rem; font-size:1.06rem; font-weight:400; | |
26 | + color:rgba(255,255,255,1);padding:1rem 0 } | |
27 | + #order-details .pic-div { | |
28 | + width:100%; background: #fff; display:inline-flex;height: 1.81rem; | |
29 | + } | |
30 | + #order-details .pic-image-div { | |
31 | + width: 100%;background: #fff; padding-bottom: 1rem; margin: 0 auto; | |
32 | + } | |
33 | + #order-details .pic-image-list { | |
34 | + padding: 0.5rem 1rem;box-sizing: border-box;width:100%;display: block;overflow: hidden; | |
35 | + } | |
36 | + #order-details .pic-image-list .img-cls{width:25%;box-sizing: border-box;float:left;padding-top:0.3rem;padding-right:0.3rem;} | |
37 | + | |
38 | + #order-details .pic-class { margin-right: 0.5rem width:100%;height:0;padding-bottom: 100%;overflow:hidden; | |
39 | + background-position: center center; | |
40 | + background-repeat: no-repeat; | |
41 | + -webkit-background-size:cover; | |
42 | + -moz-background-size:cover;background-size:cover;position: relative} | |
43 | + #order-details .padding-left-1rem {padding-left: 1rem} | |
44 | + #order-details .content-wrapper{background:#fff;padding:1rem;box-sizing: border-box;margin-bottom:0.8rem;} | |
45 | + #order-details .content-wrapper .content-title{font-size: 1.06rem;color:#000;font-weight: bold;padding-bottom: 0.8rem;} | |
46 | + #order-details .content-wrapper .bullet-point{color: #fff;background: #ff7b24;border: 0;display: block;height:1rem;width: 1.0rem;text-align: center;border-radius: 0.5rem;font-size: 0.7rem;line-height: 1rem;} | |
47 | + #order-details .content-wrapper .plan-right-cls{padding-bottom: 0.5rem;margin-left:0.5rem;width:100%;} | |
48 | + #order-details .content-wrapper .plan-price-cls{font-size:0.75rem;color:#333;line-height: 1.5rem;} | |
49 | + #order-details .content-wrapper .repair-plan-list{width:100%;display: block;position: relative} | |
50 | + #order-details .content-wrapper .repair-plan-list:after{content:'';width:100%;height: 1px;background:#DBDBDB;display:block;} | |
51 | + #order-details .content-wrapper .total-price-cls{margin-top:0.5rem;color:#000} | |
52 | + #order-details .content-wrapper .finish-image-list{width:100%;display:block;} | |
53 | + #order-details .content-wrapper .finish-image-ul{width:100%;display:block;overflow: hidden;box-sizing: border-box;} | |
54 | + #order-details .content-wrapper .finish-image-li{width:25%;display:block;padding-top:0.3rem;padding-right:0.3rem;float:left;box-sizing: border-box;} | |
55 | + #order-details .content-wrapper .finishImage{width: 100%; | |
56 | + height: 0; | |
57 | + padding-bottom: 100%; | |
58 | + overflow: hidden; | |
59 | + background-position: center center; | |
60 | + background-repeat: no-repeat; | |
61 | + -webkit-background-size: cover; | |
62 | + -moz-background-size: cover; | |
63 | + background-size: cover; | |
64 | + position: relative;} | |
65 | + #order-details .content-wrapper .comment-box{width:100%;display: flex;color:#000;align-items: center;justify-content: space-between;font-size: 1rem;} | |
66 | + #order-details .content-wrapper .rate-btn-cls{color:#fff;border-radius: 1.5rem;padding:0.6rem 0.8rem;text-align: center;background:#FF8728;width:4rem;} | |
67 | + #order-details .content-wrapper .comment-txt-cls{color:#000;font-size: 1rem;line-height: 1.5rem } | |
68 | +</style> | |
69 | +<script id="order-details-template" type="text/template"> | |
70 | + <div class="pages"> | |
71 | + <div class="page" id="order-details" style="background: #fff"> | |
72 | + <div class="page-content"> | |
73 | + <div class="content-list-div"> | |
74 | + <div class="content-div"> | |
75 | + <div class="left-title-div"><span class="padding-left-1rem">车牌号码</span></div> | |
76 | + <div class="center-content-div">{{item.carNo}} </div> | |
77 | + <div class="right-content-div"> | |
78 | + {{#js_compare "'working' == this.item.status"}} | |
79 | + <span class="status-tip"> | |
80 | + 进行中 | |
81 | + </span> | |
82 | + {{else}} | |
83 | + <span class="status-tip" style="color:#FFA903;background:#fef0d5"> | |
84 | + 已完成 | |
85 | + </span> | |
86 | + {{/js_compare}} | |
87 | + </div> | |
88 | + </div> | |
89 | + <div class="content-div-two"> | |
90 | + <div class="left-title-div"><span class="padding-left-1rem">车辆型号</span></div> | |
91 | + <div class="center-content-div">{{item.carModel}}</div> | |
92 | + <div class="right-content-div"> | |
93 | + </div> | |
94 | + </div> | |
95 | + <div class="content-div-two"> | |
96 | + <div class="left-title-div"><span class="padding-left-1rem">客户名称</span></div> | |
97 | + <div class="center-content-div">{{item.customer}}</div> | |
98 | + <div class="right-content-div"> | |
99 | + </div> | |
100 | + </div> | |
101 | + <div class="content-div-two"> | |
102 | + <div class="left-title-div"><span class="padding-left-1rem">联系电话</span></div> | |
103 | + <div class="center-content-div">{{item.mobile}}</div> | |
104 | + <div class="right-content-div"> | |
105 | + </div> | |
106 | + </div> | |
107 | + <div class="content-div-two"> | |
108 | + <div class="left-title-div"><span class="padding-left-1rem">预估维修内容</span></div> | |
109 | + <div class="center-content-div">{{item.preRepair}}</div> | |
110 | + <div class="right-content-div"> | |
111 | + </div> | |
112 | + </div> | |
113 | + <div class="content-div-two"> | |
114 | + <div class="left-title-div"><span class="padding-left-1rem">预估维修费用</span></div> | |
115 | + <div class="center-content-div">{{item.repairPrice}}</div> | |
116 | + <div class="right-content-div"> | |
117 | + </div> | |
118 | + </div> | |
119 | + <div class="content-div-two"> | |
120 | + <div class="left-title-div"><span class="padding-left-1rem">预估完成时间</span></div> | |
121 | + <div class="center-content-div">{{item.preFinishDate}}</div> | |
122 | + <div class="right-content-div"> | |
123 | + </div> | |
124 | + </div> | |
125 | + <div class="content-div-two"> | |
126 | + <div class="left-title-div"><span class="padding-left-1rem">订单创建时间</span></div> | |
127 | + <div class="center-content-div">{{item.orderDateTime}}</div> | |
128 | + <div class="right-content-div"> | |
129 | + </div> | |
130 | + </div> | |
131 | + <div class="pic-div"> | |
132 | + <div class="left-title-div"><span class="padding-left-1rem">车损照片</span></div> | |
133 | + </div> | |
134 | + <div class="pic-image-div"> | |
135 | + <div class="pic-image-list"> | |
136 | + {{#each item.brokenImages}} | |
137 | + <div class="img-cls"> | |
138 | + <div class="pic-class" style="background-image: url({{this}})"></div> | |
139 | + </div> | |
140 | + {{/each}} | |
141 | + </div> | |
142 | + </div> | |
143 | + </div> | |
144 | + {{#js_compare "'working' == this.item.status"}} | |
145 | + <div class="finish-submit btn-submit-cls"> 完成维修 </div> | |
146 | + {{/js_compare}} | |
147 | + {{#js_compare "'finish' == this.item.status"}} | |
148 | + <div class="content-wrapper"> | |
149 | + <div class="content-title">维修费用清单</div> | |
150 | + <ul class="repair-plan-list"> | |
151 | + {{#each this.item.repairPlans}} | |
152 | + <li style="width:100%;display: flex;"> | |
153 | + <div class="bullet-point">{{@index+1}}</div> | |
154 | + <div class="plan-right-cls"> | |
155 | + <p style="color:#000;font-size: 1rem;">{{content}}</p> | |
156 | + <p class="plan-price-cls">金额: ¥{{price}}</p> | |
157 | + </div> | |
158 | + </li> | |
159 | + {{/each}} | |
160 | + </ul> | |
161 | + <div class="total-price-cls">总金额: ¥{{this.item.totalPrice}}</div> | |
162 | + </div> | |
163 | + | |
164 | + {{#js_compare "this.item.finishImages.length > 0"}} | |
165 | + <div class="content-wrapper"> | |
166 | + <div class="content-title">维修完成照片</div> | |
167 | + <div class="finish-image-list"> | |
168 | + <ul class="finish-image-ul"> | |
169 | + {{#each this.item.finishImages}} | |
170 | + <li class="finish-image-li"> | |
171 | + <div class="finishImage" style="background-image:url('{{this}}')"> </div></li> | |
172 | + {{/each}} | |
173 | + </ul> | |
174 | + </div> | |
175 | + </div> | |
176 | + {{/js_compare}} | |
177 | + | |
178 | + <div class="content-wrapper" style="font-size: 1rem;"> | |
179 | + GK车管家 <span style="color:#FF8728">《质保承诺》</span> | |
180 | + </div> | |
181 | + | |
182 | + <div class="content-wrapper"> | |
183 | + {{#js_compare "this.item.hasComment"}} | |
184 | + <div class="content-title" style="padding-bottom: 0.5rem">评价</div> | |
185 | + <div class="comment-txt-cls">服务评价:超赞</div> | |
186 | + <div class="comment-txt-cls">这次修车体验很好,服务满意!</div> | |
187 | + {{else}} | |
188 | + <div class="comment-box"><div>您对此次维修服务体验如何?</div> | |
189 | + <div class="rate-btn-cls">去评价</div> | |
190 | + </div> | |
191 | + {{/js_compare}} | |
192 | + </div> | |
193 | + {{/js_compare}} | |
194 | + </div> | |
195 | + </div> | |
196 | + </div> | |
197 | +</script> | ... | ... |
app-wx/modules/order/views/default/pages/rate-template.php
... | ... | @@ -7,32 +7,44 @@ $baseUrl = Url::base(true); |
7 | 7 | input{-webkit-appearance: none;} |
8 | 8 | #rate .content-div { background: #fff; height: auto;padding: 1rem} |
9 | 9 | #rate .page-content{ background-color: #ECF0F2 } |
10 | - #rate .rate-title { height:1.06rem; font-size:1.06rem; font-weight:400; color:rgba(9,9,9,1); line-height:0.75rem;} | |
10 | + #rate .rate-title { height:1.06rem; font-size:1.06rem; font-weight:400; color:rgba(9,9,9,1); line-height:0.75rem;margin-bottom:0.5rem;} | |
11 | 11 | #rate .rate-title-two { height:1.06rem; font-size:1.06rem; font-weight:400; color:rgba(9,9,9,1); line-height:0.75rem; padding-top: 2rem;} |
12 | - #rate .star-div {margin-top: 1rem;display: flex;} | |
13 | - #rate .img-start {width: 1.47rem; height: 1.47rem; float: left; vertical-align: middle; margin-right: 1rem} | |
14 | - #rate .text-content {width: 100%;height: 7.5rem; resize: none;line-height: 1.2rem;padding: 0.5rem} | |
12 | + #rate .comment-div {margin-top: 0.3rem;display: flex;border:1px solid #DDD;line-height: 1.25rem} | |
13 | + #rate .star-row{margin-bottom: 0.6rem;} | |
14 | + #rate .img-star {width: 1.47rem; height: 1.47rem; float: left; vertical-align: middle; margin-right: 1rem;background-image:url(<?= $baseUrl . "/i/order/rate/rate_no_select.png"?>);background-repeat: no-repeat;background-size: 1.47rem auto;} | |
15 | + #rate .star-on{background-image:url(<?= $baseUrl . "/i/order/rate/rate_star.png"?>);} | |
16 | + #rate .text-content {width: 100%;height: 7.5rem; resize: none;line-height:inherit;padding: 0.5rem;font-size: 1rem} | |
17 | + #rate .btn-box{width:100%;display: block;padding:1rem;box-sizing: border-box;margin-top:2rem;} | |
15 | 18 | #rate .rate-text { font-size:0.94rem; font-weight:400; color:rgba(0,0,0,1); line-height:1.75rem;} |
19 | + #rate .submit-cls{background:#FF8728;color:#fff;border-radius: 1.2rem;box-sizing: border-box;padding:0.8rem 1rem;width:80%;margin: 0 auto;text-align: center} | |
16 | 20 | </style> |
17 | 21 | <script id="rate-template" type="text/template"> |
18 | 22 | <div class="pages"> |
19 | 23 | <div class="page" id="rate" style="background: #fff"> |
20 | 24 | <div class="page-content"> |
21 | 25 | <div class="content-div"> |
22 | - <div class="rate-title">服务评价</div> | |
23 | - <div class="star-div"> | |
24 | - <img src="<?= $baseUrl . "/i/order/rate/rate_star.png"?>" class="img-start"> | |
25 | - <img src="<?= $baseUrl . "/i/order/rate/rate_star.png"?>" class="img-start"> | |
26 | - <img src="<?= $baseUrl . "/i/order/rate/rate_star.png"?>" class="img-start"> | |
27 | - <img src="<?= $baseUrl . "/i/order/rate/rate_star.png"?>" class="img-start"> | |
28 | - <img src="<?= $baseUrl . "/i/order/rate/rate_no_select.png"?>" class="img-start"> | |
29 | - <span class="rate-text">一般</span> | |
26 | + <div class="star-row quality-row"> | |
27 | + <div class="rate-title">服务评价</div> | |
28 | + <div class="star-div quality-box"> | |
29 | + <div class="img-star star-on" data-id="1" data-txt="很差"></div> | |
30 | + <div class="img-star star-on" data-id="2" data-txt="差"></div> | |
31 | + <div class="img-star star-on" data-id="3" data-txt="一般"></div> | |
32 | + <div class="img-star" data-id="4" data-txt="满意"></div> | |
33 | + <div class="img-star" data-id="5" data-txt="很满意"></div> | |
34 | + <span class="rate-text">一般</span> | |
35 | + </div> | |
30 | 36 | </div> |
37 | + | |
38 | + | |
31 | 39 | <div class="rate-title-two">说说你的感受</div> |
32 | - <div class="star-div"> | |
40 | + <div class="comment-div"> | |
33 | 41 | <textarea class="text-content" placeholder="说说此次服务的优点和不足的地方吧"></textarea> |
34 | 42 | </div> |
35 | 43 | </div> |
44 | + | |
45 | + <div class="btn-box"> | |
46 | + <div class="submit-cls submit-btn">提交评论</div> | |
47 | + </div> | |
36 | 48 | </div> |
37 | 49 | </div> |
38 | 50 | </div> | ... | ... |
app-wx/modules/order/views/default/pages/repairing-template.php
... | ... | @@ -1,112 +0,0 @@ |
1 | -<?php | |
2 | -use yii\helpers\Url; | |
3 | -$baseUrl = Url::base(true); | |
4 | -?> | |
5 | -<style> | |
6 | - body,div,p,span,input{padding: 0;margin: 0} | |
7 | - input{-webkit-appearance: none;} | |
8 | - #repairing .content-div { width:100%; background: #fff; display:inline-flex;padding-top: 1rem} | |
9 | - #repairing .left-title-div {width:33%; font-size:1rem; font-weight:400; color:rgba(0,0,0,1); line-height:1.81rem;} | |
10 | - #repairing .center-content-div {width:47%; font-size:1rem; font-weight:400; color:rgba(118,118,118,1); line-height:1.81rem;} | |
11 | - #repairing .right-content-div {width:20%; ;height:0.91rem; font-size:0.94rem; font-weight:400; color:rgba(255,255,255,1);line-height:1.81rem;} | |
12 | - #repairing .content-div-two {width:100%; background: #fff; display:inline-flex;height: 1.81rem;} | |
13 | - #repairing .page-content{ background-color: #ECF0F2 } | |
14 | - #repairing .content-list-div {padding-bottom: 1rem} | |
15 | - #repairing .status-tip {width: 4.81rem; | |
16 | - padding-right: 0.5rem; | |
17 | - height: 1.81rem; | |
18 | - background: url(http://localhost/gk_auto/web/i/order/repairing_tip_image.png); | |
19 | - background-size: 100% 100%; | |
20 | - background-repeat: no-repeat; | |
21 | - text-align: center; | |
22 | - float: right;} | |
23 | - #repairing .btn-submit{width:85%;text-align: center;line-height: 3.06rem; height:3.06rem; | |
24 | - background:rgba(255,135,40,1); border-radius:2rem; font-size:1.06rem; font-weight:400; | |
25 | - color:rgba(255,255,255,1); margin: 0 auto; margin-top: 8rem; margin-bottom: 2rem; } | |
26 | - #repairing .pic-div { | |
27 | - width:100%; background: #fff; display:inline-flex;height: 1.81rem; | |
28 | - } | |
29 | - #repairing .pic-image-div { | |
30 | - width: 100%;background: #fff; padding-bottom: 1rem; margin: 0 auto; | |
31 | - } | |
32 | - #repairing .pic-image-list { | |
33 | - padding-left: 1rem;padding-top: 0.5rem; | |
34 | - } | |
35 | - #repairing .pic-class { width:3.91rem;height: 3.91rem;margin-right: 0.5rem } | |
36 | - #repairing .padding-left-1rem {padding-left: 1rem} | |
37 | -</style> | |
38 | -<script id="repairing-template" type="text/template"> | |
39 | - <div class="pages"> | |
40 | - <div class="page" id="repairing" style="background: #fff"> | |
41 | - <div class="page-content"> | |
42 | - <div class="content-list-div"> | |
43 | - <div class="content-div"> | |
44 | - <div class="left-title-div"><span class="padding-left-1rem">车牌号码</span></div> | |
45 | - <div class="center-content-div">粤A12345 </div> | |
46 | - <div class="right-content-div"> | |
47 | - <span class="status-tip"> | |
48 | - 进行中 | |
49 | - </span> | |
50 | - </div> | |
51 | - </div> | |
52 | - <div class="content-div-two"> | |
53 | - <div class="left-title-div"><span class="padding-left-1rem">车辆型号</span></div> | |
54 | - <div class="center-content-div">宝马X6 </div> | |
55 | - <div class="right-content-div"> | |
56 | - </div> | |
57 | - </div> | |
58 | - <div class="content-div-two"> | |
59 | - <div class="left-title-div"><span class="padding-left-1rem">客户名称</span></div> | |
60 | - <div class="center-content-div">李先生 </div> | |
61 | - <div class="right-content-div"> | |
62 | - </div> | |
63 | - </div> | |
64 | - <div class="content-div-two"> | |
65 | - <div class="left-title-div"><span class="padding-left-1rem">联系电话</span></div> | |
66 | - <div class="center-content-div">15012345678 </div> | |
67 | - <div class="right-content-div"> | |
68 | - </div> | |
69 | - </div> | |
70 | - <div class="content-div-two"> | |
71 | - <div class="left-title-div"><span class="padding-left-1rem">预估维修内容</span></div> | |
72 | - <div class="center-content-div">更换车轮胎 </div> | |
73 | - <div class="right-content-div"> | |
74 | - </div> | |
75 | - </div> | |
76 | - <div class="content-div-two"> | |
77 | - <div class="left-title-div"><span class="padding-left-1rem">预估维修费用</span></div> | |
78 | - <div class="center-content-div">250元 </div> | |
79 | - <div class="right-content-div"> | |
80 | - </div> | |
81 | - </div> | |
82 | - <div class="content-div-two"> | |
83 | - <div class="left-title-div"><span class="padding-left-1rem">预估完成时间</span></div> | |
84 | - <div class="center-content-div">2019-12-15 15:00 </div> | |
85 | - <div class="right-content-div"> | |
86 | - </div> | |
87 | - </div> | |
88 | - <div class="content-div-two"> | |
89 | - <div class="left-title-div"><span class="padding-left-1rem">订单创建时间</span></div> | |
90 | - <div class="center-content-div">2019-12-12 12:00 </div> | |
91 | - <div class="right-content-div"> | |
92 | - </div> | |
93 | - </div> | |
94 | - <div class="pic-div"> | |
95 | - <div class="left-title-div"><span class="padding-left-1rem">车损照片</span></div> | |
96 | - </div> | |
97 | - <div class="pic-image-div"> | |
98 | - <div class="pic-image-list"> | |
99 | - <img src="<?=$baseUrl . "/i/order/demo.jpg"?>" class="pic-class"/> | |
100 | - <img src="<?=$baseUrl . "/i/order/demo.jpg"?>" class="pic-class"/> | |
101 | - <img src="<?=$baseUrl . "/i/order/demo.jpg"?>" class="pic-class"/> | |
102 | - <img src="<?=$baseUrl . "/i/order/demo.jpg"?>" class="pic-class"/> | |
103 | - <img src="<?=$baseUrl . "/i/order/demo.jpg"?>" class="pic-class"/> | |
104 | - <img src="<?=$baseUrl . "/i/order/demo.jpg"?>" class="pic-class"/> | |
105 | - </div> | |
106 | - </div> | |
107 | - </div> | |
108 | - <div class="btn-submit"> 完成维修 </div> | |
109 | - </div> | |
110 | - </div> | |
111 | - </div> | |
112 | -</script> |
app-wx/modules/user/views/default/pages/register-template.php
... | ... | @@ -16,8 +16,10 @@ $baseUrl = Url::base(true); |
16 | 16 | #register .input-list .input-cls{width:100%;line-height: inherit;font-size: inherit;border:0;padding:0.3rem;box-sizing: border-box} |
17 | 17 | #register .input-list .validation-code{display:flex;align-items: center} |
18 | 18 | #register .input-list .get-code-cls{width: 10rem;font-size: 1rem;display: flex;align-items: center;justify-content:center;color:#FF8728;padding:0.302rem 0.3rem;box-sizing: border-box;border-left:0;} |
19 | - #register .upload-box{padding:0 2rem 1rem 2rem;box-sizing: border-box} | |
20 | - #register .upload-box .upload-title{line-height: 1.5rem;color:#BCBCBC;margin-bottom: 1rem;} | |
19 | + #register .upload-box{padding:0 2rem 1rem 2rem;box-sizing: border-box;overflow: hidden} | |
20 | + #register .upload-box .upload-section{width:50%;margin-bottom:0.5rem;float:left} | |
21 | + #register .upload-box .upload-title{line-height: 1.5rem;color:#BCBCBC;margin-bottom:0;} | |
22 | + #register .upload-box .upload-img-box{display: block;width: 50%;} | |
21 | 23 | #register .upload-box .upload-item{width:100%;height:0;padding-bottom: 100%;overflow:hidden; |
22 | 24 | background-position: center center; |
23 | 25 | background-repeat: no-repeat; |
... | ... | @@ -25,6 +27,7 @@ $baseUrl = Url::base(true); |
25 | 27 | -moz-background-size:cover;background-size:cover;position: relative} |
26 | 28 | #register .upload-box .upload-item{background-image:url('<?=$baseUrl?>/i/user/upload-convert.png');background-size: 4.7rem auto;background-repeat: no-repeat;background-position: 1px 1px;} |
27 | 29 | #register .upload-box .upload-input-cls{width: 100%;display: block;background: rgba(0,0,0,0);opacity: 0;height: 0;padding-bottom: 100%;} |
30 | + #register .action-box{padding:1rem;box-sizing:border-box;padding-top:3rem;} | |
28 | 31 | #register .register-btn-cls{width:80%;border-radius: 2rem; padding:0.8rem 1rem;text-align:center;box-sizing: border-box;color:#fff;background:#FF8728;margin: 0 auto;font-size:1.13rem} |
29 | 32 | #register .count-down-cls{font-size:0.7rem;color:#999} |
30 | 33 | #register .login-btn-cls{color:#4C4C4C;font-size:1rem;margin-top: 1rem; text-align: center} |
... | ... | @@ -46,7 +49,7 @@ $baseUrl = Url::base(true); |
46 | 49 | </div> |
47 | 50 | <div class="input-list"> |
48 | 51 | <div class="input-row-cls"><label class="input-label-cls"></label> |
49 | - <div class="input-div"><input class="input-cls name" type="text" placeholder="输入车厂名称" /></div></div> | |
52 | + <div class="input-div"><input class="input-cls name" type="text" placeholder="输入维修厂名" /></div></div> | |
50 | 53 | |
51 | 54 | <div class="input-row-cls"><label class="input-label-cls"></label><div class="input-div"><input class="input-cls mobile" type="number" placeholder="输入手机号码" /></div></div> |
52 | 55 | |
... | ... | @@ -59,14 +62,24 @@ $baseUrl = Url::base(true); |
59 | 62 | </div> |
60 | 63 | </div> |
61 | 64 | <div class="upload-box"> |
62 | - <div class="upload-title">上传营业执照</div> | |
63 | - <div style="display: block;width: 25%;"> | |
64 | - <div class="upload-item upload-btn-cls"> | |
65 | - <input type="file" id="upload-btn" class="upload-input-cls" name="file" accept="image/*"/> | |
65 | + <div class="upload-section"> | |
66 | + <div class="upload-title">上传营业执照</div> | |
67 | + <div class="upload-img-box"> | |
68 | + <div class="upload-item upload-btn-cls"> | |
69 | + <input type="file" id="upload-btn" class="upload-input-cls" name="file" accept="image/*"/> | |
70 | + </div> | |
71 | + </div> | |
72 | + </div> | |
73 | + <div class="upload-section"> | |
74 | + <div class="upload-title">维修场门头照</div> | |
75 | + <div class="upload-img-box"> | |
76 | + <div class="upload-item upload-btn-cls"> | |
77 | + <input type="file" id="upload-home-btn" class="upload-input-cls" name="file" accept="image/*"/> | |
78 | + </div> | |
66 | 79 | </div> |
67 | 80 | </div> |
68 | 81 | </div> |
69 | - <div style="padding:1rem;box-sizing:border-box;padding-top:3rem;"> | |
82 | + <div class="action-box"> | |
70 | 83 | <div class="register-btn-cls register-btn">注册</div> |
71 | 84 | |
72 | 85 | <div class="login-btn login-btn-cls">登录</div> | ... | ... |
web/dist/js/order-app.js
1 | -define("order-app",["mk7/app"],function(t){var n=Dom7,e=function(){var t=n(".ui-loading-block");0==t.length&&(n(".view-main").html('<div class="ui-loading-block" id="ui-loading"><div class="ui-loading-cnt"><div class="spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div><div id="loader-inner"><p></p></div> </div> </div>'),window.waitingTime=1e4,window.loaderTimer&&clearTimeout(window.loaderTimer),window.loaderTimer=setTimeout(function(){var t=document.getElementById("loader-inner"),n=document.createElement("p");n.className="notice",t&&(n.innerHTML='加载速度太慢?试试<a class="link" href="#" onclick="javascript:location.reload();return false;">重新加载</a>',t.appendChild(n))},window.waitingTime))},i=!0;return t.name="order",t.routes={index:function(){return i=!1,e(),t.runController("index")},"index/:tab":function(n){i=!1,e();var r={tab:n};return t.runController("index",r)},rate:function(){return i=!1,e(),t.runController("rate")},submit:function(){return i=!1,e(),t.runController("submit")},"*":function(){return t.runController("index")}},t}),define("order/cost-list-controller",["mk7/controller","mk7/url","mk7/utils"],function(t,n,e){var t=(Dom7,Template7,new t);return t.run=function(){var t=this;t.setPageTitle("费用列表"),t.render()},t.bindEvents=function(){console.log("bindEvents")},t}),define("order/index-controller",["mk7/controller","mk7/url","mk7/utils"],function(t,n,e){var i=Dom7,r=Template7,t=new t,o="order/default/order-list";return t.run=function(){var t=this;t.setPageTitle("订单列表"),t.tab=t.params.tab,t.page=0,t.nodata="",t.loading=!1,t.pageCount=1,t.render({tab:t.tab}),t.loadPage()},t.bindEvents=function(){var t=this;console.log("bindEvents"),t.tabEvent(),t.bindScrollEvent(),t.addEvent()},t.tabEvent=function(){i(".tab-cls").click(function(t){var n=i(this).attr("data-href");window.location.replace(n)})},t.handleNodata=function(){var t=this;t.nodata="没有数据了";var n=i(".nodata");0==n.length&&i("#index .order-list").append('<div class="nodata">'+t.nodata+"</div>"),t.app.detachInfiniteScroll(".infinite-scroll"),i("#index .infinite-scroll-preloader").remove()},t.loadPage=function(){var t=this;if(t.loading=!0,t.page>=t.pageCount)return void t.handleNodata();var r={status:t.tab};r.page=t.page+1,r=t.csrf(r),i.ajax({method:"GET",url:n.to(o),data:r,dataType:"json",beforeSend:function(){t.showIndicator()},success:function(n){1==n.success&&(e.isDefined(n.page)&&(t.page=parseInt(n.page)),e.isDefined(n.page_count)&&(t.pageCount=parseInt(n.page_count)),t.renderItems(n.items,!0))},error:function(t){},complete:function(n){t.hideIndicator(),t.loading=!1}})},t.bindScrollEvent=function(){var t=this;t.app.attachInfiniteScroll("#index .infinite-scroll"),i("#index .infinite-scroll").on("infinite",function(){t.loading||t.nodata||t.loadPage()})},t.renderItems=function(t,n){var e=i("#index .order-list"),o=i("script#order-item-template"),a=r.compile(o.html()),l=a({list:t});0==n&&(e.html(""),e.append(l)),e.append(l)},t.addEvent=function(){i("#index .add-btn-cls").click(function(t){window.location.href=n.to("order/#submit")})},t}),define("order/rate-controller",["mk7/controller","mk7/url","mk7/utils"],function(t,n,e){var t=(Dom7,Template7,new t);return t.run=function(){var t=this;t.setPageTitle("评价"),t.render()},t.bindEvents=function(){console.log("bindEvents")},t}),define("order/repairing-controller",["mk7/controller","mk7/url","mk7/utils"],function(t,n,e){var t=(Dom7,Template7,new t);return t.run=function(){var t=this;t.setPageTitle("维修单"),t.render()},t.bindEvents=function(){console.log("bindEvents")},t}),define("order/submit-controller",["mk7/controller","mk7/url","mk7/utils","mk7/uploadjs"],function(t,n,e,i){var r=Dom7,t=(Template7,new t),o="/user/default/upload-file",a="/order/default/submit",l=!0;return t.run=function(){var t=this;t.setPageTitle("录入维修单"),t.imgLimit=9,t.render()},t.bindEvents=function(){var t=this;console.log("bindEvents"),t.uploadImgEvent(),t.submitEvent()},t.uploadImgEvent=function(){var t=this;r("#submit #upload-btn").change(function(){if(""!=r(this).val()&&null!=r(this).val()){var a=r(this).parents("li");i.uploadFile({selector:"#upload-btn",url:n.to(o),processAppendTo:"#submit",success:function(n,i){try{if(n.success){var o=n.tmpUrl;r('<li class="upload-li up-img"><div data="'+n.tmpFile+'" data-url="'+o+'" class="upload-item" style="background-image:url('+n.tmpMinUrl+')"></div><span class="del-img"></span></li>').insertBefore(a),t.imgLimit==r("#submit #image-list").find(".up-img").length&&r("#submit .upload-btn-li").hide()}else e.toast({content:n.message,closeDelay:5e3})}catch(l){console.log(l),e.toast({content:"出错",closeDelay:5e3})}}})}}),r("#submit #image-list").on("click",".del-img",function(n){r(this).parent().remove(),t.imgLimit>=r("#submit #image-list").find(".up-img").length&&r("#submit .upload-btn-li").show()})},t.submitEvent=function(){var t=this;r("#submit .submit-btn-cls").click(function(i){var o=e.trim(r("#submit .carNo").val()),s=e.trim(r("#submit .carModel").val()),u=e.trim(r("#submit .customer").val()),d=e.trim(r("#submit .phone").val()),c=e.trim(r("#submit .preRepair").val()),m=e.trim(r("#submit .repairPrice").val()),f=e.trim(r("#submit .finishDate").val());if(0==l)return!1;if(""==o)return e.toast({content:"车牌号必填"}),!1;if(""==s)return e.toast({content:"车辆型号必填"}),!1;if(""==u)return e.toast({content:"客户名称必填"}),!1;if(""==d)return e.toast({content:"客联系电话必填"}),!1;if(!e.isMobile(d)&&!uitls.isTelephone(d))return e.toast({content:"客联系电话有误"}),!1;if(""==c)return e.toast({content:"预估维修内容必填"}),!1;if(""==m)return e.toast({content:"预估维修费用必填"}),!1;if(""==f)return e.toast({content:"预估完成时间必填"}),!1;var p=t.getUploadImgs();if(0==p.length)return e.toast({content:"请上传车损照"}),!1;l=!1;var v=t.csrf({carNo:o,carModel:s,customer:u,phone:d,preRepair:c,repairPrice:m,finishDate:f,images:p});e.httpPost(a,v,function(t){return l=!0,t.success?void(window.location.href=n.to("/")):(e.toast({content:message}),!1)},!0)})},t.getUploadImgs=function(){var t=r("#submit #image-list").find(".up-img"),n=[];return 0==t.length?[]:(r.each(t,function(t,e){var i=r(e).find(".upload-item");n.push(i.attr("data"))}),n)},t}); | |
2 | 1 | \ No newline at end of file |
2 | +define("order-app",["mk7/app"],function(t){var i=Dom7,n=function(){var t=i(".ui-loading-block");0==t.length&&(i(".view-main").html('<div class="ui-loading-block" id="ui-loading"><div class="ui-loading-cnt"><div class="spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div><div id="loader-inner"><p></p></div> </div> </div>'),window.waitingTime=1e4,window.loaderTimer&&clearTimeout(window.loaderTimer),window.loaderTimer=setTimeout(function(){var t=document.getElementById("loader-inner"),i=document.createElement("p");i.className="notice",t&&(i.innerHTML='加载速度太慢?试试<a class="link" href="#" onclick="javascript:location.reload();return false;">重新加载</a>',t.appendChild(i))},window.waitingTime))},e=!0;return t.name="order",t.routes={index:function(){return e=!1,n(),t.runController("index")},"index/:tab":function(i){e=!1,n();var a={tab:i};return t.runController("index",a)},"rate/:id":function(i){e=!1,n();var a={id:i};return t.runController("rate",a)},submit:function(){return e=!1,n(),t.runController("submit")},"order-details/:id":function(i){e=!1,n();var a={id:i};return t.runController("order-details",a)},"cost-list/:id":function(i){e=!1,n();var a={id:i};return t.runController("cost-list",a)},"*":function(){return t.runController("index")}},t}),define("order/cost-list-controller",["mk7/controller","mk7/url","mk7/utils","mk7/uploadjs"],function(t,i,n,e){var a=Dom7,t=(Template7,new t),o="/user/default/upload-file",r="/order/default/submit-repair-plans";return t.run=function(){var t=this;t.setPageTitle("费用列表"),t.imgLimit=9,t.canSubmit=!0,t.render()},t.bindEvents=function(){var t=this;console.log("bindEvents"),t.addEvent(),t.uploadImgEvent(),t.delPlanEvent(),t.inputPriceChangeEvent(),t.submitEvent()},t.addEvent=function(){var t=this;a("#cost-list .add-repair-plan").click(function(i){var n=a("#cost-list .cost-list-div"),e=t.planTpl(n.length+1);a(e).insertBefore(a("#cost-list .cost-total-list-div"))})},t.delPlanEvent=function(){var t=this;a("#cost-list").on("click",".del-plan",function(i){console.log("del plan event"),a(this).parents(".cost-list-div").remove(),a("#cost-list .total-plan-price").html(t.computedPrice())})},t.planTpl=function(t){var i='<div class="cost-list-div"><p class="item-title">第'+t+'项</p><div class="repair-item-cls"><input type="text" class="input-left input-cls" placeholder="填写维修内容" value=""><input type="number" class="input-right input-cls" placeholder="填写价格" value="0"><span class="del-plan"></span></div></div>';return i},t.inputPriceChangeEvent=function(){var t=this;a("#cost-list").on("input propertychange",".input-cls",function(){var i=t.computedPrice();a("#cost-list .total-plan-price").html(i)})},t.computedPrice=function(){var t=a("#cost-list .input-right"),i=0;return a.each(t,function(t,n){i+=1*a(n).val()}),Math.round(i,2)},t.uploadImgEvent=function(){var t=this;a("#cost-list #upload-btn").change(function(){if(""!=a(this).val()&&null!=a(this).val()){var r=a(this).parents("li");e.uploadFile({selector:"#upload-btn",url:i.to(o),processAppendTo:"#cost-list",success:function(i,e){try{if(i.success){var o=i.tmpUrl;a('<li class="upload-li up-img"><div data="'+i.tmpFile+'" data-url="'+o+'" class="upload-item" style="background-image:url('+i.tmpMinUrl+')"></div><span class="del-img"></span></li>').insertBefore(r),t.imgLimit==a("#cost-list #image-list").find(".up-img").length&&a("#cost-list .upload-btn-li").hide()}else n.toast({content:i.message,closeDelay:5e3})}catch(l){console.log(l),n.toast({content:"出错",closeDelay:5e3})}}})}}),a("#cost-list #image-list").on("click",".del-img",function(i){a(this).parent().remove(),t.imgLimit>=a("#cost-list #image-list").find(".up-img").length&&a("#cost-list .upload-btn-li").show()})},t.submitEvent=function(){var t=this;a("#cost-list .btn-submit").click(function(e){var o=a("#cost-list .content-div").find(".repair-item-cls"),l=[],s=!0,c=!0;if(a.each(o,function(t,i){var e=n.trim(a(i).find(".input-left").val()),o=n.trim(a(i).find(".input-right").val());""==e&&(s=!1),""!=o&&0!=o||(c=!1),l.push({content:e,price:o})}),!s)return n.toast({content:"维修清单有部分未填内容"}),!1;if(!c)return n.toast({content:"维修清单有部分未填价格"}),!1;var d=a("#cost-list #image-list").find(".upload-item"),u=[];if(a.each(d,function(t,i){u.push(a(i).attr("data"))}),!t.canSubmit)return!1;t.canSubmit=!1;var m=t.csrf({images:u,plans:l});n.httpPost(r,m,function(e){t.canSubmit=!0,e.success?window.location.replace(i.to("order/#item-details/"+t.id)):n.toast({content:e.message})},!0)})},t}),define("order/index-controller",["mk7/controller","mk7/url","mk7/utils"],function(t,i,n){var e=Dom7,a=Template7,t=new t,o="order/default/order-list";return t.run=function(){var t=this;t.setPageTitle("订单列表"),t.tab=t.params.tab,t.page=0,t.nodata="",t.loading=!1,t.pageCount=1,t.render({tab:t.tab}),t.loadPage()},t.bindEvents=function(){var t=this;console.log("bindEvents"),t.tabEvent(),t.bindScrollEvent(),t.addEvent()},t.tabEvent=function(){e(".tab-cls").click(function(t){var i=e(this).attr("data-href");window.location.replace(i)})},t.handleNodata=function(){var t=this;t.nodata="没有数据了";var i=e(".nodata");0==i.length&&e("#index .order-list").append('<div class="nodata">'+t.nodata+"</div>"),t.app.detachInfiniteScroll(".infinite-scroll"),e("#index .infinite-scroll-preloader").remove()},t.loadPage=function(){var t=this;if(t.loading=!0,t.page>=t.pageCount)return void t.handleNodata();var a={status:t.tab};a.page=t.page+1,a=t.csrf(a),e.ajax({method:"GET",url:i.to(o),data:a,dataType:"json",beforeSend:function(){t.showIndicator()},success:function(i){1==i.success&&(n.isDefined(i.page)&&(t.page=parseInt(i.page)),n.isDefined(i.page_count)&&(t.pageCount=parseInt(i.page_count)),t.renderItems(i.items,!0))},error:function(t){},complete:function(i){t.hideIndicator(),t.loading=!1}})},t.bindScrollEvent=function(){var t=this;t.app.attachInfiniteScroll("#index .infinite-scroll"),e("#index .infinite-scroll").on("infinite",function(){t.loading||t.nodata||t.loadPage()})},t.renderItems=function(t,i){var n=e("#index .order-list"),o=e("script#order-item-template"),r=a.compile(o.html()),l=r({list:t});0==i&&(n.html(""),n.append(l)),n.append(l)},t.addEvent=function(){e("#index .add-btn-cls").click(function(t){window.location.href=i.to("order/#submit")})},t}),define("order/order-details-controller",["mk7/controller","mk7/url","mk7/utils"],function(t,i,n){var e=Dom7,t=(Template7,new t),a="order/default/order-details";return t.run=function(){var t=this;t.id=t.params.id,t.setPageTitle("维修单"),t.loadPage()},t.bindEvents=function(){var t=this;console.log("bindEvents"),t.finishBtnEvent(),t.goToComment()},t.loadPage=function(){var t=this,i=t.csrf({id:t.id});n.httpGet(a,i,function(i){var n=i;t.render(n)},!0)},t.finishBtnEvent=function(){var t=this;e("#order-details .finish-submit").click(function(n){window.location.href=i.to("order/#cost-list/"+t.id)})},t.goToComment=function(){var t=this;e("#order-details .rate-btn-cls").click(function(n){window.location.href=i.to("order/#rate/"+t.id)})},t}),define("order/rate-controller",["mk7/controller","mk7/url","mk7/utils"],function(t,i,n){var e=Dom7,t=(Template7,new t),a="order/default/submit-rate";return t.run=function(){var t=this;t.id=t.params.id,t.setPageTitle("评价"),t.loadPage()},t.bindEvents=function(){var t=this;console.log("bindEvents"),t.starClickEvent(),t.submitEvent()},t.loadPage=function(){var t=this;t.render()},t.starClickEvent=function(){e("#rate").on("click",".quality-box .img-star",function(t){var i=e(this).attr("data-id"),n=e("#rate .quality-box .img-star");e.each(n,function(t,n){var a=e(n).attr("data-id");if(1*a<=i){e(n).addClass("star-on");var o=e("#rate .quality-box").find(".rate-text"),r=e(n).attr("data-txt");o.html(r)}else e(n).removeClass("star-on")})})},t.submitEvent=function(){var t=this;e("#rate .submit-btn").click(function(o){var r=n.trim(e("#rate .text-content").val()),l=e("#rate .img-star"),s=0;e.each(l,function(t,i){e(i).hasClass("star-on")&&s++});var c=t.csrf({star:s,comment:r});n.httpPost(i.to(a),c,function(i){i.success?window.location.replace("order/#order-details/"+t.id):n.toast({content:i.message})},!0)})},t}),define("order/submit-controller",["mk7/controller","mk7/url","mk7/utils","mk7/uploadjs"],function(t,i,n,e){var a=Dom7,t=(Template7,new t),o="/user/default/upload-file",r="/order/default/submit",l=!0;return t.run=function(){var t=this;t.setPageTitle("录入维修单"),t.imgLimit=9,t.render()},t.bindEvents=function(){var t=this;console.log("bindEvents"),t.uploadImgEvent(),t.submitEvent()},t.uploadImgEvent=function(){var t=this;a("#submit #upload-btn").change(function(){if(""!=a(this).val()&&null!=a(this).val()){var r=a(this).parents("li");e.uploadFile({selector:"#upload-btn",url:i.to(o),processAppendTo:"#submit",success:function(i,e){try{if(i.success){var o=i.tmpUrl;a('<li class="upload-li up-img"><div data="'+i.tmpFile+'" data-url="'+o+'" class="upload-item" style="background-image:url('+i.tmpMinUrl+')"></div><span class="del-img"></span></li>').insertBefore(r),t.imgLimit==a("#submit #image-list").find(".up-img").length&&a("#submit .upload-btn-li").hide()}else n.toast({content:i.message,closeDelay:5e3})}catch(l){console.log(l),n.toast({content:"出错",closeDelay:5e3})}}})}}),a("#submit #image-list").on("click",".del-img",function(i){a(this).parent().remove(),t.imgLimit>=a("#submit #image-list").find(".up-img").length&&a("#submit .upload-btn-li").show()})},t.submitEvent=function(){var t=this;a("#submit .submit-btn-cls").click(function(e){var o=n.trim(a("#submit .carNo").val()),s=n.trim(a("#submit .carModel").val()),c=n.trim(a("#submit .customer").val()),d=n.trim(a("#submit .phone").val()),u=n.trim(a("#submit .preRepair").val()),m=n.trim(a("#submit .repairPrice").val()),p=n.trim(a("#submit .finishDate").val());if(0==l)return!1;if(""==o)return n.toast({content:"车牌号必填"}),!1;if(""==s)return n.toast({content:"车辆型号必填"}),!1;if(""==c)return n.toast({content:"客户名称必填"}),!1;if(""==d)return n.toast({content:"客联系电话必填"}),!1;if(!n.isMobile(d)&&!uitls.isTelephone(d))return n.toast({content:"客联系电话有误"}),!1;if(""==u)return n.toast({content:"预估维修内容必填"}),!1;if(""==m)return n.toast({content:"预估维修费用必填"}),!1;if(""==p)return n.toast({content:"预估完成时间必填"}),!1;var f=t.getUploadImgs();if(0==f.length)return n.toast({content:"请上传车损照"}),!1;l=!1;var v=t.csrf({carNo:o,carModel:s,customer:c,phone:d,preRepair:u,repairPrice:m,finishDate:p,images:f});n.httpPost(r,v,function(t){return l=!0,t.success?void(window.location.href=i.to("/")):(n.toast({content:message}),!1)},!0)})},t.getUploadImgs=function(){var t=a("#submit #image-list").find(".up-img"),i=[];return 0==t.length?[]:(a.each(t,function(t,n){var e=a(n).find(".upload-item");i.push(e.attr("data"))}),i)},t}); | |
3 | 3 | \ No newline at end of file | ... | ... |
web/dist/js/user-app.js
1 | -define("user-app",["mk7/app"],function(e){var t=Dom7,n=function(){var e=t(".ui-loading-block");0==e.length&&(t(".view-main").html('<div class="ui-loading-block" id="ui-loading"><div class="ui-loading-cnt"><div class="spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div><div id="loader-inner"><p></p></div> </div> </div>'),window.waitingTime=1e4,window.loaderTimer&&clearTimeout(window.loaderTimer),window.loaderTimer=setTimeout(function(){var e=document.getElementById("loader-inner"),t=document.createElement("p");t.className="notice",e&&(t.innerHTML='加载速度太慢?试试<a class="link" href="#" onclick="javascript:location.reload();return false;">重新加载</a>',e.appendChild(t))},window.waitingTime))},o=!0;return e.name="user",e.routes={index:function(){return o=!1,n(),e.runController("index")},register:function(){return o=!1,n(),e.runController("register")},login:function(){return o=!1,n(),e.runController("login")},"*":function(){return e.runController("index")}},e}),define("user/index-controller",["mk7/controller","mk7/url","mk7/utils"],function(e,t,n){var e=(Dom7,Template7,new e);return e.run=function(){var e=this;e.setPageTitle("首页"),e.hideAllNonBaseMenuItem(window.$site),e.render()},e.bindEvents=function(){console.log("bindEvents")},e}),define("user/login-controller",["mk7/controller","mk7/url","mk7/utils"],function(e,t,n){var o=Dom7,e=(Template7,new e),i="/user/login/get-code",r="/user/login/login",l=!0,c=!0,s=null;return e.run=function(){var e=this;e.setPageTitle("登录"),e.codeDuration=60,e.render()},e.bindEvents=function(){var e=this;console.log("bindEvents"),e.getCodeEvent(),e.gotoRegisterEvent(),e.loginEvent()},e.getCodeEvent=function(){var e=this;o("#login .get-code-cls").click(function(){if(0==l)return!1;clearInterval(s),l=!1;var r=e.csrf({action:"login"});n.httpGet(t.to(i),r,function(t){if(!t.success)return n.toast({content:t.message,closeDelay:3e3}),l=!0,!1;var i=t.codeDuration;e.codeDuration=i,s=setInterval(function(t){e.codeDuration--,0==e.codeDuration?(o("#login .get-code-cls").html("获取验证码"),clearInterval(s),e.codeDuration=i,l=!0):o("#login .get-code-cls").html('<span class="count-down-cls">'+e.codeDuration+"s后重新获取</span>")},1e3)})})},e.loginEvent=function(){var e=this;o("#login .login-btn").click(function(i){var l=n.trim(o("#login .mobile").val()),s=n.trim(o("#login .code").val());if(""==l)return n.toast({content:"手机号码必填"}),!1;if(!n.isMobile(l))return n.toast({content:"手机号码不合格"}),!1;if(""==s)return n.toast({content:"验证码必填"}),!1;if(0==c)return!1;c=!1;var a=e.csrf({mobile:l,code:s});n.httpPost(t.to(r),a,function(e){return e.success?(c=!0,void(window.location.href=t.to("/"))):(n.toast({content:e.message,closeDelay:3e3}),c=!0,!1)})})},e.gotoRegisterEvent=function(){o("#login .register-btn").click(function(e){window.location.href=t.to("user/#register")})},e}),define("user/register-controller",["mk7/controller","mk7/url","mk7/utils","mk7/uploadjs"],function(e,t,n,o){var i=Dom7,e=(Template7,new e),r="/user/login/register",l="/user/default/upload-file",c="/user/login/get-code",s=!0,a=!0,u=null;return e.run=function(){var e=this;e.setPageTitle("注册"),e.codeDuration=60,e.render()},e.bindEvents=function(){var e=this;console.log("bindEvents"),e.uploadEvent(),e.getCodeEvent(),e.registerEvent(),e.gotoLoginEvent()},e.uploadEvent=function(){i("#register #upload-btn").change(function(){if(""!=i(this).val()&&null!=i(this).val()){var e=i(this).parent();o.uploadFile({selector:"#upload-btn",url:t.to(l),processAppendTo:"#register",success:function(t,o){try{if(t.success){var i=t.tmpUrl;e.css("background-image","url("+t.tmpMinUrl+")"),e.attr("data",t.tmpFile),e.attr("data-url",i)}else n.toast({content:t.message,closeDelay:5e3})}catch(r){n.toast({content:"出错",closeDelay:5e3})}}})}})},e.getCodeEvent=function(){var e=this;i("#register .get-code-cls").click(function(){if(0==s)return!1;clearInterval(u),s=!1;var o=e.csrf({action:"register"});n.httpGet(t.to(c),o,function(t){if(!t.success)return n.toast({content:t.message,closeDelay:3e3}),s=!0,!1;var o=t.codeDuration;e.codeDuration=o,u=setInterval(function(t){e.codeDuration--,0==e.codeDuration?(i("#register .get-code-cls").html("获取验证码"),clearInterval(u),e.codeDuration=o,s=!0):i("#register .get-code-cls").html('<span class="count-down-cls">'+e.codeDuration+"s后重新获取</span>")},1e3)})})},e.registerEvent=function(){var e=this;i("#register .register-btn").click(function(o){var l=n.trim(i("#register .name").val()),c=n.trim(i("#register .mobile").val()),s=n.trim(i("#register .code").val());if(""==l)return n.toast({content:"车厂名称必填"}),!1;if(""==c)return n.toast({content:"手机号码必填"}),!1;if(!n.isMobile(c))return n.toast({content:"手机号码不合格"}),!1;if(""==s)return n.toast({content:"验证码必填"}),!1;var u=i("#register .upload-btn-cls").attr("data");if(void 0===u||null==u)return n.toast({content:"请上传营业执照"}),!1;if(0==a)return!1;a=!1;var d=e.csrf({name:l,mobile:c,code:s,img:u});n.httpPost(t.to(r),d,function(e){return e.success?void(window.location.href=t.to("/")):(n.toast({content:e.message,closeDelay:3e3}),a=!0,!1)})})},e.gotoLoginEvent=function(){i("#register .login-btn").click(function(e){window.location.href=t.to("user/#login")})},e}); | |
2 | 1 | \ No newline at end of file |
2 | +define("user-app",["mk7/app"],function(e){var t=Dom7,n=function(){var e=t(".ui-loading-block");0==e.length&&(t(".view-main").html('<div class="ui-loading-block" id="ui-loading"><div class="ui-loading-cnt"><div class="spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div><div id="loader-inner"><p></p></div> </div> </div>'),window.waitingTime=1e4,window.loaderTimer&&clearTimeout(window.loaderTimer),window.loaderTimer=setTimeout(function(){var e=document.getElementById("loader-inner"),t=document.createElement("p");t.className="notice",e&&(t.innerHTML='加载速度太慢?试试<a class="link" href="#" onclick="javascript:location.reload();return false;">重新加载</a>',e.appendChild(t))},window.waitingTime))},o=!0;return e.name="user",e.routes={index:function(){return o=!1,n(),e.runController("index")},register:function(){return o=!1,n(),e.runController("register")},login:function(){return o=!1,n(),e.runController("login")},"*":function(){return e.runController("index")}},e}),define("user/index-controller",["mk7/controller","mk7/url","mk7/utils"],function(e,t,n){var e=(Dom7,Template7,new e);return e.run=function(){var e=this;e.setPageTitle("首页"),e.hideAllNonBaseMenuItem(window.$site),e.render()},e.bindEvents=function(){console.log("bindEvents")},e}),define("user/login-controller",["mk7/controller","mk7/url","mk7/utils"],function(e,t,n){var o=Dom7,e=(Template7,new e),i="/user/login/get-code",r="/user/login/login",l=!0,c=!0,s=null;return e.run=function(){var e=this;e.setPageTitle("登录"),e.codeDuration=60,e.render()},e.bindEvents=function(){var e=this;console.log("bindEvents"),e.getCodeEvent(),e.gotoRegisterEvent(),e.loginEvent()},e.getCodeEvent=function(){var e=this;o("#login .get-code-cls").click(function(){if(0==l)return!1;clearInterval(s),l=!1;var r=e.csrf({action:"login"});n.httpGet(t.to(i),r,function(t){if(!t.success)return n.toast({content:t.message,closeDelay:3e3}),l=!0,!1;var i=t.codeDuration;e.codeDuration=i,s=setInterval(function(t){e.codeDuration--,0==e.codeDuration?(o("#login .get-code-cls").html("获取验证码"),clearInterval(s),e.codeDuration=i,l=!0):o("#login .get-code-cls").html('<span class="count-down-cls">'+e.codeDuration+"s后重新获取</span>")},1e3)})})},e.loginEvent=function(){var e=this;o("#login .login-btn").click(function(i){var l=n.trim(o("#login .mobile").val()),s=n.trim(o("#login .code").val());if(""==l)return n.toast({content:"手机号码必填"}),!1;if(!n.isMobile(l))return n.toast({content:"手机号码不合格"}),!1;if(""==s)return n.toast({content:"验证码必填"}),!1;if(0==c)return!1;c=!1;var a=e.csrf({mobile:l,code:s});n.httpPost(t.to(r),a,function(e){return e.success?(c=!0,void(window.location.href=t.to("/"))):(n.toast({content:e.message,closeDelay:3e3}),c=!0,!1)})})},e.gotoRegisterEvent=function(){o("#login .register-btn").click(function(e){window.location.href=t.to("user/#register")})},e}),define("user/register-controller",["mk7/controller","mk7/url","mk7/utils","mk7/uploadjs"],function(e,t,n,o){var i=Dom7,e=(Template7,new e),r="/user/login/register",l="/user/default/upload-file",c="/user/login/get-code",s=!0,a=!0,u=null;return e.run=function(){var e=this;e.setPageTitle("注册"),e.codeDuration=60,e.render()},e.bindEvents=function(){var e=this;console.log("bindEvents"),e.uploadEvent(),e.getCodeEvent(),e.registerEvent(),e.gotoLoginEvent()},e.uploadEvent=function(){i("#register .upload-input-cls").change(function(){if(""!=i(this).val()&&null!=i(this).val()){var e=i(this).attr("id"),r=i(this).parent();o.uploadFile({selector:"#"+e,url:t.to(l),processAppendTo:"#register",success:function(e,t){try{if(e.success){var o=e.tmpUrl;r.css("background-image","url("+e.tmpMinUrl+")"),r.attr("data",e.tmpFile),r.attr("data-url",o)}else n.toast({content:e.message,closeDelay:5e3})}catch(i){n.toast({content:"出错",closeDelay:5e3})}}})}})},e.getCodeEvent=function(){var e=this;i("#register .get-code-cls").click(function(){if(0==s)return!1;clearInterval(u),s=!1;var o=e.csrf({action:"register"});n.httpGet(t.to(c),o,function(t){if(!t.success)return n.toast({content:t.message,closeDelay:3e3}),s=!0,!1;var o=t.codeDuration;e.codeDuration=o,u=setInterval(function(t){e.codeDuration--,0==e.codeDuration?(i("#register .get-code-cls").html("获取验证码"),clearInterval(u),e.codeDuration=o,s=!0):i("#register .get-code-cls").html('<span class="count-down-cls">'+e.codeDuration+"s后重新获取</span>")},1e3)})})},e.registerEvent=function(){var e=this;i("#register .register-btn").click(function(o){var l=n.trim(i("#register .name").val()),c=n.trim(i("#register .mobile").val()),s=n.trim(i("#register .code").val());if(""==l)return n.toast({content:"车厂名称必填"}),!1;if(""==c)return n.toast({content:"手机号码必填"}),!1;if(!n.isMobile(c))return n.toast({content:"手机号码不合格"}),!1;if(""==s)return n.toast({content:"验证码必填"}),!1;var u=i("#register .upload-btn-cls").attr("data");if(void 0===u||null==u)return n.toast({content:"请上传营业执照"}),!1;if(0==a)return!1;a=!1;var d=e.csrf({name:l,mobile:c,code:s,img:u});n.httpPost(t.to(r),d,function(e){return e.success?void(window.location.href=t.to("/")):(n.toast({content:e.message,closeDelay:3e3}),a=!0,!1)})})},e.gotoLoginEvent=function(){i("#register .login-btn").click(function(e){window.location.href=t.to("user/#login")})},e}); | |
3 | 3 | \ No newline at end of file | ... | ... |
914 Bytes
web/i/order/repairing_tip_image.png
914 Bytes
web/src/js/order/app.js
... | ... | @@ -47,16 +47,35 @@ define( |
47 | 47 | } |
48 | 48 | return app.runController('index',params); |
49 | 49 | }, |
50 | - 'rate': function () { | |
50 | + 'rate/:id': function (id) { | |
51 | 51 | fromOutside = false; |
52 | 52 | _autoLoading(); |
53 | - return app.runController('rate'); | |
53 | + var params = { | |
54 | + id:id | |
55 | + } | |
56 | + return app.runController('rate',params); | |
54 | 57 | }, |
55 | 58 | 'submit': function () { |
56 | 59 | fromOutside = false; |
57 | 60 | _autoLoading(); |
58 | 61 | return app.runController('submit'); |
59 | 62 | }, |
63 | + 'order-details/:id': function (id) { | |
64 | + fromOutside = false; | |
65 | + _autoLoading(); | |
66 | + var params = { | |
67 | + id:id | |
68 | + } | |
69 | + return app.runController('order-details', params); | |
70 | + }, | |
71 | + 'cost-list/:id': function (id) { | |
72 | + fromOutside = false; | |
73 | + _autoLoading(); | |
74 | + var params = { | |
75 | + id:id | |
76 | + } | |
77 | + return app.runController('cost-list', params); | |
78 | + }, | |
60 | 79 | '*': function(){ |
61 | 80 | return app.runController('index'); |
62 | 81 | } | ... | ... |
web/src/js/order/cost-list-controller.js
1 | 1 | /** |
2 | - * 订单评价-首页 | |
2 | + * 首页 | |
3 | 3 | */ |
4 | 4 | define( |
5 | 5 | "order/cost-list-controller", |
... | ... | @@ -7,24 +7,161 @@ define( |
7 | 7 | 'mk7/controller', |
8 | 8 | 'mk7/url', |
9 | 9 | 'mk7/utils', |
10 | + 'mk7/uploadjs', | |
10 | 11 | ], |
11 | 12 | |
12 | - function(ctrl, url, utils) { | |
13 | + function(ctrl, url, utils, uploadjs) { | |
13 | 14 | |
14 | 15 | var $$ = Dom7; |
15 | 16 | var t7 = Template7; |
16 | 17 | var ctrl = new ctrl(); |
17 | - | |
18 | + var uploadURL = '/user/default/upload-file'; | |
19 | + var submitURL = '/order/default/submit-repair-plans'; | |
18 | 20 | ctrl.run = function () { |
19 | 21 | var me = this; |
20 | 22 | me.setPageTitle("费用列表"); |
23 | + me.imgLimit = 9; | |
24 | + me.canSubmit = true; | |
21 | 25 | me.render(); |
22 | 26 | } |
23 | 27 | ctrl.bindEvents = function () { |
24 | 28 | var me = this; |
25 | 29 | console.log("bindEvents"); |
30 | + me.addEvent(); | |
31 | + me.uploadImgEvent(); | |
32 | + me.delPlanEvent(); | |
33 | + me.inputPriceChangeEvent(); | |
34 | + me.submitEvent(); | |
26 | 35 | } |
36 | + ctrl.addEvent = function() { | |
37 | + var me = this; | |
38 | + $$('#cost-list .add-repair-plan').click(function (e) { | |
39 | + var costList = $$('#cost-list .cost-list-div'); | |
40 | + var tpl = me.planTpl(costList.length + 1); | |
41 | + //console.log(tpl) | |
42 | + $$(tpl).insertBefore($$('#cost-list .cost-total-list-div')) | |
27 | 43 | |
44 | + }) | |
45 | + } | |
46 | + ctrl.delPlanEvent = function (){ | |
47 | + var me = this; | |
48 | + $$('#cost-list').on('click', '.del-plan', function(e) { | |
49 | + console.log('del plan event') | |
50 | + $$(this).parents('.cost-list-div').remove(); | |
51 | + $$('#cost-list .total-plan-price').html(me.computedPrice()); | |
52 | + }) | |
53 | + } | |
54 | + ctrl.planTpl = function(i){ | |
55 | + var str = '<div class="cost-list-div">'+ | |
56 | + '<p class="item-title">第'+i+'项</p>'+ | |
57 | + '<div class="repair-item-cls">'+ | |
58 | + '<input type="text" class="input-left input-cls" placeholder="填写维修内容" value=""><input type="number" class="input-right input-cls" placeholder="填写价格" value="0">'+ | |
59 | + '<span class="del-plan"></span>'+ | |
60 | + '</div>'+ | |
61 | + '</div>'; | |
62 | + return str; | |
63 | + } | |
64 | + ctrl.inputPriceChangeEvent = function() { | |
65 | + var me = this; | |
66 | + $$('#cost-list').on('input propertychange', '.input-cls', function() { | |
67 | + var p = me.computedPrice(); | |
68 | + $$('#cost-list .total-plan-price').html(p) | |
69 | + }) | |
70 | + } | |
71 | + ctrl.computedPrice = function() { | |
72 | + var items = $$('#cost-list .input-right'); | |
73 | + var totalP = 0; | |
74 | + $$.each(items, function(i, n) { | |
75 | + totalP = totalP + ($$(n).val()*1); | |
76 | + }) | |
77 | + return Math.round(totalP,2); | |
78 | + } | |
79 | + ctrl.uploadImgEvent = function() { | |
80 | + var me = this; | |
81 | + $$('#cost-list #upload-btn').change(function () { | |
82 | + if ('' == $$(this).val() || null == $$(this).val()) { | |
83 | + return; | |
84 | + } | |
85 | + var uploadParent = $$(this).parents('li'); | |
86 | + | |
87 | + uploadjs.uploadFile({ | |
88 | + selector: '#upload-btn', | |
89 | + url: url.to(uploadURL), | |
90 | + processAppendTo: '#cost-list', | |
91 | + success: function (response, e) { | |
92 | + try { | |
93 | + if (response.success) { | |
94 | + var imgUrl = response.tmpUrl; | |
95 | + | |
96 | + $$('<li class="upload-li up-img"><div data="' + response.tmpFile + '" data-url="' + imgUrl + '" class="upload-item" style="background-image:url(' + response.tmpMinUrl + ')">' + '</div><span class="del-img"></span></li>').insertBefore(uploadParent); | |
97 | + if (me.imgLimit == $$('#cost-list #image-list').find('.up-img').length) { | |
98 | + $$('#cost-list .upload-btn-li').hide(); | |
99 | + } | |
100 | + } else { | |
101 | + utils.toast({content: response.message, closeDelay: 5000}); | |
102 | + } | |
103 | + } catch (ex) { | |
104 | + console.log(ex) | |
105 | + utils.toast({content: '出错', closeDelay: 5000}); | |
106 | + } | |
107 | + } | |
108 | + }); | |
109 | + }) | |
110 | + | |
111 | + $$('#cost-list #image-list').on('click', '.del-img', function(e){ | |
112 | + $$(this).parent().remove(); | |
113 | + if (me.imgLimit >= $$('#cost-list #image-list').find('.up-img').length) { | |
114 | + $$('#cost-list .upload-btn-li').show(); | |
115 | + } | |
116 | + }) | |
117 | + } | |
118 | + ctrl.submitEvent = function() { | |
119 | + var me = this; | |
120 | + $$('#cost-list .btn-submit').click(function(e) { | |
121 | + var contentList = $$('#cost-list .content-div').find('.repair-item-cls'); | |
122 | + var repairPlan = []; | |
123 | + var fillContent = true; | |
124 | + var fillPrice = true; | |
125 | + $$.each(contentList, function(i,n){ | |
126 | + var rContent = utils.trim($$(n).find('.input-left').val()) | |
127 | + var rPrice= utils.trim($$(n).find('.input-right').val()); | |
128 | + if ('' == rContent) { | |
129 | + fillContent = false; | |
130 | + } | |
131 | + if ('' == rPrice || 0 == rPrice) { | |
132 | + fillPrice = false; | |
133 | + } | |
134 | + repairPlan.push({content:rContent, price:rPrice}) | |
135 | + }) | |
136 | + if (!fillContent) { | |
137 | + utils.toast({content:'维修清单有部分未填内容'}); | |
138 | + return false; | |
139 | + } | |
140 | + if (!fillPrice) { | |
141 | + utils.toast({content:'维修清单有部分未填价格'}); | |
142 | + return false; | |
143 | + } | |
144 | + var imagesDom = $$('#cost-list #image-list').find('.upload-item'); | |
145 | + var images = []; | |
146 | + $$.each(imagesDom, function(i,n) { | |
147 | + images.push($$(n).attr('data')) | |
148 | + }) | |
149 | + | |
150 | + if (!me.canSubmit) { | |
151 | + return false; | |
152 | + } | |
153 | + me.canSubmit = false; | |
154 | + var pData = me.csrf({images:images, plans: repairPlan}); | |
155 | + utils.httpPost(submitURL,pData, function(res){ | |
156 | + me.canSubmit = true; | |
157 | + if (res.success) { | |
158 | + window.location.replace(url.to('order/#item-details/'+me.id)) | |
159 | + } else { | |
160 | + utils.toast({content:res.message}) | |
161 | + } | |
162 | + }, true) | |
163 | + }) | |
164 | + } | |
28 | 165 | return ctrl; |
29 | 166 | } |
30 | 167 | ); | ... | ... |
... | ... | @@ -0,0 +1,55 @@ |
1 | +/** | |
2 | + * 维修中页 | |
3 | + */ | |
4 | +define( | |
5 | + "order/order-details-controller", | |
6 | + [ | |
7 | + 'mk7/controller', | |
8 | + 'mk7/url', | |
9 | + 'mk7/utils', | |
10 | + ], | |
11 | + | |
12 | + function(ctrl, url, utils) { | |
13 | + | |
14 | + var $$ = Dom7; | |
15 | + var t7 = Template7; | |
16 | + var ctrl = new ctrl(); | |
17 | + | |
18 | + var pageURL = 'order/default/order-details'; | |
19 | + ctrl.run = function () { | |
20 | + var me = this; | |
21 | + me.id = me.params.id; | |
22 | + me.setPageTitle("维修单"); | |
23 | + me.loadPage(); | |
24 | + } | |
25 | + ctrl.bindEvents = function () { | |
26 | + var me = this; | |
27 | + console.log("bindEvents"); | |
28 | + me.finishBtnEvent(); | |
29 | + me.goToComment(); | |
30 | + } | |
31 | + ctrl.loadPage = function() { | |
32 | + var me = this | |
33 | + var pData = me.csrf({id: me.id}); | |
34 | + utils.httpGet(pageURL, pData, function(res) { | |
35 | + var rData = res; | |
36 | + me.render(rData); | |
37 | + }, true) | |
38 | + | |
39 | + } | |
40 | + ctrl.finishBtnEvent = function() { | |
41 | + var me = this; | |
42 | + $$('#order-details .finish-submit').click(function(e){ | |
43 | + window.location.href = url.to('order/#cost-list/'+me.id); | |
44 | + }) | |
45 | + } | |
46 | + ctrl.goToComment = function() { | |
47 | + var me = this; | |
48 | + $$('#order-details .rate-btn-cls').click(function(e){ | |
49 | + window.location.href = url.to('order/#rate/'+me.id) | |
50 | + }) | |
51 | + | |
52 | + } | |
53 | + return ctrl; | |
54 | + } | |
55 | +); | ... | ... |
web/src/js/order/rate-controller.js
... | ... | @@ -15,16 +15,64 @@ define( |
15 | 15 | var t7 = Template7; |
16 | 16 | var ctrl = new ctrl(); |
17 | 17 | |
18 | + var submitURL = 'order/default/submit-rate'; | |
18 | 19 | ctrl.run = function () { |
19 | 20 | var me = this; |
21 | + me.id = me.params.id; | |
20 | 22 | me.setPageTitle("评价"); |
21 | - me.render(); | |
23 | + me.loadPage(); | |
22 | 24 | } |
23 | 25 | ctrl.bindEvents = function () { |
24 | 26 | var me = this; |
25 | 27 | console.log("bindEvents"); |
28 | + me.starClickEvent(); | |
29 | + me.submitEvent(); | |
26 | 30 | } |
31 | + ctrl.loadPage = function(){ | |
32 | + var me = this; | |
33 | + me.render(); | |
34 | + } | |
35 | + ctrl.starClickEvent = function() { | |
36 | + $$('#rate').on('click','.quality-box .img-star',function(e) { | |
37 | + var id = $$(this).attr('data-id'); | |
38 | + var stars = $$('#rate .quality-box .img-star') | |
39 | + $$.each(stars, function(i,n){ | |
40 | + var cid = $$(n).attr('data-id'); | |
41 | + if ((cid*1) <= id) { | |
42 | + $$(n).addClass('star-on'); | |
43 | + var rateText = $$('#rate .quality-box').find('.rate-text'); | |
44 | + var txt = $$(n).attr('data-txt'); | |
27 | 45 | |
46 | + rateText.html(txt); | |
47 | + } else { | |
48 | + $$(n).removeClass('star-on'); | |
49 | + } | |
50 | + }) | |
51 | + }) | |
52 | + } | |
53 | + ctrl.submitEvent = function() { | |
54 | + var me = this; | |
55 | + $$('#rate .submit-btn').click(function(e){ | |
56 | + var comment = utils.trim($$('#rate .text-content').val()); | |
57 | + var stars = $$('#rate .img-star') | |
58 | + var star = 0; | |
59 | + $$.each(stars, function(i,n){ | |
60 | + if($$(n).hasClass('star-on')) { | |
61 | + star++ | |
62 | + } | |
63 | + }) | |
64 | + | |
65 | + var pData = me.csrf({star:star,comment:comment}); | |
66 | + utils.httpPost(url.to(submitURL), pData, function(res) { | |
67 | + if (res.success) { | |
68 | + window.location.replace('order/#order-details/'+me.id); | |
69 | + } else { | |
70 | + utils.toast({content:res.message}); | |
71 | + } | |
72 | + }, true) | |
73 | + }) | |
74 | + | |
75 | + } | |
28 | 76 | return ctrl; |
29 | 77 | } |
30 | 78 | ); | ... | ... |
web/src/js/order/repairing-controller.js
... | ... | @@ -1,30 +0,0 @@ |
1 | -/** | |
2 | - * 维修中页 | |
3 | - */ | |
4 | -define( | |
5 | - "order/repairing-controller", | |
6 | - [ | |
7 | - 'mk7/controller', | |
8 | - 'mk7/url', | |
9 | - 'mk7/utils', | |
10 | - ], | |
11 | - | |
12 | - function(ctrl, url, utils) { | |
13 | - | |
14 | - var $$ = Dom7; | |
15 | - var t7 = Template7; | |
16 | - var ctrl = new ctrl(); | |
17 | - | |
18 | - ctrl.run = function () { | |
19 | - var me = this; | |
20 | - me.setPageTitle("维修单"); | |
21 | - me.render(); | |
22 | - } | |
23 | - ctrl.bindEvents = function () { | |
24 | - var me = this; | |
25 | - console.log("bindEvents"); | |
26 | - } | |
27 | - | |
28 | - return ctrl; | |
29 | - } | |
30 | -); |
web/src/js/user/register-controller.js
... | ... | @@ -39,13 +39,14 @@ define( |
39 | 39 | me.gotoLoginEvent(); |
40 | 40 | } |
41 | 41 | ctrl.uploadEvent = function() { |
42 | - $$('#register #upload-btn').change(function() { | |
42 | + $$('#register .upload-input-cls').change(function() { | |
43 | 43 | if ('' == $$(this).val() || null == $$(this).val()) { |
44 | 44 | return ; |
45 | 45 | } |
46 | + var id = $$(this).attr('id'); | |
46 | 47 | var parent = $$(this).parent(); |
47 | 48 | uploadjs.uploadFile({ |
48 | - selector:'#upload-btn', | |
49 | + selector:'#'+id, | |
49 | 50 | url:url.to(uploadURL), |
50 | 51 | processAppendTo:'#register', |
51 | 52 | success:function(response, e) { | ... | ... |