From 4285a63fecd1ea0c6cddc360706136f8d4e75e3d Mon Sep 17 00:00:00 2001 From: laurieryayoi <14360417+laurieryayoi@users.noreply.github.com> Date: Tue, 22 Jan 2019 02:57:26 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=82=80=E8=AF=B7=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controllers/VueController.php | 19 ++++++++++ config/routes.php | 1 + public/theme/material/css/index.css | 27 ++++++++++++++ resources/views/material/index.tpl | 58 +++++++++++++++++++++++++++-- 4 files changed, 101 insertions(+), 4 deletions(-) diff --git a/app/Controllers/VueController.php b/app/Controllers/VueController.php index c7dc7638..8b09a518 100644 --- a/app/Controllers/VueController.php +++ b/app/Controllers/VueController.php @@ -208,4 +208,23 @@ class VueController extends BaseController { return $response->getBody()->write(json_encode($res)); } + public function getNewInviteCode($request, $response, $args) + { + $user = $this->user; + $user->clear_inviteCodes(); + $code = InviteCode::where('user_id', $this->user->id)->first(); + if ($code == null) { + $this->user->addInviteCode(); + $code = InviteCode::where('user_id', $this->user->id)->first(); + } + + $res['arr'] = array( + "code" => $code, + ); + + $res['ret'] = 1; + + return $response->getBody()->write(json_encode($res)); + } + } \ No newline at end of file diff --git a/config/routes.php b/config/routes.php index baf1cd5c..beb4d884 100755 --- a/config/routes.php +++ b/config/routes.php @@ -377,6 +377,7 @@ $app->get('/getuserinviteinfo', 'App\Controllers\VueController:getUserInviteInfo $app->get('/getusershops', 'App\Controllers\VueController:getUserShops'); $app->get('/getcredit', 'App\Controllers\VueController:getCredit'); $app->get('/getnewsubtoken', 'App\Controllers\VueController:getNewSubToken'); +$app->get('/getnewinvotecode', 'App\Controllers\VueController:getNewInviteCode'); /** * chenPay diff --git a/public/theme/material/css/index.css b/public/theme/material/css/index.css index 396b4758..bae783e5 100755 --- a/public/theme/material/css/index.css +++ b/public/theme/material/css/index.css @@ -549,6 +549,10 @@ select { border-color: #D1335B; } +button.tips { + background-color: transparent; +} + .tips-blue:hover, .tips-gold:hover, .tips-green:hover, @@ -629,6 +633,25 @@ select { font-size: 14px; } +.invite-tools { + position: relative; + margin-left: .75rem; +} +.invite-tools .tips.tips-red { + position: relative; + top: 2px; +} + +.invite-tools.tips-green { + padding: 3.5px .7rem; + bottom: 1px; + margin-left: .55rem; +} + +.invite-link { + width: 100%; +} + .list-shop { padding: .5rem; font-size: 1.2rem; @@ -781,6 +804,10 @@ button[name=reset] { .link-reset .uim-tooltip-top { width: 230px; } + + .invite-link { + width: 450px; + } } @media screen and (min-width:48em) { diff --git a/resources/views/material/index.tpl b/resources/views/material/index.tpl index 94a29ca9..e52b9e76 100755 --- a/resources/views/material/index.tpl +++ b/resources/views/material/index.tpl @@ -1078,12 +1078,37 @@ const UserInvite = { mixins: [userMixin,storeMap], template: /*html*/ `
VIP等级
Lv. $[userCon.class]$
余额
-$[userCon.money]$
+$[userCon.money]$