淘宝卖家评价助手

淘宝卖家自动评价助手

  1. // ==UserScript==
  2. // @author alpha
  3. // @name 淘宝卖家评价助手
  4. // @description 淘宝卖家自动评价助手
  5. // @include *//trade.taobao.com/trade/itemlist/list_sold_items.htm?action=itemlist/SoldQueryAction&event_submit_do_query=1&*
  6. // @include *//rate.taobao.com/remarkBuyer.jhtml*
  7. // @include *//rate.taobao.com/remarkBuyer.htm
  8. // @version 0.5
  9. // @grant none
  10. // @namespace http://tampermonkey.net/
  11. // ==/UserScript==
  12.  
  13. // 页面载入后开始提交
  14. window.onload =function(){
  15. if(location.pathname == '/trade/itemlist/list_sold_items.htm'){
  16. sleep(2600);
  17. getRateHref();
  18. }else if(location.pathname == '/remarkBuyer.jhtml'){
  19. sleep(1000)
  20. autorate()
  21. }else if(location.pathname == '/remarkBuyer.htm'){
  22. sleep(1000)
  23. location.href = 'https://trade.taobao.com/trade/itemlist/list_sold_items.htm?action=itemlist/SoldQueryAction&event_submit_do_query=1&commentStatus=I_HAS_NOT_COMMENT&tabCode=waitRate';
  24. }
  25. }
  26.  
  27. //获取第一个待评价的链接
  28. function getRateHref(){
  29. var listrate = document.querySelectorAll('a');
  30. for (var i=0; i<listrate.length; i++){
  31. if(listrate[i].text == '评价'){
  32. location.href = listrate[i].href;
  33. break;
  34. }
  35. }
  36. }
  37.  
  38. // 进入评价页面自动评价
  39. function autorate(){
  40. //提取商品id
  41. var localhref = location.href;
  42. var id = /\d{10,20}/g.exec(localhref);
  43. id = '#rate-good-' + id[0];
  44. //检测是否允许评价
  45. if (document.querySelector('h4')){
  46. if(document.querySelector('h4').textContent.search('抱歉') != -1){
  47. location.href = 'https://trade.taobao.com/trade/itemlist/list_sold_items.htm?action=itemlist/SoldQueryAction&event_submit_do_query=1&commentStatus=I_HAS_NOT_COMMENT&tabCode=waitRate';
  48. }
  49. }else {
  50. // 选中好评
  51. document.querySelector('#rate-good-all').checked=true;
  52. document.querySelector(id).checked=true;
  53. // 设置评价内容
  54. var comment = '感谢您的光临,希望您每天都有一个好心情 ^_^ ^_^'
  55. document.querySelector('textarea').value = comment;
  56. // 提交
  57. document.querySelectorAll('button')[2].click();
  58. }
  59. }
  60.  
  61. // 暂缓刷新页面
  62. function sleep(delay) {
  63. var start = (new Date()).getTime();
  64. while ((new Date()).getTime() - start < delay) {
  65. continue;
  66. }
  67. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址