正在显示
3 个修改的文件
包含
57 行增加
和
7 行删除
@@ -78,9 +78,21 @@ class ActiveController extends WeChatBaseController | @@ -78,9 +78,21 @@ class ActiveController extends WeChatBaseController | ||
78 | $this->assign('list',$data); | 78 | $this->assign('list',$data); |
79 | return $this->fetch('active_detail'); | 79 | return $this->fetch('active_detail'); |
80 | } | 80 | } |
81 | + | ||
81 | public function comment(){ | 82 | public function comment(){ |
82 | $id=$this->request->param('id'); | 83 | $id=$this->request->param('id'); |
83 | - $this->assign('id',$id); | 84 | + $re=Db::name('users')->where(['open_id'=>session('wechat_user')['id']])->find(); |
85 | + if (!$re['mobile']){ | ||
86 | + return 2; | ||
87 | + } | ||
88 | + else { | ||
89 | + return url('portal/active/comment2',array('id'=>$id)); | ||
90 | + } | ||
91 | + } | ||
92 | + | ||
93 | + public function comment2(){ | ||
94 | + $id=$this->request->param('id'); | ||
95 | + $this->assign('id', $id); | ||
84 | return $this->fetch(); | 96 | return $this->fetch(); |
85 | } | 97 | } |
86 | 98 |
@@ -232,11 +232,9 @@ | @@ -232,11 +232,9 @@ | ||
232 | </eq> | 232 | </eq> |
233 | <p class="commentnum">{$list.dolike}</p> | 233 | <p class="commentnum">{$list.dolike}</p> |
234 | </p> | 234 | </p> |
235 | - <a href="{:url('portal/active/comment',array('id'=>$list.id))}" style="text-decoration:none;"> | ||
236 | <p class="comment"> | 235 | <p class="comment"> |
237 | 评论留言 | 236 | 评论留言 |
238 | </p> | 237 | </p> |
239 | - </a> | ||
240 | </div> | 238 | </div> |
241 | </div> | 239 | </div> |
242 | <div class="activedetail"> | 240 | <div class="activedetail"> |
@@ -334,7 +332,7 @@ | @@ -334,7 +332,7 @@ | ||
334 | window.location.reload(); | 332 | window.location.reload(); |
335 | } | 333 | } |
336 | else if (data==3){ | 334 | else if (data==3){ |
337 | - var a=confirm("是否注册") | 335 | + var a=confirm("请先注册") |
338 | if(a==true){ | 336 | if(a==true){ |
339 | window.location.href="{:url('user/register/register')}" | 337 | window.location.href="{:url('user/register/register')}" |
340 | } | 338 | } |
@@ -342,5 +340,26 @@ | @@ -342,5 +340,26 @@ | ||
342 | } | 340 | } |
343 | }) | 341 | }) |
344 | }) | 342 | }) |
343 | + //注册 | ||
344 | + $(".comment").click(function(){ | ||
345 | + $.ajax({ | ||
346 | + url: "{:url('portal/active/comment')}", | ||
347 | + type: "post", | ||
348 | + data: { | ||
349 | + id:"{$list.id}", | ||
350 | + }, | ||
351 | + success: function (data) { | ||
352 | + if (data==1) { | ||
353 | + window.location.href="{:url('portal/active/comment2'}" | ||
354 | + } | ||
355 | + else{ | ||
356 | + var a=confirm("是否注册") | ||
357 | + if(a==true){ | ||
358 | + window.location.href=data | ||
359 | + } | ||
360 | + } | ||
361 | + } | ||
362 | + }) | ||
363 | + }) | ||
345 | </script> | 364 | </script> |
346 | </html> | 365 | </html> |
@@ -248,11 +248,9 @@ | @@ -248,11 +248,9 @@ | ||
248 | </eq> | 248 | </eq> |
249 | <p class="commentnum">{$list.dolike}</p> | 249 | <p class="commentnum">{$list.dolike}</p> |
250 | </p> | 250 | </p> |
251 | - <a href="{:url('portal/brand/comment',array('id'=>$list.id))}" style="text-decoration:none;"> | ||
252 | <p class="comment"> | 251 | <p class="comment"> |
253 | 评论留言 | 252 | 评论留言 |
254 | </p> | 253 | </p> |
255 | - </a> | ||
256 | </div> | 254 | </div> |
257 | </div> | 255 | </div> |
258 | </div> | 256 | </div> |
@@ -339,7 +337,7 @@ | @@ -339,7 +337,7 @@ | ||
339 | window.location.reload(); | 337 | window.location.reload(); |
340 | } | 338 | } |
341 | else if (data==3){ | 339 | else if (data==3){ |
342 | - var a=confirm("是否注册") | 340 | + var a=confirm("请先注册") |
343 | if(a==true){ | 341 | if(a==true){ |
344 | window.location.href="{:url('user/register/register')}" | 342 | window.location.href="{:url('user/register/register')}" |
345 | } | 343 | } |
@@ -349,6 +347,27 @@ | @@ -349,6 +347,27 @@ | ||
349 | } | 347 | } |
350 | }) | 348 | }) |
351 | }) | 349 | }) |
350 | + //注册 | ||
351 | + $(".comment").click(function(){ | ||
352 | + $.ajax({ | ||
353 | + url: "{:url('portal/brand/comment')}", | ||
354 | + type: "post", | ||
355 | + data: { | ||
356 | + id:"{$list.id}", | ||
357 | + }, | ||
358 | + success: function (data) { | ||
359 | + if (data==1) { | ||
360 | + window.location.href="{:url('portal/brand/comment2'}" | ||
361 | + } | ||
362 | + else { | ||
363 | + var a=confirm("是否注册") | ||
364 | + if(a==true){ | ||
365 | + window.location.href=data | ||
366 | + } | ||
367 | + } | ||
368 | + } | ||
369 | + }) | ||
370 | + }) | ||
352 | </script> | 371 | </script> |
353 | </body> | 372 | </body> |
354 | </html> | 373 | </html> |
-
请 注册 或 登录 后发表评论