Skip to content

Commit 4c58c4e

Browse files
author
hooray
committed
删除应用评分
1 parent 7a29f4d commit 4c58c4e

15 files changed

Lines changed: 1 addition & 204 deletions

‎ajax.php‎

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -618,33 +618,5 @@
618618
]);
619619
echo json_encode(['status' => true]);
620620
break;
621-
//获取应用评分
622-
case 'getAppStar':
623-
$starnum = $db->get('tb_app', 'starnum', ['tbid' => $_POST['id']]);
624-
$cb['starnum'] = is_int($starnum) || $starnum == 0 ? (int)$starnum : sprintf('%.1f', $starnum);
625-
echo json_encode($cb);
626-
break;
627-
//更新应用评分
628-
case 'updateAppStar':
629-
if(!$db->has('tb_app_star', [
630-
'AND' => [
631-
'app_id' => $_POST['id'],
632-
'member_id' => session('member_id')
633-
]
634-
])){
635-
$db->insert('tb_app_star', [
636-
'app_id' => $_POST['id'],
637-
'starnum' => $_POST['starnum'],
638-
'dt' => date('Y-m-d H:i:s'),
639-
'member_id' => session('member_id')
640-
]);
641-
$starnumavg = $db->avg('tb_app_star', 'starnum', ['app_id' => $_POST['id']]);
642-
$db->update('tb_app', ['starnum' => $starnumavg], ['tbid' => $_POST['id']]);
643-
$cb['response'] = true;
644-
}else{
645-
$cb['response'] = false;
646-
}
647-
echo json_encode($cb);
648-
break;
649621
}
650622
?>

‎static/css/index.css‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎static/img/app_spr_img.png‎

-14 KB
Binary file not shown.

‎static/img/desktop-s08b7bfed4c.png‎

-56.5 KB
Binary file not shown.

‎static/img/desktop-sec2ca82f51.png‎

56.7 KB
Loading

‎static/img/desktop/widget-star.png‎

-1.47 KB
Binary file not shown.
-1.53 KB
Binary file not shown.

‎static/js/hros.app.js‎

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -43,42 +43,6 @@ HROS.app = (function(){
4343
}
4444
return false;
4545
});
46-
//应用窗口上的评分、分享按钮事件
47-
$('body').on('click', '#star ul li', function(){
48-
var num = $(this).attr('num');
49-
if(!isNaN(num) && /^[1-5]$/.test(num)){
50-
if(HROS.base.checkLogin()){
51-
$.ajax({
52-
data: {
53-
ac: 'updateAppStar',
54-
id: $('#star').attr('realappid'),
55-
starnum: num
56-
}
57-
}).done(function(responseText){
58-
dialog.get('star').close().remove();
59-
if(responseText['response']){
60-
swal({
61-
type: 'success',
62-
title: '打分成功',
63-
timer: 2000,
64-
showConfirmButton: false
65-
});
66-
}else{
67-
swal({
68-
type: 'warning',
69-
title: '你已经打过分了',
70-
timer: 2000,
71-
showConfirmButton: false
72-
});
73-
}
74-
});
75-
}else{
76-
HROS.base.login();
77-
}
78-
}
79-
}).on('click', '#share a', function(){
80-
dialog.get('share').close().remove();
81-
});
8246
//获取桌面应用数据
8347
HROS.app.get();
8448
},

‎static/js/hros.widget.js‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -297,26 +297,6 @@ HROS.widget = (function(){
297297
$('#desk').on('click', '.widget .ha-close', function(e){
298298
var obj = $(this).parents('.widget');
299299
HROS.widget.close(obj.attr('appid'));
300-
}).on('click', '.widget .ha-star', function(){
301-
var obj = $(this).parents('.widget');
302-
$.ajax({
303-
data: {
304-
ac: 'getAppStar',
305-
id: obj.data('info').realappid
306-
}
307-
}).done(function(starnum){
308-
starnum = starnum['starnum'];
309-
dialog({
310-
title: '给“' + obj.data('info').title + '”打分',
311-
padding: '10px 40px 15px 40px',
312-
id: 'star',
313-
content: HROS.template.starDialog({
314-
'realappid': obj.data('info').realappid,
315-
'point': Math.floor(starnum),
316-
'realpoint': starnum * 20
317-
})
318-
}).showModal();
319-
});
320300
});
321301
}
322302
}

‎static/js/hros.window.js‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -715,26 +715,6 @@ HROS.window = (function(){
715715
showConfirmButton: false
716716
});
717717
}
718-
}).on('click', '.window-container .star', function(){
719-
var obj = $(this).parents('.window-container');
720-
$.ajax({
721-
data: {
722-
ac: 'getAppStar',
723-
id: obj.data('info').realappid
724-
}
725-
}).done(function(starnum){
726-
starnum = starnum['starnum'];
727-
dialog({
728-
title: '给“' + obj.data('info').title + '”打分',
729-
padding: '10px 40px 15px 40px',
730-
id: 'star',
731-
content: HROS.template.starDialog({
732-
'realappid': obj.data('info').realappid,
733-
'point': Math.floor(starnum),
734-
'realpoint': starnum * 20
735-
})
736-
}).showModal();
737-
});
738718
}).on('contextmenu', '.window-container', function(){
739719
$('.popup-menu').hide();
740720
$('.quick_view_container').remove();

0 commit comments

Comments
 (0)