Commit 05c36c1d057ca8027a2845e8620cc283aaae570d
1 parent
73d5dea8
Exists in
master
1. 新增验证首页和扫码次数页
Showing
210 changed files
with
1325 additions
and
783 deletions
Show diff stats
Too many changes.
To preserve performance only 100 of 210 files displayed.
app-ht/modules/user/controllers/UserController.php
... | ... | @@ -4,8 +4,8 @@ namespace app\ht\modules\user\controllers; |
4 | 4 | |
5 | 5 | use Yii; |
6 | 6 | use yii\data\Pagination; |
7 | -use domain\user\User; | |
8 | -use domain\user\UserRepository; | |
7 | +use domain\smart\User; | |
8 | +use domain\smart\UserRepository; | |
9 | 9 | use common\models\SysUser as SysUserModel; |
10 | 10 | use app\ht\controllers\BaseController; |
11 | 11 | ... | ... |
app-wx/config/main.php
... | ... | @@ -16,12 +16,15 @@ return [ |
16 | 16 | 'modules' => [ |
17 | 17 | 'smart' => [ |
18 | 18 | 'class' => 'app\wx\modules\smart\Module', |
19 | + ], | |
20 | + 'check' => [ | |
21 | + 'class' => 'app\wx\modules\check\Module', | |
19 | 22 | ] |
20 | 23 | ], |
21 | 24 | 'components' => [ |
22 | 25 | 'user' => [ |
23 | 26 | 'class'=> 'app\wx\exts\User', |
24 | - 'identityClass' => 'domain\user\models\User', | |
27 | + 'identityClass' => 'domain\smart\models\User', | |
25 | 28 | 'enableAutoLogin' => true,//是否启用自动登录 |
26 | 29 | ], |
27 | 30 | 'errorHandler' => [ | ... | ... |
app-wx/controllers/BaseController.php
... | ... | @@ -15,7 +15,7 @@ use common\models\SysSetting; |
15 | 15 | use domain\engineer\EngineerRole; |
16 | 16 | use domain\engineer\EngineerStatus; |
17 | 17 | use domain\engineer\EngineerSkillTagsRepository; |
18 | -use domain\user\UserRepository; | |
18 | +use domain\smart\UserRepository; | |
19 | 19 | use stdClass; |
20 | 20 | use function header; |
21 | 21 | use function in_array; | ... | ... |
app-wx/controllers/SiteController.php
app-wx/controllers/WechatController.php
... | ... | @@ -5,11 +5,11 @@ namespace app\wx\controllers; |
5 | 5 | use Yii; |
6 | 6 | use yii\base\Exception; |
7 | 7 | use yii\helpers\Url; |
8 | -use domain\user\UserRepository; | |
8 | +use domain\smart\UserRepository; | |
9 | 9 | use common\helpers\AppErrorLog; |
10 | 10 | use common\helpers\Log as AppLog; |
11 | 11 | use common\helpers\WechatMessageHelper; |
12 | -use domain\user\models\User as UserModel; | |
12 | +use domain\smart\models\User as UserModel; | |
13 | 13 | use common\exts\wechat\PHPSDK as WxPHPSDK; |
14 | 14 | use common\helpers\WxHelper; |
15 | 15 | use common\helpers\ImageManager; | ... | ... |
app-wx/exts/User.php
... | ... | @@ -0,0 +1,15 @@ |
1 | +<?php namespace app\wx\modules\check; | |
2 | + | |
3 | +use yii\base\Module as BaseModule; | |
4 | + | |
5 | +/** | |
6 | + * Class Module | |
7 | + * @package app\wx\modules | |
8 | + */ | |
9 | +class Module extends BaseModule | |
10 | +{ | |
11 | + public function init() | |
12 | + { | |
13 | + parent::init(); | |
14 | + } | |
15 | +} | |
0 | 16 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,24 @@ |
1 | +<?php | |
2 | +namespace app\wx\modules\check\controllers; | |
3 | + | |
4 | +use Yii; | |
5 | +use app\wx\controllers\BaseController as AppBaseController; | |
6 | + | |
7 | +/** | |
8 | + * Class BaseController | |
9 | + * @package app\wx\modules\user\controllers | |
10 | + */ | |
11 | +class BaseController extends AppBaseController | |
12 | +{ | |
13 | + public $layout = 'main'; | |
14 | + | |
15 | + /** | |
16 | + * @throws yii\web\BadRequestHttpException | |
17 | + */ | |
18 | + public function init() | |
19 | + { | |
20 | + parent::init(); // TODO: Change the autogenerated stub | |
21 | + $this->checkClientStatus(); | |
22 | + $this->handleMallAccessCtrl(); | |
23 | + } | |
24 | +} | |
0 | 25 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,52 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace app\wx\modules\check\controllers; | |
4 | + | |
5 | +use Yii; | |
6 | +use domain\smart\ScanRecords; | |
7 | +use domain\smart\SellerInputRecordRepository; | |
8 | +use stdClass; | |
9 | + | |
10 | +/** | |
11 | + * 校验-控制器 | |
12 | + */ | |
13 | +class DefaultController extends BaseController | |
14 | +{ | |
15 | + /** | |
16 | + * 校验 | |
17 | + */ | |
18 | + public function actionIndex() | |
19 | + { | |
20 | + return $this->render('index'); | |
21 | + } | |
22 | + | |
23 | + /** | |
24 | + * 查询是否激活 | |
25 | + * @return string | |
26 | + */ | |
27 | + public function actionCheckActive() | |
28 | + { | |
29 | + $e = new stdClass(); | |
30 | + $e->success = 2; | |
31 | + $e->message = ""; | |
32 | + $uuid = Yii::$app->request->post("uuid"); | |
33 | + if (empty($uuid)) { | |
34 | + $e->message = '缺少必要参数!'; | |
35 | + return $this->renderJson($e); | |
36 | + } | |
37 | + // @todo 校验UUID是否有效 2 无效 0 有效未激活 1 有效已激活 | |
38 | + $hasRecord = SellerInputRecordRepository::findOne(["uuid" => $uuid]); | |
39 | + // 记录扫码次数 | |
40 | + ScanRecords::updateCount($uuid); | |
41 | + if (empty($hasRecord)) { | |
42 | + $e->success = 0; | |
43 | + $e->message = '暂无激活!'; | |
44 | + return $this->renderJson($e); | |
45 | + } else { | |
46 | + $e->success = 1; | |
47 | + $e->message = '已激活'; | |
48 | + } | |
49 | + return $this->renderJson($e); | |
50 | + | |
51 | + } | |
52 | +} | |
0 | 53 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,43 @@ |
1 | +<?php | |
2 | +use yii\helpers\Url; | |
3 | +use common\models\SysSetting; | |
4 | +use common\models\RepairOrderRateTag; | |
5 | +use app\wx\modules\user\helpers\UserOrderHelper; | |
6 | + | |
7 | +$baseUrl = Url::base(true); | |
8 | + | |
9 | +$assets = $this->getAssetManager(); | |
10 | +$asset = $assets->getBundle('app\wx\assets\AppAsset'); | |
11 | +function img($file, $path = '/i/check/') | |
12 | +{ $baseUrl = Url::base(true); | |
13 | + return $baseUrl . $path. $file; | |
14 | +} | |
15 | +$order_polling_interval = SysSetting::getOrderPollingInterval(); | |
16 | +$redirectInfo=$this->context->checkUserLevel('', true, "none"); | |
17 | +?> | |
18 | +<div class="views"> | |
19 | + <div class="view view-main"> | |
20 | + <?=$this->render("@app/views/widgets/ui-loading")?> | |
21 | + </div> | |
22 | +</div> | |
23 | + | |
24 | +<?=$this->render('pages/index-template', ['asset' => $asset])?> | |
25 | +<?=$this->render('pages/scan-count-template', ['asset' => $asset])?> | |
26 | + | |
27 | +<script> | |
28 | + var redirect="<?=$redirectInfo['redirect_url']?>"; | |
29 | + var redirectStatus="<?=$redirectInfo['success']?>"; | |
30 | + window.pollingTimer=null; | |
31 | +</script> | |
32 | +<script> | |
33 | + require.config({baseUrl: $site.assets_url + '/js/',urlArgs : "v=" + require.version}); | |
34 | + require([ | |
35 | + 'check-app' | |
36 | + ], | |
37 | + function(app){ | |
38 | + app.bootstrap({ | |
39 | + baseUrl: $site.base_url | |
40 | + }); | |
41 | + }); | |
42 | +</script> | |
43 | +<?=$this->render("@app/views/widgets/stat-code")?> | ... | ... |
app-wx/modules/check/views/default/pages/index-template.php
0 → 100644
... | ... | @@ -0,0 +1,46 @@ |
1 | +<?php | |
2 | + | |
3 | +use yii\helpers\Url; | |
4 | + | |
5 | +$baseUrl = Url::base(true); | |
6 | +?> | |
7 | +<style> | |
8 | + #index .page-content { | |
9 | + background-color: #fff; | |
10 | + } | |
11 | + #index .scan-image-div { | |
12 | + padding-top: 6.69rem; | |
13 | + text-align: center; | |
14 | + } | |
15 | + #index .scan-image { | |
16 | + width: 7.78rem; | |
17 | + height: 7.78rem; | |
18 | + margin: 0 auto; | |
19 | + } | |
20 | + #index .scan-button { | |
21 | + margin: 0 auto; | |
22 | + margin-top: 3rem; | |
23 | + width: 15.75rem; | |
24 | + height: 2.81rem; | |
25 | + background: url(<?=$baseUrl?>/i/check/check_btn.png) center no-repeat #ffffff; | |
26 | + color: #FFF; | |
27 | + text-align: center; | |
28 | + line-height: 2.81rem; | |
29 | + font-size:1.06rem; | |
30 | + font-weight:400; | |
31 | + } | |
32 | +</style> | |
33 | +<script id="index-template" type="text/template"> | |
34 | + <div class="pages" id="index"> | |
35 | + <div class="page"> | |
36 | + <div class="page-content"> | |
37 | + <div class="scan-image-div"> | |
38 | + <img src="<?=$baseUrl?>/i/check/check_scan.png" class="scan-image"/> | |
39 | + </div> | |
40 | + <div class="scan-button"> | |
41 | + 点击扫描标签 | |
42 | + </div> | |
43 | + </div> | |
44 | + </div> | |
45 | + </div> | |
46 | +</script> | ... | ... |
app-wx/modules/check/views/default/pages/scan-count-template.php
0 → 100644
... | ... | @@ -0,0 +1,80 @@ |
1 | +<?php | |
2 | + | |
3 | +use yii\helpers\Url; | |
4 | + | |
5 | +$baseUrl = Url::base(true); | |
6 | +?> | |
7 | +<style> | |
8 | + #scan-count .page-content { | |
9 | + background-color: #fff; | |
10 | + } | |
11 | + #scan-count .scan-image-div { | |
12 | + text-align: center; | |
13 | + width: 12.19rem; | |
14 | + height: 12.19rem; | |
15 | + margin: 0 auto; | |
16 | + margin-top: 2rem; | |
17 | + background: url( <?=$baseUrl?>/i/check/check_count.png) center no-repeat #ffffff; | |
18 | + background-size: 100% 100%; | |
19 | + } | |
20 | + #scan-count .count-title { | |
21 | + height: 1rem; | |
22 | + font-size: 1rem; | |
23 | + font-weight: 400; | |
24 | + color: rgba(51,51,51,1); | |
25 | + line-height: 1.5rem; | |
26 | + padding-top: 3.5rem; | |
27 | + } | |
28 | + #scan-count .count-num { | |
29 | + font-size:3.3rem; | |
30 | + font-weight:400; | |
31 | + color:rgba(51,51,51,1); | |
32 | + line-height:3.17rem; | |
33 | + } | |
34 | + #scan-count .count-div { | |
35 | + margin-top: 1.78rem; | |
36 | + } | |
37 | + #scan-count .scan-button { | |
38 | + margin: 0 auto; | |
39 | + margin-top: 3rem; | |
40 | + width: 15.75rem; | |
41 | + height: 2.81rem; | |
42 | + background: url(<?=$baseUrl?>/i/check/check_btn.png) center no-repeat #ffffff; | |
43 | + color: #FFF; | |
44 | + text-align: center; | |
45 | + line-height: 2.81rem; | |
46 | + font-size:1.06rem; | |
47 | + font-weight:400; | |
48 | + } | |
49 | + #scan-count .tip-div { | |
50 | + font-size:1rem; | |
51 | + font-weight:400; | |
52 | + color:rgba(51,51,51,1); | |
53 | + line-height:1.5rem; | |
54 | + text-align: left; | |
55 | + margin: 0 auto; | |
56 | + margin-top: 2.81rem; | |
57 | + max-width: 18rem; | |
58 | + } | |
59 | +</style> | |
60 | +<script id="scan-count-template" type="text/template"> | |
61 | + <div class="pages" id="scan-count"> | |
62 | + <div class="page"> | |
63 | + <div class="page-content"> | |
64 | + <div class="scan-image-div"> | |
65 | + <div class="count-title">二维码被扫描次数</div> | |
66 | + <div class="count-div"> | |
67 | + <span class="count-num">0</span><span>次</span> | |
68 | + </div> | |
69 | + </div> | |
70 | + <div class="tip-div"> | |
71 | + 亲爱的用户:<br/> | |
72 | + 如果二维码扫描次数过多,您购买的产品存在假冒的风险,请点击【验证标签】进行校验。 | |
73 | + </div> | |
74 | + <div class="scan-button"> | |
75 | + 验证标签 | |
76 | + </div> | |
77 | + </div> | |
78 | + </div> | |
79 | + </div> | |
80 | +</script> | ... | ... |
... | ... | @@ -0,0 +1,42 @@ |
1 | +<?php | |
2 | +use app\wx\assets\AppAsset; | |
3 | +use yii\helpers\Html; | |
4 | + | |
5 | +AppAsset::register($this); | |
6 | + | |
7 | +$site = $this->params['site']; | |
8 | + | |
9 | +$this->title = ''; //\yii::$app->name; | |
10 | +$assets = $this->getAssetManager(); | |
11 | +$asset = $assets->getBundle('app\wx\assets\AppAsset'); | |
12 | +?> | |
13 | +<?php $this->beginPage() ?> | |
14 | +<!DOCTYPE HTML> | |
15 | + | |
16 | +<html lang="<?= \yii::$app->language ?>"> | |
17 | +<head> | |
18 | +<meta charset="<?= \yii::$app->charset ?>"> | |
19 | +<meta name="apple-mobile-web-app-capable" content="yes"> | |
20 | +<meta name="apple-mobile-web-app-status-bar-style" content="black"> | |
21 | +<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"> | |
22 | +<meta http-equiv="Pragma" content="no-cache"> | |
23 | +<meta http-equiv="Expires" content="0"> | |
24 | +<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | |
25 | +<?= Html::csrfMetaTags() ?> | |
26 | +<title><?= Html::encode($this->title) ?></title> | |
27 | +<script> | |
28 | + <?=$this->render("@app/views/widgets/js-site", ['site' => $site])?> | |
29 | +</script> | |
30 | +<?php $this->head() ?> | |
31 | +<style> | |
32 | + | |
33 | +</style> | |
34 | +</head> | |
35 | +<body> | |
36 | +<?php $this->beginBody() ?> | |
37 | +<?=$content?> | |
38 | +<?php $this->endBody() ?> | |
39 | +</body> | |
40 | +</html> | |
41 | +<?php $this->endPage() ?> | |
42 | + | ... | ... |
app-wx/modules/smart/controllers/DefaultController.php
... | ... | @@ -6,9 +6,9 @@ use Yii; |
6 | 6 | use common\helpers\ImageManager; |
7 | 7 | use common\helpers\ImageUtils; |
8 | 8 | use common\helpers\WxHelper; |
9 | -use domain\user\SellerInputRecord; | |
10 | -use domain\user\SellerInputRecordRepository; | |
11 | -use domain\user\UserAddressRepository; | |
9 | +use domain\smart\SellerInputRecord; | |
10 | +use domain\smart\SellerInputRecordRepository; | |
11 | +use domain\smart\UserAddressRepository; | |
12 | 12 | use yii\base\Exception; |
13 | 13 | use stdClass; |
14 | 14 | ... | ... |
app-wx/modules/smart/helpers/UserOrderHelper.php
app-wx/web/gulpfile.js
... | ... | @@ -70,14 +70,14 @@ gulp.task('build', function () { |
70 | 70 | |
71 | 71 | //----------------------------------------------- |
72 | 72 | //default module (默认模块) |
73 | - gulp.src([paths.source.scripts + 'site/*.js']) | |
74 | - .pipe(concat('site-app.js')) | |
73 | + gulp.src([paths.source.scripts + 'check/*.js']) | |
74 | + .pipe(concat('check-app.js')) | |
75 | 75 | .pipe(uglify()) |
76 | 76 | .pipe(gulp.dest(paths.dist.scripts)); |
77 | 77 | //-------------------------------------------------- |
78 | 78 | |
79 | 79 | //----------------------------------------------- |
80 | - //smart module (防伪模块) | |
80 | + //smart module (校验模块) | |
81 | 81 | gulp.src([paths.source.scripts + 'smart/*.js']) |
82 | 82 | .pipe(concat('smart-app.js')) |
83 | 83 | .pipe(uglify()) | ... | ... |
6.57 KB
39.2 KB
28.6 KB
app-wx/web/i/device/add.png
991 Bytes
app-wx/web/i/device/checked.png
1.87 KB
app-wx/web/i/device/close.png
597 Bytes
app-wx/web/i/device/close@2x.png
1.5 KB
app-wx/web/i/device/default_device_apply.jpg
14.5 KB
app-wx/web/i/device/device.png
85.7 KB
app-wx/web/i/device/device_close.png
921 Bytes
app-wx/web/i/device/device_img1.png
47.9 KB
app-wx/web/i/device/device_img2.png
49.8 KB
app-wx/web/i/device/device_img3.png
44.3 KB
app-wx/web/i/device/i-default.png
19.5 KB
app-wx/web/i/device/i-takephoto.png
4.69 KB
app-wx/web/i/device/ic_scan.png
3.72 KB
app-wx/web/i/device/location.png
1.46 KB
app-wx/web/i/device/my-device.jpg
10.5 KB
app-wx/web/i/device/next.png
198 Bytes
app-wx/web/i/device/pic-blur.png
22 KB
app-wx/web/i/device/pic-correct.png
47.5 KB
app-wx/web/i/device/pic-error.png
688 Bytes
app-wx/web/i/device/pic-example.png
85.6 KB
app-wx/web/i/device/pic-interrupt.png
30.8 KB
app-wx/web/i/device/pic-ref.png
32.6 KB
app-wx/web/i/device/profit.png
7.55 KB
app-wx/web/i/device/right.png
785 Bytes
app-wx/web/i/device/scan_success.png
3.64 KB
app-wx/web/i/device/search@2x.png
1.89 KB
app-wx/web/i/device/uncheck.png
1.94 KB
app-wx/web/i/device/v2_bg.png
16.5 KB
app-wx/web/i/device/v2_ic_scan.png
2.35 KB
app-wx/web/i/device/wrong.png
786 Bytes
app-wx/web/i/user/add.png
991 Bytes
app-wx/web/i/user/area.png
1.69 KB
app-wx/web/i/user/auth_identity.png
899 Bytes
app-wx/web/i/user/auth_skill.png
1.02 KB
app-wx/web/i/user/auto_door.png
3.57 KB
app-wx/web/i/user/bg.png
7.44 KB
app-wx/web/i/user/call.png
1.62 KB
app-wx/web/i/user/camera.png
5.52 KB
app-wx/web/i/user/checked.png
1.14 KB
app-wx/web/i/user/close.png
597 Bytes
app-wx/web/i/user/custom.png
2.47 KB
app-wx/web/i/user/demo_qrcode.jpg
2.56 KB
app-wx/web/i/user/device.png
23.8 KB
app-wx/web/i/user/do_not_distrub.png
3.09 KB
app-wx/web/i/user/fake/head_fake1.jpg
8.37 KB
app-wx/web/i/user/fake/head_fake10.jpg
5.66 KB
app-wx/web/i/user/fake/head_fake11.jpg
5.12 KB
app-wx/web/i/user/fake/head_fake12.jpg
8.64 KB
app-wx/web/i/user/fake/head_fake13.jpg
8.04 KB
app-wx/web/i/user/fake/head_fake14.jpg
7.53 KB
app-wx/web/i/user/fake/head_fake15.jpg
9.16 KB
app-wx/web/i/user/fake/head_fake16.jpg
2.62 KB
app-wx/web/i/user/fake/head_fake17.jpg
3.55 KB
app-wx/web/i/user/fake/head_fake18.jpg
5.71 KB
app-wx/web/i/user/fake/head_fake19.jpg
8.02 KB
app-wx/web/i/user/fake/head_fake2.jpg
8.26 KB
app-wx/web/i/user/fake/head_fake20.jpg
7.76 KB
app-wx/web/i/user/fake/head_fake21.jpg
11.1 KB
app-wx/web/i/user/fake/head_fake22.jpg
5.65 KB
app-wx/web/i/user/fake/head_fake23.jpg
13.2 KB
app-wx/web/i/user/fake/head_fake24.jpg
8.64 KB
app-wx/web/i/user/fake/head_fake25.jpg
4.96 KB
app-wx/web/i/user/fake/head_fake26.jpg
8.99 KB
app-wx/web/i/user/fake/head_fake27.jpg
7.75 KB
app-wx/web/i/user/fake/head_fake28.jpg
4.95 KB
app-wx/web/i/user/fake/head_fake29.jpg
4.27 KB
app-wx/web/i/user/fake/head_fake3.jpg
6.64 KB
app-wx/web/i/user/fake/head_fake30.jpg
9.86 KB
app-wx/web/i/user/fake/head_fake31.jpg
8.06 KB
app-wx/web/i/user/fake/head_fake32.jpg
5.44 KB
app-wx/web/i/user/fake/head_fake4.jpg
8.92 KB
app-wx/web/i/user/fake/head_fake5.jpg
9.51 KB
app-wx/web/i/user/fake/head_fake6.jpg
4.24 KB
app-wx/web/i/user/fake/head_fake7.jpg
4.48 KB
app-wx/web/i/user/fake/head_fake8.jpg
5.78 KB
app-wx/web/i/user/fake/head_fake9.jpg
9.58 KB
app-wx/web/i/user/header/avatar_1.png
4.9 KB
app-wx/web/i/user/header/avatar_2.png
5.12 KB
app-wx/web/i/user/header/avatar_3.png
4.07 KB
app-wx/web/i/user/header/demo_header.jpg
2.6 KB
app-wx/web/i/user/ic_authed.png
1.96 KB