Greasy Fork is available in English.
淘宝卖家自动评价助手
当前为
// ==UserScript==
// @author alpha
// @name 淘宝卖家评价助手
// @description 淘宝卖家自动评价助手
// @include *//trade.taobao.com/trade/itemlist/list_sold_items.htm?action=itemlist/SoldQueryAction&event_submit_do_query=1&*
// @include *//rate.taobao.com/remarkBuyer.jhtml*
// @include *//rate.taobao.com/remarkBuyer.htm
// @version 0.2
// @grant none
// @namespace http://tampermonkey.net/
// ==/UserScript==
window.onload =function(){
if(location.pathname == '/trade/itemlist/list_sold_items.htm'){
setTimeout(function(){}, 2600);
getRateHref();
}else if(location.pathname == '/remarkBuyer.jhtml'){
setTimeout(function(){}, 1000);
autorate();
}else if(location.pathname == '/remarkBuyer.htm'){
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';
}
}
//获取第一个待评价的链接
function getRateHref(){
var listrate = document.querySelectorAll('a');
for (var i=0; i<listrate.length; i++){
if(listrate[i].text == '评价'){
location.href = listrate[i].href;
}
}
}
// 进入评价页面自动评价
function autorate(){
//提取商品id
var localhref = location.href;
var id = /\d{10,20}/g.exec(localhref);
id = '#rate-good-' + id[0];
// 选中好评
document.querySelector('#rate-good-all').checked=true;
document.querySelector(id).checked=true;
// 设置评价内容
var comment = '感谢您的光临,希望您每天都有一个好心情 ^_^ ^_^'
document.querySelector('textarea').value = comment;
// 提交
document.querySelectorAll('button')[2].click();
}