Commit 973b4e0b56ce6ed5f41d85d0c3dd42e813e05f9f
1 parent
400b66a0
Exists in
master
1.添加订单服务评价页面
Showing
14 changed files
with
331 additions
and
1 deletions
Show diff stats
app-wx/config/main.php
@@ -14,7 +14,9 @@ return [ | @@ -14,7 +14,9 @@ return [ | ||
14 | 'controllerNamespace' => 'app\wx\controllers', | 14 | 'controllerNamespace' => 'app\wx\controllers', |
15 | 'defaultRoute' => 'order', | 15 | 'defaultRoute' => 'order', |
16 | 'modules' => [ | 16 | 'modules' => [ |
17 | - | 17 | + 'order' => [ |
18 | + 'class' => 'app\wx\modules\order\Module', | ||
19 | + ], | ||
18 | 'user' => [ | 20 | 'user' => [ |
19 | 'class' => 'app\wx\modules\user\Module', | 21 | 'class' => 'app\wx\modules\user\Module', |
20 | ] | 22 | ] |
@@ -0,0 +1,17 @@ | @@ -0,0 +1,17 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace app\wx\modules\order; | ||
4 | + | ||
5 | +use yii\base\Module as BaseModule; | ||
6 | + | ||
7 | +/** | ||
8 | + * Class Module | ||
9 | + * @package app\wx\modules | ||
10 | + */ | ||
11 | +class Module extends BaseModule | ||
12 | +{ | ||
13 | + public function init() | ||
14 | + { | ||
15 | + parent::init(); | ||
16 | + } | ||
17 | +} | ||
0 | \ No newline at end of file | 18 | \ No newline at end of file |
@@ -0,0 +1,24 @@ | @@ -0,0 +1,24 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace app\wx\modules\order\controllers; | ||
4 | + | ||
5 | +use Yii; | ||
6 | +use app\wx\controllers\BaseController as AppBaseController; | ||
7 | + | ||
8 | +/** | ||
9 | + * Class BaseController | ||
10 | + * @package app\wx\modules\toutiao\controllers | ||
11 | + */ | ||
12 | +class BaseController extends AppBaseController | ||
13 | +{ | ||
14 | + public $layout = 'main'; | ||
15 | + | ||
16 | + /** | ||
17 | + * @throws yii\web\BadRequestHttpException | ||
18 | + */ | ||
19 | + public function init() | ||
20 | + { | ||
21 | + parent::init(); // TODO: Change the autogenerated stub | ||
22 | + | ||
23 | + } | ||
24 | +} | ||
0 | \ No newline at end of file | 25 | \ No newline at end of file |
@@ -0,0 +1,20 @@ | @@ -0,0 +1,20 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +namespace app\wx\modules\order\controllers; | ||
4 | + | ||
5 | +use Yii; | ||
6 | +use stdClass; | ||
7 | + | ||
8 | +/** | ||
9 | + * 控制器 | ||
10 | + */ | ||
11 | +class DefaultController extends BaseController | ||
12 | +{ | ||
13 | + /** | ||
14 | + * 首页 | ||
15 | + */ | ||
16 | + public function actionIndex() | ||
17 | + { | ||
18 | + return $this->render('index'); | ||
19 | + } | ||
20 | +} | ||
0 | \ No newline at end of file | 21 | \ No newline at end of file |
@@ -0,0 +1,38 @@ | @@ -0,0 +1,38 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Url; | ||
4 | + | ||
5 | +$baseUrl = Url::base(true); | ||
6 | +$assets = $this->getAssetManager(); | ||
7 | +$asset = $assets->getBundle('app\wx\assets\AppAsset'); | ||
8 | + | ||
9 | +function img($file, $path = '/i/') | ||
10 | +{ | ||
11 | + return \Yii::$app->request->baseUrl . $path.$file; | ||
12 | +} | ||
13 | +?> | ||
14 | +<style> | ||
15 | + | ||
16 | +</style> | ||
17 | +<div class="views"> | ||
18 | + <div class="view view-main"> | ||
19 | + <?=$this->render("@app/views/widgets/ui-loading")?> | ||
20 | + </div> | ||
21 | +</div> | ||
22 | + | ||
23 | +<?=$this->render('pages/index-template', ['asset' => $asset])?> | ||
24 | +<?=$this->render('pages/rank-template', ['asset' => $asset])?> | ||
25 | + | ||
26 | +<script> | ||
27 | + require.config({baseUrl: $site.assets_url + '/js/',urlArgs : "v=" + require.version}); | ||
28 | + require([ | ||
29 | + 'order-app' | ||
30 | + ], | ||
31 | + function(app){ | ||
32 | + app.bootstrap({ | ||
33 | + baseUrl: $site.base_url | ||
34 | + }); | ||
35 | + }); | ||
36 | +</script> | ||
37 | + | ||
38 | +<?=$this->render("@app/views/widgets/stat-code")?> |
app-wx/modules/order/views/default/pages/index-template.php
0 → 100644
@@ -0,0 +1,20 @@ | @@ -0,0 +1,20 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +use yii\helpers\Url; | ||
4 | + | ||
5 | +$baseUrl = Url::base(true); | ||
6 | +?> | ||
7 | +<style> | ||
8 | +#index{} | ||
9 | + | ||
10 | +</style> | ||
11 | +<script id="index-template" type="text/template"> | ||
12 | + <div class="pages"> | ||
13 | + <div class="page" id="index" style="background: #f2f3f6"> | ||
14 | + <div class="page-content"> | ||
15 | + | ||
16 | + </div> | ||
17 | + | ||
18 | + </div> | ||
19 | + </div> | ||
20 | +</script> |
app-wx/modules/order/views/default/pages/rank-template.php
0 → 100644
@@ -0,0 +1,39 @@ | @@ -0,0 +1,39 @@ | ||
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 | + #rank .content-div { background: #fff; height: auto;padding: 1rem} | ||
9 | + #rank .page-content{ background-color: #ECF0F2 } | ||
10 | + #rank .rank-title { height:1.06rem; font-size:1.06rem; font-weight:400; color:rgba(9,9,9,1); line-height:0.75rem;} | ||
11 | + #rank .rank-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 | + #rank .star-div {margin-top: 1rem;display: flex;} | ||
13 | + #rank .img-start {width: 1.47rem; height: 1.47rem; float: left; vertical-align: middle; margin-right: 1rem} | ||
14 | + #rank .text-content {width: 100%;height: 7.5rem; resize: none;line-height: 1.2rem;padding: 0.5rem} | ||
15 | + | ||
16 | +</style> | ||
17 | +<script id="rank-template" type="text/template"> | ||
18 | + <div class="pages"> | ||
19 | + <div class="page" id="rank" style="background: #fff"> | ||
20 | + <div class="page-content"> | ||
21 | + <div class="content-div"> | ||
22 | + <div class="rank-title">服务评价</div> | ||
23 | + <div class="star-div"> | ||
24 | + <img src="<?= $baseUrl . "/i/order/rank/rank_star.png"?>" class="img-start"> | ||
25 | + <img src="<?= $baseUrl . "/i/order/rank/rank_star.png"?>" class="img-start"> | ||
26 | + <img src="<?= $baseUrl . "/i/order/rank/rank_star.png"?>" class="img-start"> | ||
27 | + <img src="<?= $baseUrl . "/i/order/rank/rank_star.png"?>" class="img-start"> | ||
28 | + <img src="<?= $baseUrl . "/i/order/rank/rank_no_select.png"?>" class="img-start"> | ||
29 | + <span style="line-height: 1.47rem">一般</span> | ||
30 | + </div> | ||
31 | + <div class="rank-title-two">说说你的感受</div> | ||
32 | + <div class="star-div"> | ||
33 | + <textarea class="text-content" placeholder="说说此次服务的优点和不足的地方吧"></textarea> | ||
34 | + </div> | ||
35 | + </div> | ||
36 | + </div> | ||
37 | + </div> | ||
38 | + </div> | ||
39 | +</script> |
@@ -0,0 +1,43 @@ | @@ -0,0 +1,43 @@ | ||
1 | +<?php | ||
2 | + | ||
3 | +use app\wx\assets\AppAsset; | ||
4 | +use yii\helpers\Html; | ||
5 | + | ||
6 | +AppAsset::register($this); | ||
7 | + | ||
8 | +$site = $this->params['site']; | ||
9 | + | ||
10 | +$this->title = \yii::$app->name; | ||
11 | +$assets = $this->getAssetManager(); | ||
12 | +$asset = $assets->getBundle('app\wx\assets\AppAsset'); | ||
13 | +?> | ||
14 | +<?php $this->beginPage() ?> | ||
15 | +<!DOCTYPE HTML> | ||
16 | + | ||
17 | +<html lang="<?= \yii::$app->language ?>"> | ||
18 | +<head> | ||
19 | +<meta charset="<?= \yii::$app->charset ?>"> | ||
20 | +<meta name="apple-mobile-web-app-capable" content="yes"> | ||
21 | +<meta name="apple-mobile-web-app-status-bar-style" content="black"> | ||
22 | +<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"> | ||
23 | +<meta http-equiv="Pragma" content="no-cache"> | ||
24 | +<meta http-equiv="Expires" content="0"> | ||
25 | +<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | ||
26 | +<?= Html::csrfMetaTags() ?> | ||
27 | +<title><?= Html::encode($this->title) ?></title> | ||
28 | +<script> | ||
29 | + <?=$this->render("@app/views/widgets/js-site", ['site' => $site])?> | ||
30 | +</script> | ||
31 | +<?php $this->head() ?> | ||
32 | +<style> | ||
33 | + | ||
34 | +</style> | ||
35 | +</head> | ||
36 | +<body> | ||
37 | +<?php $this->beginBody() ?> | ||
38 | +<?=$content?> | ||
39 | +<?php $this->endBody() ?> | ||
40 | +</body> | ||
41 | +</html> | ||
42 | +<?php $this->endPage() ?> | ||
43 | + |
web/gulpfile.js
@@ -84,6 +84,14 @@ gulp.task('build', function () { | @@ -84,6 +84,14 @@ gulp.task('build', function () { | ||
84 | .pipe(gulp.dest(paths.dist.scripts)); | 84 | .pipe(gulp.dest(paths.dist.scripts)); |
85 | //-------------------------------------------------- | 85 | //-------------------------------------------------- |
86 | 86 | ||
87 | + //----------------------------------------------- | ||
88 | + //order module (订单模块) | ||
89 | + gulp.src([paths.source.scripts + 'order/*.js']) | ||
90 | + .pipe(concat('order-app.js')) | ||
91 | + .pipe(uglify()) | ||
92 | + .pipe(gulp.dest(paths.dist.scripts)); | ||
93 | + //-------------------------------------------------- | ||
94 | + | ||
87 | 95 | ||
88 | //字体 | 96 | //字体 |
89 | gulp.src([paths.source.fonts + '*']) | 97 | gulp.src([paths.source.fonts + '*']) |
2.25 KB
1.44 KB
@@ -0,0 +1,53 @@ | @@ -0,0 +1,53 @@ | ||
1 | +/** | ||
2 | + * 单页面应用 | ||
3 | + */ | ||
4 | +define( | ||
5 | + "order-app", | ||
6 | + [ | ||
7 | + 'mk7/app' | ||
8 | + ], | ||
9 | + function(app) { | ||
10 | + | ||
11 | + var $$ = Dom7; | ||
12 | + var _autoLoading = function(){ | ||
13 | + var e = $$('.ui-loading-block'); | ||
14 | + if(0 == e.length){ | ||
15 | + //<!--预载入页面动画--> | ||
16 | + $$('.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>'); | ||
17 | + window['waitingTime'] = 10000; // 显示重新加载的等待时间,默认10s | ||
18 | + if(window['loaderTimer']){ | ||
19 | + clearTimeout(window['loaderTimer']); | ||
20 | + } | ||
21 | + window['loaderTimer'] = setTimeout(function(){ | ||
22 | + var loaderTips = document.getElementById('loader-inner'); | ||
23 | + var tips = document.createElement('p'); | ||
24 | + tips.className = 'notice'; | ||
25 | + if(loaderTips){ | ||
26 | + tips.innerHTML = '加载速度太慢?试试<a class="link" href="#" onclick="javascript:location.reload();return false;">重新加载</a>'; | ||
27 | + loaderTips.appendChild(tips); | ||
28 | + } | ||
29 | + },window['waitingTime']); | ||
30 | + } | ||
31 | + }; | ||
32 | + | ||
33 | + var fromOutside = true; // 标记是否从外部进来 | ||
34 | + | ||
35 | + app.name = 'order'; | ||
36 | + app.routes = { | ||
37 | + 'index': function () { | ||
38 | + fromOutside = false; | ||
39 | + _autoLoading(); | ||
40 | + return app.runController('index'); | ||
41 | + }, | ||
42 | + 'rank': function () { | ||
43 | + fromOutside = false; | ||
44 | + _autoLoading(); | ||
45 | + return app.runController('rank'); | ||
46 | + }, | ||
47 | + '*': function(){ | ||
48 | + return app.runController('index'); | ||
49 | + } | ||
50 | + } | ||
51 | + return app; | ||
52 | + } | ||
53 | +); |
@@ -0,0 +1,36 @@ | @@ -0,0 +1,36 @@ | ||
1 | +/** | ||
2 | + * 首页 | ||
3 | + */ | ||
4 | +define( | ||
5 | + "order/index-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 | + | ||
19 | + ctrl.run = function () { | ||
20 | + var me = this; | ||
21 | + me.setPageTitle("首页"); | ||
22 | + me.hideAllNonBaseMenuItem(window.$site); | ||
23 | + | ||
24 | + me.render(); | ||
25 | + | ||
26 | + | ||
27 | + } | ||
28 | + ctrl.bindEvents = function () { | ||
29 | + var me = this; | ||
30 | + console.log("bindEvents"); | ||
31 | + | ||
32 | + } | ||
33 | + | ||
34 | + return ctrl; | ||
35 | + } | ||
36 | +); |
@@ -0,0 +1,30 @@ | @@ -0,0 +1,30 @@ | ||
1 | +/** | ||
2 | + * 订单评价-首页 | ||
3 | + */ | ||
4 | +define( | ||
5 | + "order/rank-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 | +); |