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*/ `
-
邀请链接
+
+
邀请链接
+ + + +
- -
邀请链接剩余次数: $[userCon.invite_num]$次
+
+ + + + + +
+ 确定要重置邀请链接? +
+ + +
+
+
+
+
+
+
邀请链接剩余次数: $[userCon.invite_num]$次

$[userCon.user_name]$,您不是VIP暂时无法使用邀请链接,

@@ -1100,12 +1125,37 @@ const UserInvite = { data: function() { return { code: '', + invitePrice: '', + inviteResetConfirm: false, } }, + methods: { + showInviteReset() { + this.inviteResetConfirm = true; + }, + hideInviteReset() { + this.inviteResetConfirm = false; + }, + resetInviteLink() { + _get('/getnewinvotecode','include').then((r)=>{ + console.log(r); + this.code = r.arr.code.code; + this.hideInviteReset(); + let callConfig = { + msg: '已重置您的邀请链接,复制您的邀请链接发送给其他人!', + icon: 'fa-bell', + time: 1500, + } + tmp.dispatch('CALL_MSGR',callConfig); + }); + }, + }, mounted() { _get('getuserinviteinfo','include').then((r)=>{ console.log(r); this.code = r.inviteInfo.code.code; + this.invitePrice = r.inviteInfo.invitePrice; + console.log(this.invitePrice); console.log(this.userCon); }); } @@ -1366,7 +1416,7 @@ const Panel = {
-
+
订阅链接