diff --git a/app/Controllers/UserController.php b/app/Controllers/UserController.php index b49906c3..4c3155c9 100755 --- a/app/Controllers/UserController.php +++ b/app/Controllers/UserController.php @@ -887,6 +887,7 @@ class UserController extends BaseController $user->invite_num += $num; $user->money -= $amount; $user->save(); + $res['invite_num'] = $user->invite_num; $res['ret'] = 1; $res['msg'] = "邀请次数添加成功"; return $response->getBody()->write(json_encode($res)); diff --git a/app/Controllers/VueController.php b/app/Controllers/VueController.php index c7dc7638..018ed6a6 100644 --- a/app/Controllers/VueController.php +++ b/app/Controllers/VueController.php @@ -162,6 +162,7 @@ class VueController extends BaseController { "paybacks" => $paybacks, "paybacks_sum" => $paybacks_sum, "invitePrice" => Config::get('invite_price'), + "customPrice" => Config::get('custom_invite_price'), ); $res['ret'] = 1; @@ -208,4 +209,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 90fa9458..5123402d 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..8990a4ef 100755 --- a/public/theme/material/css/index.css +++ b/public/theme/material/css/index.css @@ -53,6 +53,10 @@ a { text-align: right; } +.text-red { + color: #D1335B; +} + .margin-nobottom { margin-bottom: 0 !important; } @@ -230,7 +234,8 @@ button.btn-user.index-btn-active { input.checkbox, .buy-submit, .font-light, -.list-shop { +.list-shop, +.user-config { transition: all .3s; } @@ -280,15 +285,18 @@ input.checkbox, } .auth-submit:hover, -.auth-submit:focus, { +.auth-submit:focus, + { background-color: #d6d6d6; border-color: #d6d6d6; } -.buy-submit:disabled { +.buy-submit:disabled, +button.tips:disabled { color: #858585; border-color: #858585; cursor: not-allowed; + background-color: transparent; } .auth, @@ -534,6 +542,11 @@ select { border-color: #faad14; } +.tips-gold-trans.tips-gold { + color: white; + background-color: #faad14; +} + .tips-green { color: #52c41a; border-color: #52c41a; @@ -549,6 +562,14 @@ select { border-color: #D1335B; } +.font-red-trans { + color: #D1335B; +} + +button.tips { + background-color: transparent; +} + .tips-blue:hover, .tips-gold:hover, .tips-green:hover, @@ -629,6 +650,38 @@ select { font-size: 14px; } +.invite-tools { + position: relative; + margin-left: .75rem; +} + +.invite-tools .tips.tips-red { + position: relative; + top: 1px; +} + +.invite-tools.tips-green { + padding: 3.5px .7rem; + bottom: 1px; + margin-left: .55rem; +} + +.invite-link { + width: 100%; +} + +.user-invite-title .uim-tooltip { + width: 100%; +} + +.user-invite-title .uim-tooltip button { + border: 0; +} + +.user-invite-title .tips { + position: relative; +} + .list-shop { padding: .5rem; font-size: 1.2rem; @@ -641,7 +694,7 @@ select { } .list-shop:hover { - transform: translate3D(1rem,0,0); + transform: translate3D(1rem, 0, 0); } .coupon-checker { @@ -704,7 +757,8 @@ button[name=reset] { word-break: break-all; } -.sublink-reset.tips-blue { +.sublink-reset.tips-blue, +.invite-reset.tips-blue { background-color: #1997c6; color: white; } @@ -781,6 +835,15 @@ button[name=reset] { .link-reset .uim-tooltip-top { width: 230px; } + + .invite-link { + width: 450px; + } + + .user-invite-title .tips { + margin-bottom: .5rem; + margin-left: .75rem; + } } @media screen and (min-width:48em) { @@ -1067,7 +1130,7 @@ button.uim-modal-confirm { /* switch */ -.uim-switch-body { +.uim-switch-body { background-color: #ccc; border-radius: 25px; cursor: pointer; diff --git a/resources/views/material/index.tpl b/resources/views/material/index.tpl index 94a29ca9..e842bae4 100755 --- a/resources/views/material/index.tpl +++ b/resources/views/material/index.tpl @@ -224,7 +224,10 @@ const UserTmp = { }, SET_USERMONEY (state,number) { state.userCon.money = number; - } + }, + SET_INVITE_NUM (state,number) { + state.userCon.invite_num = number; + }, }, actions: { @@ -1078,12 +1081,69 @@ const UserInvite = { mixins: [userMixin,storeMap], template: /*html*/ `
VIP等级
Lv. $[userCon.class]$
余额
-$[userCon.money]$
+$[userCon.money]$